Table of Contents

Struct SpecializationConstant

Namespace
NeoVeldrid
Assembly
NeoVeldrid.dll

Describes a single shader specialization constant. Used to substitute new values into Shaders when constructing a Pipeline.

public struct SpecializationConstant : IEquatable<SpecializationConstant>
Implements
Inherited Members

Constructors

SpecializationConstant(uint, ShaderConstantType, ulong)

Constructs a new SpecializationConstant.

public SpecializationConstant(uint id, ShaderConstantType type, ulong data)

Parameters

id uint

The constant variable ID, as defined in the Shader.

type ShaderConstantType

The type of data stored in this instance. Must be a scalar numeric type.

data ulong

An 8-byte block storing the contents of the specialization value. This is treated as an untyped buffer and is interepreted according to Type.

SpecializationConstant(uint, bool)

Constructs a new SpecializationConstant for a boolean.

public SpecializationConstant(uint id, bool value)

Parameters

id uint

The constant variable ID.

value bool

The constant value.

SpecializationConstant(uint, double)

Constructs a new SpecializationConstant for a 64-bit floating-point value.

public SpecializationConstant(uint id, double value)

Parameters

id uint

The constant variable ID.

value double

The constant value.

SpecializationConstant(uint, short)

Constructs a new SpecializationConstant for a 16-bit signed integer.

public SpecializationConstant(uint id, short value)

Parameters

id uint

The constant variable ID.

value short

The constant value.

SpecializationConstant(uint, int)

Constructs a new SpecializationConstant for a 32-bit signed integer.

public SpecializationConstant(uint id, int value)

Parameters

id uint

The constant variable ID.

value int

The constant value.

SpecializationConstant(uint, long)

Constructs a new SpecializationConstant for a 64-bit signed integer.

public SpecializationConstant(uint id, long value)

Parameters

id uint

The constant variable ID.

value long

The constant value.

SpecializationConstant(uint, float)

Constructs a new SpecializationConstant for a 32-bit floating-point value.

public SpecializationConstant(uint id, float value)

Parameters

id uint

The constant variable ID.

value float

The constant value.

SpecializationConstant(uint, ushort)

Constructs a new SpecializationConstant for a 16-bit unsigned integer.

public SpecializationConstant(uint id, ushort value)

Parameters

id uint

The constant variable ID.

value ushort

The constant value.

SpecializationConstant(uint, uint)

Constructs a new SpecializationConstant for a 32-bit unsigned integer.

public SpecializationConstant(uint id, uint value)

Parameters

id uint

The constant variable ID.

value uint

The constant value.

SpecializationConstant(uint, ulong)

Constructs a new SpecializationConstant for a 64-bit unsigned integer.

public SpecializationConstant(uint id, ulong value)

Parameters

id uint

The constant variable ID.

value ulong

The constant value.

Fields

Data

An 8-byte block storing the contents of the specialization value. This is treated as an untyped buffer and is interepreted according to Type.

public ulong Data

Field Value

ulong

ID

The constant variable ID, as defined in the Shader.

public uint ID

Field Value

uint

Type

The type of data stored in this instance. Must be a scalar numeric type.

public ShaderConstantType Type

Field Value

ShaderConstantType

Methods

Equals(SpecializationConstant)

Element-wise equality.

public bool Equals(SpecializationConstant other)

Parameters

other SpecializationConstant

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 int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.