Skip to content

Commit bea0c47

Browse files
committed
actually use external opts in dxc
1 parent 5a3821f commit bea0c47

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/DxcSupport/dxcapi.extval.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ HRESULT DxcDllExtValidationLoader::CreateInstance2Impl(
405405
HRESULT
406406
DxcDllExtValidationLoader::InitializeForDll(LPCSTR dllName, LPCSTR fnName) {
407407
// Load dxcompiler.dll
408-
HRESULT Result =
409-
DxCompilerSupport.InitializeForDll(kDxCompilerLib, "DxcCreateInstance");
408+
HRESULT Result = DxCompilerSupport.InitializeForDll(dllName, fnName);
410409
// if dxcompiler.dll fails to load, return the failed HRESULT
411410
if (FAILED(Result)) {
412411
FailureReason = FailedCompilerLoad;

tools/clang/tools/dxclib/dxc.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,14 @@ int dxc::main(int argc, const char **argv_) {
14561456
// Setup a helper DLL.
14571457
DxcDllExtValidationLoader dxcSupport;
14581458
{
1459-
HRESULT dllResult = dxcSupport.initialize();
1459+
HRESULT dllResult;
1460+
if (!dxcOpts.ExternalLib.empty() || !dxcOpts.ExternalFn.empty())
1461+
dllResult =
1462+
dxcSupport.InitializeForDll(dxcOpts.ExternalLib.str().c_str(),
1463+
dxcOpts.ExternalFn.str().c_str());
1464+
else
1465+
dllResult = dxcSupport.initialize();
1466+
14601467
if (DXC_FAILED(dllResult)) {
14611468
switch (dxcSupport.getFailureReason()) {
14621469
case dxcSupport.FailedCompilerLoad: {

0 commit comments

Comments
 (0)