Skip to content

LiteFX::Rendering::IRayTracingPipeline::allocateShaderBindingTable

Allocates a buffer that contains the shader binding table containing the shader groups specified by the groups parameter.

Synopsis

Declared in <litefx/rendering_api.hpp>

[[dllimport, dllexport]] SharedPtr<IBuffer> allocateShaderBindingTable(
    ShaderBindingTableOffsets& offsets,
    ShaderBindingGroup groups = ShaderBindingGroup::All) const;

Description

The shader binding table consists out of individual shader records, where each record refers to a shader record plus its local data, as specified in the shader record collection that was passed to the ray-tracing pipeline during creation. The size of a record within the shader binding table is determined by the largest local data size of all records of the groups to be included. It makes sense to pack multiple records into the same buffer for efficiency, however it may generally be a good idea to separate groups that require large amount of local shader data into their own buffers to keep the other buffers smaller.

The shader binding table is created on the default resource heap (ResourceHeap::Dynamic). However, for best performance, consider transferring it to a buffer on the GPU resource heap (ResourceHeap::Resource) afterwards.

Return Value

The buffer that stores the shader binding table.

Parameters

NameDescription
offsetsA reference to a structure that receives the offsets and sizes to the groups within the shader binding table.
groupsThe groups to include into the shader binding table.