Split Object::Kind::Variable

We have two kinds of "variable" -- those that are directly backed by an
lvalue, and those that are subsets of an indexed location, etc space.

Split them so we don't have to rediscover it later at emit time.

Bug: b/120799499
Change-Id: I7403f76d615d7afa1ee50c014172f07b90262c40
Reviewed-on: https://swiftshader-review.googlesource.com/c/24374
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index 4093ea8..08d0d25 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -195,7 +195,7 @@
 		}
 	}
 
-	void SpirvShader::ProcessInterfaceVariable(Object const &object)
+	void SpirvShader::ProcessInterfaceVariable(Object &object)
 	{
 		assert(object.storageClass == spv::StorageClassInput || object.storageClass == spv::StorageClassOutput);
 
@@ -236,6 +236,7 @@
 		}
 		else
 		{
+			object.kind = Object::Kind::InterfaceVariable;
 			PopulateInterface(&userDefinedInterface, resultId);
 		}
 	}
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp
index 9d3d843..52e9143 100644
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -111,6 +111,7 @@
 				Unknown,        /* for paranoia -- if we get left with an object in this state, the module was broken */
 				Type,
 				Variable,
+				InterfaceVariable,
 				Constant,
 				Value,
 			} kind = Kind::Unknown;
@@ -247,7 +248,7 @@
 
 		uint32_t GetConstantInt(uint32_t id);
 
-		void ProcessInterfaceVariable(Object const &object);
+		void ProcessInterfaceVariable(Object &object);
 	};
 }