Current checks rely on the optimization phase to remove deadcode varying. Therefore remaining varying are used.
Deadcode Optimizations won't be possible anymore with the support of GL_ARB_separate_shader_objects. So it requires to check the used flag of the varying. Signed-off-by: Gregory Hainaut <[email protected]> --- src/glsl/link_varyings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index f7a7b8c..72d6632 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -1579,7 +1579,7 @@ assign_varying_locations(struct gl_context *ctx, if (var && var->data.mode == ir_var_shader_in && var->data.is_unmatched_generic_inout) { - if (prog->IsES) { + if (var->data.used && prog->IsES) { /* * On Page 91 (Page 97 of the PDF) of the GLSL ES 1.0 spec: * @@ -1594,7 +1594,7 @@ assign_varying_locations(struct gl_context *ctx, _mesa_shader_stage_to_string(consumer->Stage), var->name, _mesa_shader_stage_to_string(producer->Stage)); - } else if (prog->Version <= 120) { + } else if (var->data.used && prog->Version <= 120) { /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: * * Only those varying variables used (i.e. read) in -- 2.1.4 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
