diff --git a/cocos/renderer/backend/metal/TextureMTL.mm b/cocos/renderer/backend/metal/TextureMTL.mm index d4df762a38..1aa9fb4ebe 100644 --- a/cocos/renderer/backend/metal/TextureMTL.mm +++ b/cocos/renderer/backend/metal/TextureMTL.mm @@ -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); } diff --git a/cocos/renderer/backend/metal/Utils.mm b/cocos/renderer/backend/metal/Utils.mm index eb49aa25da..3e44df3105 100644 --- a/cocos/renderer/backend/metal/Utils.mm +++ b/cocos/renderer/backend/metal/Utils.mm @@ -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: