From 028c5a8dc4969719f0e10970e7f5df4d312f5b62 Mon Sep 17 00:00:00 2001
From: LoopDawg <sk_opengl@khasekhemwy.net>
Date: Sat, 7 Oct 2017 16:42:37 -0600
Subject: [PATCH] HLSL: nonfunctional: rename setId -> switchId, add comment

Method rename, add comment about its intended use.  No
test diffs.
---
 glslang/Include/intermediate.h | 5 ++++-
 hlsl/hlslParseHelper.cpp       | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h
index 12f17e3df..8a075678c 100644
--- a/glslang/Include/intermediate.h
+++ b/glslang/Include/intermediate.h
@@ -979,7 +979,6 @@ public:
         constSubtree(nullptr)
           { name = n; }
     virtual int getId() const { return id; }
-    virtual void setId(int newId) { id = newId; }
     virtual const TString& getName() const { return name; }
     virtual void traverse(TIntermTraverser*);
     virtual       TIntermSymbol* getAsSymbolNode()       { return this; }
@@ -993,6 +992,10 @@ public:
     int getFlattenSubset() const { return flattenSubset; } // -1 means full object
 #endif
 
+    // This is meant for cases where a node has already been constructed, and
+    // later on, it becomes necessary to switch to a different symbol.
+    virtual void switchId(int newId) { id = newId; }
+
 protected:
     int id;                      // the unique id of the symbol this node represents
 #ifdef ENABLE_HLSL
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index 706173d27..fe6333b91 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -2994,7 +2994,7 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc
         argTex->getWritableType().getSampler().shadow = shadowMode;
         samplerType.shadow = shadowMode;
 
-        texSymbol->setId(newId);
+        texSymbol->switchId(newId);
     }
 
     txcombine->setType(TType(samplerType, EvqTemporary));
-- 
GitLab