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