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) { ...@@ -227,12 +227,7 @@ int main(int argc, const char** argv) {
// vertex layout for the pipeline. (assumed to be) used by all sponza meshes. // vertex layout for the pipeline. (assumed to be) used by all sponza meshes.
const std::vector<vkcv::VertexAttachment> vertexAttachments = sponzaProgram.getVertexAttachments(); const std::vector<vkcv::VertexAttachment> vertexAttachments = sponzaProgram.getVertexAttachments();
std::vector<vkcv::VertexBinding> bindings; const vkcv::VertexLayout sponzaVertexLayout({ vkcv::VertexBinding(0, { vertexAttachments }) });
for (size_t i = 0; i < vertexAttachments.size(); i++)
{
bindings.push_back(vkcv::VertexBinding(i, { vertexAttachments[i] }));
}
const vkcv::VertexLayout sponzaVertexLayout (bindings);
// recreation of VertexBufferBindings YET AGAIN, // recreation of VertexBufferBindings YET AGAIN,
// since these are used in the command buffer to bind and draw from the vertex shaders // 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) { ...@@ -247,7 +242,6 @@ int main(int argc, const char** argv) {
compiledIndexBuffer, compiledIndexBuffer,
indexedIndirectCommands); indexedIndirectCommands);
vkcv::Buffer<vk::DrawIndexedIndirectCommand> indirectBuffer = core.createBuffer<vk::DrawIndexedIndirectCommand>( vkcv::Buffer<vk::DrawIndexedIndirectCommand> indirectBuffer = core.createBuffer<vk::DrawIndexedIndirectCommand>(
vkcv::BufferType::INDIRECT, vkcv::BufferType::INDIRECT,
indexedIndirectCommands.size() * sizeof(vk::DrawIndexedIndirectCommand), indexedIndirectCommands.size() * sizeof(vk::DrawIndexedIndirectCommand),
......
...@@ -46,8 +46,8 @@ namespace vkcv { ...@@ -46,8 +46,8 @@ namespace vkcv {
uint32_t offset = 0; uint32_t offset = 0;
for (auto &attachment : vertexAttachments) for (auto &attachment : vertexAttachments)
{ {
offset += getFormatSize(attachment.format);
attachment.offset = offset; attachment.offset = offset;
offset += getFormatSize(attachment.format);
} }
stride = offset; stride = offset;
} }
......
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