Is there any directX FVF(Flexible Vertex Format ) equivalent in OpenGL/Vulkan.
1 Answer
$\begingroup$
$\endgroup$
0
Vulkan uses vertex attributes. Here is an example:
const VkVertexInputAttributeDescription vertexAttributes[] = {
// location, binding, format, offset
{ 0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0 }, // inPosition
{ 1, 0, VK_FORMAT_R32G32B32_SFLOAT, 12 }, // inNormal
{ 2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, 24 }, // inTangent
{ 3, 0, VK_FORMAT_R32G32_SFLOAT, 40 }, // inTexCoord
};
And a description:
const VkVertexInputBindingDescription vertexInputBindings[] = {
// binding, stride, inputRate
{ 0, 48, VK_VERTEX_INPUT_RATE_VERTEX}
};