From 15efb79d10f449fa98bd1dc7323b09af9331e449 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Wed, 6 Apr 2022 21:46:03 -0700 Subject: [PATCH] Ignore the stencil in the imgui pipeline (flutter/engine#120) --- .../impeller/playground/imgui/imgui_impl_impeller.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/flutter/impeller/playground/imgui/imgui_impl_impeller.cc b/engine/src/flutter/impeller/playground/imgui/imgui_impl_impeller.cc index 682ee9bb381..b42696c4dc6 100644 --- a/engine/src/flutter/impeller/playground/imgui/imgui_impl_impeller.cc +++ b/engine/src/flutter/impeller/playground/imgui/imgui_impl_impeller.cc @@ -89,6 +89,13 @@ bool ImGui_ImplImpeller_Init(std::shared_ptr context) { impeller::ImguiRasterFragmentShader>:: MakeDefaultPipelineDescriptor(*context); desc->SetSampleCount(impeller::SampleCount::kCount4); + auto stencil = desc->GetFrontStencilAttachmentDescriptor(); + if (stencil.has_value()) { + stencil->stencil_compare = impeller::CompareFunction::kAlways; + stencil->depth_stencil_pass = impeller::StencilOperation::kKeep; + desc->SetStencilAttachmentDescriptors(stencil.value()); + } + bd->pipeline = context->GetPipelineLibrary()->GetRenderPipeline(std::move(desc)).get(); IM_ASSERT(bd->pipeline != nullptr && "Could not create ImGui pipeline.");