ETC2 Metal support

This commit is contained in:
halx99 2020-08-31 15:45:05 +08:00
parent b12068e1c8
commit 258dfc5b4a
2 changed files with 4 additions and 1 deletions

View File

@ -199,7 +199,7 @@ namespace
{
bytesPerRow = 0;
}
else if (textureFormat == PixelFormat::ETC)
else if (textureFormat == PixelFormat::ETC || textureFormat == PixelFormat::ETC2_RGBA || textureFormat == PixelFormat::ETC2_RGB)
{
bytesPerRow = getBytesPerRowETC(pixelFormat, width);
}

View File

@ -122,7 +122,10 @@ MTLPixelFormat Utils::toMTLPixelFormat(PixelFormat textureFormat)
case PixelFormat::PVRTC2:
return MTLPixelFormatPVRTC_RGB_2BPP;
case PixelFormat::ETC:
case PixelFormat::ETC2_RGB:
return MTLPixelFormatETC2_RGB8;
case PixelFormat::ETC2_RGBA:
return MTLPixelFormatEAC_RGBA8;
case PixelFormat::ASTC4:
return MTLPixelFormatASTC_4x4_LDR;
case PixelFormat::ASTC8: