MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / Vertex

Class Vertex

code/22_descriptor_set_layout.cpp:72–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70};
71
72struct 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
102struct UniformBufferObject {
103 glm::mat4 model;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected