From c6a879275345c8c0b4885a68cfa8d72c2193fb8a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 20 Mar 2020 11:50:46 -0700 Subject: [PATCH] freedreno/ir3: add bary_ij as src for meta:tex_prefetch This way RA doesn't have to special case it in use/def accounting.. This gets rid of an extra level of split/collect, which shouldn't be needed. And interferes with scheduler trying to put tex-prefetches after inputs but before other instructions. (Otherwise it would have to figure out which split/collects need to go before the tex-prefetch) Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_compiler_nir.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index de7167db83c..cf70ae5b4f6 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -2197,6 +2197,7 @@ emit_tex(struct ir3_context *ctx, nir_tex_instr *tex) sam = ir3_META_TEX_PREFETCH(b); __ssa_dst(sam)->wrmask = MASK(ncomp); /* dst */ + __ssa_src(sam, get_barycentric_pixel(ctx), 0); sam->prefetch.input_offset = ir3_nir_coord_offset(tex->src[idx].src.ssa); sam->prefetch.tex = tex->texture_index; @@ -3017,14 +3018,8 @@ emit_instructions(struct ir3_context *ctx) * only need ij_pixel for "old style" varying inputs (ie. * tgsi_to_nir) */ - struct ir3_instruction *vcoord = NULL; if (ctx->so->type == MESA_SHADER_FRAGMENT) { - struct ir3_instruction *xy[2]; - - vcoord = create_input(ctx, 0x3); - ir3_split_dest(ctx->block, xy, vcoord, 0, 2); - - ctx->ij_pixel = ir3_create_collect(ctx, xy, 2); + ctx->ij_pixel = create_input(ctx, 0x3); } /* Setup inputs: */ @@ -3035,9 +3030,9 @@ emit_instructions(struct ir3_context *ctx) /* Defer add_sysval_input() stuff until after setup_inputs(), * because sysvals need to be appended after varyings: */ - if (vcoord) { + if (ctx->ij_pixel) { add_sysval_input_compmask(ctx, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL, - 0x3, vcoord); + 0x3, ctx->ij_pixel); } -- 2.30.2