Fix handling sampler arrays in structs as function arguments on HLSL

Some of the code was written under the mistaken assumption that
createSamplerSymbols would be splitting sampler arrays in structs into
individual samplers. Fix it by adding array dimensions to sampler
parameters generated by createSamplerSymbols when necessary.

BUG=angleproject:2128
TEST=angle_end2end_tests

Change-Id: Ie622c777d78ae65b5629d12e0ae574800c1b78f5
Reviewed-on: https://chromium-review.googlesource.com/614882
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 03e0494..d9891a3 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -2579,29 +2579,26 @@
                                   &samplerSymbols, nullptr);
         for (const TIntermSymbol *sampler : samplerSymbols)
         {
+            const TType &samplerType = sampler->getType();
             if (mOutputType == SH_HLSL_4_1_OUTPUT)
             {
-                ASSERT(!sampler->getType().isArray());
-                argString << ", const uint " << sampler->getSymbol();
+                argString << ", const uint " << sampler->getSymbol() << ArrayString(samplerType);
             }
             else if (mOutputType == SH_HLSL_4_0_FL9_3_OUTPUT)
             {
-                const TType &samplerType = sampler->getType();
-                ASSERT(!samplerType.isArray());
                 ASSERT(IsSampler(samplerType.getBasicType()));
                 argString << ", " << QualifierString(qualifier) << " "
                           << TextureString(samplerType.getBasicType()) << " texture_"
-                          << sampler->getSymbol() << ", " << QualifierString(qualifier) << " "
+                          << sampler->getSymbol() << ArrayString(samplerType) << ", "
+                          << QualifierString(qualifier) << " "
                           << SamplerString(samplerType.getBasicType()) << " sampler_"
-                          << sampler->getSymbol();
+                          << sampler->getSymbol() << ArrayString(samplerType);
             }
             else
             {
-                const TType &samplerType = sampler->getType();
-                ASSERT(!samplerType.isArray());
                 ASSERT(IsSampler(samplerType.getBasicType()));
                 argString << ", " << QualifierString(qualifier) << " " << TypeString(samplerType)
-                          << " " << sampler->getSymbol();
+                          << " " << sampler->getSymbol() << ArrayString(samplerType);
             }
         }
     }