anv: Allocate lookup maps for update based on mode and flag

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 <sagar.ghuge@intel.com>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42282>
This commit is contained in:
Sagar Ghuge 2026-06-15 14:38:35 -07:00 committed by Marge Bot
parent 30ec583d7e
commit 2397b81533

View file

@ -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;
}
}