Only use VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR on Android

This fixes Nintendo Switch where the identity bit isn't available. We only needed this on Android to automatically handle device user orientation.
This commit is contained in:
Sam Lantinga
2025-03-02 09:12:48 -08:00
parent ca3c5fd409
commit 2c7c3d4d7b

View File

@@ -4634,7 +4634,11 @@ static Uint32 VULKAN_INTERNAL_CreateSwapchain(
swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
swapchainCreateInfo.queueFamilyIndexCount = 0;
swapchainCreateInfo.pQueueFamilyIndices = NULL;
#ifdef SDL_PLATFORM_ANDROID
swapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
#else
swapchainCreateInfo.preTransform = swapchainSupportDetails.capabilities.currentTransform;
#endif
swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
swapchainCreateInfo.presentMode = SDLToVK_PresentMode[windowData->presentMode];
swapchainCreateInfo.clipped = VK_TRUE;