ir3: Gather pixlod status earlier
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 1 Aug 2023 11:12:55 +0000 (13:12 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Aug 2023 10:09:28 +0000 (10:09 +0000)
We'll need this to skip optimizing helper invocations if it's
unnecessary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>

src/freedreno/ir3/ir3_compiler_nir.c

index a6b2b1a..6a8afde 100644 (file)
@@ -4815,6 +4815,12 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
          fixup_binning_pass(ctx, end);
    }
 
+   if (so->type == MESA_SHADER_FRAGMENT &&
+       ctx->s->info.fs.needs_quad_helper_invocations) {
+      so->need_pixlod = true;
+      so->need_full_quad = true;
+   }
+
    ir3_debug_print(ir, "AFTER: nir->ir3");
    ir3_validate(ir);
 
@@ -4999,12 +5005,6 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
    /* Collect sampling instructions eligible for pre-dispatch. */
    collect_tex_prefetches(ctx, ir);
 
-   if (so->type == MESA_SHADER_FRAGMENT &&
-       ctx->s->info.fs.needs_quad_helper_invocations) {
-      so->need_pixlod = true;
-      so->need_full_quad = true;
-   }
-
    if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
        !ctx->s->info.fs.early_fragment_tests)
       ctx->so->no_earlyz |= ctx->s->info.writes_memory;