[Mesa-dev] [PATCH] glsl: remove stage ref generation for transform feedback

Timothy Arceri t_arceri at yahoo.com.au
Wed Aug 5 06:13:41 PDT 2015


Stage ref cannot be queried for transform feedback.

Also simplify the build_stageref function by passing the
correct mode for uniforms.

Cc: Tapani Pälli <tapani.palli at intel.com>
---
 No piglit regressions, no program_interface_query CTS regressions.

 src/glsl/linker.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 8188a2f..3a56fa3 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -3137,7 +3137,7 @@ build_stageref(struct gl_shader_program *shProg, const char *name,
             /* Type needs to match if specified, otherwise we might
              * pick a variable with same name but different interface.
              */
-            if (mode != 0 && var->data.mode != mode)
+            if (var->data.mode != mode)
                continue;
 
             if (strncmp(var->name, name, baselen) == 0) {
@@ -3249,12 +3249,9 @@ build_program_resource_list(struct gl_context *ctx,
    /* Add transform feedback varyings. */
    if (shProg->LinkedTransformFeedback.NumVarying > 0) {
       for (int i = 0; i < shProg->LinkedTransformFeedback.NumVarying; i++) {
-         uint8_t stageref =
-            build_stageref(shProg,
-                           shProg->LinkedTransformFeedback.Varyings[i].Name, 0);
          if (!add_program_resource(shProg, GL_TRANSFORM_FEEDBACK_VARYING,
                                    &shProg->LinkedTransformFeedback.Varyings[i],
-                                   stageref))
+                                   0))
          return;
       }
    }
@@ -3266,7 +3263,8 @@ build_program_resource_list(struct gl_context *ctx,
          continue;
 
       uint8_t stageref =
-         build_stageref(shProg, shProg->UniformStorage[i].name, 0);
+         build_stageref(shProg, shProg->UniformStorage[i].name,
+                        ir_var_uniform);
 
       /* Add stagereferences for uniforms in a uniform block. */
       int block_index = shProg->UniformStorage[i].block_index;
-- 
2.4.3



More information about the mesa-dev mailing list