in Source/Core/ShaderConductor.cpp [945:979]
Compiler::ResultDesc ConvertBinary(const Compiler::ResultDesc& binaryResult, const Compiler::SourceDesc& source,
const Compiler::Options& options, const Compiler::TargetDesc& target)
{
if (!binaryResult.hasError)
{
if (target.asModule)
{
return binaryResult;
}
else
{
switch (target.language)
{
case ShadingLanguage::Dxil:
case ShadingLanguage::SpirV:
return binaryResult;
case ShadingLanguage::Hlsl:
case ShadingLanguage::Glsl:
case ShadingLanguage::Essl:
case ShadingLanguage::Msl_macOS:
case ShadingLanguage::Msl_iOS:
return CrossCompile(binaryResult, source, options, target);
default:
llvm_unreachable("Invalid shading language.");
break;
}
}
}
else
{
return binaryResult;
}
}