diff --git a/intern/ghost/intern/GHOST_ContextVK.cc b/intern/ghost/intern/GHOST_ContextVK.cc index 30e0e20efb6..f02a38e3ed8 100644 --- a/intern/ghost/intern/GHOST_ContextVK.cc +++ b/intern/ghost/intern/GHOST_ContextVK.cc @@ -841,7 +841,8 @@ static void requireExtension(const vector &extensions_ava } } -static GHOST_TSuccess selectPresentMode(VkPhysicalDevice device, +static GHOST_TSuccess selectPresentMode(const char *ghost_vsync_string, + VkPhysicalDevice device, VkSurfaceKHR surface, VkPresentModeKHR *r_presentMode) { @@ -850,7 +851,6 @@ static GHOST_TSuccess selectPresentMode(VkPhysicalDevice device, vector presents(present_count); vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &present_count, presents.data()); - const char *ghost_vsync_string = getEnvVarVsyncString(); if (ghost_vsync_string) { bool vsync_off = atoi(ghost_vsync_string) == 0; if (vsync_off) { @@ -967,7 +967,7 @@ GHOST_TSuccess GHOST_ContextVK::recreateSwapchain(bool use_hdr_swapchain) } VkPresentModeKHR present_mode; - if (!selectPresentMode(physical_device, m_surface, &present_mode)) { + if (!selectPresentMode(getEnvVarVsyncString(), physical_device, m_surface, &present_mode)) { return GHOST_kFailure; }