Table of Contents

Class Preprocessor

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

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.

public sealed class Preprocessor
Inheritance
Preprocessor
Inherited Members

Methods

Flatten(string, string, MacroSet, IIncludeResolver, IReadOnlyList<string>)

Expands all includes in the source and prepends the platform macros.

public Result<PreprocessedSource, ShaderError> Flatten(string cleanedHlsl, string originalFilePath, MacroSet macros, IIncludeResolver includeResolver, IReadOnlyList<string> additionalPaths)

Parameters

cleanedHlsl string

The HLSL entry source (comments may still be present; the include scanner is comment-aware and ignores directives inside them).

originalFilePath string

The entry source's path, used for diagnostics and relative includes.

macros MacroSet

The platform macros to prepend.

includeResolver IIncludeResolver

The resolver used to fetch #include targets.

additionalPaths IReadOnlyList<string>

Extra include search directories.

Returns

Result<PreprocessedSource, ShaderError>

The flattened source on success, or a ShaderError on a missing or circular include.