Struct BufferDescription
- Namespace
- NeoVeldrid
- Assembly
- NeoVeldrid.dll
Describes a DeviceBuffer, used in the creation of DeviceBuffer objects by a ResourceFactory.
public struct BufferDescription : IEquatable<BufferDescription>
- Implements
- Inherited Members
Constructors
BufferDescription(uint, BufferUsage)
Constructs a new BufferDescription describing a non-dynamic DeviceBuffer.
public BufferDescription(uint sizeInBytes, BufferUsage usage)
Parameters
sizeInBytesuintThe desired capacity, in bytes.
usageBufferUsageIndicates how the DeviceBuffer will be used.
BufferDescription(uint, BufferUsage, uint)
Constructs a new BufferDescription.
public BufferDescription(uint sizeInBytes, BufferUsage usage, uint structureByteStride)
Parameters
sizeInBytesuintThe desired capacity, in bytes.
usageBufferUsageIndicates how the DeviceBuffer will be used.
structureByteStrideuintFor structured buffers, this value indicates the size in bytes of a single structure element, and must be non-zero. For all other buffer types, this value must be zero.
BufferDescription(uint, BufferUsage, uint, bool)
Constructs a new BufferDescription.
public BufferDescription(uint sizeInBytes, BufferUsage usage, uint structureByteStride, bool useTypedHlslBinding)
Parameters
sizeInBytesuintThe desired capacity, in bytes.
usageBufferUsageIndicates how the DeviceBuffer will be used.
structureByteStrideuintFor structured buffers, this value indicates the size in bytes of a single structure element, and must be non-zero. For all other buffer types, this value must be zero.
useTypedHlslBindingboolControls how a structured buffer is bound on HLSL-based backends (D3D11). Only meaningful when
usageincludes StructuredBufferReadOnly or StructuredBufferReadWrite. When true, binds as a typed(RW)StructuredBuffer<T>; use this when binding hand-written HLSL that declares its storage buffers with those types. When false, binds as a raw(RW)ByteAddressBuffer. Has no effect on non-HLSL backends.
Fields
SizeInBytes
The desired capacity, in bytes, of the DeviceBuffer.
public uint SizeInBytes
Field Value
StructureByteStride
For structured buffers, this value indicates the size in bytes of a single structure element, and must be non-zero. For all other buffer types, this value must be zero.
public uint StructureByteStride
Field Value
Usage
Indicates how the DeviceBuffer will be used.
public BufferUsage Usage
Field Value
UseTypedHlslBinding
Controls how a structured buffer is bound on HLSL-based backends (D3D11). Only meaningful when
Usage includes StructuredBufferReadOnly or
StructuredBufferReadWrite. When true, binds as a typed
(RW)StructuredBuffer<T>; use this when binding hand-written HLSL that declares its
storage buffers with those types. When false (default), binds as a raw (RW)ByteAddressBuffer.
Has no effect on non-HLSL backends.
public bool UseTypedHlslBinding
Field Value
Methods
Equals(BufferDescription)
Element-wise equality.
public readonly bool Equals(BufferDescription other)
Parameters
otherBufferDescriptionThe instance to compare to.
Returns
- bool
True if all elements are equal; false otherswise.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.