| Flutter Impeller |

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
impeller::RenderTarget Class Referencefinal

`#include <render_target.h>`

## Classes
struct | AttachmentConfig
struct | AttachmentConfigMSAA

## Public Member Functions
| RenderTarget ()
| ~RenderTarget ()
bool | IsValid () const
void | SetupStencilAttachment (const Context &context, RenderTargetAllocator &allocator, ISize size, bool msaa, const std::string &label="Offscreen", AttachmentConfig stencil_attachment_config=kDefaultStencilAttachmentConfig)
SampleCount | GetSampleCount () const
bool | HasColorAttachment (size_t index) const
ISize | GetRenderTargetSize () const
std::shared_ptr< Texture > | GetRenderTargetTexture () const
PixelFormat | GetRenderTargetPixelFormat () const
std::optional< ISize > | GetColorAttachmentSize (size_t index) const
RenderTarget & | SetColorAttachment (const ColorAttachment &attachment, size_t index)
RenderTarget & | SetDepthAttachment (std::optional< DepthAttachment > attachment)
RenderTarget & | SetStencilAttachment (std::optional< StencilAttachment > attachment)
size_t | GetMaxColorAttacmentBindIndex () const
const std::map< size_t, ColorAttachment > & | GetColorAttachments () const
const std::optional< DepthAttachment > & | GetDepthAttachment () const
const std::optional< StencilAttachment > & | GetStencilAttachment () const
size_t | GetTotalAttachmentCount () const
void | IterateAllAttachments (const std::function< bool(const Attachment &attachment)> &iterator) const
std::string | ToString () const

## Static Public Member Functions
static RenderTarget | CreateOffscreen (const Context &context, RenderTargetAllocator &allocator, ISize size, const std::string &label="Offscreen", AttachmentConfig color_attachment_config=kDefaultColorAttachmentConfig, std::optional< AttachmentConfig > stencil_attachment_config=kDefaultStencilAttachmentConfig)
static RenderTarget | CreateOffscreenMSAA (const Context &context, RenderTargetAllocator &allocator, ISize size, const std::string &label="Offscreen MSAA", AttachmentConfigMSAA color_attachment_config=kDefaultColorAttachmentConfigMSAA, std::optional< AttachmentConfig > stencil_attachment_config=kDefaultStencilAttachmentConfig)

## Static Public Attributes
static constexpr AttachmentConfig | kDefaultColorAttachmentConfig
static constexpr AttachmentConfigMSAA | kDefaultColorAttachmentConfigMSAA
static constexpr AttachmentConfig | kDefaultStencilAttachmentConfig

## Detailed Description

Definition at line 48 of file render_target.h.

## Constructor & Destructor Documentation

## ◆ RenderTarget()

impeller::RenderTarget::RenderTarget | ( |  | ) |
| default

## ◆ ~RenderTarget()

impeller::RenderTarget::~RenderTarget | ( |  | ) |
| default

## Member Function Documentation

## ◆ CreateOffscreen()

RenderTarget impeller::RenderTarget::CreateOffscreen | ( | const Context & | context,
|  | RenderTargetAllocator & | allocator,
|  | ISize | size,
|  | const std::string & | label = `"Offscreen"`,
|  | AttachmentConfig | color_attachment_config = `kDefaultColorAttachmentConfig`,
|  | std::optional< AttachmentConfig > | stencil_attachment_config = `kDefaultStencilAttachmentConfig`
| ) |  |
| static

Definition at line 223 of file render_target.cc.

