From ef151d24abd2e7bb89c99bc366edf20b7cc85a18 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 5 Jan 2022 14:53:42 -0800 Subject: [PATCH] r600: Fix ordering of SSBO loads versus texturing. The two types of instructions get added to the same CF list, but not the same instr list within the CF list. So, if you SSBO fetched your texcoord, the emission of the SSBO fetch would come *after* the texcoord fetch. Avoids regressions when NIR-to-TGSI starts optimizing more. Cc: mesa-stable Reviewed-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/r600_asm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 01c47ff2d2b..321d5e3b555 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -1462,6 +1462,12 @@ int r600_bytecode_add_tex(struct r600_bytecode *bc, const struct r600_bytecode_t break; } } + /* vtx instrs get inserted after tex, so make sure we aren't moving the tex + * before (say) the instr fetching the texcoord. + */ + if (!list_is_empty(&bc->cf_last->vtx)) + bc->force_add_cf = 1; + /* slight hack to make gradients always go into same cf */ if (ntex->op == FETCH_OP_SET_GRADIENTS_H) bc->force_add_cf = 1;