Merge pull request #1597 from sheredom/add_conversion_folding

Add conversion folding when the source is a constant.
diff --git a/SPIRV/SpvTools.cpp b/SPIRV/SpvTools.cpp
index 05f234c..a886b16 100755
--- a/SPIRV/SpvTools.cpp
+++ b/SPIRV/SpvTools.cpp
@@ -181,7 +181,7 @@
     optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
     optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
 
-    optimizer.Run(spirv.data(), spirv.size(), &spirv, spvtools::ValidatorOptions(), true);
+    optimizer.Run(spirv.data(), spirv.size(), &spirv);
 }
 
 }; // end namespace glslang
diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp
index 25b5ce9..72e577a 100644
--- a/SPIRV/spirv.hpp
+++ b/SPIRV/spirv.hpp
@@ -26,13 +26,14 @@
 // the Binary Section of the SPIR-V specification.
 
 // Enumeration tokens for SPIR-V, in various styles:
-//   C, C++, C++11, JSON, Lua, Python
+//   C, C++, C++11, JSON, Lua, Python, C#
 // 
 // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
 // - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
 // - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
 // - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
+// - C# will use enum classes in the Specification class located in the "Spv" namespace, e.g.: Spv.Specification.SourceLanguage.GLSL
 // 
 // Some tokens act like mask values, which can be OR'd together,
 // while others are mutually exclusive.  The mask-like ones have
@@ -512,7 +513,9 @@
     BuiltInMeshViewIndicesNV = 5281,
     BuiltInBaryCoordNV = 5286,
     BuiltInBaryCoordNoPerspNV = 5287,
+    BuiltInFragSizeEXT = 5292,
     BuiltInFragmentSizeNV = 5292,
+    BuiltInFragInvocationCountEXT = 5293,
     BuiltInInvocationsPerPixelNV = 5293,
     BuiltInLaunchIdNV = 5319,
     BuiltInLaunchSizeNV = 5320,
@@ -770,6 +773,7 @@
     CapabilityImageFootprintNV = 5282,
     CapabilityFragmentBarycentricNV = 5284,
     CapabilityComputeDerivativeGroupQuadsNV = 5288,
+    CapabilityFragmentDensityEXT = 5291,
     CapabilityShadingRateNV = 5291,
     CapabilityGroupNonUniformPartitionedNV = 5297,
     CapabilityShaderNonUniformEXT = 5301,
diff --git a/Test/baseResults/spv.150.geom.out b/Test/baseResults/spv.150.geom.out
index 70dadf5..f759793 100644
--- a/Test/baseResults/spv.150.geom.out
+++ b/Test/baseResults/spv.150.geom.out
@@ -1,8 +1,4 @@
 spv.150.geom
-error: SPIRV-Tools Validation Errors
-error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability GeometryStreams
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 71
diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out
index 45f235f..74a4f0b 100644
--- a/Test/baseResults/spv.420.geom.out
+++ b/Test/baseResults/spv.420.geom.out
@@ -1,8 +1,4 @@
 spv.420.geom
-error: SPIRV-Tools Validation Errors
-error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability GeometryStreams
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 72
diff --git a/Test/baseResults/spv.builtInXFB.vert.out b/Test/baseResults/spv.builtInXFB.vert.out
index f175a19..556a698 100644
--- a/Test/baseResults/spv.builtInXFB.vert.out
+++ b/Test/baseResults/spv.builtInXFB.vert.out
@@ -1,8 +1,4 @@
 spv.builtInXFB.vert
-error: SPIRV-Tools Validation Errors
-error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability TransformFeedback
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 21
diff --git a/Test/baseResults/spv.xfb.vert.out b/Test/baseResults/spv.xfb.vert.out
index 68633e1..3cd93d5 100644
--- a/Test/baseResults/spv.xfb.vert.out
+++ b/Test/baseResults/spv.xfb.vert.out
@@ -1,8 +1,4 @@
 spv.xfb.vert
-error: SPIRV-Tools Validation Errors
-error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability TransformFeedback
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 16
diff --git a/Test/baseResults/spv.xfb2.vert.out b/Test/baseResults/spv.xfb2.vert.out
index 6dc3987..a8551a1 100644
--- a/Test/baseResults/spv.xfb2.vert.out
+++ b/Test/baseResults/spv.xfb2.vert.out
@@ -1,8 +1,4 @@
 spv.xfb2.vert
-error: SPIRV-Tools Validation Errors
-error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability TransformFeedback
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 35
diff --git a/Test/baseResults/spv.xfb3.vert.out b/Test/baseResults/spv.xfb3.vert.out
index 1d526aa..0218847 100644
--- a/Test/baseResults/spv.xfb3.vert.out
+++ b/Test/baseResults/spv.xfb3.vert.out
@@ -1,8 +1,4 @@
 spv.xfb3.vert
-error: SPIRV-Tools Validation Errors
-error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
-  OpCapability TransformFeedback
-
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 35
diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h
index a1acb25..dcd5260 100644
--- a/glslang/Include/revision.h
+++ b/glslang/Include/revision.h
@@ -1,3 +1,3 @@
 // This header is generated by the make-revision script.
 
-#define GLSLANG_PATCH_LEVEL 2992
+#define GLSLANG_PATCH_LEVEL 2997
diff --git a/known_good.json b/known_good.json
index d985507..837255d 100755
--- a/known_good.json
+++ b/known_good.json
@@ -5,14 +5,14 @@
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Tools",
       "subdir" : "External/spirv-tools",
-      "commit" : "8e9be303b00ba352ee25dbcd352769641637a853"
+      "commit" : "d543f7dfed9ba02910996121375e57fff92c3c93"
     },
     {
       "name" : "spirv-tools/external/spirv-headers",
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Headers",
       "subdir" : "External/spirv-tools/external/spirv-headers",
-      "commit" : "a2c529b5dda18838ab4b52f816acfebd774eaab3"
+      "commit" : "282879ca34563020dbe73fd8f7d45bed6755626a"
     }
   ]
 }