229 {
230 if (size.IsEmpty()) {
231 return {};
232 }
233
234 // Dont force additional PSO variants on Vulkan.
235 #ifdef FML_OS_ANDROID
236 FML_DCHECK(stencil_attachment_config.has_value());
237 #endif // FML_OS_ANDROID
238
239 RenderTarget target;
240 PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
241 TextureDescriptor color_tex0;
242 color_tex0.storage_mode = color_attachment_config.storage_mode;
243 color_tex0.format = pixel_format;
244 color_tex0.size = size;
245 color_tex0.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget) |
246 static_cast<uint64_t>(TextureUsage::kShaderRead);
247
248 ColorAttachment color0;
249 color0.clear_color = color_attachment_config.clear_color;
250 color0.load_action = color_attachment_config.load_action;
251 color0.store_action = color_attachment_config.store_action;
252 color0.texture = allocator.CreateTexture(color_tex0);
253
254 if (!color0.texture) {
255 return {};
256 }
257 color0.texture->SetLabel(SPrintF("%s Color Texture", label.c_str()));
258 target.SetColorAttachment(color0, 0u);
259
260 if (stencil_attachment_config.has_value()) {
261 target.SetupStencilAttachment(context, allocator, size, false, label,
262 stencil_attachment_config.value());
263 } else {
264 target.SetStencilAttachment(std::nullopt);
265 }
266
267 return target;
268 }

References impeller::RenderTarget::AttachmentConfig::clear_color, impeller::ColorAttachment::clear_color, impeller::RenderTargetAllocator::CreateTexture(), impeller::TextureDescriptor::format, impeller::Context::GetCapabilities(), impeller::TSize< T >::IsEmpty(), impeller::kRenderTarget, impeller::kShaderRead, impeller::RenderTarget::AttachmentConfig::load_action, impeller::Attachment::load_action, SetColorAttachment(), SetStencilAttachment(), SetupStencilAttachment(), impeller::TextureDescriptor::size, impeller::SPrintF(), impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfig::storage_mode, impeller::RenderTarget::AttachmentConfig::store_action, impeller::Attachment::store_action, impeller::Attachment::texture, and impeller::TextureDescriptor::usage.

Referenced by impeller::CreateRenderTarget(), impeller::ContentContext::MakeSubpass(), and impeller::testing::TEST_P().

## ◆ CreateOffscreenMSAA()

RenderTarget impeller::RenderTarget::CreateOffscreenMSAA | ( | const Context & | context,
|  | RenderTargetAllocator & | allocator,
|  | ISize | size,
|  | const std::string & | label = `"Offscreen MSAA"`,
|  | AttachmentConfigMSAA | color_attachment_config = `kDefaultColorAttachmentConfigMSAA`,
|  | std::optional< AttachmentConfig > | stencil_attachment_config = `kDefaultStencilAttachmentConfig`
| ) |  |
| static

Definition at line 270 of file render_target.cc.

276 {
277 if (size.IsEmpty()) {
278 return {};
279 }
280
281 // Dont force additional PSO variants on Vulkan.
282 #ifdef FML_OS_ANDROID
283 FML_DCHECK(stencil_attachment_config.has_value());
284 #endif // FML_OS_ANDROID
285
286 RenderTarget target;
287 PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
288
289 // Create MSAA color texture.
290
291 TextureDescriptor color0_tex_desc;
292 color0_tex_desc.storage_mode = color_attachment_config.storage_mode;
293 color0_tex_desc.type = TextureType::kTexture2DMultisample;
294 color0_tex_desc.sample_count = SampleCount::kCount4;
295 color0_tex_desc.format = pixel_format;
296 color0_tex_desc.size = size;
297 color0_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);
298
299 auto color0_msaa_tex = allocator.CreateTexture(color0_tex_desc);
300 if (!color0_msaa_tex) {
301 VALIDATION_LOG << "Could not create multisample color texture.";
302 return {};
303 }
304 color0_msaa_tex->SetLabel(
305 SPrintF("%s Color Texture (Multisample)", label.c_str()));
306
307 // Create color resolve texture.
308
309 TextureDescriptor color0_resolve_tex_desc;
310 color0_resolve_tex_desc.storage_mode =
311 color_attachment_config.resolve_storage_mode;
312 color0_resolve_tex_desc.format = pixel_format;
313 color0_resolve_tex_desc.size = size;
314 color0_resolve_tex_desc.compression_type = CompressionType::kLossy;
315 color0_resolve_tex_desc.usage =
316 static_cast<uint64_t>(TextureUsage::kRenderTarget) |
317 static_cast<uint64_t>(TextureUsage::kShaderRead);
318
319 auto color0_resolve_tex = allocator.CreateTexture(color0_resolve_tex_desc);
320 if (!color0_resolve_tex) {
321 VALIDATION_LOG << "Could not create color texture.";
322 return {};
323 }
324 color0_resolve_tex->SetLabel(SPrintF("%s Color Texture", label.c_str()));
325
326 // Color attachment.
327
328 ColorAttachment color0;
329 color0.clear_color = color_attachment_config.clear_color;
330 color0.load_action = color_attachment_config.load_action;
331 color0.store_action = color_attachment_config.store_action;
332 color0.texture = color0_msaa_tex;
333 color0.resolve_texture = color0_resolve_tex;
334
335 target.SetColorAttachment(color0, 0u);
336
337 // Create MSAA stencil texture.
338
339 if (stencil_attachment_config.has_value()) {
340 target.SetupStencilAttachment(context, allocator, size, true, label,
341 stencil_attachment_config.value());
342 } else {
343 target.SetStencilAttachment(std::nullopt);
344 }
345
346 return target;
347 }

