for (auto b : buffersToFill)
{
// Fill bytes surrounding vertex data with the offScreenVertex.
- fillWithPattern(*b, 0u, offset, &offScreenVertex, offScreenVertexSz);
- fillWithPattern(*b, offset + dataSize, extraSize, &offScreenVertex, offScreenVertexSz);
+ fillWithPattern(*b, 0u, offset, offScreenVertex.data(), offScreenVertexSz);
+ fillWithPattern(*b, offset + dataSize, extraSize, offScreenVertex.data(), offScreenVertexSz);
}
- copyAndFlush(vkd, device, vertBuffer, offset, vertices.data(), dataSize);
- copyAndFlush(vkd, device, rvertBuffer, offset, reversedVertices.data(), dataSize);
+ // Create vectors with all vertex data and all reversed vertex data concatenated in order to fill the buffers.
+ const auto vertices = concatenateVertexData(vertexRawPtrs);
+ const auto reversedVertices = concatenateVertexData(reversedVertexRawPtrs);
+
+ copyAndFlush(vkd, device, vertBuffer, offset, vertices.data(), static_cast<size_t>(vertices.size() * sizeof(vertices[0])));
+ copyAndFlush(vkd, device, rvertBuffer, offset, reversedVertices.data(), static_cast<size_t>(reversedVertices.size() * sizeof(reversedVertices[0])));
}
// Descriptor set layout.