Diligent::IShaderBindingTable struct

Shader binding table interface.

Defines the methods to manipulate an SBT object

Base classes

struct IDeviceObject
Base interface for all objects created by the render device Diligent::IRenderDevice.

Derived classes

struct IShaderBindingTableD3D12
Exposes Direct3D12-specific functionality of a shader binding table object.
struct IShaderBindingTableVk
Exposes Vulkan-specific functionality of a Shader binding table object.

Public functions

auto GetDesc() const -> const ShaderBindingTableDesc& override
Returns the shader binding table description that was used to create the object.
auto Verify(VERIFY_SBT_FLAGS Flags) const -> Bool METHOD() virtual
Checks that all shaders are bound, instances and geometries have not changed, shader record data are initialized.
auto Reset(IPipelineState* pPSO) -> void METHOD() virtual
Resets the SBT with the new pipeline state. This is more effecient than creating a new SBT.
auto ResetHitGroups() -> void METHOD() virtual
After TLAS or BLAS was rebuilt or updated, hit group shader bindings may have become invalid, you can reset hit groups only and keep ray-gen, miss and callable shader bindings intact.
auto BindRayGenShader(const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a ray-generation shader.
auto BindMissShader(const char* pShaderGroupName, Uint32 MissIndex, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a ray-miss shader.
auto BindHitGroupForGeometry(ITopLevelAS* pTLAS, const char* pInstanceName, const char* pGeometryName, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a hit group for the the specified geometry in the instance.
auto BindHitGroupByIndex(Uint32 BindingIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a hit group to the specified location in the table.
auto BindHitGroupForInstance(ITopLevelAS* pTLAS, const char* pInstanceName, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a hit group for all geometries in the specified instance.
auto BindHitGroupForTLAS(ITopLevelAS* pTLAS, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a hit group for all instances in the given top-level AS.
auto BindCallableShader(const char* pShaderGroupName, Uint32 CallableIndex, const void* pData = nullptr, Uint32 DataSize = 0) -> void METHOD() virtual
Binds a callable shader.

Function documentation

Bool METHOD() Diligent::IShaderBindingTable::Verify(VERIFY_SBT_FLAGS Flags) const virtual

Checks that all shaders are bound, instances and geometries have not changed, shader record data are initialized.

Parameters
Flags in - Flags that specify which type of validation to perform.
Returns True if SBT content is valid, and false otherwise.

void METHOD() Diligent::IShaderBindingTable::Reset(IPipelineState* pPSO) virtual

Resets the SBT with the new pipeline state. This is more effecient than creating a new SBT.

void METHOD() Diligent::IShaderBindingTable::ResetHitGroups() virtual

After TLAS or BLAS was rebuilt or updated, hit group shader bindings may have become invalid, you can reset hit groups only and keep ray-gen, miss and callable shader bindings intact.

void METHOD() Diligent::IShaderBindingTable::BindRayGenShader(const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a ray-generation shader.

Parameters
pShaderGroupName in - Ray-generation shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindMissShader(const char* pShaderGroupName, Uint32 MissIndex, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a ray-miss shader.

Parameters
pShaderGroupName in - Ray-miss shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created. Can be null to make the shader inactive.
MissIndex in - Miss shader offset in the shader binding table (aka ray type). This offset will correspond to 'MissShaderIndex' argument of TraceRay() function in HLSL, and 'missIndex' argument of traceRay() function in GLSL.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindHitGroupForGeometry(ITopLevelAS* pTLAS, const char* pInstanceName, const char* pGeometryName, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a hit group for the the specified geometry in the instance.

Parameters
pTLAS in - Top-level AS that contains the given instance.
pInstanceName in - Instance name that contains the geometry. This is the name that was used when the TLAS was created, see TLASBuildInstanceData::InstanceName.
pGeometryName in - Geometry name in the instance, for which to bind the hit group. This is the name that was given to geometry when BLAS was created, see BLASBuildTriangleData::GeometryName and BLASBuildBoundingBoxData::GeometryName.
RayOffsetInHitGroupIndex in - Ray offset in the shader binding table (aka ray type). This offset will correspond to 'RayContributionToHitGroupIndex' argument of TraceRay() function in HLSL, and 'sbtRecordOffset' argument of traceRay() function in GLSL. Must be less than HitShadersPerInstance.
pShaderGroupName in - Hit group name that was specified in RayTracingTriangleHitShaderGroup::Name or RayTracingProceduralHitShaderGroup::Name when the pipeline state was created. Can be null to make the shader group inactive.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindHitGroupByIndex(Uint32 BindingIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a hit group to the specified location in the table.

Parameters
BindingIndex in - Location of the hit group in the table.
pShaderGroupName in - Hit group name that was specified in RayTracingTriangleHitShaderGroup::Name or RayTracingProceduralHitShaderGroup::Name when the pipeline state was created. Can be null to make the shader group inactive.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindHitGroupForInstance(ITopLevelAS* pTLAS, const char* pInstanceName, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a hit group for all geometries in the specified instance.

Parameters
pTLAS in - Top-level AS that contains the given instance.
pInstanceName in - Instance name, for which to bind the hit group. This is the name that was used when the TLAS was created, see TLASBuildInstanceData::InstanceName.
RayOffsetInHitGroupIndex in - Ray offset in the shader binding table (aka ray type). This offset will correspond to 'RayContributionToHitGroupIndex' argument of TraceRay() function in HLSL, and 'sbtRecordOffset' argument of traceRay() function in GLSL. Must be less than HitShadersPerInstance.
pShaderGroupName in - Hit group name that was specified in RayTracingTriangleHitShaderGroup::Name or RayTracingProceduralHitShaderGroup::Name when the pipeline state was created. Can be null to make the shader group inactive.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindHitGroupForTLAS(ITopLevelAS* pTLAS, Uint32 RayOffsetInHitGroupIndex, const char* pShaderGroupName, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a hit group for all instances in the given top-level AS.

Parameters
pTLAS in - Top-level AS, for which to bind the hit group.
RayOffsetInHitGroupIndex in - Ray offset in the shader binding table (aka ray type). This offset will correspond to 'RayContributionToHitGroupIndex' argument of TraceRay() function in HLSL, and 'sbtRecordOffset' argument of traceRay() function in GLSL. Must be less than HitShadersPerInstance.
pShaderGroupName in - Hit group name that was specified in RayTracingTriangleHitShaderGroup::Name or RayTracingProceduralHitShaderGroup::Name when the pipeline state was created. Can be null to make the shader group inactive.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.

void METHOD() Diligent::IShaderBindingTable::BindCallableShader(const char* pShaderGroupName, Uint32 CallableIndex, const void* pData = nullptr, Uint32 DataSize = 0) virtual

Binds a callable shader.

Parameters
pShaderGroupName in - Callable shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created. Can be null to make the shader inactive.
CallableIndex in - Callable shader offset in the shader binding table. This offset will correspond to 'ShaderIndex' argument of CallShader() function in HLSL, and 'callable' argument of executeCallable() function in GLSL.
pData in - Shader record data, can be null.
DataSize in - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize.