What is the best way to change the vertex stride between draw call in Vulkan

413 Views Asked by At

I am trying to create Vulkan support for my DX12 GameEngine, however, I've run into a problem and am not sure how to solve it.

I have two kinds of meshes: a regular mesh which contains vertex position, texcoord, normal... and the other which extends it and also continues armature contact data like bones_ids and weights.

In DirectX 12 you have the gpu-command ID3D12GraphicsCommandList::IASetVertexBuffers which also allows you to change the vertex buffer stride dynamically before every mesh's draw commands. However, in my understanding of Vulkan you should define the vertex stride explicitly at the pipeline creation time, or add a appropriate dynamic state element VK_DYNAMIC_STATE_VERTEX_INPUT_EXT to change dynamically the entire vertex input layer.

Thus, is there a way to change dynamically only the vertex stride without changing all of the vertex input? Perhaps the right way is to create to pipeline state for each kind of mesh?

0

There are 0 best solutions below