aboutsummaryrefslogtreecommitdiff
path: root/include/platform/autogen/FeaturesMtl_autogen.h
blob: ecbdefa9907067fcc5060cb05277e3620c078846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_features.py using data from mtl_features.json.
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// FeaturesMtl_autogen.h: Optional features for the Metal renderer.

#ifndef ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_
#define ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_

#include "platform/Feature.h"

namespace angle
{

struct FeaturesMtl : FeatureSetBase
{
    FeaturesMtl();
    ~FeaturesMtl();

    FeatureInfo hasBaseVertexInstancedDraw = {
        "hasBaseVertexInstancedDraw",
        FeatureCategory::MetalFeatures,
        "The renderer supports base vertex instanced draw",
        &members,
    };

    FeatureInfo hasExplicitMemBarrier = {
        "hasExplicitMemBarrier",
        FeatureCategory::MetalFeatures,
        "The renderer supports explicit memory barrier",
        &members,
    };

    FeatureInfo hasCheapRenderPass = {
        "hasCheapRenderPass",
        FeatureCategory::MetalFeatures,
        "The renderer can cheaply break a render pass.",
        &members,
    };

    FeatureInfo hasNonUniformDispatch = {
        "hasNonUniformDispatch",
        FeatureCategory::MetalFeatures,
        "The renderer supports non uniform compute shader dispatch's group size",
        &members,
    };

    FeatureInfo hasShaderStencilOutput = {
        "hasShaderStencilOutput",
        FeatureCategory::MetalFeatures,
        "The renderer supports stencil output from fragment shader",
        &members,
    };

    FeatureInfo hasTextureSwizzle = {
        "hasTextureSwizzle",
        FeatureCategory::MetalFeatures,
        "The renderer supports texture swizzle",
        &members,
    };

    FeatureInfo hasDepthAutoResolve = {
        "hasDepthAutoResolve",
        FeatureCategory::MetalFeatures,
        "The renderer supports MSAA depth auto resolve at the end of render pass",
        &members,
    };

    FeatureInfo hasStencilAutoResolve = {
        "hasStencilAutoResolve",
        FeatureCategory::MetalFeatures,
        "The renderer supports MSAA stencil auto resolve at the end of render pass",
        &members,
    };

    FeatureInfo hasEvents = {
        "hasEvents",
        FeatureCategory::MetalFeatures,
        "The renderer supports MTL(Shared)Event",
        &members,
    };

    FeatureInfo allowInlineConstVertexData = {
        "allowInlineConstVertexData",
        FeatureCategory::MetalFeatures,
        "The renderer supports using inline constant data for small client vertex data",
        &members,
    };

    FeatureInfo allowSeparateDepthStencilBuffers = {
        "allowSeparateDepthStencilBuffers",
        FeatureCategory::MetalFeatures,
        "Some Apple platforms such as iOS allows separate depth and stencil buffers, "
        "whereas others such as macOS don't",
        &members,
    };

    FeatureInfo allowRuntimeSamplerCompareMode = {
        "allowRuntimeSamplerCompareMode",
        FeatureCategory::MetalFeatures,
        "The renderer supports changing sampler's compare mode outside shaders",
        &members,
    };

    FeatureInfo allowSamplerCompareGradient = {
        "allowSamplerCompareGradient",
        FeatureCategory::MetalFeatures,
        "The renderer supports sample_compare with gradients",
        &members,
    };

    FeatureInfo allowSamplerCompareLod = {
        "allowSamplerCompareLod",
        FeatureCategory::MetalFeatures,
        "The renderer supports sample_compare with lod",
        &members,
    };

    FeatureInfo allowBufferReadWrite = {
        "allowBufferReadWrite",
        FeatureCategory::MetalFeatures,
        "The renderer supports buffer read and write in the same shader",
        &members,
    };

    FeatureInfo allowMultisampleStoreAndResolve = {
        "allowMultisampleStoreAndResolve",
        FeatureCategory::MetalFeatures,
        "The renderer supports MSAA store and resolve in the same pass",
        &members,
    };

