Shader Binding Table base class, providing functions to manage custom generic shader group data and SBT building, aswell as buffer management.
More...
|
| ShaderBindingTableBase (VkDeviceSize entryDataSize=0) |
|
virtual void | Build (core::Context *context, const VkPhysicalDeviceRayTracingPipelinePropertiesKHR &pipelineProperties, const std::vector< const uint8_t * > &handles) |
| Rebuilds the SBT buffer according to the pipeline properties and matching indices.
|
|
std::vector< uint8_t > & | GroupDataAt (GroupIndex groupIndex) |
| Access the custom data entry for a group.
|
|
const std::vector< uint8_t > & | GroupDataAt (GroupIndex groupIndex) const |
| Access the custom data entry for a group.
|
|
template<typename TData > |
TData * | GroupDataAt (GroupIndex groupIndex) |
| Access the custom data entry for a group. May return nullptr!
|
|
template<typename TData > |
const TData * | GroupDataAt (GroupIndex groupIndex) const |
| Access the custom data entry for a group. May return nullptr!
|
|
void | SetData (GroupIndex groupIndex, const void *data) |
| Set the custom data entry for a group.
|
|
template<typename TData > |
void | SetData (GroupIndex groupIndex, const TData &data) |
| Set the custom data entry for a group.
|
|
virtual ShaderBindingTableBase & | SetEntryDataSize (VkDeviceSize newSize) |
| Set the custom entry data size. Any non-zero custom data is resized according to std::vector<uint8_t>::resize(newSize)!
|
|
virtual void | WriteToShaderCollection (RtShaderCollection &collection) const =0 |
| For any shader group defined, register it with the collection.
|
|
virtual VectorRange | WriteToShaderGroupCiVector (std::vector< VkRayTracingShaderGroupCreateInfoKHR > &groupCis, const RtShaderCollection &shaderCollection) const =0 |
| Write the shader groups to groupCis vector.
|
|
virtual void | Destroy () |
|
virtual | ~ShaderBindingTableBase () |
|
Shader Binding Table base class, providing functions to manage custom generic shader group data and SBT building, aswell as buffer management.
A shader binding table stores entries in the following layout
| Entry0 | Entry1 | ...
|-----------------------------|-----------------------------|-------
| GroupHandle | Custom Data | GroupHandle | Custom Data | ...
Where the GroupHandle is a vulkan driver specific memory block (all currently known drivers use 32 bit values here), as defined by VkPhysicalDeviceRayTracingPipelinePropertiesKHR::shaderGroupHandleSize It is essentially a reference to a ShaderGroup as defined in the CreateInfo passed to 'createRayTracingPipelinesKHR'
Custom Data is an optional memory area of user defined size. It allows pairing shaders with different configuration parameters.
ShaderBindingTable classes Usage:
- If you use custom data, best use SetEntryDataSize(...) first
- Define all shader groups. Make sure that all indices from 0 to the highest used are defined!
- If you didn't already when defining the shader groups, set custom data now
- Use Build(...) to build the SBT. If you use the RtPipeline class, use RtPipeline::Build(...) instead!