diff options
| author | azhirnov <zh1dron@gmail.com> | 2020-08-25 01:56:42 +0000 |
|---|---|---|
| committer | azhirnov <zh1dron@gmail.com> | 2020-08-25 01:56:42 +0000 |
| commit | 1313de1ab167fe67d14fa2a848946f442491ca11 (patch) | |
| tree | a87dad429e9a639b5403d0c923ca2d35b610479c /Graphics/GraphicsEngine | |
| parent | added AdapterId to Vulkan backend (diff) | |
| download | DiligentCore-1313de1ab167fe67d14fa2a848946f442491ca11.tar.gz DiligentCore-1313de1ab167fe67d14fa2a848946f442491ca11.zip | |
added HLSLTools, HLSL shader compiler refactoring
added ShaderCompiler field to ShaderCreateInfo,
fixed tests that doesn't compile on DXC,
added dxc/WinAdapter.h to fix compilation on linux
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/interface/Shader.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h index 8c8d0879..f3d9b198 100644 --- a/Graphics/GraphicsEngine/interface/Shader.h +++ b/Graphics/GraphicsEngine/interface/Shader.h @@ -80,6 +80,28 @@ DILIGENT_TYPED_ENUM(SHADER_SOURCE_LANGUAGE, Uint32) SHADER_SOURCE_LANGUAGE_GLSL_VERBATIM }; +/// Describes shader compiler +DILIGENT_TYPED_ENUM(SHADER_COMPILER, Uint32) +{ + /// Default compiler for specific language and API: + /// for Direct3D11 - external FXC + /// for Direct3D12 - external DXC + /// for OpenGL(ES) GLSL - native compiler + /// for OpenGL(ES) HLSL - HLSL2GLSL and native compiler + /// for Vulkan GLSL - builtin glslang + /// for Vulkan HLSL - builtin glslang (with limitted support for Shader Model 6.x) + SHADER_COMPILER_DEFAULT = 0, + + /// Builtin glslang compiler for GLSL and HLSL. + SHADER_COMPILER_GLSLANG, + + /// External HLSL compiler for Direct3D12 and Vulkan with Shader Model 6.x support. + SHADER_COMPILER_DXC, + + /// External HLSL compiler for Direct3D11 and Direct3D12 before Shader Model 6. + SHADER_COMPILER_FXC, +}; + /// Describes the flags that can be passed over to IShaderSourceInputStreamFactory::CreateInputStream2() function. DILIGENT_TYPED_ENUM(CREATE_SHADER_SOURCE_INPUT_STREAM_FLAGS, Uint32) { @@ -258,6 +280,9 @@ struct ShaderCreateInfo /// Shader source language. See Diligent::SHADER_SOURCE_LANGUAGE. SHADER_SOURCE_LANGUAGE SourceLanguage DEFAULT_INITIALIZER(SHADER_SOURCE_LANGUAGE_DEFAULT); + /// Shader compiler. See Diligent::SHADER_COMPILER. + SHADER_COMPILER ShaderCompiler DEFAULT_INITIALIZER(SHADER_COMPILER_DEFAULT); + /// HLSL shader model to use when compiling the shader. When default value /// is given (0, 0), the engine will attempt to use the highest HLSL shader model /// supported by the device. If the shader is created from the byte code, this value |
