From: Eric Anholt Date: Mon, 25 Jun 2012 17:10:26 +0000 (-0700) Subject: mesa: Return -1 for glGetUniformLocation on UBOs. X-Git-Tag: accepted/2.0alpha-wayland/20121114.171706~880 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa08b8ad549ef0ad0ee46f525f6f5dd0d6332f99;p=profile%2Fivi%2Fmesa.git mesa: Return -1 for glGetUniformLocation on UBOs. Fixes piglit ARB_uniform_buffer_object/getuniformlocation. Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index b5aaa1b..f43d0fb 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -522,6 +522,16 @@ _mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name) if (index == GL_INVALID_INDEX) return -1; + /* From the GL_ARB_uniform_buffer_object spec: + * + * "The value -1 will be returned if does not correspond to an + * active uniform variable name in , if is associated + * with a named uniform block, or if starts with the reserved + * prefix "gl_"." + */ + if (shProg->UniformStorage[index].block_index != -1) + return -1; + return _mesa_uniform_merge_location_offset(index, offset); }