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

Commit cbb3f98

Browse files
authored
[Impeller] Always create at least one RenderPass if the clear color has been overridden (#40793)
[Impeller] Always create at least one RenderPass if the clear color has been overridden
1 parent a891237 commit cbb3f98

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

impeller/entity/entity_pass.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,15 @@ bool EntityPass::OnRender(ContentContext& renderer,
478478
return false;
479479
}
480480

481+
if (!(clear_color_ == Color::BlackTransparent())) {
482+
// Force the pass context to create at least one new pass if the clear color
483+
// is present. The `EndPass` first ensures that the clear color will get
484+
// applied even if this EntityPass is getting collapsed into the parent
485+
// pass.
486+
pass_context.EndPass();
487+
pass_context.GetRenderPass(pass_depth);
488+
}
489+
481490
auto render_element = [&stencil_depth_floor, &pass_context, &pass_depth,
482491
&renderer, &stencil_coverage_stack,
483492
&global_pass_position](Entity& element_entity) {

0 commit comments

Comments
 (0)