Class Buffer.Typed
Typed buffer helper methods.
public static class Buffer.Typed
- Inheritance
-
objectBuffer.Typed
Remarks
Example in HLSL: Buffer<float4>.
Methods
New(GraphicsDevice, DataPointer, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed buffer Default uasge.
[Obsolete("Use span instead")]
public static Buffer New(GraphicsDevice device, DataPointer value, PixelFormat viewFormat, bool isUnorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueDataPointerThe value to initialize the Typed buffer.
viewFormatPixelFormatThe view format of the buffer.
isUnorderedAccessboolif set to
truethis buffer supports unordered access (RW in HLSL).usageGraphicsResourceUsageThe 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
deviceGraphicsDeviceThe GraphicsDevice.
countintThe number of data with the following viewFormat.
viewFormatPixelFormatThe view format of the buffer.
isUnorderedAccessboolif set to
truethis buffer supports unordered access (RW in HLSL).usageGraphicsResourceUsageThe usage.
Returns
- Buffer
A Typed buffer
New<T>(GraphicsDevice, ReadOnlySpan<T>, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed buffer Default uasge.
public static Buffer<T> New<T>(GraphicsDevice device, ReadOnlySpan<T> value, PixelFormat viewFormat, bool isUnorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueReadOnlySpan<T>The value to initialize the Typed buffer.
viewFormatPixelFormatThe view format of the buffer.
isUnorderedAccessboolif set to
truethis buffer supports unordered access (RW in HLSL).usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer<T>
A Typed buffer
Type Parameters
TType of the Typed buffer to get the sizeof from
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
deviceGraphicsDeviceThe GraphicsDevice.
valueT[]The value to initialize the Typed buffer.
viewFormatPixelFormatThe view format of the buffer.
isUnorderedAccessboolif set to
truethis buffer supports unordered access (RW in HLSL).usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer<T>
A Typed buffer
Type Parameters
TType of the Typed buffer to get the sizeof from