nir: add callback to nir_remove_dead_variables()
This allows us to do API specific checks before removing variable without filling nir_remove_dead_variables() with API specific code. In the following patches we will use this to support the removal of dead uniforms in GLSL. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4797>
This commit is contained in:
committed by
Marge Bot
parent
bc79442f3f
commit
04dbf709ed
@@ -808,7 +808,7 @@ v3d_nir_lower_vs_early(struct v3d_compile *c)
|
||||
&c->s->outputs, used_outputs, NULL); /* demotes to globals */
|
||||
NIR_PASS_V(c->s, nir_lower_global_vars_to_local);
|
||||
v3d_optimize_nir(c->s);
|
||||
NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_shader_in);
|
||||
NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_shader_in, NULL);
|
||||
|
||||
/* This must go before nir_lower_io */
|
||||
if (c->vs_key->per_vertex_point_size)
|
||||
@@ -839,7 +839,7 @@ v3d_nir_lower_gs_early(struct v3d_compile *c)
|
||||
&c->s->outputs, used_outputs, NULL); /* demotes to globals */
|
||||
NIR_PASS_V(c->s, nir_lower_global_vars_to_local);
|
||||
v3d_optimize_nir(c->s);
|
||||
NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_shader_in);
|
||||
NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_shader_in, NULL);
|
||||
|
||||
/* This must go before nir_lower_io */
|
||||
if (c->gs_key->per_vertex_point_size)
|
||||
|
||||
Reference in New Issue
Block a user