glsl: add new variable declaration in function body in lower_output_read
authorVincent Lejeune <vljn@ovi.com>
Fri, 23 Nov 2012 16:53:06 +0000 (17:53 +0100)
committerVincent Lejeune <vljn@ovi.com>
Wed, 5 Dec 2012 17:23:42 +0000 (18:23 +0100)
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
src/glsl/lower_output_reads.cpp

index 90d71b04a1f3cde6c5bcb972f278419f178bdf23..a6192a517075051315ea1579ded1fc4b4e8f4ac2 100644 (file)
@@ -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 */