From af922f9d441ffe62599cc32b11d7cd5e1c56382b 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 (#120) --- impeller/playground/imgui/imgui_impl_impeller.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/impeller/playground/imgui/imgui_impl_impeller.cc b/impeller/playground/imgui/imgui_impl_impeller.cc index 682ee9bb38163..b42696c4dc6e4 100644 --- a/impeller/playground/imgui/imgui_impl_impeller.cc +++ b/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.");