svga: use the sws local var to simplify some code
[mesa.git] / src / gallium / drivers / vc4 / vc4_nir_lower_blend.c
index 05bac1e311f39fe7839007d386cda87ffa7f9dda..8cad4b717e3e7b47d81a56a660207ab91846f619 100644 (file)
@@ -674,10 +674,8 @@ 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(instr, block) {
                 if (instr->type != nir_instr_type_intrinsic)
                         continue;
@@ -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 |