From d4a98ad94f994610c964725ae3a79904d12a652a Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 6 Jan 2026 09:28:51 +0800 Subject: [PATCH] [Fix] (MG_Util/Texture): fix D32 depth format in `NormalizePixelFormat`, fixing Photon shadow --- MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp b/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp index 40936635..fa8c99c6 100644 --- a/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp +++ b/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp @@ -28,8 +28,8 @@ namespace MobileGL::MG_Util::TextureFormatProcessor { break; case GL_DEPTH_COMPONENT32: - if (outInternalFormat) *outInternalFormat = GL_DEPTH_COMPONENT32F; - if (outType) *outType = GL_FLOAT; + if (outInternalFormat) *outInternalFormat = GL_DEPTH_COMPONENT; + if (outType) *outType = GL_UNSIGNED_INT; if (outFormat) *outFormat = GL_DEPTH_COMPONENT; break; @@ -46,7 +46,7 @@ namespace MobileGL::MG_Util::TextureFormatProcessor { break; case GL_DEPTH32F_STENCIL8: case GL_DEPTH_STENCIL: - if (outInternalFormat) *outInternalFormat = GL_DEPTH32F_STENCIL8; + if (outInternalFormat) *outInternalFormat = internalFormat; if (outType) *outType = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; if (outFormat) *outFormat = GL_DEPTH_STENCIL; break; @@ -215,8 +215,8 @@ namespace MobileGL::MG_Util::TextureFormatProcessor { are not supported here either. ``` */ - if (outInternalFormat) *outInternalFormat = GL_R16F; - if (outType) *outType = GL_FLOAT; + if (outInternalFormat) *outInternalFormat = GL_R16; + if (outType) *outType = GL_UNSIGNED_SHORT; if (outFormat) *outFormat = GL_RED; break; case GL_R8: