summaryrefslogtreecommitdiff
path: root/include/shader.h
blob: b34fd9231de9c13a043033e7fd5d79333e946cb8 (plain) (blame)
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
38
39
#pragma once
#include <cstdint>
#include <cstdlib>
#include <string>
#include <string_view>
#include <vector>

namespace iris {

struct ShaderDesc {
    // Name of the shader, filename if loaded from file
    std::string name;
    // Source code of the shader
    std::string source;
    // Entry name of the shader
    std::string entry_point;

    // Shader type
    enum struct Type {
        eRayGen,
        eMiss,
        eClosestHit,
        eAnyHit,
        eIntersection,
        eCallable,
        eCompute,
    } type;

    // Compiled binary
    std::vector<uint32_t> compiled_binary;

    static Type shader_type_from_string(std::string_view type);
    ShaderDesc(
        const std::string_view path,
        std::vector<std::string> defines,
        std::vector<std::pair<std::string, std::string>> valued_defines);
};

} // namespace iris