Class Buffer.Typed
Helper methods for creating Typed Buffers.
public static class Buffer.Typed
- Inheritance
-
objectBuffer.Typed
Remarks
A Typed Buffer is a Buffer that is accessed through a Shader Resource View with a specific format. Because of this, they are created with that specific format.
An example of this kind of Buffer in SDSL would be:
Buffer<float4> tb;
Methods
New(GraphicsDevice, DataPointer, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed Buffer with initial data.
[Obsolete("This method is obsolete. Use the span-based methods instead")]
public static Buffer New(GraphicsDevice device, DataPointer dataPointer, PixelFormat elementFormat, bool unorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataPointerDataPointerThe data pointer to the data to initialize the Typed Buffer.
elementFormatPixelFormatThe format of the typed elements in the Buffer.
unorderedAccessbooltrue if the Buffer should support unordered access (
RWin SDSL).usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
New(GraphicsDevice, int, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed Buffer of a given size.
public static Buffer New(GraphicsDevice device, int elementCount, PixelFormat elementFormat, bool unorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
elementCountintThe number of data with the following viewFormat.
elementFormatPixelFormatThe format of the typed elements in the Buffer.
unorderedAccessbooltrue if the Buffer should support unordered access (
RWin SDSL).usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
New<T>(GraphicsDevice, ReadOnlySpan<T>, PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed Buffer with initial data.
public static Buffer<T> New<T>(GraphicsDevice device, ReadOnlySpan<T> data, PixelFormat elementFormat, bool unorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataReadOnlySpan<T>The data to initialize the Typed Buffer.
elementFormatPixelFormatThe format of the typed elements in the Buffer.
unorderedAccessbooltrue if the Buffer should support unordered access (
RWin SDSL).usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
Type Parameters
TType of the data stored in the Buffer.
New<T>(GraphicsDevice, T[], PixelFormat, bool, GraphicsResourceUsage)
Creates a new Typed Buffer with initial data.
public static Buffer<T> New<T>(GraphicsDevice device, T[] data, PixelFormat elementFormat, bool unorderedAccess = false, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataT[]The data to initialize the Typed Buffer.
elementFormatPixelFormatThe format of the typed elements in the Buffer.
unorderedAccessbooltrue if the Buffer should support unordered access (
RWin SDSL).usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
Type Parameters
TType of the data stored in the Buffer.