Class Buffer.Constant
Constant buffer helper methods.
public static class Buffer.Constant
- Inheritance
-
objectBuffer.Constant
Methods
New(GraphicsDevice, DataPointer, GraphicsResourceUsage)
Creates a new constant buffer with Dynamic usage.
[Obsolete("Use span instead")]
public static Buffer New(GraphicsDevice device, DataPointer value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueDataPointerThe value to initialize the constant buffer.
usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer
A constant buffer
New(GraphicsDevice, int, GraphicsResourceUsage)
Creates a new constant buffer with a default Dynamic usage.
public static Buffer New(GraphicsDevice device, int size, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
sizeintThe size in bytes.
usageGraphicsResourceUsageThe usage.
Returns
- Buffer
A constant buffer
New(GraphicsDevice, ReadOnlySpan<byte>, GraphicsResourceUsage)
Creates a new constant buffer with Dynamic usage.
public static Buffer New(GraphicsDevice device, ReadOnlySpan<byte> value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueReadOnlySpan<byte>The value to initialize the constant buffer.
usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer
A constant buffer
New<T>(GraphicsDevice)
Creates a new constant buffer with Dynamic usage.
public static Buffer<T> New<T>(GraphicsDevice device) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
Returns
- Buffer<T>
A constant buffer
Type Parameters
TType of the constant buffer to get the sizeof from
New<T>(GraphicsDevice, ref T, GraphicsResourceUsage)
Creates a new constant buffer with Dynamic usage.
public static Buffer<T> New<T>(GraphicsDevice device, ref T value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueTThe value to initialize the constant buffer.
usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer<T>
A constant buffer
Type Parameters
TType of the constant buffer to get the sizeof from
New<T>(GraphicsDevice, T[], GraphicsResourceUsage)
Creates a new constant buffer with Dynamic usage.
public static Buffer<T> New<T>(GraphicsDevice device, T[] value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueT[]The value to initialize the constant buffer.
usageGraphicsResourceUsageThe usage of this resource.
Returns
- Buffer<T>
A constant buffer
Type Parameters
TType of the constant buffer to get the sizeof from