summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-04 09:58:55 -0600
committerBrian Paul <[email protected]>2008-07-04 10:04:03 -0600
commite06565b103828b276fb10e3c4b2d94b36de05987 (patch)
tree893f2318f2476b28e4b4d6400e13e2b3e0980740 /src
parentb931a0c1d9128b7fb402915089e1fd2496f65349 (diff)
mesa: generate GL_INVALID_OPERATION in _mesa_get_uniform_location() if program isn't linked
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/shader_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 3a067fe3e11..6cfdf57a494 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -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.
*/