Sampler allocation fix

Because samplers can be stored within structures, register
allocation of entire structures within the samplers registers
was pushing sampler indices outside of the allowed limit.
In order to solve this, sampler registers now exclusively
contain samplers, and utility functions to compute sampler
only type size were added to make this possible.

Bug chromium:797264

Change-Id: Ic5a6f09665c39661944444cd736547bce4dff2ab
Reviewed-on: https://swiftshader-review.googlesource.com/15728
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Shader/Shader.cpp b/src/Shader/Shader.cpp
index f7ce731..549b8bd 100644
--- a/src/Shader/Shader.cpp
+++ b/src/Shader/Shader.cpp
@@ -1474,7 +1474,10 @@
 
 	void Shader::declareSampler(int i)
 	{
-		usedSamplers |= 1 << i;
+		if(i >= 0 && i < 16)
+		{
+			usedSamplers |= 1 << i;
+		}
 	}
 
 	const Shader::Instruction *Shader::getInstruction(size_t i) const