Show / Hide Table of Contents

Struct SpecializationConstant

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

Implements
System.IEquatable<SpecializationConstant>
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Veldrid
Assembly: cs.temp.dll.dll
Syntax
public struct SpecializationConstant : IEquatable<SpecializationConstant>

Constructors

SpecializationConstant(UInt32, Boolean)

Constructs a new SpecializationConstant for a boolean.

Declaration
public SpecializationConstant(uint id, bool value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Boolean value

The constant value.

SpecializationConstant(UInt32, Double)

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

Declaration
public SpecializationConstant(uint id, double value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Double value

The constant value.

SpecializationConstant(UInt32, Int16)

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

Declaration
public SpecializationConstant(uint id, short value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Int16 value

The constant value.

SpecializationConstant(UInt32, Int32)

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

Declaration
public SpecializationConstant(uint id, int value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Int32 value

The constant value.

SpecializationConstant(UInt32, Int64)

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

Declaration
public SpecializationConstant(uint id, long value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Int64 value

The constant value.

SpecializationConstant(UInt32, Single)

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

Declaration
public SpecializationConstant(uint id, float value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.Single value

The constant value.

SpecializationConstant(UInt32, UInt16)

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

Declaration
public SpecializationConstant(uint id, ushort value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.UInt16 value

The constant value.

SpecializationConstant(UInt32, UInt32)

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

Declaration
public SpecializationConstant(uint id, uint value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.UInt32 value

The constant value.

SpecializationConstant(UInt32, UInt64)

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

Declaration
public SpecializationConstant(uint id, ulong value)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID.

System.UInt64 value

The constant value.

SpecializationConstant(UInt32, ShaderConstantType, UInt64)

Constructs a new SpecializationConstant.

Declaration
public SpecializationConstant(uint id, ShaderConstantType type, ulong data)
Parameters
Type Name Description
System.UInt32 id

The constant variable ID, as defined in the Shader.

ShaderConstantType type

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

System.UInt64 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.

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.

Declaration
public ulong Data
Field Value
Type Description
System.UInt64

ID

The constant variable ID, as defined in the Shader.

Declaration
public uint ID
Field Value
Type Description
System.UInt32

Type

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

Declaration
public ShaderConstantType Type
Field Value
Type Description
ShaderConstantType

Methods

Equals(SpecializationConstant)

Element-wise equality.

Declaration
public bool Equals(SpecializationConstant other)
Parameters
Type Name Description
SpecializationConstant other

The instance to compare to.

Returns
Type Description
System.Boolean

True if all elements are equal; false otherswise.

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

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

Overrides
System.ValueType.GetHashCode()

Implements

System.IEquatable<T>
Back to top