[Mesa-dev] [PATCH 14/21] i965: Define consistent interface to disable control flow execution masking.

Francisco Jerez currojerez at riseup.net
Tue Apr 28 10:08:30 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_ir_fs.h    | 10 ++++++++++
 src/mesa/drivers/dri/i965/brw_ir_svec4.h | 14 ++++++++++++++
 src/mesa/drivers/dri/i965/brw_ir_vec4.h  |  9 +++++++++
 3 files changed, 33 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index e8c9cbc..1bbe164 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -319,4 +319,14 @@ public:
    bool pi_noperspective:1;   /**< Pixel interpolator noperspective flag */
 };
 
+/**
+ * Disable per-channel control flow execution masking on \p inst.
+ */
+static inline fs_inst *
+exec_all(fs_inst *inst)
+{
+   inst->force_writemask_all = true;
+   return inst;
+}
+
 #endif
diff --git a/src/mesa/drivers/dri/i965/brw_ir_svec4.h b/src/mesa/drivers/dri/i965/brw_ir_svec4.h
index e023b9e..f4585d7 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_svec4.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_svec4.h
@@ -367,6 +367,20 @@ namespace brw {
 
       fs_inst *v[4];
    };
+
+   /**
+    * Disable per-channel control flow execution masking on \p inst.
+    */
+   inline svec4_inst *
+   exec_all(svec4_inst *inst)
+   {
+      for (unsigned i = 0; i < ARRAY_SIZE(inst->v); ++i) {
+         if (inst->v[i])
+            exec_all(inst->v[i]);
+      }
+
+      return inst;
+   }
 }
 
 #endif
diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
index e79f70f..1ad57d9 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
@@ -321,6 +321,15 @@ public:
    }
 };
 
+/**
+ * Disable per-channel control flow execution masking on \p inst.
+ */
+inline vec4_instruction *
+exec_all(vec4_instruction *inst)
+{
+   inst->force_writemask_all = true;
+   return inst;
+}
 } /* namespace brw */
 
 #endif
-- 
2.3.5



More information about the mesa-dev mailing list