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

[Impeller] Fixed blit command missing tracking and added mock vulkan for tests - #41408

Merged
gaaclarke merged 12 commits into
flutter-team-archive:mainfrom
gaaclarke:mock-vulkan
Apr 25, 2023
Merged

gaaclarke merged 12 commits into
flutter-team-archive:mainfrom
gaaclarke:mock-vulkan

Conversation

@gaaclarke

Copy link
Copy Markdown
Contributor

Adds test for #41347 and adds an extra fix for flutter/flutter#125147.

Testing this is possible because I've mocked out all of vulkan. We can expand on this in the future we want to be more robust.

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 changed the title Mock vulkan [Impeller] Fixed blit command missing tracking and added mock vulkan for tests Apr 21, 2023
const auto& src = TextureVK::Cast(*source);

if (!encoder.Track(source)) {
if (!encoder.Track(source) || !encoder.Track(destination)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a tracking I missed until I wrote the test.

Comment on lines +65 to +70
friend class ::impeller::testing::
BlitCommandVkTest_BlitCopyTextureToTextureCommandVK_Test;
friend class ::impeller::testing::
BlitCommandVkTest_BlitCopyTextureToBufferCommandVK_Test;
friend class ::impeller::testing::
BlitCommandVkTest_BlitGenerateMipmapCommandVK_Test;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should just make the constructor public?

@gaaclarke
gaaclarke marked this pull request as ready for review April 22, 2023 00:06
@gaaclarke
gaaclarke requested a review from chinmaygarde April 22, 2023 00:06
@gaaclarke gaaclarke self-assigned this Apr 22, 2023
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/renderer/backend/vulkan/test/mock_vulkan.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TBH I would probably call this a fake instead of a mock, but I think the design is fine? I was more worried about individual test suites constructing mocks on the fly to test specific subsets of impeller - but a reusable fake seems perfectly reasonable to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was playing around in a different PR the ability to make it record what was communicated to it. I think as we expand the test suite when we fix bugs and add tests it may end up looking more and more like what we think of with mocks.

@jonahwilliams jonahwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 26, 2023
auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request Apr 26, 2023
flutter-team-archive/engine@34ece7a...b3cbf06

2023-04-25 [email protected] Migrate windows host engine to engine v2. (flutter-team-archive/engine#41487)
2023-04-25 [email protected] Roll Skia from f6f0c4b5ee98 to 809bf518d4ab (3 revisions) (flutter-team-archive/engine#41494)
2023-04-25 [email protected] Made sure not to turn on wide gamut support without impeller. (flutter-team-archive/engine#41460)
2023-04-25 [email protected] Roll Fuchsia Mac SDK from 5bc9_eyVcLoMrWvdO... to JKHSUjf-qEr0ZMdEi... (flutter-team-archive/engine#41493)
2023-04-25 [email protected] Roll Skia from 1bed4228ea3b to f6f0c4b5ee98 (7 revisions) (flutter-team-archive/engine#41492)
2023-04-25 [email protected] [Impeller] Fixed blit command missing tracking and added mock vulkan for tests (flutter-team-archive/engine#41408)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from 5bc9_eyVcLoM to JKHSUjf-qEr0

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.

Development

Successfully merging this pull request may close these issues.

2 participants