Commit b77f8af7fc2f3ec0bb31b65787b384b7f215bd58

Igor Nazarov 2025-04-02T19:01:48

Vulkan: Ignore SUBOPTIMAL on Android without pre-rotate Android returns `VK_SUBOPTIMAL_KHR` when window orientation changes, while ignores size changes. When "enablePreRotateSurfaces" is disabled, each present will return `VK_SUBOPTIMAL_KHR` if `currentTransform` is not `VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR`, causing swapchain recreate on each swap. This behavior makes disabling "enablePreRotateSurfaces" on Android worse than suboptimal. New "presentSubOptimalReturnedOnTransformChange" feature is currently enabled only on Android for the reason described above. It may be enabled for other platforms in the future if required. Change also improves error handling, by moving `deferAcquireNextImage()` call right after the `queuePresent()`, before any other call that may fail. This will avoid repeated present of the same image if something fails after successful `queuePresent()` call. The `checkForOutOfDateSwapchain()` and `computePresentOutOfDate()` was combined into a single method to improve error handling and to simplify the code. Bug: angleproject:397848903 Bug: angleproject:42266082 Bug: angleproject:42262166 Change-Id: I7ba2389ad2ddafc0c77c3068cd85ac9b9251ccdd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6424753 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>