pan/midgard: Expand swizzle for texelFetch
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 20 Dec 2019 17:38:24 +0000 (12:38 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 24 Dec 2019 23:46:22 +0000 (23:46 +0000)
We zero the extra components anyway. Fixes
dEQP-GLES3.functional.shaders.texture_functions.texelfetch.sampler2d_fixed_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_compile.c

index 8d457de950e9570139434b9fdfcfc64bbc6560ea..f462100a2801719dd3981db8fc1dc110de0849aa 100644 (file)
@@ -1813,6 +1813,12 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
                                         unreachable("Invalid texture 2D components");
                         }
 
+                        if (midgard_texop == TEXTURE_OP_TEXEL_FETCH) {
+                                /* We zeroed */
+                                ins.swizzle[1][2] = COMPONENT_Z;
+                                ins.swizzle[1][3] = COMPONENT_W;
+                        }
+
                         break;
                 }