mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
metal: use a fallback for fonts when luminance-alpha isn't supported.
This commit is contained in:
@@ -61,17 +61,17 @@ Texture::Texture(love::graphics::Graphics *gfxbase, id<MTLDevice> device, const
|
||||
desc.arrayLength = layers;
|
||||
desc.mipmapLevelCount = mipmapCount;
|
||||
desc.textureType = getMTLTextureType(texType, 1);
|
||||
if (@available(macOS 10.15, iOS 13, *))
|
||||
|
||||
auto formatdesc = Metal::convertPixelFormat(device, format, sRGB);
|
||||
desc.pixelFormat = formatdesc.format;
|
||||
if (formatdesc.swizzled)
|
||||
{
|
||||
// We already don't really support metal on older systems, this just
|
||||
// silences a compiler warning about it.
|
||||
auto formatdesc = Metal::convertPixelFormat(device, format, sRGB);
|
||||
desc.pixelFormat = formatdesc.format;
|
||||
if (formatdesc.swizzled)
|
||||
// Swizzled formats are already only used on supported systems, this
|
||||
// just silences a compiler warning about it.
|
||||
if (@available(macOS 10.15, iOS 13, *))
|
||||
desc.swizzle = formatdesc.swizzle;
|
||||
}
|
||||
else
|
||||
throw love::Exception("Metal backend is only supported on macOS 10.15+ and iOS 13+.");
|
||||
|
||||
desc.storageMode = MTLStorageModePrivate;
|
||||
|
||||
if (readable)
|
||||
|
||||
Reference in New Issue
Block a user