Fix #1536: use string instead of TString for uniform-location override.
authorJohn Kessenich <cepheus@frii.com>
Sat, 20 Oct 2018 23:36:13 +0000 (17:36 -0600)
committerJohn Kessenich <cepheus@frii.com>
Sat, 20 Oct 2018 23:37:19 +0000 (17:37 -0600)
glslang/Include/revision.h
glslang/MachineIndependent/iomapper.cpp [changed mode: 0644->0755]
glslang/MachineIndependent/localintermediate.h [changed mode: 0644->0755]

index b595192..900a0b4 100644 (file)
@@ -1,3 +1,3 @@
 // This header is generated by the make-revision script.
 
-#define GLSLANG_PATCH_LEVEL 2904
+#define GLSLANG_PATCH_LEVEL 2933
old mode 100644 (file)
new mode 100755 (executable)
index e68e32f..46c7558
@@ -457,7 +457,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
 
         int location = intermediate.getUniformLocationOverride(name);
         if (location != -1)
-                return location;
+            return location;
 
         location = nextUniformLocation;
 
old mode 100644 (file)
new mode 100755 (executable)
index 59fbaa9..99f777f
@@ -664,7 +664,8 @@ public:
     const std::string& getSourceFile() const { return sourceFile; }
     void addSourceText(const char* text) { sourceText = sourceText + text; }
     const std::string& getSourceText() const { return sourceText; }
-    void addProcesses(const std::vector<std::string>& p) {
+    void addProcesses(const std::vector<std::string>& p)
+    {
         for (int i = 0; i < (int)p.size(); ++i)
             processes.addProcess(p[i]);
     }
@@ -672,18 +673,20 @@ public:
     void addProcessArgument(const std::string& arg) { processes.addArgument(arg); }
     const std::vector<std::string>& getProcesses() const { return processes.getProcesses(); }
 
-    void addUniformLocationOverride(const TString& name, int location)
+    void addUniformLocationOverride(const char* nameStr, int location)
     {
-            uniformLocationOverrides[name] = location;
+        std::string name = nameStr;
+        uniformLocationOverrides[name] = location;
     }
 
-    int getUniformLocationOverride(const TString& name) const
+    int getUniformLocationOverride(const char* nameStr) const
     {
-            auto pos = uniformLocationOverrides.find(name);
-            if (pos == uniformLocationOverrides.end())
-                    return -1;
-            else
-                    return pos->second;
+        std::string name = nameStr;
+        auto pos = uniformLocationOverrides.find(name);
+        if (pos == uniformLocationOverrides.end())
+            return -1;
+        else
+            return pos->second;
     }
 
     void setUniformLocationBase(int base) { uniformLocationBase = base; }
@@ -814,7 +817,7 @@ protected:
     bool needToLegalize;
     bool binaryDoubleOutput;
 
-    std::unordered_map<TString, int> uniformLocationOverrides;
+    std::unordered_map<std::string, int> uniformLocationOverrides;
     int uniformLocationBase;
 
 private: