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