-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Replace Vulkan rotation checks with polling #44361
[Impeller] Replace Vulkan rotation checks with polling #44361
Conversation
This reverts commit e32f60a.
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
cb61324
to
e7c0448
Compare
…132284) flutter/engine@b5b41ff...9117ff2 2023-08-10 zanderso@users.noreply.github.com Revert "Android a11y bridge sets importantness" (flutter/engine#44569) 2023-08-10 skia-flutter-autoroll@skia.org Roll Skia from 491f67637e6e to 7c5f6b17a998 (2 revisions) (flutter/engine#44568) 2023-08-10 matanlurey@users.noreply.github.com [Impeller] Replace Vulkan rotation checks with polling (flutter/engine#44361) 2023-08-10 31859944+LongCatIsLooong@users.noreply.github.com Disable text rounding hack by default (flutter/engine#44544) 2023-08-09 skia-flutter-autoroll@skia.org Roll Skia from 3d5a6138b7e5 to 491f67637e6e (4 revisions) (flutter/engine#44563) 2023-08-09 skia-flutter-autoroll@skia.org Manual roll Dart SDK from f664f4b9c50d to d89e4ead966d (11 revisions) (flutter/engine#44560) 2023-08-09 58529443+srujzs@users.noreply.github.com Make toJS'd function use JS types (flutter/engine#44469) 2023-08-09 xty50337@hotmail.com [web] Fix rendering of gradients in html mode (flutter/engine#40345) 2023-08-09 55360120+Matt2D@users.noreply.github.com Flutter iOS Interactive Keyboard: Fixing Animation Issue (flutter/engine#44514) 2023-08-09 skia-flutter-autoroll@skia.org Roll Skia from 8c9a8d3e073c to 3d5a6138b7e5 (4 revisions) (flutter/engine#44557) 2023-08-09 skia-flutter-autoroll@skia.org Roll Skia from d210bab77137 to 8c9a8d3e073c (1 revision) (flutter/engine#44555) 2023-08-09 skia-flutter-autoroll@skia.org Roll Skia from 25aedb939915 to d210bab77137 (2 revisions) (flutter/engine#44550) 2023-08-09 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from e7bMhkfY-RPMrSMhB... to zoCGnScKZWbm5s9Hy... (flutter/engine#44548) 2023-08-09 skia-flutter-autoroll@skia.org Roll Skia from 17ba2122707b to 25aedb939915 (3 revisions) (flutter/engine#44547) 2023-08-09 47866232+chunhtai@users.noreply.github.com Android a11y bridge sets importantness (flutter/engine#44452) 2023-08-09 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tO6r8iQqnmsYkLcvZ... to ZCP8LDbKF4LTBFz_W... (flutter/engine#44545) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from tO6r8iQqnmsY to ZCP8LDbKF4LT fuchsia/sdk/core/mac-amd64 from e7bMhkfY-RPM to zoCGnScKZWbm If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC chinmaygarde@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
tl;dr: Reverts flutter#43214. closes flutter/flutter#129459.  --- In flutter#43214, @jonahwilliams used `vkQueuePresentKHR`[^1] [to check](https://github.com/jonahwilliams/engine/blob/a0df46add166202fe68a853391d379e69ddc7c18/impeller/renderer/backend/vulkan/swapchain_impl_vk.cc#L465-L467) if device orientations had changed, and if so, the swap-chain was torn down and replaced with a new instance (that would now have a correct rotation for ... compositing reasons I don't quite understand). Unfortunately `vkQueuePresentKHR` is (a) only present on Android 10+ _and_ (b) ... isn't implemented consistently across Android devices. For example, the popular Samsung Galaxy S10 doesn't return `VK_SUBOPTIMAL_KHR`, leading to the same rotation bugs described in flutter/flutter#129459 (i.e. even with flutter#43214). This PR implements the polling technique recommended by Android[^2], in this case on every frame. We should expect this to have a performance penalty of ~`0.2`ms per frame, but should at least give us consistent fidelity on Vulkan + Android for the time-being.  <details> <summary> Some additional screenshots generated while debugging </summary> <img src ="https://github.com/flutter/engine/assets/168174/900e02a8-aa51-4592-9690-c650092130a2" /> <img src="https://github.com/flutter/engine/assets/168174/e7b9e5c0-86b0-407f-aa51-2f76afda4f03)" /> <img src="https://github.com/flutter/engine/assets/168174/6b611090-97f5-4589-9ef9-6ba778efc6b7" /> </details> [^1]: https://developer.android.com/games/optimize/vulkan-prerotation#detect_device_orientation_changes [^2]: https://developer.android.com/games/optimize/vulkan-prerotation#using_polling
flutter#44361)"" This reverts commit 8245b22.
tl;dr: Reverts #43214. closes flutter/flutter#129459.
In #43214, @jonahwilliams used
vkQueuePresentKHR
1 to check if device orientations had changed, and if so, the swap-chain was torn down and replaced with a new instance (that would now have a correct rotation for ... compositing reasons I don't quite understand).Unfortunately
vkQueuePresentKHR
is (a) only present on Android 10+ and (b) ... isn't implemented consistently across Android devices. For example, the popular Samsung Galaxy S10 doesn't returnVK_SUBOPTIMAL_KHR
, leading to the same rotation bugs described in flutter/flutter#129459 (i.e. even with #43214).This PR implements the polling technique recommended by Android2, in this case on every frame. We should expect this to have a performance penalty of ~
0.2
ms per frame, but should at least give us consistent fidelity on Vulkan + Android for the time-being.Some additional screenshots generated while debugging
Footnotes
https://developer.android.com/games/optimize/vulkan-prerotation#detect_device_orientation_changes ↩
https://developer.android.com/games/optimize/vulkan-prerotation#using_polling ↩