From de22107d7f30d79a879bfec174de917931565e3a Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@qt.io>
Date: Mon, 16 Aug 2021 17:09:54 +0200
Subject: [PATCH] glslang: Namespace and rename symbols that can conflict

...in static INTEGRITY builds.

Fixes: QTBUG-95048
Change-Id: I10e74dae15969abbadcfc55a7147b723938ca80e
---
 .../glslang/OGLCompilersDLL/InitializeDll.cpp     |  2 ++
 .../glslang/OGLCompilersDLL/InitializeDll.h       |  2 ++
 src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp       |  9 +++++++--
 src/3rdparty/glslang/SPIRV/GlslangToSpv.h         |  2 ++
 src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp     |  1 +
 src/3rdparty/glslang/SPIRV/SpvTools.cpp           |  4 +++-
 src/3rdparty/glslang/SPIRV/SpvTools.h             |  3 ++-
 .../glslang/glslang/GenericCodeGen/CodeGen.cpp    |  3 +++
 .../glslang/glslang/GenericCodeGen/Link.cpp       |  3 +++
 src/3rdparty/glslang/glslang/Include/BaseTypes.h  |  2 ++
 src/3rdparty/glslang/glslang/Include/Common.h     |  9 ++++++---
 .../glslang/glslang/Include/ConstantUnion.h       |  2 ++
 src/3rdparty/glslang/glslang/Include/InfoSink.h   |  2 ++
 .../glslang/glslang/Include/InitializeGlobals.h   |  2 ++
 src/3rdparty/glslang/glslang/Include/PoolAlloc.h  |  2 ++
 src/3rdparty/glslang/glslang/Include/ShHandle.h   |  5 +++++
 src/3rdparty/glslang/glslang/Include/Types.h      |  2 ++
 src/3rdparty/glslang/glslang/Include/arrays.h     |  2 ++
 .../glslang/glslang/Include/intermediate.h        |  3 +++
 .../glslang/MachineIndependent/Constant.cpp       |  5 +++--
 .../glslang/MachineIndependent/InfoSink.cpp       |  2 ++
 .../glslang/MachineIndependent/Initialize.cpp     |  2 ++
 .../glslang/MachineIndependent/Initialize.h       |  2 ++
 .../glslang/MachineIndependent/IntermTraverse.cpp |  2 ++
 .../glslang/MachineIndependent/Intermediate.cpp   |  3 +++
 .../glslang/MachineIndependent/LiveTraverser.h    |  2 ++
 .../MachineIndependent/ParseContextBase.cpp       |  2 ++
 .../glslang/MachineIndependent/ParseHelper.cpp    |  4 +++-
 .../glslang/MachineIndependent/ParseHelper.h      |  2 ++
 .../glslang/MachineIndependent/PoolAlloc.cpp      |  2 ++
 .../glslang/MachineIndependent/RemoveTree.cpp     |  2 ++
 .../glslang/MachineIndependent/RemoveTree.h       |  4 +++-
 .../glslang/glslang/MachineIndependent/Scan.cpp   |  5 +++++
 .../glslang/glslang/MachineIndependent/Scan.h     |  2 ++
 .../glslang/MachineIndependent/ScanContext.h      |  2 ++
 .../glslang/MachineIndependent/ShaderLang.cpp     | 15 ++++++++-------
 .../glslang/MachineIndependent/SymbolTable.cpp    |  2 ++
 .../glslang/MachineIndependent/SymbolTable.h      |  2 ++
 .../glslang/MachineIndependent/Versions.cpp       |  2 ++
 .../glslang/glslang/MachineIndependent/Versions.h |  3 ++-
 .../glslang/MachineIndependent/attribute.cpp      |  2 ++
 .../glslang/MachineIndependent/attribute.h        |  2 ++
 .../glslang/MachineIndependent/glslang_tab.cpp    |  9 ++++++---
 .../glslang/MachineIndependent/glslang_tab.cpp.h  |  2 ++
 .../glslang/MachineIndependent/intermOut.cpp      |  3 +++
 .../glslang/MachineIndependent/iomapper.cpp       |  3 +++
 .../glslang/glslang/MachineIndependent/iomapper.h |  3 ++-
 .../glslang/glslang/MachineIndependent/limits.cpp |  2 ++
 .../glslang/MachineIndependent/linkValidate.cpp   |  2 ++
 .../MachineIndependent/localintermediate.h        |  3 ++-
 .../glslang/MachineIndependent/parseConst.cpp     |  2 ++
 .../glslang/MachineIndependent/parseVersions.h    |  2 ++
 .../MachineIndependent/preprocessor/Pp.cpp        |  2 ++
 .../MachineIndependent/preprocessor/PpAtom.cpp    |  3 +++
 .../MachineIndependent/preprocessor/PpContext.cpp |  2 ++
 .../MachineIndependent/preprocessor/PpContext.h   |  2 ++
 .../MachineIndependent/preprocessor/PpScanner.cpp |  2 ++
 .../MachineIndependent/preprocessor/PpTokens.cpp  |  2 ++
 .../MachineIndependent/preprocessor/PpTokens.h    |  2 ++
 .../MachineIndependent/propagateNoContraction.cpp |  3 +++
 .../MachineIndependent/propagateNoContraction.h   |  2 ++
 .../glslang/MachineIndependent/reflection.cpp     |  3 +++
 .../glslang/MachineIndependent/reflection.h       |  2 ++
 .../glslang/glslang/OSDependent/Unix/ossource.cpp |  2 ++
 .../glslang/OSDependent/Windows/ossource.cpp      |  2 ++
 .../glslang/glslang/OSDependent/osinclude.h       |  2 ++
 src/3rdparty/glslang/glslang/Public/ShaderLang.h  | 12 ++++++++----
 src/3rdparty/glslang/hlsl/hlslAttributes.cpp      |  1 +
 src/3rdparty/glslang/hlsl/hlslGrammar.cpp         |  1 +
 src/3rdparty/glslang/hlsl/hlslGrammar.h           |  2 ++
 src/3rdparty/glslang/hlsl/hlslParseHelper.cpp     |  1 +
 src/3rdparty/glslang/hlsl/hlslParseHelper.h       |  2 ++
 src/3rdparty/glslang/hlsl/hlslScanContext.cpp     |  2 ++
 src/shadertools/qspirvcompiler.cpp                |  2 ++
 74 files changed, 188 insertions(+), 28 deletions(-)

