Mesa (master): glsl/nir: Fix getting the sampler dim when arrays are involved

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 19 19:52:09 UTC 2019


Module: Mesa
Branch: master
Commit: d7ea433a5fc13ef1f622fddf01afb1f1de7bc6b4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7ea433a5fc13ef1f622fddf01afb1f1de7bc6b4

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Wed Jun 19 10:00:39 2019 -0700

glsl/nir: Fix getting the sampler dim when arrays are involved

Unwrap any array in the variable type so we can get the sampler dim.

This fixes piglit test
spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test.

Fixes: f2d0e48ddc7 "glsl/nir: Add optimization pass for access flags"
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/compiler/glsl/gl_nir_opt_access.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/gl_nir_opt_access.c b/src/compiler/glsl/gl_nir_opt_access.c
index 1affeb3881e..7f8672faf13 100644
--- a/src/compiler/glsl/gl_nir_opt_access.c
+++ b/src/compiler/glsl/gl_nir_opt_access.c
@@ -70,7 +70,8 @@ gather_intrinsic(struct access_state *state, nir_intrinsic_instr *instr)
        * image types use textures which cannot alias with buffer objects.
        * Therefore we have to group buffer samplers together with SSBO's.
        */
-      if (glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_BUF)
+      if (glsl_get_sampler_dim(glsl_without_array(var->type)) ==
+          GLSL_SAMPLER_DIM_BUF)
          state->buffers_written = true;
       else
          state->images_written = true;




More information about the mesa-commit mailing list