From: Lionel Landwerlin Date: Thu, 16 May 2019 12:03:39 +0000 (+0100) Subject: nir: add access to image_deref intrinsics X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c330728f3094f2c836e022e57f003d0c82953ef;p=mesa.git 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 --- 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],