Merge pull request #886 from Michael-Lfx/Michael-Lfx-patch-1

Runtime check maximumFramesPerSecond
This commit is contained in:
Bill Hollings 2020-05-27 14:40:45 -04:00 committed by GitHub
commit 3181f99928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,7 +384,12 @@ void MVKSwapchain::initSurfaceImages(const VkSwapchainCreateInfoKHR* pCreateInfo
VkResult MVKSwapchain::getRefreshCycleDuration(VkRefreshCycleDurationGOOGLE *pRefreshCycleDuration) {
#if MVK_IOS
NSInteger framesPerSecond = [UIScreen mainScreen].maximumFramesPerSecond;
NSInteger framesPerSecond = 60;
if (@available(iOS 10.3, *)) {
framesPerSecond = [UIScreen mainScreen].maximumFramesPerSecond;
} else {
// TODO: fallback
}
#endif
#if MVK_MACOS
// TODO: hook this up for macOS, probably need to use CGDisplayModeGetRefeshRate