panfrost/midgard: Fix 3D texture regression
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 26 Jun 2019 23:31:31 +0000 (16:31 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 28 Jun 2019 22:10:05 +0000 (15:10 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index da01c9d67809e643206fe998eb476ef48686aca2..13f4ed9e28318c7696bf9d1cafdcddf1e2152b21 100644 (file)
@@ -1569,7 +1569,8 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
                                         /* Non-texel fetch doesn't need that
                                          * nonsense. However we do use the Z
                                          * for array indexing */
-                                        ins.texture.in_reg_swizzle = SWIZZLE_XYXZ;
+                                        bool is_3d = instr->sampler_dim == GLSL_SAMPLER_DIM_3D;
+                                        ins.texture.in_reg_swizzle = is_3d ? SWIZZLE_XYZZ : SWIZZLE_XYXZ;
                                 }
                         }