Skip to content

LiteFX::Rendering::Backends::DirectX12TopLevelAccelerationStructure::size

Returns the amount of memory in bytes inside buffer that store the acceleration structure.

Synopsis

Declared in <litefx/backends/dx12.hpp>

[[dllimport, dllexport]] virtual UInt64 size() const noexcept override;

Description

Note that this may be different to the value specified during build, as the actual size may be smaller (but can never be larger) after building. If you want to reduce the memory footprint, you can use this amount of memory for a compacted buffer and copy the acceleration structure using a copy command. In order to acquire the actual size required by the acceleration structure, the system needs to wait for the last build or update process to finish. Before that, this property will return the memory requirements as pre-computed by the device. To make sure that the build has finished, you need to manually wait for the fence acquired by submitting the command buffer that builds or updates the acceleration structure. Afterwards this method will return the actual size required to store the acceleration structure.

If the acceleration structure has not yet been built or is invalidated, this property returns 0.

Return Value

The amount of memory in bytes inside buffer that store the acceleration structure.

See Also

buffer