panvk: Take resource index in valhall_lower_get_ssbo_size
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Previously we were not extracting the resource index from the resource
handle.

This fixes failures with PanVK+ANGLE on "dEQP-GLES31.functional.ssbo.array_length.unsized_*".

Fixes: e4613f8b23 ("panvk: Lower get_ssbo_size() on Valhall")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34697>
This commit is contained in:
Mary Guillemard 2025-04-24 10:51:50 +00:00 committed by Marge Bot
parent 7ec937b81e
commit 845611bb43

View file

@ -506,10 +506,11 @@ valhall_lower_get_ssbo_size(struct nir_builder *b,
b->cursor = nir_before_instr(&intr->instr);
nir_def *table_idx =
nir_ushr_imm(b, nir_channel(b, intr->src[0].ssa, 0), 24);
nir_def *res_handle = nir_channel(b, intr->src[0].ssa, 0);
nir_def *table_idx = nir_ushr_imm(b, res_handle, 24);
nir_def *res_idx = nir_iand_imm(b, res_handle, BITFIELD_MASK(24));
nir_def *res_table = nir_ior_imm(b, table_idx, pan_res_handle(62, 0));
nir_def *buf_idx = nir_channel(b, intr->src[0].ssa, 1);
nir_def *buf_idx = nir_iadd(b, res_idx, nir_channel(b, intr->src[0].ssa, 1));
nir_def *desc_offset = nir_imul_imm(b, buf_idx, PANVK_DESCRIPTOR_SIZE);
nir_def *size = nir_load_ubo(
b, 1, 32, res_table, nir_iadd_imm(b, desc_offset, 4), .range = ~0u,