diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gfx/debug-layer/debug-shader-object.h | 4 | ||||
| -rw-r--r-- | tools/gfx/renderer-shared.cpp | 1 | ||||
| -rw-r--r-- | tools/gfx/renderer-shared.h | 10 | ||||
| -rw-r--r-- | tools/slang-cpp-extractor/node.cpp | 2 | ||||
| -rw-r--r-- | tools/slang-lookup-generator/lookup-generator-main.cpp | 11 | ||||
| -rw-r--r-- | tools/slang-profile/slang-profile-main.cpp | 6 | ||||
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 4 | ||||
| -rw-r--r-- | tools/test-server/test-server-main.cpp | 6 |
8 files changed, 21 insertions, 23 deletions
diff --git a/tools/gfx/debug-layer/debug-shader-object.h b/tools/gfx/debug-layer/debug-shader-object.h index 9f368a2c1..b5a268892 100644 --- a/tools/gfx/debug-layer/debug-shader-object.h +++ b/tools/gfx/debug-layer/debug-shader-object.h @@ -12,13 +12,13 @@ namespace debug struct ShaderOffsetKey { ShaderOffset offset; - bool operator==(ShaderOffsetKey other) + bool operator==(ShaderOffsetKey other) const { return offset.bindingArrayIndex == other.offset.bindingArrayIndex && offset.bindingRangeIndex == other.offset.bindingRangeIndex && offset.uniformOffset == other.offset.uniformOffset; } - Slang::HashCode getHashCode() + Slang::HashCode getHashCode() const { return Slang::combineHash( (Slang::HashCode)offset.uniformOffset, diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index 99188233a..1e4cbb2f4 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -3,6 +3,7 @@ #include "core/slang-io.h" #include "core/slang-token-reader.h" +#include "../../source/core/slang-stable-hash.h" #include "../../source/core/slang-file-system.h" #include "../../slang.h" diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h index 38aa775be..32aa22b48 100644 --- a/tools/gfx/renderer-shared.h +++ b/tools/gfx/renderer-shared.h @@ -1043,7 +1043,7 @@ struct ComponentKey Slang::UnownedStringSlice typeName; Slang::ShortList<ShaderComponentID> specializationArgs; Slang::HashCode hash; - Slang::HashCode getHashCode() + Slang::HashCode getHashCode() const { return hash; } @@ -1060,7 +1060,7 @@ struct PipelineKey PipelineStateBase* pipeline; Slang::ShortList<ShaderComponentID> specializationArgs; Slang::HashCode hash; - Slang::HashCode getHashCode() + Slang::HashCode getHashCode() const { return hash; } @@ -1070,7 +1070,7 @@ struct PipelineKey for (auto& arg : specializationArgs) hash = Slang::combineHash(hash, arg); } - bool operator==(const PipelineKey& other) + bool operator==(const PipelineKey& other) const { if (pipeline != other.pipeline) return false; @@ -1090,12 +1090,12 @@ struct OwningComponentKey Slang::String typeName; Slang::ShortList<ShaderComponentID> specializationArgs; Slang::HashCode hash; - Slang::HashCode getHashCode() + Slang::HashCode getHashCode() const { return hash; } template<typename KeyType> - bool operator==(const KeyType& other) + bool operator==(const KeyType& other) const { if (typeName != other.typeName) return false; diff --git a/tools/slang-cpp-extractor/node.cpp b/tools/slang-cpp-extractor/node.cpp index b606e4edf..1189e3815 100644 --- a/tools/slang-cpp-extractor/node.cpp +++ b/tools/slang-cpp-extractor/node.cpp @@ -316,7 +316,7 @@ void ScopeNode::addChild(Node* child) Node* ScopeNode::findChild(const UnownedStringSlice& name) const { - Node** nodePtr = m_childMap.tryGetValue(name); + Node* const* nodePtr = m_childMap.tryGetValue(name); if (nodePtr) { return *nodePtr; diff --git a/tools/slang-lookup-generator/lookup-generator-main.cpp b/tools/slang-lookup-generator/lookup-generator-main.cpp index 796275e4a..cb1c15dd3 100644 --- a/tools/slang-lookup-generator/lookup-generator-main.cpp +++ b/tools/slang-lookup-generator/lookup-generator-main.cpp @@ -103,12 +103,11 @@ static HashFindResult minimalPerfectHash(const List<String>& ss, HashParams& has const auto hash = [&](const String& s, const HashCode64 salt = 0) -> UInt32 { // - // The current getStableHashCode32 is susceptible to patterns of - // collisions causing the search to fail for the SPIR-V opnames - // - // getStableHashCode64 is better, although it still performs poorly on - // short strings, taking over 300000 iterations to diverge on "Ceil" - // and "FMix" (and place them in already unoccupied slots)! + // The current getStableHashCode is susceptible to patterns of + // collisions causing the search to fail for the SPIR-V opnames; it + // performs poorly on short strings, taking over 300000 iterations to + // diverge on "Ceil" and "FMix" (and place them in already unoccupied + // slots)! // // Use FNV Hash here which seem perform much better on these short inputs // https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function diff --git a/tools/slang-profile/slang-profile-main.cpp b/tools/slang-profile/slang-profile-main.cpp index 2bc97548f..7cf6cb6f8 100644 --- a/tools/slang-profile/slang-profile-main.cpp +++ b/tools/slang-profile/slang-profile-main.cpp @@ -17,7 +17,7 @@ SlangResult innerMain(int argc, char** argv) // Time the creation of the session { - const auto startTick = ProcessUtil::getClockTick(); + const auto startTick = Process::getClockTick(); for (Int i = 0; i < 32; ++i) { @@ -25,9 +25,9 @@ SlangResult innerMain(int argc, char** argv) slangSession.attach(spCreateSession(nullptr)); } - const auto endTick = ProcessUtil::getClockTick(); + const auto endTick = Process::getClockTick(); - printf("Ticks %f\n", double(endTick - startTick) / ProcessUtil::getClockFrequency()); + printf("Ticks %f\n", double(endTick - startTick) / Process::getClockFrequency()); return SLANG_OK; } diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 1359b4474..95ef4d55d 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3661,9 +3661,9 @@ bool testCategoryMatches( TestCategory* categoryToMatch, const Dictionary<TestCategory*, TestCategory*>& categorySet) { - for( auto item : categorySet ) + for( const auto& [_, category] : categorySet ) { - if(testCategoryMatches(categoryToMatch, item.value)) + if(testCategoryMatches(categoryToMatch, category)) return true; } return false; diff --git a/tools/test-server/test-server-main.cpp b/tools/test-server/test-server-main.cpp index 904a8db20..b37f8b29f 100644 --- a/tools/test-server/test-server-main.cpp +++ b/tools/test-server/test-server-main.cpp @@ -185,10 +185,8 @@ SlangResult TestServer::init(int argc, const char* const* argv) TestServer::~TestServer() { - for (auto& pair : m_unitTestModules) - { - pair.value->destroy(); - } + for (auto& [_, value] : m_unitTestModules) + value->destroy(); } slang::IGlobalSession* TestServer::getOrCreateGlobalSession() |
