Proposal Template
This proposal details and addresses the issues solved by the VK_KHR_maintenance9 extension.
1. Problem Statement
Over time, a collection of minor features, none of which would warrant an entire extension of their own, requires the creation of a maintenance extension.
The following is a list of issues considered in this proposal:
-
Support VkDevice with no queues. These can be used as effectively an offline compiler to prepopulate pipeline caches, without expensive queue creation or internal memory allocations.
-
Allow
vkCmdSetEvent2to not provide a dependency, providingvkCmdSetEvent-style usage using enums fromVK_KHR_synchronization2 -
Add a
VK_QUERY_POOL_CREATE_RESET_BIT_KHRflag to create a query pool with all queries initialized to the reset state. -
Allow any integer bit width for specific bit-wise operations.
-
Add a property to enable sparse support with
VK_EXT_image_2d_view_of_3d. -
Add a property to indicate the implementation will return (0,0,0,0) or (0,0,0,1) to vertex shaders that read unassigned attributes.
-
The effects of image memory barriers and image layout transitions on 3D images created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT are scoped to the slices specified by the user-provided VkImageSubresourceRange.
-
Queue family ownership transfers are no longer required for buffers and linear images, and a new physical device queue family property is exposed to indicate whether queue family ownership transfers are required for optimal images.
2. Issue Details and Solution Space
2.1. 2D Views of 3D Sparse Images
GL does not provide any limitation on binding 3D slices of sparse images to 2D images. A property is added to enable drivers to advertise whether this functionality is supported.
2.2. vkCmdSetEvent2 Without Dependencies
In some applications, the eventual memory barrier that is needed for synchronizing access to a resource can only be determined at vkCmdWaitEvents2-time.
Applications can use vkCmdSetEvent and vkCmdWaitEvents in that case, but they would not be allowed to use the more expressive stage and access masks introduced by VK_KHR_synchronization2.
2.3. Barriers with 2D array compatible 3D images
Until now, it has not been possible to independently transition the layouts of subsets of slices of 3D images created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT.
When this extension’s functionality is enabled, applications are able to perform image memory barriers and image layout transitions on arbitrary subsets of slices of 3D images by specifying the base slice and slice count using the baseArrayLayer and layerCount members of VkImageSubresourceRange.
3. Proposal
3.1. New features
The following features are exposed:
typedef struct VkPhysicalDeviceMaintenance9FeaturesKHR {
VkStructureType sType;
void* pNext;
VkBool32 maintenance9;
} VkPhysicalDeviceMaintenance9FeaturesKHR;
-
The
maintenance9feature indicates support for theVK_KHR_maintenance9extension.
3.2. New properties
The following properties are added by this extension:
typedef struct VkPhysicalDeviceMaintenance9PropertiesKHR {
VkStructureType sType;
void* pNext;
VkBool32 image2DViewOf3DSparse;
VkDefaultVertexAttributeValueKHR defaultVertexAttributeValue;
} VkPhysicalDeviceMaintenance9PropertiesKHR;
-
If
VK_EXT_image_2d_view_of_3dis enabled,image2DViewOf3DSparseindicates whether the implementation supports binding a slice of a sparse 3D image to a 2D image view. -
defaultVertexAttributeValueis the value returned by the implementation when the vertex shader reads an unbound vertex attribute.
typedef enum VkDefaultVertexAttributeValueKHR {
VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHR,
VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ONE_KHR,
} VkDefaultVertexAttributeValueKHR;
-
VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHRindicates that the value read for an unbound vertex attribute is (0,0,0,0). -
VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ONE_KHRindicates that the value read for an unbound vertex attribute is (0,0,0,1).
3.3. vkCmdSetEvent2 Without Dependencies
A new VkDependencyFlagBits flag is added to allow vkCmdSetEvent2 to specify nothing more than the event signal stage (similar to vkCmdSetEvent), and for vkCmdWaitEvents2 to specify the complete barrier.
VK_DEPENDENCY_ASYMMETRIC_EVENT_BIT_KHR = 0x00000040
When set on pDependencyInfo→dependencyFlags in vkCmdSetEvent2, pDependencyInfo→bufferMemoryBarrierCount and pDependencyInfo→imageMemoryBarrierCount must be 0, and pDependencyInfo→memoryBarrierCount must be 1.
The signal stage must be placed in pDependencyInfo→pMemoryBarriers[0].srcStageMask, where srcAccessMask, dstStageMask, and dstAccessMask are 0.
When set on pDependencyInfo→dependencyFlags in vkCmdWaitEvents2, it signifies that vkCmdSetEvent2 did not include the complete dependency.
The only restriction is that the set of all stage masks specified in srcStageMask fields of all elements of pDependencyInfo→pMemoryBarriers, pDependencyInfo→pBufferMemoryBarriers, and pDependencyInfo→pImageMemoryBarriers must be equal to stages specified in the vkCmdSetEvent2 call.