[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] Share vulkan playground across goldens #49981

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

gaaclarke
Copy link
Member
@gaaclarke gaaclarke commented Jan 23, 2024

fixes flutter/flutter#142052

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 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 marked this pull request as ready for review January 23, 2024 22:43
@jonahwilliams
Copy link
Member

This feels like a @jason-simmons and @chinmaygarde PR review :)

@gaaclarke gaaclarke requested review from chinmaygarde and removed request for jonahwilliams January 23, 2024 23:01
@@ -95,9 +110,20 @@ bool SaveScreenshot(std::unique_ptr<testing::Screenshot> screenshot) {
return screenshot->WriteToPNG(
testing::WorkingDirectory::Instance()->GetFilenamePath(filename));
}

bool ShouldTestHaveVulkanValidations() {
bool enable_vulkan_validations = false;
Copy link
Member

Choose a reason for hiding this comment

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

This variable is not needed. The function can return the result of the std::find comparison.

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

pimpl_->screenshotter = std::make_unique<testing::VulkanScreenshotter>(
enable_vulkan_validations);
if (enable_vulkan_validations) {
static absl::NoDestructor<std::unique_ptr<PlaygroundImpl>>
Copy link
Member

Choose a reason for hiding this comment

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

Move the validated and non-validated playground instances into GoldenPlaygroundTestImpl and access them through static methods.

I think that will make it clearer that these playground instances are used across all golden playground test cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to make sure the playgrounds are only created if they are used. The rules for static fields in classes are a bit fuzzy. I've split them out into a method called GetSharedVulkanPlayground. I think that addresses your concern about making these more clear. Let me know.

@@ -29,7 +30,7 @@ class VulkanScreenshotter : public Screenshotter {
PlaygroundImpl& GetPlayground() override { return *playground_; }

private:
std::unique_ptr<PlaygroundImpl> playground_;
const std::unique_ptr<PlaygroundImpl>& playground_;
Copy link
Member

Choose a reason for hiding this comment

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

Hold this as a PlaygroundImpl& instead of a reference to a unique_ptr

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to do that because that would require converting from a pointer to a reference which is removing validation for null pointers.

enable_vulkan_validations = true;
}

bool enable_vulkan_validations = ShouldTestHaveVulkanValidations();
Copy link
Member

Choose a reason for hiding this comment

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

Move this into the if GetParam() == kVulkan block

With the other changes below, the Vulkan block can be reduced to something like:

PlaygroundImpl& playground = ShouldTestHaveVulkanValidations()
    ? GoldenPlaygroundTestImpl::GetVulkanValidationPlayground()
    : GoldenPlaygroundTestImpl::GetVulkanPlayground();

pimpl_->screenshotter = std::make_unique<testing::VulkanScreenshotter>(playground);

Copy link
Member Author

Choose a reason for hiding this comment

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

This mostly looks like this now, the branch is in the GetSharedVulkanPlayground function though.

@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 24, 2024
@auto-submit auto-submit bot merged commit 144bb43 into flutter:main Jan 24, 2024
28 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 24, 2024
…142167)

flutter/engine@4bc368e...ed498f1

2024-01-24 flar@google.com [Impeller] allow non-square corner radii for fast blurs (flutter/engine#49994)
2024-01-24 103135467+sealesj@users.noreply.github.com Fuchsia + ocmock mirror migration (flutter/engine#50003)
2024-01-24 skia-flutter-autoroll@skia.org Roll Dart SDK from 0f7c49da26da to e0bf6a261895 (1 revision) (flutter/engine#50009)
2024-01-24 dkwingsmt@users.noreply.github.com [macOS] Fix: Memory sanitizer violated when encoding indirect strings (flutter/engine#49995)
2024-01-24 30870216+gaaclarke@users.noreply.github.com [Impeller] Share vulkan playground across goldens (flutter/engine#49981)

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 jacksongardner@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://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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
No open projects
Status: ✅ Done
3 participants