From 3634e563c4a2a09c3bdb12e15ab1a057c446e14d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 1 Sep 2018 20:47:12 -0400 Subject: [PATCH] metal: SDL_UpdateYUVTexture shouldn't swap planes based on format. --- src/render/metal/SDL_render_metal.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 7fbc83993..5afedab86 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -956,8 +956,8 @@ METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, const Uint8 *Vplane, int Vpitch) { @autoreleasepool { METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; - int Uslice = texture->format == SDL_PIXELFORMAT_YV12 ? 1 : 0; - int Vslice = texture->format == SDL_PIXELFORMAT_YV12 ? 0 : 1; + const int Uslice = 0; + const int Vslice = 1; /* Bail out if we're supposed to update an empty rectangle */ if (rect->w <= 0 || rect->h <= 0) {