Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RequestAsync

Retrieves data asynchronously from a GPU resource.
Read time 5 minutesLast updated 6 days ago

Definition

RequestAsync(ComputeBuffer)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(ComputeBuffer src)

Parameters

Resource to read the data from.

Returns

Remarks

RequestAsync(ComputeBuffer, int, int)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(ComputeBuffer src, int size, int offset)

Parameters

Resource to read the data from.

size

Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer.

offset

Offset in bytes in the ComputeBuffer or GraphicsBuffer.

Returns

Remarks

RequestAsync(GraphicsBuffer)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(GraphicsBuffer src)

Parameters

Resource to read the data from.

Returns

Remarks

RequestAsync(GraphicsBuffer, int, int)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(GraphicsBuffer src, int size, int offset)

Parameters

Resource to read the data from.

size

Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer.

offset

Offset in bytes in the ComputeBuffer or GraphicsBuffer.

Returns

Remarks

RequestAsync(Texture, int)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex = 0)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

Returns

Remarks

RequestAsync(Texture, int, TextureFormat)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex, TextureFormat dstFormat)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

dstFormat

Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic.

Returns

Remarks

RequestAsync(Texture, int, GraphicsFormat)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex, GraphicsFormat dstFormat)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic.

Returns

Remarks

RequestAsync(Texture, int, int, int, int, int, int, int)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

Starting X coordinate in pixels of the Texture data to be fetched.

width

Width in pixels of the Texture data to be fetched.

Starting Y coordinate in pixels of the Texture data to be fetched.

height

Height in pixels of the Texture data to be fetched.

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

depth

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

Returns

Remarks

RequestAsync(Texture, int, int, int, int, int, int, int, TextureFormat)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

Starting X coordinate in pixels of the Texture data to be fetched.

width

Width in pixels of the Texture data to be fetched.

Starting Y coordinate in pixels of the Texture data to be fetched.

height

Height in pixels of the Texture data to be fetched.

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

depth

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

dstFormat

Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic.

Returns

Remarks

RequestAsync(Texture, int, int, int, int, int, int, int, GraphicsFormat)

Retrieves data asynchronously from a GPU resource.
public static Awaitable<AsyncGPUReadbackRequest> RequestAsync(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, GraphicsFormat dstFormat)

Parameters

Resource to read the data from.

mipIndex

Index of the mipmap to be fetched.

Starting X coordinate in pixels of the Texture data to be fetched.

width

Width in pixels of the Texture data to be fetched.

Starting Y coordinate in pixels of the Texture data to be fetched.

height

Height in pixels of the Texture data to be fetched.

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

depth

Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic.

Returns

Remarks