From 2397b81533da6c366bfec57d28f37eb817e539fb Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Mon, 15 Jun 2026 14:38:35 -0700 Subject: [PATCH] anv: Allocate lookup maps for update based on mode and flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were unconditionally allocating lookup maps but according to vulkan spec, app is supposed to provide hint at AS build time and use it during the update phase. But Indiana jones does not follow the spec: 1) BuildSizesKHR - Mode or flags are not set 2) BuildAccelerationStructuresKHR - Mode is set to Build 3) BuildAccelerationStructures - Mode is set to UPDATE in first phase if we return size without lookup maps (based on MODE_UPDATE condition) then update phase breaks. Next patch will add driconf to deal with such apps. Signed-off-by: Sagar Ghuge Reviewed-by: Iván Briano Part-of: --- src/intel/vulkan/genX_acceleration_structure.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/genX_acceleration_structure.c b/src/intel/vulkan/genX_acceleration_structure.c index 6904be650fa..ad77307a18f 100644 --- a/src/intel/vulkan/genX_acceleration_structure.c +++ b/src/intel/vulkan/genX_acceleration_structure.c @@ -365,7 +365,9 @@ anv_get_build_config(VkDevice device, struct vk_acceleration_structure_build_sta !(flags & VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR)) ? 1 : 0; state->config.encode_key[1] = 0; - if (state->build_info->type == VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR) { + if (state->build_info->type == VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR && + (state->build_info->mode == VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR || + state->build_info->flags & VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR)) { state->config.encode_key[1] = ANV_ENCODE_KEY_ALLOW_UPDATE_BVH; } }