vulkan-3.8.1: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Description

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
Extension and Version Dependencies
  • Requires Vulkan 1.0
  • Requires VK_KHR_get_physical_device_properties2
Contact

Other Extension Metadata

Last Modified Date
2018-08-03
IP Status
No known IP claims.
Contributors
  • Vikram Kushwaha, NVIDIA
  • Jason 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

New Enum Constants

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 =
    {
        0,
        4
    };

    const VkPipelineVertexInputDivisorStateCreateInfoEXT divisorInfo =
    {
        VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT, // sType
        NULL,                                                             // pNext
        1,                                                                // vertexBindingDivisorCount
        &divisorDesc                                                      // pVertexBindingDivisors
    }

    const VkVertexInputBindingDescription binding =
    {
        0,                                                                // binding
        sizeof(Vertex),                                                   // stride
        VK_VERTEX_INPUT_RATE_INSTANCE                                     // inputRate
    };

    const VkPipelineVertexInputStateCreateInfo viInfo =
    {
        VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_CREATE_INFO,              // sType
        &divisorInfo,                                                     // pNext
        ...
    };
    //...

Version History

  • Revision 1, 2017-12-04 (Vikram Kushwaha)

    • First Version
  • Revision 2, 2018-07-16 (Jason Ekstrand)

    • Adjust the interaction between divisor and firstInstance to 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

PhysicalDeviceVertexAttributeDivisorFeaturesEXT, PhysicalDeviceVertexAttributeDivisorPropertiesEXT, PipelineVertexInputDivisorStateCreateInfoEXT, VertexInputBindingDivisorDescriptionEXT

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.

Synopsis

Documentation

data VertexInputBindingDivisorDescriptionEXT Source #

VkVertexInputBindingDivisorDescriptionEXT - Structure specifying a divisor used in instanced rendering

Description

If this structure is not used to define a divisor value for an attribute then the divisor has a logical default value of 1.

Valid Usage

See Also

PipelineVertexInputDivisorStateCreateInfoEXT

Constructors

VertexInputBindingDivisorDescriptionEXT 

Fields

  • binding :: Word32

    binding is the binding number for which the divisor is specified.

  • divisor :: Word32

    divisor is the number of successive instances that will use the same value of the vertex attribute when instanced rendering is enabled. For example, if the divisor is N, the same vertex attribute will be applied to N successive instances before moving on to the next vertex attribute. The maximum value of divisor is implementation dependent and can be queried using PhysicalDeviceVertexAttributeDivisorPropertiesEXT::maxVertexAttribDivisor. A value of 0 can be used for the divisor if the vertexAttributeInstanceRateZeroDivisor feature is enabled. In this case, the same vertex attribute will be applied to all instances.

Instances

Instances details
Eq VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Show VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Storable VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

FromCStruct VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

ToCStruct VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Zero VertexInputBindingDivisorDescriptionEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

data PipelineVertexInputDivisorStateCreateInfoEXT Source #

VkPipelineVertexInputDivisorStateCreateInfoEXT - Structure specifying vertex attributes assignment during instanced rendering

Valid Usage (Implicit)

See Also

StructureType, VertexInputBindingDivisorDescriptionEXT

Constructors

PipelineVertexInputDivisorStateCreateInfoEXT 

Fields

Instances

Instances details
Show PipelineVertexInputDivisorStateCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

FromCStruct PipelineVertexInputDivisorStateCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

ToCStruct PipelineVertexInputDivisorStateCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Zero PipelineVertexInputDivisorStateCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

data PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source #

VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT - Structure describing max value of vertex attribute divisor that can be supported by an implementation

Members

The members of the PhysicalDeviceVertexAttributeDivisorPropertiesEXT structure describe the following implementation-dependent limits:

Description

If the PhysicalDeviceVertexAttributeDivisorPropertiesEXT structure is included in the pNext chain of PhysicalDeviceProperties2, it is filled with the implementation-dependent limits.

Valid Usage (Implicit)

See Also

StructureType

Constructors

PhysicalDeviceVertexAttributeDivisorPropertiesEXT 

Fields

  • maxVertexAttribDivisor :: Word32

    maxVertexAttribDivisor is the maximum value of the number of instances that will repeat the value of vertex attribute data when instanced rendering is enabled.

Instances

Instances details
Eq PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Show PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Storable PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

FromCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

ToCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Zero PhysicalDeviceVertexAttributeDivisorPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

data PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source #

VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT - Structure describing if fetching of vertex attribute may be repeated for instanced rendering

Description

If the PhysicalDeviceVertexAttributeDivisorFeaturesEXT structure is included in the pNext chain of PhysicalDeviceFeatures2, it is filled with values indicating the implementation-dependent behavior. PhysicalDeviceVertexAttributeDivisorFeaturesEXT can also be included in pNext chain of DeviceCreateInfo to enable the feature.

Valid Usage (Implicit)

See Also

Bool32, StructureType

Constructors

PhysicalDeviceVertexAttributeDivisorFeaturesEXT 

Fields

Instances

Instances details
Eq PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Show PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Storable PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

FromCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

ToCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

Zero PhysicalDeviceVertexAttributeDivisorFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_vertex_attribute_divisor

type EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME = "VK_EXT_vertex_attribute_divisor" Source #