From dc56301f78494bea67f0c57d5aa77fef42bfe455 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 27 Oct 2021 14:44:54 +0200 Subject: [PATCH] radeonsi: treat nir_intrinsic_load_constant as a VMEM operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is used by variable indexing of constant arrays, to build code like this: s_add_u32 s6, s6, const_data@rel32@lo+4 s_addc_u32 s7, s7, const_data@rel32@hi+12 [...] global_load_dword v4, v4, s[6:7 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5118 Fixes: 8288882965b ("radeonsi: set MEM_ORDERED optimally") Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index ed07fa7e0a7..3d968dcda8a 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -245,6 +245,9 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info if (!nir_src_is_const(intr->src[1])) info->uses_vmem_return_type_other = true; break; + case nir_intrinsic_load_constant: + info->uses_vmem_return_type_other = true; + break; case nir_intrinsic_load_barycentric_at_sample: /* This loads sample positions. */ case nir_intrinsic_load_tess_level_outer: /* TES input read from memory */