summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-glslang-compiler.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-06-02 13:44:04 -0400
committerGitHub <noreply@github.com>2021-06-02 13:44:04 -0400
commit7e93e8164c74f61b61ea66f215304abdf453965b (patch)
treecf722f2e16a2cf2b2c2dc77eec38d568730d8546 /source/compiler-core/slang-glslang-compiler.cpp
parentb699a36444a03a6f7b312e805de31395a2d2ff9c (diff)
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 <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/compiler-core/slang-glslang-compiler.cpp')
-rw-r--r--source/compiler-core/slang-glslang-compiler.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/source/compiler-core/slang-glslang-compiler.cpp b/source/compiler-core/slang-glslang-compiler.cpp
index e754cbdbc..e893ef0ea 100644
--- a/source/compiler-core/slang-glslang-compiler.cpp
+++ b/source/compiler-core/slang-glslang-compiler.cpp
@@ -256,20 +256,13 @@ SlangResult GlslangDownstreamCompiler::disassemble(SlangCompileTarget sourceBlob
// On unix systems we need to ensure pthread is loaded first.
// TODO(JS):
// There is an argument that this should be performed through the loader....
+ // NOTE! We don't currently load through a dependent library, as it is *assumed* something as core as 'ptheads'
+ // isn't going to be distributed with the shader compiler.
ComPtr<ISlangSharedLibrary> pthreadLibrary;
DefaultSharedLibraryLoader::load(loader, path, "pthread", pthreadLibrary.writeRef());
#endif
- // 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("slang-glslang", library.writeRef()));
- }
+ SLANG_RETURN_ON_FAIL(DownstreamCompilerUtil::loadSharedLibrary(path, loader, nullptr, "slang-glslang", library));
SLANG_ASSERT(library);
if (!library)