multiple jit.gl.shader/jit.gl.slabs and confused textures
hello,
i had a rather shady thing happen last night that i'm not able to recreate. i have a patch with a jit.gl.shader applying shaders to a jit.gl.mesh, and a jit.gl.slab doing some masking/overlaying of textures (both of these patches have been posted previously, but i'm not trying to combine them). each process produces a plane/deformed-plane that i render in the same openGL context. for whatever reason, during one attempt, i ended up with the textures linked to my jit.gl.slab object rendered onto the OTHER plane (i.e. the one created by my jit.gl.mesh object). now, i'm just trying to understand how that could possibly happen the way things are linked up in my world. i basically name everything; my textures (video matrices going into jit.gl.texture), my shaders and all; i then use the 'texture' message to jit.gl.slab or jit.gl.mesh to get access to my textures within glsl. i have unique names for all my textures and i do not mix up what object is being told what texture to use.
on the otherhand, IN my glsl code, i often use the same names for the samplers. i.e., tex0, for the first, tex1 for the second and so on. could THAT possibly be the cause of my mixup?
if one has two shaders active, does the graphics card maintain ONE global variable space by any chance? in which variable names can possibly conflict with one another?
a note: i apologize for not having an example patch that demonstrates this. as i said, i can't reproduce the problem consistently. but it definitely was happening and i spend a good bit of time investigating it while it was happening and then on the next run of the patch, it was gone. i only ask the question in order to possibly learn whether there are some basic principals of which i'm not aware that could contribute to such an effect. if this question is too vague and abstract and thus impossible to answer without a demonstrative path, then please kindly let turn your head and let it slide.
It's definitely not due to names (tex0, etc.) getting mixed up on the
graphics card. Resources are bound to those names when the shader
object is bound on the GPU and stay that way until an OpenGL API call
is made to change things. You can at least eliminate that from your
debugging efforts. If there is leaking of textures, it's going to be
happening in Jitter, not because of the GPU.
wes