References impeller::RenderTarget::AttachmentConfigMSAA::clear_color, impeller::ColorAttachment::clear_color, impeller::TextureDescriptor::compression_type, impeller::RenderTargetAllocator::CreateTexture(), impeller::TextureDescriptor::format, impeller::Context::GetCapabilities(), impeller::TSize< T >::IsEmpty(), impeller::kCount4, impeller::kLossy, impeller::kRenderTarget, impeller::kShaderRead, impeller::kTexture2DMultisample, impeller::RenderTarget::AttachmentConfigMSAA::load_action, impeller::Attachment::load_action, impeller::RenderTarget::AttachmentConfigMSAA::resolve_storage_mode, impeller::Attachment::resolve_texture, impeller::TextureDescriptor::sample_count, SetColorAttachment(), SetStencilAttachment(), SetupStencilAttachment(), impeller::TextureDescriptor::size, impeller::SPrintF(), impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfigMSAA::storage_mode, impeller::RenderTarget::AttachmentConfigMSAA::store_action, impeller::Attachment::store_action, impeller::Attachment::texture, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, and VALIDATION_LOG.

Referenced by impeller::CreateRenderTarget(), impeller::ContentContext::MakeSubpass(), and impeller::SceneContents::Render().

## ◆ GetColorAttachments()

const std::map< size_t, ColorAttachment > & impeller::RenderTarget::GetColorAttachments | ( |  | ) | const

Definition at line 209 of file render_target.cc.

210 {
211 return colors_;
212 }

Referenced by impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::GetVKClearValues(), and impeller::ToMTLRenderPassDescriptor().

## ◆ GetColorAttachmentSize()

std::optional< ISize > impeller::RenderTarget::GetColorAttachmentSize | ( | size_t | index | ) | const

Definition at line 140 of file render_target.cc.

140 {
141 auto found = colors_.find(index);
142
143 if (found == colors_.end()) {
144 return std::nullopt;
145 }
146
147 return found->second.texture->GetSize();
148 }

Referenced by GetRenderTargetSize(), and impeller::Surface::Surface().

## ◆ GetDepthAttachment()

const std::optional< DepthAttachment > & impeller::RenderTarget::GetDepthAttachment | ( |  | ) | const

Definition at line 214 of file render_target.cc.

214 {
215 return depth_;
216 }

Referenced by impeller::GetVKClearValues(), and impeller::ToMTLRenderPassDescriptor().

## ◆ GetMaxColorAttacmentBindIndex()

size_t impeller::RenderTarget::GetMaxColorAttacmentBindIndex | ( |  | ) | const

