summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-04-12 21:20:43 +1200
committerChris Forbes <[email protected]>2014-04-13 19:27:01 +1200
commit936dda08ee6d7b2be2b016bc06780e401088ec13 (patch)
tree756611dc3a63f5006d818849b2e1f557ccf31af4 /src/mesa/main
parentca5c8d6cd435948af7ea0c70118e4d3e5ee66a32 (diff)
mesa: Consider gl_VertexID and gl_InstanceID active attribs
Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/shader_query.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 1c3c8e9a4db..f66c117338c 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -86,6 +86,15 @@ is_active_attrib(const ir_variable *var)
case ir_var_shader_in:
return var->data.location != -1;
+ case ir_var_system_value:
+ /* From GL 4.3 core spec, section 11.1.1 (Vertex Attributes):
+ * "For GetActiveAttrib, all active vertex shader input variables
+ * are enumerated, including the special built-in inputs gl_VertexID
+ * and gl_InstanceID."
+ */
+ return !strcmp(var->name, "gl_VertexID") ||
+ !strcmp(var->name, "gl_InstanceID");
+
default:
return false;
}