| 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"
14 #include "impeller/base/validation.h"
15 #include "impeller/core/formats.h"
16 #include "impeller/core/texture_descriptor.h"
17 #include "impeller/geometry/color.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:
28 return PixelFormat::kB8G8R8A8UNormInt;
29 case MTLPixelFormatBGRA8Unorm_sRGB:
30 return PixelFormat::kB8G8R8A8UNormIntSRGB;
31 case MTLPixelFormatRGBA8Unorm:
32 return PixelFormat::kR8G8B8A8UNormInt;
33 case MTLPixelFormatRGBA8Unorm_sRGB:
34 return PixelFormat::kR8G8B8A8UNormIntSRGB;
35 case MTLPixelFormatRGBA32Float:
36 return PixelFormat::kR32G32B32A32Float;
37 case MTLPixelFormatRGBA16Float:
38 return PixelFormat::kR16G16B16A16Float;
39 case MTLPixelFormatStencil8:
40 return PixelFormat::kS8UInt;
41 #if !FML_OS_IOS
42 case MTLPixelFormatDepth24Unorm_Stencil8:
43 return PixelFormat::kD24UnormS8Uint;
44 #endif // FML_OS_IOS
45 case MTLPixelFormatDepth32Float_Stencil8:
46 return PixelFormat::kD32FloatS8UInt;
47 case MTLPixelFormatBGR10_XR_sRGB:
48 return PixelFormat::kB10G10R10XRSRGB;
49 case MTLPixelFormatBGR10_XR:
50 return PixelFormat::kB10G10R10XR;
51 case MTLPixelFormatBGRA10_XR:
52 return PixelFormat::kB10G10R10A10XR;
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.
62 MTLPixelFormat SafeMTLPixelFormatDepth24Unorm_Stencil8();
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) {
79 case PixelFormat::kUnknown:
80 return MTLPixelFormatInvalid;
81 case PixelFormat::kA8UNormInt:
82 return MTLPixelFormatA8Unorm;
83 case PixelFormat::kR8UNormInt:
84 return MTLPixelFormatR8Unorm;
85 case PixelFormat::kR8G8UNormInt:
86 return MTLPixelFormatRG8Unorm;
87 case PixelFormat::kB8G8R8A8UNormInt:
88 return MTLPixelFormatBGRA8Unorm;
89 case PixelFormat::kB8G8R8A8UNormIntSRGB:
90 return MTLPixelFormatBGRA8Unorm_sRGB;
91 case PixelFormat::kR8G8B8A8UNormInt:
92 return MTLPixelFormatRGBA8Unorm;
93 case PixelFormat::kR8G8B8A8UNormIntSRGB:
94 return MTLPixelFormatRGBA8Unorm_sRGB;
95 case PixelFormat::kR32G32B32A32Float:
96 return MTLPixelFormatRGBA32Float;
97 case PixelFormat::kR16G16B16A16Float:
98 return MTLPixelFormatRGBA16Float;
99 case PixelFormat::kS8UInt:
100 return MTLPixelFormatStencil8;
101 case PixelFormat::kD24UnormS8Uint:
102 return SafeMTLPixelFormatDepth24Unorm_Stencil8();
103 case PixelFormat::kD32FloatS8UInt:
104 return MTLPixelFormatDepth32Float_Stencil8;
105 case PixelFormat::kB10G10R10XRSRGB:
106 return SafeMTLPixelFormatBGR10_XR_sRGB();
107 case PixelFormat::kB10G10R10XR:
108 return SafeMTLPixelFormatBGR10_XR();
109 case PixelFormat::kB10G10R10A10XR:
110 return SafeMTLPixelFormatBGRA10_XR();
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;
121 case BlendFactor::kSourceColor:
122 return MTLBlendFactorSourceColor;
123 case BlendFactor::kOneMinusSourceColor:
124 return MTLBlendFactorOneMinusSourceColor;
125 case BlendFactor::kSourceAlpha:
126 return MTLBlendFactorSourceAlpha;
127 case BlendFactor::kOneMinusSourceAlpha:
128 return MTLBlendFactorOneMinusSourceAlpha;
129 case BlendFactor::kDestinationColor:
130 return MTLBlendFactorDestinationColor;
131 case BlendFactor::kOneMinusDestinationColor:
132 return MTLBlendFactorOneMinusDestinationColor;
133 case BlendFactor::kDestinationAlpha:
134 return MTLBlendFactorDestinationAlpha;
135 case BlendFactor::kOneMinusDestinationAlpha:
136 return MTLBlendFactorOneMinusDestinationAlpha;
137 case BlendFactor::kSourceAlphaSaturated:
138 return MTLBlendFactorSourceAlphaSaturated;
139 case BlendFactor::kBlendColor:
140 return MTLBlendFactorBlendColor;
141 case BlendFactor::kOneMinusBlendColor:
142 return MTLBlendFactorOneMinusBlendColor;
143 case BlendFactor::kBlendAlpha:
144 return MTLBlendFactorBlendAlpha;
145 case BlendFactor::kOneMinusBlendAlpha:
146 return MTLBlendFactorOneMinusBlendAlpha;
147 }
148 return MTLBlendFactorZero;
149 };
150
151 constexpr MTLPrimitiveType ToMTLPrimitiveType(PrimitiveType type) {
152 switch (type) {
153 case PrimitiveType::kTriangle:
154 return MTLPrimitiveTypeTriangle;
155 case PrimitiveType::kTriangleStrip:
156 return MTLPrimitiveTypeTriangleStrip;
157 case PrimitiveType::kLine:
158 return MTLPrimitiveTypeLine;
159 case PrimitiveType::kLineStrip:
160 return MTLPrimitiveTypeLineStrip;
161 case PrimitiveType::kPoint:
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;
192 case CullMode::kFrontFace:
193 return MTLCullModeFront;
194 }
195 return MTLCullModeNone;
196 }
197
198 constexpr MTLBlendOperation ToMTLBlendOperation(BlendOperation type) {
199 switch (type) {
200 case BlendOperation::kAdd:
201 return MTLBlendOperationAdd;
202 case BlendOperation::kSubtract:
203 return MTLBlendOperationSubtract;
204 case BlendOperation::kReverseSubtract:
205 return MTLBlendOperationReverseSubtract;
206 }
207 return MTLBlendOperationAdd;
208 };
209
210 constexpr MTLColorWriteMask ToMTLColorWriteMask(
211 std::underlying_type_t<ColorWriteMask> type) {
212 using UnderlyingType = decltype(type);
213
214 MTLColorWriteMask mask = MTLColorWriteMaskNone;
215
216 if (type & static_cast<UnderlyingType>(ColorWriteMask::kRed)) {
217 mask |= MTLColorWriteMaskRed;
218 }
219
220 if (type & static_cast<UnderlyingType>(ColorWriteMask::kGreen)) {
221 mask |= MTLColorWriteMaskGreen;
222 }
223
224 if (type & static_cast<UnderlyingType>(ColorWriteMask::kBlue)) {
225 mask |= MTLColorWriteMaskBlue;
226 }
227
228 if (type & static_cast<UnderlyingType>(ColorWriteMask::kAlpha)) {
229 mask |= MTLColorWriteMaskAlpha;
230 }
231
232 return mask;
233 };
234
235 constexpr MTLCompareFunction ToMTLCompareFunction(CompareFunction func) {
236 switch (func) {
237 case CompareFunction::kNever:
238 return MTLCompareFunctionNever;
239 case CompareFunction::kLess:
240 return MTLCompareFunctionLess;
241 case CompareFunction::kEqual:
242 return MTLCompareFunctionEqual;
243 case CompareFunction::kLessEqual:
244 return MTLCompareFunctionLessEqual;
245 case CompareFunction::kGreater:
246 return MTLCompareFunctionGreater;
247 case CompareFunction::kNotEqual:
248 return MTLCompareFunctionNotEqual;
249 case CompareFunction::kGreaterEqual:
250 return MTLCompareFunctionGreaterEqual;
251 case CompareFunction::kAlways:
252 return MTLCompareFunctionAlways;
253 }
254 return MTLCompareFunctionAlways;
255 };
256
257 constexpr MTLStencilOperation ToMTLStencilOperation(StencilOperation op) {
258 switch (op) {
259 case StencilOperation::kKeep:
260 return MTLStencilOperationKeep;
261 case StencilOperation::kZero:
262 return MTLStencilOperationZero;
263 case StencilOperation::kSetToReferenceValue:
264 return MTLStencilOperationReplace;
265 case StencilOperation::kIncrementClamp:
266 return MTLStencilOperationIncrementClamp;
267 case StencilOperation::kDecrementClamp:
268 return MTLStencilOperationDecrementClamp;
269 case StencilOperation::kInvert:
270 return MTLStencilOperationInvert;
271 case StencilOperation::kIncrementWrap:
272 return MTLStencilOperationIncrementWrap;
273 case StencilOperation::kDecrementWrap:
274 return MTLStencilOperationDecrementWrap;
275 }
276 return MTLStencilOperationKeep;
277 };
278
279 constexpr MTLLoadAction ToMTLLoadAction(LoadAction action) {
280 switch (action) {
281 case LoadAction::kDontCare:
282 return MTLLoadActionDontCare;
283 case LoadAction::kLoad:
284 return MTLLoadActionLoad;
285 case LoadAction::kClear:
286 return MTLLoadActionClear;
287 }
288
289 return MTLLoadActionDontCare;
290 }
291
292 constexpr LoadAction FromMTLLoadAction(MTLLoadAction action) {
293 switch (action) {
294 case MTLLoadActionDontCare:
295 return LoadAction::kDontCare;
296 case MTLLoadActionLoad:
297 return LoadAction::kLoad;
298 case MTLLoadActionClear:
299 return LoadAction::kClear;
300 default:
301 break;
302 }
303
304 return LoadAction::kDontCare;
305 }
306
307 constexpr MTLStoreAction ToMTLStoreAction(StoreAction action) {
308 switch (action) {
309 case StoreAction::kDontCare:
310 return MTLStoreActionDontCare;
311 case StoreAction::kStore:
312 return MTLStoreActionStore;
313 case StoreAction::kMultisampleResolve:
314 return MTLStoreActionMultisampleResolve;
315 case StoreAction::kStoreAndMultisampleResolve:
316 return MTLStoreActionStoreAndMultisampleResolve;
317 }
318 return MTLStoreActionDontCare;
319 }
320
321 constexpr StoreAction FromMTLStoreAction(MTLStoreAction action) {
322 switch (action) {
323 case MTLStoreActionDontCare:
324 return StoreAction::kDontCare;
325 case MTLStoreActionStore:
326 return StoreAction::kStore;
327 case MTLStoreActionMultisampleResolve:
328 return StoreAction::kMultisampleResolve;
329 case MTLStoreActionStoreAndMultisampleResolve:
330 return StoreAction::kStoreAndMultisampleResolve;
331 default:
332 break;
333 }
334 return StoreAction::kDontCare;
335 }
336
337 constexpr MTLSamplerMinMagFilter ToMTLSamplerMinMagFilter(MinMagFilter filter) {
338 switch (filter) {
339 case MinMagFilter::kNearest:
340 return MTLSamplerMinMagFilterNearest;
341 case MinMagFilter::kLinear:
342 return MTLSamplerMinMagFilterLinear;
343 }
344 return MTLSamplerMinMagFilterNearest;
345 }
346
347 constexpr MTLSamplerMipFilter ToMTLSamplerMipFilter(MipFilter filter) {
348 switch (filter) {
349 case MipFilter::kNearest:
350 return MTLSamplerMipFilterNearest;
351 case MipFilter::kLinear:
352 return MTLSamplerMipFilterLinear;
353 }
354 return MTLSamplerMipFilterNotMipmapped;
355 }
356
357 constexpr MTLSamplerAddressMode ToMTLSamplerAddressMode(
358 SamplerAddressMode mode) {
359 switch (mode) {
360 case SamplerAddressMode::kClampToEdge:
361 return MTLSamplerAddressModeClampToEdge;
362 case SamplerAddressMode::kRepeat:
363 return MTLSamplerAddressModeRepeat;
364 case SamplerAddressMode::kMirror:
365 return MTLSamplerAddressModeMirrorRepeat;
366 case SamplerAddressMode::kDecal:
367 return MTLSamplerAddressModeClampToZero;
368 }
369 return MTLSamplerAddressModeClampToEdge;
370 }
371
372 inline MTLClearColor ToMTLClearColor(const Color& color) {
373 return MTLClearColorMake(color.red, color.green, color.blue, color.alpha);
374 }
375
376 constexpr MTLTextureType ToMTLTextureType(TextureType type) {
377 switch (type) {
378 case TextureType::kTexture2D:
379 return MTLTextureType2D;
380 case TextureType::kTexture2DMultisample:
381 return MTLTextureType2DMultisample;
382 case TextureType::kTextureCube:
383 return MTLTextureTypeCube;
384 case TextureType::kTextureExternalOES:
385 VALIDATION_LOG
386 << "kTextureExternalOES can not be used with the Metal backend.";
387 }
388 return MTLTextureType2D;
389 }
390
391 MTLRenderPipelineColorAttachmentDescriptor*
392 ToMTLRenderPipelineColorAttachmentDescriptor(
393 ColorAttachmentDescriptor descriptor);
394
395 MTLDepthStencilDescriptor* ToMTLDepthStencilDescriptor(
396 std::optional<DepthAttachmentDescriptor> depth,
397 std::optional<StencilAttachmentDescriptor> front,
398 std::optional<StencilAttachmentDescriptor> back);
399
400 MTLTextureDescriptor* ToMTLTextureDescriptor(const TextureDescriptor& desc);
401
402 } // namespace impeller
403
404 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_FORMATS_MTL_H_
impeller::StoreAction::kMultisampleResolve
@ kMultisampleResolve
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::TextureType::kTextureExternalOES
@ kTextureExternalOES
impeller::CompareFunction::kGreater
@ kGreater
Comparison test passes if new_value > current_value.
impeller::PrimitiveType::kLineStrip
@ kLineStrip
impeller::LoadAction::kLoad
@ kLoad
impeller::ToMTLColorWriteMask
constexpr MTLColorWriteMask ToMTLColorWriteMask(std::underlying_type_t< ColorWriteMask > type)
Definition: formats_mtl.h:210
impeller::StoreAction
StoreAction
Definition: formats.h:203
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:381
impeller::ToMTLSamplerAddressMode
constexpr MTLSamplerAddressMode ToMTLSamplerAddressMode(SamplerAddressMode mode)
Definition: formats_mtl.h:357
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:173
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::Color
Definition: color.h:124
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::SamplerAddressMode
SamplerAddressMode
Definition: formats.h:420
impeller::CompareFunction::kGreaterEqual
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
impeller::ToMTLStencilOperation
constexpr MTLStencilOperation ToMTLStencilOperation(StencilOperation op)
Definition: formats_mtl.h:257
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::TextureType
TextureType
Definition: formats.h:257
impeller::ColorWriteMask::kGreen
@ kGreen
texture_descriptor.h
formats.h
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::ColorWriteMask::kRed
@ kRed
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:307
impeller::ToMTLCompareFunction
constexpr MTLCompareFunction ToMTLCompareFunction(CompareFunction func)
Definition: formats_mtl.h:235
validation.h
impeller::Color::green
Scalar green
Definition: color.h:133
impeller::ToMTLClearColor
MTLClearColor ToMTLClearColor(const Color &color)
Definition: formats_mtl.h:372
impeller::StencilOperation
StencilOperation
Definition: formats.h:548
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:94
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::PrimitiveType::kTriangle
@ kTriangle
impeller::BlendFactor::kZero
@ kZero
impeller::TextureType::kTexture2DMultisample
@ kTexture2DMultisample
impeller::CullMode
CullMode
Definition: formats.h:335
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:529
impeller::BlendFactor::kOneMinusDestinationColor
@ kOneMinusDestinationColor
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::PrimitiveType
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition: formats.h:350
impeller::CullMode::kBackFace
@ kBackFace
impeller::FromMTLStoreAction
constexpr StoreAction FromMTLStoreAction(MTLStoreAction action)
Definition: formats_mtl.h:321
impeller::ToMTLLoadAction
constexpr MTLLoadAction ToMTLLoadAction(LoadAction action)
Definition: formats_mtl.h:279
impeller::CullMode::kNone
@ kNone
impeller::ToMTLBlendOperation
constexpr MTLBlendOperation ToMTLBlendOperation(BlendOperation type)
Definition: formats_mtl.h:198
impeller::MipFilter
MipFilter
Definition: formats.h:412
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:197
impeller::PrimitiveType::kPoint
@ kPoint
Draws a point at each input vertex.
impeller::ToMTLSamplerMinMagFilter
constexpr MTLSamplerMinMagFilter ToMTLSamplerMinMagFilter(MinMagFilter filter)
Definition: formats_mtl.h:337
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:341
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:404
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:376
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:67
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::FromMTLLoadAction
constexpr LoadAction FromMTLLoadAction(MTLLoadAction action)
Definition: formats_mtl.h:292
impeller::BlendOperation
BlendOperation
Definition: formats.h:191
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:347
impeller::ToMTLBlendFactor
constexpr MTLBlendFactor ToMTLBlendFactor(BlendFactor type)
Definition: formats_mtl.h:115
impeller::BlendFactor::kOneMinusSourceColor
@ kOneMinusSourceColor
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::ColorWriteMask::kAlpha
@ kAlpha
color.h
impeller::ColorWriteMask::kBlue
@ kBlue
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_context.cc:10
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...