Fix handle create mismatch for Vulkan snapshot

In our implementation, VkQueue is created in vkCreateDevice instead of
vkGetDeviceQueue. We will need to track their creation API properly,
otherwise there will be a name mismatch on snapshot load. This will
result in a crash during snapshot load with -guest-angle.

This commit marks their creation API properly.

Same thing applies for VkDescriptorSet.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Yahan Zhou 2024-06-10 10:21:17 -07:00 committed by Marge Bot
parent 561b6773c2
commit 3c609a9bf9

View file

@ -196,8 +196,15 @@ delayedDestroys = [
"vkDestroyShaderModule",
]
# The following types are created and cached by other commands.
# Thus we should not snapshot their "create" commands.
skipCreatorSnapshotTypes = [
"VkQueue", # created by vkCreateDevice
"VkDescriptorSet", # created by vkCreateDescriptorPool
]
def is_state_change_operation(api, param):
if param.isCreatedBy(api):
if param.isCreatedBy(api) and param.typeName not in skipCreatorSnapshotTypes:
return True
if api.name in apiChangeState:
if param.paramName == apiChangeState[api.name].vk_object: