Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_hitsbt.hpp
Go to the documentation of this file.
1#pragma once
2#include "foray_basesbt.hpp"
4#include <vector>
5
6namespace foray::rtpipe {
7
10 {
11 public:
18
19 inline explicit HitShaderBindingTable(VkDeviceSize entryDataSize = 0) : ShaderBindingTableBase(entryDataSize) {}
20
22 void SetGroup(GroupIndex groupIndex, core::ShaderModule* closestHit, core::ShaderModule* anyHit, core::ShaderModule* intersect);
25 void SetGroup(GroupIndex groupIndex, core::ShaderModule* closestHit, core::ShaderModule* anyHit, core::ShaderModule* intersect, const void* data);
26
27 virtual void WriteToShaderCollection(RtShaderCollection& collection) const override;
28 virtual VectorRange WriteToShaderGroupCiVector(std::vector<VkRayTracingShaderGroupCreateInfoKHR>& groupCis, const RtShaderCollection& shaderCollection) const override;
29
30
31 FORAY_GETTER_CR(Groups)
32
33 virtual void Destroy() override;
34
35 protected:
37
38 inline virtual size_t GetGroupArrayCount() const override { return mGroups.size(); }
39 };
40
41} // namespace foray
Wraps shader code driver handle (VkShaderModule). See ShaderManager for compiling shaders dynamically...
Definition foray_shadermodule.hpp:11
Shader binding table implementation for storing hit groups (Consist of optional closesthit,...
Definition foray_hitsbt.hpp:10
virtual void WriteToShaderCollection(RtShaderCollection &collection) const override
For any shader group defined, register it with the collection.
void SetGroup(GroupIndex groupIndex, core::ShaderModule *closestHit, core::ShaderModule *anyHit, core::ShaderModule *intersect)
Set shader group with shader.
virtual void Destroy() override
virtual VectorRange WriteToShaderGroupCiVector(std::vector< VkRayTracingShaderGroupCreateInfoKHR > &groupCis, const RtShaderCollection &shaderCollection) const override
Write the shader groups to groupCis vector.
std::vector< ShaderGroup > mGroups
Definition foray_hitsbt.hpp:36
void SetGroup(GroupIndex groupIndex, core::ShaderModule *closestHit, core::ShaderModule *anyHit, core::ShaderModule *intersect, const void *data)
Set shader group with shader and custom data.
virtual size_t GetGroupArrayCount() const override
Definition foray_hitsbt.hpp:38
HitShaderBindingTable(VkDeviceSize entryDataSize=0)
Definition foray_hitsbt.hpp:19
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_CR(member)
Return constant reference.
Definition foray_basics.hpp:60
Definition foray_basesbt.hpp:9
int32_t GroupIndex
Type used for indexing ShaderGroups in SBTs.
Definition foray_rtshadertypes.hpp:45
Definition foray_env.hpp:92
core::ShaderModule * AnyHitModule
Definition foray_hitsbt.hpp:15
core::ShaderModule * IntersectModule
Definition foray_hitsbt.hpp:16
core::ShaderModule * ClosestHitModule
Definition foray_hitsbt.hpp:14