-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] adds vulkan golden images #49849
Conversation
|
making it not a draft so we can get golden image tests |
c639534 to
96b8d97
Compare
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
|
The colors for the golden images are different than the ones we are generating. I verified that the colors are correct by looking at the colors inside the generated png for |
matanlurey
left a comment
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.
Seems reasonable to me. A few questions, most non-blocking
| } | ||
|
|
||
| const UInt8* MetalScreenshot::GetBytes() const { | ||
| const uint8_t* MetalScreenshot::GetBytes() const { |
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.
(non-blocking) for my own curiosity, what is the difference between UInt8 and uint8_t here?
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.
UInt8 comes from Apple's c headers and used in Apple code, uint8_t comes from stdint.h.
| FML_CHECK(success); | ||
| latch.Wait(); | ||
|
|
||
| // TODO(gaaclarke): Replace CoreImage requirement with something |
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.
Just checking I understand - this is OSX-only code for MoltenVK?
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.
In this case we are using swiftshader on macos. The tests should fail if you use moltenvk, there's a check in the TearDown somewhere that makes sure libMoltenVK.dylib isn't loaded.
| } | ||
| EXPECT_EQ(max_mip_count, blur_required_mip_count); | ||
| // The log is FML_DLOG, so only check in debug builds. | ||
| #ifndef NDEBUG |
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.
Do we build the unittests outside of debug mode?
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.
Yea, we run these in release build when we do golden image testing. The reason why was trying to keep the visual result we are looking at as close as possible to what users would see. It may be necessary now too that swiftshader goldens take >3s to generate on debug builds.
| } | ||
|
|
||
| bool SaveScreenshot(std::unique_ptr<testing::MetalScreenshot> screenshot) { | ||
| bool SaveScreenshot(std::unique_ptr<testing::Screenshot> screenshot) { |
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.
(non-blocking) Could this just be a reference to a screenshot instead of a pointer?
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.
Yep, it could have been. In this case taking ownership of the screenshot or not is moot since no one ever uses it after it's saved. The minor downside of that is that in c++ you don't know from the call site if you are working with references or not like you do with rust. So keeping things as smart pointers avoids the situation where you have to make sure you aren't accidentally introducing an implicit copy.
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.
(if I didn't want to take ownership, I would probably have made a reference to a unique_ptr instead of using a reference to a Screenshot for the above reason.)
| public: | ||
| virtual ~Screenshot() = default; | ||
|
|
||
| virtual const uint8_t* GetBytes() const = 0; |
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.
Now that we have this neatly seperated it might be nice to ad 1-line comments at least for the non-obvious APIs (like I'm not sure what GetBytesPerRow() does for example, though maybe it's obvious to graphics engineers?)
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.
Done, added docstrings.
|
Golden file changes are available for triage from new commit, Click here to view. |
|
Note for future archeology: These golden images were previously being generated with metal. This fixes the implementation to actually use vulkan to render the golden images. So if it seems like this PR changed a golden image test, it didn't since the old ones were a lie. I looked at all the diffs and they looked good despite some issue with gamma in the old tests that is now resolved. |
…141914) flutter/engine@d00e55f...a9b87c6 2024-01-20 [email protected] [Impeller] null check vertex buffer. (flutter/engine#49915) 2024-01-19 [email protected] [Impeller] adds vulkan golden images (flutter/engine#49849) 2024-01-19 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Fuchsia] Redo - Use chromium test-scripts to download images and execute tests" (flutter/engine#49908) 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://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
fixes flutter/flutter#141705
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.