From ec41631032b65973e8f92348e0a86bb9924ef981 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 1 Nov 2017 08:30:45 -0700 Subject: Allow use of dxc compiler for DXIL generation (#241) - Add shader model 6.0, 6.1, and 6.2 targets - Add DXIL and DXIL assembly as output formats - Add header for DXC API to `external/` - Add `dxc-support.cpp` that wraps usage of the API - Add `-pass-through dxc` option, equivalent to what we have for `fxc` Notes: * This does *not* include any logic to add `dxcompiler.dll` to our build process; that is way out of scope for the build complexity I'm ready to deal with * For right now, the use of `dxcompiler.dll` is hard-coded, and it must be discoverable in the current executable's search path; options to customize can come later * The `-pass-through` option is kind of silly because the code doesn't actually pay attention to the value (just whether it is set). If you set it to `fxc` but ask for DXIL, we pass through `dxc` anyway. --- source/slang/compiler.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/slang/compiler.h') diff --git a/source/slang/compiler.h b/source/slang/compiler.h index b7ab980fc..7b539ce69 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -47,6 +47,8 @@ namespace Slang SPIRVAssembly = SLANG_SPIRV_ASM, DXBytecode = SLANG_DXBC, DXBytecodeAssembly = SLANG_DXBC_ASM, + DXIL = SLANG_DXIL, + DXILAssembly = SLANG_DXIL_ASM, }; enum class ContainerFormat @@ -126,8 +128,9 @@ namespace Slang enum class PassThroughMode : SlangPassThrough { None = SLANG_PASS_THROUGH_NONE, // don't pass through: use Slang compiler - HLSL = SLANG_PASS_THROUGH_FXC, // pass through HLSL to `D3DCompile` API -// GLSL, // pass through GLSL to `glslang` library + fxc = SLANG_PASS_THROUGH_FXC, // pass through HLSL to `D3DCompile` API + dxc = SLANG_PASS_THROUGH_DXC, // pass through HLSL to `IDxcCompiler` API + glslang = SLANG_PASS_THROUGH_GLSLANG, // pass through GLSL to `glslang` library }; class SourceFile; -- cgit v1.2.3