This structure is used by IDeviceContext::BuildTLAS(). More...
#include <DeviceContext.h>
Public Attributes | |
ITopLevelAS * | pTLAS = nullptr |
Target top-level AS. | |
RESOURCE_STATE_TRANSITION_MODE | TLASTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE |
Top-level AS state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE). | |
RESOURCE_STATE_TRANSITION_MODE | BLASTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE |
Bottom-level AS (in TLASBuildInstanceData::pBLAS) state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE). | |
TLASBuildInstanceData const * | pInstances = nullptr |
A pointer to an array of InstanceCount TLASBuildInstanceData structures that contain instance data. | |
Uint32 | InstanceCount = 0 |
The number of instances. | |
IBuffer * | pInstanceBuffer = nullptr |
The buffer that will be used to store instance data during AS building. | |
Uint64 | InstanceBufferOffset = 0 |
RESOURCE_STATE_TRANSITION_MODE | InstanceBufferTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE |
Instance buffer state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE). | |
Uint32 | HitGroupStride = 1 |
The number of hit shaders that can be bound for a single geometry or an instance (depends on BindingMode). | |
Uint32 | BaseContributionToHitGroupIndex = 0 |
Base offset for the hit group location. | |
HIT_GROUP_BINDING_MODE | BindingMode = HIT_GROUP_BINDING_MODE_PER_GEOMETRY |
Hit shader binding mode, see Diligent::SHADER_BINDING_MODE. | |
IBuffer * | pScratchBuffer = nullptr |
Buffer that is used for acceleration structure building. | |
Uint64 | ScratchBufferOffset = 0 |
Offset from the beginning of the buffer. | |
RESOURCE_STATE_TRANSITION_MODE | ScratchBufferTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE |
Scratch buffer state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE). | |
Bool | Update = False |
Whether to build the acceleration structure from scratch or update it. | |
This structure is used by IDeviceContext::BuildTLAS().
Uint32 Diligent::BuildTLASAttribs::BaseContributionToHitGroupIndex = 0 |
Base offset for the hit group location.
Can be used to bind hit shaders for multiple acceleration structures, see IShaderBindingTable::BindHitGroupForGeometry().
BindingMode
is Diligent::SHADER_BINDING_USER_DEFINED. HIT_GROUP_BINDING_MODE Diligent::BuildTLASAttribs::BindingMode = HIT_GROUP_BINDING_MODE_PER_GEOMETRY |
Hit shader binding mode, see Diligent::SHADER_BINDING_MODE.
Used to calculate TLASBuildInstanceData::ContributionToHitGroupIndex.
Uint32 Diligent::BuildTLASAttribs::HitGroupStride = 1 |
The number of hit shaders that can be bound for a single geometry or an instance (depends on BindingMode).
BindingMode
is Diligent::SHADER_BINDING_USER_DEFINED.You should use the same value in a shader:
MultiplierForGeometryContributionToHitGroupIndex
argument in TraceRay()
in HLSLsbtRecordStride
argument in traceRay()
in GLSL. Uint64 Diligent::BuildTLASAttribs::InstanceBufferOffset = 0 |
Offset from the beginning of the buffer to the location of instance data. Offset must be aligned by RayTracingProperties::InstanceBufferAlignment.
Uint32 Diligent::BuildTLASAttribs::InstanceCount = 0 |
The number of instances.
Must be less than or equal to TopLevelASDesc::MaxInstanceCount. If Update is true then count must be the same as used to build TLAS.
IBuffer* Diligent::BuildTLASAttribs::pInstanceBuffer = nullptr |
The buffer that will be used to store instance data during AS building.
The buffer size must be at least TLAS_INSTANCE_DATA_SIZE * InstanceCount
. The buffer must be created with Diligent::BIND_RAY_TRACING flag.
TLASBuildInstanceData const* Diligent::BuildTLASAttribs::pInstances = nullptr |
A pointer to an array of InstanceCount
TLASBuildInstanceData
structures that contain instance data.
If Update
is true
:
IBuffer* Diligent::BuildTLASAttribs::pScratchBuffer = nullptr |
Buffer that is used for acceleration structure building.
Must be created with Diligent::BIND_RAY_TRACING.
Call ITopLevelAS::GetScratchBufferSizes().Build to get the minimal size for the scratch buffer.
ITopLevelAS* Diligent::BuildTLASAttribs::pTLAS = nullptr |
Target top-level AS.
Access to the TLAS must be externally synchronized.
Uint64 Diligent::BuildTLASAttribs::ScratchBufferOffset = 0 |
Offset from the beginning of the buffer.
Offset must be aligned by RayTracingProperties::ScratchBufferAlignment.
Bool Diligent::BuildTLASAttribs::Update = False |
Whether to build the acceleration structure from scratch or update it.
false
, then TLAS will be built from scratch.true
, then previous content of TLAS will be updated.pTLAS must be created with Diligent::RAYTRACING_BUILD_AS_ALLOW_UPDATE flag.