summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-04-16 14:33:31 +1000
committerTimothy Arceri <[email protected]>2019-04-17 09:56:56 +1000
commit3c5a9ab9f01d1d299eea1b99b9346c639fc30612 (patch)
treefc13d4970a2d0673516b24eb2466bca0da69e672 /src
parentc4478889b7176ea5aed52d1630bedb43797a00f0 (diff)
radeonsi/nir: fix scanning of bindless images
Fixes: d62d434fe920 ("ac/nir_to_llvm: add image bindless support")
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c75
1 files changed, 37 insertions, 38 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 938b0efcb76..5a925f19e09 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -181,39 +181,48 @@ static void scan_instruction(const struct nir_shader *nir,
case nir_intrinsic_load_tess_level_outer:
info->reads_tess_factors = true;
break;
- case nir_intrinsic_image_deref_load: {
- nir_variable *var = intrinsic_get_var(intr);
- if (var->data.bindless) {
- info->uses_bindless_images = true;
+ case nir_intrinsic_bindless_image_load:
+ info->uses_bindless_images = true;
- if (glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_BUF)
- info->uses_bindless_buffer_load = true;
- else
- info->uses_bindless_image_load = true;
- }
+ if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)
+ info->uses_bindless_buffer_load = true;
+ else
+ info->uses_bindless_image_load = true;
break;
- }
- case nir_intrinsic_image_deref_size:
- case nir_intrinsic_image_deref_samples: {
- nir_variable *var = intrinsic_get_var(intr);
- if (var->data.bindless)
- info->uses_bindless_images = true;
+ case nir_intrinsic_bindless_image_size:
+ case nir_intrinsic_bindless_image_samples:
+ info->uses_bindless_images = true;
break;
- }
- case nir_intrinsic_image_deref_store: {
- const nir_deref_instr *image_deref = nir_instr_as_deref(intr->src[0].ssa->parent_instr);
- nir_variable *var = intrinsic_get_var(intr);
- if (var->data.bindless) {
- info->uses_bindless_images = true;
+ case nir_intrinsic_bindless_image_store:
+ info->uses_bindless_images = true;
+
+ if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)
+ info->uses_bindless_buffer_store = true;
+ else
+ info->uses_bindless_image_store = true;
+
+ info->writes_memory = true;
+ break;
+ case nir_intrinsic_image_deref_store:
+ info->writes_memory = true;
+ break;
+ case nir_intrinsic_bindless_image_atomic_add:
+ case nir_intrinsic_bindless_image_atomic_min:
+ case nir_intrinsic_bindless_image_atomic_max:
+ case nir_intrinsic_bindless_image_atomic_and:
+ case nir_intrinsic_bindless_image_atomic_or:
+ case nir_intrinsic_bindless_image_atomic_xor:
+ case nir_intrinsic_bindless_image_atomic_exchange:
+ case nir_intrinsic_bindless_image_atomic_comp_swap:
+ info->uses_bindless_images = true;
+
+ if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)
+ info->uses_bindless_buffer_atomic = true;
+ else
+ info->uses_bindless_image_atomic = true;
- if (glsl_get_sampler_dim(image_deref->type) == GLSL_SAMPLER_DIM_BUF)
- info->uses_bindless_buffer_store = true;
- else
- info->uses_bindless_image_store = true;
- }
info->writes_memory = true;
break;
- }
case nir_intrinsic_image_deref_atomic_add:
case nir_intrinsic_image_deref_atomic_min:
case nir_intrinsic_image_deref_atomic_max:
@@ -221,19 +230,9 @@ static void scan_instruction(const struct nir_shader *nir,
case nir_intrinsic_image_deref_atomic_or:
case nir_intrinsic_image_deref_atomic_xor:
case nir_intrinsic_image_deref_atomic_exchange:
- case nir_intrinsic_image_deref_atomic_comp_swap: {
- nir_variable *var = intrinsic_get_var(intr);
- if (var->data.bindless) {
- info->uses_bindless_images = true;
-
- if (glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_BUF)
- info->uses_bindless_buffer_atomic = true;
- else
- info->uses_bindless_image_atomic = true;
- }
+ case nir_intrinsic_image_deref_atomic_comp_swap:
info->writes_memory = true;
break;
- }
case nir_intrinsic_store_ssbo:
case nir_intrinsic_ssbo_atomic_add:
case nir_intrinsic_ssbo_atomic_imin: