Uniform name hasAlpha verboten? (nVidia)

Anyone noticed that a float uniform named “hasAlpha” will always be filled with the value 1.0? Happens on some NV hardware/drivers. Everything works fine when I pick another name.

I’m guessing it is a sloppy driver-side bugfix for some game.

… or maybe it is a built-in name used internally by the NVIDIA driver.

Either way, it looks like a driver bug.

Oops, looks like it was a false alarm.

After some code changes my bug was inexplicably fixed. It may have to do with dynamic branching and the driver optimizing some stuff away, causing sampler/uniform locations to shift around. I still don’t know in what way the uniform name could influence such though. Maybe the driver internally alphabetically sorts uniform names for fast glGetUniformLocation lookup (I had replaced “hasAlpha” with “hasXlpha” as workaround) or some other optimization.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.