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

Commit 7479adc

Browse files
committed
Fix clip replay for GLES
1 parent e55eab9 commit 7479adc

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

impeller/entity/entity_pass.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,7 @@ bool EntityPass::RenderElement(Entity& element_entity,
721721
return false;
722722
}
723723

724-
// If the pass context returns a backdrop texture, we need to draw it to the
725-
// current pass. We do this because it's faster and takes significantly less
726-
// memory than storing/loading large MSAA textures. Also, it's not possible to
727-
// blit the non-MSAA resolve texture of the previous pass to MSAA textures
728-
// (let alone a transient one).
729-
if (result.backdrop_texture) {
724+
if (result.just_created) {
730725
// Restore any clips that were recorded before the backdrop filter was
731726
// applied.
732727
auto& replay_entities = clip_replay_->GetReplayEntities();
@@ -735,7 +730,14 @@ bool EntityPass::RenderElement(Entity& element_entity,
735730
VALIDATION_LOG << "Failed to render entity for clip restore.";
736731
}
737732
}
733+
}
738734

735+
// If the pass context returns a backdrop texture, we need to draw it to the
736+
// current pass. We do this because it's faster and takes significantly less
737+
// memory than storing/loading large MSAA textures. Also, it's not possible to
738+
// blit the non-MSAA resolve texture of the previous pass to MSAA textures
739+
// (let alone a transient one).
740+
if (result.backdrop_texture) {
739741
auto size_rect = Rect::MakeSize(result.pass->GetRenderTargetSize());
740742
auto msaa_backdrop_contents = TextureContents::MakeRect(size_rect);
741743
msaa_backdrop_contents->SetStencilEnabled(false);

impeller/entity/inline_pass_context.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
187187
" Count=" + std::to_string(pass_count_));
188188

189189
result.pass = pass_;
190+
result.just_created = true;
190191

191192
if (!renderer_.GetContext()->GetCapabilities()->SupportsReadFromResolve() &&
192193
result.backdrop_texture ==

impeller/entity/inline_pass_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace impeller {
1717
class InlinePassContext {
1818
public:
1919
struct RenderPassResult {
20+
bool just_created = false;
2021
std::shared_ptr<RenderPass> pass;
2122
std::shared_ptr<Texture> backdrop_texture;
2223
};

0 commit comments

Comments
 (0)