[Commits] SDL: Fixed runtime errors on iOS

libsdl.org revision control commits-owner at libsdl.org
Thu Dec 7 18:08:54 PST 2017


details:   https://hg.libsdl.org/SDL/rev/6d6dc7d2a704
changeset: 11734:6d6dc7d2a704
user:      Sam Lantinga <slouken at libsdl.org>
date:      Thu Dec 07 18:08:51 2017 -0800
description:
Fixed runtime errors on iOS

diffstat:

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

diffs (23 lines):

diff -r 490588c02a65 -r 6d6dc7d2a704 src/render/metal/SDL_render_metal.m
--- a/src/render/metal/SDL_render_metal.m	Thu Dec 07 17:47:01 2017 -0800
+++ b/src/render/metal/SDL_render_metal.m	Thu Dec 07 18:08:51 2017 -0800
@@ -343,7 +343,7 @@
     MakePipelineStates(data, data.mtlpipelinecopy, @"SDL_RenderCopy pipeline", @"SDL_Copy_vertex", @"SDL_Copy_fragment");
 
     static const float clearverts[] = { -1, -1, -1, 1, 1, 1, 1, -1, -1, -1 };
-    data.mtlbufclearverts = [data.mtldevice newBufferWithBytes:clearverts length:sizeof(clearverts) options:MTLResourceCPUCacheModeWriteCombined|MTLResourceStorageModePrivate];
+    data.mtlbufclearverts = [data.mtldevice newBufferWithBytes:clearverts length:sizeof(clearverts) options:MTLResourceCPUCacheModeWriteCombined];
     data.mtlbufclearverts.label = @"SDL_RenderClear vertices";
 
     // !!! FIXME: force more clears here so all the drawables are sane to start, and our static buffers are definitely flushed.
@@ -480,7 +480,9 @@
             mtlrect.width = renderer->viewport.w;
             mtlrect.height = renderer->viewport.h;
         }
-        [data.mtlcmdencoder setScissorRect:mtlrect];
+        if (mtlrect.width > 0 && mtlrect.height > 0) {
+            [data.mtlcmdencoder setScissorRect:mtlrect];
+        }
     }
     return 0;
 }


More information about the commits mailing list