From 2b76809dfc475aceb78d6f15c8b1037ad04c0bcf Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Fri, 23 May 2025 10:24:54 +0800 Subject: [PATCH] glsl: handle explicit location for mesh shader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Ian Romanick Acked-by: Marek Olšák Part-of: --- src/compiler/glsl/ast_to_hir.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index f1d29b61631..21ba2e95018 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -3402,6 +3402,7 @@ apply_explicit_location(const struct ast_type_qualifier *qual, case MESA_SHADER_TESS_CTRL: case MESA_SHADER_TESS_EVAL: case MESA_SHADER_GEOMETRY: + case MESA_SHADER_MESH: if (var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) { if (!state->check_separate_shader_objects_allowed(loc, var)) return; @@ -3430,10 +3431,11 @@ apply_explicit_location(const struct ast_type_qualifier *qual, fail = true; break; + case MESA_SHADER_TASK: case MESA_SHADER_COMPUTE: _mesa_glsl_error(loc, state, - "compute shader variables cannot be given " - "explicit locations"); + "%s shader variables cannot be given explicit locations", + _mesa_shader_stage_to_string(state->stage)); return; default: fail = true; @@ -3458,6 +3460,7 @@ apply_explicit_location(const struct ast_type_qualifier *qual, case MESA_SHADER_TESS_CTRL: case MESA_SHADER_TESS_EVAL: case MESA_SHADER_GEOMETRY: + case MESA_SHADER_MESH: if (var->data.patch) var->data.location = qual_location + VARYING_SLOT_PATCH0; else