Flutter Impeller
formats_mtl.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 <Metal/Metal.h>
8 
9 #include <optional>
10 
11 #include "flutter/fml/macros.h"
13 #include "impeller/core/formats.h"
16 
17 namespace impeller {
18 
19 class RenderTarget;
20 
21 constexpr PixelFormat FromMTLPixelFormat(MTLPixelFormat format) {
22  switch (format) {
23  case MTLPixelFormatInvalid:
24  return PixelFormat::kUnknown;
25  case MTLPixelFormatBGRA8Unorm:
27  case MTLPixelFormatBGRA8Unorm_sRGB:
29  case MTLPixelFormatRGBA8Unorm:
31  case MTLPixelFormatRGBA8Unorm_sRGB:
33  case MTLPixelFormatRGBA32Float:
35  case MTLPixelFormatRGBA16Float:
37  case MTLPixelFormatStencil8:
38  return PixelFormat::kS8UInt;
39 #if !FML_OS_IOS
40  case MTLPixelFormatDepth24Unorm_Stencil8:
42 #endif // FML_OS_IOS
43  case MTLPixelFormatDepth32Float_Stencil8:
45  case MTLPixelFormatBGR10_XR_sRGB:
47  case MTLPixelFormatBGR10_XR:
49  case MTLPixelFormatBGRA10_XR:
51  default:
52  return PixelFormat::kUnknown;
53  }
54  return PixelFormat::kUnknown;
55 }
56 
57 /// Safe accessor for MTLPixelFormatDepth24Unorm_Stencil8.
58 /// Returns PixelFormat::kUnknown if MTLPixelFormatDepth24Unorm_Stencil8 isn't
59 /// supported.
61 
62 /// Safe accessor for MTLPixelFormatBGR10_XR_sRGB.
63 /// Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR_sRGB isn't
64 /// supported.
65 MTLPixelFormat SafeMTLPixelFormatBGR10_XR_sRGB();
66 
67 /// Safe accessor for MTLPixelFormatBGR10_XR.
68 /// Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR isn't supported.
69 MTLPixelFormat SafeMTLPixelFormatBGR10_XR();
70 
71 /// Safe accessor for MTLPixelFormatBGRA10_XR.
72 /// Returns PixelFormat::kUnknown if MTLPixelFormatBGR10_XR isn't supported.
73 MTLPixelFormat SafeMTLPixelFormatBGRA10_XR();
74 
75 constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format) {
76  switch (format) {
78  return MTLPixelFormatInvalid;
80  return MTLPixelFormatA8Unorm;
82  return MTLPixelFormatR8Unorm;
84  return MTLPixelFormatRG8Unorm;
86  return MTLPixelFormatBGRA8Unorm;
88  return MTLPixelFormatBGRA8Unorm_sRGB;
90  return MTLPixelFormatRGBA8Unorm;
92  return MTLPixelFormatRGBA8Unorm_sRGB;
94  return MTLPixelFormatRGBA32Float;
96  return MTLPixelFormatRGBA16Float;
98  return MTLPixelFormatStencil8;
102  return MTLPixelFormatDepth32Float_Stencil8;
109  }
110  return MTLPixelFormatInvalid;
111 };
112 
113 constexpr MTLBlendFactor ToMTLBlendFactor(BlendFactor type) {
114  switch (type) {
115  case BlendFactor::kZero:
116  return MTLBlendFactorZero;
117  case BlendFactor::kOne:
118  return MTLBlendFactorOne;
120  return MTLBlendFactorSourceColor;
122  return MTLBlendFactorOneMinusSourceColor;
124  return MTLBlendFactorSourceAlpha;
126  return MTLBlendFactorOneMinusSourceAlpha;
128  return MTLBlendFactorDestinationColor;
130  return MTLBlendFactorOneMinusDestinationColor;
132  return MTLBlendFactorDestinationAlpha;
134  return MTLBlendFactorOneMinusDestinationAlpha;
136  return MTLBlendFactorSourceAlphaSaturated;
138  return MTLBlendFactorBlendColor;
140  return MTLBlendFactorOneMinusBlendColor;
142  return MTLBlendFactorBlendAlpha;
144  return MTLBlendFactorOneMinusBlendAlpha;
145  }
146  return MTLBlendFactorZero;
147 };
148 
149 constexpr MTLPrimitiveType ToMTLPrimitiveType(PrimitiveType type) {
150  switch (type) {
152  return MTLPrimitiveTypeTriangle;
154  return MTLPrimitiveTypeTriangleStrip;
156  return MTLPrimitiveTypeLine;
158  return MTLPrimitiveTypeLineStrip;
160  return MTLPrimitiveTypePoint;
161  }
162  return MTLPrimitiveTypePoint;
163 }
164 
165 constexpr MTLTriangleFillMode ToMTLTriangleFillMode(PolygonMode mode) {
166  switch (mode) {
167  case PolygonMode::kFill:
168  return MTLTriangleFillModeFill;
169  case PolygonMode::kLine:
170  return MTLTriangleFillModeLines;
171  }
172  return MTLTriangleFillModeFill;
173 }
174 
175 constexpr MTLIndexType ToMTLIndexType(IndexType type) {
176  switch (type) {
177  case IndexType::k16bit:
178  return MTLIndexTypeUInt16;
179  default:
180  return MTLIndexTypeUInt32;
181  }
182 }
183 
184 constexpr MTLCullMode ToMTLCullMode(CullMode mode) {
185  switch (mode) {
186  case CullMode::kNone:
187  return MTLCullModeNone;
188  case CullMode::kBackFace:
189  return MTLCullModeBack;
191  return MTLCullModeFront;
192  }
193  return MTLCullModeNone;
194 }
195 
196 constexpr MTLBlendOperation ToMTLBlendOperation(BlendOperation type) {
197  switch (type) {
199  return MTLBlendOperationAdd;
201  return MTLBlendOperationSubtract;
203  return MTLBlendOperationReverseSubtract;
204  }
205  return MTLBlendOperationAdd;
206 };
207 
208 constexpr MTLColorWriteMask ToMTLColorWriteMask(
209  std::underlying_type_t<ColorWriteMask> type) {
210  using UnderlyingType = decltype(type);
211 
212  MTLColorWriteMask mask = MTLColorWriteMaskNone;
213 
214  if (type & static_cast<UnderlyingType>(ColorWriteMask::kRed)) {
215  mask |= MTLColorWriteMaskRed;
216  }
217 
218  if (type & static_cast<UnderlyingType>(ColorWriteMask::kGreen)) {
219  mask |= MTLColorWriteMaskGreen;
220  }
221 
222  if (type & static_cast<UnderlyingType>(ColorWriteMask::kBlue)) {
223  mask |= MTLColorWriteMaskBlue;
224  }
225 
226  if (type & static_cast<UnderlyingType>(ColorWriteMask::kAlpha)) {
227  mask |= MTLColorWriteMaskAlpha;
228  }
229 
230  return mask;
231 };
232 
233 constexpr MTLCompareFunction ToMTLCompareFunction(CompareFunction func) {
234  switch (func) {
236  return MTLCompareFunctionNever;
238  return MTLCompareFunctionLess;
240  return MTLCompareFunctionEqual;
242  return MTLCompareFunctionLessEqual;
244  return MTLCompareFunctionGreater;
246  return MTLCompareFunctionNotEqual;
248  return MTLCompareFunctionGreaterEqual;
250  return MTLCompareFunctionAlways;
251  }
252  return MTLCompareFunctionAlways;
253 };
254 
255 constexpr MTLStencilOperation ToMTLStencilOperation(StencilOperation op) {
256  switch (op) {
258  return MTLStencilOperationKeep;
260  return MTLStencilOperationZero;
262  return MTLStencilOperationReplace;
264  return MTLStencilOperationIncrementClamp;
266  return MTLStencilOperationDecrementClamp;
268  return MTLStencilOperationInvert;
270  return MTLStencilOperationIncrementWrap;
272  return MTLStencilOperationDecrementWrap;
273  }
274  return MTLStencilOperationKeep;
275 };
276 
277 constexpr MTLLoadAction ToMTLLoadAction(LoadAction action) {
278  switch (action) {
280  return MTLLoadActionDontCare;
281  case LoadAction::kLoad:
282  return MTLLoadActionLoad;
283  case LoadAction::kClear:
284  return MTLLoadActionClear;
285  }
286 
287  return MTLLoadActionDontCare;
288 }
289 
290 constexpr LoadAction FromMTLLoadAction(MTLLoadAction action) {
291  switch (action) {
292  case MTLLoadActionDontCare:
293  return LoadAction::kDontCare;
294  case MTLLoadActionLoad:
295  return LoadAction::kLoad;
296  case MTLLoadActionClear:
297  return LoadAction::kClear;
298  default:
299  break;
300  }
301 
302  return LoadAction::kDontCare;
303 }
304 
305 constexpr MTLStoreAction ToMTLStoreAction(StoreAction action) {
306  switch (action) {
308  return MTLStoreActionDontCare;
309  case StoreAction::kStore:
310  return MTLStoreActionStore;
312  return MTLStoreActionMultisampleResolve;
314  return MTLStoreActionStoreAndMultisampleResolve;
315  }
316  return MTLStoreActionDontCare;
317 }
318 
319 constexpr StoreAction FromMTLStoreAction(MTLStoreAction action) {
320  switch (action) {
321  case MTLStoreActionDontCare:
322  return StoreAction::kDontCare;
323  case MTLStoreActionStore:
324  return StoreAction::kStore;
325  case MTLStoreActionMultisampleResolve:
327  case MTLStoreActionStoreAndMultisampleResolve:
329  default:
330  break;
331  }
332  return StoreAction::kDontCare;
333 }
334 
335 constexpr MTLSamplerMinMagFilter ToMTLSamplerMinMagFilter(MinMagFilter filter) {
336  switch (filter) {
338  return MTLSamplerMinMagFilterNearest;
340  return MTLSamplerMinMagFilterLinear;
341  }
342  return MTLSamplerMinMagFilterNearest;
343 }
344 
345 constexpr MTLSamplerMipFilter ToMTLSamplerMipFilter(MipFilter filter) {
346  switch (filter) {
347  case MipFilter::kNearest:
348  return MTLSamplerMipFilterNearest;
349  case MipFilter::kLinear:
350  return MTLSamplerMipFilterLinear;
351  }
352  return MTLSamplerMipFilterNotMipmapped;
353 }
354 
355 constexpr MTLSamplerAddressMode ToMTLSamplerAddressMode(
356  SamplerAddressMode mode) {
357  switch (mode) {
359  return MTLSamplerAddressModeClampToEdge;
361  return MTLSamplerAddressModeRepeat;
363  return MTLSamplerAddressModeMirrorRepeat;
365  return MTLSamplerAddressModeClampToZero;
366  }
367  return MTLSamplerAddressModeClampToEdge;
368 }
369 
370 inline MTLClearColor ToMTLClearColor(const Color& color) {
371  return MTLClearColorMake(color.red, color.green, color.blue, color.alpha);
372 }
373 
374 constexpr MTLTextureType ToMTLTextureType(TextureType type) {
375  switch (type) {
377  return MTLTextureType2D;
379  return MTLTextureType2DMultisample;
381  return MTLTextureTypeCube;
384  << "kTextureExternalOES can not be used with the Metal backend.";
385  }
386  return MTLTextureType2D;
387 }
388 
389 MTLRenderPipelineColorAttachmentDescriptor*
391  ColorAttachmentDescriptor descriptor);
392 
393 MTLDepthStencilDescriptor* ToMTLDepthStencilDescriptor(
394  std::optional<DepthAttachmentDescriptor> depth,
395  std::optional<StencilAttachmentDescriptor> front,
396  std::optional<StencilAttachmentDescriptor> back);
397 
398 MTLTextureDescriptor* ToMTLTextureDescriptor(const TextureDescriptor& desc);
399 
400 } // namespace impeller
impeller::PixelFormat::kB8G8R8A8UNormIntSRGB
@ kB8G8R8A8UNormIntSRGB
impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::TextureType::kTextureExternalOES
@ kTextureExternalOES
impeller::LoadAction::kLoad
@ kLoad
impeller::ToMTLColorWriteMask
constexpr MTLColorWriteMask ToMTLColorWriteMask(std::underlying_type_t< ColorWriteMask > type)
Definition: formats_mtl.h:208
impeller::StoreAction
StoreAction
Definition: formats.h:182
impeller::PrimitiveType
PrimitiveType
Definition: formats.h:328
impeller::StoreAction::kStoreAndMultisampleResolve
@ kStoreAndMultisampleResolve
impeller::PixelFormat::kB10G10R10XR
@ kB10G10R10XR
impeller::IndexType::k16bit
@ k16bit
impeller::PolygonMode
PolygonMode
Definition: formats.h:338
impeller::ToMTLSamplerAddressMode
constexpr MTLSamplerAddressMode ToMTLSamplerAddressMode(SamplerAddressMode mode)
Definition: formats_mtl.h:355
impeller::CompareFunction::kGreater
@ kGreater
Comparison test passes if new_value > current_value.
impeller::SafeMTLPixelFormatBGRA10_XR
MTLPixelFormat SafeMTLPixelFormatBGRA10_XR()
Definition: formats_mtl.mm:138
impeller::BlendFactor::kSourceAlphaSaturated
@ kSourceAlphaSaturated
impeller::PixelFormat::kB10G10R10XRSRGB
@ kB10G10R10XRSRGB
impeller::BlendFactor
BlendFactor
Definition: formats.h:152
impeller::Color
Definition: color.h:122
impeller::PixelFormat::kR8G8B8A8UNormIntSRGB
@ kR8G8B8A8UNormIntSRGB
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::SamplerAddressMode
SamplerAddressMode
Definition: formats.h:377
impeller::CompareFunction::kNotEqual
@ kNotEqual
Comparison test passes if new_value != current_value.
impeller::ToMTLStencilOperation
constexpr MTLStencilOperation ToMTLStencilOperation(StencilOperation op)
Definition: formats_mtl.h:255
impeller::StencilOperation::kZero
@ kZero
Reset the stencil value to zero.
impeller::TextureType
TextureType
Definition: formats.h:236
impeller::ColorWriteMask::kGreen
@ kGreen
texture_descriptor.h
formats.h
impeller::ColorWriteMask::kRed
@ kRed
impeller::Color::alpha
Scalar alpha
Definition: color.h:141
impeller::StoreAction::kDontCare
@ kDontCare
impeller::PixelFormat::kR16G16B16A16Float
@ kR16G16B16A16Float
impeller::SafeMTLPixelFormatDepth24Unorm_Stencil8
MTLPixelFormat SafeMTLPixelFormatDepth24Unorm_Stencil8()
Definition: formats_mtl.mm:113
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::SamplerAddressMode::kClampToEdge
@ kClampToEdge
impeller::BlendFactor::kDestinationAlpha
@ kDestinationAlpha
impeller::ToMTLStoreAction
constexpr MTLStoreAction ToMTLStoreAction(StoreAction action)
Definition: formats_mtl.h:305
impeller::ToMTLCompareFunction
constexpr MTLCompareFunction ToMTLCompareFunction(CompareFunction func)
Definition: formats_mtl.h:233
impeller::StencilOperation
StencilOperation
Definition: formats.h:505
validation.h
impeller::Color::green
Scalar green
Definition: color.h:131
impeller::ToMTLClearColor
MTLClearColor ToMTLClearColor(const Color &color)
Definition: formats_mtl.h:370
impeller::PolygonMode::kFill
@ kFill
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::BlendFactor::kSourceColor
@ kSourceColor
impeller::PrimitiveType::kPoint
@ kPoint
impeller::ToMTLDepthStencilDescriptor
MTLDepthStencilDescriptor * ToMTLDepthStencilDescriptor(std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
Definition: formats_mtl.mm:54
impeller::BlendFactor::kDestinationColor
@ kDestinationColor
impeller::ToMTLTextureDescriptor
MTLTextureDescriptor * ToMTLTextureDescriptor(const TextureDescriptor &desc)
Definition: formats_mtl.mm:86
impeller::MinMagFilter::kNearest
@ kNearest
Select nearest to the sample point. Most widely supported.
impeller::BlendFactor::kZero
@ kZero
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
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::LoadAction::kClear
@ kClear
impeller::BlendFactor::kOneMinusDestinationColor
@ kOneMinusDestinationColor
impeller::CullMode::kBackFace
@ kBackFace
impeller::FromMTLStoreAction
constexpr StoreAction FromMTLStoreAction(MTLStoreAction action)
Definition: formats_mtl.h:319
impeller::ToMTLLoadAction
constexpr MTLLoadAction ToMTLLoadAction(LoadAction action)
Definition: formats_mtl.h:277
impeller::CullMode::kNone
@ kNone
impeller::ToMTLBlendOperation
constexpr MTLBlendOperation ToMTLBlendOperation(BlendOperation type)
Definition: formats_mtl.h:196
impeller::MipFilter
MipFilter
Definition: formats.h:369
impeller::BlendOperation::kReverseSubtract
@ kReverseSubtract
impeller::BlendFactor::kBlendAlpha
@ kBlendAlpha
impeller::StencilOperation::kSetToReferenceValue
@ kSetToReferenceValue
Reset the stencil value to the reference value.
impeller::ToMTLPrimitiveType
constexpr MTLPrimitiveType ToMTLPrimitiveType(PrimitiveType type)
Definition: formats_mtl.h:149
impeller::LoadAction
LoadAction
Definition: formats.h:176
impeller::ToMTLSamplerMinMagFilter
constexpr MTLSamplerMinMagFilter ToMTLSamplerMinMagFilter(MinMagFilter filter)
Definition: formats_mtl.h:335
impeller::ToMTLRenderPipelineColorAttachmentDescriptor
MTLRenderPipelineColorAttachmentDescriptor * ToMTLRenderPipelineColorAttachmentDescriptor(ColorAttachmentDescriptor descriptor)
Definition: formats_mtl.mm:15
impeller::BlendOperation::kAdd
@ kAdd
impeller::MinMagFilter::kLinear
@ kLinear
impeller::BlendFactor::kBlendColor
@ kBlendColor
impeller::IndexType
IndexType
Definition: formats.h:320
impeller::Color::red
Scalar red
Definition: color.h:126
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::CompareFunction::kNever
@ kNever
Comparison test never passes.
impeller::BlendFactor::kOneMinusBlendColor
@ kOneMinusBlendColor
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::TextureType::kTextureCube
@ kTextureCube
impeller::MinMagFilter
MinMagFilter
Definition: formats.h:361
impeller::PixelFormat::kR8G8UNormInt
@ kR8G8UNormInt
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::StoreAction::kStore
@ kStore
impeller::BlendFactor::kOne
@ kOne
impeller::BlendFactor::kOneMinusBlendAlpha
@ kOneMinusBlendAlpha
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::TextureType::kTexture2D
@ kTexture2D
impeller::PrimitiveType::kLineStrip
@ kLineStrip
impeller::ToMTLPixelFormat
constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format)
Definition: formats_mtl.h:75
impeller::SafeMTLPixelFormatBGR10_XR
MTLPixelFormat SafeMTLPixelFormatBGR10_XR()
Definition: formats_mtl.mm:130
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
impeller::ToMTLTextureType
constexpr MTLTextureType ToMTLTextureType(TextureType type)
Definition: formats_mtl.h:374
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:60
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::FromMTLLoadAction
constexpr LoadAction FromMTLLoadAction(MTLLoadAction action)
Definition: formats_mtl.h:290
impeller::PixelFormat::kB10G10R10A10XR
@ kB10G10R10A10XR
impeller::BlendOperation
BlendOperation
Definition: formats.h:170
impeller::CompareFunction::kGreaterEqual
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
impeller::StencilOperation::kDecrementClamp
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
impeller::CompareFunction
CompareFunction
Definition: formats.h:486
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::SafeMTLPixelFormatBGR10_XR_sRGB
MTLPixelFormat SafeMTLPixelFormatBGR10_XR_sRGB()
Definition: formats_mtl.mm:122
impeller::SamplerAddressMode::kMirror
@ kMirror
impeller::LoadAction::kDontCare
@ kDontCare
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::ToMTLSamplerMipFilter
constexpr MTLSamplerMipFilter ToMTLSamplerMipFilter(MipFilter filter)
Definition: formats_mtl.h:345
impeller::ToMTLBlendFactor
constexpr MTLBlendFactor ToMTLBlendFactor(BlendFactor type)
Definition: formats_mtl.h:113
impeller::BlendFactor::kOneMinusSourceColor
@ kOneMinusSourceColor
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::MipFilter::kLinear
@ kLinear
impeller::ToMTLIndexType
constexpr MTLIndexType ToMTLIndexType(IndexType type)
Definition: formats_mtl.h:175
impeller::FromMTLPixelFormat
constexpr PixelFormat FromMTLPixelFormat(MTLPixelFormat format)
Definition: formats_mtl.h:21
impeller::ColorWriteMask::kAlpha
@ kAlpha
color.h
impeller::ColorWriteMask::kBlue
@ kBlue
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::PolygonMode::kLine
@ kLine
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:94
impeller::Color::blue
Scalar blue
Definition: color.h:136
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::ToMTLCullMode
constexpr MTLCullMode ToMTLCullMode(CullMode mode)
Definition: formats_mtl.h:184
impeller
Definition: aiks_context.cc:10
impeller::StencilOperation::kIncrementWrap
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
impeller::BlendOperation::kSubtract
@ kSubtract
impeller::ToMTLTriangleFillMode
constexpr MTLTriangleFillMode ToMTLTriangleFillMode(PolygonMode mode)
Definition: formats_mtl.h:165
impeller::BlendFactor::kOneMinusDestinationAlpha
@ kOneMinusDestinationAlpha
impeller::PixelFormat::kR32G32B32A32Float
@ kR32G32B32A32Float
impeller::SamplerAddressMode::kRepeat
@ kRepeat
impeller::SamplerAddressMode::kDecal
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...