From 7e93e8164c74f61b61ea66f215304abdf453965b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 2 Jun 2021 13:44:04 -0400 Subject: Downstream compiler location fix. (#1866) * #include an absolute path didn't work - because paths were taken to always be relative. * Move logic to determine how to load a downstream shared library to DownstreamCompilerUtil::loadSharedLibrary. Handle if the given path is directory or a file. * Improve comment. * Special handling for a downstream compiler loading SharedLibrary detection - take into account filename may be different. * Handle cases if path is set but paths can't be determined. * Fix typo. Co-authored-by: T. Foley --- source/compiler-core/slang-fxc-compiler.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source/compiler-core/slang-fxc-compiler.cpp') diff --git a/source/compiler-core/slang-fxc-compiler.cpp b/source/compiler-core/slang-fxc-compiler.cpp index b0a117d1a..62113a629 100644 --- a/source/compiler-core/slang-fxc-compiler.cpp +++ b/source/compiler-core/slang-fxc-compiler.cpp @@ -326,16 +326,7 @@ SlangResult FXCDownstreamCompiler::disassemble(SlangCompileTarget sourceBlobTarg { ComPtr library; - // If the user supplies a path to their preferred version of FXC, - // we just use this. - if (path.getLength() != 0) - { - SLANG_RETURN_ON_FAIL(loader->loadSharedLibrary(path.getBuffer(), library.writeRef())); - } - else - { - SLANG_RETURN_ON_FAIL(loader->loadSharedLibrary("d3dcompiler_47", library.writeRef())); - } + SLANG_RETURN_ON_FAIL(DownstreamCompilerUtil::loadSharedLibrary(path, loader, nullptr, "d3dcompiler_47", library)); SLANG_ASSERT(library); if (!library) -- cgit v1.2.3