OSDN Git Service

panfrost/midgard: Apply writemask to LUTs
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 18:49:44 +0000 (11:49 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 19:52:50 +0000 (12:52 -0700)
Fixes LUT instructions with NIR registers.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/ci/expected-failures.txt
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index 66ca050..98632fa 100644 (file)
@@ -307,8 +307,6 @@ dEQP-GLES2.functional.shaders.random.all_features.fragment.72
 dEQP-GLES2.functional.shaders.random.all_features.fragment.77
 dEQP-GLES2.functional.shaders.random.all_features.vertex.0
 dEQP-GLES2.functional.shaders.random.all_features.vertex.17
-dEQP-GLES2.functional.shaders.random.exponential.fragment.46
-dEQP-GLES2.functional.shaders.random.exponential.vertex.46
 dEQP-GLES2.functional.shaders.random.texture.vertex.10
 dEQP-GLES2.functional.shaders.random.texture.vertex.11
 dEQP-GLES2.functional.shaders.random.texture.vertex.12
index cfb1757..47742a5 100644 (file)
@@ -985,7 +985,14 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
                 memcpy(original_swizzle, nirmods[0]->swizzle, sizeof(nirmods[0]->swizzle));
 
                 for (int i = 0; i < nr_components; ++i) {
-                        ins.alu.mask = (0x3) << (2 * i); /* Mask the associated component */
+                        /* Mask the associated component, dropping the
+                         * instruction if needed */
+
+                        ins.alu.mask = (0x3) << (2 * i);
+                        ins.alu.mask &= alu.mask;
+
+                        if (!ins.alu.mask)
+                                continue;
 
                         for (int j = 0; j < 4; ++j)
                                 nirmods[0]->swizzle[j] = original_swizzle[i]; /* Pull from the correct component */