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/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index 0bb1973..a421bfc 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -298,6 +298,24 @@
     return (rendererString.find("Direct3D11 vs_5_0") != std::string::npos);
 }
 
+bool ANGLETest::isD3D11_FL93() const
+{
+    std::string rendererString(reinterpret_cast<const char *>(glGetString(GL_RENDERER)));
+    return (rendererString.find("Direct3D11 vs_4_0_") != std::string::npos);
+}
+
+bool ANGLETest::isD3D9() const
+{
+    std::string rendererString(reinterpret_cast<const char *>(glGetString(GL_RENDERER)));
+    return (rendererString.find("Direct3D9") != std::string::npos);
+}
+
+bool ANGLETest::isD3DSM3() const
+{
+    std::string rendererString(reinterpret_cast<const char *>(glGetString(GL_RENDERER)));
+    return isD3D9() || isD3D11_FL93();
+}
+
 EGLint ANGLETest::getPlatformRenderer() const
 {
     assert(mEGLWindow);