diff options
author | Brian Paul <[email protected]> | 2011-10-13 08:35:19 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-10-13 08:35:19 -0600 |
commit | a9e5528f09a835b66771ba4d3f08ff7fd51e08a6 (patch) | |
tree | 4b517112eb36131b46a7b2af2f59589c02dc0502 /src/mesa/state_tracker | |
parent | e06277bd886a9a79f0bf9b175ec26fbe187689c2 (diff) |
st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()
This fixes a bug where we'd wind up emitting an invalid instruction like
MOVE R[0]., R[1]; - note the empty/zero writemask. If we don't write to
any dest register channels, cull the instruction.
v2: simply change/fix the existing test for instruction culling.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index fe65ae53941..9cc56872536 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3772,7 +3772,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void) if (!inst->dead_mask || !inst->dst.writemask) continue; - else if (inst->dead_mask == inst->dst.writemask) { + else if ((inst->dst.writemask & ~inst->dead_mask) == 0) { iter.remove(); delete inst; removed++; |