nir: Add and use a nir_variable_list_for_mode helper
We also add a new list iterator which takes a modes bitfield and automatically figures out which list to use. In the future, this iterator will work for multiple modes but today it assumes a single mode thanks to the behavior of nir_variable_list_for_mode. This also doesn't work for function_temp variables. Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
This commit is contained in:

committed by
Marge Bot

parent
e3e1c50067
commit
6f6f7a34c5
@@ -128,8 +128,7 @@ nir_remove_unused_io_vars(nir_shader *shader,
|
||||
uint64_t *used;
|
||||
|
||||
assert(mode == nir_var_shader_in || mode == nir_var_shader_out);
|
||||
struct exec_list *var_list =
|
||||
mode == nir_var_shader_in ? &shader->inputs : &shader->outputs;
|
||||
struct exec_list *var_list = nir_variable_list_for_mode(shader, mode);
|
||||
|
||||
nir_foreach_variable_safe(var, var_list) {
|
||||
if (var->data.patch)
|
||||
|
Reference in New Issue
Block a user