Merge remote-tracking branch 'aosp/upstream-master' into update-shaderc

Includes the following:
	2d89b6a Do not gitignore source/opt/build_module.*
	ee6c877 Test SPV_KHR_shader_draw_parameters support

Test: checkbuild.py for Linux, Windows; ran unit tests on Windows
Change-Id: Ica302fd13353d90b0745420a6d2b1a25d54a2297
diff --git a/.gitignore b/.gitignore
index 8933fe9..5295aef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-build*
+/build*
 .ycm_extra_conf.py*
 compile_commands.json
 /external/googletest/
diff --git a/CHANGES b/CHANGES
index dbfb69c..ab7a89d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@
 v2016.6-dev 2016-09-16
  - Published the C++ interface for assembling, disassembling, validation, and
    optimization.
+ - Support SPV_KHR_shader_draw_parameters in assembler, disassembler, parser.
  - Fixes issues:
    #429: Validator: Allow OpTypeForwardPointer and OpTypeStruct to reference
      undefined IDs
diff --git a/test/TextToBinary.Extension.cpp b/test/TextToBinary.Extension.cpp
index 8c78f5d..b4508f2 100644
--- a/test/TextToBinary.Extension.cpp
+++ b/test/TextToBinary.Extension.cpp
@@ -90,18 +90,16 @@
 }
 
 
-// SPV_KHR_shader_ballot
-
 // A test case for assembling into words in an instruction.
 struct AssemblyCase {
   std::string input;
   std::vector<uint32_t> expected;
 };
 
-using SPV_KHR_shader_ballot_Test = spvtest::TextToBinaryTestBase<
+using ExtensionRoundTripTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<std::tuple<spv_target_env, AssemblyCase>>>;
 
-TEST_P(SPV_KHR_shader_ballot_Test, Samples) {
+TEST_P(ExtensionRoundTripTest, Samples) {
   const spv_target_env& env = std::get<0>(GetParam());
   const AssemblyCase& ac = std::get<1>(GetParam());
 
@@ -114,8 +112,10 @@
               Eq(ac.input));
 }
 
+// SPV_KHR_shader_ballot
+
 INSTANTIATE_TEST_CASE_P(
-    Assembly, SPV_KHR_shader_ballot_Test,
+    SPV_KHR_shader_ballot, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
@@ -145,4 +145,27 @@
                                                  SpvBuiltInSubgroupLtMaskKHR})},
             })), );
 
+// SPV_KHR_shader_draw_parameters
+
+INSTANTIATE_TEST_CASE_P(
+    SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
+    // We'll get coverage over operand tables by trying the universal
+    // environments, and at least one specific environment.
+    Combine(
+        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
+               SPV_ENV_VULKAN_1_0),
+        ValuesIn(std::vector<AssemblyCase>{
+            {"OpCapability DrawParameters\n",
+             MakeInstruction(SpvOpCapability, {SpvCapabilityDrawParameters})},
+            {"OpDecorate %1 BuiltIn BaseVertex\n",
+             MakeInstruction(SpvOpDecorate,
+                             {1, SpvDecorationBuiltIn, SpvBuiltInBaseVertex})},
+            {"OpDecorate %1 BuiltIn BaseInstance\n",
+             MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
+                                             SpvBuiltInBaseInstance})},
+            {"OpDecorate %1 BuiltIn DrawIndex\n",
+             MakeInstruction(SpvOpDecorate,
+                             {1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})},
+        })), );
+
 }  // anonymous namespace