diff options
author | Brian Paul <[email protected]> | 2008-07-04 09:58:14 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-07-04 10:02:43 -0600 |
commit | 294b061256220960e7e29fbc8ecbd2ffce75de40 (patch) | |
tree | f2d68e42cb5cadcca70fdcbcfdcdd547fb15ada3 /src/mesa/shader/shader_api.c | |
parent | c4b6941e62f5e30a7c479b7b8d6521cc4dd92e3e (diff) |
mesa: generate GL_INVALID_OPERATION in _mesa_get_uniform_location() if program isn't linked
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r-- | src/mesa/shader/shader_api.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 3e28d92fe18..182de37b50d 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. */ |