[Commits] SDL: iOS: fix build

libsdl.org revision control commits-owner at libsdl.org
Mon Jan 1 15:40:42 PST 2018


details:   https://hg.libsdl.org/SDL/rev/3f5fad386f11
changeset: 11802:3f5fad386f11
user:      Alex Szpakowski <slime73 at gmail.com>
date:      Mon Jan 01 19:40:29 2018 -0400
description:
iOS: fix build

diffstat:

 src/render/metal/SDL_render_metal.m |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r a42e37b036c0 -r 3f5fad386f11 src/render/metal/SDL_render_metal.m
--- a/src/render/metal/SDL_render_metal.m	Mon Jan 01 19:37:16 2018 -0400
+++ b/src/render/metal/SDL_render_metal.m	Mon Jan 01 19:40:29 2018 -0400
@@ -424,7 +424,7 @@
     data.mtlpipelineprims = MakePipelineCache(data, "SDL primitives pipeline ", SDL_METAL_VERTEX_SOLID, SDL_METAL_FRAGMENT_SOLID);
     data.mtlpipelinecopy = MakePipelineCache(data, "SDL texture pipeline ", SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_COPY);
 
-    MTLSamplerDescriptor *samplerdesc = [[[MTLSamplerDescriptor alloc] init] autorelease];
+    MTLSamplerDescriptor *samplerdesc = [[MTLSamplerDescriptor alloc] init];
 
     samplerdesc.minFilter = MTLSamplerMinMagFilterNearest;
     samplerdesc.magFilter = MTLSamplerMinMagFilterNearest;
@@ -434,6 +434,10 @@
     samplerdesc.magFilter = MTLSamplerMinMagFilterLinear;
     data.mtlsamplerlinear = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc];
 
+#if !__has_feature(objc_arc)
+    [samplerdesc release];
+#endif
+
     static const float clearverts[] = { 0, 0,  0, 3,  3, 0 };
     data.mtlbufclearverts = [data.mtldevice newBufferWithBytes:clearverts length:sizeof(clearverts) options:MTLResourceCPUCacheModeWriteCombined];
     data.mtlbufclearverts.label = @"SDL_RenderClear vertices";


More information about the commits mailing list