Fixes piglit ARB_uniform_buffer_object/getuniformlocation.
---
src/mesa/main/uniforms.c | 10 ++++++++++
1 file changed, 10 insertions(+)
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 <name> does not correspond to an
+ * active uniform variable name in <program>, if <name> is associated
+ * with a named uniform block, or if <name> starts with the reserved
+ * prefix "gl_"."
+ */
+ if (shProg->UniformStorage[index].block_index != -1)
+ return -1;
+
return _mesa_uniform_merge_location_offset(index, offset);
}
--
1.7.10.4
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev