From 0c6dc68d4c451edf75449a4f121c8c6c58c0fbc0 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 7 Aug 2023 13:58:57 +1000 Subject: [PATCH] glsl: fix spirv sso validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The api validation calls will segfault without this as it will try to fallback to string matching names which are NULL. This would be incorrect behaviour even if the names weren't NULL so here we correctly set the explicit location flag. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9483 Fixes: ffdb44d3a0a2 ("nir/linker: Add inputs/outputs to the program resource list") Reviewed-by: Marek Olšák Part-of: (cherry picked from commit a7850f8cf3ee8ac87a0d8328d2c21f75352f9c4d) --- .pick_status.json | 2 +- src/compiler/glsl/gl_nir_linker.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index ce149b90e46..52cd71f482a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1426,7 +1426,7 @@ "description": "glsl: fix spirv sso validation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ffdb44d3a0a2199487f17ff566c51280c9708c60" }, diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index 40cb08b2bdc..3b02651c06b 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -486,6 +486,7 @@ add_vars_with_modes(const struct gl_constants *consts, resource_name_updated(&sh_var->name); sh_var->type = var->type; sh_var->location = var->data.location - loc_bias; + sh_var->explicit_location = var->data.explicit_location; sh_var->index = var->data.index; if (!link_util_add_program_resource(prog, resource_set,