mesa: Consider gl_VertexID and gl_InstanceID active attribs
authorChris Forbes <chrisf@ijw.co.nz>
Sat, 12 Apr 2014 09:20:43 +0000 (21:20 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Sun, 13 Apr 2014 07:27:01 +0000 (19:27 +1200)
Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/shader_query.cpp

index 1c3c8e9a4db05984840f87543e2d2681765283e2..f66c117338c8b441ed7d16ff704a0c5c023bb5c8 100644 (file)
@@ -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;
    }