Jump to content
  • Advertisement
Sign in to follow this  
exolon

glUniform1f() in Linux does not work - solved

This topic is 2562 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

This is just to inform people about an easy solution to a bug which, judging by some googling, has been around since 2007 :/

When using glUniform1f() to set a float value on a uniform in a GLSL shader in Linux (Ubuntu 10.10), you get random values set. This has nothing to do with the driver per se, I got exactly the same behaviour under Mesa OGL on Intel as on the nvidia proprietary driver. It also works if you use GLEW to remap the calls.. so it is probably some header-file somewhere which is incorrectly defining or wrapping the glUniform* family of calls.

In either case, simply using glUniformfv() instead with a count of 1 and a pointer to the float variable you want to set, solves the problem.

Hope this helps someone else (I spent some hours searching for this bug :)

Share this post


Link to post
Share on other sites
Advertisement
How sure are you about this?

I ask only because... I'm using exactly that function call on Ubuntu 10.10 and 10.04 on NV drivers and it's working fine....

Share this post


Link to post
Share on other sites
I heard about this issue some time ago, but it seemed to be a random quirk happening only on very few systems. glUniform1f is a very commonly used function, a major malfunction would have been noticed and fixed by now. I was never able to reproduce it.

It's probably a bug somewhere in Mesa (which, considering the abysmal quality of Mesa in general, isn't in the least surprising) that only manifests itself under certain specific build configurations.

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!