summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_qir.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-05-05 18:04:14 -0700
committerEric Anholt <[email protected]>2016-05-06 10:25:55 -0700
commita1f698881e13a4993e958815b79f8150d48e2739 (patch)
treeb672c8fd5640e76d0b3282abc345c6b46f04134f /src/gallium/drivers/vc4/vc4_qir.h
parent890dc19eeba10b4df9c658b524ce743cf4db6765 (diff)
vc4: Add support for loading immediate values in QIR.
This will be used for resetting the uniform stream in the presence of branching, but may also be useful as an optimization to reduce how many uniforms we have to copy out per draw call (in exchange for increasing icache pressure).
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_qir.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h
index d1263b64362..f541c754c88 100644
--- a/src/gallium/drivers/vc4/vc4_qir.h
+++ b/src/gallium/drivers/vc4/vc4_qir.h
@@ -62,6 +62,12 @@ enum qfile {
QFILE_FRAG_REV_FLAG,
/**
+ * Stores an immediate value in the index field that will be used
+ * directly by qpu_load_imm().
+ */
+ QFILE_LOAD_IMM,
+
+ /**
* Stores an immediate value in the index field that can be turned
* into a small immediate field by qpu_encode_small_immediate().
*/
@@ -147,6 +153,8 @@ enum qop {
* the destination
*/
QOP_TEX_RESULT,
+
+ QOP_LOAD_IMM,
};
struct queued_qpu_inst {
@@ -721,4 +729,13 @@ qir_VPM_WRITE(struct vc4_compile *c, struct qreg val)
qir_MOV_dest(c, qir_reg(QFILE_VPM, 0), val);
}
+static inline struct qreg
+qir_LOAD_IMM(struct vc4_compile *c, uint32_t val)
+{
+ struct qreg t = qir_get_temp(c);
+ qir_emit(c, qir_inst(QOP_LOAD_IMM, t,
+ qir_reg(QFILE_LOAD_IMM, val), c->undef));
+ return t;
+}
+
#endif /* VC4_QIR_H */