pan/mdg: Move search_var to earlier in midgard_compile.c
authorIcecream95 <ixn@keemail.me>
Sat, 6 Jun 2020 03:39:22 +0000 (15:39 +1200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 13:54:03 +0000 (13:54 +0000)
It will be needed by the new zs lowering.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5065>

src/panfrost/midgard/midgard_compile.c

index 8865bda..ef54984 100644 (file)
@@ -253,6 +253,17 @@ midgard_nir_lower_fdot2(nir_shader *shader)
         return progress;
 }
 
+static const nir_variable *
+search_var(struct exec_list *vars, unsigned driver_loc)
+{
+        nir_foreach_variable(var, vars) {
+                if (var->data.driver_location == driver_loc)
+                        return var;
+        }
+
+        return NULL;
+}
+
 /* Flushes undefined values to zero */
 
 static void
@@ -1379,17 +1390,6 @@ emit_control_barrier(compiler_context *ctx)
         emit_mir_instruction(ctx, ins);
 }
 
-static const nir_variable *
-search_var(struct exec_list *vars, unsigned driver_loc)
-{
-        nir_foreach_variable(var, vars) {
-                if (var->data.driver_location == driver_loc)
-                        return var;
-        }
-
-        return NULL;
-}
-
 static unsigned
 mir_get_branch_cond(nir_src *src, bool *invert)
 {