From 0794708717520e40cc23a5c9504568ec50bd11f2 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 20 Dec 2022 14:18:42 -0800 Subject: [PATCH] [Impeller] Remove depth/stencil attachments from imgui pipeline --- impeller/playground/imgui/imgui_impl_impeller.cc | 10 ++++------ impeller/renderer/pipeline_descriptor.cc | 8 ++++---- impeller/renderer/pipeline_descriptor.h | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/impeller/playground/imgui/imgui_impl_impeller.cc b/impeller/playground/imgui/imgui_impl_impeller.cc index d93a7369e7524..443b32d8dcc85 100644 --- a/impeller/playground/imgui/imgui_impl_impeller.cc +++ b/impeller/playground/imgui/imgui_impl_impeller.cc @@ -94,12 +94,10 @@ bool ImGui_ImplImpeller_Init( auto desc = impeller::PipelineBuilder:: MakeDefaultPipelineDescriptor(*context); - 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()); - } + desc->SetStencilPixelFormat(impeller::PixelFormat::kUnknown); + desc->SetStencilAttachmentDescriptors(std::nullopt); + desc->SetDepthPixelFormat(impeller::PixelFormat::kUnknown); + desc->SetDepthStencilAttachmentDescriptor(std::nullopt); bd->pipeline = context->GetPipelineLibrary()->GetPipeline(std::move(desc)).Get(); diff --git a/impeller/renderer/pipeline_descriptor.cc b/impeller/renderer/pipeline_descriptor.cc index c6d8029e46b64..aaebe968485c2 100644 --- a/impeller/renderer/pipeline_descriptor.cc +++ b/impeller/renderer/pipeline_descriptor.cc @@ -135,19 +135,19 @@ PipelineDescriptor& PipelineDescriptor::SetStencilPixelFormat( } PipelineDescriptor& PipelineDescriptor::SetDepthStencilAttachmentDescriptor( - DepthAttachmentDescriptor desc) { + std::optional desc) { depth_attachment_descriptor_ = desc; return *this; } PipelineDescriptor& PipelineDescriptor::SetStencilAttachmentDescriptors( - StencilAttachmentDescriptor front_and_back) { + std::optional front_and_back) { return SetStencilAttachmentDescriptors(front_and_back, front_and_back); } PipelineDescriptor& PipelineDescriptor::SetStencilAttachmentDescriptors( - StencilAttachmentDescriptor front, - StencilAttachmentDescriptor back) { + std::optional front, + std::optional back) { front_stencil_attachment_descriptor_ = front; back_stencil_attachment_descriptor_ = back; return *this; diff --git a/impeller/renderer/pipeline_descriptor.h b/impeller/renderer/pipeline_descriptor.h index 7b1ed5aa00a18..e7ba72efc48eb 100644 --- a/impeller/renderer/pipeline_descriptor.h +++ b/impeller/renderer/pipeline_descriptor.h @@ -71,17 +71,17 @@ class PipelineDescriptor final : public Comparable { const ColorAttachmentDescriptor* GetLegacyCompatibleColorAttachment() const; PipelineDescriptor& SetDepthStencilAttachmentDescriptor( - DepthAttachmentDescriptor desc); + std::optional desc); std::optional GetDepthStencilAttachmentDescriptor() const; PipelineDescriptor& SetStencilAttachmentDescriptors( - StencilAttachmentDescriptor front_and_back); + std::optional front_and_back); PipelineDescriptor& SetStencilAttachmentDescriptors( - StencilAttachmentDescriptor front, - StencilAttachmentDescriptor back); + std::optional front, + std::optional back); std::optional GetFrontStencilAttachmentDescriptor() const;