Table of Contents

Class GlobalInitializerDefault

Namespace
ShadowDusk.HLSL
Assembly
ShadowDusk.HLSL.dll

The default value of one global uniform, read off its HLSL initializer (float R = 1;).

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

Constructors

GlobalInitializerDefault(string, byte, byte, int, int, int, IReadOnlyList<byte[]>, string, int, int)

The default value of one global uniform, read off its HLSL initializer (float R = 1;).

public GlobalInitializerDefault(string Name, byte Class, byte Type, int Rows, int Columns, int ArrayLength, IReadOnlyList<byte[]> ElementBlobs, string File, int Line, int Column)

Parameters

Name string

The parameter name.

Class byte

The MGFX parameter class: Scalar = 0, Vector = 1, Matrix = 2.

Type byte

The MGFX parameter type: Bool = 1, Int32 = 2, Single = 3.

Rows int

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

Columns int

The MGFX column count (1 for a scalar).

ArrayLength int

The declared array length, or 0 when the declaration is not an array.

ElementBlobs IReadOnlyList<byte[]>

One default blob per array element (a single blob when not an array), each Rows * Columns * 4 bytes in the layout MonoGame's EffectParameter.Data holds.

File string

The author's file the declaration is in.

Line int

The 1-based line of the declared name.

Column int

The 1-based column of the declared name.

Properties

ArrayLength

The declared array length, or 0 when the declaration is not an array.

public int ArrayLength { get; init; }

Property Value

int

Class

The MGFX parameter class: Scalar = 0, Vector = 1, Matrix = 2.

public byte Class { get; init; }

Property Value

byte

Column

The 1-based column of the declared name.

public int Column { get; init; }

Property Value

int

Columns

The MGFX column count (1 for a scalar).

public int Columns { get; init; }

Property Value

int

ElementBlobs

One default blob per array element (a single blob when not an array), each Rows * Columns * 4 bytes in the layout MonoGame's EffectParameter.Data holds.

public IReadOnlyList<byte[]> ElementBlobs { get; init; }

Property Value

IReadOnlyList<byte[]>

EndColumn

The 1-based column of the initializer's last character; see EndLine.

public int EndColumn { get; init; }

Property Value

int

EndLine

The 1-based line of the initializer's last character in File; with EndColumn it closes the span (Line, Column) .. (EndLine, EndColumn) that runs from the declared name to the end of its initializer. A compiler reports a diagnostic about the initializer somewhere inside that span (DXC's SPIR-V path at the initializer's first token, its DXIL path at the name), which can be lines below the name (float4 C = / { 1, 0, 0, 1 };). 0 when unknown: the span is the name alone.

public int EndLine { get; init; }

Property Value

int

File

The author's file the declaration is in.

public string File { get; init; }

Property Value

string

Kind

The declared scalar kind. Type is the MGFX type, which is Int32 for both int and uint (and every compiler we drive reflects a uint as Int32, a bool too on Vulkan), so this is what says how a 32-bit word of the blob reads (issue #427). When not set it follows Type: Bool, Int or Float.

public GlobalInitializerKind Kind { get; init; }

Property Value

GlobalInitializerKind

Line

The 1-based line of the declared name.

public int Line { get; init; }

Property Value

int

Name

The parameter name.

public string Name { get; init; }

Property Value

string

Rows

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

public int Rows { get; init; }

Property Value

int

Type

The MGFX parameter type: Bool = 1, Int32 = 2, Single = 3.

public byte Type { get; init; }

Property Value

byte