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>
This commit is contained in:
Ian Romanick 2025-01-13 19:00:25 -08:00 committed by Marge Bot
parent 739da17f6e
commit 38b58e286f

View file

@ -4493,7 +4493,7 @@ brw_from_nir_emit_fs_intrinsic(nir_to_brw_state &ntb,
if (devinfo->ver >= 20) { if (devinfo->ver >= 20) {
emit_pixel_interpolater_alu_at_offset( emit_pixel_interpolater_alu_at_offset(
bld, dest, 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); interpolation);
} else if (nir_const_value *const_offset = nir_src_as_const_value(instr->src[0])) { } else if (nir_const_value *const_offset = nir_src_as_const_value(instr->src[0])) {
@ -4539,7 +4539,7 @@ brw_from_nir_emit_fs_intrinsic(nir_to_brw_state &ntb,
if (bary_intrin == nir_intrinsic_load_barycentric_at_offset || if (bary_intrin == nir_intrinsic_load_barycentric_at_offset ||
bary_intrin == nir_intrinsic_load_barycentric_at_sample) { bary_intrin == nir_intrinsic_load_barycentric_at_sample) {
/* Use the result of the PI message. */ /* 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 { } else {
/* Use the delta_xy values computed from the payload */ /* Use the delta_xy values computed from the payload */
enum intel_barycentric_mode bary = brw_barycentric_mode( enum intel_barycentric_mode bary = brw_barycentric_mode(