Intel Reports Active Uniform with 0 Length Name


I’ve recently run into a problem when attempting to load a shader on an Intel GPU. Everything worked on my development machine (which runs a Nvidia GPU), but when I pushed a release to our production machine (running an Intel HD Graphics 630 GPU) the app crashed during the ofShader.Load() function. I tracked the problem down to an issue (that I believe is a bug in the Intel driver) where one of the active uniforms reported a length of 0. In addition, because of a different bug in the Intel driver, this resulted in GL_ACTIVE_UNIFORM_MAX_LENGTH also reporting 0 (even though GL_ACTIVE_UNIFORMS was non-zero).

My solution was to modify the ofShader code to check each active uniform’s length and respond accordingly (ignore any with length 0, and make sure the uniformName vector was large enough to hold the name in case the uniformMaxLength value was also inaccurate). I’m still fairly new to OpenGL so I’m curious to hear if anyone else has encountered this problem, and if there is a better solution than what I have come up with.