From 4007f85d8dd7ca7767d773874d285552253d2b04 Mon Sep 17 00:00:00 2001 From: Kai Angulo Date: Mon, 28 Oct 2024 22:17:31 -0700 Subject: [PATCH] fix: add semantic comparison when comparing symbols --- glslang/MachineIndependent/linkValidate.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index b0c27e84..1d1a2979 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -132,6 +132,12 @@ static bool isSameSymbol(TIntermSymbol* symbol1, EShLanguage stage1, TIntermSymb if (isSameInterface(symbol1, stage1, symbol2, stage2)) { return symbol1->getType().getTypeName() == symbol2->getType().getTypeName(); } + } else if (symbol1->getQualifier().semanticName && symbol2->getQualifier().semanticName) { + std::string sem1 = symbol1->getQualifier().semanticName; + std::string sem2 = symbol2->getQualifier().semanticName; + + if (sem1 == sem2) + return true; } else if (symbol1->getName() == symbol2->getName()) return true; return false; @@ -470,6 +476,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(useStorageBuffer); MERGE_TRUE(invariantAll); MERGE_TRUE(hlslIoMapping); + MERGE_TRUE(mapUnusedUniforms); // TODO: sourceFile // TODO: sourceText