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

[Impeller] Removed last ivars to raw vk::Device's. #42215

Merged
merged 2 commits into from
May 23, 2023

Conversation

gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented May 22, 2023

Removes the last ivars that hold onto a Device directly. This have recently been the cause of crashes, so the safer thing is to remove them all.

For the Allocator and the Sampler library, removing the device ivars is likely just a precaution since they should have only been accessed from the raster thread and killed before the Device. The fence waiter however was potentially accessing the device from a separate thread, so that was much more risky and likely to cause crashes.

Testing: The existing impeller_unittests verify this is setup correctly.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gaaclarke gaaclarke force-pushed the last-naked-devices branch 2 times, most recently from 659a1ff to b4c3cb2 Compare May 22, 2023 20:40
@gaaclarke gaaclarke changed the title Removed last ivars to raw devices. [Impeller] Removed last ivars to raw vk::Device's. May 22, 2023
@gaaclarke gaaclarke force-pushed the last-naked-devices branch 2 times, most recently from 87deb58 to f4bbe42 Compare May 22, 2023 20:49
@gaaclarke gaaclarke force-pushed the last-naked-devices branch from f4bbe42 to 1c540de Compare May 22, 2023 21:05
@gaaclarke gaaclarke marked this pull request as ready for review May 22, 2023 21:22
@gaaclarke gaaclarke requested a review from jason-simmons May 22, 2023 21:22
@@ -131,10 +133,16 @@ class ContextVK final : public Context,
std::shared_ptr<FenceWaiterVK> GetFenceWaiter() const;

private:
vk::UniqueInstance instance_;
struct UniqueDeviceHolder : public DeviceHolder {
Copy link
Member

Choose a reason for hiding this comment

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

Avoid the "Unique" name for something that does not provide an interface similar to std::unique_ptr. Call this something like DeviceHolderImpl.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@gaaclarke gaaclarke requested a review from jason-simmons May 23, 2023 16:18
@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label May 23, 2023
@auto-submit auto-submit bot merged commit fa44648 into flutter:main May 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 23, 2023
zanderso pushed a commit to flutter/flutter that referenced this pull request May 23, 2023
…127416)

flutter/engine@a6e37bd...ccf50f3

2023-05-23 [email protected] Roll Fuchsia Linux SDK from
Zbd3haNY2Idcdu1Fj... to -dXJ_pnUVwmjscIYm... (flutter/engine#42250)
2023-05-23 [email protected] [Impeller]
Removed last ivars to raw vk::Device's. (flutter/engine#42215)
2023-05-23 [email protected] Roll Skia from 225d51031ad0 to
292879d286e9 (5 revisions) (flutter/engine#42249)
2023-05-23 [email protected] Build arm64
FlutterEmbedder.framework and lipo the result (flutter/engine#42233)
2023-05-23 [email protected] Roll watcher dependency for web_ui to 1.1.0.
(flutter/engine#42248)
2023-05-23 [email protected] [web] Move platformViewRegistry to ui_web
(flutter/engine#41877)
2023-05-23 [email protected] Roll Skia from 3ded22186598 to
225d51031ad0 (1 revision) (flutter/engine#42246)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from Zbd3haNY2Idc to -dXJ_pnUVwmj

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 [email protected],[email protected],[email protected] 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
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 24, 2023
…lutter#127416)

flutter/engine@a6e37bd...ccf50f3

2023-05-23 [email protected] Roll Fuchsia Linux SDK from
Zbd3haNY2Idcdu1Fj... to -dXJ_pnUVwmjscIYm... (flutter/engine#42250)
2023-05-23 [email protected] [Impeller]
Removed last ivars to raw vk::Device's. (flutter/engine#42215)
2023-05-23 [email protected] Roll Skia from 225d51031ad0 to
292879d286e9 (5 revisions) (flutter/engine#42249)
2023-05-23 [email protected] Build arm64
FlutterEmbedder.framework and lipo the result (flutter/engine#42233)
2023-05-23 [email protected] Roll watcher dependency for web_ui to 1.1.0.
(flutter/engine#42248)
2023-05-23 [email protected] [web] Move platformViewRegistry to ui_web
(flutter/engine#41877)
2023-05-23 [email protected] Roll Skia from 3ded22186598 to
225d51031ad0 (1 revision) (flutter/engine#42246)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from Zbd3haNY2Idc to -dXJ_pnUVwmj

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 [email protected],[email protected],[email protected] 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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants