svga: use the sws local var to simplify some code
[mesa.git] / src / gallium / drivers / vc4 / vc4_nir_lower_blend.c
index 99cbf30863aa74bcc4ff7fc0e148e824db1f5e83..8cad4b717e3e7b47d81a56a660207ab91846f619 100644 (file)
@@ -674,11 +674,9 @@ vc4_nir_lower_blend_instr(struct vc4_compile *c, nir_builder *b,
 }
 
 static bool
-vc4_nir_lower_blend_block(nir_block *block, void *state)
+vc4_nir_lower_blend_block(nir_block *block, struct vc4_compile *c)
 {
-        struct vc4_compile *c = state;
-
-        nir_foreach_instr_safe(block, instr) {
+        nir_foreach_instr_safe(instr, block) {
                 if (instr->type != nir_instr_type_intrinsic)
                         continue;
                 nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
@@ -712,10 +710,11 @@ vc4_nir_lower_blend_block(nir_block *block, void *state)
 void
 vc4_nir_lower_blend(nir_shader *s, struct vc4_compile *c)
 {
-        nir_foreach_function(s, function) {
+        nir_foreach_function(function, s) {
                 if (function->impl) {
-                        nir_foreach_block_call(function->impl,
-                                          vc4_nir_lower_blend_block, c);
+                        nir_foreach_block(block, function->impl) {
+                                vc4_nir_lower_blend_block(block, c);
+                        }
 
                         nir_metadata_preserve(function->impl,
                                               nir_metadata_block_index |