Version: 2021.3

CommandBuffer.RequestAsyncReadback

切换到手册
public void RequestAsyncReadback (ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (ComputeBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (GraphicsBuffer src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (GraphicsBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, Experimental.Rendering.GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);
public void RequestAsyncReadback (Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Experimental.Rendering.GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback);

参数

src 要从中读取数据的资源。
size Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer.
offset 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 回读请求命令。

另请参阅:AsyncGPUReadback.Request

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961