mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Feat] (MG_Util/Converters): add depth formats to ConvertInternalFormatToSized
This commit is contained in:
@@ -183,6 +183,36 @@ namespace MobileGL {
|
|||||||
return internalformat;
|
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: {
|
default: {
|
||||||
MGLOG_W("%s: Can't infer sized internal format from internalformat=%s, format=%s, type=%s, returning "
|
MGLOG_W("%s: Can't infer sized internal format from internalformat=%s, format=%s, type=%s, returning "
|
||||||
"original.",
|
"original.",
|
||||||
|
|||||||
Reference in New Issue
Block a user