SDEngine
Game Engine
Loading...
Searching...
No Matches
Vertex.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <VLA/Vector.hpp>
3
#include <vulkan/vulkan.hpp>
4
5
#include "
core/types.hpp
"
6
namespace
sd
{
7
8
struct
VertexPNUV
{
9
VLA::Vector3f
position
;
10
VLA::Vector3f
normal
;
11
VLA::Vector2f
uv
;
12
13
static
constexpr
std::array<vk::VertexInputBindingDescription, 1>
binding_descriptions
() {
14
return
{
15
{{.binding = 0, .stride =
sizeof
(
VertexPNUV
), .
inputRate
= vk::VertexInputRate::eVertex}}};
16
}
17
18
static
constexpr
std::array<vk::VertexInputAttributeDescription, 3>
attribute_descriptions
() {
19
return
{
20
{
21
{
22
.location = 0,
23
.binding = 0,
24
.format = vk::Format::eR32G32B32Sfloat,
25
.offset =
static_cast<
U32
>
(
offsetof
(
VertexPNUV
,
position
)),
26
}, {
27
.location = 1,
28
.binding = 0,
29
.format = vk::Format::eR32G32B32Sfloat,
30
.offset =
static_cast<
U32
>
(
offsetof
(
VertexPNUV
,
normal
)),
31
}, {
32
.location = 2,
33
.binding = 0,
34
.format = vk::Format::eR32G32Sfloat,
35
.offset =
static_cast<
U32
>
(
offsetof
(
VertexPNUV
,
uv
)),
36
}, }
37
};
38
};
39
};
40
}
// namespace sd
sd
Definition
Application.hpp:22
sd::VertexPNUV
Definition
Vertex.hpp:8
sd::VertexPNUV::attribute_descriptions
static constexpr std::array< vk::VertexInputAttributeDescription, 3 > attribute_descriptions()
Definition
Vertex.hpp:18
sd::VertexPNUV::uv
VLA::Vector2f uv
Definition
Vertex.hpp:11
sd::VertexPNUV::position
VLA::Vector3f position
Definition
Vertex.hpp:9
sd::VertexPNUV::normal
VLA::Vector3f normal
Definition
Vertex.hpp:10
sd::VertexPNUV::binding_descriptions
static constexpr std::array< vk::VertexInputBindingDescription, 1 > binding_descriptions()
Definition
Vertex.hpp:13
type_id_of
consteval U64 type_id_of()
Definition
type_id.hpp:6
types.hpp
U32
std::uint32_t U32
Definition
types.hpp:15
SD
include
SD
Vertex.hpp
Generated by
1.9.8