ShaderCompiler::HlslEmitter class

Transforms an already-lowered modern-GLSL stage source into HLSL (Shader Model 4/5).

Public static functions

static auto Transform(StringView modernSource, bool vertexStage, const StageReflection& reflection, String& out, Diagnostic& diag) -> bool

Function documentation

static bool ShaderCompiler::HlslEmitter::Transform(StringView modernSource, bool vertexStage, const StageReflection& reflection, String& out, Diagnostic& diag)

Transforms modernSource (as produced by ShaderParser::BuildStageSource) into HLSL, writing the result to out. vertexStage selects the vertex-vs-fragment lowering; reflection supplies texture-unit register assignments and the batched instance-block stride (for the emitted array size). Returns false and fills diag when the source uses a construct the emitter does not handle.