ir3: Insert frag coord code after preamble
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 1 Oct 2021 10:15:10 +0000 (12:15 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Mar 2022 12:15:45 +0000 (12:15 +0000)
To match the pre-preamble behavior, and so that we can better schedule
it.

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

src/freedreno/ir3/ir3_compiler_nir.c

index 481db2b..ecaf8e7 100644 (file)
@@ -1825,7 +1825,7 @@ static struct ir3_instruction *
 get_frag_coord(struct ir3_context *ctx, nir_intrinsic_instr *intr)
 {
    if (!ctx->frag_coord) {
-      struct ir3_block *b = ctx->in_block;
+      struct ir3_block *b = ir3_after_preamble(ctx->ir);
       struct ir3_instruction *xyzw[4];
       struct ir3_instruction *hw_frag_coord;