mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-28 16:58:44 +00:00
Fix B4G4R4A4_UNORM swizzle with the Metal GPU driver
This commit is contained in:
parent
ab7d275113
commit
cd72f6b02e
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue