[Fix] (MG_Backend/DirectVulkan/VkRenderPassManager): early return when there's an active render pass that is compatible

This commit is contained in:
2026-03-06 14:46:51 +08:00
parent 6e21fd9a35
commit 8ae66521e3
@@ -95,8 +95,12 @@ namespace MobileGL::MG_Backend::DirectVulkan {
RenderPassEntry& VkRenderPassManager::GetOrCreateRenderPass(const MG_State::GLState::FramebufferObject& fbo,
Uint32 swapchainImageIndex) {
// retrieve from cache first
auto hash = ComputeHash(fbo, swapchainImageIndex, true);
auto* activeRenderPass = GetActiveRenderPass();
auto compatibilityHash = ComputeHash(fbo, swapchainImageIndex, false);
if (activeRenderPass != nullptr && activeRenderPass->CompatibleWith(compatibilityHash)) {
return *activeRenderPass;
}
auto hash = ComputeHash(fbo, swapchainImageIndex, true);
auto it = m_renderPasses.find(hash);
if (it != m_renderPasses.end())
return it->second;