• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_features.py using data from mtl_features.json.
3 //
4 // Copyright 2022 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // FeaturesMtl_autogen.h: Optional features for the Metal renderer.
9 
10 #ifndef ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_
11 #define ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_
12 
13 #include "platform/Feature.h"
14 
15 namespace angle
16 {
17 
18 struct FeaturesMtl : FeatureSetBase
19 {
20     FeaturesMtl();
21     ~FeaturesMtl();
22 
23     FeatureInfo hasBaseVertexInstancedDraw = {
24         "hasBaseVertexInstancedDraw",
25         FeatureCategory::MetalFeatures,
26         "The renderer supports base vertex instanced draw",
27         &members,
28     };
29 
30     FeatureInfo hasExplicitMemBarrier = {
31         "hasExplicitMemBarrier",
32         FeatureCategory::MetalFeatures,
33         "The renderer supports explicit memory barrier",
34         &members,
35     };
36 
37     FeatureInfo hasCheapRenderPass = {
38         "hasCheapRenderPass",
39         FeatureCategory::MetalFeatures,
40         "The renderer can cheaply break a render pass.",
41         &members,
42     };
43 
44     FeatureInfo hasNonUniformDispatch = {
45         "hasNonUniformDispatch",
46         FeatureCategory::MetalFeatures,
47         "The renderer supports non uniform compute shader dispatch's group size",
48         &members,
49     };
50 
51     FeatureInfo hasShaderStencilOutput = {
52         "hasShaderStencilOutput",
53         FeatureCategory::MetalFeatures,
54         "The renderer supports stencil output from fragment shader",
55         &members,
56     };
57 
58     FeatureInfo hasTextureSwizzle = {
59         "hasTextureSwizzle",
60         FeatureCategory::MetalFeatures,
61         "The renderer supports texture swizzle",
62         &members,
63     };
64 
65     FeatureInfo hasDepthAutoResolve = {
66         "hasDepthAutoResolve",
67         FeatureCategory::MetalFeatures,
68         "The renderer supports MSAA depth auto resolve at the end of render pass",
69         &members,
70     };
71 
72     FeatureInfo hasStencilAutoResolve = {
73         "hasStencilAutoResolve",
74         FeatureCategory::MetalFeatures,
75         "The renderer supports MSAA stencil auto resolve at the end of render pass",
76         &members,
77     };
78 
79     FeatureInfo hasEvents = {
80         "hasEvents",
81         FeatureCategory::MetalFeatures,
82         "The renderer supports MTL(Shared)Event",
83         &members,
84     };
85 
86     FeatureInfo allowInlineConstVertexData = {
87         "allowInlineConstVertexData",
88         FeatureCategory::MetalFeatures,
89         "The renderer supports using inline constant data for small client vertex data",
90         &members,
91     };
92 
93     FeatureInfo allowSeparateDepthStencilBuffers = {
94         "allowSeparateDepthStencilBuffers",
95         FeatureCategory::MetalFeatures,
96         "Some Apple platforms such as iOS allows separate depth and stencil buffers, "
97         "whereas others such as macOS don't",
98         &members,
99     };
100 
101     FeatureInfo allowRuntimeSamplerCompareMode = {
102         "allowRuntimeSamplerCompareMode",
103         FeatureCategory::MetalFeatures,
104         "The renderer supports changing sampler's compare mode outside shaders",
105         &members,
106     };
107 
108     FeatureInfo allowSamplerCompareGradient = {
109         "allowSamplerCompareGradient",
110         FeatureCategory::MetalFeatures,
111         "The renderer supports sample_compare with gradients",
112         &members,
113     };
114 
115     FeatureInfo allowSamplerCompareLod = {
116         "allowSamplerCompareLod",
117         FeatureCategory::MetalFeatures,
118         "The renderer supports sample_compare with lod",
119         &members,
120     };
121 
122     FeatureInfo allowBufferReadWrite = {
123         "allowBufferReadWrite",
124         FeatureCategory::MetalFeatures,
125         "The renderer supports buffer read and write in the same shader",
126         &members,
127     };
128 
129     FeatureInfo allowMultisampleStoreAndResolve = {
130         "allowMultisampleStoreAndResolve",
131         FeatureCategory::MetalFeatures,
132         "The renderer supports MSAA store and resolve in the same pass",
133         &members,
134     };
135 
136     FeatureInfo allowGenMultipleMipsPerPass = {
137         "allowGenMultipleMipsPerPass",
138         FeatureCategory::MetalFeatures,
139         "The renderer supports generating multiple mipmaps per pass",
140         &members,
141     };
142 
143     FeatureInfo forceD24S8AsUnsupported = {
144         "forceD24S8AsUnsupported",
145         FeatureCategory::MetalFeatures,
146         "Force Depth24Stencil8 format as unsupported.",
147         &members,
148     };
149 
150     FeatureInfo forceBufferGPUStorage = {
151         "forceBufferGPUStorage",
152         FeatureCategory::MetalFeatures,
153         "On systems that support both buffer' memory allocation on GPU and shared memory (such as "
154         "macOS), force using GPU memory allocation for buffers everytime or not.",
155         &members,
156     };
157 
158     FeatureInfo forceNonCSBaseMipmapGeneration = {
159         "forceNonCSBaseMipmapGeneration",
160         FeatureCategory::MetalFeatures,
161         "Turn this feature on to disallow Compute Shader based mipmap generation. Compute Shader "
162         "based mipmap generation might cause GPU hang on some older iOS devices.",
163         &members,
164     };
165 
166     FeatureInfo emulateTransformFeedback = {
167         "emulateTransformFeedback",
168         FeatureCategory::MetalFeatures,
169         "Turn this on to allow transform feedback in Metal using a 2-pass VS for GLES3.",
170         &members,
171     };
172 
173     FeatureInfo intelExplicitBoolCastWorkaround = {
174         "intelExplicitBoolCastWorkaround",
175         FeatureCategory::MetalWorkarounds,
176         "Insert explicit casts for float/double/unsigned/signed int on macOS 10.15 with Intel "
177         "driver",
178         &members,
179     };
180 
181     FeatureInfo intelDisableFastMath = {
182         "intelDisableFastMath",
183         FeatureCategory::MetalWorkarounds,
184         "Disable fast math in atan and invariance cases when running below macOS 12.0",
185         &members,
186     };
187 
188     FeatureInfo allowRenderpassWithoutAttachment = {
189         "allowRenderpassWithoutAttachment",
190         FeatureCategory::MetalFeatures,
191         "Allow creation of render passes without any attachments",
192         &members,
193     };
194 
195     FeatureInfo avoidStencilTextureSwizzle = {
196         "avoidStencilTextureSwizzle",
197         FeatureCategory::MetalFeatures,
198         "Do not create swizzled views of stencil textures",
199         &members,
200     };
201 
202     FeatureInfo emulateAlphaToCoverage = {
203         "emulateAlphaToCoverage",
204         FeatureCategory::MetalWorkarounds,
205         "Some GPUs ignore alpha-to-coverage when [[sample_mask]] is written",
206         &members,
207     };
208 
209     FeatureInfo writeHelperSampleMask = {
210         "writeHelperSampleMask",
211         FeatureCategory::MetalWorkarounds,
212         "Some GPUs produce incorrect derivatives unless [[sample_mask]] is written",
213         &members,
214     };
215 
216     FeatureInfo preTransformTextureCubeGradDerivatives = {
217         "preTransformTextureCubeGradDerivatives",
218         FeatureCategory::MetalWorkarounds,
219         "Apply a vendor-specific transformation to explicit cubemap derivatives",
220         &members,
221     };
222 
223     FeatureInfo multisampleColorFormatShaderReadWorkaround = {
224         "multisampleColorFormatShaderReadWorkaround",
225         FeatureCategory::MetalWorkarounds,
226         "Add shaderRead usage to some multisampled texture formats",
227         &members, "http://anglebug.com/7049"
228     };
229 
230     FeatureInfo copyIOSurfaceToNonIOSurfaceForReadOptimization = {
231         "copyIOSurfaceToNonIOSurfaceForReadOptimization",
232         FeatureCategory::MetalWorkarounds,
233         "some GPUs are faster to read an IOSurface texture by first copying the texture to a "
234         "non-IOSurface texture",
235         &members, "http://anglebug.com/7117 http://anglebug.com/7573"
236     };
237 
238     FeatureInfo copyTextureToBufferForReadOptimization = {
239         "copyTextureToBufferForReadOptimization",
240         FeatureCategory::MetalWorkarounds,
241         "some GPUs are faster to read a texture by first copying the texture to a buffer",
242         &members, "http://anglebug.com/7117"
243     };
244 
245     FeatureInfo limitMaxDrawBuffersForTesting = {
246         "limitMaxDrawBuffersForTesting",
247         FeatureCategory::MetalFeatures,
248         "Used to check the backend works when the device's advertized limit is less than the code's limit",
249         &members, "http://anglebug.com/7280"
250     };
251 
252     FeatureInfo limitMaxColorTargetBitsForTesting = {
253         "limitMaxColorTargetBitsForTesting",
254         FeatureCategory::MetalFeatures,
255         "Metal iOS has a limit on the number of color target bits per pixel.",
256         &members, "http://anglebug.com/7280"
257     };
258 
259     FeatureInfo preemptivelyStartProvokingVertexCommandBuffer = {
260         "preemptivelyStartProvokingVertexCommandBuffer",
261         FeatureCategory::MetalFeatures,
262         "AMD Metal Drivers appear to have a bug this works around",
263         &members, "http://anglebug.com/7635"
264     };
265 
266     FeatureInfo uploadDataToIosurfacesWithStagingBuffers = {
267         "uploadDataToIosurfacesWithStagingBuffers",
268         FeatureCategory::MetalWorkarounds,
269         "When uploading data to IOSurface-backed textures, use a staging buffer.",
270         &members, "http://anglebug.com/7573"
271     };
272 
273     FeatureInfo alwaysUseStagedBufferUpdates = {
274         "alwaysUseStagedBufferUpdates",
275         FeatureCategory::MetalFeatures,
276         "Always update buffers by copying the data to a staging buffer and then blitting it to the actual buffer",
277         &members, "http://anglebug.com/7544"
278     };
279 
280     FeatureInfo useShadowBuffersWhenAppropriate = {
281         "useShadowBuffersWhenAppropriate",
282         FeatureCategory::MetalFeatures,
283         "On some architectures using a shadow buffer can be faster for certain size buffers",
284         &members, "http://anglebug.com/7544"
285     };
286 
287     FeatureInfo alwaysUseManagedStorageModeForBuffers = {
288         "alwaysUseManagedStorageModeForBuffers",
289         FeatureCategory::MetalFeatures,
290         "Metal buffers can be managed, shared, or private. Sometimes managed is fastest",
291         &members, "http://anglebug.com/7544"
292     };
293 
294     FeatureInfo alwaysUseSharedStorageModeForBuffers = {
295         "alwaysUseSharedStorageModeForBuffers",
296         FeatureCategory::MetalFeatures,
297         "Metal buffers can be managed, shared, or private. Sometimes shared is fastest",
298         &members, "http://anglebug.com/7544"
299     };
300 
301     FeatureInfo preferCpuForBuffersubdata = {
302         "preferCpuForBuffersubdata",
303         FeatureCategory::MetalFeatures,
304         "Makes bufferSubData always update via CPU",
305         &members, "http://anglebug.com/7544"
306     };
307 
308     FeatureInfo disableProgrammableBlending = {
309         "disableProgrammableBlending",
310         FeatureCategory::MetalFeatures,
311         "Disable programmable blending in order to test read_write pixel local storage textures",
312         &members, "http://anglebug.com/7279"
313     };
314 
315     FeatureInfo disableRWTextureTier2Support = {
316         "disableRWTextureTier2Support",
317         FeatureCategory::MetalFeatures,
318         "Disable tier2 read_write textures in order to test tier1 support",
319         &members, "http://anglebug.com/7279"
320     };
321 
322     FeatureInfo disableRasterOrderGroups = {
323         "disableRasterOrderGroups",
324         FeatureCategory::MetalFeatures,
325         "Disable raster order groups in order to test pixel local storage memory barriers",
326         &members, "http://anglebug.com/7279"
327     };
328 
329     FeatureInfo enableInMemoryMtlLibraryCache = {
330         "enableInMemoryMtlLibraryCache",
331         FeatureCategory::MetalFeatures,
332         "Cache MTLLibrary objects in memory.",
333         &members, "http://crbug.com/1385510"
334     };
335 
336     FeatureInfo enableParallelMtlLibraryCompilation = {
337         "enableParallelMtlLibraryCompilation",
338         FeatureCategory::MetalFeatures,
339         "Compile MTLLibrary in multiple threads.",
340         &members, "http://crbug.com/1385510"
341     };
342 
343     FeatureInfo alwaysPreferStagedTextureUploads = {
344         "alwaysPreferStagedTextureUploads",
345         FeatureCategory::MetalFeatures,
346         "Always prefer to upload texture data via a staging buffer and avoid MTLTexture::replaceRegion.",
347         &members, "http://crbug.com/1380790"
348     };
349 
350     FeatureInfo disableStagedInitializationOfPackedTextureFormats = {
351         "disableStagedInitializationOfPackedTextureFormats",
352         FeatureCategory::MetalFeatures,
353         "Staged GPU upload of some packed texture formats such as RGB9_E5 fail on Intel GPUs.",
354         &members, "http://anglebug.com/8092"
355     };
356 
357     FeatureInfo compileMetalShaders = {
358         "compileMetalShaders",
359         FeatureCategory::MetalFeatures,
360         "Compiles metal shaders using command line tools and saves to BlobCache. "
361         "Requires using --no-sandbox and disabling enableParallelMtlLibraryCompilation.",
362         &members, "http://crbug.com/1423136"
363     };
364 
365     FeatureInfo loadMetalShadersFromBlobCache = {
366         "loadMetalShadersFromBlobCache",
367         FeatureCategory::MetalFeatures,
368         "Loads metal shaders from blob cache. Useful if compile_metal_shaders was used to "
369         "generate shaders.",
370         &members, "http://crbug.com/1423136"
371     };
372 
373     FeatureInfo printMetalShaders = {
374         "printMetalShaders",
375         FeatureCategory::MetalFeatures,
376         "Prints the source to a shader before it's compiled.",
377         &members, "http://crbug.com/1423136"
378     };
379 
380     FeatureInfo generateShareableShaders = {
381         "generateShareableShaders",
382         FeatureCategory::MetalFeatures,
383         "Attempts to generate shaders that are shareable. More specifically, shaders"
384         " end up with conditionals that are decided at run time via input parameters vs"
385         " compile time. This results in bigger shaders.",
386         &members, "http://crbug.com/1423136"
387     };
388 
389     FeatureInfo disableMetalOnNvidia = {
390         "disableMetalOnNvidia",
391         FeatureCategory::MetalFeatures,
392         "NVIDIA GPUs are unsupported due to scarcity of the hardware.",
393         &members, "http://anglebug.com/8170"
394     };
395 
396     FeatureInfo flushAfterStreamVertexData = {
397         "flushAfterStreamVertexData",
398         FeatureCategory::MetalFeatures,
399         "Flush after calls to StreamVertexData to work around driver bugs.",
400         &members,
401     };
402 
403     FeatureInfo requireGpuFamily2 = {
404         "requireGpuFamily2",
405         FeatureCategory::MetalFeatures,
406         "Mac GPU Family 2 is required to support all the features of OpenGL ES 2.0",
407         &members, "http://anglebug.com/7952"
408     };
409 
410     FeatureInfo requireMsl21 = {
411         "requireMsl21",
412         FeatureCategory::MetalFeatures,
413         "MSL 2.1 is required to support all the features of OpenGL ES 2.0",
414         &members, "http://anglebug.com/8258"
415     };
416 
417     FeatureInfo rescopeGlobalVariables = {
418         "rescopeGlobalVariables",
419         FeatureCategory::MetalFeatures,
420         "Rescope global variables that are only used in one function to be function-local.",
421         &members, "http://anglebug.com/8311"
422     };
423 
424     FeatureInfo alwaysResolveMultisampleRenderBuffers = {
425         "alwaysResolveMultisampleRenderBuffers",
426         FeatureCategory::MetalFeatures,
427         "Always automatically resolve MSAA render buffers to single sampled texture.",
428         &members, "http://crbug.com/1486094"
429     };
430 
431     FeatureInfo injectAsmStatementIntoLoopBodies = {
432         "injectAsmStatementIntoLoopBodies",
433         FeatureCategory::MetalFeatures,
434         "Inject asm("") statements into loop bodies to force all loops to be treated as "
435         "having side effects and not optimized out.",
436         &members, "http://crbug.com/1513738"
437     };
438 
439 };
440 
441 inline FeaturesMtl::FeaturesMtl()  = default;
442 inline FeaturesMtl::~FeaturesMtl() = default;
443 
444 }  // namespace angle
445 
446 #endif  // ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_
447