From 8c330728f3094f2c836e022e57f003d0c82953ef Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 16 May 2019 13:03:39 +0100 Subject: [PATCH] nir: add access to image_deref intrinsics SPIRV added the ability to access variables and have expressions non dynamically uniform and because spirv_to_nir generates deref instructions, we'll need to have that access there. Signed-off-by: Lionel Landwerlin Cc: Reviewed-by: Jason Ekstrand Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/nir/nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 0e2face3109..822c6ab5d27 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -2162,6 +2162,8 @@ void nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, nir_ssa_def *src, bool bindless) { + enum gl_access_qualifier access = nir_intrinsic_access(intrin); + switch (intrin->intrinsic) { #define CASE(op) \ case nir_intrinsic_image_deref_##op: \ @@ -2193,6 +2195,7 @@ nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, nir_ssa_def *src, nir_intrinsic_set_image_dim(intrin, glsl_get_sampler_dim(deref->type)); nir_intrinsic_set_image_array(intrin, glsl_sampler_type_is_array(deref->type)); + nir_intrinsic_set_access(intrin, access | var->data.image.access); nir_intrinsic_set_format(intrin, var->data.image.format); nir_instr_rewrite_src(&intrin->instr, &intrin->src[0], -- 2.30.2