diff --git a/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp b/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp index c8b3db71..f58c5a06 100644 --- a/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp +++ b/MobileGL/MG_Util/Texture/TextureFormatProcessor.cpp @@ -70,9 +70,11 @@ namespace MobileGL::MG_Util::TextureFormatProcessor { // glTexStorage/glRenderbufferStorage internal format on ES, which left // the attachment with no storage at all (KHR-GL3x.framebuffer_blit's // GL_DEPTH_COMPONENT32 config then read an incomplete framebuffer). - // GL_DEPTH_COMPONENT32F is the sized ES format that keeps the requested - // 32-bit depth footprint. - *outInternalFormat = GL_DEPTH_COMPONENT32F; + // GL_DEPTH_COMPONENT24 is the nearest sized ES format that keeps the + // same fixed-point encoding, so the GL_UNSIGNED_INT transfer type below + // still describes the data; GL_DEPTH_COMPONENT32F would need a float + // conversion the upload path does not apply. + *outInternalFormat = GL_DEPTH_COMPONENT24; break; } *outInternalFormat = internalFormat; @@ -560,7 +562,7 @@ namespace MobileGL::MG_Util::TextureFormatProcessor { case GL_DEPTH_COMPONENT32: // Follows the internal-format normalization above: ES only accepts // GL_FLOAT data for a GL_DEPTH_COMPONENT32F store. - *outType = (options & PixelFormatNormalizeOptionBit::NoDepthComponent32) ? GL_FLOAT : GL_UNSIGNED_INT; + *outType = GL_UNSIGNED_INT; break; case GL_DEPTH_COMPONENT32F: *outType = GL_FLOAT;