Fix swapchain creation on the latest iOS to run on UI thread

This commit is contained in:
2026-05-11 22:27:21 +02:00
parent 834cb94110
commit dcccc4687d
@@ -401,7 +401,15 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
VkBool32 supportsPresent; VkBool32 supportsPresent;
VALIDATE_VULKAN_RESULT(vkGetPhysicalDeviceSurfaceSupportKHR(gpu, _device->PresentQueue->GetFamilyIndex(), _surface, &supportsPresent)); VALIDATE_VULKAN_RESULT(vkGetPhysicalDeviceSurfaceSupportKHR(gpu, _device->PresentQueue->GetFamilyIndex(), _surface, &supportsPresent));
ASSERT(supportsPresent); ASSERT(supportsPresent);
#if PLATFORM_IOS
Function<void()> func = [this, &device, &swapChainInfo]()
{
VALIDATE_VULKAN_RESULT(vkCreateSwapchainKHR(device, &swapChainInfo, nullptr, &_swapChain));
};
iOSPlatform::RunOnUIThread(func, true);
#else
VALIDATE_VULKAN_RESULT(vkCreateSwapchainKHR(device, &swapChainInfo, nullptr, &_swapChain)); VALIDATE_VULKAN_RESULT(vkCreateSwapchainKHR(device, &swapChainInfo, nullptr, &_swapChain));
#endif
// Cache data // Cache data
_width = width; _width = width;