yes
This commit is contained in:
41
Runtime/Includes/Renderer/Vertex.inl
git.filemode.normal_file
41
Runtime/Includes/Renderer/Vertex.inl
git.filemode.normal_file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <Renderer/Vertex.h>
|
||||
|
||||
namespace Scop
|
||||
{
|
||||
VkVertexInputBindingDescription Vertex::GetBindingDescription()
|
||||
{
|
||||
VkVertexInputBindingDescription binding_description{};
|
||||
binding_description.binding = 0;
|
||||
binding_description.stride = sizeof(Vertex);
|
||||
binding_description.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
|
||||
return binding_description;
|
||||
}
|
||||
|
||||
std::array<VkVertexInputAttributeDescription, 4> Vertex::GetAttributeDescriptions()
|
||||
{
|
||||
std::array<VkVertexInputAttributeDescription, 4> attribute_descriptions;
|
||||
|
||||
attribute_descriptions[0].binding = 0;
|
||||
attribute_descriptions[0].location = 0;
|
||||
attribute_descriptions[0].format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
attribute_descriptions[0].offset = offsetof(Vertex, position);
|
||||
|
||||
attribute_descriptions[1].binding = 0;
|
||||
attribute_descriptions[1].location = 1;
|
||||
attribute_descriptions[1].format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
attribute_descriptions[1].offset = offsetof(Vertex, color);
|
||||
|
||||
attribute_descriptions[2].binding = 0;
|
||||
attribute_descriptions[2].location = 2;
|
||||
attribute_descriptions[2].format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
attribute_descriptions[2].offset = offsetof(Vertex, normal);
|
||||
|
||||
attribute_descriptions[3].binding = 0;
|
||||
attribute_descriptions[3].location = 3;
|
||||
attribute_descriptions[3].format = VK_FORMAT_R32G32_SFLOAT;
|
||||
attribute_descriptions[3].offset = offsetof(Vertex, uv);
|
||||
|
||||
return attribute_descriptions;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user