We're seing weird return values from glUniformLocation on Intel hardware. All returned values are greater than 0x10000, leading me to believe it is a byte order failure somewhere. I tried taking the returned value and shift it down 16 bits, but no luck. The returned size is also wrong, always the same as type (which is returned correctly, GL_FLOAT_VEC4)
final int numUniform = glGetProgrami(programObject, GL_ACTIVE_UNIFORMS);
for (int iu = 0; iu < numUniform; ++iu)
{
String uniformName = glGetActiveUniform(programObject, iu, 128);
if (uniformName == null || uniformName.length() <= 0)
continue;
if (uniformName.startsWith("gl_"))
continue; //Built-in
int location = glGetUniformLocation(programObject, uniformName);
if (location < 0)
continue;
if (location > 0x10000)
{
System.out.println("Uniform failed sanity check: " + uniformName + " has location " + location);
continue;
}
int gltype = glGetActiveUniformType(programObject, iu);
int glsize = glGetActiveUniformSize(programObject, iu);
//...rest of code...
}