Fix support for arrays of samplers.
TRAC #14840
Signed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@507 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Program.cpp b/src/libGLESv2/Program.cpp
index 3c08642..1dd92ac 100644
--- a/src/libGLESv2/Program.cpp
+++ b/src/libGLESv2/Program.cpp
@@ -1659,14 +1659,15 @@
 {
     if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
     {
-        unsigned int samplerIndex = constantDescription.RegisterIndex;
+        for (unsigned int samplerIndex = constantDescription.RegisterIndex; samplerIndex < constantDescription.RegisterIndex + constantDescription.RegisterCount; samplerIndex++)
+        {
+            ASSERT(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
 
-        assert(samplerIndex < sizeof(mSamplers)/sizeof(mSamplers[0]));
-
-        mSamplers[samplerIndex].active = true;
-        mSamplers[samplerIndex].type = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? SAMPLER_CUBE : SAMPLER_2D;
-        mSamplers[samplerIndex].logicalTextureUnit = 0;
-        mSamplers[samplerIndex].dirty = true;
+            mSamplers[samplerIndex].active = true;
+            mSamplers[samplerIndex].type = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? SAMPLER_CUBE : SAMPLER_2D;
+            mSamplers[samplerIndex].logicalTextureUnit = 0;
+            mSamplers[samplerIndex].dirty = true;
+        }
     }
 
     switch(constantDescription.Class)