    FeatureInfo allowGenMultipleMipsPerPass = {
        "allowGenMultipleMipsPerPass",
        FeatureCategory::MetalFeatures,
        "The renderer supports generating multiple mipmaps per pass",
        &members,
    };

    FeatureInfo forceD24S8AsUnsupported = {
        "forceD24S8AsUnsupported",
        FeatureCategory::MetalFeatures,
        "Force Depth24Stencil8 format as unsupported.",
        &members,
    };

    FeatureInfo forceBufferGPUStorage = {
        "forceBufferGPUStorage",
        FeatureCategory::MetalFeatures,
        "On systems that support both buffer' memory allocation on GPU and shared memory (such as "
        "macOS), force using GPU memory allocation for buffers everytime or not.",
        &members,
    };

    FeatureInfo forceNonCSBaseMipmapGeneration = {
        "forceNonCSBaseMipmapGeneration",
        FeatureCategory::MetalFeatures,
        "Turn this feature on to disallow Compute Shader based mipmap generation. Compute Shader "
        "based mipmap generation might cause GPU hang on some older iOS devices.",
        &members,
    };

    FeatureInfo emulateTransformFeedback = {
        "emulateTransformFeedback",
        FeatureCategory::MetalFeatures,
        "Turn this on to allow transform feedback in Metal using a 2-pass VS for GLES3.",
        &members,
    };

    FeatureInfo intelExplicitBoolCastWorkaround = {
        "intelExplicitBoolCastWorkaround",
        FeatureCategory::MetalWorkarounds,
        "Insert explicit casts for float/double/unsigned/signed int on macOS 10.15 with Intel "
        "driver",
        &members,
    };

    FeatureInfo intelDisableFastMath = {
        "intelDisableFastMath",
        FeatureCategory::MetalWorkarounds,
        "Disable fast math in atan and invariance cases when running below macOS 12.0",
        &members,
    };

    FeatureInfo allowRenderpassWithoutAttachment = {
        "allowRenderpassWithoutAttachment",
        FeatureCategory::MetalFeatures,
        "Allow creation of render passes without any attachments",
        &members,
    };

    FeatureInfo avoidStencilTextureSwizzle = {
        "avoidStencilTextureSwizzle",
        FeatureCategory::MetalFeatures,
        "Do not create swizzled views of stencil textures",
        &members,
    };

    FeatureInfo emulateAlphaToCoverage = {
        "emulateAlphaToCoverage",
        FeatureCategory::MetalWorkarounds,
        "Some GPUs ignore alpha-to-coverage when [[sample_mask]] is written",
        &members,
    };

    FeatureInfo writeHelperSampleMask = {
        "writeHelperSampleMask",
        FeatureCategory::MetalWorkarounds,
        "Some GPUs produce incorrect derivatives unless [[sample_mask]] is written",
        &members,
    };

    FeatureInfo preTransformTextureCubeGradDerivatives = {
        "preTransformTextureCubeGradDerivatives",
        FeatureCategory::MetalWorkarounds,
        "Apply a vendor-specific transformation to explicit cubemap derivatives",
        &members,
    };

    FeatureInfo multisampleColorFormatShaderReadWorkaround = {
        "multisampleColorFormatShaderReadWorkaround",
        FeatureCategory::MetalWorkarounds,
        "Add shaderRead usage to some multisampled texture formats",
        &members, "http://anglebug.com/7049"
    };

    FeatureInfo copyIOSurfaceToNonIOSurfaceForReadOptimization = {
        "copyIOSurfaceToNonIOSurfaceForReadOptimization",
        FeatureCategory::MetalWorkarounds,
        "some GPUs are faster to read an IOSurface texture by first copying the texture to a "
        "non-IOSurface texture",
        &members, "http://anglebug.com/7117 http://anglebug.com/7573"
    };

