File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -502,8 +502,19 @@ void VulkanWindow::Render()
502502 {
503503 auto result = m_swapchain->acquireNextImage (UINT64_MAX, **m_imageAcquiredSemaphores[m_semaphoreIndex], {});
504504 m_lastFrameIndex = m_frameIndex;
505- m_frameIndex = result.second ;
506- if (result.first == vk::Result::eSuboptimalKHR)
505+
506+ // Accidental breaking API change in 1.4.324 Vulkan SDK release.
507+ // See https://github.com/KhronosGroup/Vulkan-Hpp/issues/2260
508+ // We can remove this first ifdef path when all supported platforms ship .324 and newer SDK
509+ #if (VK_HEADER_VERSION < 324)
510+ // Old SDK: std::pair<Result, uint32_t>
511+ m_frameIndex = result.second ;
512+ if (result.first == vk::Result::eSuboptimalKHR)
513+ #else
514+ // New SD: vk::ResultValue<uint32_t>
515+ m_frameIndex = result.value ;
516+ if (result.result == vk::Result::eSuboptimalKHR)
517+ #endif
507518 {
508519 // eSuboptimalKHR is actually a success code, meaning that although the image is suboptimal,
509520 // we *did* acquire the next image from the swapchain. Proceed to render the suboptimal frame
You can’t perform that action at this time.
0 commit comments