[SOLVED] glUniform crash with samplers
my textures are initialized successfully. checked all with the old pipeline they just work fine. shaders compiled and program linked succesfully. I got the valid uniform locations for the samplers. textures are bound to corresponding tex units.
when I call glUniform1i or glUniform1iv with texture handle, the program raises an access violation.
any idea?
[Edited by - reoxthen on July 21, 2009 1:50:21 PM]
well.. it's ok cuz in the textures are only textures in my test case and they have the handle values same as the tex unit values. but I tried your way too.. still crashes.
[Edited by - reoxthen on July 21, 2009 1:35:57 PM]
[Edited by - reoxthen on July 21, 2009 1:35:57 PM]
Quote:Original post by reoxthen
well.. it's ok cuz in the textures are only textures in my test case and they have the handle values same as the tex unit values. but I tried your way too.. still crashes.
It shouldn't crash in any case, can you post the code ?
I realized it only crashes with glUniform1iv. I set the "count" parameter as 1...
// works fine
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureHandle);
glUniform1i(glGetUniformLocation(programHandle, "mytexture"), 0);
//crashes
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureHandle);
glUniform1iv(glGetUniformLocation(programHandle, "mytexture"), 1, 0);
and the weird thing is, this used to work in another project.
// works fine
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureHandle);
glUniform1i(glGetUniformLocation(programHandle, "mytexture"), 0);
//crashes
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureHandle);
glUniform1iv(glGetUniformLocation(programHandle, "mytexture"), 1, 0);
and the weird thing is, this used to work in another project.
Quote:Original post by reoxthen
I realized it only crashes with glUniform1iv. I set the "count" parameter as 1...
and the weird thing is, this used to work in another project.
I highly doubt it worked for you elsewhere, maybe it just didn't crash out of pure luck. For *v functions the parameter is a pointer to array of values (or to a single value), that is it should be
GLint val = 0;
glUniform1iv(...,1,&val);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement