Module: Mesa
Branch: main
Commit: a7850f8cf3ee8ac87a0d8328d2c21f75352f9c4d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7850f8cf3ee8ac87a0d8328d2c21f75352f9c4d

Author: Timothy Arceri <[email protected]>
Date:   Mon Aug  7 13:58:57 2023 +1000

glsl: fix spirv sso validation

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24529>

---

 src/compiler/glsl/gl_nir_linker.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/gl_nir_linker.c 
b/src/compiler/glsl/gl_nir_linker.c
index e9be3a9bf0c..8ea80883698 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@ -589,6 +589,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,

Reply via email to