https://bugs.freedesktop.org/show_bug.cgi?id=79783
--- Comment #11 from gregory.hain...@gmail.com --- I ran some piglit tests with a new patch (see below) to only remove deadcode variable that doesn't have a location. Unfortunately it triggers various regression in piglit. 1/ Test spec@glsl-1.10@execution@variable-indexing@fs-temp-array-mat2-col-rd Failed to link: error: fragment shader varying color not written by vertex shader An unused variable still exists on the program but technically the variable isn't read. So maybe the check can be improved. The error appears for glsl <= 120 or as a warning in GLES. Maybe we could use ir_variable_data.used bit, don't know. 2/ Test spec@glsl-1.10@api@getactiveattrib 110 Failing shader: attribute vec4 not_used; void main() { gl_Position = gl_Vertex; } Attribute `not_used' should not be active but is. I think we could optimize the vertex shader input as it is the first stage of the pipeline (until someone add a new stage). However I don't know how to check the current stage on the IR (neither if is possible actually). Or there is maybe a special bits to detect attribute input. diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp index f45bf5d..29cbe52 100644 --- a/src/glsl/opt_dead_code.cpp +++ b/src/glsl/opt_dead_code.cpp @@ -125,6 +125,21 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) } } + if (entry->var->data.mode == ir_var_shader_in && + !entry->var->data.explicit_location) + continue; + entry->var->remove(); progress = true; -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev