Features
Features describe functionality which is not supported on all implementations. Features are properties of the physical device. Features are optional, and must be explicitly enabled before use. Support for features is reported and enabled on a per-feature basis.
Features are reported via the basic VkPhysicalDeviceFeatures
structure, as well as the extensible structure
VkPhysicalDeviceFeatures2
, which was added in the
VK_KHR_get_physical_device_properties2 extension and included in
Vulkan 1.1.
When new features are added in future Vulkan versions or extensions, each
extension should introduce one new feature structure, if needed.
This structure can be added to the pNext
chain of the
VkPhysicalDeviceFeatures2
structure.
For convenience, new core versions of Vulkan may introduce new unified feature structures for features promoted from extensions. At the same time, the extension’s original feature structure (if any) is also promoted to the core API, and is an alias of the extension’s structure. This results in multiple names for the same feature: in the original extension’s feature structure and the promoted structure alias, in the unified feature structure. When a feature was implicitly supported and enabled in the extension, but an explicit name was added during promotion, then the extension itself acts as an alias for the feature as listed in the table below.
All aliases of the same feature in the core API must be reported consistently: either all must be reported as supported, or none of them. When a promoted extension is available, any corresponding feature aliases must be supported.
Extension | Feature(s) |
---|
Fine-grained features used by a logical device must be enabled at
VkDevice
creation time.
If a feature is enabled that the physical device does not support,
VkDevice
creation will fail and return
VK_ERROR_FEATURE_NOT_PRESENT
.
The fine-grained features are enabled by passing a pointer to the
VkPhysicalDeviceFeatures
structure via the pEnabledFeatures
member of the VkDeviceCreateInfo structure that is passed into the
vkCreateDevice
call.
If a member of pEnabledFeatures
is VK_TRUE
or VK_FALSE
,
then the device will be created with the indicated feature enabled or
disabled, respectively.
Features can also be enabled by using the VkPhysicalDeviceFeatures2
structure.
If an application wishes to enable all features supported by a device, it
can simply pass in the VkPhysicalDeviceFeatures
structure that was
previously returned by vkGetPhysicalDeviceFeatures
.
To disable an individual feature, the application can set the desired
member to VK_FALSE
in the same structure.
Setting pEnabledFeatures
to NULL
and not including a VkPhysicalDeviceFeatures2 in the pNext
chain
of VkDeviceCreateInfo
is equivalent to setting all members of the structure to VK_FALSE
.
Some features, such as robustBufferAccess
, may incur a runtime
performance cost.
Application writers should carefully consider the implications of enabling
all supported features.
Feature Requirements
All Vulkan graphics implementations must support the following features:
{generated}/featurerequirements.adoc
* storageBuffer8BitAccess
, if
uniformAndStorageBuffer8BitAccess
is enabled.
* shaderInt64
, if the
shaderSharedInt64Atomics
or
shaderBufferInt64Atomics
features are supported.
* storageBuffer16BitAccess
,
if uniformAndStorageBuffer16BitAccess
is enabled.
* shaderImageFloat32Atomics
,
if the sparseImageFloat32Atomics
feature is supported.
* shaderImageFloat32AtomicAdd
, if the
sparseImageFloat32AtomicAdd
feature is supported.
* shaderImageFloat32AtomicMinMax
, if the
sparseImageFloat32AtomicMinMax
feature is supported.
* primitiveFragmentShadingRate
if
primitiveFragmentShadingRateMeshShader
feature is supported.
* fragmentShaderSampleInterlock
or
fragmentShaderPixelInterlock
or
fragmentShaderShadingRateInterlock
, if the
VK_EXT_fragment_shader_interlock extension is supported.
* rectangularLines
or
bresenhamLines
or
smoothLines
or
stippledRectangularLines
or
stippledBresenhamLines
or
stippledSmoothLines
, if the
VK_KHR_line_rasterization extension is supported.
* rectangularLines
or
bresenhamLines
or
smoothLines
or
stippledRectangularLines
or
stippledBresenhamLines
or
stippledSmoothLines
, if the
VK_EXT_line_rasterization extension is supported.
* tessellationShader
, if the
extendedDynamicState3TessellationDomainOrigin
feature is
supported.
* depthClamp
, if the
extendedDynamicState3DepthClampEnable
feature is supported.
* fillModeNonSolid
, if the
extendedDynamicState3PolygonMode
feature is supported.
* alphaToOne
, if the
extendedDynamicState3AlphaToOneEnable
feature is supported.
* logicOp
, if the
extendedDynamicState3LogicOpEnable
feature is supported.
* geometryStreams
, if the
extendedDynamicState3RasterizationStream
feature is supported.
* VK_EXT_conservative_rasterization extension, if the
extendedDynamicState3ConservativeRasterizationMode
feature is
supported.
* VK_EXT_conservative_rasterization extension, if the
extendedDynamicState3ExtraPrimitiveOverestimationSize
feature is
supported.
* VK_EXT_sample_locations extension, if the
extendedDynamicState3SampleLocationsEnable
feature is supported.
* VK_EXT_blend_operation_advanced extension, if the
extendedDynamicState3ColorBlendAdvanced
feature is supported.
* provokingVertexLast
, if the
extendedDynamicState3ProvokingVertexMode
feature is supported.
* VK_KHR_line_rasterization or VK_EXT_line_rasterization
extension, if the extendedDynamicState3LineRasterizationMode
feature is supported.
* VK_KHR_line_rasterization or VK_EXT_line_rasterization
extension, if the extendedDynamicState3LineStippleEnable
feature is supported.
* depthClipControl
, if the
extendedDynamicState3DepthClipNegativeOneToOne
feature is
supported.
* VK_NV_clip_space_w_scaling extension, if the
extendedDynamicState3ViewportWScalingEnable
feature is
supported.
* VK_NV_viewport_swizzle extension, if the
extendedDynamicState3ViewportSwizzle
feature is supported.
* VK_NV_fragment_coverage_to_color extension, if the
extendedDynamicState3CoverageToColorEnable
feature is supported.
* VK_NV_fragment_coverage_to_color extension, if the
extendedDynamicState3CoverageToColorLocation
feature is
supported.
* VK_NV_framebuffer_mixed_samples extension, if the
extendedDynamicState3CoverageModulationMode
feature is
supported.
* VK_NV_framebuffer_mixed_samples extension, if the
extendedDynamicState3CoverageModulationTableEnable
feature is
supported.
* VK_NV_framebuffer_mixed_samples extension, if the
extendedDynamicState3CoverageModulationTable
feature is
supported.
* coverageReductionMode
, if the
extendedDynamicState3CoverageReductionMode
feature is supported.
* representativeFragmentTest
, if the
extendedDynamicState3RepresentativeFragmentTestEnable
feature is
supported.
* shadingRateImage
, if the
extendedDynamicState3ShadingRateImageEnable
feature is
supported.
* Either shaderFloat16
or
shaderInt8
if
VK_KHR_shader_float16_int8 is supported.
All other features defined in the Specification are optional.