Specifying a pipeline vertex binding description, attribute description, and input state
When we want to draw a geometry, we prepare vertices along with their additional attributes like normal vectors, colors, or texture coordinates. Such vertex data is chosen arbitrarily by us, so for the hardware to properly use them, we need to specify how many attributes there are, how are they laid out in memory, or where are they taken from. This information is provided through the vertex binding description and attribute description required to create a graphics pipeline.
How to do it...
- Create a
std::vector
variable namedbinding_descriptions
with elements of typeVkVertexInputBindingDescription
. - Add a separate entry to the
binding_descriptions
vector for each vertex binding (part of a buffer bound to a command buffer as a vertex buffer) used in a given pipeline. Use the following values to initialize its members:- The index of a binding (number which it represents) for
binding
- The number of bytes between...
- The index of a binding (number which it represents) for