summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-06-27 17:40:10 -0500
committerBryan Cain <[email protected]>2011-08-01 17:59:09 -0500
commit9c2810103d107d1e5ef8bd8b57819d12264f664a (patch)
treeb25824984dd4853995752716d141b479915ad008
parent4c8b6a286887628e5fc35306189a4c4a83c482ea (diff)
glsl_to_tgsi: always run copy_propagate() and eliminate_dead_code_advanced()
These two passes are written to handle indirect addressing properly.
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f87c64f62c7..e7d0af83a6b 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4422,18 +4422,17 @@ get_mesa_program(struct gl_context *ctx,
if (target == GL_VERTEX_PROGRAM_ARB)
v->remove_output_reads(PROGRAM_VARYING);
- /* Perform the simplify_cmp optimization, which is required by r300g. */
+ /* Perform optimizations on the instructions in the glsl_to_tgsi_visitor. */
v->simplify_cmp();
+ v->copy_propagate();
+ while (v->eliminate_dead_code_advanced());
- /* Perform optimizations on the instructions in the glsl_to_tgsi_visitor.
- * FIXME: These passes to optimize temporary registers don't work when there
+ /* FIXME: These passes to optimize temporary registers don't work when there
* is indirect addressing of the temporary register space. We need proper
* array support so that we don't have to give up these passes in every
* shader that uses arrays.
*/
if (!v->indirect_addr_temps) {
- v->copy_propagate();
- while (v->eliminate_dead_code_advanced());
v->eliminate_dead_code();
v->merge_registers();
v->renumber_registers();