Definition at line 172 of file render_target.cc.

172 {
173 size_t max = 0;
174 for (const auto& color : colors_) {
175 max = std::max(color.first, max);
176 }
177 return max;
178 }

## ◆ GetRenderTargetPixelFormat()

PixelFormat impeller::RenderTarget::GetRenderTargetPixelFormat | ( |  | ) | const

Definition at line 164 of file render_target.cc.

164 {
165 if (auto texture = GetRenderTargetTexture(); texture != nullptr) {
166 return texture->GetTextureDescriptor().format;
167 }
168
169 return PixelFormat::kUnknown;
170 }

References GetRenderTargetTexture(), and impeller::kUnknown.

Referenced by impeller::OptionsFromPass().

## ◆ GetRenderTargetSize()

ISize impeller::RenderTarget::GetRenderTargetSize | ( |  | ) | const

Definition at line 150 of file render_target.cc.

150 {
151 auto size = GetColorAttachmentSize(0u);
152 return size.has_value() ? size.value() : ISize{};
153 }

References GetColorAttachmentSize().

Referenced by impeller::RenderPass::AddCommand(), impeller::RenderPass::GetRenderTargetSize(), and impeller::scene::Scene::Render().

## ◆ GetRenderTargetTexture()

std::shared_ptr< Texture > impeller::RenderTarget::GetRenderTargetTexture | ( |  | ) | const

Definition at line 155 of file render_target.cc.

155 {
156 auto found = colors_.find(0u);
157 if (found == colors_.end()) {
158 return nullptr;
159 }
160 return found->second.resolve_texture ? found->second.resolve_texture
161 : found->second.texture;
162 }

Referenced by GetRenderTargetPixelFormat(), impeller::InlinePassContext::GetTexture(), impeller::ContentContext::MakeSubpass(), and impeller::SceneContents::Render().

## ◆ GetSampleCount()

SampleCount impeller::RenderTarget::GetSampleCount | ( |  | ) | const

Definition at line 126 of file render_target.cc.

126 {
127 if (auto found = colors_.find(0u); found != colors_.end()) {
128 return found->second.texture->GetTextureDescriptor().sample_count;
129 }
130 return SampleCount::kCount1;
131 }

References impeller::kCount1.

Referenced by impeller::scene::Material::GetContextOptions(), and impeller::OptionsFromPass().

## ◆ GetStencilAttachment()

const std::optional< StencilAttachment > & impeller::RenderTarget::GetStencilAttachment | ( |  | ) | const

Definition at line 218 of file render_target.cc.

219 {
220 return stencil_;
221 }

Referenced by impeller::InlinePassContext::GetRenderPass(), impeller::GetVKClearValues(), impeller::OptionsFromPass(), and impeller::ToMTLRenderPassDescriptor().

## ◆ GetTotalAttachmentCount()

size_t impeller::RenderTarget::GetTotalAttachmentCount | ( |  | ) | const

Definition at line 380 of file render_target.cc.

380 {
381 size_t count = 0u;
382 for (const auto& [_, color] : colors_) {
383 if (color.texture) {
384 count++;
385 }
386 if (color.resolve_texture) {
387 count++;
388 }
389 }
390 if (depth_.has_value()) {
391 count++;
392 }
393 if (stencil_.has_value()) {
394 count++;
395 }
396 return count;
397 }

## ◆ HasColorAttachment()

bool impeller::RenderTarget::HasColorAttachment | ( | size_t | index | ) | const

Definition at line 133 of file render_target.cc.

133 {
134 if (auto found = colors_.find(index); found != colors_.end()) {
135 return true;
136 }
137 return false;
138 }

Referenced by IsValid().

## ◆ IsValid()

bool impeller::RenderTarget::IsValid | ( |  | ) | const

Definition at line 34 of file render_target.cc.

