Skip to content

Commit e8f8717

Browse files
SwapChainVk: added workaround for KhronosGroup/MoltenVK#2542
1 parent f5bd877 commit e8f8717

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,13 @@ VkResult SwapChainVkImpl::AcquireNextImage(DeviceContextVkImpl* pDeviceCtxVk)
627627

628628
VkResult res = vkAcquireNextImageKHR(LogicalDevice.GetVkDevice(), m_VkSwapChain, UINT64_MAX, ImageAcquiredSemaphore->Get(), VK_NULL_HANDLE, &m_BackBufferIndex);
629629
m_ImageAcquired = (res == VK_SUCCESS || res == VK_SUBOPTIMAL_KHR);
630+
#if PLATFORM_APPLE
631+
if (res == VK_SUBOPTIMAL_KHR)
632+
{
633+
// https://github.com/KhronosGroup/MoltenVK/issues/2542
634+
m_ImageAcquired = false;
635+
}
636+
#endif
630637
if (m_ImageAcquired)
631638
{
632639
// Next command in the device context must wait for the next image to be acquired.

0 commit comments

Comments
 (0)