panfrost/midgard: Simplify 2D array logic
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 19:41:41 +0000 (12:41 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 19:52:51 +0000 (12:52 -0700)
It shouldn't matter if we stick a z in for non-arrays, anyway.

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

index c213f5f..cd65da8 100644 (file)
@@ -1421,10 +1421,7 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr)
                                  * layer. To NIR, z is array layer for a 2D
                                  * array */
 
-                                bool has_array = instr->texture_array_size > 0;
-                                bool is_2d = instr->sampler_dim == GLSL_SAMPLER_DIM_2D;
-
-                                if (is_2d && has_array)
+                                if (instr->sampler_dim == GLSL_SAMPLER_DIM_2D)
                                         position_swizzle = SWIZZLE_XYXZ;
                         }