[dxbc] Rework semantic name matching

This commit is contained in:
Philip Rebohle 2022-08-10 14:11:47 +02:00
parent ec0c377cf8
commit 5540df955c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 15 additions and 7 deletions

View File

@ -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;

View File

@ -56,14 +56,14 @@ namespace dxvk {
void printEntries() const;
static bool compareSemanticNames(
const std::string& a,
const std::string& b);
private:
std::vector<DxbcSgnEntry> m_entries;
bool compareSemanticNames(
const std::string& a,
const std::string& b) const;
};
}