34 {
35 // Validate that there is a color attachment at zero index.
36 if (!HasColorAttachment(0u)) {
37 VALIDATION_LOG
38 << "Render target does not have color attachment at index 0.";
39 return false;
40 }
41
42 // Validate that all attachments are of the same size.
43 {
44 std::optional<ISize> size;
45 bool sizes_are_same = true;
46 auto iterator = [&](const Attachment& attachment) -> bool {
47 if (!size.has_value()) {
48 size = attachment.texture->GetSize();
49 }
50 if (size != attachment.texture->GetSize()) {
51 sizes_are_same = false;
52 return false;
53 }
54 return true;
55 };
56 IterateAllAttachments(iterator);
57 if (!sizes_are_same) {
58 VALIDATION_LOG
59 << "Sizes of all render target attachments are not the same.";
60 return false;
61 }
62 }
63
64 // Validate that all attachments are of the same type and sample counts.
65 {
66 std::optional<TextureType> texture_type;
67 std::optional<SampleCount> sample_count;
68 bool passes_type_validation = true;
69 auto iterator = [&](const Attachment& attachment) -> bool {
70 if (!texture_type.has_value() || !sample_count.has_value()) {
71 texture_type = attachment.texture->GetTextureDescriptor().type;
72 sample_count = attachment.texture->GetTextureDescriptor().sample_count;
73 }
74
75 if (texture_type != attachment.texture->GetTextureDescriptor().type) {
76 passes_type_validation = false;
77 VALIDATION_LOG << "Render target has incompatible texture types: "
78 << TextureTypeToString(texture_type.value()) << " != "
79 << TextureTypeToString(
80 attachment.texture->GetTextureDescriptor().type)
81 << " on target " << ToString();
82 return false;
83 }
84
85 if (sample_count !=
86 attachment.texture->GetTextureDescriptor().sample_count) {
87 passes_type_validation = false;
88 VALIDATION_LOG << "Render target (" << ToString()
89 << ") has incompatible sample counts.";
90
91 return false;
92 }
93
94 return true;
95 };
96 IterateAllAttachments(iterator);
97 if (!passes_type_validation) {
98 return false;
99 }
100 }
101
102 return true;
103 }

References HasColorAttachment(), IterateAllAttachments(), impeller::TextureTypeToString(), ToString(), and VALIDATION_LOG.

Referenced by impeller::EntityPassTarget::IsValid(), and impeller::SceneContents::Render().

## ◆ IterateAllAttachments()

void impeller::RenderTarget::IterateAllAttachments | ( | const std::function< bool(const Attachment &attachment)> & | iterator | ) | const

Definition at line 105 of file render_target.cc.

106 {
107 for (const auto& color : colors_) {
108 if (!iterator(color.second)) {
109 return;
110 }
111 }
112
113 if (depth_.has_value()) {
114 if (!iterator(depth_.value())) {
115 return;
116 }
117 }
118
119 if (stencil_.has_value()) {
120 if (!iterator(stencil_.value())) {
121 return;
122 }
123 }
124 }

Referenced by IsValid().

## ◆ SetColorAttachment()

RenderTarget & impeller::RenderTarget::SetColorAttachment | ( | const ColorAttachment & | attachment,
|  | size_t | index
| ) |  |

Definition at line 180 of file render_target.cc.

182 {
183 if (attachment.IsValid()) {
184 colors_[index] = attachment;
185 }
186 return *this;
187 }

References impeller::Attachment::IsValid().

Referenced by CreateOffscreen(), CreateOffscreenMSAA(), impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::testing::TEST_P(), impeller::SurfaceGLES::WrapFBO(), and impeller::SurfaceVK::WrapSwapchainImage().

## ◆ SetDepthAttachment()

RenderTarget & impeller::RenderTarget::SetDepthAttachment | ( | std::optional< DepthAttachment > | attachment | ) |

Definition at line 189 of file render_target.cc.

190 {
191 if (!attachment.has_value()) {
192 depth_ = std::nullopt;
193 } else if (attachment->IsValid()) {
194 depth_ = std::move(attachment);
195 }
196 return *this;
197 }

