Shader binding table interface. More...
#include <ShaderBindingTable.h>
Public Member Functions | |
virtual const ShaderBindingTableDesc &DILIGENT_CALL_TYPE | GetDesc () const override=0 |
Returns the shader binding table description that was used to create the object. | |
virtual Bool DILIGENT_CALL_TYPE | Verify (VERIFY_SBT_FLAGS Flags) const =0 |
Checks that all shaders are bound, instances and geometries have not changed, shader record data are initialized. | |
virtual void DILIGENT_CALL_TYPE | Reset (IPipelineState *pPSO)=0 |
Resets the SBT with the new pipeline state. This is more efficient than creating a new SBT. | |
virtual void DILIGENT_CALL_TYPE | ResetHitGroups ()=0 |
Resets hit groups in the SBT. | |
virtual void DILIGENT_CALL_TYPE | BindRayGenShader (const Char *pShaderGroupName, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a ray-generation shader. | |
virtual void DILIGENT_CALL_TYPE | BindMissShader (const Char *pShaderGroupName, Uint32 MissIndex, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a ray-miss shader. | |
virtual void DILIGENT_CALL_TYPE | BindHitGroupForGeometry (ITopLevelAS *pTLAS, const Char *pInstanceName, const Char *pGeometryName, Uint32 RayOffsetInHitGroupIndex, const Char *pShaderGroupName, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a hit group for the the specified geometry in the instance. | |
virtual void DILIGENT_CALL_TYPE | BindHitGroupByIndex (Uint32 BindingIndex, const Char *pShaderGroupName, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a hit group to the specified location in the table. | |
virtual void DILIGENT_CALL_TYPE | BindHitGroupForInstance (ITopLevelAS *pTLAS, const Char *pInstanceName, Uint32 RayOffsetInHitGroupIndex, const Char *pShaderGroupName, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a hit group for all geometries in the specified instance. | |
virtual void DILIGENT_CALL_TYPE | BindHitGroupForTLAS (ITopLevelAS *pTLAS, Uint32 RayOffsetInHitGroupIndex, const Char *pShaderGroupName, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a hit group for all instances in the given top-level AS. | |
virtual void DILIGENT_CALL_TYPE | BindCallableShader (const Char *pShaderGroupName, Uint32 CallableIndex, const void *pData=nullptr, Uint32 DataSize=0)=0 |
Binds a callable shader. | |
![]() | |
virtual Int32 DILIGENT_CALL_TYPE | GetUniqueID () const =0 |
Returns unique identifier assigned to an object. | |
virtual void DILIGENT_CALL_TYPE | SetUserData (IObject *pUserData)=0 |
Stores a pointer to the user-provided data object. | |
virtual IObject *DILIGENT_CALL_TYPE | GetUserData () const =0 |
Returns a pointer to the user data object previously set with SetUserData() method. | |
![]() | |
virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
Queries the specific interface. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
Increments the number of strong references by 1. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
Shader binding table interface.
Defines the methods to manipulate an SBT object
|
pure virtual |
Binds a callable shader.
[in] | pShaderGroupName | - Callable shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created. Can be null to make the shader inactive. |
[in] | CallableIndex | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a hit group to the specified location in the table.
[in] | BindingIndex | - Location of the hit group in the table. |
[in] | pShaderGroupName | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a hit group for the the specified geometry in the instance.
[in] | pTLAS | - Top-level AS that contains the given instance. |
[in] | pInstanceName | - Instance name that contains the geometry. This is the name that was used when the TLAS was created, see TLASBuildInstanceData::InstanceName. |
[in] | pGeometryName | - 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. |
[in] | RayOffsetInHitGroupIndex | - 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. |
[in] | pShaderGroupName | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a hit group for all geometries in the specified instance.
[in] | pTLAS | - Top-level AS that contains the given instance. |
[in] | pInstanceName | - Instance name, for which to bind the hit group. This is the name that was used when the TLAS was created, see TLASBuildInstanceData::InstanceName. |
[in] | RayOffsetInHitGroupIndex | - 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. |
[in] | pShaderGroupName | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a hit group for all instances in the given top-level AS.
[in] | pTLAS | - Top-level AS, for which to bind the hit group. |
[in] | RayOffsetInHitGroupIndex | - 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. |
[in] | pShaderGroupName | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a ray-miss shader.
[in] | pShaderGroupName | - Ray-miss shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created. Can be null to make the shader inactive. |
[in] | MissIndex | - 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. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Binds a ray-generation shader.
[in] | pShaderGroupName | - Ray-generation shader name that was specified in RayTracingGeneralShaderGroup::Name when the pipeline state was created. |
[in] | pData | - Shader record data, can be null. |
[in] | DataSize | - Shader record data size, should be equal to RayTracingPipelineDesc::ShaderRecordSize. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Resets the SBT with the new pipeline state. This is more efficient than creating a new SBT.
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Resets hit groups in the SBT.
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.
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
|
pure virtual |
Checks that all shaders are bound, instances and geometries have not changed, shader record data are initialized.
[in] | Flags | - Flags that specify which type of validation to perform. |
The function does not modify the data used by IDeviceContext::TraceRays() and IDeviceContext::TraceRaysIndirect() commands, so they can run in parallel.
This method is only implemented in development build and has no effect in release build.