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