summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-04-27 18:49:59 -0700
committerEric Anholt <[email protected]>2016-05-02 11:06:29 -0700
commitb145b731ab01937993e2bf7ecc072217932568ff (patch)
tree043b659a4adb625d65d8c9ad849442afd5ed6958 /src/gallium
parente138716d8d96a8bd53d9403635777e33698bfd2c (diff)
vc4: Emit only one FRAG_Z or FRAG_W QIR opcode.
We were generating piles of FRAG_W for interpolation, only to CSE them away immediately. Since this is the only thing that CSE is doing for us any more, just avoid making the CSE work necessary.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_qir.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h
index 789918dee68..62624d4b1e2 100644
--- a/src/gallium/drivers/vc4/vc4_qir.h
+++ b/src/gallium/drivers/vc4/vc4_qir.h
@@ -374,6 +374,8 @@ struct vc4_compile {
struct qreg line_x, point_x, point_y;
struct qreg discard;
+ struct qreg payload_FRAG_Z;
+ struct qreg payload_FRAG_W;
uint8_t vattr_sizes[8];
@@ -584,6 +586,21 @@ qir_##name(struct vc4_compile *c, struct qreg dest, struct qreg a) \
return dest; \
}
+#define QIR_PAYLOAD(name) \
+static inline struct qreg \
+qir_##name(struct vc4_compile *c) \
+{ \
+ struct qreg *payload = &c->payload_##name; \
+ if (payload->file != QFILE_NULL) \
+ return *payload; \
+ *payload = qir_get_temp(c); \
+ struct qinst *inst = qir_inst(QOP_##name, *payload, \
+ c->undef, c->undef); \
+ list_add(&inst->link, &c->instructions); \
+ c->defs[payload->index] = inst; \
+ return *payload; \
+}
+
QIR_ALU1(MOV)
QIR_ALU1(FMOV)
QIR_ALU1(MMOV)
@@ -625,8 +642,8 @@ QIR_NODST_2(TEX_T)
QIR_NODST_2(TEX_R)
QIR_NODST_2(TEX_B)
QIR_NODST_2(TEX_DIRECT)
-QIR_ALU0(FRAG_Z)
-QIR_ALU0(FRAG_W)
+QIR_PAYLOAD(FRAG_Z)
+QIR_PAYLOAD(FRAG_W)
QIR_ALU0(TEX_RESULT)
QIR_ALU0(TLB_COLOR_READ)
QIR_NODST_1(MS_MASK)