Home -> ITexelArray -> QueueDataUpdate
Description
The QueueDataUpdate method schedules an update to data in an allocated texel array. Unlike SetInitialData, the provided CPU memory may be modified or deallocated immediately after this method returns.
Updates may target an offset within the array and may be attached to an ITransferBatch so multiple resource updates are submitted and synchronized together. The source image and data format arguments describe the CPU data and allow the renderer to perform supported format conversion.
Important
Queued updates are scheduled GPU work. If a transfer batch is supplied, completion and visibility follow that batch. Without an explicit batch, the renderer schedules the update using its default transfer path.
Usage
template<class T> SuccessToken QueueDataUpdate(const std::vector<T>& sourceBuffer, size_t targetBufferOffset = 0, ITransferBatch* transferBatch = nullptr);
SuccessToken QueueDataUpdate(const void* sourceBuffer, size_t sourceBufferSizeInBytes, SourceImageFormat imageFormat, SourceDataFormat dataFormat, size_t targetBufferOffset = 0, ITransferBatch* transferBatch = nullptr);
Argument list
- sourceBuffer [const std::vector<T> or const void*]
- The source data to copy into the texel array.
- sourceBufferSizeInBytes [size_t]
- The size, in bytes, of the source data.
- imageFormat [SourceImageFormat]
- The image channel layout of the source data.
- dataFormat [SourceDataFormat]
- The data encoding of the source data.
- targetBufferOffset [size_t]
- The destination texel offset where the update begins.
- transferBatch [ITransferBatch*]
- An optional transfer batch to schedule the update into. If null, the renderer schedules the update independently.
Return value
- [SuccessToken]
- True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.