Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::ScheduleBufferUpdateInfo Struct Reference

Structure describing a buffer update operation to be scheduled by IGPUUploadManager::ScheduleBufferUpdate(). More...

#include <GPUUploadManager.h>

Public Attributes

IDeviceContextpContext = nullptr
 
IBufferpDstBuffer = nullptr
 
Uint32 DstOffset = 0
 
Uint32 NumBytes = 0
 Number of bytes to copy from the source data to the destination buffer.
 
const void * pSrcData = nullptr
 
WriteStagingDataCallbackType WriteDataCallback = nullptr
 
void * pWriteDataCallbackUserData = nullptr
 Optional pointer to user data that will be passed to the WriteStagingDataCallback.
 
CopyStagingBufferCallbackType CopyBuffer = nullptr
 
void * pCopyBufferData = nullptr
 Optional pointer to user data that will be passed to the CopyBuffer callback.
 
GPUUploadEnqueuedCallbackType UploadEnqueued = nullptr
 
void * pUploadEnqueuedData = nullptr
 Optional pointer to user data that will be passed to the callback.
 

Detailed Description

Structure describing a buffer update operation to be scheduled by IGPUUploadManager::ScheduleBufferUpdate().

Member Data Documentation

◆ CopyBuffer

CopyStagingBufferCallbackType Diligent::ScheduleBufferUpdateInfo::CopyBuffer = nullptr

Optional callback to perform the copy operation. If this parameter is null, the manager will perform the copy from the source data to the destination buffer using its internal staging buffer and copy command. If the callback is provided, it must perform the copy operation itself. The manager will pass the necessary parameters to the callback.

◆ DstOffset

Uint32 Diligent::ScheduleBufferUpdateInfo::DstOffset = 0

Offset in the destination buffer where the update will be applied. If CopyBuffer callback is provided, this parameter will be ignored, and the callback must perform the copy operation itself. Otherwise, this offset will be used as the destination offset for the copy operation.

◆ pContext

IDeviceContext* Diligent::ScheduleBufferUpdateInfo::pContext = nullptr

If calling ScheduleBufferUpdate() from the render thread, a pointer to the device context. If calling ScheduleBufferUpdate() from a worker thread, this parameter must be null.

◆ pDstBuffer

IBuffer* Diligent::ScheduleBufferUpdateInfo::pDstBuffer = nullptr

Pointer to the destination buffer to update. If CopyBuffer callback is provided, this parameter will be ignored (though the manager will still keep a reference to the buffer until the copy operation is scheduled), and the callback must perform the copy operation itself. Otherwise, this buffer will be used as the destination for the copy operation

◆ pSrcData

const void* Diligent::ScheduleBufferUpdateInfo::pSrcData = nullptr

Pointer to the source data to copy to the destination buffer. The manager makes an internal copy of the source data, so the memory pointed to by this parameter can be safely released or reused after the method returns. If WriteDataCallback callback is provided, this parameter will be ignored, and the callback must write the source data to the staging buffer when requested by the manager.

◆ UploadEnqueued

GPUUploadEnqueuedCallbackType Diligent::ScheduleBufferUpdateInfo::UploadEnqueued = nullptr

Optional callback to be called when the GPU copy operation is scheduled for execution. If CopyBuffer is provided, the callback will not be called, and the CopyBuffer callback is expected to perform any necessary follow-up actions after scheduling the copy operation.

◆ WriteDataCallback

WriteStagingDataCallbackType Diligent::ScheduleBufferUpdateInfo::WriteDataCallback = nullptr

Optional callback to write data to a staging buffer. If provided, the pSrcData parameter is ignored, and the manager will call the callback with a pointer to the staging buffer memory when it needs to write data to a staging buffer page. The callback will be called from ScheduleBufferUpdate().