[Impeller] Always create at least one RenderPass if the clear color has been overridden (flutter/engine#40793)

[Impeller] Always create at least one RenderPass if the clear color has been overridden
This commit is contained in:
Brandon DeRosier
2023-03-30 13:09:48 -07:00
committed by GitHub
parent 8116ea14c7
commit 8fe44e180e

View File

@@ -478,6 +478,15 @@ bool EntityPass::OnRender(ContentContext& renderer,
return false;
}
if (!(clear_color_ == Color::BlackTransparent())) {
// Force the pass context to create at least one new pass if the clear color
// is present. The `EndPass` first ensures that the clear color will get
// applied even if this EntityPass is getting collapsed into the parent
// pass.
pass_context.EndPass();
pass_context.GetRenderPass(pass_depth);
}
auto render_element = [&stencil_depth_floor, &pass_context, &pass_depth,
&renderer, &stencil_coverage_stack,
&global_pass_position](Entity& element_entity) {