vc4: Add the format name in miptree_debug.
[mesa.git] / src / gallium / drivers / vc4 / vc4_qir.h
index 90cc138504352df4cccd27a86d45cb49fec0411b..4d41c427c1032df38a99b5f9a74a4f15030db4c1 100644 (file)
@@ -168,6 +168,8 @@ enum qop {
          */
         QOP_LOAD_IMM_I2,
 
+        QOP_ROT_MUL,
+
         /* Jumps to block->successor[0] if the qinst->cond (as a
          * QPU_COND_BRANCH_*) passes, or block->successor[1] if not.  Note
          * that block->successor[1] may be unset if the condition is ALWAYS.
@@ -193,6 +195,7 @@ struct qinst {
         struct qreg dst;
         struct qreg *src;
         bool sf;
+        bool cond_is_exec_mask;
         uint8_t cond;
 };
 
@@ -446,6 +449,7 @@ struct vc4_compile {
         struct qreg execute;
 
         struct qreg line_x, point_x, point_y;
+        /** boolean (~0 -> true) if the fragment has been discarded. */
         struct qreg discard;
         struct qreg payload_FRAG_Z;
         struct qreg payload_FRAG_W;
@@ -822,11 +826,23 @@ qir_LOAD_IMM_I2(struct vc4_compile *c, uint32_t val)
                                         c->undef));
 }
 
-static inline void
+/** Shifts the multiply output to the right by rot channels */
+static inline struct qreg
+qir_ROT_MUL(struct vc4_compile *c, struct qreg val, uint32_t rot)
+{
+        return qir_emit_def(c, qir_inst(QOP_ROT_MUL, c->undef,
+                                        val,
+                                        qir_reg(QFILE_LOAD_IMM,
+                                                QPU_SMALL_IMM_MUL_ROT + rot)));
+}
+
+static inline struct qinst *
 qir_MOV_cond(struct vc4_compile *c, uint8_t cond,
              struct qreg dest, struct qreg src)
 {
-        qir_MOV_dest(c, dest, src)->cond = cond;
+        struct qinst *mov = qir_MOV_dest(c, dest, src);
+        mov->cond = cond;
+        return mov;
 }
 
 static inline struct qinst *