28 VkVertexInputBindingDescription bindingDescription = {};
29 bindingDescription.binding = 0;
30 bindingDescription.stride =
sizeof(
Vertex);
31 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
33 return bindingDescription;
39 std::array<VkVertexInputAttributeDescription, 5> attributeDescriptions = {};
41 attributeDescriptions[0].binding = 0;
42 attributeDescriptions[0].location = 0;
43 attributeDescriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT;
44 attributeDescriptions[0].offset = offsetof(
Vertex,
Pos);
46 attributeDescriptions[1].binding = 0;
47 attributeDescriptions[1].location = 1;
48 attributeDescriptions[1].format = VK_FORMAT_R32G32B32_SFLOAT;
49 attributeDescriptions[1].offset = offsetof(
Vertex,
Color);
51 attributeDescriptions[2].binding = 0;
52 attributeDescriptions[2].location = 2;
53 attributeDescriptions[2].format = VK_FORMAT_R32G32B32_SFLOAT;
56 attributeDescriptions[3].binding = 0;
57 attributeDescriptions[3].location = 3;
58 attributeDescriptions[3].format = VK_FORMAT_R32G32B32_SFLOAT;
59 attributeDescriptions[3].offset = offsetof(
Vertex,
Normal);
61 attributeDescriptions[4].binding = 0;
62 attributeDescriptions[4].location = 4;
63 attributeDescriptions[4].format = VK_FORMAT_R32G32_SFLOAT;
66 return attributeDescriptions;
76 template<>
struct hash<
Fling::Vertex>
80 return ((hash<glm::vec3>()(vertex.
Pos) ^
81 (hash<glm::vec3>()(vertex.
Color) << 1)) >> 1) ^
82 (hash<glm::vec2>()(vertex.
TexCoord) << 1);
glm::vec2 TexCoord
Definition: Vertex.h:16
Basic Vertex outline for use with our vertex buffers.
Definition: Vertex.h:10
static VkVertexInputBindingDescription GetBindingDescription()
Gets the shader binding of a vertex.
Definition: Vertex.h:26
glm::vec3 Normal
Definition: Vertex.h:15
glm::vec3 Pos
Definition: Vertex.h:12
bool operator==(const Vertex &other) const
Definition: Vertex.h:18
glm::vec3 Color
Definition: Vertex.h:13
static std::array< VkVertexInputAttributeDescription, 5 > GetAttributeDescriptions()
Definition: Vertex.h:37
glm::vec3 Tangent
Definition: Vertex.h:14
size_t operator()(Fling::Vertex const &vertex) const
Definition: Vertex.h:78