[Mesa-dev] [PATCH 5/7] panfrost/midgard: Fix 3D texture regression

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Thu Jun 27 13:12:25 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 src/gallium/drivers/panfrost/midgard/midgard_compile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index da01c9d6780..13f4ed9e283 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -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;
                                 }
                         }
 
-- 
2.20.1



More information about the mesa-dev mailing list