summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2013-06-12 21:31:19 +0200
committerIan Romanick <ian.d.romanick@intel.com>2014-05-29 15:16:56 -0700
commit7efdc55f5f415969ab1a3fbf5331fb2b0309a5ff (patch)
tree75a06518158eac4d600a4274ee16e91ad7749383 /src/gallium/drivers/nouveau
parent9ea859931ea67eeb8431303c71faa83ac394f2d5 (diff)
nv50/ir/tgsi: optimize KIL
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d479713d25699c168af807ad36068691af11d0e0)
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index e24be519d75..a0f1fe1c87d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2457,7 +2457,12 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
break;
case TGSI_OPCODE_KILL_IF:
val0 = new_LValue(func, FILE_PREDICATE);
+ mask = 0;
for (c = 0; c < 4; ++c) {
+ const int s = tgsi.getSrc(0).getSwizzle(c);
+ if (mask & (1 << s))
+ continue;
+ mask |= 1 << s;
mkCmp(OP_SET, CC_LT, TYPE_F32, val0, TYPE_F32, fetchSrc(0, c), zero);
mkOp(OP_DISCARD, TYPE_NONE, NULL)->setPredicate(CC_P, val0);
}