From 82a38504fe8b601f40c47dc6b650158e18c0d12c Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Thu, 26 Aug 2021 19:52:18 +0000 Subject: [PATCH] vkr: log set allocation failure for pools without free set bit Signed-off-by: Yiwei Zhang Reviewed-by: Chia-I Wu Reviewed-by: Ryan Neph --- src/venus/vkr_descriptor_set.c | 9 ++++++++- src/venus/vkr_descriptor_set.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/venus/vkr_descriptor_set.c b/src/venus/vkr_descriptor_set.c index 8580466..a30a065 100644 --- a/src/venus/vkr_descriptor_set.c +++ b/src/venus/vkr_descriptor_set.c @@ -41,6 +41,8 @@ vkr_dispatch_vkCreateDescriptorPool(struct vn_dispatch_context *dispatch, if (!pool) return; + pool->flags = args->pCreateInfo->flags; + list_inithead(&pool->descriptor_sets); } @@ -89,14 +91,19 @@ vkr_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_context *dispatch, struct vkr_descriptor_pool *pool = vkr_descriptor_pool_from_handle(args->pAllocateInfo->descriptorPool); struct object_array arr; + VkResult result; if (!pool) { vkr_cs_decoder_set_fatal(&ctx->decoder); return; } - if (vkr_descriptor_set_create_array(ctx, args, &arr) != VK_SUCCESS) + result = vkr_descriptor_set_create_array(ctx, args, &arr); + if (result != VK_SUCCESS) { + if (!(pool->flags & VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT)) + vkr_log("Warning: vkAllocateDescriptorSets failed(%u)", result); return; + } vkr_descriptor_set_add_array(ctx, dev, pool, &arr); } diff --git a/src/venus/vkr_descriptor_set.h b/src/venus/vkr_descriptor_set.h index 1c42e37..1a7f15d 100644 --- a/src/venus/vkr_descriptor_set.h +++ b/src/venus/vkr_descriptor_set.h @@ -18,6 +18,8 @@ VKR_DEFINE_OBJECT_CAST(descriptor_set_layout, struct vkr_descriptor_pool { struct vkr_object base; + VkDescriptorPoolCreateFlags flags; + struct list_head descriptor_sets; }; VKR_DEFINE_OBJECT_CAST(descriptor_pool, VK_OBJECT_TYPE_DESCRIPTOR_POOL, VkDescriptorPool)