Method GetDataAsync
GetDataAsync(CommandBuffer, Action<NativeArray<T>>)
Gets data from the GPU buffer asynchronously, via a command buffer.
Declaration
public AsyncRequestStatus GetDataAsync(CommandBuffer cmd, Action<NativeArray<T>> callback)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | The command buffer. Cannot be null. |
Action<NativeArray<T>> | callback | A callback to run when the data is ready. |
Returns
Type | Description |
---|---|
AsyncRequestStatus | The status of an asynchronous request. |
Remarks
IsEmpty must be false to call this function. Consider using the RequestAsyncReadback<T>(CommandBuffer, StructuredBuffer<T>, Action<NativeArray<T>>) extension method instead. If the request fails, the callback is not called.