diff --git a/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp b/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp
index abea9108..4c044bf7 100644
--- a/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp
+++ b/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp
@@ -41,6 +41,7 @@
 #include "../glslang/Public/ShaderLang.h"
 #include "../glslang/Include/PoolAlloc.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
@@ -163,3 +164,4 @@ bool DetachProcess()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h b/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h
index 661cee4d..ab614f2d 100644
--- a/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h
+++ b/src/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h
@@ -36,6 +36,7 @@
 
 #include "../glslang/OSDependent/osinclude.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 bool InitProcess();
@@ -44,6 +45,7 @@ bool DetachThread();  // not called from standalone, perhaps other tools rely on
 bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // __INITIALIZEDLL_H
 
diff --git a/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
index 1adebef8..ba13cae1 100644
--- a/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
+++ b/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
@@ -118,6 +118,8 @@ struct OpDecorations {
 
 } // namespace
 
+
+using namespace QtShaderTools;
 //
 // The main holder of information for translating glslang to SPIR-V.
 //
@@ -8832,9 +8834,11 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
     }
 }
 #endif
-
 };  // end anonymous namespace
 
+
+namespace QtShaderTools {
+
 namespace glslang {
 
 void GetSpirvVersion(std::string& version)
@@ -8965,4 +8969,5 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>&
     GetThreadPoolAllocator().pop();
 }
 
-}; // end namespace glslang
+} // end namespace glslang
+}; // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/SPIRV/GlslangToSpv.h b/src/3rdparty/glslang/SPIRV/GlslangToSpv.h
index 3907be43..25b7e7a1 100644
--- a/src/3rdparty/glslang/SPIRV/GlslangToSpv.h
+++ b/src/3rdparty/glslang/SPIRV/GlslangToSpv.h
@@ -47,6 +47,7 @@
 
 #include "Logger.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 void GetSpirvVersion(std::string&);
@@ -59,3 +60,4 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
 void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
 
 }
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
index d40174d1..6b2653b3 100644
--- a/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
+++ b/src/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
@@ -56,6 +56,7 @@ namespace spv {
     #include "GLSL.ext.NV.h"
 }
 
+using namespace QtShaderTools;
 namespace spv {
 
 #ifndef GLSLANG_WEB
diff --git a/src/3rdparty/glslang/SPIRV/SpvTools.cpp b/src/3rdparty/glslang/SPIRV/SpvTools.cpp
index 16d051a9..04fa53d6 100644
--- a/src/3rdparty/glslang/SPIRV/SpvTools.cpp
+++ b/src/3rdparty/glslang/SPIRV/SpvTools.cpp
@@ -45,6 +45,7 @@
 #include "SpvTools.h"
 #include "spirv-tools/optimizer.hpp"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Translate glslang's view of target versioning to what SPIRV-Tools uses.
@@ -236,6 +237,7 @@ void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate,
     optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
 }
 
-}; // end namespace glslang
+} // end namespace glslang
+}; // namespace QtShaderTools
 
 #endif
diff --git a/src/3rdparty/glslang/SPIRV/SpvTools.h b/src/3rdparty/glslang/SPIRV/SpvTools.h
index 3fb3cbac..af5de445 100644
--- a/src/3rdparty/glslang/SPIRV/SpvTools.h
+++ b/src/3rdparty/glslang/SPIRV/SpvTools.h
@@ -50,6 +50,7 @@
 #include "glslang/MachineIndependent/localintermediate.h"
 #include "Logger.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 struct SpvOptions {
@@ -89,5 +90,5 @@ void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate,
 #endif
 
 } // end namespace glslang
-
+} // namespace QtShaderTools
 #endif // GLSLANG_SPV_TOOLS_H
diff --git a/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp b/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp
index b3c7226d..f061a936 100644
--- a/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp
+++ b/src/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp
@@ -36,6 +36,7 @@
 #include "../Include/ShHandle.h"
 #include "../MachineIndependent/Versions.h"
 
