Set correct symbol ids when referring to GLSL built-ins

The symbol ids are fetched from the symbol table. A new utility
function is added to make this more convenient.

BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests

Change-Id: I780430e3386f6599503d8290c568ca9bc9cad147
Reviewed-on: https://chromium-review.googlesource.com/559535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Initialize.cpp b/src/compiler/translator/Initialize.cpp
index f5941ea..4275837 100644
--- a/src/compiler/translator/Initialize.cpp
+++ b/src/compiler/translator/Initialize.cpp
@@ -824,8 +824,15 @@
             symbolTable.insert(ESSL1_BUILTINS,
                                new TVariable(NewPoolTString("gl_FragColor"),
                                              TType(EbtFloat, EbpMedium, EvqFragColor, 4)));
-            TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, 1, true);
-            fragData.setArraySize(resources.MaxDrawBuffers);
+            TType fragData(EbtFloat, EbpMedium, EvqFragData, 4);
+            if (spec != SH_WEBGL2_SPEC && spec != SH_WEBGL3_SPEC)
+            {
+                fragData.setArraySize(resources.MaxDrawBuffers);
+            }
+            else
+            {
+                fragData.setArraySize(1u);
+            }
             symbolTable.insert(ESSL1_BUILTINS,
                                new TVariable(NewPoolTString("gl_FragData"), fragData));