From 9e42e40705929f178c91f126da07b345ea85e402 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 9 Mar 2026 17:13:56 +0800 Subject: [PATCH] [Chore] (MG_Backend/DirectVulkan): notes for `MaterializePendingClearForTexture` --- MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index 752fe502..a1598ca7 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -733,6 +733,11 @@ void main() { } auto* activeRenderPass = VkRenderPassManager::GetActiveRenderPass(); + + // Check if any of the textures to sample have pending clears, + // which probably indicates it's been gone through codepath like `fbo attach` -> `clear` -> `fbo detach`, and + // without draws in between to give it a chance to materialize such clear. + // Deal with this situation here. Vector sampledTextures; Bool hasSampledTextures = m_uniformDescriptorBinder->CollectSampledTextures(program, sampledTextures); MOBILEGL_ASSERT(hasSampledTextures, "%s: CollectSampledTextures failed", __func__);