Table of Contents

Namespace ShadowDusk.Core.Preprocessor

Classes

FileSystemIncludePathCanonicalizer

The disk-backed IIncludePathCanonicalizer: walks a path segment by segment and asks the file system for each segment's real name.

FileSystemIncludeResolver

An IIncludeResolver that resolves #include directives from the file system, searching first relative to the including file's directory and then the supplied additional search paths.

InMemoryIncludeResolver

An IIncludeResolver that resolves #include directives from an in-memory dictionary of file path → contents, with no disk access. Ideal for the WASM/in-browser host and for tests, where the entire shader source set is held in memory.

IncludeResolvedFile

The successful result of resolving an #include: the file's path and text.

MacroDefinition

A single preprocessor macro definition (a #define) injected into compilation.

MacroSet

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.

PlatformMacros

Provides the standard preprocessor macros (e.g. MGFX, GLSL/HLSL, per-target flags) that shaders branch on for each PlatformTarget, mirroring the macros mgfxc defines.

PreprocessedSource

The output of the include-flattening preprocessor pass: the fully expanded source text, the DXC macro flags to pass downstream, and the original file path for diagnostics.

Preprocessor

Flattens an HLSL source tree by expanding all #include directives (honoring #pragma once and detecting circular includes) and prepending the platform macros, producing a single self-contained PreprocessedSource for the compiler.

UserDefine

A user-supplied preprocessor macro — the library-level equivalent of mgfxc's /Defines: CLI flag, injected after the platform macros. Unlike MacroDefinition the value is free-form text, matching what fxc and mgfxc accept (NAME=text; a bare NAME defines 1).

Interfaces

IIncludePathCanonicalizer

Reports the spelling a resolved #include path actually has on the storage it came from, so the preprocessor can decide whether two differently-cased paths name the same file by asking rather than by guessing from the operating system.

IIncludeResolver

Resolves an HLSL #include directive to its source text. Supply a custom implementation via IncludeResolver to control where includes come from — e.g. InMemoryIncludeResolver to compile without touching disk (WASM/in-browser) or FileSystemIncludeResolver for normal file access.