Method RequestAsyncReadback
RequestAsyncReadback<T>(CommandBuffer, StructuredBuffer<T>, Action<NativeArray<T>>)
Adds an asynchonous GPU readback request command to the command buffer.
Declaration
public static void RequestAsyncReadback<T>(this CommandBuffer cmd, StructuredBuffer<T> src, Action<NativeArray<T>> callback) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | The command buffer. |
StructuredBuffer<T> | src | The buffer to read the data from. |
Action<NativeArray<T>> | callback | A delegate called once the request is fullfilled. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in the GPU buffer. |
Remarks
IsEmpty must be false to call this function. If the request fails, the callback is not called.
RequestAsyncReadback<T>(CommandBuffer, ExchangeBuffer<T>, Action)
Adds to the command buffer an asynchonous request to readback from the GPU buffer into ExchangeBuffer CPU list.
Declaration
public static void RequestAsyncReadback<T>(this CommandBuffer cmd, ExchangeBuffer<T> src, Action callback) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | The command buffer. |
ExchangeBuffer<T> | src | The buffer to read the data from. |
Action | callback | A delegate called once the request is fullfilled. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in the GPU buffer. |
Remarks
IsEmpty must be false to call this function. If the request fails, the callback is not called.