diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2020-07-20 16:30:37 -0500 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-07-29 17:38:58 +0000 |
commit | d70fff99c5bc3a721e20869e7f0be8024ffe5ecd (patch) | |
tree | 9217f352b532399caf0606632fa7eb28ac81309b /src/compiler/nir/nir_lower_system_values.c | |
parent | 473b0fc25dccc6e6ba1afd520adcd6fb5d618e36 (diff) | |
download | external_mesa3d-d70fff99c5bc3a721e20869e7f0be8024ffe5ecd.tar.gz external_mesa3d-d70fff99c5bc3a721e20869e7f0be8024ffe5ecd.tar.bz2 external_mesa3d-d70fff99c5bc3a721e20869e7f0be8024ffe5ecd.zip |
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>
Diffstat (limited to 'src/compiler/nir/nir_lower_system_values.c')
-rw-r--r-- | src/compiler/nir/nir_lower_system_values.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c index bdc337aecfc..05cf5107d6e 100644 --- a/src/compiler/nir/nir_lower_system_values.c +++ b/src/compiler/nir/nir_lower_system_values.c @@ -328,7 +328,8 @@ nir_lower_system_values(nir_shader *shader) if (progress) nir_remove_dead_derefs(shader); - exec_list_make_empty(&shader->system_values); + nir_foreach_variable_with_modes_safe(var, shader, nir_var_system_value) + exec_node_remove(&var->node); return progress; } |