View Issue Details

IDProjectCategoryView StatusLast Update
0004713NoesisGUIC++ SDKpublic2026-01-20 18:56
Reportermaverikou Assigned Tojsantos  
PrioritynormalSeveritytrivial 
Status resolvedResolutionfixed 
Product Version3.2.10 
Target Version3.2.11 
Summary0004713: Vulkan render device leaks VkImageView when using WrapTexture
Description

When redirecting texture loads to the engine via a custom TextureProvider that calls WrapTexture, the resulting VKTexture has hash=0 and gets a VkImageView created in VKRenderDevice::TextureHash, eventually leaking it as VKRenderDevice is not responsible for cleaning up that texture.

PlatformWindows

Activities

jsantos

jsantos

2026-01-20 18:56

manager   ~0011726

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;

Issue History

Date Modified Username Field Change
2026-01-20 08:34 maverikou New Issue
2026-01-20 12:36 jsantos Assigned To => jsantos
2026-01-20 12:36 jsantos Status new => assigned
2026-01-20 12:36 jsantos Target Version => 3.2.11
2026-01-20 18:56 jsantos Status assigned => resolved
2026-01-20 18:56 jsantos Resolution open => fixed
2026-01-20 18:56 jsantos Note Added: 0011726