diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-12-12 14:53:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-12 14:53:44 -0500 |
| commit | 15335549340c54fd7b89b28104ddc907e9c64638 (patch) | |
| tree | 02c4705fc7784c3003d14fc661894b5f88c05875 /source/core/slang-shared-library.h | |
| parent | 6e6a876a6b5ad3d2ef402757d2e20641f5a2b49b (diff) | |
Use DownstreamCompiler for all downstream compilers (#1152)
* CPPCompiler -> DownstreamCompiler
* Added DownstreamCompileResult to start abstraction such that we don't need files.
* * Split out slang-blob.cpp
* Made CompileResult hold a DownstreamCompileResult - for access to binary or ISlangSharedLibrary
* Keep temporary files in scope.
* Add a hash to the hex dump stream.
* Move all file tracking into DownstreamCompiler.
* WIP support for nvrtc.
* WIP: Adding support for nvrtc compiler.
Adding enum types, wiring up the nvrtc into slang.
* Fix remaining CPPCompiler references.
* Fix order issue on target string matching.
* Use ISlangSharedLibrary for nvrtc.
* Use DownstreamCompiler for nvrtc.
* WIP first pass at compilation win nvrtc.
* Added testing if file is on file system into CommandLineDownstreamCompiler.
Added sourceContentsPath.
* Make test cuda-compile.cu work by just compiling not comparing output.
* Genearlize DownstreamCompiler usage.
* Fix warning on clang.
* Remove CompilerType from DownstreamCompiler.
* Use DownstreamCompiler interface for all compilers.
NOTE for FXC, DXC and GLSLANG this doesn't mean using 'compile' - it's still extracting functions from shared library.
* Fix compiling on gcc/clang for DownstreamCompiler.
* Fix problem on non-vc builds with not having return on locateCompilers for VS.
* Change so no warning for code not reachable on locateCompilers for vs.
Diffstat (limited to 'source/core/slang-shared-library.h')
| -rw-r--r-- | source/core/slang-shared-library.h | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/source/core/slang-shared-library.h b/source/core/slang-shared-library.h index 9c58d4e10..0b5c5b2d7 100644 --- a/source/core/slang-shared-library.h +++ b/source/core/slang-shared-library.h @@ -13,18 +13,6 @@ namespace Slang { -/* NOTE! Do not change this enum without making the appropriate changes to DefaultSharedLibraryLoader::s_libraryNames */ -enum class SharedLibraryType -{ - Unknown, ///< Unknown compiler - Dxc, ///< Dxc compiler - Fxc, ///< Fxc compiler - Glslang, ///< Slang specific glslang compiler - Dxil, ///< Dxil is used with dxc - NVRTC, ///< Nvrtc compiler - CountOf, -}; - class DefaultSharedLibraryLoader : public ISlangSharedLibraryLoader { public: @@ -44,14 +32,8 @@ public: /// Get the singleton static DefaultSharedLibraryLoader* getSingleton() { return &s_singleton; } - /// Get the type from the name - static SharedLibraryType getSharedLibraryTypeFromName(const UnownedStringSlice& name); - /// Get the name from the type, or nullptr if not known - static const char* getSharedLibraryNameFromType(SharedLibraryType type) { return s_libraryNames[int(type)]; } - - /// Make a shared library to it's name - static const char* s_libraryNames[int(SharedLibraryType::CountOf)]; + static SlangResult load(ISlangSharedLibraryLoader* loader, const String& path, const String& name, ISlangSharedLibrary** outLibrary); private: /// Make so not constructible @@ -112,39 +94,6 @@ protected: String m_path; }; -class ConfigurableSharedLibraryLoader: public ISlangSharedLibraryLoader, public RefObject -{ -public: - typedef Result (*Func)(const char* pathIn, const String& entryString, SharedLibrary::Handle& handleOut); - - // IUnknown - SLANG_REF_OBJECT_IUNKNOWN_ALL - - // ISlangSharedLibraryLoader - virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadSharedLibrary(const char* path, ISlangSharedLibrary** sharedLibraryOut) SLANG_OVERRIDE; - - /// Function to replace the the path with entryString - static Result replace(const char* pathIn, const String& entryString, SharedLibrary::Handle& handleOut); - /// Function to change the path using the entryString - static Result changePath(const char* pathIn, const String& entryString, SharedLibrary::Handle& handleOut); - - void addEntry(const String& libName, Func func, const String& entryString) { m_entryMap.Add(libName, Entry{ func, entryString} ); } - void addEntry(SharedLibraryType libType, Func func, const String& entryString) { m_entryMap.Add(DefaultSharedLibraryLoader::getSharedLibraryNameFromType(libType), Entry { func, entryString} ); } - - virtual ~ConfigurableSharedLibraryLoader() {} - protected: - - struct Entry - { - Func func; - String entryString; - }; - - ISlangUnknown* getInterface(const Guid& guid); - - Dictionary<String, Entry> m_entryMap; -}; - } #endif // SLANG_SHARED_LIBRARY_H_INCLUDED |
