Table of Contents

Class EffectParameterInfo

Namespace
ShadowDusk.Core
Assembly
ShadowDusk.Core.dll

One .mgfx parameter record. MonoGame 3.8.2's Effect.ReadParameters reads Elements (array elements) and Members (struct members) as RECURSIVE parameter collections — elements first, then members, each a full nested parameter record (mirroring mgfxc's EffectObject.WriteParameter). A value-typed leaf (Scalar/Vector/Matrix with no elements/members) additionally carries a raw default-value blob of RowCountColumnCount4 bytes: the DefaultValue read off the HLSL initializer (float R = 1;), or zeros when the declaration has none. For an array, each element leaf carries its own blob.

public sealed record EffectParameterInfo : IEquatable<EffectParameterInfo>
Inheritance
EffectParameterInfo
Implements
Inherited Members

Constructors

EffectParameterInfo(byte, byte, string, string?, IReadOnlyList<AnnotationInfo>, byte, byte, IReadOnlyList<EffectParameterInfo>, IReadOnlyList<EffectParameterInfo>, byte[]?)

One .mgfx parameter record. MonoGame 3.8.2's Effect.ReadParameters reads Elements (array elements) and Members (struct members) as RECURSIVE parameter collections — elements first, then members, each a full nested parameter record (mirroring mgfxc's EffectObject.WriteParameter). A value-typed leaf (Scalar/Vector/Matrix with no elements/members) additionally carries a raw default-value blob of RowCountColumnCount4 bytes: the DefaultValue read off the HLSL initializer (float R = 1;), or zeros when the declaration has none. For an array, each element leaf carries its own blob.

public EffectParameterInfo(byte Class, byte Type, string Name, string? Semantic, IReadOnlyList<AnnotationInfo> Annotations, byte RowCount, byte ColumnCount, IReadOnlyList<EffectParameterInfo> Members, IReadOnlyList<EffectParameterInfo> Elements, byte[]? DefaultValue = null)

Parameters

Class byte

The MGFX parameter class (Scalar = 0, Vector = 1, Matrix = 2, Object = 3, Struct = 4).

Type byte

The MGFX parameter type (Bool = 1, Int32 = 2, Single = 3, textures, ...).

Name string

The parameter name (empty for an array element).

Semantic string

The semantic, if any.

Annotations IReadOnlyList<AnnotationInfo>

The annotations declared on the parameter.

RowCount byte

The row count (1 for a scalar or vector).

ColumnCount byte

The column count (1 for a scalar).

Members IReadOnlyList<EffectParameterInfo>

Struct members, each a full nested record.

Elements IReadOnlyList<EffectParameterInfo>

Array elements, each a full nested record.

DefaultValue byte[]

The default blob of a value-typed leaf, in the layout MonoGame's EffectParameter.Data holds (a matrix column by column), or null for zeros. When set it must be exactly RowCountColumnCount4 bytes; the writers refuse any other length.

Properties

Annotations

The annotations declared on the parameter.

public IReadOnlyList<AnnotationInfo> Annotations { get; init; }

Property Value

IReadOnlyList<AnnotationInfo>

Class

The MGFX parameter class (Scalar = 0, Vector = 1, Matrix = 2, Object = 3, Struct = 4).

public byte Class { get; init; }

Property Value

byte

ColumnCount

The column count (1 for a scalar).

public byte ColumnCount { get; init; }

Property Value

byte

DefaultValue

The default blob of a value-typed leaf, in the layout MonoGame's EffectParameter.Data holds (a matrix column by column), or null for zeros. When set it must be exactly RowCountColumnCount4 bytes; the writers refuse any other length.

public byte[]? DefaultValue { get; init; }

Property Value

byte[]

Elements

Array elements, each a full nested record.

public IReadOnlyList<EffectParameterInfo> Elements { get; init; }

Property Value

IReadOnlyList<EffectParameterInfo>

Members

Struct members, each a full nested record.

public IReadOnlyList<EffectParameterInfo> Members { get; init; }

Property Value

IReadOnlyList<EffectParameterInfo>

Name

The parameter name (empty for an array element).

public string Name { get; init; }

Property Value

string

RowCount

The row count (1 for a scalar or vector).

public byte RowCount { get; init; }

Property Value

byte

Semantic

The semantic, if any.

public string? Semantic { get; init; }

Property Value

string

Type

The MGFX parameter type (Bool = 1, Int32 = 2, Single = 3, textures, ...).

public byte Type { get; init; }

Property Value

byte