Version: 2020.1

CommandBuffer.RequestAsyncReadbackIntoNativeArray

切换到手册
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, ComputeBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, GraphicsBuffer src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, GraphicsBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, int mipIndex, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, int mipIndex, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, int mipIndex, Experimental.Rendering.GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadbackIntoNativeArray (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);
public void RequestAsyncReadbackIntoNativeArray (ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Experimental.Rendering.GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);

参数

output 要将数据写入其中的 NativeArray 的引用。
src 要从中读取数据的资源。
size The size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer.
offset The offset in bytes in the ComputeBuffer or GraphicsBuffer.
mipIndex 要获取的 Mipmap 的索引。
dstFormat 数据的目标 TextureFormat。如果目标格式与 GPU 中存储的格式不同,则转换是自动进行的。
x 要获取的纹理数据的起始 X 坐标(以像素为单位)。
y 要获取的纹理数据的起始 Y 坐标(以像素为单位)。
z 所获取的 Texture3D 的起始 Z 坐标(以像素为单位)。所获取的 TextureCube、Texture2DArray 和 TextureCubeArray 的起始层索引。
depth 所获取的 Texture3D 的深度(以像素为单位)。TextureCube、TextureArray 和 TextureCubeArray 的层数。
width 要获取的纹理数据的宽度(以像素为单位)。
height 要获取的纹理数据的高度(以像素为单位)。
callback 完成请求时调用的委托 System.Action。完成请求作为参数传递给 System.Action 回调。

描述

向命令缓冲区添加异步 GPU 回读请求命令。