void
vc4_nir_lower_blend(nir_shader *s, struct vc4_compile *c)
{
- nir_foreach_function(function, s) {
- if (function->impl) {
- nir_foreach_block(block, function->impl) {
- vc4_nir_lower_blend_block(block, c);
- }
-
- nir_metadata_preserve(function->impl,
- nir_metadata_block_index |
- nir_metadata_dominance);
+ nir_foreach_function_impl(impl, s) {
+ nir_foreach_block(block, impl) {
+ vc4_nir_lower_blend_block(block, c);
}
+
+ nir_metadata_preserve(impl,
+ nir_metadata_block_index |
+ nir_metadata_dominance);
}
/* If we didn't do alpha-to-coverage on the output color, we still
void
vc4_nir_lower_io(nir_shader *s, struct vc4_compile *c)
{
- nir_foreach_function(function, s) {
- if (function->impl)
- vc4_nir_lower_io_impl(c, function->impl);
+ nir_foreach_function_impl(impl, s) {
+ vc4_nir_lower_io_impl(c, impl);
}
}
count_nir_instrs(nir_shader *nir)
{
int count = 0;
- nir_foreach_function(function, nir) {
- if (!function->impl)
- continue;
- nir_foreach_block(block, function->impl) {
+ nir_foreach_function_impl(impl, nir) {
+ nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block)
count++;
}