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.

void vkGetPhysicalDeviceFeatures( VkPhysicalDevice VkPhysicalDeviceFeatures* physicalDevice, pFeatures);

void FVulkanDevice::InitGPU(int32 DeviceIndex)

void vkGetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures);

void FVulkanDevice::InitGPU(int32 DeviceIndex)

typedef struct VkPhysicalDeviceFeatures { VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 robustBufferAccess; fullDrawIndexUint32; imageCubeArray; independentBlend; geometryShader; tessellationShader; sampleRateShading; dualSrcBlend; logicOp; multiDrawIndirect; VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 drawIndirectFirstInstance; depthClamp; depthBiasClamp; fillModeNonSolid; depthBounds; wideLines; largePoints; alphaToOne; multiViewport; samplerAnisotropy; textureCompressionETC2; textureCompressionASTC_LDR; textureCompressionBC; occlusionQueryPrecise; pipelineStatisticsQuery; vertexPipelineStoresAndAtomics; fragmentStoresAndAtomics; shaderTessellationAndGeometryPointSize; shaderImageGatherExtended; shaderStorageImageExtendedFormats; shaderStorageImageMultisample; shaderStorageImageReadWithoutFormat; shaderStorageImageWriteWithoutFormat; shaderUniformBufferArrayDynamicIndexing; shaderSampledImageArrayDynamicIndexing; shaderStorageBufferArrayDynamicIndexing; shaderStorageImageArrayDynamicIndexing; shaderClipDistance; shaderCullDistance; shaderFloat64; shaderInt64; shaderInt16; shaderResourceResidency; shaderResourceMinLod; sparseBinding; sparseResidencyBuffer; sparseResidencyImage2D; sparseResidencyImage3D; sparseResidency2Samples; sparseResidency4Samples; sparseResidency8Samples; sparseResidency16Samples; sparseResidencyAliased; variableMultisampleRate; inheritedQueries; } VkPhysicalDeviceFeatures;

typedef struct VkPhysicalDeviceVulkan11Features { VkStructureType void* VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 sType; pNext; storageBuffer16BitAccess; uniformAndStorageBuffer16BitAccess; storagePushConstant16; storageInputOutput16; multiview; multiviewGeometryShader; multiviewTessellationShader; variablePointersStorageBuffer; variablePointers; protectedMemory; samplerYcbcrConversion; shaderDrawParameters; } VkPhysicalDeviceVulkan11Features;

typedef struct VkPhysicalDeviceVulkan12Features { VkStructureType void* VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 sType; pNext; samplerMirrorClampToEdge; drawIndirectCount; storageBuffer8BitAccess; uniformAndStorageBuffer8BitAccess; storagePushConstant8; shaderBufferInt64Atomics; shaderSharedInt64Atomics; shaderFloat16; VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 shaderInt8; descriptorIndexing; shaderInputAttachmentArrayDynamicIndexing; shaderUniformTexelBufferArrayDynamicIndexing; shaderStorageTexelBufferArrayDynamicIndexing; shaderUniformBufferArrayNonUniformIndexing; shaderSampledImageArrayNonUniformIndexing; shaderStorageBufferArrayNonUniformIndexing; shaderStorageImageArrayNonUniformIndexing; shaderInputAttachmentArrayNonUniformIndexing; shaderUniformTexelBufferArrayNonUniformIndexing; shaderStorageTexelBufferArrayNonUniformIndexing; descriptorBindingUniformBufferUpdateAfterBind; descriptorBindingSampledImageUpdateAfterBind; descriptorBindingStorageImageUpdateAfterBind; descriptorBindingStorageBufferUpdateAfterBind; descriptorBindingUniformTexelBufferUpdateAfterBind; descriptorBindingStorageTexelBufferUpdateAfterBind; descriptorBindingUpdateUnusedWhilePending; descriptorBindingPartiallyBound; descriptorBindingVariableDescriptorCount; runtimeDescriptorArray; samplerFilterMinmax; scalarBlockLayout; imagelessFramebuffer; uniformBufferStandardLayout; shaderSubgroupExtendedTypes; separateDepthStencilLayouts; hostQueryReset; timelineSemaphore; bufferDeviceAddress; bufferDeviceAddressCaptureReplay; bufferDeviceAddressMultiDevice; vulkanMemoryModel; vulkanMemoryModelDeviceScope; vulkanMemoryModelAvailabilityVisibilityChains; shaderOutputViewportIndex; shaderOutputLayer; subgroupBroadcastDynamicId; } VkPhysicalDeviceVulkan12Features;

