spirv: don't set in_bounds for structs

The arr::in_bounds field was set unconditionally for every deref created
for a chain. For struct derefs, which don't have this field, this would
write to an unused memory location, which is probably why this never
caused issues.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: f19cbe98e3 ("nir,spirv: Preserve inbounds access information")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38110>
This commit is contained in:
Job Noorman 2025-10-28 14:30:11 +01:00 committed by Marge Bot
parent 62f0ef3445
commit 0ac55b786a

View file

@ -506,8 +506,8 @@ vtn_pointer_dereference(struct vtn_builder *b,
type = type->array_element; type = type->array_element;
} }
tail = nir_build_deref_array(&b->nb, tail, arr_index); tail = nir_build_deref_array(&b->nb, tail, arr_index);
}
tail->arr.in_bounds = deref_chain->in_bounds; tail->arr.in_bounds = deref_chain->in_bounds;
}
access |= type->access; access |= type->access;
} }