Command buffers should go through ReleaseWrappedResource

This commit is contained in:
baldurk
2016-02-07 18:40:36 +01:00
parent 89c4676f9c
commit 23ffd5df1b
+7 -2
View File
@@ -1074,7 +1074,7 @@ DESTROY_IMPL(VkSwapChainWSI, DestroySwapChainWSI)
VkResult WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
{
WrappedVkDispRes *wrapped = (WrappedVkDispRes *)GetWrapped(obj);
GetResourceManager()->MarkCleanResource(wrapped->id);
if(wrapped->record)
{
if(wrapped->record->bakedCommands)
@@ -1083,8 +1083,13 @@ VkResult WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
wrapped->record->bakedCommands = NULL;
}
wrapped->record->Delete(GetResourceManager());
wrapped->record = NULL;
}
return ObjDisp(device)->DestroyCommandBuffer(Unwrap(device), wrapped->real.As<VkCmdBuffer>());
VkResult ret = ObjDisp(device)->DestroyCommandBuffer(Unwrap(device), wrapped->real.As<VkCmdBuffer>());
GetResourceManager()->ReleaseWrappedResource(obj);
return ret;
}