mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Perf] (MG_Backend/DirectGLES): skip redundant attachment object sync
This commit is contained in:
@@ -870,12 +870,18 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
// attach texture to fbo
|
// attach texture to fbo
|
||||||
// TODO: attach according to remapped
|
// TODO: attach according to remapped
|
||||||
const auto& attachments = stateFBOObject->GetAllAttachmentObjects();
|
const auto& attachments = stateFBOObject->GetAllAttachmentObjects();
|
||||||
|
const auto& attachmentVersions = stateFBOObject->GetAllFramebufferAttachmentVersions();
|
||||||
for (SizeT i = 0; i < attachments.size(); ++i) {
|
for (SizeT i = 0; i < attachments.size(); ++i) {
|
||||||
const auto& attachmentObject = attachments[i];
|
const auto& attachmentObject = attachments[i];
|
||||||
FramebufferAttachmentType type = static_cast<FramebufferAttachmentType>(i);
|
FramebufferAttachmentType type = static_cast<FramebufferAttachmentType>(i);
|
||||||
|
// should retrieve BACKEND attachment here
|
||||||
GLenum glBackendAttachment = MG_Util::ConvertFramebufferAttachmentTypeToGLEnum(type);
|
GLenum glBackendAttachment = MG_Util::ConvertFramebufferAttachmentTypeToGLEnum(type);
|
||||||
|
|
||||||
SyncAttachmentObject(glFBOTarget, attachmentObject, glBackendAttachment);
|
// relevant FRONTEND!!! version should be checked and updated
|
||||||
|
if (m_syncedFrontendAttachmentVersions[i] != attachmentVersions[i]) {
|
||||||
|
SyncAttachmentObject(glFBOTarget, attachmentObject, glBackendAttachment);
|
||||||
|
m_syncedFrontendAttachmentVersions[i] = attachmentVersions[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
GLenum m_backendReadBuffer = GL_COLOR_ATTACHMENT0;
|
GLenum m_backendReadBuffer = GL_COLOR_ATTACHMENT0;
|
||||||
|
|
||||||
using FramebufferObject = MG_State::GLState::FramebufferObject;
|
using FramebufferObject = MG_State::GLState::FramebufferObject;
|
||||||
FramebufferObject::FramebufferAttachmentVersionArray m_syncedAttachmentVersions = {0};
|
FramebufferObject::FramebufferAttachmentVersionArray m_syncedFrontendAttachmentVersions = {0};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern UnorderedMap<SharedPtr<MG_State::GLState::FramebufferObject>, SharedPtr<BackendFramebufferObject>>
|
extern UnorderedMap<SharedPtr<MG_State::GLState::FramebufferObject>, SharedPtr<BackendFramebufferObject>>
|
||||||
|
|||||||
Reference in New Issue
Block a user