From 17b9bc277000de3661ebb9b8e83d582d41e4a25a Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 20 Nov 2025 10:26:47 -0500 Subject: [PATCH] spirv: Only set workgroup_size_variable on compute-like stages This should be ignored on non-compute stages but AGX changes 3D shaders to compute without setting the workgroup size and blows up if it claims variable workgroups. The safest thing is to only set it from spirv_to_nir for stages that actually have workgroups. Fixes: 6d9f56396088 ("spirv: Assume variable workgroup size unless it's set") LoLed-by: Alyssa Rosenzweig Reviewed-by: Caio Oliveira Part-of: --- src/compiler/spirv/spirv_to_nir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 64ad0311aec..15e8ccb6558 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -7302,7 +7302,8 @@ spirv_to_nir(const uint32_t *words, size_t word_count, b->shader = nir_shader_create(b, stage, nir_options); b->shader->info.float_controls_execution_mode = options->float_controls_execution_mode; - b->shader->info.workgroup_size_variable = true; + if (mesa_shader_stage_uses_workgroup(stage)) + b->shader->info.workgroup_size_variable = true; b->shader->info.cs.shader_index = options->shader_index; b->shader->has_debug_info = options->debug_info; _mesa_blake3_compute(words, word_count * sizeof(uint32_t), b->shader->info.source_blake3);