From 085828ea4dc029a4850fa64c47335f393b5c1c60 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 9 Nov 2022 16:22:27 +0000 Subject: [PATCH] vtn: add mesh output and task_payload to vtn_mode_is_cross_invocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes a potential race condition, and removes output loads (which should not exist in the EXT_mesh_shader). Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7391 Part-of: --- src/compiler/spirv/vtn_variables.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index b536ae2..9665d44 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -179,12 +179,16 @@ static bool vtn_mode_is_cross_invocation(struct vtn_builder *b, enum vtn_variable_mode mode) { + /* TODO: add TCS here once nir_remove_unused_io_vars() can handle vector indexing. */ + bool cross_invocation_outputs = b->shader->info.stage == MESA_SHADER_MESH; return mode == vtn_variable_mode_ssbo || mode == vtn_variable_mode_ubo || mode == vtn_variable_mode_phys_ssbo || mode == vtn_variable_mode_push_constant || mode == vtn_variable_mode_workgroup || - mode == vtn_variable_mode_cross_workgroup; + mode == vtn_variable_mode_cross_workgroup || + (cross_invocation_outputs && mode == vtn_variable_mode_output) || + (b->shader->info.stage == MESA_SHADER_TASK && mode == vtn_variable_mode_task_payload); } static bool -- 2.7.4