VertexLayout.hpp 804 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <unordered_map>
#include <vector>
#include <iostream>

namespace vkcv{
    enum class VertexFormat{
        FLOAT,
        FLOAT2,
        FLOAT3,
        FLOAT4,
        INT,
        INT2,
        INT3,
        INT4
    };

    struct VertexInputAttachment{
        VertexInputAttachment() = delete;
        VertexInputAttachment(uint32_t location, uint32_t binding, VertexFormat format, uint32_t offset) noexcept;

        uint32_t location;
        uint32_t binding;
        VertexFormat format;
        uint32_t offset;
    };

    struct VertexLayout{
        VertexLayout() noexcept;
        VertexLayout(const std::vector<VertexInputAttachment> &inputs) noexcept;
        std::unordered_map<uint32_t, VertexInputAttachment> attachmentMap;
        uint32_t stride;
    };


}