+namespace QtShaderTools {
 //
 // Here is where real machine specific high-level data would be defined.
 //
@@ -74,3 +75,5 @@ bool TGenericCompiler::compile(TIntermNode* /*root*/, int /*version*/, EProfile
 
     return haveValidObjectCode;
 }
+
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp
index c38db0f6..64d4413f 100644
--- a/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp
+++ b/src/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp
@@ -39,6 +39,7 @@
 #include "../Include/Common.h"
 #include "../Include/ShHandle.h"
 
+namespace QtShaderTools {
 //
 // Actual link object, derived from the shader handle base classes.
 //
@@ -89,3 +90,5 @@ void DeleteBindingList(TShHandleBase* bindingList)
 {
     delete bindingList;
 }
+
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/Include/BaseTypes.h b/src/3rdparty/glslang/glslang/Include/BaseTypes.h
index 55bdd25d..ca08fc6c 100644
--- a/src/3rdparty/glslang/glslang/Include/BaseTypes.h
+++ b/src/3rdparty/glslang/glslang/Include/BaseTypes.h
@@ -39,6 +39,7 @@
 #ifndef _BASICTYPES_INCLUDED_
 #define _BASICTYPES_INCLUDED_
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -573,5 +574,6 @@ __inline int getTypeRank(TBasicType type)
 }
 
 } // end namespace glslang
+} // QtShaderTools
 
 #endif // _BASICTYPES_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/Common.h b/src/3rdparty/glslang/glslang/Include/Common.h
