mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Fix] (MG_Backend/DirectVulkan/VkRenderPassManager): early return when there's an active render pass that is compatible
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user