Module: Mesa
Branch: master
Commit: c6a879275345c8c0b4885a68cfa8d72c2193fb8a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6a879275345c8c0b4885a68cfa8d72c2193fb8a

Author: Rob Clark <[email protected]>
Date:   Fri Mar 20 11:50:46 2020 -0700

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4272>

---

 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);
        }
 
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to