#include "vulkan/vertex.hpp" VkVertexInputBindingDescription Vertex::getBindingDescription() { VkVertexInputBindingDescription bindingDescription {}; bindingDescription.binding = 0; bindingDescription.stride = sizeof(Vertex); bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX; return bindingDescription; } std::vector Vertex::getAttributeDescriptions() { std::vector attributeDescriptions(3); attributeDescriptions[0] = { .location = 0, .binding = 0, .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = offsetof(Vertex, position), }; attributeDescriptions[1] = { .location = 1, .binding = 0, .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = offsetof(Vertex, uv), }; attributeDescriptions[2] = { .location = 2, .binding = 0, .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = offsetof(Vertex, normal), }; return attributeDescriptions; }