From c3a894fb47597ad7295f65072497b3b2ffb7d812 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 29 Sep 2023 16:12:09 +0100 Subject: [PATCH] aco: disable zero offset optimization for strict WQM coords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we try to do this, we end up using {undef,coordx} as the coordinates for an image_sample instruction, because we can't shrink the linear VGPR. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9767 Fixes: 859e059aa912 ("radv: use fix_derivs_in_divergent_cf") Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 287669f1fb6..30dea1070f4 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9343,7 +9343,7 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr) if (pack_const && pack != Temp()) pack = bld.vop2(aco_opcode::v_or_b32, bld.def(v1), Operand::c32(pack_const), pack); } - if (pack_const && pack == Temp()) + if ((pack_const || has_wqm_coord) && pack == Temp()) offset = bld.copy(bld.def(v1), Operand::c32(pack_const)); else if (pack == Temp()) has_offset = false;