nir: Use a single list for all shader variables
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 20 Jul 2020 21:30:37 +0000 (16:30 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jul 2020 17:38:58 +0000 (17:38 +0000)
commitd70fff99c5bc3a721e20869e7f0be8024ffe5ecd
tree9217f352b532399caf0606632fa7eb28ac81309b
parent473b0fc25dccc6e6ba1afd520adcd6fb5d618e36
nir: Use a single list for all shader variables

Instead of having separate lists of variables, roughly sorted by mode,
use a single list for all shader-level NIR variables.  This makes a few
list walks a bit longer here and there but list walks aren't a very
common thing in NIR at all.  On the other hand, it makes a lot of things
like validation, printing, etc. way simpler.  Also, there are a number
of cases where we move variables from inputs/outputs to globals and this
makes it way easier because we no longer have to move them between
lists.  We only have to deal with that if moving them from the shader to
a nir_function_impl.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
30 files changed:
src/compiler/glsl/gl_nir_link_uniform_blocks.c
src/compiler/glsl/gl_nir_linker.h
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_linking_helpers.c
src/compiler/nir/nir_lower_amul.c
src/compiler/nir/nir_lower_clip.c
src/compiler/nir/nir_lower_global_vars_to_local.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_io_to_temporaries.c
src/compiler/nir/nir_lower_system_values.c
src/compiler/nir/nir_lower_variable_initializers.c
src/compiler/nir/nir_opt_access.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_remove_dead_variables.c
src/compiler/nir/nir_serialize.c
src/compiler/nir/nir_split_vars.c
src/compiler/nir/nir_sweep.c
src/compiler/nir/nir_validate.c
src/compiler/nir/tests/vars_tests.cpp
src/freedreno/ir3/ir3_nir_lower_tess.c
src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
src/gallium/drivers/iris/iris_program.c
src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c
src/gallium/drivers/r600/sfn/sfn_nir.cpp
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c
src/intel/blorp/blorp.c
src/mesa/state_tracker/st_glsl_to_nir.cpp