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/gallium/drivers/lima/standalone/lima_compiler_cmdline.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/gallium/drivers/lima/standalone/lima_compiler_cmdline.c')
-rw-r--r-- | src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c b/src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c index a9d1fba440b..f510e731052 100644 --- a/src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c +++ b/src/gallium/drivers/lima/standalone/lima_compiler_cmdline.c @@ -48,7 +48,7 @@ print_usage(void) static void insert_sorted(struct exec_list *var_list, nir_variable *new_var) { - nir_foreach_variable(var, var_list) { + nir_foreach_variable_in_list(var, var_list) { if (var->data.location > new_var->data.location && new_var->data.location >= 0) { exec_node_insert_node_before(&var->node, &new_var->node); @@ -67,7 +67,7 @@ sort_varyings(nir_shader *nir, nir_variable_mode mode) exec_node_remove(&var->node); insert_sorted(&new_list, var); } - exec_list_move_nodes_to(&new_list, var_list); + exec_list_append(&nir->variables, &new_list); } static void |