mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 20:58: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
|
||||
// TODO: attach according to remapped
|
||||
const auto& attachments = stateFBOObject->GetAllAttachmentObjects();
|
||||
const auto& attachmentVersions = stateFBOObject->GetAllFramebufferAttachmentVersions();
|
||||
for (SizeT i = 0; i < attachments.size(); ++i) {
|
||||
const auto& attachmentObject = attachments[i];
|
||||
FramebufferAttachmentType type = static_cast<FramebufferAttachmentType>(i);
|
||||
// should retrieve BACKEND attachment here
|
||||
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;
|
||||
|
||||
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>>
|
||||
|
||||
Reference in New Issue
Block a user