30 glm::vec2 _position{0.0f, 0.0f};
31 uint32_t _color{std::numeric_limits<uint32_t>::max()};
32 glm::vec2 _texCoords{0.0f, 0.0f};
34 static VkVertexInputBindingDescription getBindingDescription()
36 VkVertexInputBindingDescription bindingDescription{};
37 bindingDescription.binding = 0;
38 bindingDescription.stride =
sizeof(
Vertex);
39 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
41 return bindingDescription;
44 static std::array<VkVertexInputAttributeDescription, 3> getAttributeDescriptions()
46 std::array<VkVertexInputAttributeDescription, 3> attributeDescriptions{};
48 attributeDescriptions[0].binding = 0;
49 attributeDescriptions[0].location = 0;
50 attributeDescriptions[0].format = VK_FORMAT_R32G32_SFLOAT;
51 attributeDescriptions[0].offset = offsetof(
Vertex, _position);
53 attributeDescriptions[1].binding = 0;
54 attributeDescriptions[1].location = 1;
55 attributeDescriptions[1].format = VK_FORMAT_R8G8B8A8_UINT;
56 attributeDescriptions[1].offset = offsetof(
Vertex, _color);
58 attributeDescriptions[2].binding = 0;
59 attributeDescriptions[2].location = 2;
60 attributeDescriptions[2].format = VK_FORMAT_R32G32_SFLOAT;
61 attributeDescriptions[2].offset = offsetof(
Vertex, _texCoords);
63 return attributeDescriptions;