anv/rt: avoid out of bound access by clamping global id
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Signed-off-by: Felix DeGrood <felix.j.degrood@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cff9d82c66 ("anv/rt: rewrite encode.comp for better performance")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38636>
This commit is contained in:
Felix DeGrood 2025-11-24 19:16:21 +00:00 committed by Marge Bot
parent b1e74a1bb1
commit 406e6e094a

View file

@ -516,8 +516,8 @@ main()
((gl_GlobalInvocationID.x & 0xF0) >> 4)
: gl_GlobalInvocationID.x;
uint32_t global_id =
DEREF(args.header).ir_internal_node_count - 1 - global_id_hash;
DEREF(args.header).ir_internal_node_count - 1 -
min(global_id_hash, DEREF(args.header).ir_internal_node_count - 1);
uint32_t intermediate_leaf_node_size;
switch (args.geometry_type) {