freedreno/ir3: update prefetch input_offset when packing inlocs
authorJonathan Marek <jonathan@marek.ca>
Tue, 17 Dec 2019 21:03:07 +0000 (16:03 -0500)
committerJonathan Marek <jonathan@marek.ca>
Tue, 17 Dec 2019 21:41:13 +0000 (16:41 -0500)
If the input location changes then prefetch input_offset needs to change.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3141>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3141>

src/freedreno/ir3/ir3_compiler_nir.c

index bc4cdae0e93b9ff2b240921cf89c56f03fe84611..82149c98e60160f17abd4cdccb2df1af44f4fd96 100644 (file)
@@ -2878,6 +2878,10 @@ pack_inlocs(struct ir3_context *ctx)
                                unsigned j = inloc % 4;
 
                                instr->regs[1]->iim_val = so->inputs[i].inloc + j;
+                       } else if (instr->opc == OPC_META_TEX_PREFETCH) {
+                               unsigned i = instr->prefetch.input_offset / 4;
+                               unsigned j = instr->prefetch.input_offset % 4;
+                               instr->prefetch.input_offset = so->inputs[i].inloc + j;
                        }
                }
        }