Class Buffer.StructuredCounter
StructuredCounter buffer helper methods.
public static class Buffer.StructuredCounter
- Inheritance
-
Buffer.StructuredCounter
Remarks
Example in HLSL: StructuredBuffer<float4> or RWStructuredBuffer<float4> for structured buffers supporting unordered access.
Methods
New(GraphicsDevice, DataPointer, int)
Creates a new StructuredCounter buffer Default usage.
[Obsolete("Use span instead")]
public static Buffer New(GraphicsDevice device, DataPointer value, int elementSize)
Parameters
device
GraphicsDeviceThe GraphicsDevice.
value
DataPointerThe value to initialize the StructuredCounter buffer.
elementSize
intSize of the element.
Returns
- Buffer
A StructuredCounter buffer
New(GraphicsDevice, int, int)
Creates a new StructuredCounter buffer accessible as a ShaderResourceView and as a UnorderedAccessView.
public static Buffer New(GraphicsDevice device, int count, int elementSize)
Parameters
device
GraphicsDeviceThe GraphicsDevice.
count
intThe number of element in this buffer.
elementSize
intSize of the struct.
Returns
- Buffer
A StructuredCounter buffer
New(GraphicsDevice, ReadOnlySpan<byte>, int)
Creates a new StructuredCounter buffer Default usage.
public static Buffer New(GraphicsDevice device, ReadOnlySpan<byte> value, int elementSize)
Parameters
device
GraphicsDeviceThe GraphicsDevice.
value
ReadOnlySpan<byte>The value to initialize the StructuredCounter buffer.
elementSize
intSize of the element.
Returns
- Buffer
A StructuredCounter buffer
New<T>(GraphicsDevice, int)
Creates a new StructuredCounter buffer accessible as a ShaderResourceView and optionally as a UnorderedAccessView.
public static Buffer<T> New<T>(GraphicsDevice device, int count) where T : unmanaged
Parameters
device
GraphicsDeviceThe GraphicsDevice.
count
intThe number of element in this buffer.
Returns
- Buffer<T>
A Structured buffer
Type Parameters
T
Type of the element in the structured buffer
New<T>(GraphicsDevice, T[])
Creates a new StructuredCounter buffer Default usage.
public static Buffer New<T>(GraphicsDevice device, T[] value) where T : unmanaged
Parameters
device
GraphicsDeviceThe GraphicsDevice.
value
T[]The value to initialize the StructuredCounter buffer.
Returns
- Buffer
A StructuredCounter buffer
Type Parameters
T
Type of the StructuredCounter buffer to get the sizeof from