## ◆ SetStencilAttachment()

RenderTarget & impeller::RenderTarget::SetStencilAttachment | ( | std::optional< StencilAttachment > | attachment | ) |

Definition at line 199 of file render_target.cc.

200 {
201 if (!attachment.has_value()) {
202 stencil_ = std::nullopt;
203 } else if (attachment->IsValid()) {
204 stencil_ = std::move(attachment);
205 }
206 return *this;
207 }

Referenced by CreateOffscreen(), CreateOffscreenMSAA(), impeller::InlinePassContext::GetRenderPass(), SetupStencilAttachment(), impeller::testing::TEST_P(), and impeller::SurfaceGLES::WrapFBO().

## ◆ SetupStencilAttachment()

void impeller::RenderTarget::SetupStencilAttachment | ( | const Context & | context,
|  | RenderTargetAllocator & | allocator,
|  | ISize | size,
|  | bool | msaa,
|  | const std::string & | label = `"Offscreen"`,
|  | AttachmentConfig | stencil_attachment_config = `kDefaultStencilAttachmentConfig`
| ) |  |

Definition at line 349 of file render_target.cc.

355 {
356 TextureDescriptor stencil_tex0;
357 stencil_tex0.storage_mode = stencil_attachment_config.storage_mode;
358 if (msaa) {
359 stencil_tex0.type = TextureType::kTexture2DMultisample;
360 stencil_tex0.sample_count = SampleCount::kCount4;
361 }
362 stencil_tex0.format = context.GetCapabilities()->GetDefaultStencilFormat();
363 stencil_tex0.size = size;
364 stencil_tex0.usage =
365 static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
366
367 StencilAttachment stencil0;
368 stencil0.load_action = stencil_attachment_config.load_action;
369 stencil0.store_action = stencil_attachment_config.store_action;
370 stencil0.clear_stencil = 0u;
371 stencil0.texture = allocator.CreateTexture(stencil_tex0);
372
373 if (!stencil0.texture) {
374 return; // Error messages are handled by `Allocator::CreateTexture`.
375 }
376 stencil0.texture->SetLabel(SPrintF("%s Stencil Texture", label.c_str()));
377 SetStencilAttachment(std::move(stencil0));
378 }

References impeller::StencilAttachment::clear_stencil, impeller::RenderTargetAllocator::CreateTexture(), impeller::TextureDescriptor::format, impeller::Context::GetCapabilities(), impeller::kCount4, impeller::kRenderTarget, impeller::kTexture2DMultisample, impeller::RenderTarget::AttachmentConfig::load_action, impeller::Attachment::load_action, impeller::TextureDescriptor::sample_count, SetStencilAttachment(), impeller::TextureDescriptor::size, impeller::SPrintF(), impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfig::storage_mode, impeller::RenderTarget::AttachmentConfig::store_action, impeller::Attachment::store_action, impeller::Attachment::texture, impeller::TextureDescriptor::type, and impeller::TextureDescriptor::usage.

Referenced by CreateOffscreen(), and CreateOffscreenMSAA().

## ◆ ToString()

std::string impeller::RenderTarget::ToString | ( |  | ) | const

Definition at line 399 of file render_target.cc.

399 {
400 std::stringstream stream;
401
402 for (const auto& [index, color] : colors_) {
403 stream << SPrintF("Color[%zu]=(%s)", index,
404 ColorAttachmentToString(color).c_str());
405 }
406 if (depth_) {
407 stream << ",";
408 stream << SPrintF("Depth=(%s)",
409 DepthAttachmentToString(depth_.value()).c_str());
410 }
411 if (stencil_) {
412 stream << ",";
413 stream << SPrintF("Stencil=(%s)",
414 StencilAttachmentToString(stencil_.value()).c_str());
415 }
416 return stream.str();
417 }

