Mesa (9.2): i965/vec4: Only zero out unused message components when there are any.
Carl Worth
cworth at kemper.freedesktop.org
Fri Sep 27 23:03:18 UTC 2013
Module: Mesa
Branch: 9.2
Commit: 5461cc1f00dc9a06c94d05b0096e95e14652b013
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5461cc1f00dc9a06c94d05b0096e95e14652b013
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Sep 9 11:11:03 2013 -0700
i965/vec4: Only zero out unused message components when there are any.
Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:
mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };
At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Chris Forbes <chrisf at ijw.co.nz>
Cc: mesa-stable at lists.freedesktop.org
(cherry picked from commit 6c3db2167c64ecf2366862f15f8e2d4a91f1028c)
---
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 55f8b02..55ef2b5 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2403,8 +2403,10 @@ vec4_visitor::visit(ir_texture *ir)
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
coordinate));
}
- emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
- src_reg(0)));
+ if (zero_mask != 0) {
+ emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
+ src_reg(0)));
+ }
/* Load the shadow comparitor */
if (ir->shadow_comparitor && ir->op != ir_txd) {
emit(MOV(dst_reg(MRF, param_base + 1, ir->shadow_comparitor->type,
More information about the mesa-commit
mailing list