brw/nir: Fix source handling of nir_intrinsic_load_barycentric_at_offset

The source of nir_intrinsic_load_barycentric_at_offset is a vector, so
-1 should be passed to get_nir_src. This is also done for texture
sampling intrinsics.

I skimmed the other user of get_nir_src, and I believe they are
correct. This one was just missed as LNL support landed an many, many
rebases of the original MR occurred.

v2: Fix another get_nir_src call. Suggested by Lionel.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: d5d7ae22ae ("brw/nir: Fix up handling of sources that might be convergent vectors")
Closes: #12464
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33007>
(cherry picked from commit 38b58e286f)
This commit is contained in:
Ian Romanick 2025-01-13 19:00:25 -08:00 committed by Eric Engestrom
parent a29fa8d084
commit 58f3ddadf1
2 changed files with 3 additions and 3 deletions

View file

@ -1544,7 +1544,7 @@
"description": "brw/nir: Fix source handling of nir_intrinsic_load_barycentric_at_offset",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d5d7ae22ae4d150fa96e9cb7c5f423cff83f88b3",
"notes": null

View file

@ -4515,7 +4515,7 @@ fs_nir_emit_fs_intrinsic(nir_to_brw_state &ntb,
if (devinfo->ver >= 20) {
emit_pixel_interpolater_alu_at_offset(
bld, dest,
retype(get_nir_src(ntb, instr->src[0]), BRW_TYPE_F),
retype(get_nir_src(ntb, instr->src[0], -1), BRW_TYPE_F),
interpolation);
} else if (nir_const_value *const_offset = nir_src_as_const_value(instr->src[0])) {
@ -4561,7 +4561,7 @@ fs_nir_emit_fs_intrinsic(nir_to_brw_state &ntb,
if (bary_intrin == nir_intrinsic_load_barycentric_at_offset ||
bary_intrin == nir_intrinsic_load_barycentric_at_sample) {
/* Use the result of the PI message. */
dst_xy = retype(get_nir_src(ntb, instr->src[0]), BRW_TYPE_F);
dst_xy = retype(get_nir_src(ntb, instr->src[0], -1), BRW_TYPE_F);
} else {
/* Use the delta_xy values computed from the payload */
enum intel_barycentric_mode bary = brw_barycentric_mode(