0
$\begingroup$

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

$\endgroup$
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$
1
  • $\begingroup$ Thank you, you are a real help. $\endgroup$
    – Cerberus
    Jun 2 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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