pan/compiler/lower_fs_inputs: Do not trust slot->alu_type

pan_varying_layout contains both layout and format, in lower_fs_inputs
though the layout is referring to the VS layout and the format might
differ from what the FS layout expects.  We cannot use the VS format as
FS format otherwise we risk interpolating an integer.

Fixes: 66bee415ad ("pan/compiler: Split lower_varyings_io into fs_inputs and vs_outputs")
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40761>
This commit is contained in:
Lorenzo Rossi 2026-04-01 19:16:14 +02:00 committed by Marge Bot
parent e3d5d13d6d
commit 1f80394c67

View file

@ -62,18 +62,17 @@ lower_fs_input_load(struct nir_builder *b,
nir_def *res;
if (use_ld_var_buf) {
const nir_alu_type src_type = slot->alu_type;
nir_def *offset_B = nir_imm_int(b, slot->offset);
if (load->intrinsic == nir_intrinsic_load_interpolated_input) {
res = nir_load_var_buf_pan(b, load_comps, load->def.bit_size,
offset_B, &bary->def,
.src_type = src_type,
.src_type = dest_type,
.io_semantics = sem);
} else {
res = nir_load_var_buf_flat_pan(b, load_comps, load->def.bit_size,
offset_B,
.src_type = src_type,
.src_type = dest_type,
.io_semantics = sem);
}
} else {