spirv: don't set in_bounds for structs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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>
(cherry picked from commit 0ac55b786a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
Job Noorman 2025-10-28 14:30:11 +01:00 committed by Dylan Baker
parent 8a2bf930bb
commit 3a71d94735
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@
"description": "spirv: don't set in_bounds for structs",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f19cbe98e325f6549e6d1f13fc06537b23a29622",
"notes": null

View file

@ -506,8 +506,8 @@ vtn_pointer_dereference(struct vtn_builder *b,
type = type->array_element;
}
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;
}