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>
This commit is contained in:
committed by
Marge Bot
parent
473b0fc25d
commit
d70fff99c5
@@ -81,7 +81,10 @@ protected:
|
||||
}
|
||||
|
||||
unsigned count_shader_temp_vars(void) {
|
||||
return exec_list_length(&b->shader->globals);
|
||||
unsigned count = 0;
|
||||
nir_foreach_variable_with_modes(var, b->shader, nir_var_shader_temp)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
nir_intrinsic_instr *get_intrinsic(nir_intrinsic_op intrinsic,
|
||||
|
||||
Reference in New Issue
Block a user