Table of Contents

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

sizeInBytes uint

The desired capacity, in bytes.

usage BufferUsage

Indicates how the DeviceBuffer will be used.

BufferDescription(uint, BufferUsage, uint)

Constructs a new BufferDescription.

public BufferDescription(uint sizeInBytes, BufferUsage usage, uint structureByteStride)

Parameters

sizeInBytes uint

The desired capacity, in bytes.

usage BufferUsage

Indicates how the DeviceBuffer will be used.

structureByteStride uint

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.

BufferDescription(uint, BufferUsage, uint, bool)

Constructs a new BufferDescription.

public BufferDescription(uint sizeInBytes, BufferUsage usage, uint structureByteStride, bool useTypedHlslBinding)

Parameters

sizeInBytes uint

The desired capacity, in bytes.

usage BufferUsage

Indicates how the DeviceBuffer will be used.

structureByteStride uint

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.

useTypedHlslBinding bool

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, 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

uint

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

uint

Usage

Indicates how the DeviceBuffer will be used.

public BufferUsage Usage

Field Value

BufferUsage

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

bool

Methods

Equals(BufferDescription)

Element-wise equality.

public readonly bool Equals(BufferDescription other)

Parameters

other BufferDescription

The 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.