pan/bi: Ignore swizzle in unwritten component
[mesa.git] / src / panfrost / bifrost / bir.c
index cb24f4590961c08d96c1e8f0318dfe19025b30e5..8256c45a7806169d93e528db29daf04b83d29cf2 100644 (file)
@@ -144,3 +144,11 @@ bi_get_immediate(bi_instruction *ins, unsigned index)
         unsigned shift = index & ~BIR_INDEX_CONSTANT;
         return ins->constant.u64 >> shift;
 }
+
+bool
+bi_writes_component(bi_instruction *ins, unsigned comp)
+{
+        nir_alu_type T = ins->dest_type;
+        unsigned size = nir_alu_type_get_type_size(T);
+        return ins->writemask & (0xF << (comp * (size / 8)));
+}