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
iduintThe constant variable ID, as defined in the Shader.
typeShaderConstantTypeThe type of data stored in this instance. Must be a scalar numeric type.
dataulongAn 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
SpecializationConstant(uint, double)
Constructs a new SpecializationConstant for a 64-bit floating-point value.
public SpecializationConstant(uint id, double value)
Parameters
SpecializationConstant(uint, short)
Constructs a new SpecializationConstant for a 16-bit signed integer.
public SpecializationConstant(uint id, short value)
Parameters
SpecializationConstant(uint, int)
Constructs a new SpecializationConstant for a 32-bit signed integer.
public SpecializationConstant(uint id, int value)
Parameters
SpecializationConstant(uint, long)
Constructs a new SpecializationConstant for a 64-bit signed integer.
public SpecializationConstant(uint id, long value)
Parameters
SpecializationConstant(uint, float)
Constructs a new SpecializationConstant for a 32-bit floating-point value.
public SpecializationConstant(uint id, float value)
Parameters
SpecializationConstant(uint, ushort)
Constructs a new SpecializationConstant for a 16-bit unsigned integer.
public SpecializationConstant(uint id, ushort value)
Parameters
SpecializationConstant(uint, uint)
Constructs a new SpecializationConstant for a 32-bit unsigned integer.
public SpecializationConstant(uint id, uint value)
Parameters
SpecializationConstant(uint, ulong)
Constructs a new SpecializationConstant for a 64-bit unsigned integer.
public SpecializationConstant(uint id, ulong value)
Parameters
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
ID
The constant variable ID, as defined in the Shader.
public uint ID
Field Value
Type
The type of data stored in this instance. Must be a scalar numeric type.
public ShaderConstantType Type
Field Value
Methods
Equals(SpecializationConstant)
Element-wise equality.
public bool Equals(SpecializationConstant other)
Parameters
otherSpecializationConstantThe 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.