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

Commit c7eae29

Browse files
authored
[Impeller] Remove depth/stencil attachments from imgui pipeline (#38427)
1 parent 75d7557 commit c7eae29

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

impeller/playground/imgui/imgui_impl_impeller.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@ bool ImGui_ImplImpeller_Init(
9494
auto desc = impeller::PipelineBuilder<impeller::ImguiRasterVertexShader,
9595
impeller::ImguiRasterFragmentShader>::
9696
MakeDefaultPipelineDescriptor(*context);
97-
auto stencil = desc->GetFrontStencilAttachmentDescriptor();
98-
if (stencil.has_value()) {
99-
stencil->stencil_compare = impeller::CompareFunction::kAlways;
100-
stencil->depth_stencil_pass = impeller::StencilOperation::kKeep;
101-
desc->SetStencilAttachmentDescriptors(stencil.value());
102-
}
97+
desc->SetStencilPixelFormat(impeller::PixelFormat::kUnknown);
98+
desc->SetStencilAttachmentDescriptors(std::nullopt);
99+
desc->SetDepthPixelFormat(impeller::PixelFormat::kUnknown);
100+
desc->SetDepthStencilAttachmentDescriptor(std::nullopt);
103101

104102
bd->pipeline =
105103
context->GetPipelineLibrary()->GetPipeline(std::move(desc)).Get();

impeller/renderer/pipeline_descriptor.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,19 @@ PipelineDescriptor& PipelineDescriptor::SetStencilPixelFormat(
135135
}
136136

137137
PipelineDescriptor& PipelineDescriptor::SetDepthStencilAttachmentDescriptor(
138-
DepthAttachmentDescriptor desc) {
138+
std::optional<DepthAttachmentDescriptor> desc) {
139139
depth_attachment_descriptor_ = desc;
140140
return *this;
141141
}
142142

143143
PipelineDescriptor& PipelineDescriptor::SetStencilAttachmentDescriptors(
144-
StencilAttachmentDescriptor front_and_back) {
144+
std::optional<StencilAttachmentDescriptor> front_and_back) {
145145
return SetStencilAttachmentDescriptors(front_and_back, front_and_back);
146146
}
147147

148148
PipelineDescriptor& PipelineDescriptor::SetStencilAttachmentDescriptors(
149-
StencilAttachmentDescriptor front,
150-
StencilAttachmentDescriptor back) {
149+
std::optional<StencilAttachmentDescriptor> front,
150+
std::optional<StencilAttachmentDescriptor> back) {
151151
front_stencil_attachment_descriptor_ = front;
152152
back_stencil_attachment_descriptor_ = back;
153153
return *this;

impeller/renderer/pipeline_descriptor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ class PipelineDescriptor final : public Comparable<PipelineDescriptor> {
7171
const ColorAttachmentDescriptor* GetLegacyCompatibleColorAttachment() const;
7272

7373
PipelineDescriptor& SetDepthStencilAttachmentDescriptor(
74-
DepthAttachmentDescriptor desc);
74+
std::optional<DepthAttachmentDescriptor> desc);
7575

7676
std::optional<DepthAttachmentDescriptor> GetDepthStencilAttachmentDescriptor()
7777
const;
7878

7979
PipelineDescriptor& SetStencilAttachmentDescriptors(
80-
StencilAttachmentDescriptor front_and_back);
80+
std::optional<StencilAttachmentDescriptor> front_and_back);
8181

8282
PipelineDescriptor& SetStencilAttachmentDescriptors(
83-
StencilAttachmentDescriptor front,
84-
StencilAttachmentDescriptor back);
83+
std::optional<StencilAttachmentDescriptor> front,
84+
std::optional<StencilAttachmentDescriptor> back);
8585

8686
std::optional<StencilAttachmentDescriptor>
8787
GetFrontStencilAttachmentDescriptor() const;

0 commit comments

Comments
 (0)