LiteFX::Rendering::Backends::DirectX12GraphicsFactory::beginDefragmentationPass¶
Starts a new defragmentation pass.
Synopsis¶
Declared in <litefx/backends/dx12.hpp>
[[dllimport, dllexport]] virtual UInt64 beginDefragmentationPass() const override;
Description¶
Before calling this method, make sure you have started a defragmentation process by calling beginDefragmentation. If no defragmentation process is currently started, calling this method raises an exception.
You are expected to issue alternating calls to this method and endDefragmentationPass. This can happen either at the beginning or end of a frame, or on a separate thread.
In between a call to this method and endDefragmentationPass, the moved-from resources remain valid. Only after the move has finished and endDefragmentationPass has been called, they will get invalidated. This means, that you might have to update descriptor bindings for the resource. You can subscribe to the IDeviceMemory::moved event for this purpose. You might also want to issue a barrier to transition an image resource back into the required layout. Calling this method will leave the new resource in a ImageLayout::Common state.
Return Value¶
A type for an unsigned 64 bit integer.
See Also¶
beginDefragmentation
endDefragmentationPass