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

This structure is used by IDeviceContext::BuildBLAS(). More...

#include <DeviceContext.h>

Public Attributes

IBottomLevelASpBLAS = nullptr
 Target bottom-level AS.
 
RESOURCE_STATE_TRANSITION_MODE BLASTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE
 Bottom-level AS state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE).
 
RESOURCE_STATE_TRANSITION_MODE GeometryTransitionMode = RESOURCE_STATE_TRANSITION_MODE_NONE
 Geometry data source buffers state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE).
 
BLASBuildTriangleData const * pTriangleData = nullptr
 A pointer to the array of TriangleDataCount BLASBuildTriangleData structures that contains triangle geometry data.
 
Uint32 TriangleDataCount = 0
 The number of triangle geometries.
 
BLASBuildBoundingBoxData const * pBoxData = nullptr
 A pointer to an array of BoxDataCount BLASBuildBoundingBoxData structures that contain AABB geometry data.
 
Uint32 BoxDataCount = 0
 The number of AABB geometries.
 
IBufferpScratchBuffer = nullptr
 The 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.
 

Detailed Description

This structure is used by IDeviceContext::BuildBLAS().

Member Data Documentation

◆ BoxDataCount

Uint32 Diligent::BuildBLASAttribs::BoxDataCount = 0

The number of AABB geometries.

Must be less than or equal to BottomLevelASDesc::BoxCount. If Update is true then the count must be the same as the one used to build BLAS.

◆ pBLAS

IBottomLevelAS* Diligent::BuildBLASAttribs::pBLAS = nullptr

Target bottom-level AS.

Note
Access to the BLAS must be externally synchronized.

◆ pBoxData

BLASBuildBoundingBoxData const* Diligent::BuildBLASAttribs::pBoxData = nullptr

A pointer to an array of BoxDataCount BLASBuildBoundingBoxData structures that contain AABB geometry data.

If Update is true:

◆ pScratchBuffer

IBuffer* Diligent::BuildBLASAttribs::pScratchBuffer = nullptr

The buffer that is used for acceleration structure building.

Must be created with Diligent::BIND_RAY_TRACING. Call IBottomLevelAS::GetScratchBufferSizes().Build to get the minimal size for the scratch buffer.

◆ pTriangleData

BLASBuildTriangleData const* Diligent::BuildBLASAttribs::pTriangleData = nullptr

A pointer to the array of TriangleDataCount BLASBuildTriangleData structures that contains triangle geometry data.

If Update is true:

  • Only vertex positions (in pVertexBuffer) and transformation (in pTransformBuffer) can be changed.
  • All other content in BLASBuildTriangleData and buffers must be the same as what was used to build BLAS.
  • To disable geometry, make all triangles inactive, see BLASBuildTriangleData::pVertexBuffer description.

◆ ScratchBufferOffset

Uint64 Diligent::BuildBLASAttribs::ScratchBufferOffset = 0

Offset from the beginning of the buffer.

Offset must be aligned by RayTracingProperties::ScratchBufferAlignment.

◆ TriangleDataCount

Uint32 Diligent::BuildBLASAttribs::TriangleDataCount = 0

The number of triangle geometries.

Must be less than or equal to BottomLevelASDesc::TriangleCount. If Update is true then the count must be the same as the one used to build BLAS.

◆ Update

Bool Diligent::BuildBLASAttribs::Update = False

Whether to build the acceleration structure from scratch or update it.

if false then BLAS will be built from scratch. If true then previous content of BLAS will be updated.

pBLAS must be created with Diligent::RAYTRACING_BUILD_AS_ALLOW_UPDATE flag.

An update will be faster than building an acceleration structure from scratch.