Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RequestAsyncReadbackIntoNativeArray

Adds an asynchonous GPU readback request command to the command buffer.
Read time 9 minutesLast updated 4 days ago

Definition

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, ComputeBuffer, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, ComputeBuffer, int, int, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, ComputeBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

size

The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer.

offset

The offset in bytes in the ComputeBuffer or GraphicsBuffer.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, GraphicsBuffer, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, GraphicsBuffer src, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, GraphicsBuffer, int, int, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, GraphicsBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

size

The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer.

offset

The offset in bytes in the ComputeBuffer or GraphicsBuffer.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, TextureFormat, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

dstFormat

The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, GraphicsFormat, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, int, int, int, int, int, int, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

The starting x-coordinate, in pixels, of the Texture data to fetch.

width

The width, in pixels, of the Texture data to fetch.

The starting y-coordinate, in pixels, of the Texture data to fetch.

height

The height, in pixels, of the Texture data to fetch.

The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer.

depth

The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, int, int, int, int, int, int, TextureFormat, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

The starting x-coordinate, in pixels, of the Texture data to fetch.

width

The width, in pixels, of the Texture data to fetch.

The starting y-coordinate, in pixels, of the Texture data to fetch.

height

The height, in pixels, of the Texture data to fetch.

The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer.

depth

The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve.

dstFormat

The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks

RequestAsyncReadbackIntoNativeArray<T>(NativeArray<T>, Texture, int, int, int, int, int, int, int, GraphicsFormat, Action<AsyncGPUReadbackRequest>)

Adds an asynchonous GPU readback request command to the command buffer.
public void RequestAsyncReadbackIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback) where T : struct

Parameters

Reference to a NativeArray to write the data into.

The resource to read the data from.

mipIndex

The index of the mipmap to fetch.

The starting x-coordinate, in pixels, of the Texture data to fetch.

width

The width, in pixels, of the Texture data to fetch.

The starting y-coordinate, in pixels, of the Texture data to fetch.

height

The height, in pixels, of the Texture data to fetch.

The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer.

depth

The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve.

The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU.

A delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

Remarks