-
Notifications
You must be signed in to change notification settings - Fork 6k
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] finish migration to new render pass API. #49740
Conversation
cmd.stencil_reference = entity.GetClipDepth(); | ||
auto options = OptionsFromPass(pass); | ||
cmd.pipeline = renderer.GetPorterDuffBlendPipeline(options); | ||
#ifdef IMPELLER_DEBUG |
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.
I only added ifdefs where we do runtime string creation.
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.
I prefer the macro style we had previously. Did you find the string creation wasn't getting stripped out?
FWIW this could be transformed to a static string too since we only have so many blend modes. I did that at some point but the PR got caught up and dropped.
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.
Strings were still getting formatted, then dropped. We could add more static strings for these, I wouldn't be opposed. Feedback I got on the macro approach was that everyone hated it 😆
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.
LGTM, there is just one spot where there might be an accident logic change. Also, this introduces string copies which I think you were trying to avoid so maybe it's better to use the macro function still to set the debug labels.
cmd.stencil_reference = entity.GetClipDepth(); | ||
auto options = OptionsFromPass(pass); | ||
cmd.pipeline = renderer.GetPorterDuffBlendPipeline(options); | ||
#ifdef IMPELLER_DEBUG |
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.
I prefer the macro style we had previously. Did you find the string creation wasn't getting stripped out?
FWIW this could be transformed to a static string too since we only have so many blend modes. I did that at some point but the PR got caught up and dropped.
cmd.pipeline = renderer.GetClipPipeline(options); | ||
pass.AddCommand(Command(cmd)); | ||
pass.SetPipeline(renderer.GetClipPipeline(options)); | ||
pass.SetStencilReference(entity.GetClipDepth()); |
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.
Is this difference intentional? This used to be set outside of the conditional.
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.
It shouldn't actually matter, this one is redundant since I call Draw immediately below.
if (label_.empty()) { | ||
DEBUG_COMMAND_INFO(cmd, "Texture Fill"); | ||
pass.SetCommandLabel("Texture Fill"); |
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.
You just set it to the unnamed label in non debug builds.
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.
It will get dropped anyway, because SetCommandLabel will no-op
@@ -396,8 +397,7 @@ bool AtlasTextureContents::Render(const ContentContext& renderer, | |||
return true; | |||
} | |||
|
|||
Command cmd; | |||
DEBUG_COMMAND_INFO(cmd, "AtlasTexture"); | |||
pass.SetCommandLabel("AtlasTexture"); |
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.
FYI this is still incurring a copy because the parameter takes a std::string
.
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.
https://github.com/flutter/engine/blob/main/impeller/renderer/render_pass.h#L74 This takes a string view.
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.
RenderPass::OnSetLabel
takes an std::string
, it doesn't hit that?
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.
RenderPass label vs Command label
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.
Maybe we should rename SetCommandLabel at some point since the concept of Command has been eliminated.
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.
Yeah, I think that it would be better if the RenderPass label was provided during construction instead of via a Setter. Then we just need "SetLabel"
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.
lgtm with nit about being able to have static debug labels as a fallback
…e into finish_cmd_migration
…141489) flutter/engine@418c9e9...b8e5d47 2024-01-12 jonahwilliams@google.com [Impeller] move TrackedObjectsVK to separate file. (flutter/engine#49773) 2024-01-12 54558023+keyonghan@users.noreply.github.com Add gclient_variables back for linux_license and fix the excluded files (flutter/engine#49775) 2024-01-12 jonahwilliams@google.com [Impeller] Descriptor pool incremental allocation. (flutter/engine#49686) 2024-01-12 zanderso@users.noreply.github.com Relands: Refactors RBE support (flutter/engine#49660) 2024-01-12 jonahwilliams@google.com [Impeller] finish migration to new render pass API. (flutter/engine#49740) 2024-01-12 jonahwilliams@google.com [Impeller] remove Buffer type and associated abstractions. (flutter/engine#49702) 2024-01-12 54558023+keyonghan@users.noreply.github.com Remove `gclient_variables` from `linux_license.json` (flutter/engine#49766) 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 bdero@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
Part of flutter/flutter#140804
Migrate the rest of the commands in impeller to use the new API. Hide RenderPass::AddCommand. On subsequent changes I will be able to begin making some of these methods virtual so we can add more direct pass through. Though the vulkan backend will be blocked on changes to descriptor sets: #49686