From 67384dd18b1715a61851017763d3b3f49f07edd2 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Mon, 16 May 2022 23:03:37 -0400 Subject: [PATCH] fix structure indexing reassignment during block merging For EOpIndexDirectStruct binaries, we want to visit the left symbol (the structure) before we visit the binary, so it gets updated first. That way we are comparing the updated structure against the target 'unitType', not the original structure. --- glslang/MachineIndependent/linkValidate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 9b45570e..7fed096b 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -642,7 +642,7 @@ void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* bl } TMergeBlockTraverser(const TIntermSymbol* newSym, const glslang::TType* unitType, glslang::TIntermediate* unit, const std::map* memberIdxUpdates) - : newSymbol(newSym), unitType(unitType), unit(unit), memberIndexUpdates(memberIdxUpdates) + : TIntermTraverser(false, true), newSymbol(newSym), unitType(unitType), unit(unit), memberIndexUpdates(memberIdxUpdates) { } virtual ~TMergeBlockTraverser() {}