Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_rtshadercollection.hpp
Go to the documentation of this file.
1#pragma once
2#include "../core/foray_shadermodule.hpp"
4#include <unordered_map>
5#include <vector>
6
7namespace foray::rtpipe {
8
11 {
12 public:
16 void Add(core::ShaderModule* module, RtShaderType type, const char* entryPointName = "main");
18 void Clear();
20 uint32_t IndexOf(core::ShaderModule* module) const;
21
22 FORAY_GETTER_R(ShaderStageCis)
23
24 protected:
25 struct Entry
26 {
29 const char* EntryPointName = nullptr;
30 uint32_t StageCiIndex = VK_SHADER_UNUSED_KHR;
31 };
32
33 std::unordered_map<core::ShaderModule*, Entry> mEntries;
34 std::vector<VkPipelineShaderStageCreateInfo> mShaderStageCis;
35 };
36} // namespace foray::rtpipe
Wraps shader code driver handle (VkShaderModule). See ShaderManager for compiling shaders dynamically...
Definition foray_shadermodule.hpp:11
Helper class to manage unique Rt ShaderModules.
Definition foray_rtshadercollection.hpp:11
std::vector< VkPipelineShaderStageCreateInfo > mShaderStageCis
Definition foray_rtshadercollection.hpp:34
uint32_t IndexOf(core::ShaderModule *module) const
Get index of a module in the ShaderStageCi vector.
void Add(core::ShaderModule *module, RtShaderType type, const char *entryPointName="main")
Add a shadermodule. If a new module, also adds an entry to the ShaderStageCi vector.
std::unordered_map< core::ShaderModule *, Entry > mEntries
Definition foray_rtshadercollection.hpp:33
#define FORAY_GETTER_R(member)
Shorthand for mutable & constant reference getters.
Definition foray_basics.hpp:75
Definition foray_basesbt.hpp:9
RtShaderType
Shader types used in Raytracing.
Definition foray_rtshadertypes.hpp:9
Definition foray_rtshadercollection.hpp:26
core::ShaderModule * Module
Definition foray_rtshadercollection.hpp:27
uint32_t StageCiIndex
Definition foray_rtshadercollection.hpp:30
RtShaderType Type
Definition foray_rtshadercollection.hpp:28
const char * EntryPointName
Definition foray_rtshadercollection.hpp:29