From 1f1009210844d65e6644930086d72ac321016a2b Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 13 Mar 2026 12:26:07 +0000 Subject: [PATCH] Fixes to glslang for compiling on Android and linux --- renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp | 2 +- .../glslang/glslang/MachineIndependent/ParseHelper.cpp | 5 +++-- .../glslang/glslang/MachineIndependent/SymbolTable.h | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp index 2877b7d39..a1285c500 100644 --- a/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -3071,7 +3071,7 @@ Instruction* Builder::createDescHeapLoadStoreBaseRemap(Id baseId, Op op) baseVal = chain->getResultId(); clearAccessChain(); } else if (instOp != Op::OpUntypedAccessChainKHR) { - assert("Not a untyped load type"); + assert(false && "Not a untyped load type"); } Instruction* inst = nullptr; diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index b484d0457..173020077 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -43,6 +43,7 @@ #include "Scan.h" #include +#include #include #include "Versions.h" @@ -1835,10 +1836,10 @@ void TParseContext::handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFun if (type.isCoopMatNV()) { // coopmatNV don't encode usage, so provide the correct usage by default - return {size->getArraySize(2), size->getArraySize(3), idx}; + return std::tuple(size->getArraySize(2), size->getArraySize(3), idx); } else { assert(type.isCoopMatKHR()); - return {size->getArraySize(1), size->getArraySize(2), size->getDimSize(3)}; + return std::tuple(size->getArraySize(1), size->getArraySize(2), size->getDimSize(3)); } }; diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h index 1d738c8f2..f00510c73 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -839,7 +839,9 @@ public: std::unordered_multimap collectBuiltinAlias() { std::unordered_multimap allRetargets; - for (int level = 0; level <= std::min(currentLevel(), builtinLevel); ++level) + // RD modification - some compilers get confused with this and expect an instantiation of the static const int + const int x = builtinLevel; + for (int level = 0; level <= std::min(currentLevel(), x); ++level) table[level]->collectRetargetedSymbols(allRetargets); return allRetargets;