| 70 | }; |
| 71 | |
| 72 | struct Vertex { |
| 73 | glm::vec2 pos; |
| 74 | glm::vec3 color; |
| 75 | |
| 76 | static VkVertexInputBindingDescription getBindingDescription() { |
| 77 | VkVertexInputBindingDescription bindingDescription{}; |
| 78 | bindingDescription.binding = 0; |
| 79 | bindingDescription.stride = sizeof(Vertex); |
| 80 | bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX; |
| 81 | |
| 82 | return bindingDescription; |
| 83 | } |
| 84 | |
| 85 | static std::array<VkVertexInputAttributeDescription, 2> getAttributeDescriptions() { |
| 86 | std::array<VkVertexInputAttributeDescription, 2> attributeDescriptions{}; |
| 87 | |
| 88 | attributeDescriptions[0].binding = 0; |
| 89 | attributeDescriptions[0].location = 0; |
| 90 | attributeDescriptions[0].format = VK_FORMAT_R32G32_SFLOAT; |
| 91 | attributeDescriptions[0].offset = offsetof(Vertex, pos); |
| 92 | |
| 93 | attributeDescriptions[1].binding = 0; |
| 94 | attributeDescriptions[1].location = 1; |
| 95 | attributeDescriptions[1].format = VK_FORMAT_R32G32B32_SFLOAT; |
| 96 | attributeDescriptions[1].offset = offsetof(Vertex, color); |
| 97 | |
| 98 | return attributeDescriptions; |
| 99 | } |
| 100 | }; |
| 101 | |
| 102 | struct UniformBufferObject { |
| 103 | glm::mat4 model; |
nothing calls this directly
no outgoing calls
no test coverage detected