summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-10-12 14:41:22 -0700
committerGitHub <noreply@github.com>2022-10-12 14:41:22 -0700
commit53b180a9383668246a152af41aec8f6e565904a4 (patch)
treec034dc6584dd7dd7b5451d9fd8b3972e6b5d0106 /source/slang
parentf0cd62b37c5dfbbdb3fb205f1be2b8beba0dfed4 (diff)
Add specialization args test (#2444)
* Added specialization args test; small cleanup changes to slang-digest.h * Moved slang::Digest inside namespace Slang
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-hash-utils.h11
-rw-r--r--source/slang/slang.cpp9
2 files changed, 4 insertions, 16 deletions
diff --git a/source/slang/slang-hash-utils.h b/source/slang/slang-hash-utils.h
index d0d610cb8..62232dd21 100644
--- a/source/slang/slang-hash-utils.h
+++ b/source/slang/slang-hash-utils.h
@@ -12,11 +12,7 @@ namespace Slang
{
DigestBuilder builder;
builder.addToDigest(text);
-
- slang::Digest textHash;
- builder.finalize(&textHash);
-
- return textHash;
+ return builder.finalize();
}
// Combines the two provided hashes.
@@ -25,10 +21,7 @@ namespace Slang
DigestBuilder builder;
builder.addToDigest(hashA);
builder.addToDigest(hashB);
-
- slang::Digest combined;
- builder.finalize(&combined);
- return combined;
+ return builder.finalize();
}
// Returns the stored hash in checksum as a String.
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index a6dcf8ab2..20cad2465 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -3482,19 +3482,14 @@ SLANG_NO_THROW void SLANG_MCALL ComponentType::computeDependencyBasedHash(
auto entryPointNameOverride = getEntryPointNameOverride(entryPointIndex);
builder.addToDigest(entryPointNameOverride);
- slang::Digest hash;
- builder.finalize(&hash);
- *outHash = hash;
+ *outHash = builder.finalize();
}
SLANG_NO_THROW void SLANG_MCALL ComponentType::computeASTBasedHash(slang::Digest* outHash)
{
DigestBuilder builder;
updateASTBasedHash(builder);
-
- slang::Digest hash;
- builder.finalize(&hash);
- *outHash = hash;
+ *outHash = builder.finalize();
}
SLANG_NO_THROW SlangResult SLANG_MCALL ComponentType::getEntryPointHostCallable(