Flutter Impeller
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< TextureGetRenderTargetTexture () const
 
PixelFormat GetRenderTargetPixelFormat () const
 
std::optional< ISizeGetColorAttachmentSize (size_t index) const
 
RenderTargetSetColorAttachment (const ColorAttachment &attachment, size_t index)
 
RenderTargetSetDepthAttachment (std::optional< DepthAttachment > attachment)
 
RenderTargetSetStencilAttachment (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 49 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  RenderTarget target;
235  PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
236  TextureDescriptor color_tex0;
237  color_tex0.storage_mode = color_attachment_config.storage_mode;
238  color_tex0.format = pixel_format;
239  color_tex0.size = size;
240  color_tex0.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget) |
241  static_cast<uint64_t>(TextureUsage::kShaderRead);
242 
243  ColorAttachment color0;
244  color0.clear_color = color_attachment_config.clear_color;
245  color0.load_action = color_attachment_config.load_action;
246  color0.store_action = color_attachment_config.store_action;
247  color0.texture = allocator.CreateTexture(color_tex0);
248 
249  if (!color0.texture) {
250  return {};
251  }
252  color0.texture->SetLabel(SPrintF("%s Color Texture", label.c_str()));
253  target.SetColorAttachment(color0, 0u);
254 
255  if (stencil_attachment_config.has_value()) {
256  target.SetupStencilAttachment(context, allocator, size, false, label,
257  stencil_attachment_config.value());
258  } else {
259  target.SetStencilAttachment(std::nullopt);
260  }
261 
262  return target;
263 }

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(), impeller::SceneContents::Render(), 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 265 of file render_target.cc.

271  {
272  if (size.IsEmpty()) {
273  return {};
274  }
275 
276  RenderTarget target;
277  PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
278 
279  // Create MSAA color texture.
280 
281  TextureDescriptor color0_tex_desc;
282  color0_tex_desc.storage_mode = color_attachment_config.storage_mode;
283  color0_tex_desc.type = TextureType::kTexture2DMultisample;
284  color0_tex_desc.sample_count = SampleCount::kCount4;
285  color0_tex_desc.format = pixel_format;
286  color0_tex_desc.size = size;
287  color0_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);
288 
289  if (context.GetCapabilities()->SupportsImplicitResolvingMSAA()) {
290  // See below ("SupportsImplicitResolvingMSAA") for more details.
291  color0_tex_desc.storage_mode = StorageMode::kDevicePrivate;
292  }
293 
294  auto color0_msaa_tex = allocator.CreateTexture(color0_tex_desc);
295  if (!color0_msaa_tex) {
296  VALIDATION_LOG << "Could not create multisample color texture.";
297  return {};
298  }
299  color0_msaa_tex->SetLabel(
300  SPrintF("%s Color Texture (Multisample)", label.c_str()));
301 
302  // Create color resolve texture.
303 
304  TextureDescriptor color0_resolve_tex_desc;
305  color0_resolve_tex_desc.storage_mode =
306  color_attachment_config.resolve_storage_mode;
307  color0_resolve_tex_desc.format = pixel_format;
308  color0_resolve_tex_desc.size = size;
309  color0_resolve_tex_desc.compression_type = CompressionType::kLossy;
310  color0_resolve_tex_desc.usage =
311  static_cast<uint64_t>(TextureUsage::kRenderTarget) |
312  static_cast<uint64_t>(TextureUsage::kShaderRead);
313 
314  auto color0_resolve_tex = allocator.CreateTexture(color0_resolve_tex_desc);
315  if (!color0_resolve_tex) {
316  VALIDATION_LOG << "Could not create color texture.";
317  return {};
318  }
319  color0_resolve_tex->SetLabel(SPrintF("%s Color Texture", label.c_str()));
320 
321  // Color attachment.
322 
323  ColorAttachment color0;
324  color0.clear_color = color_attachment_config.clear_color;
325  color0.load_action = color_attachment_config.load_action;
326  color0.store_action = color_attachment_config.store_action;
327  color0.texture = color0_msaa_tex;
328  color0.resolve_texture = color0_resolve_tex;
329 
330  if (context.GetCapabilities()->SupportsImplicitResolvingMSAA()) {
331  // If implicit MSAA is supported, then the resolve texture is not needed
332  // because the multisample texture is automatically resolved. We instead
333  // provide a view of the multisample texture as the resolve texture (because
334  // the HAL does expect a resolve texture).
335  //
336  // In practice, this is used for GLES 2.0 EXT_multisampled_render_to_texture
337  // https://registry.khronos.org/OpenGL/extensions/EXT/EXT_multisampled_render_to_texture.txt
338  color0.resolve_texture = color0_msaa_tex;
339  }
340 
341  target.SetColorAttachment(color0, 0u);
342 
343  // Create MSAA stencil texture.
344 
345  if (stencil_attachment_config.has_value()) {
346  target.SetupStencilAttachment(context, allocator, size, true, label,
347  stencil_attachment_config.value());
348  } else {
349  target.SetStencilAttachment(std::nullopt);
350  }
351 
352  return target;
353 }

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::kDevicePrivate, 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(), impeller::SceneContents::Render(), and impeller::testing::TEST_P().

