macOS retina scaling fixes, M1 Vulkan vsync workaround, CMakeLists OpenMP path fix for Apple

This commit is contained in:
Stephen Saunders 2022-06-20 16:44:34 -04:00
parent 279c95422d
commit 8bc8d14cf2
10 changed files with 33 additions and 21 deletions

View file

@ -291,8 +291,12 @@ void VulkanSwapChain::create(uint32_t *width, uint32_t *height, bool vsync, bool
// Determine the number of images
uint32_t desiredNumberOfSwapchainImages = surfCaps.minImageCount + 1;
#if (defined(VK_USE_PLATFORM_MACOS_MVK) && defined(VK_EXAMPLE_XCODE_GENERATED))
// SRS - Work around known MoltenVK issue re 2x frame rate when vsync (VK_PRESENT_MODE_FIFO_KHR) enabled in windowed mode
if (vsync && !fullscreen)
// SRS - Work around known MoltenVK issue re 2x frame rate when vsync (VK_PRESENT_MODE_FIFO_KHR) enabled
struct utsname sysInfo;
uname(&sysInfo);
// SRS - When vsync is on, use minImageCount when not in fullscreen or when running on Apple Silcon
// This forces swapchain image acquire frame rate to match display vsync frame rate
if (vsync && (!fullscreen || strcmp(sysInfo.machine, "arm64") == 0))
{
desiredNumberOfSwapchainImages = surfCaps.minImageCount;
}