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

Commit 36a2ea6

Browse files
authored
[Impeller] Load instead of restore drawing for non-MSAA passes (#40436)
[Impeller] Load instead of restore drawing for non-MSAA passes
1 parent 82b94b9 commit 36a2ea6

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

impeller/entity/inline_pass_context.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
100100

101101
RenderPassResult result;
102102

103-
if (pass_count_ > 0) {
103+
if (pass_count_ > 0 && pass_target_.GetRenderTarget()
104+
.GetColorAttachments()
105+
.find(0)
106+
->second.resolve_texture) {
104107
result.backdrop_texture =
105108
pass_target_.Flip(*context_->GetResourceAllocator());
106109
if (!result.backdrop_texture) {
@@ -111,8 +114,12 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
111114
auto color0 =
112115
pass_target_.GetRenderTarget().GetColorAttachments().find(0)->second;
113116

114-
color0.load_action =
115-
pass_count_ > 0 ? LoadAction::kDontCare : LoadAction::kClear;
117+
if (pass_count_ > 0) {
118+
color0.load_action =
119+
color0.resolve_texture ? LoadAction::kDontCare : LoadAction::kLoad;
120+
} else {
121+
color0.load_action = LoadAction::kClear;
122+
}
116123

117124
color0.store_action = color0.resolve_texture
118125
? StoreAction::kMultisampleResolve

impeller/entity/inline_pass_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class InlinePassContext {
1515
public:
1616
struct RenderPassResult {
1717
std::shared_ptr<RenderPass> pass;
18+
1819
std::shared_ptr<Texture> backdrop_texture;
1920
};
2021

0 commit comments

Comments
 (0)