diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-01-17 17:50:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-17 17:50:48 -0500 |
| commit | 3c7e1be0098f963225afd0ebe83340a991392892 (patch) | |
| tree | 4be05c44125c3378cb5278cd8f7615fc280ea0fc /source/slang/slang.cpp | |
| parent | 668078ac8be89e55c8e13ac429c4b0e63fb604dc (diff) | |
Feature/hash for source identity (#786)
* * Added COMMAND_LINE_SIMPLE test type
* Made how spawning works controllable by paramter/type SpawnType
* Made break-outside-loop and global-uniform run command line slangc
* calcRelativePath -> calcCombinedPath
* Add 64 bit version of GetHash.
* Add support for Hash based mode for CacheFileSystem.
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 38b417960..23f7a4e47 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -102,16 +102,16 @@ struct IncludeHandlerImpl : IncludeHandler ISlangFileSystemExt* fileSystemExt = _getFileSystemExt(); // Get relative path - ComPtr<ISlangBlob> relPathBlob; - SLANG_RETURN_ON_FAIL(fileSystemExt->calcRelativePath(fromPathType, fromPath.begin(), path.begin(), relPathBlob.writeRef())); - String relPath(StringUtil::getString(relPathBlob)); - if (relPath.Length() <= 0) + ComPtr<ISlangBlob> combinedPathBlob; + SLANG_RETURN_ON_FAIL(fileSystemExt->calcCombinedPath(fromPathType, fromPath.begin(), path.begin(), combinedPathBlob.writeRef())); + String combinedPath(StringUtil::getString(combinedPathBlob)); + if (combinedPath.Length() <= 0) { return SLANG_FAIL; } SlangPathType pathType; - SLANG_RETURN_ON_FAIL(fileSystemExt->getPathType(relPath.begin(), &pathType)); + SLANG_RETURN_ON_FAIL(fileSystemExt->getPathType(combinedPath.begin(), &pathType)); if (pathType != SLANG_PATH_TYPE_FILE) { return SLANG_E_NOT_FOUND; @@ -119,7 +119,7 @@ struct IncludeHandlerImpl : IncludeHandler // Get the canonical path ComPtr<ISlangBlob> canonicalPathBlob; - SLANG_RETURN_ON_FAIL(fileSystemExt->getCanoncialPath(relPath.begin(), canonicalPathBlob.writeRef())); + SLANG_RETURN_ON_FAIL(fileSystemExt->getCanoncialPath(combinedPath.begin(), canonicalPathBlob.writeRef())); // If the rel path exists -> the canonical path MUST exists too String canonicalPath(StringUtil::getString(canonicalPathBlob)); @@ -130,7 +130,7 @@ struct IncludeHandlerImpl : IncludeHandler } pathInfoOut.type = PathInfo::Type::Normal; - pathInfoOut.foundPath = relPath; + pathInfoOut.foundPath = combinedPath; pathInfoOut.canonicalPath = canonicalPath; return SLANG_OK; } |
