pan/bi: Fix function temp lowering with 64-bit pointers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

OpenCL-CTS `test_basic vload_private` fails with the following
assertion:
```
src/compiler/nir/nir_lower_explicit_io.c:1649: lower_explicit_io_deref:
Assertion `addr->bit_size == deref->def.bit_size' failed.
```

Use `nir_address_format_32bit_offset_as_64bit` when the shader has
64-bit pointers. The scratch offset is still 32-bit, but the NIR address
value now matches the 64-bit derefs being lowered.

Fixes: 01e6a0555c ("pan/compiler: Rework scratch memory strategy")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41769>
This commit is contained in:
Ahmed Hesham 2026-05-23 21:30:01 +00:00 committed by Marge Bot
parent 87e5fb2dcb
commit 617d4810c1

View file

@ -984,8 +984,13 @@ bifrost_postprocess_nir(nir_shader *nir,
*/
NIR_PASS(_, nir, nir_lower_vars_to_explicit_types, nir_var_function_temp,
glsl_get_natural_size_align_bytes);
nir_address_format scratch_addr_format =
nir_get_ptr_bitsize(nir) == 64 ? nir_address_format_32bit_offset_as_64bit
: nir_address_format_32bit_offset;
NIR_PASS(_, nir, nir_lower_explicit_io, nir_var_function_temp,
nir_address_format_32bit_offset);
scratch_addr_format);
}
nir_lower_mem_access_bit_sizes_options mem_size_options = {