Class Buffer.Typed
Typed buffer helper methods.
public static class Buffer.Typed
- Inheritance
-
Buffer.Typed
Remarks
Example in HLSL: Buffer<float4>.
Methods
New(GraphicsDevice, DataPointer, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed buffer Default uasge.
public static Buffer New(GraphicsDevice device, DataPointer value, PixelFormat viewFormat, bool isUnorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
device
GraphicsDeviceThe GraphicsDevice.
value
DataPointerThe value to initialize the Typed buffer.
viewFormat
PixelFormatThe view format of the buffer.
isUnorderedAccess
boolif set to
true
this buffer supports unordered access (RW in HLSL).usage
GraphicsResourceUsageThe usage of this resource.
Returns
- Buffer
A Typed buffer
New(GraphicsDevice, int, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed buffer Default uasge.
public static Buffer New(GraphicsDevice device, int count, PixelFormat viewFormat, bool isUnorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
device
GraphicsDeviceThe GraphicsDevice.
count
intThe number of data with the following viewFormat.
viewFormat
PixelFormatThe view format of the buffer.
isUnorderedAccess
boolif set to
true
this buffer supports unordered access (RW in HLSL).usage
GraphicsResourceUsageThe usage.
Returns
- Buffer
A Typed buffer
New<T>(GraphicsDevice, T[], PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed buffer Default uasge.
public static Buffer<T> New<T>(GraphicsDevice device, T[] value, PixelFormat viewFormat, bool isUnorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
Parameters
device
GraphicsDeviceThe GraphicsDevice.
value
T[]The value to initialize the Typed buffer.
viewFormat
PixelFormatThe view format of the buffer.
isUnorderedAccess
boolif set to
true
this buffer supports unordered access (RW in HLSL).usage
GraphicsResourceUsageThe usage of this resource.
Returns
- Buffer<T>
A Typed buffer
Type Parameters
T
Type of the Typed buffer to get the sizeof from