Choose D3D11 swizzle formats in gen_texture_format_table.py

Making swizzle format data come from the ANGLE format table will make
it easier to make changes that affect both swizzle formats and regular
texture formats. Swizzle format is now specified manually for some
tricky formats, but for most it can be determined automatically from
the ANGLE texture format info.

The ANGLE texture format info in texture_format_table.json is changed
to facilitate this. The componentType field now captures only whether
the data is normalized, int or float and its signedness, but not the
width of the data type. Bit widths of the individual channels are
recorded in a separate "bits" object for each ANGLE format entry.

Also, a new 16-bit RGBA UNORM ANGLE format is added to support
swizzling 16-bit normalized depth formats.

This change is mostly just refactoring, but it fixes swizzling for
formats which have less bits for alpha than other channels:

- RGB10_A2
- RGB10_A2UI
- RGB5_A1

BUG=angleproject:1322
BUG=angleproject:1244
TEST=angle_end2end_tests,
     dEQP-GLES3.functional.texture.swizzle.* (all pass)

Change-Id: I87d8a9cc0b6569191f50c41754d77b20ca6afef9
Reviewed-on: https://chromium-review.googlesource.com/329074
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/tests/gl_tests/SwizzleTest.cpp b/src/tests/gl_tests/SwizzleTest.cpp
index a91030c..095fd69 100644
--- a/src/tests/gl_tests/SwizzleTest.cpp
+++ b/src/tests/gl_tests/SwizzleTest.cpp
@@ -230,6 +230,13 @@
     runTest2D();
 }
 
+TEST_P(SwizzleTest, RGB10_A2_2D)
+{
+    GLuint data[] = {20u | (40u << 10) | (60u << 20) | (2u << 30)};
+    init2DTexture(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, data);
+    runTest2D();
+}
+
 TEST_P(SwizzleTest, RGBA32F_2D)
 {
     GLfloat data[] = { 0.25f, 0.5f, 0.75f, 0.8f };