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

Commit 8860b27

Browse files
committed
whisper words of wisdom
1 parent 6d94146 commit 8860b27

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

impeller/entity/contents/contents.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ ContentContextOptions OptionsFromPass(const RenderPass& pass) {
2121
ContentContextOptions opts;
2222
opts.sample_count = pass.GetSampleCount();
2323
opts.color_attachment_pixel_format = pass.GetRenderTargetPixelFormat();
24-
opts.has_depth_stencil_attachments = pass.HasStencilAttachment();
24+
25+
bool has_depth_stencil_attachments =
26+
pass.HasDepthAttachment() && pass.HasStencilAttachment();
27+
FML_DCHECK(pass.HasDepthAttachment() == pass.HasStencilAttachment());
28+
29+
opts.has_depth_stencil_attachments = has_depth_stencil_attachments;
2530
return opts;
2631
}
2732

impeller/renderer/render_pass.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RenderPass::RenderPass(std::shared_ptr<const Context> context,
1212
: context_(std::move(context)),
1313
sample_count_(target.GetSampleCount()),
1414
pixel_format_(target.GetRenderTargetPixelFormat()),
15+
has_depth_attachment_(target.GetDepthAttachment().has_value()),
1516
has_stencil_attachment_(target.GetStencilAttachment().has_value()),
1617
render_target_size_(target.GetRenderTargetSize()),
1718
render_target_(target),
@@ -27,6 +28,10 @@ PixelFormat RenderPass::GetRenderTargetPixelFormat() const {
2728
return pixel_format_;
2829
}
2930

31+
bool RenderPass::HasDepthAttachment() const {
32+
return has_depth_attachment_;
33+
}
34+
3035
bool RenderPass::HasStencilAttachment() const {
3136
return has_stencil_attachment_;
3237
}

impeller/renderer/render_pass.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ class RenderPass : public ResourceBinder {
156156
/// @brief The pixel format of the attached render target.
157157
PixelFormat GetRenderTargetPixelFormat() const;
158158

159+
//----------------------------------------------------------------------------
160+
/// @brief Whether the render target has a depth attachment.
161+
bool HasDepthAttachment() const;
162+
159163
//----------------------------------------------------------------------------
160164
/// @brief Whether the render target has an stencil attachment.
161165
bool HasStencilAttachment() const;
@@ -169,6 +173,7 @@ class RenderPass : public ResourceBinder {
169173
// a const reference.
170174
const SampleCount sample_count_;
171175
const PixelFormat pixel_format_;
176+
const bool has_depth_attachment_;
172177
const bool has_stencil_attachment_;
173178
const ISize render_target_size_;
174179
const RenderTarget render_target_;

0 commit comments

Comments
 (0)