mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-13 07:13:35 +00:00
Fix B4G4R4A4_UNORM swizzle with the Metal GPU driver
This commit is contained in:
committed by
Sam Lantinga
parent
ab7d275113
commit
cd72f6b02e
@@ -1434,10 +1434,10 @@ static MetalTexture *METAL_INTERNAL_CreateTexture(
|
||||
// This format isn't natively supported so let's swizzle!
|
||||
if (createinfo->format == SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM) {
|
||||
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
|
||||
textureDescriptor.swizzle = MTLTextureSwizzleChannelsMake(MTLTextureSwizzleBlue,
|
||||
MTLTextureSwizzleGreen,
|
||||
MTLTextureSwizzleRed,
|
||||
MTLTextureSwizzleAlpha);
|
||||
textureDescriptor.swizzle = MTLTextureSwizzleChannelsMake(MTLTextureSwizzleGreen,
|
||||
MTLTextureSwizzleBlue,
|
||||
MTLTextureSwizzleAlpha,
|
||||
MTLTextureSwizzleRed);
|
||||
} else {
|
||||
SET_STRING_ERROR_AND_RETURN("SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM is not supported", NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user