@@ -105,7 +105,7 @@ class DXCompilerImpl final : public IDXCompiler
105105
106106 virtual void Compile (const ShaderCreateInfo& ShaderCI,
107107 ShaderVersion ShaderModel,
108- const char * ExtraDefinitions ,
108+ const char * Preamble ,
109109 IDxcBlob** ppByteCodeBlob,
110110 std::vector<uint32_t >* pByteCode,
111111 IDataBlob** ppCompilerOutput) noexcept (false ) override final ;
@@ -688,7 +688,7 @@ void DXCompilerImpl::GetD3D12ShaderReflection(IDxcBlob* pShaderBy
688688
689689void DXCompilerImpl::Compile (const ShaderCreateInfo& ShaderCI,
690690 ShaderVersion ShaderModel,
691- const char * ExtraDefinitions ,
691+ const char * Preamble ,
692692 IDxcBlob** ppByteCodeBlob,
693693 std::vector<uint32_t >* pByteCode,
694694 IDataBlob** ppCompilerOutput) noexcept (false )
@@ -781,7 +781,8 @@ void DXCompilerImpl::Compile(const ShaderCreateInfo& ShaderCI,
781781
782782 IDXCompiler::CompileAttribs CA;
783783
784- const String Source = BuildHLSLSourceString (ShaderCI, ExtraDefinitions);
784+ String Source{Preamble != nullptr ? Preamble : " " };
785+ Source.append (BuildHLSLSourceString (ShaderCI));
785786
786787 DxcDefine Defines[] = {{L" DXCOMPILER" , L" 1" }};
787788
0 commit comments