Copy propagate is not applied in function parameters when they are out or inout.
But if the parameter is an array, we can copy propagate the index array. This also fixes several shaders@out-parameter-indexing piglit tests, that exposes a wrong handling of inout function parameters in Mesa. This commit does not produce any piglit regression, nor any change in shader-db results. --- src/compiler/glsl/opt_copy_propagation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler/glsl/opt_copy_propagation.cpp b/src/compiler/glsl/opt_copy_propagation.cpp index ae62921..141dfeb 100644 --- a/src/compiler/glsl/opt_copy_propagation.cpp +++ b/src/compiler/glsl/opt_copy_propagation.cpp @@ -193,6 +193,12 @@ ir_copy_propagation_visitor::visit_enter(ir_call *ir) if (sig_param->data.mode != ir_var_function_out && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); + } else { + /* If parameter is an array, we can copy propagate the index */ + ir_dereference_array *ir_array = ir->as_dereference_array(); + if (ir_array) { + ir_array->array_index->accept(this); + } } } -- 2.5.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev