Flutter Impeller
formats.h
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 #pragma once
6 
7 #include <cstdint>
8 #include <functional>
9 #include <memory>
10 #include <string>
11 #include <type_traits>
12 
13 #include "flutter/fml/hash_combine.h"
14 #include "flutter/fml/logging.h"
15 #include "flutter/fml/macros.h"
17 #include "impeller/geometry/rect.h"
19 
20 namespace impeller {
21 
22 class Texture;
23 
24 //------------------------------------------------------------------------------
25 /// @brief Specified where the allocation resides and how it is used.
26 ///
27 enum class StorageMode {
28  //----------------------------------------------------------------------------
29  /// Allocations can be mapped onto the hosts address space and also be used by
30  /// the device.
31  ///
33  //----------------------------------------------------------------------------
34  /// Allocations can only be used by the device. This location is optimal for
35  /// use by the device. If the host needs to access these allocations, the
36  /// transfer queue must be used to transfer this allocation onto the a host
37  /// visible buffer.
38  ///
40  //----------------------------------------------------------------------------
41  /// Used by the device for temporary render targets. These allocations cannot
42  /// be transferred from and to other allocations using the transfer queue.
43  /// Render pass cannot initialize the contents of these buffers using load and
44  /// store actions.
45  ///
46  /// These allocations reside in tile memory which has higher bandwidth, lower
47  /// latency and lower power consumption. The total device memory usage is
48  /// also lower as a separate allocation does not need to be created in
49  /// device memory. Prefer using these allocations for intermediates like depth
50  /// and stencil buffers.
51  ///
53 };
54 
55 constexpr const char* StorageModeToString(StorageMode mode) {
56  switch (mode) {
58  return "HostVisible";
60  return "DevicePrivate";
62  return "DeviceTransient";
63  }
64  FML_UNREACHABLE();
65 }
66 
67 //------------------------------------------------------------------------------
68 /// @brief The Pixel formats supported by Impeller. The naming convention
69 /// denotes the usage of the component, the bit width of that
70 /// component, and then one or more qualifiers to its
71 /// interpretation.
72 ///
73 /// For instance, `kR8G8B8A8UNormIntSRGB` is a 32 bits-per-pixel
74 /// format ordered in RGBA with 8 bits per component with each
75 /// component expressed as an unsigned normalized integer and a
76 /// conversion from sRGB to linear color space.
77 ///
78 /// Key:
79 /// R -> Red Component
80 /// G -> Green Component
81 /// B -> Blue Component
82 /// D -> Depth Component
83 /// S -> Stencil Component
84 /// U -> Unsigned (Lack of this denotes a signed component)
85 /// Norm -> Normalized
86 /// SRGB -> sRGB to linear interpretation
87 ///
88 /// While the effective bit width of the pixel can be determined by
89 /// adding up the widths of each component, only the non-esoteric
90 /// formats are tightly packed. Do not assume tight packing for the
91 /// esoteric formats and use blit passes to convert to a
92 /// non-esoteric pass.
93 ///
94 enum class PixelFormat {
95  kUnknown,
105  kB10G10R10XR,
108  // Depth and stencil formats.
109  kS8UInt,
112 };
113 
114 constexpr const char* PixelFormatToString(PixelFormat format) {
115  switch (format) {
117  return "Unknown";
119  return "A8UNormInt";
121  return "R8UNormInt";
123  return "R8G8UNormInt";
125  return "R8G8B8A8UNormInt";
127  return "R8G8B8A8UNormIntSRGB";
129  return "B8G8R8A8UNormInt";
131  return "B8G8R8A8UNormIntSRGB";
133  return "R32G32B32A32Float";
135  return "R16G16B16A16Float";
137  return "B10G10R10XR";
139  return "B10G10R10XRSRGB";
141  return "B10G10R10A10XR";
143  return "S8UInt";
145  return "D24UnormS8Uint";
147  return "D32FloatS8UInt";
148  }
149  FML_UNREACHABLE();
150 }
151 
152 enum class BlendFactor {
153  kZero,
154  kOne,
155  kSourceColor,
157  kSourceAlpha,
164  kBlendColor,
166  kBlendAlpha,
168 };
169 
170 enum class BlendOperation {
171  kAdd,
172  kSubtract,
174 };
175 
176 enum class LoadAction {
177  kDontCare,
178  kLoad,
179  kClear,
180 };
181 
182 enum class StoreAction {
183  kDontCare,
184  kStore,
187 };
188 
189 constexpr const char* LoadActionToString(LoadAction action) {
190  switch (action) {
192  return "DontCare";
193  case LoadAction::kLoad:
194  return "Load";
195  case LoadAction::kClear:
196  return "Clear";
197  }
198 }
199 
200 constexpr const char* StoreActionToString(StoreAction action) {
201  switch (action) {
203  return "DontCare";
204  case StoreAction::kStore:
205  return "Store";
207  return "MultisampleResolve";
209  return "StoreAndMultisampleResolve";
210  }
211 }
212 
213 constexpr bool CanClearAttachment(LoadAction action) {
214  switch (action) {
215  case LoadAction::kLoad:
216  return false;
218  case LoadAction::kClear:
219  return true;
220  }
221  FML_UNREACHABLE();
222 }
223 
225  switch (action) {
226  case StoreAction::kStore:
228  return false;
231  return true;
232  }
233  FML_UNREACHABLE();
234 }
235 
236 enum class TextureType {
237  kTexture2D,
239  kTextureCube,
241 };
242 
243 constexpr const char* TextureTypeToString(TextureType type) {
244  switch (type) {
246  return "Texture2D";
248  return "Texture2DMultisample";
250  return "TextureCube";
252  return "TextureExternalOES";
253  }
254  FML_UNREACHABLE();
255 }
256 
257 constexpr bool IsMultisampleCapable(TextureType type) {
258  switch (type) {
262  return false;
264  return true;
265  }
266  return false;
267 }
268 
269 enum class SampleCount {
270  kCount1 = 1,
271  kCount4 = 4,
272 };
273 
274 using TextureUsageMask = uint64_t;
275 
277  kUnknown = 0,
278  kShaderRead = 1 << 0,
279  kShaderWrite = 1 << 1,
280  kRenderTarget = 1 << 2,
281 };
282 
284  return static_cast<TextureUsageMask>(TextureUsage::kRenderTarget) & mask;
285 }
286 
287 constexpr const char* TextureUsageToString(TextureUsage usage) {
288  switch (usage) {
290  return "Unknown";
292  return "ShaderRead";
294  return "ShaderWrite";
296  return "RenderTarget";
297  }
298  FML_UNREACHABLE();
299 }
300 
302 
303 // Texture coordinate system.
305  // Alternative coordinate system used when uploading texture data from the
306  // host.
307  // (0, 0) is the bottom-left of the image with +Y going up.
309  // Default coordinate system.
310  // (0, 0) is the top-left of the image with +Y going down.
312 };
313 
314 enum class CullMode {
315  kNone,
316  kFrontFace,
317  kBackFace,
318 };
319 
320 enum class IndexType {
321  kUnknown,
322  k16bit,
323  k32bit,
324  /// Does not use the index buffer.
325  kNone,
326 };
327 
328 enum class PrimitiveType {
329  kTriangle,
331  kLine,
332  kLineStrip,
333  kPoint,
334  // Triangle fans are implementation dependent and need extra extensions
335  // checks. Hence, they are not supported here.
336 };
337 
338 enum class PolygonMode {
339  kFill,
340  kLine,
341 };
342 
343 struct DepthRange {
344  Scalar z_near = 0.0;
345  Scalar z_far = 1.0;
346 
347  constexpr bool operator==(const DepthRange& other) const {
348  return z_near == other.z_near && z_far == other.z_far;
349  }
350 };
351 
352 struct Viewport {
355 
356  constexpr bool operator==(const Viewport& other) const {
357  return rect == other.rect && depth_range == other.depth_range;
358  }
359 };
360 
361 enum class MinMagFilter {
362  /// Select nearest to the sample point. Most widely supported.
363  kNearest,
364  /// Select two points and linearly interpolate between them. Some formats
365  /// may not support this.
366  kLinear,
367 };
368 
369 enum class MipFilter {
370  /// Sample from the nearest mip level.
371  kNearest,
372  /// Sample from the two nearest mip levels and linearly interpolate between
373  /// them.
374  kLinear,
375 };
376 
377 enum class SamplerAddressMode {
378  kClampToEdge,
379  kRepeat,
380  kMirror,
381  // More modes are almost always supported but they are usually behind
382  // extensions checks. The ones current in these structs are safe (always
383  // supported) defaults.
384 
385  /// @brief decal sampling mode is only supported on devices that pass
386  /// the `Capabilities.SupportsDecalSamplerAddressMode` check.
387  kDecal,
388 };
389 
390 enum class ColorWriteMask : uint64_t {
391  kNone = 0,
392  kRed = 1 << 0,
393  kGreen = 1 << 1,
394  kBlue = 1 << 2,
395  kAlpha = 1 << 3,
396  kAll = kRed | kGreen | kBlue | kAlpha,
397 };
398 
399 constexpr size_t BytesPerPixelForPixelFormat(PixelFormat format) {
400  switch (format) {
402  return 0u;
406  return 1u;
408  return 2u;
415  return 4u;
417  return 4u;
419  return 5u;
422  return 8u;
424  return 16u;
425  }
426  return 0u;
427 }
428 
429 //------------------------------------------------------------------------------
430 /// @brief Describe the color attachment that will be used with this
431 /// pipeline.
432 ///
433 /// Blending at specific color attachments follows the pseudo-code:
434 /// ```
435 /// if (blending_enabled) {
436 /// final_color.rgb = (src_color_blend_factor * new_color.rgb)
437 /// <color_blend_op>
438 /// (dst_color_blend_factor * old_color.rgb);
439 /// final_color.a = (src_alpha_blend_factor * new_color.a)
440 /// <alpha_blend_op>
441 /// (dst_alpha_blend_factor * old_color.a);
442 /// } else {
443 /// final_color = new_color;
444 /// }
445 /// // IMPORTANT: The write mask is applied irrespective of whether
446 /// // blending_enabled is set.
447 /// final_color = final_color & write_mask;
448 /// ```
449 ///
450 /// The default blend mode is 1 - source alpha.
453  bool blending_enabled = false;
454 
458 
462 
463  std::underlying_type_t<ColorWriteMask> write_mask =
464  static_cast<uint64_t>(ColorWriteMask::kAll);
465 
466  constexpr bool operator==(const ColorAttachmentDescriptor& o) const {
467  return format == o.format && //
470  color_blend_op == o.color_blend_op && //
473  alpha_blend_op == o.alpha_blend_op && //
475  write_mask == o.write_mask;
476  }
477 
478  constexpr size_t Hash() const {
479  return fml::HashCombine(format, blending_enabled, src_color_blend_factor,
483  }
484 };
485 
486 enum class CompareFunction {
487  /// Comparison test never passes.
488  kNever,
489  /// Comparison test passes always passes.
490  kAlways,
491  /// Comparison test passes if new_value < current_value.
492  kLess,
493  /// Comparison test passes if new_value == current_value.
494  kEqual,
495  /// Comparison test passes if new_value <= current_value.
496  kLessEqual,
497  /// Comparison test passes if new_value > current_value.
498  kGreater,
499  /// Comparison test passes if new_value != current_value.
500  kNotEqual,
501  /// Comparison test passes if new_value >= current_value.
503 };
504 
505 enum class StencilOperation {
506  /// Don't modify the current stencil value.
507  kKeep,
508  /// Reset the stencil value to zero.
509  kZero,
510  /// Reset the stencil value to the reference value.
512  /// Increment the current stencil value by 1. Clamp it to the maximum.
514  /// Decrement the current stencil value by 1. Clamp it to zero.
516  /// Perform a logical bitwise invert on the current stencil value.
517  kInvert,
518  /// Increment the current stencil value by 1. If at maximum, set to zero.
520  /// Decrement the current stencil value by 1. If at zero, set to maximum.
522 };
523 
525  //----------------------------------------------------------------------------
526  /// Indicates how to compare the value with that in the depth buffer.
527  ///
529  //----------------------------------------------------------------------------
530  /// Indicates when writes must be performed to the depth buffer.
531  ///
532  bool depth_write_enabled = false;
533 
534  constexpr bool operator==(const DepthAttachmentDescriptor& o) const {
535  return depth_compare == o.depth_compare &&
537  }
538 
539  constexpr size_t GetHash() const {
540  return fml::HashCombine(depth_compare, depth_write_enabled);
541  }
542 };
543 
545  //----------------------------------------------------------------------------
546  /// Indicates the operation to perform between the reference value and the
547  /// value in the stencil buffer. Both values have the read_mask applied to
548  /// them before performing this operation.
549  ///
551  //----------------------------------------------------------------------------
552  /// Indicates what to do when the stencil test has failed.
553  ///
555  //----------------------------------------------------------------------------
556  /// Indicates what to do when the stencil test passes but the depth test
557  /// fails.
558  ///
560  //----------------------------------------------------------------------------
561  /// Indicates what to do when both the stencil and depth tests pass.
562  ///
564 
565  //----------------------------------------------------------------------------
566  /// The mask applied to the reference and stencil buffer values before
567  /// performing the stencil_compare operation.
568  ///
569  uint32_t read_mask = ~0;
570  //----------------------------------------------------------------------------
571  /// The mask applied to the new stencil value before it is written into the
572  /// stencil buffer.
573  ///
574  uint32_t write_mask = ~0;
575 
576  constexpr bool operator==(const StencilAttachmentDescriptor& o) const {
577  return stencil_compare == o.stencil_compare &&
582  }
583 
584  constexpr size_t GetHash() const {
585  return fml::HashCombine(stencil_compare, stencil_failure, depth_failure,
587  }
588 };
589 
590 struct Attachment {
591  std::shared_ptr<Texture> texture;
592  std::shared_ptr<Texture> resolve_texture;
595 
596  bool IsValid() const;
597 };
598 
599 struct ColorAttachment : public Attachment {
601 };
602 
603 struct DepthAttachment : public Attachment {
604  double clear_depth = 0.0;
605 };
606 
607 struct StencilAttachment : public Attachment {
608  uint32_t clear_stencil = 0;
609 };
610 
611 std::string AttachmentToString(const Attachment& attachment);
612 
613 std::string ColorAttachmentToString(const ColorAttachment& color);
614 
615 std::string DepthAttachmentToString(const DepthAttachment& depth);
616 
617 std::string StencilAttachmentToString(const StencilAttachment& stencil);
618 
619 } // namespace impeller
620 
621 namespace std {
622 
623 template <>
624 struct hash<impeller::DepthAttachmentDescriptor> {
625  constexpr std::size_t operator()(
626  const impeller::DepthAttachmentDescriptor& des) const {
627  return des.GetHash();
628  }
629 };
630 
631 template <>
632 struct hash<impeller::StencilAttachmentDescriptor> {
633  constexpr std::size_t operator()(
634  const impeller::StencilAttachmentDescriptor& des) const {
635  return des.GetHash();
636  }
637 };
638 
639 } // namespace std
impeller::PixelFormat::kB8G8R8A8UNormIntSRGB
@ kB8G8R8A8UNormIntSRGB
impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::TextureType::kTextureExternalOES
@ kTextureExternalOES
impeller::ColorAttachmentDescriptor::src_color_blend_factor
BlendFactor src_color_blend_factor
Definition: formats.h:455
impeller::LoadAction::kLoad
@ kLoad
impeller::StoreAction
StoreAction
Definition: formats.h:182
impeller::PrimitiveType
PrimitiveType
Definition: formats.h:328
impeller::ColorWriteMask
ColorWriteMask
Definition: formats.h:390
impeller::StoreAction::kStoreAndMultisampleResolve
@ kStoreAndMultisampleResolve
impeller::TextureUsageMask
uint64_t TextureUsageMask
Definition: formats.h:274
impeller::PixelFormat::kB10G10R10XR
@ kB10G10R10XR
impeller::IndexType::k16bit
@ k16bit
impeller::Attachment::store_action
StoreAction store_action
Definition: formats.h:594
impeller::PolygonMode
PolygonMode
Definition: formats.h:338
impeller::PixelFormatToString
constexpr const char * PixelFormatToString(PixelFormat format)
Definition: formats.h:114
impeller::Scalar
float Scalar
Definition: scalar.h:15
impeller::CanClearAttachment
constexpr bool CanClearAttachment(LoadAction action)
Definition: formats.h:213
impeller::TextureUsage
TextureUsage
Definition: formats.h:276
impeller::StencilAttachmentDescriptor::depth_failure
StencilOperation depth_failure
Definition: formats.h:559
impeller::StencilAttachmentDescriptor::stencil_compare
CompareFunction stencil_compare
Definition: formats.h:550
impeller::CompareFunction::kGreater
@ kGreater
Comparison test passes if new_value > current_value.
impeller::Viewport::rect
Rect rect
Definition: formats.h:353
impeller::TextureUsage::kUnknown
@ kUnknown
impeller::Viewport::depth_range
DepthRange depth_range
Definition: formats.h:354
impeller::SampleCount
SampleCount
Definition: formats.h:269
impeller::BlendFactor::kSourceAlphaSaturated
@ kSourceAlphaSaturated
impeller::PixelFormat::kB10G10R10XRSRGB
@ kB10G10R10XRSRGB
impeller::BlendFactor
BlendFactor
Definition: formats.h:152
impeller::DepthRange::z_far
Scalar z_far
Definition: formats.h:345
impeller::Color
Definition: color.h:122
impeller::PixelFormat::kR8G8B8A8UNormIntSRGB
@ kR8G8B8A8UNormIntSRGB
impeller::ColorAttachmentDescriptor::write_mask
std::underlying_type_t< ColorWriteMask > write_mask
Definition: formats.h:463
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::ColorAttachment
Definition: formats.h:599
impeller::SamplerAddressMode
SamplerAddressMode
Definition: formats.h:377
impeller::CompareFunction::kNotEqual
@ kNotEqual
Comparison test passes if new_value != current_value.
impeller::StencilOperation::kZero
@ kZero
Reset the stencil value to zero.
impeller::LoadActionToString
constexpr const char * LoadActionToString(LoadAction action)
Definition: formats.h:189
impeller::TextureType
TextureType
Definition: formats.h:236
impeller::ColorWriteMask::kGreen
@ kGreen
impeller::DepthRange::z_near
Scalar z_near
Definition: formats.h:344
impeller::DepthAttachmentDescriptor::GetHash
constexpr size_t GetHash() const
Definition: formats.h:539
impeller::ColorWriteMask::kRed
@ kRed
impeller::ColorAttachmentDescriptor::alpha_blend_op
BlendOperation alpha_blend_op
Definition: formats.h:460
impeller::SampleCount::kCount1
@ kCount1
impeller::TextureUsage::kRenderTarget
@ kRenderTarget
impeller::StoreAction::kDontCare
@ kDontCare
impeller::PixelFormat::kR16G16B16A16Float
@ kR16G16B16A16Float
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::SamplerAddressMode::kClampToEdge
@ kClampToEdge
impeller::BlendFactor::kDestinationAlpha
@ kDestinationAlpha
impeller::IndexType::k32bit
@ k32bit
impeller::StencilAttachmentDescriptor::write_mask
uint32_t write_mask
Definition: formats.h:574
impeller::StorageMode::kHostVisible
@ kHostVisible
impeller::StencilOperation
StencilOperation
Definition: formats.h:505
impeller::SampleCount::kCount4
@ kCount4
impeller::PolygonMode::kFill
@ kFill
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::BlendFactor::kSourceColor
@ kSourceColor
impeller::PrimitiveType::kPoint
@ kPoint
impeller::BlendFactor::kDestinationColor
@ kDestinationColor
impeller::MinMagFilter::kNearest
@ kNearest
Select nearest to the sample point. Most widely supported.
impeller::TextureCoordinateSystem::kUploadFromHost
@ kUploadFromHost
impeller::ColorAttachmentDescriptor::Hash
constexpr size_t Hash() const
Definition: formats.h:478
impeller::BlendFactor::kZero
@ kZero
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
impeller::StencilAttachment
Definition: formats.h:607
impeller::TextureCoordinateSystem
TextureCoordinateSystem
Definition: formats.h:304
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::StencilOperation::kInvert
@ kInvert
Perform a logical bitwise invert on the current stencil value.
impeller::CullMode
CullMode
Definition: formats.h:314
impeller::MipFilter::kNearest
@ kNearest
Sample from the nearest mip level.
impeller::TextureCoordinateSystem::kRenderToTexture
@ kRenderToTexture
impeller::LoadAction::kClear
@ kClear
impeller::DepthAttachmentDescriptor::depth_write_enabled
bool depth_write_enabled
Definition: formats.h:532
impeller::BlendFactor::kOneMinusDestinationColor
@ kOneMinusDestinationColor
impeller::StorageMode::kDeviceTransient
@ kDeviceTransient
impeller::ColorAttachment::clear_color
Color clear_color
Definition: formats.h:600
impeller::CullMode::kBackFace
@ kBackFace
impeller::StorageMode
StorageMode
Specified where the allocation resides and how it is used.
Definition: formats.h:27
impeller::DepthAttachmentDescriptor::operator==
constexpr bool operator==(const DepthAttachmentDescriptor &o) const
Definition: formats.h:534
impeller::CullMode::kNone
@ kNone
impeller::StencilAttachmentDescriptor::read_mask
uint32_t read_mask
Definition: formats.h:569
impeller::MipFilter
MipFilter
Definition: formats.h:369
impeller::BlendOperation::kReverseSubtract
@ kReverseSubtract
impeller::BytesPerPixelForPixelFormat
constexpr size_t BytesPerPixelForPixelFormat(PixelFormat format)
Definition: formats.h:399
impeller::BlendFactor::kBlendAlpha
@ kBlendAlpha
impeller::Attachment::texture
std::shared_ptr< Texture > texture
Definition: formats.h:591
impeller::StencilOperation::kSetToReferenceValue
@ kSetToReferenceValue
Reset the stencil value to the reference value.
impeller::DepthRange::operator==
constexpr bool operator==(const DepthRange &other) const
Definition: formats.h:347
impeller::LoadAction
LoadAction
Definition: formats.h:176
impeller::BlendOperation::kAdd
@ kAdd
impeller::ColorWriteMask::kNone
@ kNone
impeller::MinMagFilter::kLinear
@ kLinear
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::StorageModeToString
constexpr const char * StorageModeToString(StorageMode mode)
Definition: formats.h:55
impeller::BlendFactor::kBlendColor
@ kBlendColor
std::hash< impeller::DepthAttachmentDescriptor >::operator()
constexpr std::size_t operator()(const impeller::DepthAttachmentDescriptor &des) const
Definition: formats.h:625
impeller::IndexType
IndexType
Definition: formats.h:320
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::AttachmentToString
std::string AttachmentToString(const Attachment &attachment)
Definition: formats.cc:104
impeller::ColorAttachmentToString
std::string ColorAttachmentToString(const ColorAttachment &color)
Definition: formats.cc:123
impeller::TextureUsage::kShaderRead
@ kShaderRead
impeller::CompareFunction::kNever
@ kNever
Comparison test never passes.
impeller::StencilAttachmentDescriptor::stencil_failure
StencilOperation stencil_failure
Definition: formats.h:554
impeller::BlendFactor::kOneMinusBlendColor
@ kOneMinusBlendColor
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::ColorAttachmentDescriptor::format
PixelFormat format
Definition: formats.h:452
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::TextureType::kTextureCube
@ kTextureCube
impeller::MinMagFilter
MinMagFilter
Definition: formats.h:361
impeller::StencilAttachmentDescriptor::depth_stencil_pass
StencilOperation depth_stencil_pass
Definition: formats.h:563
impeller::PixelFormat::kR8G8UNormInt
@ kR8G8UNormInt
impeller::Attachment
Definition: formats.h:590
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::StoreAction::kStore
@ kStore
impeller::StencilAttachment::clear_stencil
uint32_t clear_stencil
Definition: formats.h:608
impeller::StencilAttachmentDescriptor::operator==
constexpr bool operator==(const StencilAttachmentDescriptor &o) const
Definition: formats.h:576
impeller::BlendFactor::kOne
@ kOne
impeller::BlendFactor::kOneMinusBlendAlpha
@ kOneMinusBlendAlpha
impeller::CanDiscardAttachmentWhenDone
constexpr bool CanDiscardAttachmentWhenDone(StoreAction action)
Definition: formats.h:224
impeller::StencilAttachmentDescriptor::GetHash
constexpr size_t GetHash() const
Definition: formats.h:584
impeller::IsMultisampleCapable
constexpr bool IsMultisampleCapable(TextureType type)
Definition: formats.h:257
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::PixelFormat::kB8G8R8A8UNormInt
@ kB8G8R8A8UNormInt
impeller::PrimitiveType::kLine
@ kLine
impeller::DepthRange
Definition: formats.h:343
impeller::TextureType::kTexture2D
@ kTexture2D
impeller::TextureUsageMaskToString
std::string TextureUsageMaskToString(TextureUsageMask mask)
Definition: formats.cc:81
impeller::PrimitiveType::kLineStrip
@ kLineStrip
std::hash< impeller::StencilAttachmentDescriptor >::operator()
constexpr std::size_t operator()(const impeller::StencilAttachmentDescriptor &des) const
Definition: formats.h:633
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
scalar.h
impeller::ColorAttachmentDescriptor::src_alpha_blend_factor
BlendFactor src_alpha_blend_factor
Definition: formats.h:459
impeller::Viewport
Definition: formats.h:352
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::PixelFormat::kB10G10R10A10XR
@ kB10G10R10A10XR
impeller::ColorAttachmentDescriptor::dst_color_blend_factor
BlendFactor dst_color_blend_factor
Definition: formats.h:457
impeller::TextureTypeToString
constexpr const char * TextureTypeToString(TextureType type)
Definition: formats.h:243
impeller::BlendOperation
BlendOperation
Definition: formats.h:170
impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor
BlendFactor dst_alpha_blend_factor
Definition: formats.h:461
impeller::CompareFunction::kGreaterEqual
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
impeller::Attachment::resolve_texture
std::shared_ptr< Texture > resolve_texture
Definition: formats.h:592
impeller::StencilOperation::kDecrementClamp
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
impeller::CompareFunction
CompareFunction
Definition: formats.h:486
impeller::ColorWriteMask::kAll
@ kAll
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::SamplerAddressMode::kMirror
@ kMirror
std
Definition: comparable.h:98
impeller::DepthAttachmentToString
std::string DepthAttachmentToString(const DepthAttachment &depth)
Definition: formats.cc:130
impeller::LoadAction::kDontCare
@ kDontCare
impeller::PixelFormat::kS8UInt
@ kS8UInt
rect.h
impeller::DepthAttachmentDescriptor
Definition: formats.h:524
impeller::Color::BlackTransparent
static constexpr Color BlackTransparent()
Definition: color.h:260
impeller::StencilAttachmentDescriptor
Definition: formats.h:544
impeller::Attachment::load_action
LoadAction load_action
Definition: formats.h:593
impeller::BlendFactor::kOneMinusSourceColor
@ kOneMinusSourceColor
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::MipFilter::kLinear
@ kLinear
impeller::Viewport::operator==
constexpr bool operator==(const Viewport &other) const
Definition: formats.h:356
impeller::Attachment::IsValid
bool IsValid() const
Definition: formats.cc:26
impeller::ColorWriteMask::kAlpha
@ kAlpha
color.h
impeller::ColorAttachmentDescriptor::operator==
constexpr bool operator==(const ColorAttachmentDescriptor &o) const
Definition: formats.h:466
impeller::ColorWriteMask::kBlue
@ kBlue
impeller::DepthAttachment::clear_depth
double clear_depth
Definition: formats.h:604
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::PolygonMode::kLine
@ kLine
impeller::StoreActionToString
constexpr const char * StoreActionToString(StoreAction action)
Definition: formats.h:200
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::DepthAttachment
Definition: formats.h:603
impeller::ColorAttachmentDescriptor::color_blend_op
BlendOperation color_blend_op
Definition: formats.h:456
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:94
impeller::BlendFactor::kSourceAlpha
@ kSourceAlpha
impeller::StencilOperation::kDecrementWrap
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
impeller::CompareFunction::kLessEqual
@ kLessEqual
Comparison test passes if new_value <= current_value.
impeller::TextureUsage::kShaderWrite
@ kShaderWrite
impeller::TextureUsageToString
constexpr const char * TextureUsageToString(TextureUsage usage)
Definition: formats.h:287
impeller
Definition: aiks_context.cc:10
impeller::StencilAttachmentToString
std::string StencilAttachmentToString(const StencilAttachment &stencil)
Definition: formats.cc:137
impeller::ColorAttachmentDescriptor::blending_enabled
bool blending_enabled
Definition: formats.h:453
impeller::StencilOperation::kIncrementWrap
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
impeller::BlendOperation::kSubtract
@ kSubtract
impeller::IndexType::kUnknown
@ kUnknown
impeller::TRect< Scalar >
impeller::BlendFactor::kOneMinusDestinationAlpha
@ kOneMinusDestinationAlpha
impeller::DepthAttachmentDescriptor::depth_compare
CompareFunction depth_compare
Definition: formats.h:528
impeller::TextureUsageIsRenderTarget
constexpr bool TextureUsageIsRenderTarget(TextureUsageMask mask)
Definition: formats.h:283
impeller::PixelFormat::kR32G32B32A32Float
@ kR32G32B32A32Float
impeller::ColorAttachmentDescriptor
Describe the color attachment that will be used with this pipeline.
Definition: formats.h:451
impeller::SamplerAddressMode::kRepeat
@ kRepeat
impeller::SamplerAddressMode::kDecal
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...