[Mesa-stable] [PATCH 3/3] glsl: create program resource list after LinkShader

Tapani Pälli tapani.palli at intel.com
Tue Sep 1 22:03:37 PDT 2015


Resource list can be created properly  only after LinkShader hook
has been called to make sure all dead variables have been removed.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Martin Peres <martin.peres at linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90925
---
 src/glsl/linker.cpp             | 4 ----
 src/mesa/program/ir_to_mesa.cpp | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 5ce28c7..c218758 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -3235,10 +3235,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
       }
    }
 
-   build_program_resource_list(ctx, prog);
-   if (!prog->LinkStatus)
-      goto done;
-
    /* FINISHME: Assign fragment shader output locations. */
 
 done:
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 3dcb537..7382054 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2963,6 +2963,8 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
    if (prog->LinkStatus) {
       if (!ctx->Driver.LinkShader(ctx, prog)) {
 	 prog->LinkStatus = GL_FALSE;
+      } else {
+         build_program_resource_list(ctx, prog);
       }
    }
 
-- 
2.1.0



More information about the mesa-stable mailing list