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

[#105] Sort out (some) of the vertex mess

parent b01d37c7
No related branches found
No related tags found
1 merge request!88Resolve "Indirect Draw"
......@@ -227,12 +227,7 @@ int main(int argc, const char** argv) {
// vertex layout for the pipeline. (assumed to be) used by all sponza meshes.
const std::vector<vkcv::VertexAttachment> vertexAttachments = sponzaProgram.getVertexAttachments();
std::vector<vkcv::VertexBinding> bindings;
for (size_t i = 0; i < vertexAttachments.size(); i++)
{
bindings.push_back(vkcv::VertexBinding(i, { vertexAttachments[i] }));
}
const vkcv::VertexLayout sponzaVertexLayout (bindings);
const vkcv::VertexLayout sponzaVertexLayout({ vkcv::VertexBinding(0, { vertexAttachments }) });
// recreation of VertexBufferBindings YET AGAIN,
// since these are used in the command buffer to bind and draw from the vertex shaders
......@@ -247,7 +242,6 @@ int main(int argc, const char** argv) {
compiledIndexBuffer,
indexedIndirectCommands);
vkcv::Buffer<vk::DrawIndexedIndirectCommand> indirectBuffer = core.createBuffer<vk::DrawIndexedIndirectCommand>(
vkcv::BufferType::INDIRECT,
indexedIndirectCommands.size() * sizeof(vk::DrawIndexedIndirectCommand),
......
......@@ -46,8 +46,8 @@ namespace vkcv {
uint32_t offset = 0;
for (auto &attachment : vertexAttachments)
{
offset += getFormatSize(attachment.format);
attachment.offset = offset;
offset += getFormatSize(attachment.format);
}
stride = offset;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment