Skip to content
Snippets Groups Projects
Verified Commit 8363c9c1 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#105] Fixed attribute order by sorting

parent 23576685
No related branches found
No related tags found
1 merge request!88Resolve "Indirect Draw"
Pipeline #27479 passed
......@@ -93,6 +93,13 @@ void interleaveScene(vkcv::asset::Scene scene,
{
for(auto vertexGroupIndex : mesh.vertexGroups)
{
// Sort attributes to fix it!
auto& attributes = scene.vertexGroups[vertexGroupIndex].vertexBuffer.attributes;
std::sort(attributes.begin(), attributes.end(), [](const vkcv::asset::VertexAttribute& x, const vkcv::asset::VertexAttribute& y) {
return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type);
});
const auto &vertexGroup = scene.vertexGroups[vertexGroupIndex];
const vkcv::asset::VertexAttribute positionAttribute = vertexGroup.vertexBuffer.attributes[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment