From 548377bcf3ba879fca54cfb8ce1a9c4fa9d8f4ed Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 29 Sep 2021 13:52:34 +0200 Subject: [PATCH] ir3: Always create barycentrics in the input block Otherwise, when there are uses in multiple blocks the collect may not dominate some of the uses. This is a bugfix, but before it would've mattered only in weird scenarios with interpolateAt*. When we start moving prefetch textures into the block before the preamble it will start to matter more, because it will need to read the barycentrics from a different block than the bary.f instructions. Part-of: --- src/freedreno/ir3/ir3_compiler_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index fdd78c24bc1..bdff4c1bc45 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1504,9 +1504,9 @@ get_barycentric(struct ir3_context *ctx, enum ir3_bary bary) struct ir3_instruction *ij; ij = create_sysval_input(ctx, sysval_base + bary, 0x3); - ir3_split_dest(ctx->block, xy, ij, 0, 2); + ir3_split_dest(ctx->in_block, xy, ij, 0, 2); - ctx->ij[bary] = ir3_create_collect(ctx->block, xy, 2); + ctx->ij[bary] = ir3_create_collect(ctx->in_block, xy, 2); } return ctx->ij[bary];