UnityEngine.ComputeBuffer.ComputeBuffer C# (CSharp) Method

ComputeBuffer() public method

Create a Compute Buffer.

public ComputeBuffer ( int count, int stride, ComputeBufferType type ) : System
count int Number of elements in the buffer.
stride int Size of one element in the buffer. Has to match size of buffer type in the shader. See for cross-platform compatibility information.
type ComputeBufferType Type of the buffer, default is ComputeBufferType.Default.
return System
        public ComputeBuffer(int count, int stride, ComputeBufferType type)
        {
            if (count <= 0)
            {
                throw new ArgumentException("Attempting to create a zero length compute buffer", "count");
            }
            if (stride < 0)
            {
                throw new ArgumentException("Attempting to create a compute buffer with a negative stride", "stride");
            }
            this.m_Ptr = IntPtr.Zero;
            InitBuffer(this, count, stride, type);
        }

Same methods

ComputeBuffer::ComputeBuffer ( int count, int stride ) : System