glsl: fix cross validate globals

We want to skip the validation of compiler added global temps.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30199>
This commit is contained in:
Timothy Arceri
2024-06-28 10:33:31 +10:00
committed by Marge Bot
parent dde1a69929
commit c9f26a9995

View File

@@ -1678,11 +1678,11 @@ cross_validate_globals(void *mem_ctx, const struct gl_constants *consts,
if (glsl_without_array(var->type) == var->interface_type)
continue;
/* Don't cross validate temporaries that are at global scope. These
* will eventually get pulled into the shaders 'main'.
/* Don't cross validate compiler temporaries that are at global scope.
* These will eventually get pulled into the shaders 'main'.
*/
if (var->data.mode == nir_var_function_temp ||
var->data.mode == nir_var_shader_temp)
if (var->data.mode == nir_var_shader_temp &&
var->data.how_declared == nir_var_hidden)
continue;
/* If a global with this name has already been seen, verify that the