<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2019 at 12:33 AM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Fixes: d62d434fe920 ("ac/nir_to_llvm: add image bindless support")<br>
---<br>
 src/gallium/drivers/radeonsi/si_shader_nir.c | 75 ++++++++++----------<br>
 1 file changed, 37 insertions(+), 38 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c<br>
index 938b0efcb76..5a925f19e09 100644<br>
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c<br>
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c<br>
@@ -181,39 +181,48 @@ static void scan_instruction(const struct nir_shader *nir,<br>
                case nir_intrinsic_load_tess_level_outer:<br>
                        info->reads_tess_factors = true;<br>
                        break;<br>
-               case nir_intrinsic_image_deref_load: {<br>
-                       nir_variable *var = intrinsic_get_var(intr);<br>
-                       if (var->data.bindless) {<br>
-                               info->uses_bindless_images = true;<br>
+               case nir_intrinsic_bindless_image_load:<br>
+                       info->uses_bindless_images = true;<br>
<br>
-                               if (glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_BUF)<br>
-                                       info->uses_bindless_buffer_load = true;<br>
-                               else<br>
-                                       info->uses_bindless_image_load = true;<br>
-                       }<br>
+                       if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)<br>
+                               info->uses_bindless_buffer_load = true;<br>
+                       else<br>
+                               info->uses_bindless_image_load = true;<br>
                        break;<br>
-               }<br>
-               case nir_intrinsic_image_deref_size:<br>
-               case nir_intrinsic_image_deref_samples: {<br>
-                       nir_variable *var = intrinsic_get_var(intr);<br>
-                       if (var->data.bindless)<br>
-                               info->uses_bindless_images = true;<br>
+               case nir_intrinsic_bindless_image_size:<br>
+               case nir_intrinsic_bindless_image_samples:<br>
+                       info->uses_bindless_images = true;<br>
                        break;<br>
-               }<br>
-               case nir_intrinsic_image_deref_store: {<br>
-                       const nir_deref_instr *image_deref = nir_instr_as_deref(intr->src[0].ssa->parent_instr);<br>
-                       nir_variable *var = intrinsic_get_var(intr);<br>
-                       if (var->data.bindless) {<br>
-                               info->uses_bindless_images = true;<br>
+               case nir_intrinsic_bindless_image_store:<br>
+                       info->uses_bindless_images = true;<br>
+<br>
+                       if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)<br>
+                               info->uses_bindless_buffer_store = true;<br>
+                       else<br>
+                               info->uses_bindless_image_store = true;<br>
+<br>
+                       info->writes_memory = true;<br>
+                       break;<br>
+               case nir_intrinsic_image_deref_store:<br>
+                       info->writes_memory = true;<br>
+                       break;<br>
+               case nir_intrinsic_bindless_image_atomic_add:<br>
+               case nir_intrinsic_bindless_image_atomic_min:<br>
+               case nir_intrinsic_bindless_image_atomic_max:<br>
+               case nir_intrinsic_bindless_image_atomic_and:<br>
+               case nir_intrinsic_bindless_image_atomic_or:<br>
+               case nir_intrinsic_bindless_image_atomic_xor:<br>
+               case nir_intrinsic_bindless_image_atomic_exchange:<br>
+               case nir_intrinsic_bindless_image_atomic_comp_swap:<br>
+                       info->uses_bindless_images = true;<br>
+<br>
+                       if (nir_intrinsic_image_dim(intr) == GLSL_SAMPLER_DIM_BUF)<br>
+                               info->uses_bindless_buffer_atomic = true;<br>
+                       else<br>
+                               info->uses_bindless_image_atomic = true;<br>
<br>
-                               if (glsl_get_sampler_dim(image_deref->type) == GLSL_SAMPLER_DIM_BUF)<br>
-                                       info->uses_bindless_buffer_store = true;<br>
-                               else<br>
-                                       info->uses_bindless_image_store = true;<br>
-                       }<br>
                        info->writes_memory = true;<br>
                        break;<br>
-               }<br>
                case nir_intrinsic_image_deref_atomic_add:<br>
                case nir_intrinsic_image_deref_atomic_min:<br>
                case nir_intrinsic_image_deref_atomic_max:<br>
@@ -221,19 +230,9 @@ static void scan_instruction(const struct nir_shader *nir,<br>
                case nir_intrinsic_image_deref_atomic_or:<br>
                case nir_intrinsic_image_deref_atomic_xor:<br>
                case nir_intrinsic_image_deref_atomic_exchange:<br>
-               case nir_intrinsic_image_deref_atomic_comp_swap: {<br>
-                       nir_variable *var = intrinsic_get_var(intr);<br>
-                       if (var->data.bindless) {<br>
-                               info->uses_bindless_images = true;<br>
-<br>
-                               if (glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_BUF)<br>
-                                       info->uses_bindless_buffer_atomic = true;<br>
-                               else<br>
-                                       info->uses_bindless_image_atomic = true;<br>
-                       }<br>
+               case nir_intrinsic_image_deref_atomic_comp_swap:<br>
                        info->writes_memory = true;<br>
                        break;<br>
-               }<br>
                case nir_intrinsic_store_ssbo:<br>
                case nir_intrinsic_ssbo_atomic_add:<br>
                case nir_intrinsic_ssbo_atomic_imin:<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>