radeonsi: set uses_vmem_load_other for nir_intrinsic_load_buffer_amd
authorQiang Yu <yuq825@gmail.com>
Sat, 28 May 2022 14:20:08 +0000 (22:20 +0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 27 Jun 2022 02:38:21 +0000 (02:38 +0000)
Before lower TES load input to load buffer, mark this flag for this
intrinsic, otherwise we get corruption with GFX10 after the lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

src/gallium/drivers/radeonsi/si_shader_info.c

index f4d94f0..68dc0f8 100644 (file)
@@ -435,13 +435,6 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
             if (!nir_src_is_const(intr->src[1]))
                info->uses_vmem_load_other = true;
             break;
-         case nir_intrinsic_load_constant:
-            info->uses_vmem_load_other = true;
-            break;
-
-         case nir_intrinsic_load_barycentric_at_sample: /* This loads sample positions. */
-            info->uses_vmem_load_other = true;
-            break;
 
          case nir_intrinsic_load_input:
          case nir_intrinsic_load_input_vertex:
@@ -451,6 +444,12 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
                info->uses_vmem_load_other = true;
             break;
 
+         case nir_intrinsic_load_constant:
+         case nir_intrinsic_load_barycentric_at_sample: /* This loads sample positions. */
+         case nir_intrinsic_load_buffer_amd:
+            info->uses_vmem_load_other = true;
+            break;
+
          default:
             if (is_image ||
                 is_bindless_image ||