mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Perf] (MG_Backend/DirectGLES): use version to skip unnecessary FBO sync in BindCurrentFBO
This commit is contained in:
@@ -373,7 +373,11 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
|
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
|
||||||
#endif
|
#endif
|
||||||
const auto& currentFBO = MG_State::pGLContext->GetFramebufferBindingSlot(target).GetBoundObject();
|
auto& slot = MG_State::pGLContext->GetFramebufferBindingSlot(target);
|
||||||
|
if (slot.GetVersion() == FramebufferImpl::g_fboBindVersions[(SizeT)target])
|
||||||
|
return;
|
||||||
|
|
||||||
|
const auto& currentFBO = slot.GetBoundObject();
|
||||||
if (currentFBO && currentFBO != MG_Impl::GLImpl::FramebufferImpl::pDefaultFramebufferInfo->defaultFBO) {
|
if (currentFBO && currentFBO != MG_Impl::GLImpl::FramebufferImpl::pDefaultFramebufferInfo->defaultFBO) {
|
||||||
const auto& backendFBOIt = FramebufferImpl::g_backendFramebufferObjects.find(currentFBO);
|
const auto& backendFBOIt = FramebufferImpl::g_backendFramebufferObjects.find(currentFBO);
|
||||||
if (backendFBOIt != FramebufferImpl::g_backendFramebufferObjects.end()) {
|
if (backendFBOIt != FramebufferImpl::g_backendFramebufferObjects.end()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user