gallivm: handle u8/u16 const loads properly on big-endian.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Turns out just putting the u32 in doesn't work on big endian, so
put the proper u8/u16 values in.

Got a report that since the loop limiter got removed, a gtk4 blur
shader was looping forever on s390x. Turns out it was using a 16-bit
loop variable (because why wouldn't you), and the loop counter was
just staying at 0 all the time.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37593>
This commit is contained in:
Dave Airlie 2025-09-26 12:21:24 +10:00
parent f90e0f0797
commit e28cfb2bad

View file

@ -1267,8 +1267,10 @@ emit_load_const(struct lp_build_nir_soa_context *bld,
for (unsigned i = 0; i < instr->def.num_components; i++) {
outval[i] = lp_build_const_int_vec(bld->base.gallivm, int_bld->type,
bits == 32 ? instr->value[i].u32
: instr->value[i].u64);
bits == 8 ? instr->value[i].u8 :
bits == 16 ? instr->value[i].u32 :
bits == 32 ? instr->value[i].u32 :
instr->value[i].u64);
}
for (unsigned i = instr->def.num_components; i < NIR_MAX_VEC_COMPONENTS; i++) {
outval[i] = NULL;