Implement dynamic indexing of temporaries.

Previously only dynamic indexing of uniforms was supported.

Since this is essentially a gather operation within the register file,
it is slow. We optimize the common case of using the loop index
variable as relative address, where the index value would be the same
for all shader invocations running in lock-step across SIMD lanes.

Bug chromium:845103
Bug skia:7846

Change-Id: Idb36b512dd560d740ac9088691b633ff3a1561c1
Reviewed-on: https://swiftshader-review.googlesource.com/18968
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/VertexProgram.hpp b/src/Shader/VertexProgram.hpp
index fcd2a93..3c4199c 100644
--- a/src/Shader/VertexProgram.hpp
+++ b/src/Shader/VertexProgram.hpp
@@ -70,8 +70,9 @@
 		Vector4f fetchRegister(const Src &src, unsigned int offset = 0);
 		Vector4f readConstant(const Src &src, unsigned int offset = 0);
 		RValue<Pointer<Byte>> uniformAddress(int bufferIndex, unsigned int index);
-		RValue<Pointer<Byte>> uniformAddress(int bufferIndex, unsigned int index, Int& offset);
-		Int relativeAddress(const Shader::Parameter &var, int bufferIndex = -1);
+		RValue<Pointer<Byte>> uniformAddress(int bufferIndex, unsigned int index, Int &offset);
+		Int relativeAddress(const Shader::Relative &rel, int bufferIndex = -1);
+		Int4 dynamicAddress(const Shader::Relative &rel);
 		Int4 enableMask(const Shader::Instruction *instruction);
 
 		void M3X2(Vector4f &dst, Vector4f &src0, Src &src1);