Module: Mesa Branch: main Commit: 3538b5af6dedbff09913a3a959d1a869415e310b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3538b5af6dedbff09913a3a959d1a869415e310b
Author: Yiwei Zhang <[email protected]> Date: Sun Aug 22 22:26:54 2021 +0000 venus: conditionally enable async descriptor set allocation When VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT is not used to create the pool, set allocation is guaranteed to not return VK_ERROR_FRAGMENTED_POOL, and we can safely move set allocation to async after doing resource tracking in the driver. Enable after fully tested with assert(false) in the failure case. Tested with: - dEQP-VK.api.descriptor* - dEQP-VK.api.object_management.* - dEQP-VK.binding_model.descriptor* - dEQP-VK.descriptor_indexing.* Signed-off-by: Yiwei Zhang <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Ryan Neph <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12501> --- src/virtio/vulkan/vn_descriptor_set.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/virtio/vulkan/vn_descriptor_set.c b/src/virtio/vulkan/vn_descriptor_set.c index b6a1da54a01..a88e071acf2 100644 --- a/src/virtio/vulkan/vn_descriptor_set.c +++ b/src/virtio/vulkan/vn_descriptor_set.c @@ -444,10 +444,15 @@ vn_AllocateDescriptorSets(VkDevice device, pDescriptorSets[i] = set_handle; } - result = vn_call_vkAllocateDescriptorSets(dev->instance, device, - pAllocateInfo, pDescriptorSets); - if (result != VK_SUCCESS) - goto fail; + if (pool->async_set_allocation) { + vn_async_vkAllocateDescriptorSets(dev->instance, device, pAllocateInfo, + pDescriptorSets); + } else { + result = vn_call_vkAllocateDescriptorSets( + dev->instance, device, pAllocateInfo, pDescriptorSets); + if (result != VK_SUCCESS) + goto fail; + } return VK_SUCCESS;
