Fixed build warnings
This commit is contained in:
parent
a5356f9b45
commit
2a8f87d34b
1 changed files with 7 additions and 3 deletions
|
@ -627,7 +627,7 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
|
||||||
METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata;
|
METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata;
|
||||||
MTLPixelFormat pixfmt;
|
MTLPixelFormat pixfmt;
|
||||||
MTLTextureDescriptor *mtltexdesc;
|
MTLTextureDescriptor *mtltexdesc;
|
||||||
id<MTLTexture> mtltexture, mtltextureUv;
|
id<MTLTexture> mtltexture = nil, mtltextureUv = nil;
|
||||||
BOOL yuv = FALSE;
|
BOOL yuv = FALSE;
|
||||||
BOOL nv12 = FALSE;
|
BOOL nv12 = FALSE;
|
||||||
METAL_TextureData *texturedata;
|
METAL_TextureData *texturedata;
|
||||||
|
@ -696,7 +696,9 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc iosurface:surface plane:0];
|
if (@available(iOS 11.0, *)) {
|
||||||
|
mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc iosurface:surface plane:0];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
||||||
}
|
}
|
||||||
|
@ -727,7 +729,9 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
|
||||||
|
|
||||||
if (yuv || nv12) {
|
if (yuv || nv12) {
|
||||||
if (surface) {
|
if (surface) {
|
||||||
mtltextureUv = [data.mtldevice newTextureWithDescriptor:mtltexdesc iosurface:surface plane:1];
|
if (@available(iOS 11.0, *)) {
|
||||||
|
mtltextureUv = [data.mtldevice newTextureWithDescriptor:mtltexdesc iosurface:surface plane:1];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mtltextureUv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
mtltextureUv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue