用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:computebuffer:computebuffer

ComputeBuffer 计算机缓存

class in UnityEngine

Description 描述

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.

Variables 变量

countNumber of elements in the buffer (Read Only).
缓存区的元素数量(只读)。
strideSize of one element in the buffer (Read Only).
缓存区中的元素大小(只读)。

Constructors 构造

ComputeBufferCreate a Compute Buffer.
创建一个计算缓存区。

script/unityengine/classes/computebuffer/computebuffer.txt · 最后更改: 2016/08/02 05:30 (外部编辑)