• 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 multisampleColorFormatShaderReadWorkaround = {
210         "multisampleColorFormatShaderReadWorkaround",
211         FeatureCategory::MetalWorkarounds,
212         "Add shaderRead usage to some multisampled texture formats",
213         &members, "http://anglebug.com/7049"
214     };
215 
216     FeatureInfo copyIOSurfaceToNonIOSurfaceForReadOptimization = {
217         "copyIOSurfaceToNonIOSurfaceForReadOptimization",
218         FeatureCategory::MetalWorkarounds,
219         "some GPUs are faster to read an IOSurface texture by first copying the texture to a "
220         "non-IOSurface texture",
221         &members, "http://anglebug.com/7117 http://anglebug.com/7573"
222     };
223 
224     FeatureInfo copyTextureToBufferForReadOptimization = {
225         "copyTextureToBufferForReadOptimization",
226         FeatureCategory::MetalWorkarounds,
227         "some GPUs are faster to read a texture by first copying the texture to a buffer",
228         &members, "http://anglebug.com/7117"
229     };
230 
231     FeatureInfo limitMaxDrawBuffersForTesting = {
232         "limitMaxDrawBuffersForTesting",
233         FeatureCategory::MetalFeatures,
234         "Used to check the backend works when the device's advertized limit is less than the code's limit",
235         &members, "http://anglebug.com/7280"
236     };
237 
238     FeatureInfo limitMaxColorTargetBitsForTesting = {
239         "limitMaxColorTargetBitsForTesting",
240         FeatureCategory::MetalFeatures,
241         "Metal iOS has a limit on the number of color target bits per pixel.",
242         &members, "http://anglebug.com/7280"
243     };
244 
245     FeatureInfo preemptivelyStartProvokingVertexCommandBuffer = {
246         "preemptivelyStartProvokingVertexCommandBuffer",
247         FeatureCategory::MetalFeatures,
248         "AMD Metal Drivers appear to have a bug this works around",
249         &members, "http://anglebug.com/7635"
250     };
251 
252     FeatureInfo uploadDataToIosurfacesWithStagingBuffers = {
253         "uploadDataToIosurfacesWithStagingBuffers",
254         FeatureCategory::MetalWorkarounds,
255         "When uploading data to IOSurface-backed textures, use a staging buffer.",
256         &members, "http://anglebug.com/7573"
257     };
258 
259     FeatureInfo alwaysUseStagedBufferUpdates = {
260         "alwaysUseStagedBufferUpdates",
261         FeatureCategory::MetalFeatures,
262         "Always update buffers by copying the data to a staging buffer and then blitting it to the actual buffer",
263         &members, "http://anglebug.com/7544"
264     };
265 
266     FeatureInfo useShadowBuffersWhenAppropriate = {
267         "useShadowBuffersWhenAppropriate",
268         FeatureCategory::MetalFeatures,
269         "On some architectures using a shadow buffer can be faster for certain size buffers",
270         &members, "http://anglebug.com/7544"
271     };
272 
273     FeatureInfo alwaysUseManagedStorageModeForBuffers = {
274         "alwaysUseManagedStorageModeForBuffers",
275         FeatureCategory::MetalFeatures,
276         "Metal buffers can be managed, shared, or private. Sometimes managed is fastest",
277         &members, "http://anglebug.com/7544"
278     };
279 
280     FeatureInfo alwaysUseSharedStorageModeForBuffers = {
281         "alwaysUseSharedStorageModeForBuffers",
282         FeatureCategory::MetalFeatures,
283         "Metal buffers can be managed, shared, or private. Sometimes shared is fastest",
284         &members, "http://anglebug.com/7544"
285     };
286 
287     FeatureInfo preferCpuForBuffersubdata = {
288         "preferCpuForBuffersubdata",
289         FeatureCategory::MetalFeatures,
290         "Makes bufferSubData always update via CPU",
291         &members, "http://anglebug.com/7544"
292     };
293 
294     FeatureInfo disableProgrammableBlending = {
295         "disableProgrammableBlending",
296         FeatureCategory::MetalFeatures,
297         "Disable programmable blending in order to test read_write pixel local storage textures",
298         &members, "http://anglebug.com/7279"
299     };
300 
301     FeatureInfo disableRWTextureTier2Support = {
302         "disableRWTextureTier2Support",
303         FeatureCategory::MetalFeatures,
304         "Disable tier2 read_write textures in order to test tier1 support",
305         &members, "http://anglebug.com/7279"
306     };
307 
308     FeatureInfo disableRasterOrderGroups = {
309         "disableRasterOrderGroups",
310         FeatureCategory::MetalFeatures,
311         "Disable raster order groups in order to test pixel local storage memory barriers",
312         &members, "http://anglebug.com/7279"
313     };
314 
315     FeatureInfo enableInMemoryMtlLibraryCache = {
316         "enableInMemoryMtlLibraryCache",
317         FeatureCategory::MetalFeatures,
318         "Cache MTLLibrary objects in memory.",
319         &members, "http://crbug.com/1385510"
320     };
321 
322     FeatureInfo enableParallelMtlLibraryCompilation = {
323         "enableParallelMtlLibraryCompilation",
324         FeatureCategory::MetalFeatures,
325         "Compile MTLLibrary in multiple threads.",
326         &members, "http://crbug.com/1385510"
327     };
328 
329     FeatureInfo alwaysPreferStagedTextureUploads = {
330         "alwaysPreferStagedTextureUploads",
331         FeatureCategory::MetalFeatures,
332         "Always prefer to upload texture data via a staging buffer and avoid MTLTexture::replaceRegion.",
333         &members, "http://crbug.com/1380790"
334     };
335 
336     FeatureInfo disableStagedInitializationOfPackedTextureFormats = {
337         "disableStagedInitializationOfPackedTextureFormats",
338         FeatureCategory::MetalFeatures,
339         "Staged GPU upload of some packed texture formats such as RGB9_E5 fail on Intel GPUs.",
340         &members, "http://anglebug.com/8092"
341     };
342 
343     FeatureInfo compileMetalShaders = {
344         "compileMetalShaders",
345         FeatureCategory::MetalFeatures,
346         "Compiles metal shaders using command line tools and saves to BlobCache. "
347         "Requires using --no-sandbox and disabling enableParallelMtlLibraryCompilation.",
348         &members, "http://crbug.com/1423136"
349     };
350 
351     FeatureInfo loadMetalShadersFromBlobCache = {
352         "loadMetalShadersFromBlobCache",
353         FeatureCategory::MetalFeatures,
354         "Loads metal shaders from blob cache. Useful if compile_metal_shaders was used to "
355         "generate shaders.",
356         &members, "http://crbug.com/1423136"
357     };
358 
359     FeatureInfo printMetalShaders = {
360         "printMetalShaders",
361         FeatureCategory::MetalFeatures,
362         "Prints the source to a shader before it's compiled.",
363         &members, "http://crbug.com/1423136"
364     };
365 
366     FeatureInfo generateShareableShaders = {
367         "generateShareableShaders",
368         FeatureCategory::MetalFeatures,
369         "Attempts to generate shaders that are shareable. More specifically, shaders"
370         " end up with conditionals that are decided at run time via input parameters vs"
371         " compile time. This results in bigger shaders.",
372         &members, "http://crbug.com/1423136"
373     };
374 
375     FeatureInfo disableMetalOnNvidia = {
376         "disableMetalOnNvidia",
377         FeatureCategory::MetalFeatures,
378         "NVIDIA GPUs are unsupported due to scarcity of the hardware.",
379         &members, "http://anglebug.com/8170"
380     };
381 
382     FeatureInfo flushAfterStreamVertexData = {
383         "flushAfterStreamVertexData",
384         FeatureCategory::MetalFeatures,
385         "Flush after calls to StreamVertexData to work around driver bugs.",
386         &members,
387     };
388 
389     FeatureInfo requireGpuFamily2 = {
390         "requireGpuFamily2",
391         FeatureCategory::MetalFeatures,
392         "Mac GPU Family 2 is required to support all the features of OpenGL ES 2.0",
393         &members, "http://anglebug.com/7952"
394     };
395 
396     FeatureInfo requireMsl21 = {
397         "requireMsl21",
398         FeatureCategory::MetalFeatures,
399         "MSL 2.1 is required to support all the features of OpenGL ES 2.0",
400         &members, "http://anglebug.com/8258"
401     };
402 
403 };
404 
405 inline FeaturesMtl::FeaturesMtl()  = default;
406 inline FeaturesMtl::~FeaturesMtl() = default;
407 
408 }  // namespace angle
409 
410 #endif  // ANGLE_PLATFORM_AUTOGEN_FEATURESMTL_H_
411