From 406e6e094a782fb75e9086b174e23d58798fe187 Mon Sep 17 00:00:00 2001 From: Felix DeGrood Date: Mon, 24 Nov 2025 19:16:21 +0000 Subject: [PATCH] anv/rt: avoid out of bound access by clamping global id Signed-off-by: Felix DeGrood Reviewed-by: Lionel Landwerlin Fixes: cff9d82c66 ("anv/rt: rewrite encode.comp for better performance") Part-of: --- src/intel/vulkan/bvh/encode.comp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/bvh/encode.comp b/src/intel/vulkan/bvh/encode.comp index b12952b57a7..0ecae5867c8 100644 --- a/src/intel/vulkan/bvh/encode.comp +++ b/src/intel/vulkan/bvh/encode.comp @@ -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) {