From: Bryan Cain Date: Sat, 25 Jun 2011 04:17:30 +0000 (-0500) Subject: glsl_to_tgsi: improve eliminate_dead_code_advanced() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71cbc9e3c4c9ef6090ee31e87601ae64af26321e;p=mesa.git glsl_to_tgsi: improve eliminate_dead_code_advanced() --- 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. */