Modulevulkan-3.27GHC2021
Vulkan.Extensions.VK_EXT_vertex_attribute_divisor
Name
VK_EXT_vertex_attribute_divisor - device extension
VK_EXT_vertex_attribute_divisor
- Name String
VK_EXT_vertex_attribute_divisor
- Extension Type
Device extension
- Registered Extension Number
191
- Revision
3
- Ratification Status
Not ratified
- Extension and Version Dependencies
VK_KHR_get_physical_device_properties2
or
- Deprecation State
Promoted to VK_KHR_vertex_attribute_divisor extension
Which in turn was promoted to Vulkan 1.4
- Contact
Other Extension Metadata
- Last Modified Date
2018-08-03
- IP Status
No known IP claims.
- Contributors
Vikram Kushwaha, NVIDIA
Faith Ekstrand, Intel
Description
This extension allows instance-rate vertex attributes to be repeated for certain number of instances instead of advancing for every instance when instanced rendering is enabled.
New Structures
Extending PhysicalDeviceFeatures2, DeviceCreateInfo:
Extending PhysicalDeviceProperties2:
Extending PipelineVertexInputStateCreateInfo:
New Enum Constants
Extending StructureType:
Issues
1) What is the effect of a non-zero value for firstInstance?
RESOLVED: The Vulkan API should follow the OpenGL convention and
offset attribute fetching by firstInstance while computing vertex
attribute offsets.
2) Should zero be an allowed divisor?
RESOLVED: Yes. A zero divisor means the vertex attribute is repeated for all instances.
Examples
To create a vertex binding such that the first binding uses instanced rendering and the same attribute is used for every 4 draw instances, an application could use the following set of structures:
const VkVertexInputBindingDivisorDescriptionEXT divisorDesc =
{
.binding = 0,
.divisor = 4
};
const VkPipelineVertexInputDivisorStateCreateInfoEXT divisorInfo =
{
.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT,
.pNext = NULL,
.vertexBindingDivisorCount = 1,
.pVertexBindingDivisors = &divisorDesc
}
const VkVertexInputBindingDescription binding =
{
.binding = 0,
.stride = sizeof(Vertex),
.inputRate = VK_VERTEX_INPUT_RATE_INSTANCE
};
const VkPipelineVertexInputStateCreateInfo viInfo =
{
.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_CREATE_INFO,
.pNext = &divisorInfo,
...
};
//...Version History
Revision 1, 2017-12-04 (Vikram Kushwaha)
First Version
Revision 2, 2018-07-16 (Faith Ekstrand)
Adjust the interaction between
divisorandfirstInstanceto match the OpenGL convention.Disallow divisors of zero.
Revision 3, 2018-08-03 (Vikram Kushwaha)
Allow a zero divisor.
Add a physical device features structure to query/enable this feature.
See Also
No cross-references are available
Document Notes
For more information, see the Vulkan Specification.
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
- 6 types
- Packagevulkan-3.27
- Exports10
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceVK_EXT_vertex_attribute_divisor.hs
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT - Structure describing max value of vertex attribute divisor that can be supported by an implementation
Description
If the PhysicalDeviceVertexAttributeDivisorPropertiesEXT structure is
included in the pNext chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2,
it is filled in with each corresponding implementation-dependent
property.
Structure Chaining
See Also
Constructors
PhysicalDeviceVertexAttributeDivisorPropertiesEXTmaxVertexAttribDivisor :: Word32maxVertexAttribDivisoris the maximum value of the number of instances that will repeat the value of vertex attribute data when instanced rendering is enabled.
Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
Eq PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisorShow PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisorStorable PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisorFromCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisorToCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisorZero PhysicalDeviceVertexAttributeDivisorPropertiesEXTDefined in vulkan-3.27 · Vulkan.Extensions.VK_EXT_vertex_attribute_divisor