From be9a43f1777a4ad41a51159916e35e44053fa33e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Mar 2019 18:20:24 +0200 Subject: [PATCH] - added temp hack for perf issue with Metal layer in fullscreen --- src/posix/cocoa/i_video.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index f89331ede..682b2239c 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -391,6 +391,16 @@ public: fb->SetMode(fullscreen, vid_hidpi); fb->SetSize(fb->GetClientWidth(), fb->GetClientHeight()); + // This lame hack is a temporary workaround for strange performance issues + // with fullscreen window and Core Animation's Metal layer + // It is somehow related to initial window level and flags + // Toggling fullscreen -> window -> fullscreen mysteriously solves the problem + if (ms_isVulkanEnabled && fullscreen) + { + fb->SetMode(false, vid_hidpi); + fb->SetMode(true, vid_hidpi); + } + return fb; }