[Mesa-dev] [PATCH 2/2] mesa: Consider gl_VertexID and gl_InstanceID active attribs

Chris Forbes chrisf at ijw.co.nz
Sat Apr 12 02:20:43 PDT 2014


Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/main/shader_query.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index c6e7342..2be84f2 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -85,6 +85,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;
    }
-- 
1.9.2



More information about the mesa-dev mailing list