Commit c9fed272899906acf996bb5d0d7a42ba1442669c

Alex Szpakowski 2018-11-04T12:31:02

metal: fix the SDL_RENDERER_PRESENTVSYNC flag not being set on the renderer info on macOS, when vsync is used.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m
index a1bf36a..d5e009d 100644
--- a/src/render/metal/SDL_render_metal.m
+++ b/src/render/metal/SDL_render_metal.m
@@ -1465,6 +1465,9 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
 #if defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13)
     if (@available(macOS 10.13, *)) {
         data.mtllayer.displaySyncEnabled = (flags & SDL_RENDERER_PRESENTVSYNC) != 0;
+        if (data.mtllayer.displaySyncEnabled) {
+            renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
+        }
     } else
 #endif
     {