vulkan: Properly free guest-side handles for descriptor sets (guest)
bug: 145153816
Test: host-side unit tests
dEQP-VK.binding_model*
Change-Id: I246d03e87e677a90dbafa7304b6b2c1c4d3907cc
diff --git a/system/vulkan/func_table.cpp b/system/vulkan/func_table.cpp
index 80f586f..4e02b93 100644
--- a/system/vulkan/func_table.cpp
+++ b/system/vulkan/func_table.cpp
@@ -866,7 +866,8 @@
AEMU_SCOPED_TRACE("vkCreateDescriptorPool");
auto vkEnc = HostConnection::get()->vkEncoder();
VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
- vkCreateDescriptorPool_VkResult_return = vkEnc->vkCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
+ auto resources = ResourceTracker::get();
+ vkCreateDescriptorPool_VkResult_return = resources->on_vkCreateDescriptorPool(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pDescriptorPool);
return vkCreateDescriptorPool_VkResult_return;
}
static void entry_vkDestroyDescriptorPool(
@@ -876,7 +877,8 @@
{
AEMU_SCOPED_TRACE("vkDestroyDescriptorPool");
auto vkEnc = HostConnection::get()->vkEncoder();
- vkEnc->vkDestroyDescriptorPool(device, descriptorPool, pAllocator);
+ auto resources = ResourceTracker::get();
+ resources->on_vkDestroyDescriptorPool(vkEnc, device, descriptorPool, pAllocator);
}
static VkResult entry_vkResetDescriptorPool(
VkDevice device,
@@ -886,7 +888,8 @@
AEMU_SCOPED_TRACE("vkResetDescriptorPool");
auto vkEnc = HostConnection::get()->vkEncoder();
VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
- vkResetDescriptorPool_VkResult_return = vkEnc->vkResetDescriptorPool(device, descriptorPool, flags);
+ auto resources = ResourceTracker::get();
+ vkResetDescriptorPool_VkResult_return = resources->on_vkResetDescriptorPool(vkEnc, VK_SUCCESS, device, descriptorPool, flags);
return vkResetDescriptorPool_VkResult_return;
}
static VkResult entry_vkAllocateDescriptorSets(
@@ -897,7 +900,8 @@
AEMU_SCOPED_TRACE("vkAllocateDescriptorSets");
auto vkEnc = HostConnection::get()->vkEncoder();
VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
- vkAllocateDescriptorSets_VkResult_return = vkEnc->vkAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
+ auto resources = ResourceTracker::get();
+ vkAllocateDescriptorSets_VkResult_return = resources->on_vkAllocateDescriptorSets(vkEnc, VK_SUCCESS, device, pAllocateInfo, pDescriptorSets);
return vkAllocateDescriptorSets_VkResult_return;
}
static VkResult entry_vkFreeDescriptorSets(
@@ -909,7 +913,8 @@
AEMU_SCOPED_TRACE("vkFreeDescriptorSets");
auto vkEnc = HostConnection::get()->vkEncoder();
VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
- vkFreeDescriptorSets_VkResult_return = vkEnc->vkFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
+ auto resources = ResourceTracker::get();
+ vkFreeDescriptorSets_VkResult_return = resources->on_vkFreeDescriptorSets(vkEnc, VK_SUCCESS, device, descriptorPool, descriptorSetCount, pDescriptorSets);
return vkFreeDescriptorSets_VkResult_return;
}
static void entry_vkUpdateDescriptorSets(