diff options
author | Chuyan Zhang <chuyan@ucsb.edu> | 2024-10-09 22:11:24 -0700 |
---|---|---|
committer | Chuyan Zhang <chuyan@ucsb.edu> | 2024-10-09 22:11:24 -0700 |
commit | d25c392cec57e8c561899bf75668da79c4e67aed (patch) | |
tree | 4289461c83345024a5a1b93295043d61d4acd246 /src/shader.h | |
parent | 60b9692af28a353c4e5813d1723422477e31f433 (diff) | |
download | iris-d25c392cec57e8c561899bf75668da79c4e67aed.tar.gz iris-d25c392cec57e8c561899bf75668da79c4e67aed.zip |
add shader compile infra
Diffstat (limited to 'src/shader.h')
-rw-r--r-- | src/shader.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/shader.h b/src/shader.h new file mode 100644 index 0000000..b1be8a8 --- /dev/null +++ b/src/shader.h @@ -0,0 +1,33 @@ +#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; + + // Shader type + enum struct Type { + eRayGen, + eMiss, + eClosestHit, + eAnyHit, + eIntersection, + 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); +}; + +} // namespace iris
\ No newline at end of file |