D3D: Rework varying packing code.

In D3D we pack varyings by making a register map, and using the
recommended GLSL ES algorithm to reserve register space. We use
this map to assign row and column slots to each varying and then
produce a semantic index value.

The existing scheme had a number of bugs, and was failing several
angle_end2end_tests. The new design cleans up the code somewhat
and uses a different counting scheme for the semantic indexes:
just sort the varyings in packing order and use a simple
incrementing semantic index per varying. In SM4+, the HLSL compiler
sorts and packs the varyings correctly itself, and in SM3, handle
the cases we don't support by returning an error instead of a D3D
compiler link error.

Also refactor how we store varying information for TF Feedback/
StreamOut. Only store the necessary D3D information, instead of
extra information like the name and type.

This fixes several tests in GLSLTest/*. This also will allow us to
fix interpolation qualifier packing and the structure packing in
HLSL, which seems to work differently than the rest of the varying
types.

BUG=angleproject:1202
TEST=bots,dEQP-GLES3.functional.transform_feedback.*

Change-Id: Ie5bfbb4f71d8bf97f39115fc46d2e61b131df639
Reviewed-on: https://chromium-review.googlesource.com/311241
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/gl_tests/GLSLTest.cpp b/src/tests/gl_tests/GLSLTest.cpp
index c19b873..0be58e9 100644
--- a/src/tests/gl_tests/GLSLTest.cpp
+++ b/src/tests/gl_tests/GLSLTest.cpp
@@ -828,8 +828,14 @@
 }
 
 // Disabled because of a failure in D3D9
-TEST_P(GLSLTest, DISABLED_MaxVaryingVec3AndOneFloat)
+TEST_P(GLSLTest, MaxVaryingVec3AndOneFloat)
 {
+    if (isD3D9())
+    {
+        std::cout << "Test disabled on D3D9." << std::endl;
+        return;
+    }
+
     GLint maxVaryings = 0;
     glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
 
@@ -837,8 +843,14 @@
 }
 
 // Disabled because of a failure in D3D9
-TEST_P(GLSLTest, DISABLED_MaxVaryingVec3ArrayAndOneFloatArray)
+TEST_P(GLSLTest, MaxVaryingVec3ArrayAndOneFloatArray)
 {
+    if (isD3D9())
+    {
+        std::cout << "Test disabled on D3D9." << std::endl;
+        return;
+    }
+
     GLint maxVaryings = 0;
     glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
 
@@ -846,8 +858,14 @@
 }
 
 // Disabled because of a failure in D3D9
-TEST_P(GLSLTest, DISABLED_TwiceMaxVaryingVec2)
+TEST_P(GLSLTest, TwiceMaxVaryingVec2)
 {
+    if (isD3D9())
+    {
+        std::cout << "Test disabled on D3D9." << std::endl;
+        return;
+    }
+
     GLint maxVaryings = 0;
     glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
 
@@ -855,8 +873,14 @@
 }
 
 // Disabled because of a failure in D3D9
-TEST_P(GLSLTest, DISABLED_MaxVaryingVec2Arrays)
+TEST_P(GLSLTest, MaxVaryingVec2Arrays)
 {
+    if (isD3DSM3())
+    {
+        std::cout << "Test disabled on SM3." << std::endl;
+        return;
+    }
+
     GLint maxVaryings = 0;
     glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);