LiteFX::Rendering::GraphicsDevice::computeAccelerationStructureSizes¶
Computes the required amount of device memory for an ITopLevelAccelerationStructure.
Synopsis¶
Declared in <litefx/rendering.hpp>
virtual void computeAccelerationStructureSizes(
top_level_acceleration_structure_type const& tlas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const = 0;
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 |
|---|---|
| tlas | The top-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. |