Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/include/platform/FeaturesVk.h
1693 views
1
//
2
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
3
// Use of this source code is governed by a BSD-style license that can be
4
// found in the LICENSE file.
5
//
6
// FeaturesVk.h: Optional features for the Vulkan renderer.
7
//
8
9
#ifndef ANGLE_PLATFORM_FEATURESVK_H_
10
#define ANGLE_PLATFORM_FEATURESVK_H_
11
12
#include "platform/Feature.h"
13
14
#include <array>
15
16
namespace angle
17
{
18
19
struct FeaturesVk : FeatureSetBase
20
{
21
FeaturesVk();
22
~FeaturesVk();
23
24
// Line segment rasterization must follow OpenGL rules. This means using an algorithm similar
25
// to Bresenham's. Vulkan uses a different algorithm. This feature enables the use of pixel
26
// shader patching to implement OpenGL basic line rasterization rules. This feature will
27
// normally always be enabled. Exposing it as an option enables performance testing.
28
Feature basicGLLineRasterization = {
29
"basicGLLineRasterization", FeatureCategory::VulkanFeatures,
30
"Enable the use of pixel shader patching to implement OpenGL basic line "
31
"rasterization rules",
32
&members};
33
34
// If the VK_EXT_line_rasterization extension is available we'll use it to get
35
// Bresenham line rasterization.
36
Feature bresenhamLineRasterization = {
37
"bresenhamLineRasterization", FeatureCategory::VulkanFeatures,
38
"Enable Bresenham line rasterization via VK_EXT_line_rasterization extension", &members};
39
40
// If the VK_EXT_provoking_vertex extension is available, we'll use it to set
41
// the provoking vertex mode
42
Feature provokingVertex = {"provokingVertex", FeatureCategory::VulkanFeatures,
43
"Enable provoking vertex mode via VK_EXT_provoking_vertex extension",
44
&members};
45
46
// Add an extra copy region when using vkCmdCopyBuffer as the Windows Intel driver seems
47
// to have a bug where the last region is ignored.
48
Feature extraCopyBufferRegion = {
49
"extraCopyBufferRegion", FeatureCategory::VulkanWorkarounds,
50
"Some drivers seem to have a bug where the last copy region in vkCmdCopyBuffer is ignored",
51
&members};
52
53
// This flag is added for the sole purpose of end2end tests, to test the correctness
54
// of various algorithms when a fallback format is used, such as using a packed format to
55
// emulate a depth- or stencil-only format.
56
Feature forceFallbackFormat = {"forceFallbackFormat", FeatureCategory::VulkanWorkarounds,
57
"Force a fallback format for angle_end2end_tests", &members};
58
59
// On some NVIDIA drivers the point size range reported from the API is inconsistent with the
60
// actual behavior. Clamp the point size to the value from the API to fix this.
61
// Tracked in http://anglebug.com/2970.
62
Feature clampPointSize = {
63
"clampPointSize", FeatureCategory::VulkanWorkarounds,
64
"The point size range reported from the API is inconsistent with the actual behavior",
65
&members, "http://anglebug.com/2970"};
66
67
// On some NVIDIA drivers the depth value is not clamped to [0,1] for floating point depth
68
// buffers. This is NVIDIA bug 3171019, see http://anglebug.com/3970 for details.
69
Feature depthClamping = {
70
"depth_clamping", FeatureCategory::VulkanWorkarounds,
71
"The depth value is not clamped to [0,1] for floating point depth buffers.", &members,
72
"http://anglebug.com/3970"};
73
74
// On some android devices, the memory barrier between the compute shader that converts vertex
75
// attributes and the vertex shader that reads from it is ineffective. Only known workaround is
76
// to perform a flush after the conversion. http://anglebug.com/3016
77
Feature flushAfterVertexConversion = {
78
"flushAfterVertexConversion", FeatureCategory::VulkanWorkarounds,
79
"The memory barrier between the compute shader that converts vertex attributes and the "
80
"vertex shader that reads from it is ineffective",
81
&members, "http://anglebug.com/3016"};
82
83
Feature supportsRenderpass2 = {"supportsRenderpass2", FeatureCategory::VulkanFeatures,
84
"VkDevice supports the VK_KHR_create_renderpass2 extension",
85
&members};
86
87
// Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the
88
// EGL_KHR_swap_buffers_with_damage extension can be layered.
89
Feature supportsIncrementalPresent = {
90
"supportsIncrementalPresent", FeatureCategory::VulkanFeatures,
91
"VkDevice supports the VK_KHR_incremental_present extension", &members};
92
93
// Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer
94
// extension, on which the EGL_ANDROID_image_native_buffer extension can be layered.
95
Feature supportsAndroidHardwareBuffer = {
96
"supportsAndroidHardwareBuffer", FeatureCategory::VulkanFeatures,
97
"VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer extension",
98
&members};
99
100
// Whether the VkDevice supports the VK_GGP_frame_token extension, on which
101
// the EGL_ANGLE_swap_with_frame_token extension can be layered.
102
Feature supportsGGPFrameToken = {"supportsGGPFrameToken", FeatureCategory::VulkanFeatures,
103
"VkDevice supports the VK_GGP_frame_token extension",
104
&members};
105
106
// Whether the VkDevice supports the VK_KHR_external_memory_fd extension, on which the
107
// GL_EXT_memory_object_fd extension can be layered.
108
Feature supportsExternalMemoryFd = {"supportsExternalMemoryFd", FeatureCategory::VulkanFeatures,
109
"VkDevice supports the VK_KHR_external_memory_fd extension",
110
&members};
111
112
// Whether the VkDevice supports the VK_FUCHSIA_external_memory
113
// extension, on which the GL_ANGLE_memory_object_fuchsia extension can be layered.
114
Feature supportsExternalMemoryFuchsia = {
115
"supportsExternalMemoryFuchsia", FeatureCategory::VulkanFeatures,
116
"VkDevice supports the VK_FUCHSIA_external_memory extension", &members};
117
118
Feature supportsFilteringPrecision = {
119
"supportsFilteringPrecision", FeatureCategory::VulkanFeatures,
120
"VkDevice supports the VK_GOOGLE_sampler_filtering_precision extension", &members};
121
122
// Whether the VkDevice supports the VK_KHR_external_fence_capabilities extension.
123
Feature supportsExternalFenceCapabilities = {
124
"supportsExternalFenceCapabilities", FeatureCategory::VulkanFeatures,
125
"VkDevice supports the VK_KHR_external_fence_capabilities extension", &members};
126
127
// Whether the VkDevice supports the VK_KHR_external_semaphore_capabilities extension.
128
Feature supportsExternalSemaphoreCapabilities = {
129
"supportsExternalSemaphoreCapabilities", FeatureCategory::VulkanFeatures,
130
"VkDevice supports the VK_KHR_external_semaphore_capabilities extension", &members};
131
132
// Whether the VkDevice supports the VK_KHR_external_semaphore_fd extension, on which the
133
// GL_EXT_semaphore_fd extension can be layered.
134
Feature supportsExternalSemaphoreFd = {
135
"supportsExternalSemaphoreFd", FeatureCategory::VulkanFeatures,
136
"VkDevice supports the VK_KHR_external_semaphore_fd extension", &members};
137
138
// Whether the VkDevice supports the VK_FUCHSIA_external_semaphore
139
// extension, on which the GL_ANGLE_semaphore_fuchsia extension can be layered.
140
angle::Feature supportsExternalSemaphoreFuchsia = {
141
"supportsExternalSemaphoreFuchsia", FeatureCategory::VulkanFeatures,
142
"VkDevice supports the VK_FUCHSIA_external_semaphore extension", &members};
143
144
// Whether the VkDevice supports the VK_KHR_external_fence_fd extension, on which the
145
// EGL_ANDROID_native_fence extension can be layered.
146
Feature supportsExternalFenceFd = {"supportsExternalFenceFd", FeatureCategory::VulkanFeatures,
147
"VkDevice supports the VK_KHR_external_fence_fd extension",
148
&members, "http://anglebug.com/2517"};
149
150
// Whether the VkDevice can support EGL_ANDROID_native_fence_sync extension.
151
Feature supportsAndroidNativeFenceSync = {
152
"supportsAndroidNativeFenceSync", FeatureCategory::VulkanFeatures,
153
"VkDevice supports the EGL_ANDROID_native_fence_sync extension", &members,
154
"http://anglebug.com/2517"};
155
156
// Whether the VkDevice can support the imageCubeArray feature properly.
157
Feature supportsImageCubeArray = {"supportsImageCubeArray", FeatureCategory::VulkanFeatures,
158
"VkDevice supports the imageCubeArray feature properly",
159
&members, "http://anglebug.com/3584"};
160
161
// Whether the VkDevice supports the pipelineStatisticsQuery feature.
162
Feature supportsPipelineStatisticsQuery = {
163
"supportsPipelineStatisticsQuery", FeatureCategory::VulkanFeatures,
164
"VkDevice supports the pipelineStatisticsQuery feature", &members,
165
"http://anglebug.com/5430"};
166
167
// Whether the VkDevice supports the VK_EXT_shader_stencil_export extension, which is used to
168
// perform multisampled resolve of stencil buffer. A multi-step workaround is used instead if
169
// this extension is not available.
170
Feature supportsShaderStencilExport = {
171
"supportsShaderStencilExport", FeatureCategory::VulkanFeatures,
172
"VkDevice supports the VK_EXT_shader_stencil_export extension", &members};
173
174
// Whether the VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension, which is needed
175
// to support Ycbcr conversion with external images.
176
Feature supportsYUVSamplerConversion = {
177
"supportsYUVSamplerConversion", FeatureCategory::VulkanFeatures,
178
"VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension", &members};
179
180
// Where VK_EXT_transform_feedback is not support, an emulation path is used.
181
// http://anglebug.com/3205
182
Feature emulateTransformFeedback = {
183
"emulateTransformFeedback", FeatureCategory::VulkanFeatures,
184
"Emulate transform feedback as the VK_EXT_transform_feedback is not present.", &members,
185
"http://anglebug.com/3205"};
186
187
// Where VK_EXT_transform_feedback is supported, it's preferred over an emulation path.
188
// http://anglebug.com/3206
189
Feature supportsTransformFeedbackExtension = {
190
"supportsTransformFeedbackExtension", FeatureCategory::VulkanFeatures,
191
"Transform feedback uses the VK_EXT_transform_feedback extension.", &members,
192
"http://anglebug.com/3206"};
193
194
Feature supportsGeometryStreamsCapability = {
195
"supportsGeometryStreamsCapability", FeatureCategory::VulkanFeatures,
196
"Implementation supports the GeometryStreams SPIR-V capability.", &members,
197
"http://anglebug.com/3206"};
198
199
// Whether the VkDevice supports the VK_EXT_index_type_uint8 extension
200
// http://anglebug.com/4405
201
Feature supportsIndexTypeUint8 = {"supportsIndexTypeUint8", FeatureCategory::VulkanFeatures,
202
"VkDevice supports the VK_EXT_index_type_uint8 extension",
203
&members, "http://anglebug.com/4405"};
204
205
// Whether the VkDevice supports the VK_EXT_custom_border_color extension
206
// http://anglebug.com/3577
207
Feature supportsCustomBorderColorEXT = {
208
"supports_custom_border_color", FeatureCategory::VulkanFeatures,
209
"VkDevice supports the VK_EXT_custom_border_color extension", &members,
210
"http://anglebug.com/3577"};
211
212
// Whether the VkDevice supports the VK_KHR_depth_stencil_resolve extension with the
213
// independentResolveNone feature.
214
// http://anglebug.com/4836
215
Feature supportsDepthStencilResolve = {"supportsDepthStencilResolve",
216
FeatureCategory::VulkanFeatures,
217
"VkDevice supports the VK_KHR_depth_stencil_resolve "
218
"extension with the independentResolveNone feature",
219
&members, "http://anglebug.com/4836"};
220
221
// Whether the VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension.
222
// http://anglebug.com/4836
223
Feature supportsMultisampledRenderToSingleSampled = {
224
"supportsMultisampledRenderToSingleSampled", FeatureCategory::VulkanFeatures,
225
"VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension", &members,
226
"http://anglebug.com/4836"};
227
228
// Whether the VkDevice supports the VK_KHR_multiview extension. http://anglebug.com/6048
229
Feature supportsMultiview = {"supportsMultiview", FeatureCategory::VulkanFeatures,
230
"VkDevice supports the VK_KHR_multiview extension", &members,
231
"http://anglebug.com/6048"};
232
233
// VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153
234
Feature disableFifoPresentMode = {"disableFifoPresentMode", FeatureCategory::VulkanWorkarounds,
235
"VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members,
236
"http://anglebug.com/3153"};
237
238
// On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave.
239
// For example, binding only descriptor set 3 results in zero being read from a uniform buffer
240
// object within that set. This flag results in empty descriptor sets being bound for any
241
// unused descriptor set to work around this issue. http://anglebug.com/2727
242
Feature bindEmptyForUnusedDescriptorSets = {
243
"bindEmptyForUnusedDescriptorSets", FeatureCategory::VulkanWorkarounds,
244
"Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members,
245
"http://anglebug.com/2727"};
246
247
// OES_depth_texture is a commonly expected feature on Android. However it
248
// requires that D16_UNORM support texture filtering
249
// (e.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) and some devices
250
// do not. Work-around this by setting saying D16_UNORM supports filtering
251
// anyway.
252
Feature forceD16TexFilter = {
253
"forceD16TexFilter", FeatureCategory::VulkanWorkarounds,
254
"VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "
255
"which prevents OES_depth_texture from being supported.",
256
&members, "http://anglebug.com/3452"};
257
258
// On some android devices, vkCmdBlitImage with flipped coordinates blits incorrectly. This
259
// workaround makes sure this path is avoided. http://anglebug.com/3498
260
Feature disableFlippingBlitWithCommand = {
261
"disableFlippingBlitWithCommand", FeatureCategory::VulkanWorkarounds,
262
"vkCmdBlitImage with flipped coordinates blits incorrectly.", &members,
263
"http://anglebug.com/3498"};
264
265
// On platform with Intel or AMD GPU, a window resizing would not trigger the vulkan driver to
266
// return VK_ERROR_OUT_OF_DATE on swapchain present. Work-around by query current window extent
267
// every frame to detect a window resizing.
268
// http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625
269
Feature perFrameWindowSizeQuery = {
270
"perFrameWindowSizeQuery", FeatureCategory::VulkanWorkarounds,
271
"Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members,
272
"http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};
273
274
// Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed.
275
Feature disallowSeamfulCubeMapEmulation = {
276
"disallowSeamfulCubeMapEmulation", FeatureCategory::VulkanWorkarounds,
277
"Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members,
278
"http://anglebug.com/3243"};
279
280
// Vulkan considers vertex attribute accesses to count up to the last multiple of the stride.
281
// This additional access supports AMD's robust buffer access implementation.
282
// AMDVLK in particular will return incorrect values when the vertex access extends into the
283
// range that would be the stride padding and the buffer is too small.
284
// This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a reasonable value and pads out
285
// every buffer allocation size to be large enough to support a maximum vertex stride.
286
// http://anglebug.com/4428
287
Feature padBuffersToMaxVertexAttribStride = {
288
"padBuffersToMaxVertexAttribStride", FeatureCategory::VulkanWorkarounds,
289
"Vulkan considers vertex attribute accesses to count up to the last multiple of the "
290
"stride. This additional access supports AMD's robust buffer access implementation. "
291
"AMDVLK in particular will return incorrect values when the vertex access extends into "
292
"the range that would be the stride padding and the buffer is too small. "
293
"This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a maximum value and "
294
"pads up every buffer allocation size to be a multiple of the maximum stride.",
295
&members, "http://anglebug.com/4428"};
296
297
// Whether the VkDevice supports the VK_EXT_swapchain_colorspace extension
298
// http://anglebug.com/2514
299
Feature supportsSwapchainColorspace = {
300
"supportsSwapchainColorspace", FeatureCategory::VulkanFeatures,
301
"VkDevice supports the VK_EXT_swapchain_colorspace extension", &members,
302
"http://anglebug.com/2514"};
303
304
// Whether the VkDevice supports the VK_EXT_external_memory_host extension, on which the
305
// ANGLE_iosurface_client_buffer extension can be layered.
306
Feature supportsExternalMemoryHost = {
307
"supportsExternalMemoryHost", FeatureCategory::VulkanFeatures,
308
"VkDevice supports the VK_EXT_external_memory_host extension", &members};
309
310
// Whether to fill new buffers and textures with nonzero data to sanitize robust resource
311
// initialization and flush out assumptions about zero init.
312
Feature allocateNonZeroMemory = {
313
"allocateNonZeroMemory", FeatureCategory::VulkanFeatures,
314
"Fill new allocations with non-zero values to flush out errors.", &members,
315
"http://anglebug.com/4384"};
316
317
// Whether to log each callback from the VK_EXT_device_memory_report extension. This feature is
318
// used for trying to debug GPU memory leaks.
319
Feature logMemoryReportCallbacks = {"logMemoryReportCallbacks", FeatureCategory::VulkanFeatures,
320
"Log each callback from VK_EXT_device_memory_report",
321
&members};
322
323
// Whether to log statistics from the VK_EXT_device_memory_report extension each eglSwapBuffer.
324
Feature logMemoryReportStats = {"logMemoryReportStats", FeatureCategory::VulkanFeatures,
325
"Log stats from VK_EXT_device_memory_report each swap",
326
&members};
327
328
// Allocate a "shadow" buffer for GL buffer objects. For GPU-read only buffers
329
// glMap* latency can be reduced by maintaining a copy of the buffer which is
330
// writeable only by the CPU. We then return this shadow buffer on glMap* calls.
331
Feature shadowBuffers = {
332
"shadowBuffers", FeatureCategory::VulkanFeatures,
333
"Allocate a shadow buffer for GL buffer objects to reduce glMap* latency.", &members,
334
"http://anglebug.com/4339"};
335
336
// Persistently map buffer memory until destroy, saves on map/unmap IOCTL overhead
337
// for buffers that are updated frequently.
338
Feature persistentlyMappedBuffers = {
339
"persistentlyMappedBuffers", FeatureCategory::VulkanFeatures,
340
"Persistently map buffer memory to reduce map/unmap IOCTL overhead.", &members,
341
"http://anglebug.com/2162"};
342
343
// Android needs to pre-rotate surfaces that are not oriented per the native device's
344
// orientation (e.g. a landscape application on a Pixel phone). This feature works for
345
// full-screen applications. http://anglebug.com/3502
346
Feature enablePreRotateSurfaces = {"enablePreRotateSurfaces", FeatureCategory::VulkanFeatures,
347
"Enable Android pre-rotation for landscape applications",
348
&members, "http://anglebug.com/3502"};
349
350
// Enable precision qualifiers for shaders generated by Vulkan backend http://anglebug.com/3078
351
Feature enablePrecisionQualifiers = {
352
"enablePrecisionQualifiers", FeatureCategory::VulkanFeatures,
353
"Enable precision qualifiers in shaders", &members, "http://anglebug.com/3078"};
354
355
// Desktop (at least NVIDIA) drivers prefer combining barriers into one vkCmdPipelineBarrier
356
// call over issuing multiple barrier calls with fine grained dependency information to have
357
// better performance. http://anglebug.com/4633
358
Feature preferAggregateBarrierCalls = {
359
"preferAggregateBarrierCalls", FeatureCategory::VulkanWorkarounds,
360
"Single barrier call is preferred over multiple calls with "
361
"fine grained pipeline stage dependency information",
362
&members, "http://anglebug.com/4633"};
363
364
// Tell the Vulkan back-end to use the async command queue to dispatch work to the GPU. Command
365
// buffer work will happened in a worker thread. Otherwise use Renderer::CommandQueue directly.
366
Feature asyncCommandQueue = {"asyncCommandQueue", FeatureCategory::VulkanFeatures,
367
"Use CommandQueue worker thread to dispatch work to GPU.",
368
&members, "http://anglebug.com/4324"};
369
370
// Whether the VkDevice supports the VK_KHR_shader_float16_int8 extension and has the
371
// shaderFloat16 feature.
372
Feature supportsShaderFloat16 = {"supportsShaderFloat16", FeatureCategory::VulkanFeatures,
373
"VkDevice supports the VK_KHR_shader_float16_int8 extension "
374
"and has the shaderFloat16 feature",
375
&members, "http://anglebug.com/4551"};
376
377
// Some devices don't meet the limits required to perform mipmap generation using the built-in
378
// compute shader. On some other devices, VK_IMAGE_USAGE_STORAGE_BIT is detrimental to
379
// performance, making this solution impractical.
380
Feature allowGenerateMipmapWithCompute = {
381
"allowGenerateMipmapWithCompute", FeatureCategory::VulkanFeatures,
382
"Use the compute path to generate mipmaps on devices that meet the minimum requirements, "
383
"and the performance is better.",
384
&members, "http://anglebug.com/4551"};
385
386
// Whether the VkDevice supports the VK_QCOM_render_pass_store_ops extension
387
// http://anglebug.com/5505
388
Feature supportsRenderPassStoreOpNoneQCOM = {
389
"supportsRenderPassStoreOpNoneQCOM", FeatureCategory::VulkanFeatures,
390
"VkDevice supports VK_QCOM_render_pass_store_ops extension.", &members,
391
"http://anglebug.com/5055"};
392
393
// Force maxUniformBufferSize to 16K on Qualcomm's Adreno 540. Pixel2's Adreno540 reports
394
// maxUniformBufferSize 64k but various tests failed with that size. For that specific
395
// device, we set to 16k for now which is known to pass all tests.
396
// https://issuetracker.google.com/161903006
397
Feature forceMaxUniformBufferSize16KB = {
398
"forceMaxUniformBufferSize16KB", FeatureCategory::VulkanWorkarounds,
399
"Force max uniform buffer size to 16K on some device due to bug", &members,
400
"https://issuetracker.google.com/161903006"};
401
402
// Enable mutable bit by default for ICD's that support VK_KHR_image_format_list.
403
// http://anglebug.com/5281
404
Feature supportsImageFormatList = {
405
"supportsImageFormatList", FeatureCategory::VulkanFeatures,
406
"Enable VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT by default for ICDs "
407
"that support VK_KHR_image_format_list",
408
&members, "http://anglebug.com/5281"};
409
410
// Swiftshader on mac fails to initialize WebGL context when EXT_multisampled_render_to_texture
411
// is used by Chromium.
412
// http://anglebug.com/4937
413
Feature enableMultisampledRenderToTexture = {
414
"enableMultisampledRenderToTexture", FeatureCategory::VulkanWorkarounds,
415
"Expose EXT_multisampled_render_to_texture", &members, "http://anglebug.com/4937"};
416
417
// Qualcomm fails some tests when reducing the preferred block size to 4M.
418
// http://anglebug.com/4995
419
Feature preferredLargeHeapBlockSize4MB = {
420
"preferredLargeHeapBlockSize4MB", FeatureCategory::VulkanWorkarounds,
421
"Use 4 MB preferred large heap block size with AMD allocator", &members,
422
"http://anglebug.com/4995"};
423
424
// Manhattan is calling glFlush in the middle of renderpass which breaks renderpass and hurts
425
// performance on tile based GPU. When this is enabled, we will defer the glFlush call made in
426
// the middle of renderpass to the end of renderpass.
427
// https://issuetracker.google.com/issues/166475273
428
Feature deferFlushUntilEndRenderPass = {
429
"deferFlushUntilEndRenderPass", FeatureCategory::VulkanWorkarounds,
430
"Allow glFlush to be deferred until renderpass ends", &members,
431
"https://issuetracker.google.com/issues/166475273"};
432
433
// Android mistakenly destroys oldSwapchain passed to vkCreateSwapchainKHR, causing crashes on
434
// certain drivers. http://anglebug.com/5061
435
Feature waitIdleBeforeSwapchainRecreation = {
436
"waitIdleBeforeSwapchainRecreation", FeatureCategory::VulkanWorkarounds,
437
"Before passing an oldSwapchain to VkSwapchainCreateInfoKHR, wait for queue to be idle. "
438
"Works around a bug on platforms which destroy oldSwapchain in vkCreateSwapchainKHR.",
439
&members, "http://anglebug.com/5061"};
440
441
// Allow forcing an LOD offset on all sampling operations for performance comparisons. ANGLE is
442
// non-conformant if this feature is enabled.
443
std::array<angle::Feature, 4> forceTextureLODOffset = {
444
angle::Feature{"force_texture_lod_offset_1", angle::FeatureCategory::VulkanWorkarounds,
445
"Increase the minimum texture level-of-detail by 1 when sampling.",
446
&members},
447
angle::Feature{"force_texture_lod_offset_2", angle::FeatureCategory::VulkanWorkarounds,
448
"Increase the minimum texture level-of-detail by 2 when sampling.",
449
&members},
450
angle::Feature{"force_texture_lod_offset_3", angle::FeatureCategory::VulkanWorkarounds,
451
"Increase the minimum texture level-of-detail by 3 when sampling.",
452
&members},
453
angle::Feature{"force_texture_lod_offset_4", angle::FeatureCategory::VulkanWorkarounds,
454
"Increase the minimum texture level-of-detail by 4 when sampling.",
455
&members},
456
};
457
458
// Translate non-nearest filtering modes to nearest for all samplers for performance
459
// comparisons. ANGLE is non-conformant if this feature is enabled.
460
Feature forceNearestFiltering = {"force_nearest_filtering", FeatureCategory::VulkanWorkarounds,
461
"Force nearest filtering when sampling.", &members};
462
463
// Translate non-nearest mip filtering modes to nearest mip for all samplers for performance
464
// comparisons. ANGLE is non-conformant if this feature is enabled.
465
Feature forceNearestMipFiltering = {"forceNearestMipFiltering",
466
FeatureCategory::VulkanWorkarounds,
467
"Force nearest mip filtering when sampling.", &members};
468
469
// Compress float32 vertices in static buffers to float16 at draw time. ANGLE is non-conformant
470
// if this feature is enabled.
471
angle::Feature compressVertexData = {"compress_vertex_data",
472
angle::FeatureCategory::VulkanWorkarounds,
473
"Compress vertex data to smaller data types when "
474
"possible. Using this feature makes ANGLE non-conformant.",
475
&members};
476
477
// Qualcomm missynchronizes vkCmdClearAttachments in the middle of render pass.
478
// https://issuetracker.google.com/166809097
479
Feature preferDrawClearOverVkCmdClearAttachments = {
480
"preferDrawClearOverVkCmdClearAttachments", FeatureCategory::VulkanWorkarounds,
481
"On some hardware, clear using a draw call instead of vkCmdClearAttachments in the middle "
482
"of render pass due to bugs",
483
&members, "https://issuetracker.google.com/166809097"};
484
485
// Whether prerotation is being emulated for testing. 90 degree rotation.
486
Feature emulatedPrerotation90 = {"emulatedPrerotation90", FeatureCategory::VulkanFeatures,
487
"Emulate 90-degree prerotation.", &members,
488
"http://anglebug.com/4901"};
489
490
// Whether prerotation is being emulated for testing. 180 degree rotation.
491
Feature emulatedPrerotation180 = {"emulatedPrerotation180", FeatureCategory::VulkanFeatures,
492
"Emulate 180-degree prerotation.", &members,
493
"http://anglebug.com/4901"};
494
495
// Whether prerotation is being emulated for testing. 270 degree rotation.
496
Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures,
497
"Emulate 270-degree prerotation.", &members,
498
"http://anglebug.com/4901"};
499
500
// Whether SPIR-V should be generated directly instead of through glslang. Transitory feature
501
// until the work is complete.
502
Feature directSPIRVGeneration = {"directSPIRVGeneration", FeatureCategory::VulkanFeatures,
503
"Direct translation to SPIR-V.", &members,
504
"http://anglebug.com/4889"};
505
506
// Whether we should use driver uniforms over specialization constants for some shader
507
// modifications like yflip and rotation.
508
Feature forceDriverUniformOverSpecConst = {
509
"forceDriverUniformOverSpecConst", FeatureCategory::VulkanWorkarounds,
510
"Forces using driver uniforms instead of specialization constants.", &members,
511
"http://issuetracker.google.com/173636783"};
512
513
// Whether non-conformant configurations and extensions should be exposed. When an extension is
514
// in development, or a GLES version is not supported on a device, we may still want to expose
515
// them for partial testing. This feature is enabled by our test harness.
516
Feature exposeNonConformantExtensionsAndVersions = {
517
"exposeNonConformantExtensionsAndVersions", FeatureCategory::VulkanWorkarounds,
518
"Expose GLES versions and extensions that are not conformant.", &members,
519
"http://anglebug.com/5375"};
520
521
// imageAtomicExchange is expected to work for r32f formats, but support for atomic operations
522
// for VK_FORMAT_R32_SFLOAT is rare. This support is emulated by using an r32ui format for such
523
// images instead.
524
Feature emulateR32fImageAtomicExchange = {
525
"emulateR32fImageAtomicExchange", FeatureCategory::VulkanWorkarounds,
526
"Emulate r32f images with r32ui to support imageAtomicExchange.", &members,
527
"http://anglebug.com/5535"};
528
529
Feature supportsNegativeViewport = {
530
"supportsNegativeViewport", FeatureCategory::VulkanFeatures,
531
"The driver supports inverting the viewport with a negative height.", &members};
532
533
// Whether we should force any highp precision in the fragment shader to mediump.
534
// ANGLE is non-conformant if this feature is enabled.
535
Feature forceFragmentShaderPrecisionHighpToMediump = {
536
"forceFragmentShaderPrecisionHighpToMediump", FeatureCategory::VulkanWorkarounds,
537
"Forces highp precision in fragment shader to mediump.", &members,
538
"https://issuetracker.google.com/184850002"};
539
540
// Whether we should submit at each FBO boundary.
541
Feature preferSubmitAtFBOBoundary = {
542
"preferSubmitAtFBOBoundary", FeatureCategory::VulkanWorkarounds,
543
"Submit commands to driver at each FBO boundary for performance improvements.", &members,
544
"https://issuetracker.google.com/187425444"};
545
546
// Workaround for gap in Vulkan spec related to querying descriptor count for immutable samplers
547
// tied to an external format.
548
Feature useMultipleDescriptorsForExternalFormats = {
549
"useMultipleDescriptorsForExternalFormats", FeatureCategory::VulkanWorkarounds,
550
"Return a default descriptor count for external formats.", &members,
551
"http://anglebug.com/6141"};
552
553
// Whether the VkDevice can support Protected Memory.
554
Feature supportsProtectedMemory = {"supports_protected_memory", FeatureCategory::VulkanFeatures,
555
"VkDevice supports protected memory", &members,
556
"http://anglebug.com/3965"};
557
558
// Whether the VkInstance supports the VK_KHR_get_surface_capabilities2 extension.
559
Feature supportsSurfaceCapabilities2Extension = {
560
"supportsSurfaceCapabilities2Extension", FeatureCategory::VulkanFeatures,
561
"VkInstance supports the VK_KHR_get_surface_capabilities2 extension", &members};
562
563
// Whether the VkInstance supports the VK_KHR_surface_protected_capabilities extension.
564
Feature supportsSurfaceProtectedCapabilitiesExtension = {
565
"supportsSurfaceProtectedCapabilitiesExtension", FeatureCategory::VulkanFeatures,
566
"VkInstance supports the VK_KHR_surface_protected_capabilities extension", &members};
567
568
// Whether the VkSurface supports protected swapchains from
569
// supportsSurfaceProtectedCapabilitiesExtension.
570
Feature supportsSurfaceProtectedSwapchains = {
571
"supportsSurfaceProtectedSwapchains", FeatureCategory::VulkanFeatures,
572
"VkSurface supportsProtected for protected swapchains", &members};
573
};
574
575
inline FeaturesVk::FeaturesVk() = default;
576
inline FeaturesVk::~FeaturesVk() = default;
577
578
} // namespace angle
579
580
#endif // ANGLE_PLATFORM_FEATURESVK_H_
581
582