Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_generalsbt.hpp
Go to the documentation of this file.
1#pragma once
2#include "foray_basesbt.hpp"
4#include "../core/foray_shadermodule.hpp"
5#include <vector>
6
7namespace foray::rtpipe {
10 {
11 public:
14 {
16 };
17
18 explicit GeneralShaderBindingTable(RtShaderGroupType groupType, VkDeviceSize entryDataSize = 0);
19
21 void SetGroup(GroupIndex groupIndex, core::ShaderModule* shader);
24 void SetGroup(GroupIndex groupIndex, core::ShaderModule* shader, const void* data);
25
26 FORAY_GETTER_CR(Groups)
27 FORAY_GETTER_V(ShaderGroupType)
28
29 virtual void WriteToShaderCollection(RtShaderCollection& collection) const override;
30 virtual VectorRange WriteToShaderGroupCiVector(std::vector<VkRayTracingShaderGroupCreateInfoKHR>& groupCis, const RtShaderCollection& shaderCollection) const override;
31
32 virtual void Destroy() override;
33
34 protected:
37
38 inline virtual size_t GetGroupArrayCount() const override { return mGroups.size(); }
39 };
40} // namespace foray::rtpipe
Wraps shader code driver handle (VkShaderModule). See ShaderManager for compiling shaders dynamically...
Definition foray_shadermodule.hpp:11
Shader binding table for storing raygen, miss and callable shader groups.
Definition foray_generalsbt.hpp:10
GeneralShaderBindingTable(RtShaderGroupType groupType, VkDeviceSize entryDataSize=0)
std::vector< ShaderGroup > mGroups
Definition foray_generalsbt.hpp:36
virtual void WriteToShaderCollection(RtShaderCollection &collection) const override
For any shader group defined, register it with the collection.
RtShaderGroupType mShaderGroupType
Definition foray_generalsbt.hpp:35
void SetGroup(GroupIndex groupIndex, core::ShaderModule *shader)
Set shader group with shader.
virtual VectorRange WriteToShaderGroupCiVector(std::vector< VkRayTracingShaderGroupCreateInfoKHR > &groupCis, const RtShaderCollection &shaderCollection) const override
Write the shader groups to groupCis vector.
virtual size_t GetGroupArrayCount() const override
Definition foray_generalsbt.hpp:38
void SetGroup(GroupIndex groupIndex, core::ShaderModule *shader, const void *data)
Set shader group with shader and custom data.
Helper class to manage unique Rt ShaderModules.
Definition foray_rtshadercollection.hpp:11
Shader Binding Table base class, providing functions to manage custom generic shader group data and S...
Definition foray_basesbt.hpp:35
#define FORAY_GETTER_V(member)
Return value.
Definition foray_basics.hpp:39
#define FORAY_GETTER_CR(member)
Return constant reference.
Definition foray_basics.hpp:60
Definition foray_basesbt.hpp:9
RtShaderGroupType
ShaderGroup Types.
Definition foray_rtshadertypes.hpp:21
int32_t GroupIndex
Type used for indexing ShaderGroups in SBTs.
Definition foray_rtshadertypes.hpp:45
Definition foray_env.hpp:92
General shader group.
Definition foray_generalsbt.hpp:14
core::ShaderModule * Module
Definition foray_generalsbt.hpp:15