Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::TLASBuildInstanceData Struct Reference

This structure is used by BuildTLASAttribs. More...

#include <DeviceContext.h>

Public Attributes

const Char * InstanceName = nullptr
 Instance name that is used to map an instance to a hit group in shader binding table.
 
IBottomLevelASpBLAS = nullptr
 Bottom-level AS that represents instance geometry.
 
InstanceMatrix Transform
 Instance to world transformation.
 
Uint32 CustomId = 0
 User-defined value that can be accessed in the shader.
 
RAYTRACING_INSTANCE_FLAGS Flags = RAYTRACING_INSTANCE_NONE
 Instance flags, see Diligent::RAYTRACING_INSTANCE_FLAGS.
 
Uint8 Mask = 0xFF
 Visibility mask for the geometry, the instance may only be hit if rayMask & instance.Mask != 0.
 
Uint32 ContributionToHitGroupIndex = TLAS_INSTANCE_OFFSET_AUTO
 The index used to calculate the hit group location in the shader binding table.
 

Detailed Description

This structure is used by BuildTLASAttribs.

Member Data Documentation

◆ ContributionToHitGroupIndex

Uint32 Diligent::TLASBuildInstanceData::ContributionToHitGroupIndex = TLAS_INSTANCE_OFFSET_AUTO

The index used to calculate the hit group location in the shader binding table.

Must be Diligent::TLAS_INSTANCE_OFFSET_AUTO if BuildTLASAttribs::BindingMode is not Diligent::SHADER_BINDING_USER_DEFINED. Only the lower 24 bits are used.

◆ CustomId

Uint32 Diligent::TLASBuildInstanceData::CustomId = 0

User-defined value that can be accessed in the shader.

  • HLSL: InstanceID() in closest-hit and intersection shaders.
  • HLSL: RayQuery::CommittedInstanceID() within inline ray tracing.
  • GLSL: gl_InstanceCustomIndex in closest-hit and intersection shaders.
  • GLSL: rayQueryGetIntersectionInstanceCustomIndex within inline ray tracing.
  • MSL: intersection_result< instancing >::instance_id.

Only the lower 24 bits are used.

◆ Mask

Uint8 Diligent::TLASBuildInstanceData::Mask = 0xFF

Visibility mask for the geometry, the instance may only be hit if rayMask & instance.Mask != 0.

  • rayMask in GLSL is a cullMask argument of traceRay()
  • rayMask in HLSL is an InstanceInclusionMask argument of TraceRay().

◆ pBLAS

IBottomLevelAS* Diligent::TLASBuildInstanceData::pBLAS = nullptr

Bottom-level AS that represents instance geometry.

Once built, TLAS will hold strong reference to pBLAS until next build or copy operation.

Note
Access to the BLAS must be externally synchronized.