Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Jul 17, 2024

Fixes flutter/flutter#148139

Block on the CPU rather than immediately beginning encoding. Seems to fix the synchronization issues that we knew about. We need to find a way to use AHB swapchains, as it seems like correct synchronization via either SurfaceView or a SurfaceControl hierarchy will require exposing our rendering as a SurfaceTransaction.

@flutter-dashboard
Copy link

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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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.

@jonahwilliams
Copy link
Contributor Author

This is primarily tested via eyeballing and looking at performance benchmarks. We can't really unit test the timing/fence synchronization.

#include "impeller/renderer/backend/vulkan/swapchain/surface_vk.h"
#include "impeller/toolkit/android/surface_transaction.h"
#include "impeller/toolkit/android/surface_transaction_stats.h"
#include "vulkan/vulkan_enums.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad include? impeller/renderer/backend/vulkan/vk.h should be the right include.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...now

@jonahwilliams jonahwilliams marked this pull request as draft July 17, 2024 23:44
@jonahwilliams
Copy link
Contributor Author

Unfortunately I found that this does not currently work with hybrid composition, we fail to construct the SurfaceControl

@chinmaygarde
Copy link
Contributor

The only failure mode I am aware of is ASurfaceControl_createFromWindow. Do we not have a window? If not, we can create a control and add it to an existing control reference.

@jonahwilliams
Copy link
Contributor Author

We have the Surface/window obtained from the Image reader but ASurfaceControl_createFromWindow is returning nullptr.

I'm looking into reparenting for hc++ but that will require API 34 to get the correct behavior for the platform views themselves

@jonahwilliams jonahwilliams marked this pull request as ready for review July 19, 2024 18:48
@jonahwilliams
Copy link
Contributor Author

The failure case here is that the SurfaceControl object is invalid (because the parenting failed). This is easy to detect and we can fall back to the khr swapchain.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 19, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 19, 2024
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 19, 2024

auto label is removed for flutter/engine/53978, due to - The status or check suite Linux linux_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 19, 2024
@auto-submit auto-submit bot merged commit 2590113 into flutter:main Jul 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 19, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 19, 2024
flutter/engine@6312dfc...5810b3f

2024-07-19 chris@bracken.jp Move !is_android to build_engine_artifacts declaration (flutter/engine#54006)
2024-07-19 zanderso@users.noreply.github.com [et] Plumb -j to ninja (flutter/engine#54005)
2024-07-19 jonahwilliams@google.com [Impeller] re-enable AHB swapchain. (flutter/engine#53978)

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 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…2054)

flutter/engine@6312dfc...5810b3f

2024-07-19 chris@bracken.jp Move !is_android to build_engine_artifacts declaration (flutter/engine#54006)
2024-07-19 zanderso@users.noreply.github.com [et] Plumb -j to ninja (flutter/engine#54005)
2024-07-19 jonahwilliams@google.com [Impeller] re-enable AHB swapchain. (flutter/engine#53978)

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 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…2054)

flutter/engine@6312dfc...5810b3f

2024-07-19 chris@bracken.jp Move !is_android to build_engine_artifacts declaration (flutter/engine#54006)
2024-07-19 zanderso@users.noreply.github.com [et] Plumb -j to ninja (flutter/engine#54005)
2024-07-19 jonahwilliams@google.com [Impeller] re-enable AHB swapchain. (flutter/engine#53978)

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 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Impeller] AHB swapchain has synchronization issue on present.

2 participants