From 0d4c2271966ccffa8331026a197403f455535b2d Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 8 Jan 2026 10:33:00 +0800 Subject: [PATCH] [Chore] (MG_Backend/DirectGLES): fix param order in `GenerateTextureFormatInfo` --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 2 +- MobileGL/MG_Backend/DirectGLES/Managers.cpp | 15 ++++++++------- MobileGL/MG_Backend/DirectGLES/Utils.cpp | 9 +++++---- MobileGL/MG_Backend/DirectGLES/Utils.h | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index 776fefb1..412bd4f0 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -774,7 +774,7 @@ namespace MobileGL::MG_Backend::DirectGLES { GLenum format = GL_DEPTH_COMPONENT; GLenum type = GL_UNSIGNED_INT; - TextureImpl::GenerateTextureFormatInfo(mglInternalFormat, &internalformat, &format, &type); + TextureImpl::GenerateTextureFormatInfo(mglInternalFormat, &internalformat, &type, &format); TexturePixelDataType texturePixelDataType = MG_Util::ConvertGLEnumToTexturePixelDataType(type); bool isDepthFormat = diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index 47592673..db4d5f76 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -367,8 +367,8 @@ namespace MobileGL::MG_Backend::DirectGLES { // Regenerate all mipmap levels GLenum glInternalFormat, glType, glFormat; - TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, &glType, - &glFormat); + TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, + &glFormat, &glType); const auto& uploadTargets = textureMipmapObject->GetUploadTargets(); for (auto uploadTarget : uploadTargets) { @@ -422,8 +422,8 @@ namespace MobileGL::MG_Backend::DirectGLES { { // Update all dirty mipmap levels const auto mipmapCount = textureMipmapObject->GetMipmapLevelCount(); GLenum glInternalFormat, glType, glFormat; - TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, &glType, - &glFormat); + TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, + &glFormat, &glType); const auto& uploadTargets = textureMipmapObject->GetUploadTargets(); for (auto uploadTarget : uploadTargets) { for (SizeT level = 0; level < mipmapCount; ++level) { @@ -490,8 +490,8 @@ namespace MobileGL::MG_Backend::DirectGLES { auto backendId = backendBufferObject->GetBackendBufferId(); GLenum glInternalFormat, glType, glFormat; - TextureImpl::GenerateTextureFormatInfo(textureBufferObject->GetFormat(), &glInternalFormat, &glType, - &glFormat); + TextureImpl::GenerateTextureFormatInfo(textureBufferObject->GetFormat(), &glInternalFormat, + &glFormat, &glType); MG_External::GLES::glTexBuffer(GL_TEXTURE_BUFFER, glInternalFormat, backendId); break; @@ -1088,7 +1088,8 @@ namespace MobileGL::MG_Backend::DirectGLES { Int width = static_cast(stateRBOObject->GetWidth()); Int height = static_cast(stateRBOObject->GetHeight()); GLenum glInternalFormat, glType, glFormat; - TextureImpl::GenerateTextureFormatInfo(internalFormat, &glInternalFormat, &glType, &glFormat); + TextureImpl::GenerateTextureFormatInfo(internalFormat, &glInternalFormat, + &glFormat, &glType); MG_External::GLES::glRenderbufferStorage(GL_RENDERBUFFER, glInternalFormat, static_cast(width), static_cast(height)); diff --git a/MobileGL/MG_Backend/DirectGLES/Utils.cpp b/MobileGL/MG_Backend/DirectGLES/Utils.cpp index 87ced594..b527c10e 100644 --- a/MobileGL/MG_Backend/DirectGLES/Utils.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Utils.cpp @@ -67,13 +67,14 @@ namespace MobileGL::MG_Backend::DirectGLES { MG_External::GLES::glBindTexture(m_target, m_previousBinding); } - void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, GLenum* outType, - GLenum* outFormat) { + void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, + GLenum* outFormat, GLenum* outType) { #ifdef TRACY_ENABLE ZoneScopedC(TRACY_ZONECOLOR_BACKEND); #endif - MG_Util::TextureFormatProcessor::NormalizePixelFormat(MG_Util::ConvertTextureInternalFormatToGLEnum(internalFormat), outInternalFormat, - outFormat, outType); + MG_Util::TextureFormatProcessor::NormalizePixelFormat( + MG_Util::ConvertTextureInternalFormatToGLEnum(internalFormat), outInternalFormat, + outFormat, outType); } } // namespace TextureImpl diff --git a/MobileGL/MG_Backend/DirectGLES/Utils.h b/MobileGL/MG_Backend/DirectGLES/Utils.h index f069abc5..73dbb71a 100644 --- a/MobileGL/MG_Backend/DirectGLES/Utils.h +++ b/MobileGL/MG_Backend/DirectGLES/Utils.h @@ -59,8 +59,8 @@ namespace MobileGL::MG_Backend::DirectGLES { GLint m_previousBinding = 0; }; - void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, GLenum* outType, - GLenum* outFormat); + void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, + GLenum* outFormat, GLenum* outType); } // namespace TextureImpl namespace FramebufferImpl {