From 3c7e1be0098f963225afd0ebe83340a991392892 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 17 Jan 2019 17:50:48 -0500 Subject: 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. --- source/slang/slang.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/slang/slang.cpp') 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 relPathBlob; - SLANG_RETURN_ON_FAIL(fileSystemExt->calcRelativePath(fromPathType, fromPath.begin(), path.begin(), relPathBlob.writeRef())); - String relPath(StringUtil::getString(relPathBlob)); - if (relPath.Length() <= 0) + ComPtr 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 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; } -- cgit v1.2.3