◆ GetColorAttachments()

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

◆ 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.

◆ 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(), 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().

◆ 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(), and impeller::ToMTLRenderPassDescriptor().

◆ GetTotalAttachmentCount()

size_t impeller::RenderTarget::GetTotalAttachmentCount ( ) const

Definition at line 386 of file render_target.cc.

386  {
387  size_t count = 0u;
388  for (const auto& [_, color] : colors_) {
389  if (color.texture) {
390  count++;
391  }
392  if (color.resolve_texture) {
393  count++;
394  }
395  }
396  if (depth_.has_value()) {
397  count++;
398  }
399  if (stencil_.has_value()) {
400  count++;
401  }
402  return count;
403 }

◆ 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)) {
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) {
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()) << " != "
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 355 of file render_target.cc.

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

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 405 of file render_target.cc.

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

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

Referenced by IsValid().

Member Data Documentation

◆ kDefaultColorAttachmentConfig

constexpr AttachmentConfig impeller::RenderTarget::kDefaultColorAttachmentConfig
staticconstexpr
Initial value:
= {
.storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kClear,
.store_action = StoreAction::kStore,
.clear_color = Color::BlackTransparent()}

Definition at line 66 of file render_target.h.

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

◆ kDefaultColorAttachmentConfigMSAA

constexpr AttachmentConfigMSAA impeller::RenderTarget::kDefaultColorAttachmentConfigMSAA
staticconstexpr
Initial value:
= {
.resolve_storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kClear,
.clear_color = Color::BlackTransparent()}

Definition at line 72 of file render_target.h.

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

◆ kDefaultStencilAttachmentConfig

constexpr AttachmentConfig impeller::RenderTarget::kDefaultStencilAttachmentConfig
staticconstexpr
Initial value:
= {
.load_action = LoadAction::kClear,
.store_action = StoreAction::kDontCare,
.clear_color = Color::BlackTransparent()}

Definition at line 79 of file render_target.h.


The documentation for this class was generated from the following files:
impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::TextureUsageMask
uint64_t TextureUsageMask
Definition: formats.h:295
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::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:94
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::StoreAction::kStore
@ kStore
impeller::CompressionType::kLossy
@ kLossy
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::ISize
TSize< int64_t > ISize
Definition: size.h:138
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:67
impeller::TextureTypeToString
constexpr const char * TextureTypeToString(TextureType type)
Definition: formats.h:264
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:262
impeller::SampleCount::kCount1
@ kCount1
impeller::SampleCount::kCount4
@ kCount4
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:405
impeller::RenderTarget::RenderTarget
RenderTarget()