Path: blob/main_old/include/platform/FeaturesVk.h
1693 views
//1// Copyright 2018 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// FeaturesVk.h: Optional features for the Vulkan renderer.6//78#ifndef ANGLE_PLATFORM_FEATURESVK_H_9#define ANGLE_PLATFORM_FEATURESVK_H_1011#include "platform/Feature.h"1213#include <array>1415namespace angle16{1718struct FeaturesVk : FeatureSetBase19{20FeaturesVk();21~FeaturesVk();2223// Line segment rasterization must follow OpenGL rules. This means using an algorithm similar24// to Bresenham's. Vulkan uses a different algorithm. This feature enables the use of pixel25// shader patching to implement OpenGL basic line rasterization rules. This feature will26// normally always be enabled. Exposing it as an option enables performance testing.27Feature basicGLLineRasterization = {28"basicGLLineRasterization", FeatureCategory::VulkanFeatures,29"Enable the use of pixel shader patching to implement OpenGL basic line "30"rasterization rules",31&members};3233// If the VK_EXT_line_rasterization extension is available we'll use it to get34// Bresenham line rasterization.35Feature bresenhamLineRasterization = {36"bresenhamLineRasterization", FeatureCategory::VulkanFeatures,37"Enable Bresenham line rasterization via VK_EXT_line_rasterization extension", &members};3839// If the VK_EXT_provoking_vertex extension is available, we'll use it to set40// the provoking vertex mode41Feature provokingVertex = {"provokingVertex", FeatureCategory::VulkanFeatures,42"Enable provoking vertex mode via VK_EXT_provoking_vertex extension",43&members};4445// Add an extra copy region when using vkCmdCopyBuffer as the Windows Intel driver seems46// to have a bug where the last region is ignored.47Feature extraCopyBufferRegion = {48"extraCopyBufferRegion", FeatureCategory::VulkanWorkarounds,49"Some drivers seem to have a bug where the last copy region in vkCmdCopyBuffer is ignored",50&members};5152// This flag is added for the sole purpose of end2end tests, to test the correctness53// of various algorithms when a fallback format is used, such as using a packed format to54// emulate a depth- or stencil-only format.55Feature forceFallbackFormat = {"forceFallbackFormat", FeatureCategory::VulkanWorkarounds,56"Force a fallback format for angle_end2end_tests", &members};5758// On some NVIDIA drivers the point size range reported from the API is inconsistent with the59// actual behavior. Clamp the point size to the value from the API to fix this.60// Tracked in http://anglebug.com/2970.61Feature clampPointSize = {62"clampPointSize", FeatureCategory::VulkanWorkarounds,63"The point size range reported from the API is inconsistent with the actual behavior",64&members, "http://anglebug.com/2970"};6566// On some NVIDIA drivers the depth value is not clamped to [0,1] for floating point depth67// buffers. This is NVIDIA bug 3171019, see http://anglebug.com/3970 for details.68Feature depthClamping = {69"depth_clamping", FeatureCategory::VulkanWorkarounds,70"The depth value is not clamped to [0,1] for floating point depth buffers.", &members,71"http://anglebug.com/3970"};7273// On some android devices, the memory barrier between the compute shader that converts vertex74// attributes and the vertex shader that reads from it is ineffective. Only known workaround is75// to perform a flush after the conversion. http://anglebug.com/301676Feature flushAfterVertexConversion = {77"flushAfterVertexConversion", FeatureCategory::VulkanWorkarounds,78"The memory barrier between the compute shader that converts vertex attributes and the "79"vertex shader that reads from it is ineffective",80&members, "http://anglebug.com/3016"};8182Feature supportsRenderpass2 = {"supportsRenderpass2", FeatureCategory::VulkanFeatures,83"VkDevice supports the VK_KHR_create_renderpass2 extension",84&members};8586// Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the87// EGL_KHR_swap_buffers_with_damage extension can be layered.88Feature supportsIncrementalPresent = {89"supportsIncrementalPresent", FeatureCategory::VulkanFeatures,90"VkDevice supports the VK_KHR_incremental_present extension", &members};9192// Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer93// extension, on which the EGL_ANDROID_image_native_buffer extension can be layered.94Feature supportsAndroidHardwareBuffer = {95"supportsAndroidHardwareBuffer", FeatureCategory::VulkanFeatures,96"VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer extension",97&members};9899// Whether the VkDevice supports the VK_GGP_frame_token extension, on which100// the EGL_ANGLE_swap_with_frame_token extension can be layered.101Feature supportsGGPFrameToken = {"supportsGGPFrameToken", FeatureCategory::VulkanFeatures,102"VkDevice supports the VK_GGP_frame_token extension",103&members};104105// Whether the VkDevice supports the VK_KHR_external_memory_fd extension, on which the106// GL_EXT_memory_object_fd extension can be layered.107Feature supportsExternalMemoryFd = {"supportsExternalMemoryFd", FeatureCategory::VulkanFeatures,108"VkDevice supports the VK_KHR_external_memory_fd extension",109&members};110111// Whether the VkDevice supports the VK_FUCHSIA_external_memory112// extension, on which the GL_ANGLE_memory_object_fuchsia extension can be layered.113Feature supportsExternalMemoryFuchsia = {114"supportsExternalMemoryFuchsia", FeatureCategory::VulkanFeatures,115"VkDevice supports the VK_FUCHSIA_external_memory extension", &members};116117Feature supportsFilteringPrecision = {118"supportsFilteringPrecision", FeatureCategory::VulkanFeatures,119"VkDevice supports the VK_GOOGLE_sampler_filtering_precision extension", &members};120121// Whether the VkDevice supports the VK_KHR_external_fence_capabilities extension.122Feature supportsExternalFenceCapabilities = {123"supportsExternalFenceCapabilities", FeatureCategory::VulkanFeatures,124"VkDevice supports the VK_KHR_external_fence_capabilities extension", &members};125126// Whether the VkDevice supports the VK_KHR_external_semaphore_capabilities extension.127Feature supportsExternalSemaphoreCapabilities = {128"supportsExternalSemaphoreCapabilities", FeatureCategory::VulkanFeatures,129"VkDevice supports the VK_KHR_external_semaphore_capabilities extension", &members};130131// Whether the VkDevice supports the VK_KHR_external_semaphore_fd extension, on which the132// GL_EXT_semaphore_fd extension can be layered.133Feature supportsExternalSemaphoreFd = {134"supportsExternalSemaphoreFd", FeatureCategory::VulkanFeatures,135"VkDevice supports the VK_KHR_external_semaphore_fd extension", &members};136137// Whether the VkDevice supports the VK_FUCHSIA_external_semaphore138// extension, on which the GL_ANGLE_semaphore_fuchsia extension can be layered.139angle::Feature supportsExternalSemaphoreFuchsia = {140"supportsExternalSemaphoreFuchsia", FeatureCategory::VulkanFeatures,141"VkDevice supports the VK_FUCHSIA_external_semaphore extension", &members};142143// Whether the VkDevice supports the VK_KHR_external_fence_fd extension, on which the144// EGL_ANDROID_native_fence extension can be layered.145Feature supportsExternalFenceFd = {"supportsExternalFenceFd", FeatureCategory::VulkanFeatures,146"VkDevice supports the VK_KHR_external_fence_fd extension",147&members, "http://anglebug.com/2517"};148149// Whether the VkDevice can support EGL_ANDROID_native_fence_sync extension.150Feature supportsAndroidNativeFenceSync = {151"supportsAndroidNativeFenceSync", FeatureCategory::VulkanFeatures,152"VkDevice supports the EGL_ANDROID_native_fence_sync extension", &members,153"http://anglebug.com/2517"};154155// Whether the VkDevice can support the imageCubeArray feature properly.156Feature supportsImageCubeArray = {"supportsImageCubeArray", FeatureCategory::VulkanFeatures,157"VkDevice supports the imageCubeArray feature properly",158&members, "http://anglebug.com/3584"};159160// Whether the VkDevice supports the pipelineStatisticsQuery feature.161Feature supportsPipelineStatisticsQuery = {162"supportsPipelineStatisticsQuery", FeatureCategory::VulkanFeatures,163"VkDevice supports the pipelineStatisticsQuery feature", &members,164"http://anglebug.com/5430"};165166// Whether the VkDevice supports the VK_EXT_shader_stencil_export extension, which is used to167// perform multisampled resolve of stencil buffer. A multi-step workaround is used instead if168// this extension is not available.169Feature supportsShaderStencilExport = {170"supportsShaderStencilExport", FeatureCategory::VulkanFeatures,171"VkDevice supports the VK_EXT_shader_stencil_export extension", &members};172173// Whether the VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension, which is needed174// to support Ycbcr conversion with external images.175Feature supportsYUVSamplerConversion = {176"supportsYUVSamplerConversion", FeatureCategory::VulkanFeatures,177"VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension", &members};178179// Where VK_EXT_transform_feedback is not support, an emulation path is used.180// http://anglebug.com/3205181Feature emulateTransformFeedback = {182"emulateTransformFeedback", FeatureCategory::VulkanFeatures,183"Emulate transform feedback as the VK_EXT_transform_feedback is not present.", &members,184"http://anglebug.com/3205"};185186// Where VK_EXT_transform_feedback is supported, it's preferred over an emulation path.187// http://anglebug.com/3206188Feature supportsTransformFeedbackExtension = {189"supportsTransformFeedbackExtension", FeatureCategory::VulkanFeatures,190"Transform feedback uses the VK_EXT_transform_feedback extension.", &members,191"http://anglebug.com/3206"};192193Feature supportsGeometryStreamsCapability = {194"supportsGeometryStreamsCapability", FeatureCategory::VulkanFeatures,195"Implementation supports the GeometryStreams SPIR-V capability.", &members,196"http://anglebug.com/3206"};197198// Whether the VkDevice supports the VK_EXT_index_type_uint8 extension199// http://anglebug.com/4405200Feature supportsIndexTypeUint8 = {"supportsIndexTypeUint8", FeatureCategory::VulkanFeatures,201"VkDevice supports the VK_EXT_index_type_uint8 extension",202&members, "http://anglebug.com/4405"};203204// Whether the VkDevice supports the VK_EXT_custom_border_color extension205// http://anglebug.com/3577206Feature supportsCustomBorderColorEXT = {207"supports_custom_border_color", FeatureCategory::VulkanFeatures,208"VkDevice supports the VK_EXT_custom_border_color extension", &members,209"http://anglebug.com/3577"};210211// Whether the VkDevice supports the VK_KHR_depth_stencil_resolve extension with the212// independentResolveNone feature.213// http://anglebug.com/4836214Feature supportsDepthStencilResolve = {"supportsDepthStencilResolve",215FeatureCategory::VulkanFeatures,216"VkDevice supports the VK_KHR_depth_stencil_resolve "217"extension with the independentResolveNone feature",218&members, "http://anglebug.com/4836"};219220// Whether the VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension.221// http://anglebug.com/4836222Feature supportsMultisampledRenderToSingleSampled = {223"supportsMultisampledRenderToSingleSampled", FeatureCategory::VulkanFeatures,224"VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension", &members,225"http://anglebug.com/4836"};226227// Whether the VkDevice supports the VK_KHR_multiview extension. http://anglebug.com/6048228Feature supportsMultiview = {"supportsMultiview", FeatureCategory::VulkanFeatures,229"VkDevice supports the VK_KHR_multiview extension", &members,230"http://anglebug.com/6048"};231232// VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153233Feature disableFifoPresentMode = {"disableFifoPresentMode", FeatureCategory::VulkanWorkarounds,234"VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members,235"http://anglebug.com/3153"};236237// On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave.238// For example, binding only descriptor set 3 results in zero being read from a uniform buffer239// object within that set. This flag results in empty descriptor sets being bound for any240// unused descriptor set to work around this issue. http://anglebug.com/2727241Feature bindEmptyForUnusedDescriptorSets = {242"bindEmptyForUnusedDescriptorSets", FeatureCategory::VulkanWorkarounds,243"Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members,244"http://anglebug.com/2727"};245246// OES_depth_texture is a commonly expected feature on Android. However it247// requires that D16_UNORM support texture filtering248// (e.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) and some devices249// do not. Work-around this by setting saying D16_UNORM supports filtering250// anyway.251Feature forceD16TexFilter = {252"forceD16TexFilter", FeatureCategory::VulkanWorkarounds,253"VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "254"which prevents OES_depth_texture from being supported.",255&members, "http://anglebug.com/3452"};256257// On some android devices, vkCmdBlitImage with flipped coordinates blits incorrectly. This258// workaround makes sure this path is avoided. http://anglebug.com/3498259Feature disableFlippingBlitWithCommand = {260"disableFlippingBlitWithCommand", FeatureCategory::VulkanWorkarounds,261"vkCmdBlitImage with flipped coordinates blits incorrectly.", &members,262"http://anglebug.com/3498"};263264// On platform with Intel or AMD GPU, a window resizing would not trigger the vulkan driver to265// return VK_ERROR_OUT_OF_DATE on swapchain present. Work-around by query current window extent266// every frame to detect a window resizing.267// http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625268Feature perFrameWindowSizeQuery = {269"perFrameWindowSizeQuery", FeatureCategory::VulkanWorkarounds,270"Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members,271"http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};272273// Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed.274Feature disallowSeamfulCubeMapEmulation = {275"disallowSeamfulCubeMapEmulation", FeatureCategory::VulkanWorkarounds,276"Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members,277"http://anglebug.com/3243"};278279// Vulkan considers vertex attribute accesses to count up to the last multiple of the stride.280// This additional access supports AMD's robust buffer access implementation.281// AMDVLK in particular will return incorrect values when the vertex access extends into the282// range that would be the stride padding and the buffer is too small.283// This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a reasonable value and pads out284// every buffer allocation size to be large enough to support a maximum vertex stride.285// http://anglebug.com/4428286Feature padBuffersToMaxVertexAttribStride = {287"padBuffersToMaxVertexAttribStride", FeatureCategory::VulkanWorkarounds,288"Vulkan considers vertex attribute accesses to count up to the last multiple of the "289"stride. This additional access supports AMD's robust buffer access implementation. "290"AMDVLK in particular will return incorrect values when the vertex access extends into "291"the range that would be the stride padding and the buffer is too small. "292"This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a maximum value and "293"pads up every buffer allocation size to be a multiple of the maximum stride.",294&members, "http://anglebug.com/4428"};295296// Whether the VkDevice supports the VK_EXT_swapchain_colorspace extension297// http://anglebug.com/2514298Feature supportsSwapchainColorspace = {299"supportsSwapchainColorspace", FeatureCategory::VulkanFeatures,300"VkDevice supports the VK_EXT_swapchain_colorspace extension", &members,301"http://anglebug.com/2514"};302303// Whether the VkDevice supports the VK_EXT_external_memory_host extension, on which the304// ANGLE_iosurface_client_buffer extension can be layered.305Feature supportsExternalMemoryHost = {306"supportsExternalMemoryHost", FeatureCategory::VulkanFeatures,307"VkDevice supports the VK_EXT_external_memory_host extension", &members};308309// Whether to fill new buffers and textures with nonzero data to sanitize robust resource310// initialization and flush out assumptions about zero init.311Feature allocateNonZeroMemory = {312"allocateNonZeroMemory", FeatureCategory::VulkanFeatures,313"Fill new allocations with non-zero values to flush out errors.", &members,314"http://anglebug.com/4384"};315316// Whether to log each callback from the VK_EXT_device_memory_report extension. This feature is317// used for trying to debug GPU memory leaks.318Feature logMemoryReportCallbacks = {"logMemoryReportCallbacks", FeatureCategory::VulkanFeatures,319"Log each callback from VK_EXT_device_memory_report",320&members};321322// Whether to log statistics from the VK_EXT_device_memory_report extension each eglSwapBuffer.323Feature logMemoryReportStats = {"logMemoryReportStats", FeatureCategory::VulkanFeatures,324"Log stats from VK_EXT_device_memory_report each swap",325&members};326327// Allocate a "shadow" buffer for GL buffer objects. For GPU-read only buffers328// glMap* latency can be reduced by maintaining a copy of the buffer which is329// writeable only by the CPU. We then return this shadow buffer on glMap* calls.330Feature shadowBuffers = {331"shadowBuffers", FeatureCategory::VulkanFeatures,332"Allocate a shadow buffer for GL buffer objects to reduce glMap* latency.", &members,333"http://anglebug.com/4339"};334335// Persistently map buffer memory until destroy, saves on map/unmap IOCTL overhead336// for buffers that are updated frequently.337Feature persistentlyMappedBuffers = {338"persistentlyMappedBuffers", FeatureCategory::VulkanFeatures,339"Persistently map buffer memory to reduce map/unmap IOCTL overhead.", &members,340"http://anglebug.com/2162"};341342// Android needs to pre-rotate surfaces that are not oriented per the native device's343// orientation (e.g. a landscape application on a Pixel phone). This feature works for344// full-screen applications. http://anglebug.com/3502345Feature enablePreRotateSurfaces = {"enablePreRotateSurfaces", FeatureCategory::VulkanFeatures,346"Enable Android pre-rotation for landscape applications",347&members, "http://anglebug.com/3502"};348349// Enable precision qualifiers for shaders generated by Vulkan backend http://anglebug.com/3078350Feature enablePrecisionQualifiers = {351"enablePrecisionQualifiers", FeatureCategory::VulkanFeatures,352"Enable precision qualifiers in shaders", &members, "http://anglebug.com/3078"};353354// Desktop (at least NVIDIA) drivers prefer combining barriers into one vkCmdPipelineBarrier355// call over issuing multiple barrier calls with fine grained dependency information to have356// better performance. http://anglebug.com/4633357Feature preferAggregateBarrierCalls = {358"preferAggregateBarrierCalls", FeatureCategory::VulkanWorkarounds,359"Single barrier call is preferred over multiple calls with "360"fine grained pipeline stage dependency information",361&members, "http://anglebug.com/4633"};362363// Tell the Vulkan back-end to use the async command queue to dispatch work to the GPU. Command364// buffer work will happened in a worker thread. Otherwise use Renderer::CommandQueue directly.365Feature asyncCommandQueue = {"asyncCommandQueue", FeatureCategory::VulkanFeatures,366"Use CommandQueue worker thread to dispatch work to GPU.",367&members, "http://anglebug.com/4324"};368369// Whether the VkDevice supports the VK_KHR_shader_float16_int8 extension and has the370// shaderFloat16 feature.371Feature supportsShaderFloat16 = {"supportsShaderFloat16", FeatureCategory::VulkanFeatures,372"VkDevice supports the VK_KHR_shader_float16_int8 extension "373"and has the shaderFloat16 feature",374&members, "http://anglebug.com/4551"};375376// Some devices don't meet the limits required to perform mipmap generation using the built-in377// compute shader. On some other devices, VK_IMAGE_USAGE_STORAGE_BIT is detrimental to378// performance, making this solution impractical.379Feature allowGenerateMipmapWithCompute = {380"allowGenerateMipmapWithCompute", FeatureCategory::VulkanFeatures,381"Use the compute path to generate mipmaps on devices that meet the minimum requirements, "382"and the performance is better.",383&members, "http://anglebug.com/4551"};384385// Whether the VkDevice supports the VK_QCOM_render_pass_store_ops extension386// http://anglebug.com/5505387Feature supportsRenderPassStoreOpNoneQCOM = {388"supportsRenderPassStoreOpNoneQCOM", FeatureCategory::VulkanFeatures,389"VkDevice supports VK_QCOM_render_pass_store_ops extension.", &members,390"http://anglebug.com/5055"};391392// Force maxUniformBufferSize to 16K on Qualcomm's Adreno 540. Pixel2's Adreno540 reports393// maxUniformBufferSize 64k but various tests failed with that size. For that specific394// device, we set to 16k for now which is known to pass all tests.395// https://issuetracker.google.com/161903006396Feature forceMaxUniformBufferSize16KB = {397"forceMaxUniformBufferSize16KB", FeatureCategory::VulkanWorkarounds,398"Force max uniform buffer size to 16K on some device due to bug", &members,399"https://issuetracker.google.com/161903006"};400401// Enable mutable bit by default for ICD's that support VK_KHR_image_format_list.402// http://anglebug.com/5281403Feature supportsImageFormatList = {404"supportsImageFormatList", FeatureCategory::VulkanFeatures,405"Enable VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT by default for ICDs "406"that support VK_KHR_image_format_list",407&members, "http://anglebug.com/5281"};408409// Swiftshader on mac fails to initialize WebGL context when EXT_multisampled_render_to_texture410// is used by Chromium.411// http://anglebug.com/4937412Feature enableMultisampledRenderToTexture = {413"enableMultisampledRenderToTexture", FeatureCategory::VulkanWorkarounds,414"Expose EXT_multisampled_render_to_texture", &members, "http://anglebug.com/4937"};415416// Qualcomm fails some tests when reducing the preferred block size to 4M.417// http://anglebug.com/4995418Feature preferredLargeHeapBlockSize4MB = {419"preferredLargeHeapBlockSize4MB", FeatureCategory::VulkanWorkarounds,420"Use 4 MB preferred large heap block size with AMD allocator", &members,421"http://anglebug.com/4995"};422423// Manhattan is calling glFlush in the middle of renderpass which breaks renderpass and hurts424// performance on tile based GPU. When this is enabled, we will defer the glFlush call made in425// the middle of renderpass to the end of renderpass.426// https://issuetracker.google.com/issues/166475273427Feature deferFlushUntilEndRenderPass = {428"deferFlushUntilEndRenderPass", FeatureCategory::VulkanWorkarounds,429"Allow glFlush to be deferred until renderpass ends", &members,430"https://issuetracker.google.com/issues/166475273"};431432// Android mistakenly destroys oldSwapchain passed to vkCreateSwapchainKHR, causing crashes on433// certain drivers. http://anglebug.com/5061434Feature waitIdleBeforeSwapchainRecreation = {435"waitIdleBeforeSwapchainRecreation", FeatureCategory::VulkanWorkarounds,436"Before passing an oldSwapchain to VkSwapchainCreateInfoKHR, wait for queue to be idle. "437"Works around a bug on platforms which destroy oldSwapchain in vkCreateSwapchainKHR.",438&members, "http://anglebug.com/5061"};439440// Allow forcing an LOD offset on all sampling operations for performance comparisons. ANGLE is441// non-conformant if this feature is enabled.442std::array<angle::Feature, 4> forceTextureLODOffset = {443angle::Feature{"force_texture_lod_offset_1", angle::FeatureCategory::VulkanWorkarounds,444"Increase the minimum texture level-of-detail by 1 when sampling.",445&members},446angle::Feature{"force_texture_lod_offset_2", angle::FeatureCategory::VulkanWorkarounds,447"Increase the minimum texture level-of-detail by 2 when sampling.",448&members},449angle::Feature{"force_texture_lod_offset_3", angle::FeatureCategory::VulkanWorkarounds,450"Increase the minimum texture level-of-detail by 3 when sampling.",451&members},452angle::Feature{"force_texture_lod_offset_4", angle::FeatureCategory::VulkanWorkarounds,453"Increase the minimum texture level-of-detail by 4 when sampling.",454&members},455};456457// Translate non-nearest filtering modes to nearest for all samplers for performance458// comparisons. ANGLE is non-conformant if this feature is enabled.459Feature forceNearestFiltering = {"force_nearest_filtering", FeatureCategory::VulkanWorkarounds,460"Force nearest filtering when sampling.", &members};461462// Translate non-nearest mip filtering modes to nearest mip for all samplers for performance463// comparisons. ANGLE is non-conformant if this feature is enabled.464Feature forceNearestMipFiltering = {"forceNearestMipFiltering",465FeatureCategory::VulkanWorkarounds,466"Force nearest mip filtering when sampling.", &members};467468// Compress float32 vertices in static buffers to float16 at draw time. ANGLE is non-conformant469// if this feature is enabled.470angle::Feature compressVertexData = {"compress_vertex_data",471angle::FeatureCategory::VulkanWorkarounds,472"Compress vertex data to smaller data types when "473"possible. Using this feature makes ANGLE non-conformant.",474&members};475476// Qualcomm missynchronizes vkCmdClearAttachments in the middle of render pass.477// https://issuetracker.google.com/166809097478Feature preferDrawClearOverVkCmdClearAttachments = {479"preferDrawClearOverVkCmdClearAttachments", FeatureCategory::VulkanWorkarounds,480"On some hardware, clear using a draw call instead of vkCmdClearAttachments in the middle "481"of render pass due to bugs",482&members, "https://issuetracker.google.com/166809097"};483484// Whether prerotation is being emulated for testing. 90 degree rotation.485Feature emulatedPrerotation90 = {"emulatedPrerotation90", FeatureCategory::VulkanFeatures,486"Emulate 90-degree prerotation.", &members,487"http://anglebug.com/4901"};488489// Whether prerotation is being emulated for testing. 180 degree rotation.490Feature emulatedPrerotation180 = {"emulatedPrerotation180", FeatureCategory::VulkanFeatures,491"Emulate 180-degree prerotation.", &members,492"http://anglebug.com/4901"};493494// Whether prerotation is being emulated for testing. 270 degree rotation.495Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures,496"Emulate 270-degree prerotation.", &members,497"http://anglebug.com/4901"};498499// Whether SPIR-V should be generated directly instead of through glslang. Transitory feature500// until the work is complete.501Feature directSPIRVGeneration = {"directSPIRVGeneration", FeatureCategory::VulkanFeatures,502"Direct translation to SPIR-V.", &members,503"http://anglebug.com/4889"};504505// Whether we should use driver uniforms over specialization constants for some shader506// modifications like yflip and rotation.507Feature forceDriverUniformOverSpecConst = {508"forceDriverUniformOverSpecConst", FeatureCategory::VulkanWorkarounds,509"Forces using driver uniforms instead of specialization constants.", &members,510"http://issuetracker.google.com/173636783"};511512// Whether non-conformant configurations and extensions should be exposed. When an extension is513// in development, or a GLES version is not supported on a device, we may still want to expose514// them for partial testing. This feature is enabled by our test harness.515Feature exposeNonConformantExtensionsAndVersions = {516"exposeNonConformantExtensionsAndVersions", FeatureCategory::VulkanWorkarounds,517"Expose GLES versions and extensions that are not conformant.", &members,518"http://anglebug.com/5375"};519520// imageAtomicExchange is expected to work for r32f formats, but support for atomic operations521// for VK_FORMAT_R32_SFLOAT is rare. This support is emulated by using an r32ui format for such522// images instead.523Feature emulateR32fImageAtomicExchange = {524"emulateR32fImageAtomicExchange", FeatureCategory::VulkanWorkarounds,525"Emulate r32f images with r32ui to support imageAtomicExchange.", &members,526"http://anglebug.com/5535"};527528Feature supportsNegativeViewport = {529"supportsNegativeViewport", FeatureCategory::VulkanFeatures,530"The driver supports inverting the viewport with a negative height.", &members};531532// Whether we should force any highp precision in the fragment shader to mediump.533// ANGLE is non-conformant if this feature is enabled.534Feature forceFragmentShaderPrecisionHighpToMediump = {535"forceFragmentShaderPrecisionHighpToMediump", FeatureCategory::VulkanWorkarounds,536"Forces highp precision in fragment shader to mediump.", &members,537"https://issuetracker.google.com/184850002"};538539// Whether we should submit at each FBO boundary.540Feature preferSubmitAtFBOBoundary = {541"preferSubmitAtFBOBoundary", FeatureCategory::VulkanWorkarounds,542"Submit commands to driver at each FBO boundary for performance improvements.", &members,543"https://issuetracker.google.com/187425444"};544545// Workaround for gap in Vulkan spec related to querying descriptor count for immutable samplers546// tied to an external format.547Feature useMultipleDescriptorsForExternalFormats = {548"useMultipleDescriptorsForExternalFormats", FeatureCategory::VulkanWorkarounds,549"Return a default descriptor count for external formats.", &members,550"http://anglebug.com/6141"};551552// Whether the VkDevice can support Protected Memory.553Feature supportsProtectedMemory = {"supports_protected_memory", FeatureCategory::VulkanFeatures,554"VkDevice supports protected memory", &members,555"http://anglebug.com/3965"};556557// Whether the VkInstance supports the VK_KHR_get_surface_capabilities2 extension.558Feature supportsSurfaceCapabilities2Extension = {559"supportsSurfaceCapabilities2Extension", FeatureCategory::VulkanFeatures,560"VkInstance supports the VK_KHR_get_surface_capabilities2 extension", &members};561562// Whether the VkInstance supports the VK_KHR_surface_protected_capabilities extension.563Feature supportsSurfaceProtectedCapabilitiesExtension = {564"supportsSurfaceProtectedCapabilitiesExtension", FeatureCategory::VulkanFeatures,565"VkInstance supports the VK_KHR_surface_protected_capabilities extension", &members};566567// Whether the VkSurface supports protected swapchains from568// supportsSurfaceProtectedCapabilitiesExtension.569Feature supportsSurfaceProtectedSwapchains = {570"supportsSurfaceProtectedSwapchains", FeatureCategory::VulkanFeatures,571"VkSurface supportsProtected for protected swapchains", &members};572};573574inline FeaturesVk::FeaturesVk() = default;575inline FeaturesVk::~FeaturesVk() = default;576577} // namespace angle578579#endif // ANGLE_PLATFORM_FEATURESVK_H_580581582