Mesa (master): panfrost/midgard: Fix b2f32 swizzle for vectors

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 26 23:37:32 UTC 2019


Module: Mesa
Branch: master
Commit: 9da4603fb630bb6cee3e37808f7e4b4de87b18fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9da4603fb630bb6cee3e37808f7e4b4de87b18fc

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Sun Mar 24 16:07:31 2019 +0000

panfrost/midgard: Fix b2f32 swizzle for vectors

Fixes issues in most of dEQP-GLES2.functional.shaders.*

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/midgard/midgard_compile.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 87c504061aa..2be883fa3fc 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -204,6 +204,10 @@ const midgard_vector_alu_src blank_alu_src = {
         .swizzle = SWIZZLE(COMPONENT_X, COMPONENT_Y, COMPONENT_Z, COMPONENT_W),
 };
 
+const midgard_vector_alu_src blank_alu_src_xxxx = {
+        .swizzle = SWIZZLE(COMPONENT_X, COMPONENT_X, COMPONENT_X, COMPONENT_X),
+};
+
 const midgard_scalar_alu_src blank_scalar_alu_src = {
         .full = true
 };
@@ -904,10 +908,6 @@ emit_condition(compiler_context *ctx, nir_src *src, bool for_branch)
         /* XXX: Force component correct */
         int condition = nir_src_index(ctx, src);
 
-        const midgard_vector_alu_src alu_src = {
-                .swizzle = SWIZZLE(COMPONENT_X, COMPONENT_X, COMPONENT_X, COMPONENT_X),
-        };
-
         /* There is no boolean move instruction. Instead, we simulate a move by
          * ANDing the condition with itself to get it into r31.w */
 
@@ -924,8 +924,8 @@ emit_condition(compiler_context *ctx, nir_src *src, bool for_branch)
                         .reg_mode = midgard_reg_mode_full,
                         .dest_override = midgard_dest_override_none,
                         .mask = (0x3 << 6), /* w */
-                        .src1 = vector_alu_srco_unsigned(alu_src),
-                        .src2 = vector_alu_srco_unsigned(alu_src)
+                        .src1 = vector_alu_srco_unsigned(blank_alu_src_xxxx),
+                        .src2 = vector_alu_srco_unsigned(blank_alu_src_xxxx)
                 },
         };
 
@@ -1130,6 +1130,8 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
                 ins.ssa_args.src1 = SSA_FIXED_REGISTER(REGISTER_CONSTANT);
                 ins.has_constants = true;
                 ins.constants[0] = 1.0;
+
+                ins.alu.src2 = vector_alu_srco_unsigned(blank_alu_src_xxxx);
         }
 
         if ((opcode_props & UNITS_ALL) == UNIT_VLUT) {




More information about the mesa-commit mailing list