diff options
author | Bryan Cain <[email protected]> | 2011-06-24 23:17:30 -0500 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2011-08-01 17:59:09 -0500 |
commit | 71cbc9e3c4c9ef6090ee31e87601ae64af26321e (patch) | |
tree | 639ff76fa57e770cdce6568378cfbd8f4598be68 /src | |
parent | 3bd06e5b82b438041f50e2469be9ea68bf3b4300 (diff) |
glsl_to_tgsi: improve eliminate_dead_code_advanced()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 13573fc1b94..15a1a3c51c4 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3379,6 +3379,15 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void) } } + /* Anything still in the write array at this point is dead code. */ + for (int r = 0; r < this->next_temp; r++) { + for (int c = 0; c < 4; c++) { + glsl_to_tgsi_instruction *inst = writes[4 * r + c]; + if (inst) + inst->dead_mask |= (1 << c); + } + } + /* Now actually remove the instructions that are completely dead and update * the writemask of other instructions with dead channels. */ |