From 8bdab8005bb419de4a288d5b2a76e978129c9301 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 16 Jul 2026 02:36:07 -0400 Subject: [PATCH] [Fix] (MG_Backend/DirectVulkan): skip combined depth-stencil texture data uploads instead of recording invalid single-copy with multi-bit aspect mask (VK_INCOMPLETE at vkEndCommandBuffer killed the process); proper per-aspect de-interleave tracked separately --- .../DirectVulkan/Renderer/VkTextureManager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp index 50e6562e..da38a978 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp @@ -1424,6 +1424,19 @@ namespace MobileGL::MG_Backend::DirectVulkan { return true; } + // Combined depth-stencil images need per-aspect de-interleaved copies (VkBufferImageCopy + // aspectMask must have exactly one bit set). Until that is implemented, skip the upload + // instead of recording an invalid command buffer that kills the process. + const VkImageAspectFlags uploadAspectMask = GetAspectMaskForFormat(outResource.format); + if ((uploadAspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) && (uploadAspectMask & VK_IMAGE_ASPECT_STENCIL_BIT)) { + MGLOG_E("UploadDirtyMipLevels: skipping unimplemented depth-stencil data upload for textureId=%d", + mipmapTexture.GetExternalIndex()); + for (const auto& item : uploadItems) { + mipmapTexture.MarkStorageDirty(item.target, item.level, false); + } + return true; + } + VkBuffer stagingBuffer = VK_NULL_HANDLE; VmaAllocation stagingAllocation = nullptr;