Module: Mesa Branch: staging/23.2 Commit: f497e05f40577f6fdfbf787519ddaf7666bdba63 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f497e05f40577f6fdfbf787519ddaf7666bdba63
Author: Rhys Perry <[email protected]> Date: Fri Sep 29 16:12:09 2023 +0100 aco: disable zero offset optimization for strict WQM coords 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 <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9767 Fixes: 859e059aa912 ("radv: use fix_derivs_in_divergent_cf") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25477> (cherry picked from commit c3a894fb47597ad7295f65072497b3b2ffb7d812) --- .pick_status.json | 2 +- src/amd/compiler/aco_instruction_selection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 39327fcbbd7..88dcc9207a0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2064,7 +2064,7 @@ "description": "aco: disable zero offset optimization for strict WQM coords", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "859e059aa912dee5a7ef36e21eac00e6f5fcc7b3", "notes": null diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index c443fed5819..6794f3d2b93 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9329,7 +9329,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;
