Table of Contents

Namespace ShadowDusk.Core.Preprocessor

Classes

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.

Interfaces

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.