From fa225be28bddf8e167bfec9bb9ac704fc0f14027 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Fri, 1 Mar 2024 03:34:47 -0800 Subject: [PATCH 1/2] Fix clip replay for GLES --- impeller/entity/entity_pass.cc | 14 ++++++++------ impeller/entity/inline_pass_context.cc | 1 + impeller/entity/inline_pass_context.h | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index f3f0f225c76c5..f85a383fb37da 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -721,12 +721,7 @@ bool EntityPass::RenderElement(Entity& element_entity, return false; } - // If the pass context returns a backdrop texture, we need to draw it to the - // current pass. We do this because it's faster and takes significantly less - // memory than storing/loading large MSAA textures. Also, it's not possible to - // blit the non-MSAA resolve texture of the previous pass to MSAA textures - // (let alone a transient one). - if (result.backdrop_texture) { + if (result.just_created) { // Restore any clips that were recorded before the backdrop filter was // applied. auto& replay_entities = clip_replay_->GetReplayEntities(); @@ -735,7 +730,14 @@ bool EntityPass::RenderElement(Entity& element_entity, VALIDATION_LOG << "Failed to render entity for clip restore."; } } + } + // If the pass context returns a backdrop texture, we need to draw it to the + // current pass. We do this because it's faster and takes significantly less + // memory than storing/loading large MSAA textures. Also, it's not possible to + // blit the non-MSAA resolve texture of the previous pass to MSAA textures + // (let alone a transient one). + if (result.backdrop_texture) { auto size_rect = Rect::MakeSize(result.pass->GetRenderTargetSize()); auto msaa_backdrop_contents = TextureContents::MakeRect(size_rect); msaa_backdrop_contents->SetStencilEnabled(false); diff --git a/impeller/entity/inline_pass_context.cc b/impeller/entity/inline_pass_context.cc index d39d41394fe34..73b15b16a9086 100644 --- a/impeller/entity/inline_pass_context.cc +++ b/impeller/entity/inline_pass_context.cc @@ -187,6 +187,7 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass( " Count=" + std::to_string(pass_count_)); result.pass = pass_; + result.just_created = true; if (!renderer_.GetContext()->GetCapabilities()->SupportsReadFromResolve() && result.backdrop_texture == diff --git a/impeller/entity/inline_pass_context.h b/impeller/entity/inline_pass_context.h index 43ee0f6b98f44..93e69ff1737df 100644 --- a/impeller/entity/inline_pass_context.h +++ b/impeller/entity/inline_pass_context.h @@ -17,6 +17,7 @@ namespace impeller { class InlinePassContext { public: struct RenderPassResult { + bool just_created = false; std::shared_ptr pass; std::shared_ptr backdrop_texture; }; From 4682661abc72ebb0d9816d11c61a4d95aed47c3a Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 4 Mar 2024 12:50:00 -0800 Subject: [PATCH 2/2] blank