summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/shader_query.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 8182d3dcc04..84cbfbcd4af 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -808,6 +808,14 @@ program_resource_location(struct gl_shader_program *shProg,
if (RESOURCE_UNI(res)->builtin)
return -1;
+ /* From page 79 of the OpenGL 4.2 spec:
+ *
+ * "A valid name cannot be a structure, an array of structures, or any
+ * portion of a single vector or a matrix."
+ */
+ if (RESOURCE_UNI(res)->type->without_array()->is_record())
+ return -1;
+
/* From the GL_ARB_uniform_buffer_object spec:
*
* "The value -1 will be returned if <name> does not correspond to an