mesa/src/compiler
Timothy Arceri 26d59acadd glsl: don't tree graft globals
As per this optimisations description:

"Takes assignments to variables that are dereferenced only
once and pastes the RHS expression into where the variables
dereferenced."

However the optimisation is run at compile time before multiple
shaders from the same stage could have been pasted together.
So this optimisation can incorrectly assume a global is only
referenced once since it cannot see the other pieces of the
shader stage until link time.

Here we skip the optimisation if the variable is a global. We
could change it to only run at link time however this
optimisation is only run at link time if we are being forced
to use GLSL IR to inline a function that glsl to nir cannot
handle and this will also be removed in a future patchset.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10482
Fixes: d75a36a9ee ("glsl: remove do_copy_propagation_elements() optimisation pass")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27351>
(cherry picked from commit bc0178af57)
2024-02-02 16:50:13 +00:00
..
clc clc: retrieve libclang path at runtime. 2024-01-31 22:24:25 +00:00
glsl glsl: don't tree graft globals 2024-02-02 16:50:13 +00:00
isaspec isaspec : fix isaspec build error in aosp 2023-10-13 11:09:40 +00:00
nir nir/builder: Fix compilation with gcc-13 when tsan is enabled 2024-01-31 22:24:25 +00:00
spirv compiler/spirv: The spirv shader is binary, should write in binary mode 2024-01-17 22:18:27 +00:00
builtin_types.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
builtin_types_c.py compiler/types: Use a string table for builtin type names 2023-09-16 15:17:01 +00:00
builtin_types_cpp_h.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
builtin_types_h.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
glsl_types.c compiler/types: Remove warnings about potential fallthrough 2023-10-25 01:51:12 +00:00
glsl_types.h compiler/types: Move comments and reorganize declarations 2023-10-25 01:51:12 +00:00
glsl_types_impl.h compiler/types: Add remaining type extraction functions and use them in C++ 2023-10-25 01:51:12 +00:00
meson.build compiler/types: Rename glsl_types.cpp to glsl_types.c 2023-10-25 01:51:12 +00:00
nir_gl_types.h compiler/types: Flip wrapping of remaining small data getters 2023-10-25 01:51:12 +00:00
nir_types.h compiler/types: Move C declarations into glsl_types.h 2023-10-07 00:42:54 +00:00
shader_enums.c nir: Add shader enqueue data structures and handling 2023-08-18 16:57:22 +00:00
shader_enums.h nir: split FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP* flags 2023-10-17 17:27:12 +00:00
shader_info.h nir: split FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP* flags 2023-10-17 17:27:12 +00:00