typedef struct VkPhysicalDeviceVulkan13Features { VkStructureType void* VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 VkBool32 sType; pNext; robustImageAccess; inlineUniformBlock; descriptorBindingInlineUniformBlockUpdateAfterBind; pipelineCreationCacheControl; privateData; shaderDemoteToHelperInvocation; shaderTerminateInvocation; subgroupSizeControl; computeFullSubgroups; synchronization2; textureCompressionASTC_HDR; shaderZeroInitializeWorkgroupMemory; dynamicRendering; shaderIntegerDotProduct; maintenance4; } VkPhysicalDeviceVulkan13Features;

Feature Requirements

All Vulkan graphics implementations must support the following features

robustBufferAccess • multiview, if Vulkan 1.1 is supported. • uniformBufferStandardLayout, if Vulkan 1.2 or the VK_KHR_uniform_buffer_standard_layout extension is supported. • storageBuffer8BitAccess, if uniformAndStorageBuffer8BitAccess is enabled. • If the descriptorIndexing feature is supported, or if the VK_EXT_descriptor_indexing extension is supported: ◦ shaderSampledImageArrayDynamicIndexing ◦ shaderStorageBufferArrayDynamicIndexing ◦ shaderUniformTexelBufferArrayDynamicIndexing ◦ shaderStorageTexelBufferArrayDynamicIndexing ◦ shaderSampledImageArrayNonUniformIndexing ◦ shaderStorageBufferArrayNonUniformIndexing ◦ shaderUniformTexelBufferArrayNonUniformIndexing ◦ descriptorBindingSampledImageUpdateAfterBind ◦ descriptorBindingStorageImageUpdateAfterBind ◦ descriptorBindingStorageBufferUpdateAfterBind (see also robustBufferAccessUpdateAfterBind) ◦descriptorBindingUniformTexelBufferUpdateAfterBind (see also robustBufferAccessUpdateAfterBind) ◦descriptorBindingStorageTexelBufferUpdateAfterBind (see also robustBufferAccessUpdateAfterBind) ◦ descriptorBindingUpdateUnusedWhilePending ◦ descriptorBindingPartiallyBound ◦ runtimeDescriptorArray • If Vulkan 1.3 is supported: ◦ vulkanMemoryModel ◦ vulkanMemoryModelDeviceScope • inlineUniformBlock, if Vulkan 1.3 or the VK_EXT_inline_uniform_block extension is supported. •descriptorBindingInlineUniformBlockUpdateAfterBind, if Vulkan 1.3 or the VK_EXT_inline_uniform_block extension is supported; and if the descriptorIndexing feature is supported, or the VK_EXT_descriptor_indexing extension is supported. • subgroupBroadcastDynamicId, if Vulkan 1.2 is supported. • subgroupSizeControl, if Vulkan 1.3 or the VK_EXT_subgroup_size_control extension is supported.computeFullSubgroups, if Vulkan 1.3 or the VK_EXT_subgroup_size_control extension is supported. • imagelessFramebuffer, if Vulkan 1.2 or the VK_KHR_imageless_framebuffer extension is supported. • separateDepthStencilLayouts, if Vulkan 1.2 or the VK_KHR_separate_depth_stencil_layouts extension is supported. • hostQueryReset, if Vulkan 1.2 or the VK_EXT_host_query_reset extension is supported. • timelineSemaphore, if Vulkan 1.2 or the VK_KHR_timeline_semaphore extension is supported. • pipelineCreationCacheControl, if Vulkan 1.3 or the VK_EXT_pipeline_creation_cache_control extension is supported. • shaderSubgroupExtendedTypes, if Vulkan 1.2 or the VK_KHR_shader_subgroup_extended_types extension is supported. • textureCompressionASTC_HDR, if the VK_EXT_texture_compression_astc_hdr extension is supported. • shaderDemoteToHelperInvocation, if Vulkan 1.3 or the VK_EXT_shader_demote_to_helper_invocation extension is supported. • texelBufferAlignment, if Vulkan 1.3 or the VK_EXT_texel_buffer_alignment extension is supported. • bufferDeviceAddress, if Vulkan 1.3 or the VK_KHR_buffer_device_address extension is supported. • shaderInt64, if the shaderSharedInt64Atomics or shaderBufferInt64Atomics features are supported. • storageBuffer16BitAccess, if uniformAndStorageBuffer16BitAccess is enabled. • robustImageAccess, if Vulkan 1.3 or the VK_EXT_image_robustness extension is supported. • shaderTerminateInvocation if Vulkan 1.3 or the VK_KHR_shader_terminate_invocation extension is supported. •shaderZeroInitializeWorkgroupMemory, if Vulkan 1.3 or the VK_KHR_zero_initialize_workgroup_memory extension is supported. • synchronization2 if Vulkan 1.3 or the VK_KHR_synchronization2 extension is supported. • shaderIntegerDotProduct if Vulkan 1.3 or the VK_KHR_shader_integer_dot_product extension is supported. • maintenance4, if Vulkan 1.3 or the VK_KHR_maintenance4 extension is supported. • privateData, if Vulkan 1.3 or the VK_EXT_private_data extension is supported. • dynamicRendering, if Vulkan 1.3 or the VK_KHR_dynamic_rendering extension is supported.