    FeatureInfo copyTextureToBufferForReadOptimization = {
        "copyTextureToBufferForReadOptimization",
        FeatureCategory::MetalWorkarounds,
        "some GPUs are faster to read a texture by first copying the texture to a buffer",
        &members, "http://anglebug.com/7117"
    };

    FeatureInfo limitMaxDrawBuffersForTesting = {
        "limitMaxDrawBuffersForTesting",
        FeatureCategory::MetalFeatures,
        "Used to check the backend works when the device's advertized limit is less than the code's limit",
        &members, "http://anglebug.com/7280"
    };

    FeatureInfo limitMaxColorTargetBitsForTesting = {
        "limitMaxColorTargetBitsForTesting",
        FeatureCategory::MetalFeatures,
        "Metal iOS has a limit on the number of color target bits per pixel.",
        &members, "http://anglebug.com/7280"
    };

    FeatureInfo preemptivelyStartProvokingVertexCommandBuffer = {
        "preemptivelyStartProvokingVertexCommandBuffer",
        FeatureCategory::MetalFeatures,
        "AMD Metal Drivers appear to have a bug this works around",
        &members, "http://anglebug.com/7635"
    };

    FeatureInfo uploadDataToIosurfacesWithStagingBuffers = {
        "uploadDataToIosurfacesWithStagingBuffers",
        FeatureCategory::MetalWorkarounds,
        "When uploading data to IOSurface-backed textures, use a staging buffer.",
        &members, "http://anglebug.com/7573"
    };

    FeatureInfo alwaysUseStagedBufferUpdates = {
        "alwaysUseStagedBufferUpdates",
        FeatureCategory::MetalFeatures,
        "Always update buffers by copying the data to a staging buffer and then blitting it to the actual buffer",
        &members, "http://anglebug.com/7544"
    };

    FeatureInfo useShadowBuffersWhenAppropriate = {
        "useShadowBuffersWhenAppropriate",
        FeatureCategory::MetalFeatures,
        "On some architectures using a shadow buffer can be faster for certain size buffers",
        &members, "http://anglebug.com/7544"
    };

    FeatureInfo alwaysUseManagedStorageModeForBuffers = {
        "alwaysUseManagedStorageModeForBuffers",
        FeatureCategory::MetalFeatures,
        "Metal buffers can be managed, shared, or private. Sometimes managed is fastest",
        &members, "http://anglebug.com/7544"
    };

    FeatureInfo alwaysUseSharedStorageModeForBuffers = {
        "alwaysUseSharedStorageModeForBuffers",
        FeatureCategory::MetalFeatures,
        "Metal buffers can be managed, shared, or private. Sometimes shared is fastest",
        &members, "http://anglebug.com/7544"
    };

    FeatureInfo preferCpuForBuffersubdata = {
        "preferCpuForBuffersubdata",
        FeatureCategory::MetalFeatures,
        "Makes bufferSubData always update via CPU",
        &members, "http://anglebug.com/7544"
    };

    FeatureInfo disableProgrammableBlending = {
        "disableProgrammableBlending",
        FeatureCategory::MetalFeatures,
        "Disable programmable blending in order to test read_write pixel local storage textures",
        &members, "http://anglebug.com/7279"
    };

    FeatureInfo disableRWTextureTier2Support = {
        "disableRWTextureTier2Support",
        FeatureCategory::MetalFeatures,
        "Disable tier2 read_write textures in order to test tier1 support",
        &members, "http://anglebug.com/7279"
    };

    FeatureInfo disableRasterOrderGroups = {
        "disableRasterOrderGroups",
        FeatureCategory::MetalFeatures,
        "Disable raster order groups in order to test pixel local storage memory barriers",
        &members, "http://anglebug.com/7279"
    };

    FeatureInfo enableInMemoryMtlLibraryCache = {
        "enableInMemoryMtlLibraryCache",
        FeatureCategory::MetalFeatures,
        "Cache MTLLibrary objects in memory.",
        &members, "http://crbug.com/1385510"
    };

