Table of Contents

Class DxcPreprocessRequest

Namespace
ShadowDusk.HLSL.Dxc
Assembly
ShadowDusk.HLSL.dll

A DXC preprocess-only request (the -P path): expand #includes, #defines and conditional directives into a single flat HLSL text WITHOUT compiling. No entry point, stage, or profile is involved — preprocessing is stage-agnostic.

public sealed class DxcPreprocessRequest
Inheritance
DxcPreprocessRequest
Inherited Members

Remarks

Used by the zero-technique fallback in CompilationPipeline: the MonoGame stock effects (BasicEffect.fx etc.) declare their techniques only through the TECHNIQUE(name, vs, ps) macro from Macros.fxh, so the raw pre-parse sees zero literal technique blocks. Running DXC's preprocessor first expands the macro into a literal technique { pass { ... } } block the pre-parser can then read.

Properties

HlslSource

The HLSL source to preprocess (already #include-flattened upstream).

public required string HlslSource { get; init; }

Property Value

string

Macros

The macro defines to apply (the target's PlatformMacros set as -D pairs).

public IReadOnlyList<(string Name, string? Value)> Macros { get; init; }

Property Value

IReadOnlyList<(string Name, string Value)>

SourceFileName

The original source path, preserved for diagnostics.

public required string SourceFileName { get; init; }

Property Value

string