|
|
The following patch fixes this:
Index: VKRenderDevice.cpp
===================================================================
--- VKRenderDevice.cpp (revision 16510)
+++ VKRenderDevice.cpp (working copy)
@@ -567,10 +567,16 @@
PendingDestroy p{};
p.frame = mFrameNumber;
- p.memory = texture->memory;
- p.image = texture->image;
p.view = texture->view;
+ // If the texture has no memory handle, it is a wrapped resource
+ // In that case, we do not own the VkImage and should not destroy it
+ if (texture->memory != VK_NULL_HANDLE)
+ {
+ p.memory = texture->memory;
+ p.image = texture->image;
+ }
+
mPendingDestroys.PushBack(p);
}
@@ -2253,6 +2259,7 @@
{
// This is the first use of a wrapped texture
texture->hash = mLastTextureHashValue++;
+ texture->device = this;
VkImageViewCreateInfo viewInfo{};
viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; |