[Mesa-dev] [PATCH] glsl: add new variable declaration in function body in lower_output_read

Kenneth Graunke kenneth at whitecape.org
Tue Dec 4 17:44:30 PST 2012


On 11/27/2012 02:09 PM, Vincent Lejeune wrote:
> ---
>   src/glsl/lower_output_reads.cpp | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/glsl/lower_output_reads.cpp b/src/glsl/lower_output_reads.cpp
> index 90d71b0..a6192a5 100644
> --- a/src/glsl/lower_output_reads.cpp
> +++ b/src/glsl/lower_output_reads.cpp
> @@ -97,6 +97,7 @@ output_read_remover::visit(ir_dereference_variable *ir)
>         temp = new(var_ctx) ir_variable(ir->var->type, ir->var->name,
>                                         ir_var_temporary);
>         hash_table_insert(replacements, temp, ir->var);
> +      ir->var->insert_after(temp);
>      }
>
>      /* Update the dereference to use the temporary */

Yeah, that looks necessary.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list