v3d: Switch to use nir_foreach_function_impl
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23988>
This commit is contained in:
@@ -716,31 +716,29 @@ v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c)
|
||||
unreachable("Unsupported shader stage");
|
||||
}
|
||||
|
||||
nir_foreach_function(function, s) {
|
||||
if (function->impl) {
|
||||
nir_builder b = nir_builder_create(function->impl);
|
||||
nir_foreach_function_impl(impl, s) {
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
|
||||
if (c->s->info.stage == MESA_SHADER_GEOMETRY)
|
||||
emit_gs_prolog(c, &b, function->impl, &state);
|
||||
if (c->s->info.stage == MESA_SHADER_GEOMETRY)
|
||||
emit_gs_prolog(c, &b, impl, &state);
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_instr_safe(instr, block)
|
||||
v3d_nir_lower_io_instr(c, &b, instr,
|
||||
&state);
|
||||
}
|
||||
|
||||
nir_block *last = nir_impl_last_block(function->impl);
|
||||
b.cursor = nir_after_block(last);
|
||||
if (s->info.stage == MESA_SHADER_VERTEX) {
|
||||
v3d_nir_emit_ff_vpm_outputs(c, &b, &state);
|
||||
} else if (s->info.stage == MESA_SHADER_GEOMETRY) {
|
||||
emit_gs_vpm_output_header_prolog(c, &b, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(function->impl,
|
||||
nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr_safe(instr, block)
|
||||
v3d_nir_lower_io_instr(c, &b, instr,
|
||||
&state);
|
||||
}
|
||||
|
||||
nir_block *last = nir_impl_last_block(impl);
|
||||
b.cursor = nir_after_block(last);
|
||||
if (s->info.stage == MESA_SHADER_VERTEX) {
|
||||
v3d_nir_emit_ff_vpm_outputs(c, &b, &state);
|
||||
} else if (s->info.stage == MESA_SHADER_GEOMETRY) {
|
||||
emit_gs_vpm_output_header_prolog(c, &b, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
if (s->info.stage == MESA_SHADER_VERTEX ||
|
||||
|
@@ -406,19 +406,17 @@ v3d_nir_lower_logic_ops(nir_shader *s, struct v3d_compile *c)
|
||||
if (c->fs_key->logicop_func == PIPE_LOGICOP_COPY)
|
||||
return false;
|
||||
|
||||
nir_foreach_function(function, s) {
|
||||
if (function->impl) {
|
||||
nir_foreach_block(block, function->impl)
|
||||
progress |= v3d_nir_lower_logic_ops_block(block, c);
|
||||
nir_foreach_function_impl(impl, s) {
|
||||
nir_foreach_block(block, impl)
|
||||
progress |= v3d_nir_lower_logic_ops_block(block, c);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(function->impl,
|
||||
nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
} else {
|
||||
nir_metadata_preserve(function->impl,
|
||||
nir_metadata_all);
|
||||
}
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
} else {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_all);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user