Module: Mesa Branch: main Commit: 8dbde926593ad2b5d356cb57a117c5545b9f3ae0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dbde926593ad2b5d356cb57a117c5545b9f3ae0
Author: Timur Kristóf <[email protected]> Date: Thu Jan 27 10:07:55 2022 +0100 radv: Lower shared and task_payload variables in task/mesh shaders. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14929> --- src/amd/vulkan/radv_shader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index c1fb12a1a1f..ba8d1d28c67 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -873,11 +873,18 @@ radv_shader_compile_to_nir(struct radv_device *device, const struct radv_pipelin /* Lower deref operations for compute shared memory. */ if (nir->info.stage == MESA_SHADER_COMPUTE || + nir->info.stage == MESA_SHADER_TASK || nir->info.stage == MESA_SHADER_MESH) { + nir_variable_mode var_modes = nir_var_mem_shared; + + if (nir->info.stage == MESA_SHADER_TASK || + nir->info.stage == MESA_SHADER_MESH) + var_modes |= nir_var_mem_task_payload; + 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_vars_to_explicit_types, var_modes, shared_var_info); } - NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_shared, nir_address_format_32bit_offset); + NIR_PASS_V(nir, nir_lower_explicit_io, var_modes, nir_address_format_32bit_offset); if (nir->info.zero_initialize_shared_memory && nir->info.shared_size > 0) { const unsigned chunk_size = 16; /* max single store size */
