mirror of
https://github.com/love2d/love.git
synced 2026-08-18 19:54:22 +02:00
metal: use a fallback for fonts when luminance-alpha isn't supported.
This commit is contained in:
@@ -143,11 +143,16 @@ Metal::PixelFormatDesc Metal::convertPixelFormat(id<MTLDevice> device, PixelForm
|
||||
break;
|
||||
|
||||
case PIXELFORMAT_LA8_UNORM:
|
||||
// TODO: fall back to RGBA8 when swizzle isn't available. Pixel format
|
||||
// size calculation will need to be adjusted as well
|
||||
mtlformat = MTLPixelFormatRG8Unorm;
|
||||
desc.swizzled = true;
|
||||
desc.swizzle = MTLTextureSwizzleChannelsMake(MTLTextureSwizzleRed, MTLTextureSwizzleRed, MTLTextureSwizzleRed, MTLTextureSwizzleGreen);
|
||||
// Only supported on some systems.
|
||||
if (@available(macOS 10.15, iOS 13, *))
|
||||
{
|
||||
mtlformat = MTLPixelFormatRG8Unorm;
|
||||
desc.swizzled = true;
|
||||
desc.swizzle.red = MTLTextureSwizzleRed;
|
||||
desc.swizzle.green = MTLTextureSwizzleRed;
|
||||
desc.swizzle.blue = MTLTextureSwizzleRed;
|
||||
desc.swizzle.alpha = MTLTextureSwizzleGreen;
|
||||
}
|
||||
break;
|
||||
|
||||
case PIXELFORMAT_RGBA4_UNORM:
|
||||
|
||||
Reference in New Issue
Block a user