#pragma once #include std::vector VertexInfo::create_descs() const { std::vector ret; unsigned i = 0; uint32_t offset = 0; for (const auto& component : components) { ret.push_back( vk::VertexInputAttributeDescription { .location = (component.location == -1) ? i : component.location, .binding = 0, .format = static_cast(component.type), .offset = (component.offset == -1) ? offset : component.offset, } ); i++; offset += component.size(); } return ret; }