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.
Вычисляемым шейдерам необходимы достаточно современные GPU, на которых доступна возможность использования DirectX 11.
On shader side, ComputeBuffers map to StructuredBuffer<T> and RWStructuredBuffer<T> in HLSL.
See Also: SystemInfo.supportsComputeShaders, ComputeShader class, Shader.SetGlobalBuffer, Material.SetBuffer, Compute Shaders.
count | Number of elements in the buffer (Read Only). |
stride | Size of one element in the buffer (Read Only). |
ComputeBuffer | Create a Compute Buffer. |
GetData | Read data values from the buffer into an array. |
Release | Release a Compute Buffer. |
SetData | Set the buffer with values from an array. |
CopyCount | Копирует значение счетчика добавления/извлечения буфера в другой буфер. |