Home -> ITexelArrayOutput -> ReadBufferData
Description
The ReadBufferData method attempts to read the captured texel array output and write it to the target CPU buffer. Typed overloads are provided for each supported vector source format, while the raw overload allows the requested output format to be specified explicitly.
The captured data represents output produced by shader or transfer work and made available through the output capture path. Applications should wait for output capture completion before reading if the capture was produced by recently submitted frame or transfer work.
When the requested output format differs from the captured storage format, the renderer performs the supported format conversion before writing to the target buffer.
Usage
template<class T> SuccessToken ReadBufferData(std::vector<T>& targetBuffer) const;
SuccessToken ReadBufferData(void* targetBuffer, size_t targetBufferSizeInBytes, ITexelArray::SourceImageFormat imageFormat, ITexelArray::SourceDataFormat dataFormat) const;
Argument list
- targetBuffer [std::vector<T> or void*]
- The destination memory to receive the captured data.
- targetBufferSizeInBytes [size_t]
- The size, in bytes, of the destination memory.
- imageFormat [ITexelArray::SourceImageFormat]
- The image channel layout requested for the destination data.
- dataFormat [ITexelArray::SourceDataFormat]
- The data encoding requested for the destination data.
Return value
- [SuccessToken]
- True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.