glow icon indicating copy to clipboard operation
glow copied to clipboard

get_uniform_location() fails to return the proper location

Open IllusionMan1212 opened this issue 1 year ago • 1 comments

Summary

When calling the get_uniform_location() function in certain situations it returns a None value instead of a Some value.

I have made sure (to the best of my ability as a beginner) that there are no reasons the uniform would be optimized out or otherwise have a typo on either the rust or shader side, as well as making sure to use the shader program before trying to retrieve the location.

Reproduction

I tried to make the repro code as concise as possible here's the link: Repro

Additional Notes

I have also written the same reproduction code using the glad bindings that can be generated on the webservice. This works fine and is able to retrieve the uniform location.

the code can be found here

IllusionMan1212 avatar Apr 26 '23 02:04 IllusionMan1212

I've recently experienced this as well. Not exactly the same but I did observe a mismatch between GL_ACTIVE_UNIFORMS and glGetActiveUniform. It was platform (and maybe browser or driver) specific behavior.

In the end, I just accepted that the uniform wasn't there which is not a particularly useful answer in this context but I wanted to add my voice to this issue. Happy to accept that these are unrelated.

TannerRogalsky avatar Apr 26 '23 11:04 TannerRogalsky