All other features defined in the Specification are optional.

Profile Features

Roadmap 2022

Implementations that claim support for the Roadmap 2022 profile must support the following features:

fullDrawIndexUint32 • imageCubeArray independentBlend • sampleRateShading • drawIndirectFirstInstance • depthClamp • depthBiasClamp • samplerAnisotropy • occlusionQueryPrecise • fragmentStoresAndAtomics • shaderStorageImageExtendedFormats • shaderUniformBufferArrayDynamicIndexing • shaderSampledImageArrayDynamicIndexing • shaderStorageBufferArrayDynamicIndexing • shaderStorageImageArrayDynamicIndexing • samplerYcbcrConversion • samplerMirrorClampToEdge • descriptorIndexing • shaderUniformTexelBufferArrayDynamicIndexing • shaderStorageTexelBufferArrayDynamicIndexing • shaderUniformBufferArrayNonUniformIndexing • shaderSampledImageArrayNonUniformIndexing • shaderStorageBufferArrayNonUniformIndexing • shaderStorageImageArrayNonUniformIndexing • shaderUniformTexelBufferArrayNonUniformIndexing • shaderStorageTexelBufferArrayNonUniformIndexing • descriptorBindingSampledImageUpdateAfterBind • descriptorBindingStorageImageUpdateAfterBind • descriptorBindingStorageBufferUpdateAfterBind • descriptorBindingUniformTexelBufferUpdateAfterBind • descriptorBindingStorageTexelBufferUpdateAfterBind • descriptorBindingUpdateUnusedWhilePending • descriptorBindingPartiallyBound • descriptorBindingVariableDescriptorCount • runtimeDescriptorArray • scalarBlockLayout

本节教程就到此结束,希望大家继续阅读我之后的教程。

谢谢大家,再见!


原创技术文章,撰写不易,转载请注明出处:电子设备中的画家|王烁 于 2021 年 5 月 10 日发表,原文链接(http://geekfaner.com/shineengine/blog20_Vulkanv1.2_6.html)