Table of Contents

Class MacroSet

Namespace
ShadowDusk.Core.Preprocessor
Assembly
ShadowDusk.Core.dll

A set of preprocessor macros applied to a compile, with helpers to render them either as prepended #define text or as DXC command-line -D flags.

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

Constructors

MacroSet(IReadOnlyList<MacroDefinition>)

A set of preprocessor macros applied to a compile, with helpers to render them either as prepended #define text or as DXC command-line -D flags.

public MacroSet(IReadOnlyList<MacroDefinition> Macros)

Parameters

Macros IReadOnlyList<MacroDefinition>

The macro definitions in the set.

Properties

Macros

The macro definitions in the set.

public IReadOnlyList<MacroDefinition> Macros { get; init; }

Property Value

IReadOnlyList<MacroDefinition>

Methods

ToDxcFlags()

Renders the macros as DXC command-line define flags (-D NAME=VALUE pairs).

public IReadOnlyList<string> ToDxcFlags()

Returns

IReadOnlyList<string>

The flattened flag list to pass to DXC.

ToTextPrepend(string)

Renders the macros as a header block of #define lines followed by a #line 1 directive that restores the original file path for diagnostics.

public string ToTextPrepend(string originalFilePath)

Parameters

originalFilePath string

The source path to restore via #line.

Returns

string

Text to prepend to the shader source.