Fix image states being removed too early on image destruction

* This causes problems if we're doing a last-second initial state prepare on
  destruction.
This commit is contained in:
baldurk
2020-06-16 15:27:40 +01:00
parent dc98283de6
commit 6915f07184
@@ -247,10 +247,11 @@ void WrappedVulkan::vkDestroyImage(VkDevice device, VkImage obj,
if(obj == VK_NULL_HANDLE)
return;
EraseImageState(GetResID(obj));
VkImage unwrappedObj = Unwrap(obj);
GetResourceManager()->ReleaseWrappedResource(obj, true);
EraseImageState(GetResID(obj));
return ObjDisp(device)->DestroyImage(Unwrap(device), unwrappedObj, pAllocator);
}