0
$\begingroup$

Is there any directX FVF(Flexible Vertex Format ) equivalent in OpenGL/Vulkan.

$\endgroup$

1 Answer 1

2
$\begingroup$

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} 
};
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.