index b628cdc2..115f6f73 100644
--- a/src/3rdparty/glslang/glslang/Include/Common.h
+++ b/src/3rdparty/glslang/glslang/Include/Common.h
@@ -119,6 +119,7 @@ std::string to_string(const T& val) {
     void operator delete[](void*) { }                                 \
     void operator delete[](void *, void *) { }
 
+namespace QtShaderTools {
 namespace glslang {
 
     //
@@ -128,12 +129,13 @@ namespace glslang {
     typedef std::basic_string <char, std::char_traits<char>, TStringAllocator> TString;
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 // Repackage the std::hash for use by unordered map/set with a TString key.
 namespace std {
 
-    template<> struct hash<glslang::TString> {
-        std::size_t operator()(const glslang::TString& s) const
+    template<> struct hash<QtShaderTools::glslang::TString> {
+        std::size_t operator()(const QtShaderTools::glslang::TString& s) const
         {
             const unsigned _FNV_offset_basis = 2166136261U;
             const unsigned _FNV_prime = 16777619U;
@@ -150,7 +152,7 @@ namespace std {
         }
     };
 }
-
+namespace QtShaderTools {
 namespace glslang {
 
 inline TString* NewPoolTString(const char* s)
@@ -287,5 +289,6 @@ template <class T> bool IsMultipleOfPow2(T number, int powerOf2)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _COMMON_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/ConstantUnion.h b/src/3rdparty/glslang/glslang/Include/ConstantUnion.h
index c4ffb857..b249372c 100644
--- a/src/3rdparty/glslang/glslang/Include/ConstantUnion.h
+++ b/src/3rdparty/glslang/glslang/Include/ConstantUnion.h
@@ -41,6 +41,7 @@
 #include "../Include/Common.h"
 #include "../Include/BaseTypes.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TConstUnion {
@@ -970,5 +971,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _CONSTANT_UNION_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/InfoSink.h b/src/3rdparty/glslang/glslang/Include/InfoSink.h
index dceb603c..8147308c 100644
--- a/src/3rdparty/glslang/glslang/Include/InfoSink.h
+++ b/src/3rdparty/glslang/glslang/Include/InfoSink.h
@@ -38,6 +38,7 @@
 #include "../Include/Common.h"
 #include <cmath>
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -140,5 +141,6 @@ public:
     glslang::TInfoSinkBase info;
     glslang::TInfoSinkBase debug;
 };
+} // namespace QtShaderTools
 
 #endif // _INFOSINK_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h b/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h
index 95d0a40e..fcdb8b05 100644
--- a/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h
+++ b/src/3rdparty/glslang/glslang/Include/InitializeGlobals.h
@@ -35,10 +35,12 @@
 #ifndef __INITIALIZE_GLOBALS_INCLUDED_
 #define __INITIALIZE_GLOBALS_INCLUDED_
 
+namespace QtShaderTools {
 namespace glslang {
 
 bool InitializePoolIndex();
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // __INITIALIZE_GLOBALS_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/PoolAlloc.h b/src/3rdparty/glslang/glslang/Include/PoolAlloc.h
index b8eccb88..3b03fd60 100644
--- a/src/3rdparty/glslang/glslang/Include/PoolAlloc.h
+++ b/src/3rdparty/glslang/glslang/Include/PoolAlloc.h
@@ -65,6 +65,7 @@
 #include <cstring>
 #include <vector>
 
+namespace QtShaderTools {
 namespace glslang {
 
 // If we are using guard blocks, we must track each individual
@@ -312,5 +313,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _POOLALLOC_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/ShHandle.h b/src/3rdparty/glslang/glslang/Include/ShHandle.h
index df07bd8e..1c72cf49 100644
--- a/src/3rdparty/glslang/glslang/Include/ShHandle.h
+++ b/src/3rdparty/glslang/glslang/Include/ShHandle.h
@@ -47,6 +47,8 @@
 #include "../MachineIndependent/Versions.h"
 #include "InfoSink.h"
 
+namespace QtShaderTools {
+
 class TCompiler;
 class TLinker;
 class TUniformMap;
@@ -152,6 +154,7 @@ protected:
     ShBindingTable* uniformBindings;                // created by the linker
 };
 
+
 //
 // This is the interface between the machine independent code
 // and the machine dependent code.
@@ -173,4 +176,6 @@ void DeleteCompiler(TCompiler*);
 
 void DeleteUniformMap(TUniformMap*);
 
+} // namespace QtShaderTools
+
 #endif // _SHHANDLE_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/Types.h b/src/3rdparty/glslang/glslang/Include/Types.h
index 696daf6d..77df5b7d 100644
--- a/src/3rdparty/glslang/glslang/Include/Types.h
+++ b/src/3rdparty/glslang/glslang/Include/Types.h
@@ -47,6 +47,7 @@
 
 #include <algorithm>
 
+namespace QtShaderTools {
 namespace glslang {
 
 const int GlslangMaxTypeLength = 200;  // TODO: need to print block/struct one member per line, so this can stay bounded
@@ -2494,5 +2495,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _TYPES_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/arrays.h b/src/3rdparty/glslang/glslang/Include/arrays.h
index 7f047d9f..afbbc718 100644
--- a/src/3rdparty/glslang/glslang/Include/arrays.h
+++ b/src/3rdparty/glslang/glslang/Include/arrays.h
@@ -43,6 +43,7 @@
 
 #include <algorithm>
 
+namespace QtShaderTools {
 namespace glslang {
 
 // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else.
@@ -337,5 +338,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _ARRAYS_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/Include/intermediate.h b/src/3rdparty/glslang/glslang/Include/intermediate.h
index 19cd32e9..c0a939c9 100644
--- a/src/3rdparty/glslang/glslang/Include/intermediate.h
+++ b/src/3rdparty/glslang/glslang/Include/intermediate.h
@@ -57,6 +57,7 @@
 #include "../Include/Types.h"
 #include "../Include/ConstantUnion.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TIntermediate;
@@ -1063,6 +1064,7 @@ class TIntermLoop;
 
 } // end namespace glslang
 
+
 //
 // Base class for the tree nodes
 //
@@ -1816,5 +1818,6 @@ inline bool SameSpecializationConstants(TIntermTyped* node1, TIntermTyped* node2
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // __INTERMEDIATE_H
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
index e21cf427..23c511eb 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
@@ -43,7 +43,7 @@
 #include <climits>
 
 namespace {
-
+using namespace QtShaderTools;
 using namespace glslang;
 
 typedef union {
@@ -79,7 +79,7 @@ const double pi = 3.1415926535897932384626433832795;
 
 } // end anonymous namespace
 
-
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -1426,3 +1426,4 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors<T
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp
index d00c4225..b16a8fb8 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp
@@ -36,6 +36,7 @@
 
 #include <cstring>
 
+namespace QtShaderTools {
 namespace glslang {
 
 void TInfoSinkBase::append(const char* s)
@@ -111,3 +112,4 @@ void TInfoSinkBase::append(const TString& t)
 }
 
 } // end namespace glslang
+} // QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
index a5ef6cca..7fada95a 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
@@ -54,6 +54,7 @@
 #include "../Include/intermediate.h"
 #include "Initialize.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // TODO: ARB_Compatability: do full extension support
@@ -9448,3 +9449,4 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h
index ac8ec33e..72885841 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Initialize.h
@@ -43,6 +43,7 @@
 #include "SymbolTable.h"
 #include "Versions.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -108,5 +109,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _INITIALIZE_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp
index 553b1b5f..e78c76f4 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp
@@ -37,6 +37,7 @@
 
 #include "../Include/intermediate.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -307,3 +308,4 @@ void TIntermSwitch::traverse(TIntermTraverser* it)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
index f6172a2b..84b4c551 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
@@ -49,6 +49,8 @@
 #include <utility>
 #include <tuple>
 
+namespace QtShaderTools {
+
 namespace glslang {
 
 ////////////////////////////////////////////////////////////////////////////
@@ -3988,3 +3990,4 @@ const char* TIntermediate::getResourceName(TResourceType res)
 
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h b/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h
index 9b39b598..b0c5ad5d 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h
@@ -44,6 +44,7 @@
 #include <list>
 #include <unordered_set>
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -166,3 +167,4 @@ private:
 };
 
 } // namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
index 3efa27ac..63a71c55 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
@@ -40,6 +40,7 @@
 
 #include "ParseHelper.h"
 
+namespace QtShaderTools {
 extern int yyparse(glslang::TParseContext*);
 
 namespace glslang {
@@ -661,3 +662,4 @@ void TParseContextBase::finish()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
index 9c42a204..54d85296 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
@@ -45,6 +45,8 @@
 
 #include "preprocessor/PpContext.h"
 
+namespace QtShaderTools {
+
 extern int yyparse(glslang::TParseContext*);
 
 namespace glslang {
@@ -8704,4 +8706,4 @@ const TTypeList* TParseContext::recordStructCopy(TStructRecord& record, const TT
 }
 
 } // end namespace glslang
-
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
index fe2b6fbb..46fafaaa 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
@@ -55,6 +55,7 @@
 #include "Scan.h"
 #include "attribute.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 struct TPragma {
@@ -531,5 +532,6 @@ protected:
 };
 
 } // end namespace glslang
+}
 
 #endif // _PARSER_HELPER_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp
index 84c40f4e..6fc470e7 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp
@@ -38,6 +38,7 @@
 #include "../Include/InitializeGlobals.h"
 #include "../OSDependent/osinclude.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Process-wide TLS index
@@ -313,3 +314,4 @@ void TAllocation::checkAllocList() const
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp
index 1d33bfd2..83dfc611 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp
@@ -37,6 +37,7 @@
 #include "../Include/intermediate.h"
 #include "RemoveTree.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -116,3 +117,4 @@ void RemoveAllTreeNodes(TIntermNode* root)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h
index 1ed01562..f793897e 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h
@@ -34,8 +34,10 @@
 
 #pragma once
 
+namespace QtShaderTools {
 namespace glslang {
 
-void RemoveAllTreeNodes(TIntermNode*);
+void RemoveAllTreeNodes(QtShaderTools::TIntermNode*);
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
index 78c8a365..5cadc8df 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
@@ -57,6 +57,7 @@
 #include "preprocessor/PpContext.h"
 #include "preprocessor/PpTokens.h"
 
+namespace QtShaderTools {
 // Required to avoid missing prototype warnings for some compilers
 int yylex(YYSTYPE*, glslang::TParseContext&);
 
@@ -296,6 +297,8 @@ int yylex(YYSTYPE* glslangTokenDesc, glslang::TParseContext& parseContext)
     return parseContext.getScanContext()->tokenize(parseContext.getPpContext(), token);
 }
 
+} // namespace QtShaderTools
+
 namespace {
 
 struct str_eq
@@ -330,6 +333,7 @@ std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
 
 };
 
+namespace QtShaderTools {
 namespace glslang {
 
 void TScanContext::fillInKeywordMap()
@@ -1923,3 +1927,4 @@ int TScanContext::secondGenerationImage()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h
index 24b75cf7..44be9051 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Scan.h
@@ -38,6 +38,7 @@
 
 #include "Versions.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Use a global end-of-input character, so no translation is needed across
@@ -272,5 +273,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _GLSLANG_SCAN_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h b/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h
index 74b2b3c7..740c146d 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h
@@ -42,6 +42,7 @@
 
 #include "ParseHelper.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TPpContext;
@@ -91,3 +92,4 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
index c6030bd7..e2f93aea 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
@@ -80,7 +80,7 @@ namespace { // anonymous namespace for file-local functions and symbols
 // Total number of successful initializers of glslang: a refcount
 // Shared global; access should be protected by a global mutex/critical section.
 int NumberOfClients = 0;
-
+using namespace QtShaderTools;
 using namespace glslang;
 
 // Create a language specific version of parseables.
@@ -1351,7 +1351,7 @@ int ShInitialize()
 // objects.
 //
 
-ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
+ShHandle ShConstructCompiler_New(const EShLanguage language, int debugOptions)
 {
     if (!InitThread())
         return 0;
@@ -1381,7 +1381,7 @@ ShHandle ShConstructUniformMap()
     return reinterpret_cast<void*>(base);
 }
 
-void ShDestruct(ShHandle handle)
+void ShDestruct_New(ShHandle handle)
 {
     if (handle == 0)
         return;
@@ -1399,7 +1399,7 @@ void ShDestruct(ShHandle handle)
 //
 // Cleanup symbol tables
 //
-int ShFinalize()
+int ShFinalize_New()
 {
     glslang::GetGlobalLock();
     --NumberOfClients;
@@ -1456,7 +1456,7 @@ int ShFinalize()
 // Return:  The return value is really boolean, indicating
 // success (1) or failure (0).
 //
-int ShCompile(
+int ShCompile_New(
     const ShHandle handle,
     const char* const shaderStrings[],
     const int numStrings,
@@ -1697,7 +1697,7 @@ int ShGetUniformLocation(const ShHandle handle, const char* name)
 //
 // See more detailed comment in ShaderLang.h
 //
-
+namespace QtShaderTools {
 namespace glslang {
 
 Version GetVersion()
@@ -1737,7 +1737,7 @@ bool InitializeProcess()
 
 void FinalizeProcess()
 {
-    ShFinalize();
+    ShFinalize_New();
 }
 
 class TDeferredCompiler : public TCompiler {
@@ -2144,3 +2144,4 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
 #endif // !GLSLANG_WEB && !GLSLANG_ANGLE
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
index f6291c39..ea8acc2f 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
@@ -44,6 +44,7 @@
 
 #include "SymbolTable.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -448,3 +449,4 @@ void TSymbolTable::copyTable(const TSymbolTable& copyOf)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
index db16c19b..0fcbcb44 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
@@ -69,6 +69,7 @@
 #include "../Include/intermediate.h"
 #include "../Include/InfoSink.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -895,5 +896,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _SYMBOL_TABLE_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
index 69b8863c..880f517c 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
@@ -149,6 +149,7 @@
 #include "parseVersions.h"
 #include "localintermediate.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 #ifndef GLSLANG_WEB
@@ -1294,3 +1295,4 @@ void TParseVersions::requireSpv(const TSourceLoc& loc, const char *op, unsigned
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h
index eb17c52e..6ec3258e 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/Versions.h
@@ -61,7 +61,7 @@ typedef enum : unsigned {
     EEsProfile            = (1 << 3),
     LAST_ELEMENT_MARKER(EProfileCount),
 } EProfile;
-
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -333,5 +333,6 @@ const char* const AEP_texture_cube_map_array[] = { E_GL_EXT_texture_cube_map_arr
 const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]);
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _VERSIONS_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp
index 95855183..22a87578 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp
@@ -40,6 +40,7 @@
 #include "../Include/intermediate.h"
 #include "ParseHelper.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // extract integers out of attribute arguments stored in attribute aggregate
@@ -342,5 +343,6 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // GLSLANG_WEB
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h
index 38a943d2..372b6a2c 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/attribute.h
@@ -40,6 +40,7 @@
 #include "../Include/Common.h"
 #include "../Include/ConstantUnion.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
     enum TAttributeType {
@@ -145,5 +146,6 @@ namespace glslang {
     typedef TList<TAttributeArgs> TAttributes;
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _ATTRIBUTE_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
index feecc982..6aca8fe6 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
@@ -90,9 +90,9 @@ Jutta Degener, 1995
 #include "../Public/ShaderLang.h"
 #include "attribute.h"
 
+using namespace QtShaderTools;
 using namespace glslang;
 
-
 #line 97 "MachineIndependent/glslang_tab.cpp"
 
 # ifndef YY_CAST
@@ -695,8 +695,9 @@ typedef enum yysymbol_kind_t yysymbol_kind_t;
 #define parseContext (*pParseContext)
 #define yyerror(context, msg) context->parserError(msg)
 
+namespace QtShaderTools {
 extern int yylex(YYSTYPE*, TParseContext&);
-
+} // QtShaderTools
 
 #line 702 "MachineIndependent/glslang_tab.cpp"
 
@@ -3909,7 +3910,6 @@ do {                                                                      \
     }                                                                     \
 } while (0)
 
-
 /*-----------------------------------.
 | Print this symbol's value on YYO.  |
 `-----------------------------------*/
@@ -4329,6 +4329,8 @@ yydestruct (const char *yymsg,
 | yyparse.  |
 `----------*/
 
+namespace QtShaderTools {
+
 int
 yyparse (glslang::TParseContext* pParseContext)
 {
@@ -11219,6 +11221,7 @@ yyreturn:
     YYSTACK_FREE (yymsg);
   return yyresult;
 }
+} // QtShaderTools
 
 #line 4044 "MachineIndependent/glslang.y"
 
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
index d6bc00d9..6936e3a7 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
@@ -500,6 +500,7 @@ extern int yydebug;
   typedef enum yytokentype yytoken_kind_t;
 #endif
 
+namespace QtShaderTools {
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 union YYSTYPE
@@ -551,5 +552,6 @@ typedef union YYSTYPE YYSTYPE;
 
 
 int yyparse (glslang::TParseContext* pParseContext);
+} // namespace QtShaderTools
 
 #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED  */
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
index 5ce3e472..e07cdfe9 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
@@ -80,6 +80,8 @@ bool IsNan(double x) {
 
 }
 
+namespace QtShaderTools {
+
 namespace glslang {
 
 //
@@ -1575,5 +1577,6 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // !GLSLANG_WEB && !GLSLANG_ANGLE
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
index c42e74fa..8c1cdd05 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
@@ -60,6 +60,8 @@
 //    c. implicit dead bindings are left un-bound.
 //
 
+namespace QtShaderTools {
+
 namespace glslang {
 
 class TVarGatherTraverser : public TLiveTraverser {
@@ -1597,5 +1599,6 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // !GLSLANG_WEB && !GLSLANG_ANGLE
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
index 7934c4a9..0133c166 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
@@ -45,7 +45,7 @@
 //
 // A reflection database and its interface, consistent with the OpenGL API reflection queries.
 //
-
+namespace QtShaderTools {
 class TInfoSink;
 
 namespace glslang {
@@ -299,6 +299,7 @@ public:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _IOMAPPER_INCLUDED
 
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp
index 51d93003..d1d3b4b5 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/limits.cpp
@@ -53,6 +53,7 @@
 
 #include "ParseHelper.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -198,3 +199,4 @@ void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
index 4e84adbf..dbef4f37 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
@@ -49,6 +49,7 @@
 #include "localintermediate.h"
 #include "../Include/InfoSink.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -1805,3 +1806,4 @@ int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
index f8d8e801..c21a20dd 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
@@ -49,8 +49,8 @@
 #include <set>
 #include <array>
 
+namespace QtShaderTools {
 class TInfoSink;
-
 namespace glslang {
 
 struct TMatrixSelector {
@@ -1073,5 +1073,6 @@ private:
 };
 
 } // end namespace glslang
+} // QtShaderTools
 
 #endif // _LOCAL_INTERMEDIATE_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp
index 7c04743b..af9d1f8e 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp
@@ -39,6 +39,7 @@
 
 #include "ParseHelper.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TConstTraverser : public TIntermTraverser {
@@ -212,3 +213,4 @@ bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArra
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
index 7248354e..a0b25d8e 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
@@ -45,6 +45,7 @@
 
 #include <map>
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -241,5 +242,6 @@ private:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _PARSE_VERSIONS_INCLUDED_
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
index aa1e0d74..1633954c 100755
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
@@ -90,6 +90,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "PpContext.h"
 #include "PpTokens.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Handle #define
@@ -1344,3 +1345,4 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
index 06c2333e..21929133 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
@@ -89,6 +89,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 namespace {
 
+using namespace QtShaderTools;
 using namespace glslang;
 
 const struct {
@@ -151,6 +152,7 @@ const struct {
 
 } // end anonymous namespace
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -179,3 +181,4 @@ TStringAtomMap::TStringAtomMap()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
index 1363ce2b..9f6b6a9a 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
@@ -82,6 +82,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "PpContext.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) :
@@ -118,3 +119,4 @@ void TPpContext::setInput(TInputScanner& input, bool versionWillBeError)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h
index 714b5ead..5c46592c 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h
@@ -91,6 +91,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     #pragma warning(disable : 4127)
 #endif
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TPpToken {
@@ -699,5 +700,6 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif  // PPCONTEXT_H
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
index e0f44f8b..a2e22839 100755
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
@@ -90,6 +90,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "PpTokens.h"
 #include "../Scan.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
@@ -1313,3 +1314,4 @@ void TPpContext::missingEndifCheck()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
index 7ed58703..e1bc2c7a 100755
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
@@ -97,6 +97,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "PpContext.h"
 #include "PpTokens.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Add a token (including backing string) to the end of a macro
@@ -219,3 +220,4 @@ void TPpContext::UngetToken(int token, TPpToken* ppToken)
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
index 7b0f8155..31bbc087 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
@@ -78,6 +78,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef PARSER_H
 #define PARSER_H
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Multi-character tokens
@@ -175,5 +176,6 @@ enum EFixedAtoms {
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif /* not PARSER_H */
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
index 9def592b..5c051fbf 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
@@ -48,6 +48,8 @@
 #include <unordered_set>
 
 #include "localintermediate.h"
+
+namespace QtShaderTools {
 namespace {
 
 // Use a string to hold the access chain information, as in most cases the
@@ -865,6 +867,7 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate)
         precise_object_accesschains.erase(precise_object_accesschain);
     }
 }
+}
 };
 
 #endif // GLSLANG_WEB
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h
index 8521ad7d..7968713d 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h
@@ -41,6 +41,7 @@
 
 #include "../Include/intermediate.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
 // Propagates the 'precise' qualifier for objects (objects marked with
@@ -52,4 +53,5 @@ namespace glslang {
 // 'noContraction' means the object is 'precise'; and for arithmetic operation
 // nodes, it means the operation should not be contracted.
 void PropagateNoContraction(const glslang::TIntermediate& intermediate);
+}
 };
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
index 72950029..53406a00 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
@@ -65,6 +65,8 @@
 // there wasn't exactly one entry point.
 //
 
+namespace QtShaderTools {
+
 namespace glslang {
 
 //
@@ -1268,5 +1270,6 @@ void TReflection::dump()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // !GLSLANG_WEB && !GLSLANG_ANGLE
diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h
index 5af4467c..a5f6f374 100644
--- a/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h
+++ b/src/3rdparty/glslang/glslang/MachineIndependent/reflection.h
@@ -44,6 +44,7 @@
 #include <list>
 #include <set>
 
+namespace QtShaderTools {
 //
 // A reflection database and its interface, consistent with the OpenGL API reflection queries.
 //
@@ -217,6 +218,7 @@ protected:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _REFLECTION_INCLUDED
 
diff --git a/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
index b3d1e430..c311f49b 100644
--- a/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
+++ b/src/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
@@ -50,6 +50,7 @@
 #include <sys/resource.h>
 #endif
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -205,3 +206,4 @@ void OS_DumpMemoryCounters()
 }
 
 } // end namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp b/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp
index 870840c5..3d5cd520 100644
--- a/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp
+++ b/src/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp
@@ -51,6 +51,7 @@
 #error Trying to build a windows specific file in a non windows build.
 #endif
 
+namespace QtShaderTools {
 namespace glslang {
 
 inline OS_TLSIndex ToGenericTLSIndex (DWORD handle)
@@ -145,3 +146,4 @@ void OS_DumpMemoryCounters()
 }
 
 } // namespace glslang
+} // namespace QtShaderTools
diff --git a/src/3rdparty/glslang/glslang/OSDependent/osinclude.h b/src/3rdparty/glslang/glslang/OSDependent/osinclude.h
index 218abe4f..f16be6f7 100644
--- a/src/3rdparty/glslang/glslang/OSDependent/osinclude.h
+++ b/src/3rdparty/glslang/glslang/OSDependent/osinclude.h
@@ -35,6 +35,7 @@
 #ifndef __OSINCLUDE_H
 #define __OSINCLUDE_H
 
+namespace QtShaderTools {
 namespace glslang {
 
 //
@@ -59,5 +60,6 @@ void OS_CleanupThreadData(void);
 void OS_DumpMemoryCounters();
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // __OSINCLUDE_H
diff --git a/src/3rdparty/glslang/glslang/Public/ShaderLang.h b/src/3rdparty/glslang/glslang/Public/ShaderLang.h
index 273f1569..c89173b4 100755
--- a/src/3rdparty/glslang/glslang/Public/ShaderLang.h
+++ b/src/3rdparty/glslang/glslang/Public/ShaderLang.h
@@ -84,7 +84,7 @@ GLSLANG_EXPORT int ShInitialize();
 //
 // Call this at process shutdown to clean up memory.
 //
-GLSLANG_EXPORT int ShFinalize();
+GLSLANG_EXPORT int ShFinalize_New();
 
 //
 // Types of languages the compiler can consume.
@@ -137,6 +137,7 @@ typedef enum : unsigned {
     LAST_ELEMENT_MARKER(EShLanguageMaskCount),
 } EShLanguageMask;
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TType;
@@ -212,6 +213,7 @@ struct TEnvironment {
 GLSLANG_EXPORT const char* StageName(EShLanguage);
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 //
 // Types of output the linker will create.
@@ -310,10 +312,10 @@ typedef void* ShHandle;
 // Driver calls these to create and destroy compiler/linker
 // objects.
 //
-GLSLANG_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int debugOptions);  // one per shader
+GLSLANG_EXPORT ShHandle ShConstructCompiler_New(const EShLanguage, int debugOptions);  // one per shader
 GLSLANG_EXPORT ShHandle ShConstructLinker(const EShExecutable, int debugOptions);  // one per shader pair
 GLSLANG_EXPORT ShHandle ShConstructUniformMap();                 // one per uniform namespace (currently entire program object)
-GLSLANG_EXPORT void ShDestruct(ShHandle);
+GLSLANG_EXPORT void ShDestruct_New(ShHandle);
 
 //
 // The return value of ShCompile is boolean, non-zero indicating
@@ -322,7 +324,7 @@ GLSLANG_EXPORT void ShDestruct(ShHandle);
 // The info-log should be written by ShCompile into
 // ShHandle, so it can answer future queries.
 //
-GLSLANG_EXPORT int ShCompile(
+GLSLANG_EXPORT int ShCompile_New(
     const ShHandle,
     const char* const shaderStrings[],
     const int numStrings,
@@ -389,6 +391,7 @@ GLSLANG_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* n
 #include <string>
 #include <utility>
 
+namespace QtShaderTools {
 class TCompiler;
 class TInfoSink;
 
@@ -944,5 +947,6 @@ private:
 };
 
 } // end namespace glslang
+} // namespace QtShaderTools
 
 #endif // _COMPILER_INTERFACE_INCLUDED_
diff --git a/src/3rdparty/glslang/hlsl/hlslAttributes.cpp b/src/3rdparty/glslang/hlsl/hlslAttributes.cpp
index 0cc0d3f4..2ac90f13 100644
--- a/src/3rdparty/glslang/hlsl/hlslAttributes.cpp
+++ b/src/3rdparty/glslang/hlsl/hlslAttributes.cpp
@@ -36,6 +36,7 @@
 #include "hlslAttributes.h"
 #include "hlslParseHelper.h"
 
+using namespace QtShaderTools;
 namespace glslang {
     // Map the given string to an attribute enum from TAttributeType,
     // or EatNone if invalid.
diff --git a/src/3rdparty/glslang/hlsl/hlslGrammar.cpp b/src/3rdparty/glslang/hlsl/hlslGrammar.cpp
index 47ced29c..84a045ea 100644
--- a/src/3rdparty/glslang/hlsl/hlslGrammar.cpp
+++ b/src/3rdparty/glslang/hlsl/hlslGrammar.cpp
@@ -55,6 +55,7 @@
 #include "hlslGrammar.h"
 #include "hlslAttributes.h"
 
+using namespace QtShaderTools;
 namespace glslang {
 
 // Root entry point to this recursive decent parser.
diff --git a/src/3rdparty/glslang/hlsl/hlslGrammar.h b/src/3rdparty/glslang/hlsl/hlslGrammar.h
index 27706b2b..74e4103b 100644
--- a/src/3rdparty/glslang/hlsl/hlslGrammar.h
+++ b/src/3rdparty/glslang/hlsl/hlslGrammar.h
@@ -41,6 +41,7 @@
 #include "hlslOpMap.h"
 #include "hlslTokenStream.h"
 
+namespace QtShaderTools {
 namespace glslang {
 
     class TFunctionDeclarator;
@@ -138,5 +139,6 @@ namespace glslang {
     };
 
 } // end namespace glslang
+} // end namespace QtShaderTools
 
 #endif // HLSLGRAMMAR_H_
diff --git a/src/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/src/3rdparty/glslang/hlsl/hlslParseHelper.cpp
index 557d4ae4..02cb8a6d 100755
--- a/src/3rdparty/glslang/hlsl/hlslParseHelper.cpp
+++ b/src/3rdparty/glslang/hlsl/hlslParseHelper.cpp
@@ -51,6 +51,7 @@
 #include <array>
 #include <set>
 
+using namespace QtShaderTools;
 namespace glslang {
 
 HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins,
diff --git a/src/3rdparty/glslang/hlsl/hlslParseHelper.h b/src/3rdparty/glslang/hlsl/hlslParseHelper.h
index 6f416610..eb431d31 100644
--- a/src/3rdparty/glslang/hlsl/hlslParseHelper.h
+++ b/src/3rdparty/glslang/hlsl/hlslParseHelper.h
@@ -42,6 +42,7 @@
 
 #include <array>
 
+namespace QtShaderTools {
 namespace glslang {
 
 class TFunctionDeclarator;
@@ -510,5 +511,6 @@ protected:
 #define BUILTIN_PREFIX "__BI_"
 
 } // end namespace glslang
+} // end namespace QtShaderTools
 
 #endif // HLSL_PARSE_INCLUDED_
diff --git a/src/3rdparty/glslang/hlsl/hlslScanContext.cpp b/src/3rdparty/glslang/hlsl/hlslScanContext.cpp
index 28a66bb4..c33aa282 100644
--- a/src/3rdparty/glslang/hlsl/hlslScanContext.cpp
+++ b/src/3rdparty/glslang/hlsl/hlslScanContext.cpp
@@ -77,6 +77,8 @@ struct str_hash
     }
 };
 
+using namespace QtShaderTools;
+
 // A single global usable by all threads, by all versions, by all languages.
 // After a single process-level initialization, this is read only and thread safe
 std::unordered_map<const char*, glslang::EHlslTokenClass, str_hash, str_eq>* KeywordMap = nullptr;
-- 
2.23.0.windows.1

