class GpuBuffer
A GPU data buffer intended for use with a . You can read and write arbitrary data to and from the CPU and GPU. This allows for efficient parallel data processing on the GPU. Different GPU buffer types can be used depending on the provided . Using the default type buffers map to StructuredBuffer<T> and RWStructuredBuffer<T> in HLSL.
public int ElementCount { get; }
Number of elements in the buffer.
public int ElementSize { get; }
Size of a single element in the buffer.
public GpuBuffer.UsageFlags Usage { get; }
What sort of buffer this is
public GpuBuffer( int elementCount, int elementSize, GpuBuffer.UsageFlags flags = Structured, string debugName = null )
Creates a new GPU buffer with a specified number of elements and a specific buffer type.
elementCountThe total number of elements that the GpuBuffer can hold. This represents the buffer's size in terms of elements, not bytes.elementSizeThe total number of elements that the GpuBuffer can hold. This represents the buffer's size in terms of elements, not bytes.flagsDefines the usage pattern of the GPU buffer. This can affect performance depending on how the buffer is utilized.debugNameTest
public void CopyStructureCount( GpuBuffer destBuffer, int destBufferOffset = 0 )
For buffers there is a hidden uint 32-bit atomic counter in the buffer that contains the number of writes to the buffer after invocation of the compute shader. In order to get the value of the counter, the data needs to be copied to another GPU buffer that can be used.
public void SetCounterValue( uint counterValue )
Sets the counter value for or structured buffers.
public bool IsValid { get; }
😔 No documentation found.
public void Dispose( )
😔 No documentation found.
public void GetData( Span<T> data )
😔 No documentation found.
public void GetData( Span<T> data, int start, int count )
😔 No documentation found.
public void SetData( Span<T> data, int elementOffset = 0 )
😔 No documentation found.
public void SetData( List<T> data, int elementOffset = 0 )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.