    FeatureInfo enableParallelMtlLibraryCompilation = {
        "enableParallelMtlLibraryCompilation",
        FeatureCategory::MetalFeatures,
        "Compile MTLLibrary in multiple threads.",
        &members, "http://crbug.com/1385510"
    };

    FeatureInfo alwaysPreferStagedTextureUploads = {
        "alwaysPreferStagedTextureUploads",
        FeatureCategory::MetalFeatures,
        "Always prefer to upload texture data via a staging buffer and avoid MTLTexture::replaceRegion.",
        &members, "http://crbug.com/1380790"
    };

    FeatureInfo disableStagedInitializationOfPackedTextureFormats = {
        "disableStagedInitializationOfPackedTextureFormats",
        FeatureCategory::MetalFeatures,
        "Staged GPU upload of some packed texture formats such as RGB9_E5 fail on Intel GPUs.",
        &members, "http://anglebug.com/8092"
    };

    FeatureInfo compileMetalShaders = {
        "compileMetalShaders",
        FeatureCategory::MetalFeatures,
        "Compiles metal shaders using command line tools and saves to BlobCache. "
        "Requires using --no-sandbox and disabling enableParallelMtlLibraryCompilation.",
        &members, "http://crbug.com/1423136"
    };

    FeatureInfo loadMetalShadersFromBlobCache = {
        "loadMetalShadersFromBlobCache",
        FeatureCategory::MetalFeatures,
        "Loads metal shaders from blob cache. Useful if compile_metal_shaders was used to "
        "generate shaders.",
        &members, "http://crbug.com/1423136"
    };

    FeatureInfo printMetalShaders = {
        "printMetalShaders",
        FeatureCategory::MetalFeatures,
        "Prints the source to a shader before it's compiled.",
        &members, "http://crbug.com/1423136"
    };

    FeatureInfo generateShareableShaders = {
        "generateShareableShaders",
        FeatureCategory::MetalFeatures,
        "Attempts to generate shaders that are shareable. More specifically, shaders"
        " end up with conditionals that are decided at run time via input parameters vs"
        " compile time. This results in bigger shaders.",
        &members, "http://crbug.com/1423136"
    };

    FeatureInfo disableMetalOnNvidia = {
        "disableMetalOnNvidia",
        FeatureCategory::MetalFeatures,
        "NVIDIA GPUs are unsupported due to scarcity of the hardware.",
        &members, "http://anglebug.com/8170"
    };

    FeatureInfo flushAfterStreamVertexData = {
        "flushAfterStreamVertexData",
        FeatureCategory::MetalFeatures,
        "Flush after calls to StreamVertexData to work around driver bugs.",
        &members,
    };

    FeatureInfo requireGpuFamily2 = {
        "requireGpuFamily2",
        FeatureCategory::MetalFeatures,
        "Mac GPU Family 2 is required to support all the features of OpenGL ES 2.0",
        &members, "http://anglebug.com/7952"
    };

    FeatureInfo requireMsl21 = {
        "requireMsl21",
        FeatureCategory::MetalFeatures,
        "MSL 2.1 is required to support all the features of OpenGL ES 2.0",
        &members, "http://anglebug.com/8258"
    };

    FeatureInfo rescopeGlobalVariables = {
        "rescopeGlobalVariables",
        FeatureCategory::MetalFeatures,
        "Rescope global variables that are only used in one function to be function-local.",
        &members, "http://anglebug.com/8311"
    };

    FeatureInfo alwaysResolveMultisampleRenderBuffers = {
        "alwaysResolveMultisampleRenderBuffers",
        FeatureCategory::MetalFeatures,
        "Always automatically resolve MSAA render buffers to single sampled texture.",
        &members, "http://crbug.com/1486094"
    };

};

inline FeaturesMtl::FeaturesMtl()  = default;
inline FeaturesMtl::~FeaturesMtl() = default;

}  // namespace angle

#endif  // ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_