Skip to content
Snippets Groups Projects
Commit 6a24a53b authored by Alex Laptop's avatar Alex Laptop
Browse files

[#105] Fix vertex offsets

parent 96a88403
No related branches found
No related tags found
1 merge request!88Resolve "Indirect Draw"
Pipeline #27239 passed
......@@ -64,6 +64,7 @@ void addMeshToIndirectDraw(const vkcv::asset::Scene &scene,
std::vector<uint8_t> &compiledIndexBuffer,
std::vector<vk::DrawIndexedIndirectCommand> &indexedIndirectCommands)
{
uint32_t vertexOffset = 0;
for (const auto &mesh : scene.meshes)
{
for(auto &vertexGroupIndex : mesh.vertexGroups)
......@@ -73,9 +74,11 @@ void addMeshToIndirectDraw(const vkcv::asset::Scene &scene,
indexedIndirectCommands.emplace_back(static_cast<uint32_t>(vertexGroup.numIndices),
1,
static_cast<uint32_t>(compiledIndexBuffer.size() / 4),
0,
vertexOffset,
static_cast<uint32_t>(indexedIndirectCommands.size()));
vertexOffset += vertexGroup.numVertices;
compiledVertexBuffer.insert(compiledVertexBuffer.end(),
vertexGroup.vertexBuffer.data.begin(),
vertexGroup.vertexBuffer.data.end());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment