mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-13 06:38:31 +09:00
[Perf] (Texture|State): Replace dynamic_cast hot paths with static_cast.
This commit is contained in:
@@ -60,9 +60,9 @@ namespace MobileGL::MG_State::GLState {
|
||||
IntVec3 FramebufferAttachmentObject::GetSize() const {
|
||||
if (IsTexture()) {
|
||||
// TODO: get correct upload target
|
||||
MOBILEGL_ASSERT(nullptr != dynamic_cast<MG_State::GLState::TextureObjectMipmap*>(m_texture.get()),
|
||||
MOBILEGL_ASSERT(nullptr != static_cast<MG_State::GLState::TextureObjectMipmap*>(m_texture.get()),
|
||||
"Texture object here should always be an object with mipmap");
|
||||
auto textureMipmapObject = dynamic_cast<MG_State::GLState::TextureObjectMipmap*>(m_texture.get());
|
||||
auto textureMipmapObject = static_cast<MG_State::GLState::TextureObjectMipmap*>(m_texture.get());
|
||||
return textureMipmapObject->GetMipmapTexelSize(TextureUploadTarget::Texture2D, m_textureLevel);
|
||||
} else if (IsRenderbuffer()) {
|
||||
return {m_renderbuffer->GetWidth(), m_renderbuffer->GetHeight(), 1};
|
||||
|
||||
Reference in New Issue
Block a user