class in UnityEngine
Data buffer to hold data for compute shaders.
计算机着色器保存数据的数据缓存区。
ComputeShader programs often need arbitrary data to be read & written into memory buffers. ComputeBuffer class is exactly for that - you can create & fill them from script code, and use them in compute shaders or regular shaders.
ComputeShader程序经常需要读取和写入任意数据到内存缓冲区。ComputeBuffer类是精准的-你可以通过脚本代码来创建和填充它,并且可以在计算着色器或定期着色器中使用。
Compute shaders need a fairly modern GPU (with shader model 5.0 support) and are at the moment available on DirectX 11, PS4, XboxOne and OpenGL ES 3.1. On shader side, ComputeBuffers map to StructuredBuffer<T> and RWStructuredBuffer<T> in HLSL.
计算着色器需要先进的GPU(支持着色器模型 5.0)和目前在DirectX 11、 XboxOne、 索尼 PS4 OpenGL ES 3.1 上可用。在着色器方面,在 HLSL上ComputeBuffers 映射到 StructuredBuffer <T>,RWStructuredBuffer<T> 。
See Also: SystemInfo.supportsComputeShaders, ComputeShader class, Shader.SetGlobalBuffer, Material.SetBuffer, Compute Shaders.
ComputeBuffer | Create a Compute Buffer. 创建一个计算缓存区。 |
CopyCount | Copy counter value of append/consume buffer into another buffer. 将计数器追加/消耗缓存区的值复制到另一个缓存区。 |