Jump to content
  • Advertisement
Sign in to follow this  
reoxthen

[SOLVED] glUniform crash with samplers

This topic is 3352 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!