VK_EXT_primitive_restart_index.proposal
This document proposes adding support for setting the index for primitive restart.
Problem Statement
Other graphics APIs, such as OpenGL, provide functionality for arbitrarily setting the primitive restart index. When performing similar operations in Vulkan, this functionality may be emulated, but many implementations are capable of handling it at the execution level to avoid needing alternative solutions.
This proposal aims to provide this functionality.
Solution Space
This functionality could alternatively be emulated with:
- Direct host readback of the index buffer to rewrite indices
- Compute shaders to rewrite the index buffer
For implementations which can trivially support a custom primitive restart index, however, this generates additional and unnecessary hardware load.
Proposal
API Features
The following features are exposed by this extension:
typedef struct VkPhysicalDevicePrimitiveRestartIndexFeaturesEXT {
VkStructureType sType;
void* pNext;
VkBool32 primitiveRestartIndex;
} VkPhysicalDevicePrimitiveRestartIndexFeaturesEXT;
primitiveRestartIndex is the core feature enabling this extension’s functionality.
API Functions
Enabling this extension allows calling vkCmdSetPrimitiveRestartIndexEXT to set a custom index.
void vkCmdSetPrimitiveRestartIndexEXT(VkCommandBuffer commandBuffer, uint32_t primitiveRestartIndex)
Binding an index buffer resets the index.
Issues
No known issues.