From 5540df955cd8a0963de014fe3b09234b28cea644 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 10 Aug 2022 14:11:47 +0200 Subject: [PATCH] [dxbc] Rework semantic name matching --- src/dxbc/dxbc_chunk_isgn.cpp | 14 +++++++++++--- src/dxbc/dxbc_chunk_isgn.h | 8 ++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/dxbc/dxbc_chunk_isgn.cpp b/src/dxbc/dxbc_chunk_isgn.cpp index ce6617bd1..47f4eef46 100644 --- a/src/dxbc/dxbc_chunk_isgn.cpp +++ b/src/dxbc/dxbc_chunk_isgn.cpp @@ -99,13 +99,21 @@ namespace dxvk { bool DxbcIsgn::compareSemanticNames( - const std::string& a, const std::string& b) const { + const std::string& a, const std::string& b) { if (a.size() != b.size()) return false; for (size_t i = 0; i < a.size(); i++) { - if (std::toupper(a[i]) != std::toupper(b[i])) - return false; + char ac = a[i]; + char bc = b[i]; + + if (ac != bc) { + if (ac >= 'A' && ac <= 'Z') ac += 'a' - 'A'; + if (bc >= 'A' && bc <= 'Z') bc += 'a' - 'A'; + + if (ac != bc) + return false; + } } return true; diff --git a/src/dxbc/dxbc_chunk_isgn.h b/src/dxbc/dxbc_chunk_isgn.h index 030372f3f..1dce64add 100644 --- a/src/dxbc/dxbc_chunk_isgn.h +++ b/src/dxbc/dxbc_chunk_isgn.h @@ -56,14 +56,14 @@ namespace dxvk { void printEntries() const; + static bool compareSemanticNames( + const std::string& a, + const std::string& b); + private: std::vector m_entries; - bool compareSemanticNames( - const std::string& a, - const std::string& b) const; - }; }