| Flutter Impeller |

render_target.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/renderer/render_target.h"
6
7 #include <sstream>
8
9 #include "impeller/base/strings.h"
10 #include "impeller/base/validation.h"
11 #include "impeller/core/allocator.h"
12 #include "impeller/core/formats.h"
13 #include "impeller/core/texture.h"
14 #include "impeller/core/texture_descriptor.h"
15 #include "impeller/renderer/context.h"
16
17 namespace impeller {
18
19 RenderTarget::RenderTarget() = default;
20
21 RenderTarget::~RenderTarget() = default;
22
23 bool RenderTarget::IsValid() const {
24 // Validate that there is a color attachment at zero index.
25 if (!HasColorAttachment(0u)) {
26 VALIDATION_LOG
27 << "Render target does not have color attachment at index 0.";
28 return false;
29 }
30
31 #ifndef NDEBUG
32 // Validate that all attachments are of the same size.
33 {
34 std::optional<ISize> size;
35 bool sizes_are_same = true;
36 auto iterator = [&](const Attachment& attachment) -> bool {
37 if (!size.has_value()) {
38 size = attachment.texture->GetSize();
39 }
40 if (size != attachment.texture->GetSize()) {
41 sizes_are_same = false;
42 return false;
43 }
44 return true;
45 };
46 IterateAllAttachments(iterator);
47 if (!sizes_are_same) {
48 VALIDATION_LOG
49 << "Sizes of all render target attachments are not the same.";
50 return false;
51 }
52 }
53
54 // Validate that all attachments are of the same type and sample counts.
55 {
56 std::optional<TextureType> texture_type;
57 std::optional<SampleCount> sample_count;
58 bool passes_type_validation = true;
59 auto iterator = [&](const Attachment& attachment) -> bool {
60 if (!texture_type.has_value() || !sample_count.has_value()) {
61 texture_type = attachment.texture->GetTextureDescriptor().type;
62 sample_count = attachment.texture->GetTextureDescriptor().sample_count;
63 }
64
65 if (texture_type != attachment.texture->GetTextureDescriptor().type) {
66 passes_type_validation = false;
67 VALIDATION_LOG << "Render target has incompatible texture types: "
68 << TextureTypeToString(texture_type.value()) << " != "
69 << TextureTypeToString(
70 attachment.texture->GetTextureDescriptor().type)
71 << " on target " << ToString();
72 return false;
73 }
74
75 if (sample_count !=
76 attachment.texture->GetTextureDescriptor().sample_count) {
77 passes_type_validation = false;
78 VALIDATION_LOG << "Render target (" << ToString()
79 << ") has incompatible sample counts.";
80
81 return false;
82 }
83
84 return true;
85 };
86 IterateAllAttachments(iterator);
87 if (!passes_type_validation) {
88 return false;
89 }
90 }
91 #endif // NDEBUG
92
93 return true;
94 }
95
96 bool RenderTarget::IterateAllColorAttachments(
97 const std::function<bool(size_t index, const ColorAttachment& attachment)>&
98 iterator) const {
99 if (color0_.has_value()) {
100 if (!iterator(0, color0_.value())) {
101 return false;
102 }
103 }
104 for (const auto& [index, attachment] : colors_) {
105 if (!iterator(index, attachment)) {
106 return false;
107 }
108 }
109 return true;
110 }
111
112 void RenderTarget::IterateAllAttachments(
113 const std::function<bool(const Attachment& attachment)>& iterator) const {
114 if (color0_.has_value()) {
115 if (!iterator(color0_.value())) {
116 return;
117 }
118 }
119 for (const auto& color : colors_) {
120 if (!iterator(color.second)) {
121 return;
122 }
123 }
124
125 if (depth_.has_value()) {
126 if (!iterator(depth_.value())) {
127 return;
128 }
129 }
130
131 if (stencil_.has_value()) {
132 if (!iterator(stencil_.value())) {
133 return;
134 }
135 }
136 }
137
138 SampleCount RenderTarget::GetSampleCount() const {
139 if (color0_.has_value()) {
140 return color0_.value().texture->GetTextureDescriptor().sample_count;
141 }
142 return SampleCount::kCount1;
143 }
144
145 bool RenderTarget::HasColorAttachment(size_t index) const {
146 if (index == 0u) {
147 return color0_.has_value();
148 }
149 if (auto found = colors_.find(index); found != colors_.end()) {
150 return true;
151 }
152 return false;
153 }
154
155 std::optional<ISize> RenderTarget::GetColorAttachmentSize(size_t index) const {
156 if (index == 0u) {
157 if (color0_.has_value()) {
158 return color0_.value().texture->GetSize();
159 }
160 return std::nullopt;
161 }
162 auto found = colors_.find(index);
163
164 if (found == colors_.end()) {
165 return std::nullopt;
166 }
167
168 return found->second.texture->GetSize();
169 }
170
171 ISize RenderTarget::GetRenderTargetSize() const {
172 auto size = GetColorAttachmentSize(0u);
173 return size.has_value() ? size.value() : ISize{};
174 }
175
176 std::shared_ptr<Texture> RenderTarget::GetRenderTargetTexture() const {
177 if (!color0_.has_value()) {
178 return nullptr;
179 }
180 return color0_->resolve_texture ? color0_->resolve_texture : color0_->texture;
181 }
182
183 PixelFormat RenderTarget::GetRenderTargetPixelFormat() const {
184 if (auto texture = GetRenderTargetTexture(); texture != nullptr) {
185 return texture->GetTextureDescriptor().format;
186 }
187
188 return PixelFormat::kUnknown;
189 }
190
191 size_t RenderTarget::GetMaxColorAttacmentBindIndex() const {
192 size_t max = 0;
193 for (const auto& color : colors_) {
194 max = std::max(color.first, max);
195 }
196 return max;
197 }
198
199 RenderTarget& RenderTarget::SetColorAttachment(
200 const ColorAttachment& attachment,
201 size_t index) {
202 if (!attachment.IsValid()) {
203 return *this;
204 }
205 if (index == 0u) {
206 color0_ = attachment;
207 } else {
208 colors_[index] = attachment;
209 }
210 return *this;
211 }
212
213 RenderTarget& RenderTarget::SetDepthAttachment(
214 std::optional<DepthAttachment> attachment) {
215 if (!attachment.has_value()) {
216 depth_ = std::nullopt;
217 } else if (attachment->IsValid()) {
218 depth_ = std::move(attachment);
219 }
220 return *this;
221 }
222
223 RenderTarget& RenderTarget::SetStencilAttachment(
224 std::optional<StencilAttachment> attachment) {
225 if (!attachment.has_value()) {
226 stencil_ = std::nullopt;
227 } else if (attachment->IsValid()) {
228 stencil_ = std::move(attachment);
229 }
230 return *this;
231 }
232
233 ColorAttachment RenderTarget::GetColorAttachment(size_t index) const {
234 if (index == 0) {
235 if (color0_.has_value()) {
236 return color0_.value();
237 }
238 return ColorAttachment{};
239 }
240 std::map<size_t, ColorAttachment>::const_iterator it = colors_.find(index);
241 if (it != colors_.end()) {
242 return it->second;
243 }
244 return ColorAttachment{};
245 }
246
247 const std::optional<DepthAttachment>& RenderTarget::GetDepthAttachment() const {
248 return depth_;
249 }
250
251 const std::optional<StencilAttachment>& RenderTarget::GetStencilAttachment()
252 const {
253 return stencil_;
254 }
255
256 size_t RenderTarget::GetTotalAttachmentCount() const {
257 size_t count = 0u;
258 for (const auto& [_, color] : colors_) {
259 if (color.texture) {
260 count++;
261 }
262 if (color.resolve_texture) {
263 count++;
264 }
265 }
266 if (color0_.has_value()) {
267 count++;
268 }
269 if (depth_.has_value()) {
270 count++;
271 }
272 if (stencil_.has_value()) {
273 count++;
274 }
275 return count;
276 }
277
278 std::string RenderTarget::ToString() const {
279 std::stringstream stream;
280
281 if (color0_.has_value()) {
282 stream << SPrintF("Color[%d]=(%s)", 0,
283 ColorAttachmentToString(color0_.value()).c_str());
284 }
285 for (const auto& [index, color] : colors_) {
286 stream << SPrintF("Color[%zu]=(%s)", index,
287 ColorAttachmentToString(color).c_str());
288 }
289 if (depth_) {
290 stream << ",";
291 stream << SPrintF("Depth=(%s)",
292 DepthAttachmentToString(depth_.value()).c_str());
293 }
294 if (stencil_) {
295 stream << ",";
296 stream << SPrintF("Stencil=(%s)",
297 StencilAttachmentToString(stencil_.value()).c_str());
298 }
299 return stream.str();
300 }
301
302 RenderTargetConfig RenderTarget::ToConfig() const {
303 if (!color0_.has_value()) {
304 return RenderTargetConfig{};
305 }
306 const auto& color_attachment = color0_.value();
307 return RenderTargetConfig{
308 .size = color_attachment.texture->GetSize(),
309 .mip_count = color_attachment.texture->GetMipCount(),
310 .has_msaa = color_attachment.resolve_texture != nullptr,
311 .has_depth_stencil = depth_.has_value() && stencil_.has_value()};
312 }
313
314 RenderTargetAllocator::RenderTargetAllocator(
315 std::shared_ptr<Allocator> allocator)
316 : allocator_(std::move(allocator)) {}
317
318 void RenderTargetAllocator::Start() {}
319
320 void RenderTargetAllocator::End() {}
321
322 RenderTarget RenderTargetAllocator::CreateOffscreen(
323 const Context& context,
324 ISize size,
325 int mip_count,
326 std::string_view label,
327 RenderTarget::AttachmentConfig color_attachment_config,
328 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config,
329 const std::shared_ptr<Texture>& existing_color_texture,
330 const std::shared_ptr<Texture>& existing_depth_stencil_texture) {
331 if (size.IsEmpty()) {
332 return {};
333 }
334
335 RenderTarget target;
336
337 std::shared_ptr<Texture> color0_tex;
338 if (existing_color_texture) {
339 color0_tex = existing_color_texture;
340 } else {
341 PixelFormat pixel_format =
342 context.GetCapabilities()->GetDefaultColorFormat();
343 TextureDescriptor color0_tex_desc;
344 color0_tex_desc.storage_mode = color_attachment_config.storage_mode;
345 color0_tex_desc.format = pixel_format;
346 color0_tex_desc.size = size;
347 color0_tex_desc.mip_count = mip_count;
348 color0_tex_desc.usage =
349 TextureUsage::kRenderTarget | TextureUsage::kShaderRead;
350 color0_tex = allocator_->CreateTexture(color0_tex_desc);
351 if (!color0_tex) {
352 return {};
353 }
354 }
355 color0_tex->SetLabel(label, "Color Texture");
356
357 ColorAttachment color0;
358 color0.clear_color = color_attachment_config.clear_color;
359 color0.load_action = color_attachment_config.load_action;
360 color0.store_action = color_attachment_config.store_action;
361 color0.texture = color0_tex;
362 target.SetColorAttachment(color0, 0u);
363
364 if (stencil_attachment_config.has_value()) {
365 target.SetupDepthStencilAttachments(
366 context, *allocator_, size, false, label,
367 stencil_attachment_config.value(), existing_depth_stencil_texture);
368 } else {
369 target.SetStencilAttachment(std::nullopt);
370 target.SetDepthAttachment(std::nullopt);
371 }
372
373 return target;
374 }
375
376 RenderTarget RenderTargetAllocator::CreateOffscreenMSAA(
377 const Context& context,
378 ISize size,
379 int mip_count,
380 std::string_view label,
381 RenderTarget::AttachmentConfigMSAA color_attachment_config,
382 std::optional<RenderTarget::AttachmentConfig> stencil_attachment_config,
383 const std::shared_ptr<Texture>& existing_color_msaa_texture,
384 const std::shared_ptr<Texture>& existing_color_resolve_texture,
385 const std::shared_ptr<Texture>& existing_depth_stencil_texture) {
386 if (size.IsEmpty()) {
387 return {};
388 }
389
390 RenderTarget target;
391 PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
392
393 // Create MSAA color texture.
394 std::shared_ptr<Texture> color0_msaa_tex;
395 if (existing_color_msaa_texture) {
396 color0_msaa_tex = existing_color_msaa_texture;
397 } else {
398 TextureDescriptor color0_tex_desc;
399 color0_tex_desc.storage_mode = color_attachment_config.storage_mode;
400 color0_tex_desc.type = TextureType::kTexture2DMultisample;
401 color0_tex_desc.sample_count = SampleCount::kCount4;
402 color0_tex_desc.format = pixel_format;
403 color0_tex_desc.size = size;
404 color0_tex_desc.usage = TextureUsage::kRenderTarget;
405 if (context.GetCapabilities()->SupportsImplicitResolvingMSAA()) {
406 // See below ("SupportsImplicitResolvingMSAA") for more details.
407 color0_tex_desc.storage_mode = StorageMode::kDevicePrivate;
408 }
409 color0_msaa_tex = allocator_->CreateTexture(color0_tex_desc);
410 if (!color0_msaa_tex) {
411 VALIDATION_LOG << "Could not create multisample color texture.";
412 return {};
413 }
414 }
415 color0_msaa_tex->SetLabel(label, "Color Texture (Multisample)");
416
417 // Create color resolve texture.
418 std::shared_ptr<Texture> color0_resolve_tex;
419 if (existing_color_resolve_texture) {
420 color0_resolve_tex = existing_color_resolve_texture;
421 } else {
422 TextureDescriptor color0_resolve_tex_desc;
423 color0_resolve_tex_desc.storage_mode =
424 color_attachment_config.resolve_storage_mode;
425 color0_resolve_tex_desc.format = pixel_format;
426 color0_resolve_tex_desc.size = size;
427 color0_resolve_tex_desc.compression_type = CompressionType::kLossy;
428 color0_resolve_tex_desc.usage =
429 TextureUsage::kRenderTarget | TextureUsage::kShaderRead;
430 color0_resolve_tex_desc.mip_count = mip_count;
431 color0_resolve_tex = allocator_->CreateTexture(color0_resolve_tex_desc);
432 if (!color0_resolve_tex) {
433 VALIDATION_LOG << "Could not create color texture.";
434 return {};
435 }
436 }
437 color0_resolve_tex->SetLabel(label, "Color Texture");
438
439 // Color attachment.
440
441 ColorAttachment color0;
442 color0.clear_color = color_attachment_config.clear_color;
443 color0.load_action = color_attachment_config.load_action;
444 color0.store_action = color_attachment_config.store_action;
445 color0.texture = color0_msaa_tex;
446 color0.resolve_texture = color0_resolve_tex;
447
448 if (context.GetCapabilities()->SupportsImplicitResolvingMSAA()) {
449 // If implicit MSAA is supported, then the resolve texture is not needed
450 // because the multisample texture is automatically resolved. We instead
451 // provide a view of the multisample texture as the resolve texture (because
452 // the HAL does expect a resolve texture).
453 //
454 // In practice, this is used for GLES 2.0 EXT_multisampled_render_to_texture
455 // https://registry.khronos.org/OpenGL/extensions/EXT/EXT_multisampled_render_to_texture.txt
456 color0.resolve_texture = color0_msaa_tex;
457 }
458
459 target.SetColorAttachment(color0, 0u);
460
461 // Create MSAA stencil texture.
462
463 if (stencil_attachment_config.has_value()) {
464 target.SetupDepthStencilAttachments(context, *allocator_, size, true, label,
465 stencil_attachment_config.value(),
466 existing_depth_stencil_texture);
467 } else {
468 target.SetDepthAttachment(std::nullopt);
469 target.SetStencilAttachment(std::nullopt);
470 }
471
472 return target;
473 }
474
475 void RenderTarget::SetupDepthStencilAttachments(
476 const Context& context,
477 Allocator& allocator,
478 ISize size,
479 bool msaa,
480 std::string_view label,
481 RenderTarget::AttachmentConfig stencil_attachment_config,
482 const std::shared_ptr<Texture>& existing_depth_stencil_texture) {
483 std::shared_ptr<Texture> depth_stencil_texture;
484 if (existing_depth_stencil_texture) {
485 depth_stencil_texture = existing_depth_stencil_texture;
486 } else {
487 TextureDescriptor depth_stencil_texture_desc;
488 depth_stencil_texture_desc.storage_mode =
489 stencil_attachment_config.storage_mode;
490 if (msaa) {
491 depth_stencil_texture_desc.type = TextureType::kTexture2DMultisample;
492 depth_stencil_texture_desc.sample_count = SampleCount::kCount4;
493 }
494 depth_stencil_texture_desc.format =
495 context.GetCapabilities()->GetDefaultDepthStencilFormat();
496 depth_stencil_texture_desc.size = size;
497 depth_stencil_texture_desc.usage = TextureUsage::kRenderTarget;
498 depth_stencil_texture = allocator.CreateTexture(depth_stencil_texture_desc);
499 if (!depth_stencil_texture) {
500 return; // Error messages are handled by `Allocator::CreateTexture`.
501 }
502 }
503
504 DepthAttachment depth0;
505 depth0.load_action = stencil_attachment_config.load_action;
506 depth0.store_action = stencil_attachment_config.store_action;
507 depth0.clear_depth = 0u;
508 depth0.texture = depth_stencil_texture;
509
510 StencilAttachment stencil0;
511 stencil0.load_action = stencil_attachment_config.load_action;
512 stencil0.store_action = stencil_attachment_config.store_action;
513 stencil0.clear_stencil = 0u;
514 stencil0.texture = std::move(depth_stencil_texture);
515 stencil0.texture->SetLabel(label, "Depth+Stencil Texture");
516
517 SetDepthAttachment(std::move(depth0));
518 SetStencilAttachment(std::move(stencil0));
519 }
520
521 } // namespace impeller
allocator.h
impeller::Allocator
An object that allocates device memory.
Definition: allocator.h:24
impeller::Allocator::CreateTexture
std::shared_ptr< Texture > CreateTexture(const TextureDescriptor &desc, bool threadsafe=false)
Creates a new texture.
Definition: allocator.cc:49
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition: context.h:65
impeller::Context::GetCapabilities
virtual const std::shared_ptr< const Capabilities > & GetCapabilities() const =0
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
impeller::RenderTargetAllocator::RenderTargetAllocator
RenderTargetAllocator(std::shared_ptr< Allocator > allocator)
Definition: render_target.cc:314
impeller::RenderTargetAllocator::CreateOffscreenMSAA
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
Definition: render_target.cc:376
impeller::RenderTargetAllocator::CreateOffscreen
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
Definition: render_target.cc:322
impeller::RenderTargetAllocator::Start
virtual void Start()
Mark the beginning of a frame workload.
Definition: render_target.cc:318
impeller::RenderTargetAllocator::End
virtual void End()
Mark the end of a frame workload.
Definition: render_target.cc:320
impeller::RenderTarget
Definition: render_target.h:38
impeller::RenderTarget::~RenderTarget
~RenderTarget()
impeller::RenderTarget::RenderTarget
RenderTarget()
impeller::RenderTarget::GetColorAttachment
ColorAttachment GetColorAttachment(size_t index) const
Get the color attachment at [index].
Definition: render_target.cc:233
impeller::RenderTarget::GetRenderTargetTexture
std::shared_ptr< Texture > GetRenderTargetTexture() const
Definition: render_target.cc:176
impeller::RenderTarget::GetSampleCount
SampleCount GetSampleCount() const
Definition: render_target.cc:138
impeller::RenderTarget::IterateAllAttachments
void IterateAllAttachments(const std::function< bool(const Attachment &attachment)> &iterator) const
Definition: render_target.cc:112
impeller::RenderTarget::SetColorAttachment
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
Definition: render_target.cc:199
impeller::RenderTarget::HasColorAttachment
bool HasColorAttachment(size_t index) const
Definition: render_target.cc:145
impeller::RenderTarget::GetMaxColorAttacmentBindIndex
size_t GetMaxColorAttacmentBindIndex() const
Definition: render_target.cc:191
impeller::RenderTarget::ToString
std::string ToString() const
Definition: render_target.cc:278
impeller::RenderTarget::SetDepthAttachment
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
Definition: render_target.cc:213
impeller::RenderTarget::GetRenderTargetPixelFormat
PixelFormat GetRenderTargetPixelFormat() const
Definition: render_target.cc:183
impeller::RenderTarget::GetTotalAttachmentCount
size_t GetTotalAttachmentCount() const
Definition: render_target.cc:256
impeller::RenderTarget::GetRenderTargetSize
ISize GetRenderTargetSize() const
Definition: render_target.cc:171
impeller::RenderTarget::SetStencilAttachment
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
Definition: render_target.cc:223
impeller::RenderTarget::IterateAllColorAttachments
bool IterateAllColorAttachments(const std::function< bool(size_t index, const ColorAttachment &attachment)> &iterator) const
Definition: render_target.cc:96
impeller::RenderTarget::GetColorAttachmentSize
std::optional< ISize > GetColorAttachmentSize(size_t index) const
Definition: render_target.cc:155
impeller::RenderTarget::GetDepthAttachment
const std::optional< DepthAttachment > & GetDepthAttachment() const
Definition: render_target.cc:247
impeller::RenderTarget::IsValid
bool IsValid() const
Definition: render_target.cc:23
impeller::RenderTarget::GetStencilAttachment
const std::optional< StencilAttachment > & GetStencilAttachment() const
Definition: render_target.cc:251
impeller::RenderTarget::SetupDepthStencilAttachments
void SetupDepthStencilAttachments(const Context &context, Allocator &allocator, ISize size, bool msaa, std::string_view label="Offscreen", RenderTarget::AttachmentConfig stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &depth_stencil_texture=nullptr)
Definition: render_target.cc:475
impeller::RenderTarget::ToConfig
RenderTargetConfig ToConfig() const
Definition: render_target.cc:302
formats.h
texture.h
impeller
Definition: allocation.cc:12
impeller::DepthAttachmentToString
std::string DepthAttachmentToString(const DepthAttachment &depth)
Definition: formats.cc:130
impeller::ColorAttachmentToString
std::string ColorAttachmentToString(const ColorAttachment &color)
Definition: formats.cc:123
impeller::StencilAttachmentToString
std::string StencilAttachmentToString(const StencilAttachment &stencil)
Definition: formats.cc:137
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::SPrintF
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::TextureTypeToString
constexpr const char * TextureTypeToString(TextureType type)
Definition: formats.h:269
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
impeller::CompressionType::kLossy
@ kLossy
impeller::TextureUsage::kRenderTarget
@ kRenderTarget
impeller::TextureUsage::kShaderRead
@ kShaderRead
impeller::SampleCount
SampleCount
Definition: formats.h:295
impeller::SampleCount::kCount4
@ kCount4
impeller::SampleCount::kCount1
@ kCount1
std
Definition: comparable.h:95
render_target.h
context.h
strings.h
impeller::Attachment
Definition: formats.h:656
impeller::Attachment::resolve_texture
std::shared_ptr< Texture > resolve_texture
Definition: formats.h:658
impeller::Attachment::IsValid
bool IsValid() const
Definition: formats.cc:26
impeller::Attachment::load_action
LoadAction load_action
Definition: formats.h:659
impeller::Attachment::texture
std::shared_ptr< Texture > texture
Definition: formats.h:657
impeller::Attachment::store_action
StoreAction store_action
Definition: formats.h:660
impeller::ColorAttachment
Definition: formats.h:665
impeller::ColorAttachment::clear_color
Color clear_color
Definition: formats.h:666
impeller::DepthAttachment
Definition: formats.h:669
impeller::DepthAttachment::clear_depth
double clear_depth
Definition: formats.h:670
impeller::RenderTarget::AttachmentConfig
Definition: render_target.h:40
impeller::RenderTarget::AttachmentConfig::clear_color
Color clear_color
Definition: render_target.h:44
impeller::RenderTarget::AttachmentConfig::load_action
LoadAction load_action
Definition: render_target.h:42
impeller::RenderTarget::AttachmentConfig::store_action
StoreAction store_action
Definition: render_target.h:43
impeller::RenderTarget::AttachmentConfig::storage_mode
StorageMode storage_mode
Definition: render_target.h:41
impeller::RenderTarget::AttachmentConfigMSAA
Definition: render_target.h:47
impeller::RenderTarget::AttachmentConfigMSAA::clear_color
Color clear_color
Definition: render_target.h:52
impeller::RenderTarget::AttachmentConfigMSAA::storage_mode
StorageMode storage_mode
Definition: render_target.h:48
impeller::RenderTarget::AttachmentConfigMSAA::load_action
LoadAction load_action
Definition: render_target.h:50
impeller::RenderTarget::AttachmentConfigMSAA::store_action
StoreAction store_action
Definition: render_target.h:51
impeller::RenderTarget::AttachmentConfigMSAA::resolve_storage_mode
StorageMode resolve_storage_mode
Definition: render_target.h:49
impeller::RenderTargetConfig
Definition: render_target.h:21
impeller::RenderTargetConfig::size
ISize size
Definition: render_target.h:22
impeller::StencilAttachment
Definition: formats.h:673
impeller::StencilAttachment::clear_stencil
uint32_t clear_stencil
Definition: formats.h:674
impeller::TSize
Definition: size.h:25
impeller::TSize::IsEmpty
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
Definition: size.h:123
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:38
impeller::TextureDescriptor::usage
TextureUsageMask usage
Definition: texture_descriptor.h:44
impeller::TextureDescriptor::compression_type
CompressionType compression_type
Definition: texture_descriptor.h:46
impeller::TextureDescriptor::type
TextureType type
Definition: texture_descriptor.h:40
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:42
impeller::TextureDescriptor::storage_mode
StorageMode storage_mode
Definition: texture_descriptor.h:39
impeller::TextureDescriptor::sample_count
SampleCount sample_count
Definition: texture_descriptor.h:45
impeller::TextureDescriptor::mip_count
size_t mip_count
Definition: texture_descriptor.h:43
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:41
texture_descriptor.h
validation.h
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91