summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-spirv.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index f63d2e417..f7d8a4ec6 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -972,21 +972,13 @@ struct SPIRVEmitContext
struct SpvTypeInstKey
{
List<SpvWord> words;
- bool operator==(const SpvTypeInstKey& other)
+ bool operator==(const SpvTypeInstKey& other) const { return words == other.words; }
+ const static bool kHasUniformHash = true;
+ auto getHashCode() const
{
- if (words.getCount() != other.words.getCount())
- return false;
- for (Index i = 0; i < words.getCount(); i++)
- if (words[i] != other.words[i])
- return false;
- return true;
- }
- HashCode getHashCode()
- {
- HashCode result = 0;
- for (auto word : words)
- result = combineHash(result, word);
- return result;
+ return Slang::getHashCode(
+ reinterpret_cast<const char*>(words.getBuffer()),
+ words.getCount() * sizeof(SpvWord));
}
};