glsl: add a is_implicit_initializer flag

Shared globals and glsl_zero_init can cause linker errors if the
variable is only initialized in 1 place.

This commit adds a flag to variables that have been implicitely
initialized to be able in this situation to keep the explicit
initialization value.

Without this change the global-single-initializer-2-shaders piglit
test fails when using glsl_zero_init.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2020-04-30 15:06:08 +02:00
parent fa6b22d36a
commit 679421628b
4 changed files with 18 additions and 2 deletions

View File

@@ -758,6 +758,11 @@ public:
*/
unsigned has_initializer:1;
/**
* Is the initializer created by the compiler (glsl_zero_init)
*/
unsigned is_implicit_initializer:1;
/**
* Is this variable a generic output or input that has not yet been matched
* up to a variable in another stage of the pipeline?