nir: Move shared_memory_explicit_layout bit into common shader_info

Move it out of the "cs" sub-struct, since the bit can be used for
other shader stages in the future.

This also removes a subtle issue in spirv_to_nir:
info.cs.shared_memory_explicit_layout was used without checking for
the CS shader stage.  It ended up being "harmless" since the effects
also depended on presence of shared variables.

Fixes: 5de6c5973a ("spirv: Implement SPV_KHR_workgroup_memory_explicit_layout")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10529>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2021-04-29 12:10:13 -07:00
committed by Marge Bot
parent 89114225b5
commit dd48683cfd
5 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -645,7 +645,7 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
/* Lower deref operations for compute shared memory. */
if (nir->info.stage == MESA_SHADER_COMPUTE) {
if (!nir->info.cs.shared_memory_explicit_layout) {
if (!nir->info.shared_memory_explicit_layout) {
NIR_PASS_V(nir, nir_lower_vars_to_explicit_types, nir_var_mem_shared, shared_var_info);
}
NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_shared, nir_address_format_32bit_offset);