From 8097c0d7b17f11887297059dbc56257931904aa6 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Fri, 6 Mar 2026 15:45:19 +0800 Subject: [PATCH] [Fix] (MG_Backend/DirectVulkan): add untreated `aspect` member in `TextureResource` move ctor --- .../MG_Backend/DirectVulkan/Renderer/VkTextureManager.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.h b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.h index d36f1da8..a180f2e2 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.h +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.h @@ -48,9 +48,10 @@ public: std::swap(this->extent, that.extent); std::swap(this->mipLevels, that.mipLevels); std::swap(this->format, that.format); + std::swap(this->aspect, that.aspect); } - ~TextureResource() { + void Reset() { if (view != VK_NULL_HANDLE) { vkDestroyImageView(s_device, view, nullptr); } @@ -64,6 +65,11 @@ public: extent = {0, 0}; mipLevels = 1; format = VK_FORMAT_UNDEFINED; + aspect = VK_IMAGE_ASPECT_NONE; + } + + ~TextureResource() { + Reset(); } static inline VkDevice s_device = VK_NULL_HANDLE;