References impeller::ColorAttachmentToString(), impeller::DepthAttachmentToString(), impeller::SPrintF(), and impeller::StencilAttachmentToString().

Referenced by IsValid().

## Member Data Documentation

## ◆ kDefaultColorAttachmentConfig

constexpr AttachmentConfig impeller::RenderTarget::kDefaultColorAttachmentConfig
| static constexpr

Initial value:
= {
.storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kClear,
.store_action = StoreAction::kStore,
.clear_color = Color::BlackTransparent()}

Definition at line 65 of file render_target.h.

Referenced by impeller::ContentContext::MakeSubpass(), and impeller::testing::TEST_P().

## ◆ kDefaultColorAttachmentConfigMSAA

constexpr AttachmentConfigMSAA impeller::RenderTarget::kDefaultColorAttachmentConfigMSAA
| static constexpr

Initial value:
= {
.storage_mode = StorageMode::kDeviceTransient,
.resolve_storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kClear,
.store_action = StoreAction::kMultisampleResolve,
.clear_color = Color::BlackTransparent()}

Definition at line 71 of file render_target.h.

Referenced by impeller::ContentContext::MakeSubpass().

## ◆ kDefaultStencilAttachmentConfig

constexpr AttachmentConfig impeller::RenderTarget::kDefaultStencilAttachmentConfig
| static constexpr

Initial value:
= {
.storage_mode = StorageMode::kDeviceTransient,
.load_action = LoadAction::kClear,
.store_action = StoreAction::kDontCare,
.clear_color = Color::BlackTransparent()}

Definition at line 78 of file render_target.h.

The documentation for this class was generated from the following files:

- impeller/renderer/render_target.h
- impeller/renderer/render_target.cc

impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::TextureUsageMask
uint64_t TextureUsageMask
Definition: formats.h:274
impeller::SampleCount::kCount1
@ kCount1
impeller::TextureUsage::kRenderTarget
@ kRenderTarget
impeller::StoreAction::kDontCare
@ kDontCare
impeller::RenderTarget::GetColorAttachmentSize
std::optional< ISize > GetColorAttachmentSize(size_t index) const
Definition: render_target.cc:140
impeller::SampleCount::kCount4
@ kCount4
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
impeller::LoadAction::kClear
@ kClear
impeller::StorageMode::kDeviceTransient
@ kDeviceTransient
impeller::RenderTarget::GetRenderTargetTexture
std::shared_ptr< Texture > GetRenderTargetTexture() const
Definition: render_target.cc:155
impeller::RenderTarget::IterateAllAttachments
void IterateAllAttachments(const std::function< bool(const Attachment &attachment)> &iterator) const
Definition: render_target.cc:105
impeller::SPrintF
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::ColorAttachmentToString
std::string ColorAttachmentToString(const ColorAttachment &color)
Definition: formats.cc:123
impeller::TextureUsage::kShaderRead
@ kShaderRead
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::StoreAction::kStore
@ kStore
impeller::CompressionType::kLossy
@ kLossy
impeller::ISize
TSize< int64_t > ISize
Definition: size.h:136
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:60
impeller::TextureTypeToString
constexpr const char * TextureTypeToString(TextureType type)
Definition: formats.h:243
impeller::RenderTarget::SetStencilAttachment
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
Definition: render_target.cc:199
impeller::DepthAttachmentToString
std::string DepthAttachmentToString(const DepthAttachment &depth)
Definition: formats.cc:130
impeller::Color::BlackTransparent
static constexpr Color BlackTransparent()
Definition: color.h:260
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:94
impeller::RenderTarget::HasColorAttachment
bool HasColorAttachment(size_t index) const
Definition: render_target.cc:133
impeller::StencilAttachmentToString
std::string StencilAttachmentToString(const StencilAttachment &stencil)
Definition: formats.cc:137
impeller::RenderTarget::ToString
std::string ToString() const
Definition: render_target.cc:399
impeller::RenderTarget::RenderTarget
RenderTarget()