mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Perf] (MG_Backend/DirectGLES): No need to use shared_ptr for g_boundVertexBufferObject.
This commit is contained in:
@@ -177,25 +177,21 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
}
|
||||
}
|
||||
|
||||
SharedPtr<BackendBufferObject> BackendBufferObject::GetSharedPtr() {
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
void BackendBufferObject::Bind(GLenum target) {
|
||||
#ifdef TRACY_ENABLE
|
||||
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
|
||||
#endif
|
||||
if (target == GL_ARRAY_BUFFER) {
|
||||
if (g_boundVertexBufferObject.get() == this) {
|
||||
if (g_boundVertexBufferObject == this) {
|
||||
return;
|
||||
}
|
||||
g_boundVertexBufferObject = GetSharedPtr();
|
||||
g_boundVertexBufferObject = this;
|
||||
}
|
||||
MG_External::GLES::glBindBuffer(target, m_backendBufferId);
|
||||
}
|
||||
|
||||
UnorderedMap<SharedPtr<MG_State::GLState::BufferObject>, SharedPtr<BackendBufferObject>> g_backendBufferObjects;
|
||||
SharedPtr<BackendBufferObject> g_boundVertexBufferObject;
|
||||
BackendBufferObject* g_boundVertexBufferObject = nullptr;
|
||||
} // namespace BufferImpl
|
||||
|
||||
namespace VertexArrayImpl {
|
||||
|
||||
Reference in New Issue
Block a user