Version: 2017.2

ComputeBuffer

class in UnityEngine

マニュアルに切り替える

説明

GPU data buffer, mostly for use with 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.

Compute buffers are always supported in compute shaders. Compute shader support can be queried runtime using SystemInfo.supportsComputeShaders. See the Compute Shaders Manual page for more information about platforms supporting compute shaders. In regular graphics shaders the compute buffer support requires minimum shader model 4.5.

On the shader side, ComputeBuffers with default ComputeBufferType map to StructuredBuffer<T> and RWStructuredBuffer<T> in HLSL.

See Also: ComputeShader class, Shader.SetGlobalBuffer, Material.SetBuffer, Compute Shaders overview.

変数

countバッファ要素の数(読み取り専用) .
strideバッファの一つの要素のサイズ(読み取り専用) .

コンストラクタ

ComputeBufferCompute Buffer を作成します

Public 関数

GetDataバッファからデータの値を配列へと読み出します
GetNativeBufferPtrRetrieve a native (underlying graphics API) pointer to the buffer.
ReleaseCompute Buffer をリリースします
SetCounterValueappend/consume バッファのカウンターの値を設定します。
SetData配列から値をバッファへと設定します

Static 関数

CopyCountappend/consume バッファの値を別のバッファにカウンター変数をコピーします。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961