This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] EntityPass::Clone needs to clone harder #45313
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ EntityPass::EntityPass() = default; | |
|
||
EntityPass::~EntityPass() = default; | ||
|
||
void EntityPass::SetDelegate(std::unique_ptr<EntityPassDelegate> delegate) { | ||
void EntityPass::SetDelegate(std::shared_ptr<EntityPassDelegate> delegate) { | ||
if (!delegate) { | ||
return; | ||
} | ||
|
@@ -1023,6 +1023,16 @@ std::unique_ptr<EntityPass> EntityPass::Clone() const { | |
|
||
auto pass = std::make_unique<EntityPass>(); | ||
pass->SetElements(std::move(new_elements)); | ||
pass->backdrop_filter_reads_from_pass_texture_ = | ||
backdrop_filter_reads_from_pass_texture_; | ||
pass->advanced_blend_reads_from_pass_texture_ = | ||
advanced_blend_reads_from_pass_texture_; | ||
pass->backdrop_filter_proc_ = backdrop_filter_proc_; | ||
pass->blend_mode_ = blend_mode_; | ||
pass->delegate_ = delegate_; | ||
// Note: I tried also adding flood clip and bounds limit but one of the | ||
// two caused rendering in wonderous to break. It's 10:51 PM, and I'm | ||
// ready to move on. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow-up bug for investigating? The bounds limit might need to be transformed when the pass is applied with DrawPicture. |
||
return pass; | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(These read-counts are what's important for
DrawPicture
.)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 need the readcounts, the delegate, and the backdrop proc or wonderous will crash.
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.
That shouldn't be the case if the cloned pass is being used for
DrawPicture
(the elements are copied inline and these values should get discarded).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.
For the delegate and backdrop proc, that is. The read counts are important.
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 can confirm that wonderous does not work correctly without copying the backdrop prop and entity delegate. Maybe the entity delegate doesn't need to be copied but it does need to be set to a non-default value.
Let me double check that.
Uh oh!
There was an error while loading. Please reload this page.
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.
Ah nevermind, we don't need these for the base pass/inline merge, but we definitely need to copy them for the recursive clone, otherwise Very Bad Things will happen:
engine/impeller/entity/entity_pass.cc
Line 1015 in 494fd7f