aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_ureg.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-11-21 13:11:30 +0000
committerJosé Fonseca <[email protected]>2013-11-22 15:03:36 +0000
commit69049555af0b0a8fe6005cfa5766f15fc91403a0 (patch)
treea1ad4d21be00a94f7a69dc1c9c0e4e34d88d022d /src/gallium/auxiliary/tgsi/tgsi_ureg.c
parent4ade77f625cf3b29dabb6d7c151b7ab649def0d5 (diff)
tgsi: Prevent emission of instructions with empty writemask.
These degenerate instructions can often be emitted by state trackers when the semantics of instructions don't match precisely. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 432ed00c715..f06858ef177 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -1113,6 +1113,10 @@ ureg_insn(struct ureg_program *ureg,
boolean negate = FALSE;
unsigned swizzle[4] = { 0 };
+ if (nr_dst && ureg_dst_is_empty(dst[0])) {
+ return;
+ }
+
saturate = nr_dst ? dst[0].Saturate : FALSE;
predicate = nr_dst ? dst[0].Predicate : FALSE;
if (predicate) {
@@ -1162,6 +1166,10 @@ ureg_tex_insn(struct ureg_program *ureg,
boolean negate = FALSE;
unsigned swizzle[4] = { 0 };
+ if (nr_dst && ureg_dst_is_empty(dst[0])) {
+ return;
+ }
+
saturate = nr_dst ? dst[0].Saturate : FALSE;
predicate = nr_dst ? dst[0].Predicate : FALSE;
if (predicate) {