mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Feat|Perf] (MG_Backend/DirectGLES): Skip whole texture params sync when not dirty.
This commit is contained in:
@@ -644,6 +644,13 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
return;
|
||||
}
|
||||
|
||||
Uint16 currentTextureParamsVersion = stateTextureObject->GetTextureParamsVersion();
|
||||
if (m_syncedTextureParamsVersion == currentTextureParamsVersion) {
|
||||
MGLOG_D("Texture parameters have not changed for texture ID: %u, skipping sync.", m_backendTextureId);
|
||||
return;
|
||||
}
|
||||
m_syncedTextureParamsVersion = currentTextureParamsVersion;
|
||||
|
||||
MGLOG_D("Syncing texture params with backend ID %u to backend for state ID %u", m_backendTextureId,
|
||||
stateTextureObject->GetExternalIndex());
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
Vec4<TextureSwizzleParam> m_cacheSwizzleParams = {TextureSwizzleParam::Red, TextureSwizzleParam::Green,
|
||||
TextureSwizzleParam::Blue, TextureSwizzleParam::Alpha};
|
||||
Uint16 m_syncedSamplerVersion = 0;
|
||||
Uint16 m_syncedTextureParamsVersion = 0;
|
||||
};
|
||||
|
||||
extern UnorderedMap<SharedPtr<MG_State::GLState::ITextureObject>, SharedPtr<BackendTextureObject>>
|
||||
|
||||
Reference in New Issue
Block a user