LiteFX::Rendering::IGraphicsDevice::computeAccelerationStructureSizes¶
Computes the required amount of device memory for an IBottomLevelAccelerationStructure.
Synopsis¶
Declared in <litefx/rendering_api.hpp>
[[dllimport, dllexport]] void computeAccelerationStructureSizes(
IBottomLevelAccelerationStructure const& blas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const;
Description¶
Acceleration structures are built on the GPU, which requires additional memory called scratch memory. When creating an acceleration structure (AS), you have to provide a temporary buffer containing the scratch memory, alongside the actual buffer that stores the AS itself. This method can be used to pre-compute the buffer sizes for both buffers.
This method is only supported, if the GraphicsDeviceFeatures::RayTracing feature is enabled.
Parameters¶
| Name | Description |
|---|---|
| blas | The bottom-level acceleration structure to compute the memory requirements for. |
| bufferSize | The size of the acceleration structure buffer. |
| scratchSize | The size of the scratch memory buffer. |
| forUpdate | If set to true, scratchSize will contain the amount of scratch memory required for an update. |