diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-09-01 16:39:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-01 16:39:08 -0400 |
| commit | cc0b81350f6b681c794b4ac7c0f3b5fe73cb19eb (patch) | |
| tree | 7fd935748f4da5daa381f6cf4ef5d06c6adfc0a6 /source/slang/slang-options.cpp | |
| parent | f64d8748d4396a90d27adbdc17db3bac4a58d666 (diff) | |
Make ISlangFileSystem derive from ICastable (#2386)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Make ISlangFileSystem derive from ICastable.
* Make ArchiveFileSystem into an interface
Make file systems atomically reference counted.
* Small fix.
* Some small fixes to work around issues of ICastable on ISlangFileSystem
* Use ISlangFileSystem derived type instead of IArchiveFileSystem. Can always get other interface with castAs.
* Some small fixes around change of interface returned from archive type functions.
* Remove CacheFileSystem member from linkage. Can access easily from m_fileSystemExt if necessary with as cast.
* Fix RiffFileSystem casting issue.
* Add a check around CacheFileSystem.
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index a86cd5e6b..a572ab375 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -1006,14 +1006,17 @@ struct OptionsParser } } - RefPtr<CacheFileSystem> cacheFileSystem; - SLANG_RETURN_ON_FAIL(ReproUtil::loadFileSystem(base, requestState, dirFileSystem, cacheFileSystem)); + ComPtr<ISlangFileSystemExt> fileSystem; + SLANG_RETURN_ON_FAIL(ReproUtil::loadFileSystem(base, requestState, dirFileSystem, fileSystem)); + + auto cacheFileSystem = as<CacheFileSystem>(fileSystem); + SLANG_ASSERT(cacheFileSystem); // I might want to make the dir file system the fallback file system... cacheFileSystem->setInnerFileSystem(dirFileSystem, cacheFileSystem->getUniqueIdentityMode(), cacheFileSystem->getPathStyle()); // Set as the file system - compileRequest->setFileSystem(cacheFileSystem); + compileRequest->setFileSystem(fileSystem); } else if (argValue == "-serial-ir") { |
