llvmpipe: Fix crash when using nir_tex_src_min_lod

Calculating lod does not always happen with the same vector size as
the vector size of the coords, which led to a crash when using the
new minLod feature. Use same repacking as with explicit lod.

Fixes: a8b104d9bd
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34906>
This commit is contained in:
Roland Scheidegger 2025-05-09 20:38:03 +02:00 committed by Marge Bot
parent 338273dedd
commit 5006d7f1f1

View file

@ -1001,8 +1001,14 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
lod = lp_build_max(lodf_bld, lod, desc_min_lod);
}
if (min_lod)
if (min_lod) {
if (bld->num_lods != bld->coord_type.length) {
min_lod = lp_build_pack_aos_scalars(bld->gallivm, bld->coord_bld.type,
lodf_bld->type, min_lod, 0);
}
lod = lp_build_max(lodf_bld, lod, min_lod);
}
if (is_lodq) {
*out_lod_fpart = lod;