From f045b8b2ff5ac75da3e092f482fd1717571d8462 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Mon, 29 Jun 2015 15:23:45 +0300 Subject: [PATCH] glsl: create program resource list after LinkShader MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Martin Peres 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 e0ce00ce5b9..71a45e8db9c 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -3242,10 +3242,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 18e3bc5d5cc..0b2eb122364 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2975,6 +2975,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.30.2