mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +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,
|
RenderPassEntry& VkRenderPassManager::GetOrCreateRenderPass(const MG_State::GLState::FramebufferObject& fbo,
|
||||||
Uint32 swapchainImageIndex) {
|
Uint32 swapchainImageIndex) {
|
||||||
// retrieve from cache first
|
// retrieve from cache first
|
||||||
auto hash = ComputeHash(fbo, swapchainImageIndex, true);
|
auto* activeRenderPass = GetActiveRenderPass();
|
||||||
auto compatibilityHash = ComputeHash(fbo, swapchainImageIndex, false);
|
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);
|
auto it = m_renderPasses.find(hash);
|
||||||
if (it != m_renderPasses.end())
|
if (it != m_renderPasses.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|||||||
Reference in New Issue
Block a user