mesa: generate GL_INVALID_OPERATION in _mesa_get_uniform_location() if program isn't linked

This commit is contained in:
Brian Paul 2008-07-04 09:58:14 -06:00
parent c4b6941e62
commit 294b061256

View file

@ -1011,6 +1011,11 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name)
if (!shProg)
return -1;
if (shProg->LinkStatus == GL_FALSE) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
return -1;
}
/* XXX we should return -1 if the uniform was declared, but not
* actually used.
*/