class
GpuTransferBufferHelper
Helper that manages automatic creation and submission of transfer command buffers.
Primarily used for buffer/texture read/write operations, in case the user doesn't provide an explicit command buffer to perform them on.
Thread safe.
Public
Constructors
GpuTransferBufferHelper
Creates a transfer buffer helper for the specified device and target queue.
- device
- GPU device this helper belongs to.
- targetQueue
- Queue that transfer command buffers will be submitted to.
Methods
~GpuTransferBufferHelper
GetOrCreateTransferCommandBuffer
Returns a command buffer for transfer operations on the current thread.
If no command buffer exists for this thread, one is created. The command buffer will be submitted to the configured target queue.
This is a helper method that creates a transient transfer command buffer under the hood.
Returns: Transfer command buffer for the current thread.
SubmitTransferCommandBuffer
Submits the active transfer command buffer for the current thread.
After submission, the command buffer is invalidated and a new one will be created on the next GetOrCreate call.
- wait
- If true, blocks until the command buffer finishes executing on the GPU.
EndFrame
Advances all transfer command buffer pool rings to the next frame.
Called at the end of each frame by the renderer.
Private
Methods
RegisterCurrentThreadIfNeeded
Registers the current thread if not already registered.
Returns the thread data.
GetCurrentThreadData
Gets the thread data for the current thread, or nullptr if not registered.