diff --git a/MobileGL/MG_Util/Converters/MGToMG/TextureEnumConverter.cpp b/MobileGL/MG_Util/Converters/MGToMG/TextureEnumConverter.cpp index 6bb12ac4..d5f00ddb 100644 --- a/MobileGL/MG_Util/Converters/MGToMG/TextureEnumConverter.cpp +++ b/MobileGL/MG_Util/Converters/MGToMG/TextureEnumConverter.cpp @@ -183,6 +183,36 @@ namespace MobileGL { return internalformat; } } + case TextureInternalFormat::DepthComponent: { + switch (type) { + case TexturePixelDataType::UnsignedShort: + return TextureInternalFormat::DepthComponent16; + case TexturePixelDataType::UnsignedInt: + return TextureInternalFormat::DepthComponent32; + case TexturePixelDataType::Float: + return TextureInternalFormat::DepthComponent32F; + default: + MGLOG_W("%s: Can't infer sized internal format from internalformat=%s, format=%s, type=%s, " + "returning original.", + __func__, MG_Util::ConvertTextureInternalFormatToString(internalformat).c_str(), + MG_Util::ConvertTextureInputFormatToString(format).c_str(), + MG_Util::ConvertTexturePixelDataTypeToString(type).c_str()); + return internalformat; + } + } + case TextureInternalFormat::DepthStencil: { + switch (type) { + case TexturePixelDataType::UnsignedInt248: + return TextureInternalFormat::Depth24Stencil8; + default: + MGLOG_W("%s: Can't infer sized internal format from internalformat=%s, format=%s, type=%s, " + "returning original.", + __func__, MG_Util::ConvertTextureInternalFormatToString(internalformat).c_str(), + MG_Util::ConvertTextureInputFormatToString(format).c_str(), + MG_Util::ConvertTexturePixelDataTypeToString(type).c_str()); + return internalformat; + } + } default: { MGLOG_W("%s: Can't infer sized internal format from internalformat=%s, format=%s, type=%s, returning " "original.",