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

Includes:
fda6edcb HLSL Tests: Fix two tests to be valid under FXC.
318a379b Non-functional: HLSL further simplications to base I/O flattening on.
8bcdf2ea Non-functional: HLSL: clean up dead code for splitting.
48dc5872 Merge pull request #1005 from LoopDawg/remove-unused
7a3cef10 HLSL: Non-functional: warning fix, remove unused member.
a58cc9ff GLSL reflection: Fix #985: reflect runtime sized arrays having no constant index.
a353bf1f Nonfunctional: Add reflect test case, and fix long lines in reflection code.
2ceec681 Nonfunctional: Shorten some lines to the coding standard, to retrigger failed test run.
38151b2f Merge pull request #1002 from amdrexu/bugfix
286ca432 SPV: Memory qualifiers should decorate top-level block members
f1f5058a Merge pull request #997 from LoopDawg/clipcull-semantic
307b6507 HLSL: handle multiple clip/cull semantic IDs
d2d3a142 SPV: Update to latest 1.0 headers, removing redundancies in GLSL.ext.AMD.h.
cd52fd5a Merge pull request #1000 from LoopDawg/samplecmpzero-cubearray-fix
ef94b1a5 Fix dref explicit LOD form of sample with cube texture arrays
53863a3a GLSL: Implement version 320 for ES.
9353f1af GLSL: Add version-number checking.
67eb4970 SPV/OpenGL: Require locations on non-opaque uniform variables.
ab008675 Merge pull request #991 from LoopDawg/resource-set-binding-fix
a2b71902 Reflection: Fix #977: Expose getBinding(), use in new getUniformBinding().
52017192 Fix crash with --resource-set-binding [n] (common set form, not per-register form)
0e392aa9 Merge pull request #996 from KhronosGroup/decorate-parameters
961cd35b SPV: Fix #995: Include memory decorations on parameters.
fad62972 SPV: Non-functional: support lists of decorations per parameter.
198652a6 Merge pull request #994 from KhronosGroup/opaque-init
0e6e2ffd Fix #980: flatten opaque initializers to use aliases.
37c202aa Merge pull request #992 from polarina/null-deref-fix
b5d9c11e Fix NULL pointer dereference in TParseContext::builtInOpCheck
91e69c03 SPV: Address #989: Don't add Location to built-ins when automapping.
56d2b990 Merge pull request #987 from KhronosGroup/global-std140
735d7e56 Address part A of #982: $Global will use std140 instead of HLSL offsets.
1e4a721c Merge pull request #978 from LoopDawg/global-const-init-fix
d854ac8b Merge pull request #983 from LoopDawg/warning-fix
b97b25e4 Fix StandAlone.cpp compilation warnings
0fca0baf WIP: HLSL: support global const initializers from non-constant rvalues
652db16f Build: Fix #975: shut up a compiler warning (code was fine).
4b1a890b Nonfunctional, infrastructure: Clean up Test directory droppings.
645fdaa7 Merge pull request #971 from amdrexu/bugfix
57e65929 HLSL: Translate directive [flatten] and [branch] to SPV control mask.
423fae48 Tests: Add a test for concurrent use of std430 and push_constant.
9645f782 Merge pull request #965 from chaoc/spv-khr-post-depth-coverage
c1204527 Implement SPV_KHR_post_depth_coverage
33bf7b2f Merge pull request #974 from LoopDawg/anyall-types
54b9ff9c HLSL: handle type conversion for any/all intrinsics
17b5f917 Merge pull request #969 from d3x0r/patch-1
3f70d405 Merge pull request #970 from rohith10/master
6206091e Fix CMake scripts: The set_property script can be used to set only a single property, so now setting the POSITION_INDEPENDENT_CODE property correctly.
45933124 Update CMakeLists.txt
4e53d905 Update CMakeLists.txt
89de217f Update CMakeLists.txt
9c6ea324 Update CMakeLists.txt
57a2b22d Update CMakeLists.txt
cde46127 Update CMakeLists.txt
02ed9eb2 Update CMakeLists.txt
42b69261 Update CMakeLists.txt
f8f494ff Add option to skip installation
eb5f12d1 Merge pull request #967 from dsrbecky/multiview
d1be7545 HLSL: Non-functional: Move partial flattened access into symbol node.
02a14e7c HLSL: Non-functional: some coding convention tweaks (120 columns, nullptr).
0af795e8 Merge pull request #966 from TiemoJung/io_remapper_update
aad93a80 Merge pull request #959 from TiemoJung/texture_upgrade
5513d9d0 Multiview extension: Accept layout(num_views) qualifier
0422eb23 io resolver improvements
99466020 Merge pull request #964 from dsrbecky/multiview
0fbe02c6 Implement extensions GL_OVR_multiview and GL_OVR_multiview2
fde4975d Fix for not transforming all image symbols into sampled images symbols
2ae23ca1 Merge pull request #957 from amdrexu/feature
37d7cfb1 Merge pull request #961 from benvanik/fix_order
82da44d4 Fixing initialization order to fix -Wreorder warning in clang.
89400ea7 GLSL: validation of early_fragment_tests, others, on an object.
37cdceed Implement extension GL_ARB_shader_stencil_export
89f8d1e6 HLSL: Fix #942: Map SV_TargetN to SPV Location N.
4f54c0c4 HLSL: Fix hull-shader test.
da9eb815 HLSL: Don't pin down which tessellation stage must error check input primitive.
fe6689c6 HLSL: support point mode.
102328b7 Merge pull request #950 from dsrbecky/shadow_samplers
a8a83204 Merge pull request #948 from KhronosGroup/env-control
6353d55e Command-line: Add support for setting language's environment.
c178f0a4 Infrastructure: Non-functional: rationalize some command-line processing.
4be4aebd Infrastructure: Non-functional: Move to rich description of environment.
c6ac40a1 Add support for GL_EXT_shadow_samplers
4fbb8cb4 Merge pull request #947 from LoopDawg/clip-cull-distance
c44b95fd WIP: HLSL: handle clip/cull distance array semantic matching
4329d555 HLSL: Broaden solution for #940, editing integer input for 'flat'.
f0bc598d HLSL: Force flat interpolation for structure members. Fixes #940.
be1085cb Build: add switch default to make compilers happy
fba125a9 Merge pull request #943 from xxxbxxx/for-upstream-1
54596ff9 HLSL: Force flat (nointerp) onto integer fragment inputs.
b1d97537 hlsl: "in out" is also an inout qualifier.
f02c8e6b Non-functional: Attempt to reset Travis error, while adding more nullptr use.
2fcdd64e HLSL: Remove support for named tbuffer/cbuffer.  Fixes #939.
054378d9 HLSL: Non-functional: Make test valid HLSL, and related comments/cleanup.
e2ff404f Merge pull request #917 from KhronosGroup/remove-redundant-locations
f790b161 Tests: Fix missing test result.
a931366f Standalone: Implement -D and -U for preprocessor macros.
04acb1b7 Standalone: Rationalize ShaderCompUnit and file data.
6263fb19 Infrastructure: Rationalize command-line options.
2d46e73b Merge pull request #931 from LoopDawg/scalar-mat-assign
e2713125 HLSL: fix several issues in mat construction from scalars
f7cd88a2 Merge pull request #937 from amdrexu/bugfix
301a2bc8 SPV: Fix an typo of SPV_AMD_texture_gather_bias_lod
82ae8c31 HLSL: Fix #924: Convert between two different arrays with cast.
0320d090 HLSL: Recognize types declared as identifiers as identifiers.
7cdf3fc3 Replace #422: Remove the redundant location setting in AST->SPIR-V.

Test: ndk/checkpoint.py on Linux; unit tests on Windows
Change-Id: I0260b403a61da54e9e655322e97b2af8a80c9760
diff --git a/.gitignore b/.gitignore
index 30889ac..3e6cc14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,8 +6,4 @@
 TAGS
 build/
 Test/localResults/
-Test/multiThread.out
-Test/singleThread.out
-Test/vert.spv
-Test/frag.spv
 External/googletest
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d98c9f..9bc94b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,11 @@
 # Adhere to GNU filesystem layout conventions
 include(GNUInstallDirs)
 
+option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL})
+if(NOT ${SKIP_GLSLANG_INSTALL})
+  set(ENABLE_GLSLANG_INSTALL ON)
+endif()
+
 option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
 option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
 
diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
index 8edd143..5bb3f0e 100644
--- a/OGLCompilersDLL/CMakeLists.txt
+++ b/OGLCompilersDLL/CMakeLists.txt
@@ -1,11 +1,14 @@
 set(SOURCES InitializeDll.cpp InitializeDll.h)
 
 add_library(OGLCompiler STATIC ${SOURCES})
-set_property(TARGET OGLCompiler PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET OGLCompiler PROPERTY FOLDER glslang)
+set_property(TARGET OGLCompiler PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 if(WIN32)
     source_group("Source" FILES ${SOURCES})
 endif(WIN32)
 
-install(TARGETS OGLCompiler
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS OGLCompiler
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
index 2ad86d6..3c5ebab 100755
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
@@ -40,18 +40,22 @@
 endif(ENABLE_NV_EXTENSIONS)
 
 add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
-set_property(TARGET SPIRV PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET SPIRV PROPERTY FOLDER glslang)
+set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
 target_link_libraries(SPIRV glslang)
 
 add_library(SPVRemapper STATIC ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
-set_property(TARGET SPVRemapper PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
+set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 if(WIN32)
     source_group("Source" FILES ${SOURCES} ${HEADERS})
     source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
 endif(WIN32)
 
-install(TARGETS SPIRV SPVRemapper
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS SPIRV SPVRemapper
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
-install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
+    install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/SPIRV/GLSL.ext.AMD.h b/SPIRV/GLSL.ext.AMD.h
index a1b9ef9..b5b8dd6 100644
--- a/SPIRV/GLSL.ext.AMD.h
+++ b/SPIRV/GLSL.ext.AMD.h
@@ -38,15 +38,6 @@
 // SPV_AMD_shader_ballot
 static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot";
 
-static const Op OpGroupIAddNonUniformAMD = static_cast<Op>(5000);
-static const Op OpGroupFAddNonUniformAMD = static_cast<Op>(5001);
-static const Op OpGroupFMinNonUniformAMD = static_cast<Op>(5002);
-static const Op OpGroupUMinNonUniformAMD = static_cast<Op>(5003);
-static const Op OpGroupSMinNonUniformAMD = static_cast<Op>(5004);
-static const Op OpGroupFMaxNonUniformAMD = static_cast<Op>(5005);
-static const Op OpGroupUMaxNonUniformAMD = static_cast<Op>(5006);
-static const Op OpGroupSMaxNonUniformAMD = static_cast<Op>(5007);
-
 enum ShaderBallotAMD {
     ShaderBallotBadAMD = 0, // Don't use
 
@@ -80,16 +71,6 @@
 // SPV_AMD_shader_explicit_vertex_parameter
 static const char* const E_SPV_AMD_shader_explicit_vertex_parameter = "SPV_AMD_shader_explicit_vertex_parameter";
 
-static const BuiltIn BuiltInBaryCoordNoPerspAMD           = static_cast<BuiltIn>(4992);
-static const BuiltIn BuiltInBaryCoordNoPerspCentroidAMD   = static_cast<BuiltIn>(4993);
-static const BuiltIn BuiltInBaryCoordNoPerspSampleAMD     = static_cast<BuiltIn>(4994);
-static const BuiltIn BuiltInBaryCoordSmoothAMD            = static_cast<BuiltIn>(4995);
-static const BuiltIn BuiltInBaryCoordSmoothCentroidAMD    = static_cast<BuiltIn>(4996);
-static const BuiltIn BuiltInBaryCoordSmoothSampleAMD      = static_cast<BuiltIn>(4997);
-static const BuiltIn BuiltInBaryCoordPullModelAMD         = static_cast<BuiltIn>(4998);
-
-static const Decoration DecorationExplicitInterpAMD       = static_cast<Decoration>(4999);
-
 enum ShaderExplicitVertexParameterAMD {
     ShaderExplicitVertexParameterBadAMD = 0, // Don't use
 
@@ -117,8 +98,6 @@
 // SPV_AMD_texture_gather_bias_lod
 static const char* const E_SPV_AMD_texture_gather_bias_lod = "SPV_AMD_texture_gather_bias_lod";
 
-static const Capability OpCapabilityImageGatherBiasLodAMD = static_cast<Capability>(5009);
-
 // SPV_AMD_gpu_shader_int16
 static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16";
 
diff --git a/SPIRV/GLSL.ext.KHR.h b/SPIRV/GLSL.ext.KHR.h
index c9e31a6..6e02529 100644
--- a/SPIRV/GLSL.ext.KHR.h
+++ b/SPIRV/GLSL.ext.KHR.h
@@ -32,7 +32,7 @@
 enum Capability;
 
 static const int GLSLextKHRVersion = 100;
-static const int GLSLextKHRRevision = 1;
+static const int GLSLextKHRRevision = 2;
 
 static const char* const E_SPV_KHR_shader_ballot                = "SPV_KHR_shader_ballot";
 static const char* const E_SPV_KHR_subgroup_vote                = "SPV_KHR_subgroup_vote";
@@ -41,5 +41,6 @@
 static const char* const E_SPV_KHR_shader_draw_parameters       = "SPV_KHR_shader_draw_parameters";
 static const char* const E_SPV_KHR_16bit_storage                = "SPV_KHR_16bit_storage";
 static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class";
+static const char* const E_SPV_KHR_post_depth_coverage          = "SPV_KHR_post_depth_coverage";
 
 #endif  // #ifndef GLSLextKHR_H
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 9a29b2e..36b2707 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -122,6 +122,7 @@
     spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier);
     spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration);
     spv::ImageFormat TranslateImageFormat(const glslang::TType& type);
+    spv::SelectionControlMask TranslateSelectionControl(glslang::TSelectionControl) const;
     spv::LoopControlMask TranslateLoopControl(glslang::TLoopControl) const;
     spv::StorageClass TranslateStorageClass(const glslang::TType&);
     spv::Id createSpvVariable(const glslang::TIntermSymbol*);
@@ -520,6 +521,10 @@
             builder.addCapability(spv::CapabilityGeometry);
         return spv::BuiltInPrimitiveId;
 
+    case glslang::EbvFragStencilRef:
+        logger->missingFunctionality("shader stencil export");
+        return spv::BuiltInMax;
+
     case glslang::EbvInvocationId:         return spv::BuiltInInvocationId;
     case glslang::EbvTessLevelInner:       return spv::BuiltInTessLevelInner;
     case glslang::EbvTessLevelOuter:       return spv::BuiltInTessLevelOuter;
@@ -737,6 +742,16 @@
     }
 }
 
+spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(glslang::TSelectionControl selectionControl) const
+{
+    switch (selectionControl) {
+    case glslang::ESelectionControlNone:        return spv::SelectionControlMaskNone;
+    case glslang::ESelectionControlFlatten:     return spv::SelectionControlFlattenMask;
+    case glslang::ESelectionControlDontFlatten: return spv::SelectionControlDontFlattenMask;
+    default:                                    return spv::SelectionControlMaskNone;
+    }
+}
+
 spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(glslang::TLoopControl loopControl) const
 {
     switch (loopControl) {
@@ -976,6 +991,12 @@
         if (glslangIntermediate->getEarlyFragmentTests())
             builder.addExecutionMode(shaderEntry, spv::ExecutionModeEarlyFragmentTests);
 
+        if (glslangIntermediate->getPostDepthCoverage()) {
+            builder.addCapability(spv::CapabilitySampleMaskPostDepthCoverage);
+            builder.addExecutionMode(shaderEntry, spv::ExecutionModePostDepthCoverage);
+            builder.addExtension(spv::E_SPV_KHR_post_depth_coverage);
+        }
+
         switch(glslangIntermediate->getDepth()) {
         case glslang::EldGreater:  mode = spv::ExecutionModeDepthGreater; break;
         case glslang::EldLess:     mode = spv::ExecutionModeDepthLess;    break;
@@ -1931,8 +1952,7 @@
         return false;
     }
 
-    // Instead, emit control flow...
-
+    // Instead, emit control flow...    
     // Don't handle results as temporaries, because there will be two names
     // and better to leave SSA to later passes.
     spv::Id result = (node->getBasicType() == glslang::EbtVoid)
@@ -1942,8 +1962,11 @@
     // emit the condition before doing anything with selection
     node->getCondition()->traverse(this);
 
+    // Selection control:
+    const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl());
+
     // make an "if" based on the value created by the condition
-    spv::Builder::If ifBuilder(accessChainLoad(node->getCondition()->getType()), builder);
+    spv::Builder::If ifBuilder(accessChainLoad(node->getCondition()->getType()), control, builder);
 
     // emit the "then" statement
     if (node->getTrueBlock() != nullptr) {
@@ -1981,6 +2004,9 @@
     node->getCondition()->traverse(this);
     spv::Id selector = accessChainLoad(node->getCondition()->getAsTyped()->getType());
 
+    // Selection control:
+    const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl());
+
     // browse the children to sort out code segments
     int defaultSegment = -1;
     std::vector<TIntermNode*> codeSegments;
@@ -2006,7 +2032,7 @@
 
     // make the switch statement
     std::vector<spv::Block*> segmentBlocks; // returned, as the blocks allocated in the call
-    builder.makeSwitch(selector, (int)codeSegments.size(), caseValues, valueIndexToSegment, defaultSegment, segmentBlocks);
+    builder.makeSwitch(selector, control, (int)codeSegments.size(), caseValues, valueIndexToSegment, defaultSegment, segmentBlocks);
 
     // emit all the code in the segments
     breakForLoop.push(false);
@@ -2431,7 +2457,6 @@
     // Create a vector of struct types for SPIR-V to consume
     std::vector<spv::Id> spvMembers;
     int memberDelta = 0;  // how much the member's index changes from glslang to SPIR-V, normally 0, except sometimes for blocks
-    int locationOffset = 0;  // for use across struct members, when they are called recursively
     for (int i = 0; i < (int)glslangMembers->size(); i++) {
         glslang::TType& glslangMember = *(*glslangMembers)[i].type;
         if (glslangMember.hiddenMember()) {
@@ -2448,11 +2473,9 @@
             glslang::TQualifier memberQualifier = glslangMember.getQualifier();
             InheritQualifiers(memberQualifier, qualifier);
 
-            // manually inherit location; it's more complex
+            // manually inherit location
             if (! memberQualifier.hasLocation() && qualifier.hasLocation())
-                memberQualifier.layoutLocation = qualifier.layoutLocation + locationOffset;
-            if (qualifier.hasLocation())
-                locationOffset += glslangIntermediate->computeTypeLocationSize(glslangMember);
+                memberQualifier.layoutLocation = qualifier.layoutLocation;
 
             // recurse
             spvMembers.push_back(convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier));
@@ -2508,36 +2531,21 @@
             }
             addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier));
 
-            if (qualifier.storage == glslang::EvqBuffer) {
+            if (type.getBasicType() == glslang::EbtBlock &&
+                qualifier.storage == glslang::EvqBuffer) {
+                // Add memory decorations only to top-level members of shader storage block
                 std::vector<spv::Decoration> memory;
                 TranslateMemoryDecoration(memberQualifier, memory);
                 for (unsigned int i = 0; i < memory.size(); ++i)
                     addMemberDecoration(spvType, member, memory[i]);
             }
 
-            // Compute location decoration; tricky based on whether inheritance is at play and
-            // what kind of container we have, etc.
-            // TODO: This algorithm (and it's cousin above doing almost the same thing) should
-            //       probably move to the linker stage of the front end proper, and just have the
-            //       answer sitting already distributed throughout the individual member locations.
-            int location = -1;                // will only decorate if present or inherited
+            // Location assignment was already completed correctly by the front end,
+            // just track whether a member needs to be decorated.
             // Ignore member locations if the container is an array, as that's
-            // ill-specified and decisions have been made to not allow this anyway.
-            // The object itself must have a location, and that comes out from decorating the object,
-            // not the type (this code decorates types).
-            if (! type.isArray()) {
-                if (memberQualifier.hasLocation()) { // no inheritance, or override of inheritance
-                    // struct members should not have explicit locations
-                    assert(type.getBasicType() != glslang::EbtStruct);
-                    location = memberQualifier.layoutLocation;
-                } else if (type.getBasicType() != glslang::EbtBlock) {
-                    // If it is a not a Block, (...) Its members are assigned consecutive locations (...)
-                    // The members, and their nested types, must not themselves have Location decorations.
-                } else if (qualifier.hasLocation()) // inheritance
-                    location = qualifier.layoutLocation + locationOffset;
-            }
-            if (location >= 0)
-                builder.addMemberDecoration(spvType, member, spv::DecorationLocation, location);
+            // ill-specified and decisions have been made to not allow this.
+            if (! type.isArray() && memberQualifier.hasLocation())
+                builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation);
 
             if (qualifier.hasLocation())      // track for upcoming inheritance
                 locationOffset += glslangIntermediate->computeTypeLocationSize(glslangMember);
@@ -2816,7 +2824,7 @@
 // 'currentOffset' should be passed in already initialized, ready to modify, and reflecting
 // the migration of data from nextOffset -> currentOffset.  It should be -1 on the first call.
 // -1 means a non-forced member offset (no decoration needed).
-void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& /*structType*/, const glslang::TType& memberType, int& currentOffset, int& nextOffset,
+void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset,
                                                 glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout)
 {
     // this will get a positive value when deemed necessary
@@ -2850,8 +2858,12 @@
     int memberAlignment = glslangIntermediate->getBaseAlignment(memberType, memberSize, dummyStride, explicitLayout == glslang::ElpStd140, matrixLayout == glslang::ElmRowMajor);
 
     // Adjust alignment for HLSL rules
+    // TODO: make this consistent in early phases of code:
+    //       adjusting this late means inconsistencies with earlier code, which for reflection is an issue
+    // Until reflection is brought in sync with these adjustments, don't apply to $Global,
+    // which is the most likely to rely on reflection, and least likely to rely implicit layouts
     if (glslangIntermediate->usingHlslOFfsets() &&
-        ! memberType.isArray() && memberType.isVector()) {
+        ! memberType.isArray() && memberType.isVector() && structType.getTypeName().compare("$Global") != 0) {
         int dummySize;
         int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, dummySize);
         if (componentAlignment <= 4)
@@ -2904,6 +2916,13 @@
 // Make all the functions, skeletally, without actually visiting their bodies.
 void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions)
 {
+    const auto getParamDecorations = [](std::vector<spv::Decoration>& decorations, const glslang::TType& type) {
+        spv::Decoration paramPrecision = TranslatePrecisionDecoration(type);
+        if (paramPrecision != spv::NoPrecision)
+            decorations.push_back(paramPrecision);
+        TranslateMemoryDecoration(type.getQualifier(), decorations);
+    };
+
     for (int f = 0; f < (int)glslFunctions.size(); ++f) {
         glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate();
         if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction || isShaderEntryPoint(glslFunction))
@@ -2924,11 +2943,13 @@
         //   GLSL has copy-in/copy-out semantics.  They can be handled though with a pointer to a copy.
 
         std::vector<spv::Id> paramTypes;
-        std::vector<spv::Decoration> paramPrecisions;
+        std::vector<std::vector<spv::Decoration>> paramDecorations; // list of decorations per parameter
         glslang::TIntermSequence& parameters = glslFunction->getSequence()[0]->getAsAggregate()->getSequence();
 
-        bool implicitThis = (int)parameters.size() > 0 && parameters[0]->getAsSymbolNode()->getName() == glslangIntermediate->implicitThisName;
+        bool implicitThis = (int)parameters.size() > 0 && parameters[0]->getAsSymbolNode()->getName() ==
+                                                          glslangIntermediate->implicitThisName;
 
+        paramDecorations.resize(parameters.size());
         for (int p = 0; p < (int)parameters.size(); ++p) {
             const glslang::TType& paramType = parameters[p]->getAsTyped()->getType();
             spv::Id typeId = convertGlslangToSpvType(paramType);
@@ -2942,14 +2963,15 @@
                 typeId = builder.makePointer(spv::StorageClassFunction, typeId);
             else
                 rValueParameters.insert(parameters[p]->getAsSymbolNode()->getId());
-            paramPrecisions.push_back(TranslatePrecisionDecoration(paramType));
+            getParamDecorations(paramDecorations[p], paramType);
             paramTypes.push_back(typeId);
         }
 
         spv::Block* functionBlock;
         spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()),
                                                             convertGlslangToSpvType(glslFunction->getType()),
-                                                            glslFunction->getName().c_str(), paramTypes, paramPrecisions, &functionBlock);
+                                                            glslFunction->getName().c_str(), paramTypes,
+                                                            paramDecorations, &functionBlock);
         if (implicitThis)
             function->setImplicitThis();
 
@@ -3294,7 +3316,7 @@
         if (bias || cracked.lod ||
             sourceExtensions.find(glslang::E_GL_AMD_texture_gather_bias_lod) != sourceExtensions.end()) {
             builder.addExtension(spv::E_SPV_AMD_texture_gather_bias_lod);
-            builder.addCapability(spv::OpCapabilityImageGatherBiasLodAMD);
+            builder.addCapability(spv::CapabilityImageGatherBiasLodAMD);
         }
     }
 #endif
@@ -3325,7 +3347,7 @@
 
     // lod
     if (cracked.lod) {
-        params.lod = arguments[2];
+        params.lod = arguments[2 + extraArgs];
         ++extraArgs;
     } else if (glslangIntermediate->getStage() != EShLangFragment) {
         // we need to invent the default lod for an explicit lod instruction for a non-fragment stage
@@ -3334,7 +3356,7 @@
 
     // multisample
     if (sampler.ms) {
-        params.sample = arguments[2]; // For MS, "sample" should be specified
+        params.sample = arguments[2 + extraArgs]; // For MS, "sample" should be specified
         ++extraArgs;
     }
 
@@ -5717,7 +5739,7 @@
         leftId = builder.createUnaryOp(spv::OpLogicalNot, boolTypeId, leftId);
 
     // make an "if" based on the left value
-    spv::Builder::If ifBuilder(leftId, builder);
+    spv::Builder::If ifBuilder(leftId, spv::SelectionControlMaskNone, builder);
 
     // emit right operand as the "then" part of the "if"
     builder.clearAccessChain();
diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp
index ffd17af..d472eb5 100644
--- a/SPIRV/SpvBuilder.cpp
+++ b/SPIRV/SpvBuilder.cpp
@@ -983,16 +983,16 @@
 
     Block* entry;
     std::vector<Id> params;
-    std::vector<Decoration> precisions;
+    std::vector<std::vector<Decoration>> decorations;
 
-    entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
+    entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, decorations, &entry);
 
     return entryPointFunction;
 }
 
 // Comments in header
 Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name,
-                                     const std::vector<Id>& paramTypes, const std::vector<Decoration>& precisions, Block **entry)
+                                     const std::vector<Id>& paramTypes, const std::vector<std::vector<Decoration>>& decorations, Block **entry)
 {
     // Make the function and initial instructions in it
     Id typeId = makeFunctionType(returnType, paramTypes);
@@ -1001,8 +1001,10 @@
 
     // Set up the precisions
     setPrecision(function->getId(), precision);
-    for (unsigned p = 0; p < (unsigned)precisions.size(); ++p)
-        setPrecision(firstParamId + p, precisions[p]);
+    for (unsigned p = 0; p < (unsigned)decorations.size(); ++p) {
+        for (int d = 0; d < (int)decorations[p].size(); ++d)
+            addDecoration(firstParamId + p, decorations[p][d]);
+    }
 
     // CFG
     if (entry) {
@@ -2009,9 +2011,10 @@
 }
 
 // Comments in header
-Builder::If::If(Id cond, Builder& gb) :
+Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) :
     builder(gb),
     condition(cond),
+    control(ctrl),
     elseBlock(0)
 {
     function = &builder.getBuildPoint()->getParent();
@@ -2052,7 +2055,7 @@
 
     // Go back to the headerBlock and make the flow control split
     builder.setBuildPoint(headerBlock);
-    builder.createSelectionMerge(mergeBlock, SelectionControlMaskNone);
+    builder.createSelectionMerge(mergeBlock, control);
     if (elseBlock)
         builder.createConditionalBranch(condition, thenBlock, elseBlock);
     else
@@ -2064,7 +2067,7 @@
 }
 
 // Comments in header
-void Builder::makeSwitch(Id selector, int numSegments, const std::vector<int>& caseValues,
+void Builder::makeSwitch(Id selector, unsigned int control, int numSegments, const std::vector<int>& caseValues,
                          const std::vector<int>& valueIndexToSegment, int defaultSegment,
                          std::vector<Block*>& segmentBlocks)
 {
@@ -2077,7 +2080,7 @@
     Block* mergeBlock = new Block(getUniqueId(), function);
 
     // make and insert the switch's selection-merge instruction
-    createSelectionMerge(mergeBlock, SelectionControlMaskNone);
+    createSelectionMerge(mergeBlock, control);
 
     // make the switch instruction
     Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch);
diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h
index 92f5084..3a94919 100755
--- a/SPIRV/SpvBuilder.h
+++ b/SPIRV/SpvBuilder.h
@@ -247,7 +247,7 @@
     // Return the function, pass back the entry.
     // The returned pointer is only valid for the lifetime of this builder.
     Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, const std::vector<Id>& paramTypes,
-                                const std::vector<Decoration>& precisions, Block **entry = 0);
+                                const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
 
     // Create a return. An 'implicit' return is one not appearing in the source
     // code.  In the case of an implicit return, no post-return block is inserted.
@@ -385,7 +385,7 @@
     // Helper to use for building nested control flow with if-then-else.
     class If {
     public:
-        If(Id condition, Builder& builder);
+        If(Id condition, unsigned int ctrl, Builder& builder);
         ~If() {}
 
         void makeBeginElse();
@@ -397,6 +397,7 @@
 
         Builder& builder;
         Id condition;
+        unsigned int control;
         Function* function;
         Block* headerBlock;
         Block* thenBlock;
@@ -416,7 +417,7 @@
     // Returns the right set of basic blocks to start each code segment with, so that the caller's
     // recursion stack can hold the memory for it.
     //
-    void makeSwitch(Id condition, int numSegments, const std::vector<int>& caseValues,
+    void makeSwitch(Id condition, unsigned int control, int numSegments, const std::vector<int>& caseValues,
                     const std::vector<int>& valueToSegment, int defaultSegment, std::vector<Block*>& segmentBB); // return argument
 
     // Add a branch to the innermost switch's merge block.
diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp
index bae43bd..fb0cc36 100755
--- a/SPIRV/doc.cpp
+++ b/SPIRV/doc.cpp
@@ -175,6 +175,7 @@
     case 31: return "ContractionOff";
     case 32: return "Bad";
 
+    case 4446:  return "PostDepthCoverage";
     case ExecutionModeCeiling:
     default: return "Bad";
     }
@@ -636,13 +637,15 @@
     }
 }
 
-const int LoopControlCeiling = 2;
+const int LoopControlCeiling = 4;
 
 const char* LoopControlString(int cont)
 {
     switch (cont) {
     case 0:  return "Unroll";
     case 1:  return "DontUnroll";
+    case 2:  return "DependencyInfinite";
+    case 3:  return "DependencyLength";
 
     case LoopControlCeiling:
     default: return "Bad";
@@ -843,6 +846,7 @@
     case 5009: return "ImageGatherBiasLodAMD";
 #endif
 
+    case 4447: return "SampleMaskPostDepthCoverage";
 #ifdef NV_EXTENSIONS
     case 5251: return "GeometryShaderPassthroughNV";
     case 5254: return "ShaderViewportIndexLayerNV";
diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp
index 91cb59e..338f6a1 100755
--- a/SPIRV/spirv.hpp
+++ b/SPIRV/spirv.hpp
@@ -47,11 +47,11 @@
 typedef unsigned int Id;
 
 #define SPV_VERSION 0x10000
-#define SPV_REVISION 10
+#define SPV_REVISION 11
 
 static const unsigned int MagicNumber = 0x07230203;
 static const unsigned int Version = 0x00010000;
-static const unsigned int Revision = 10;
+static const unsigned int Revision = 11;
 static const unsigned int OpCodeMask = 0xffff;
 static const unsigned int WordCountShift = 16;
 
@@ -122,6 +122,7 @@
     ExecutionModeOutputTriangleStrip = 29,
     ExecutionModeVecTypeHint = 30,
     ExecutionModeContractionOff = 31,
+    ExecutionModePostDepthCoverage = 4446,
     ExecutionModeMax = 0x7fffffff,
 };
 
@@ -376,6 +377,7 @@
     DecorationNoContraction = 42,
     DecorationInputAttachmentIndex = 43,
     DecorationAlignment = 44,
+    DecorationExplicitInterpAMD = 4999,
     DecorationOverrideCoverageNV = 5248,
     DecorationPassthroughNV = 5250,
     DecorationViewportRelativeNV = 5252,
@@ -435,6 +437,13 @@
     BuiltInDrawIndex = 4426,
     BuiltInDeviceIndex = 4438,
     BuiltInViewIndex = 4440,
+    BuiltInBaryCoordNoPerspAMD = 4992,
+    BuiltInBaryCoordNoPerspCentroidAMD = 4993,
+    BuiltInBaryCoordNoPerspSampleAMD = 4994,
+    BuiltInBaryCoordSmoothAMD = 4995,
+    BuiltInBaryCoordSmoothCentroidAMD = 4996,
+    BuiltInBaryCoordSmoothSampleAMD = 4997,
+    BuiltInBaryCoordPullModelAMD = 4998,
     BuiltInViewportMaskNV = 5253,
     BuiltInSecondaryPositionNV = 5257,
     BuiltInSecondaryViewportMaskNV = 5258,
@@ -628,6 +637,9 @@
     CapabilityMultiView = 4439,
     CapabilityVariablePointersStorageBuffer = 4441,
     CapabilityVariablePointers = 4442,
+    CapabilityAtomicStorageOps = 4445,
+    CapabilitySampleMaskPostDepthCoverage = 4447,
+    CapabilityImageGatherBiasLodAMD = 5009,
     CapabilitySampleMaskOverrideCoverageNV = 5249,
     CapabilityGeometryShaderPassthroughNV = 5251,
     CapabilityShaderViewportIndexLayerNV = 5254,
@@ -938,6 +950,14 @@
     OpSubgroupAnyKHR = 4429,
     OpSubgroupAllEqualKHR = 4430,
     OpSubgroupReadInvocationKHR = 4432,
+    OpGroupIAddNonUniformAMD = 5000,
+    OpGroupFAddNonUniformAMD = 5001,
+    OpGroupFMinNonUniformAMD = 5002,
+    OpGroupUMinNonUniformAMD = 5003,
+    OpGroupSMinNonUniformAMD = 5004,
+    OpGroupFMaxNonUniformAMD = 5005,
+    OpGroupUMaxNonUniformAMD = 5006,
+    OpGroupSMaxNonUniformAMD = 5007,
     OpMax = 0x7fffffff,
 };
 
diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index c61667c..b0d863d 100644
--- a/StandAlone/CMakeLists.txt
+++ b/StandAlone/CMakeLists.txt
@@ -1,6 +1,7 @@
 add_library(glslang-default-resource-limits
             ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp)
-set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
+set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 target_include_directories(glslang-default-resource-limits
                            PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
@@ -37,8 +38,10 @@
     source_group("Source" FILES ${SOURCES})
 endif(WIN32)
 
-install(TARGETS glslangValidator
-        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS glslangValidator
+            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-install(TARGETS spirv-remap
-        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+    install(TARGETS spirv-remap
+            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 0b8b8f4..3301df4 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -115,18 +115,14 @@
 EShLanguage FindLanguage(const std::string& name, bool parseSuffix=true);
 void CompileFile(const char* fileName, ShHandle);
 void usage();
-void FreeFileData(char** data);
-char** ReadFileData(const char* fileName);
+char* ReadFileData(const char* fileName);
+void FreeFileData(char* data);
 void InfoLogMsg(const char* msg, const char* name, const int num);
 
 // Globally track if any compile or link failure.
 bool CompileFailed = false;
 bool LinkFailed = false;
 
-// Use to test breaking up a single shader file into multiple strings.
-// Set in ReadFileData().
-int NumShaderStrings;
-
 TBuiltInResource Resources;
 std::string ConfigFile;
 
@@ -135,29 +131,13 @@
 //
 void ProcessConfigFile()
 {
-    char** configStrings = 0;
-    char* config = 0;
-    if (ConfigFile.size() > 0) {
-        configStrings = ReadFileData(ConfigFile.c_str());
-        if (configStrings)
-            config = *configStrings;
-        else {
-            printf("Error opening configuration file; will instead use the default configuration\n");
-            usage();
-        }
-    }
-
-    if (config == 0) {
+    if (ConfigFile.size() == 0)
         Resources = glslang::DefaultTBuiltInResource;
-        return;
+    else {
+        char* configString = ReadFileData(ConfigFile.c_str());
+        glslang::DecodeResourceLimits(&Resources,  configString);
+        FreeFileData(configString);
     }
-
-    glslang::DecodeResourceLimits(&Resources,  config);
-
-    if (configStrings)
-        FreeFileData(configStrings);
-    else
-        delete[] config;
 }
 
 int Options = 0;
@@ -168,6 +148,10 @@
 const char* shaderStageName = nullptr;
 const char* variableName = nullptr;
 std::vector<std::string> IncludeDirectoryList;
+int ClientInputSemanticsVersion = 100;   // maps to, say, #define VULKAN 100
+int VulkanClientVersion = 100;           // would map to, say, Vulkan 1.0
+int OpenGLClientVersion = 450;           // doesn't influence anything yet, but maps to OpenGL 4.50
+unsigned int TargetVersion = 0x00001000; // maps to, say, SPIR-V 1.0
 
 std::array<unsigned int, EShLangCount> baseSamplerBinding;
 std::array<unsigned int, EShLangCount> baseTextureBinding;
@@ -177,6 +161,52 @@
 std::array<unsigned int, EShLangCount> baseUavBinding;
 std::array<std::vector<std::string>, EShLangCount> baseResourceSetBinding;
 
+// Add things like "#define ..." to a preamble to use in the beginning of the shader.
+class TPreamble {
+public:
+    TPreamble() { }
+
+    bool isSet() const { return text.size() > 0; }
+    const char* get() const { return text.c_str(); }
+
+    // #define...
+    void addDef(std::string def)
+    {
+        text.append("#define ");
+        fixLine(def);
+
+        // The first "=" needs to turn into a space
+        const size_t equal = def.find_first_of("=");
+        if (equal != def.npos)
+            def[equal] = ' ';
+
+        text.append(def);
+        text.append("\n");
+    }
+
+    // #undef...
+    void addUndef(std::string undef)
+    {
+        text.append("#undef ");
+        fixLine(undef);
+        text.append(undef);
+        text.append("\n");
+    }
+
+protected:
+    void fixLine(std::string& line)
+    {
+        // Can't go past a newline in the line
+        const size_t end = line.find_first_of("\n");
+        if (end != line.npos)
+            line = line.substr(0, end);
+    }
+
+    std::string text;  // contents of preamble
+};
+
+TPreamble UserPreamble;
+
 //
 // Create the default name for saving a binary if -o is not provided.
 //
@@ -259,31 +289,29 @@
         usage();
 
     if (!isdigit(argv[1][0])) {
-        if (argc < 5) // this form needs one more argument
+        if (argc < 3) // this form needs one more argument
             usage();
 
-        // Parse form: --argname stage base
+        // Parse form: --argname stage [regname set base...], or:
+        //             --argname stage set
         const EShLanguage lang = FindLanguage(argv[1], false);
 
-        base[lang].push_back(argv[2]);
-        base[lang].push_back(argv[3]);
-        base[lang].push_back(argv[4]);
-        argc-= 4;
-        argv+= 4;
-        while(argv[1] != NULL) {
-            if(argv[1][0] != '-') {
-                base[lang].push_back(argv[1]);
-                base[lang].push_back(argv[2]);
-                base[lang].push_back(argv[3]);
-                argc-= 3;
-                argv+= 3;
-            }
-            else {
-                break;
-            }
+        argc--;
+        argv++;
+
+        while (argc > 1 && argv[1] != nullptr && argv[1][0] != '-') {
+            base[lang].push_back(argv[1]);
+
+            argc--;
+            argv++;
         }
+
+        // Must have one arg, or a multiple of three (for [regname set binding] triples)
+        if (base[lang].size() != 1 && (base[lang].size() % 3) != 0)
+            usage();
+
     } else {
-        // Parse form: --argname base
+        // Parse form: --argname set
         for (int lang=0; lang<EShLangCount; ++lang)
             base[lang].push_back(argv[1]);
 
@@ -310,9 +338,48 @@
     ExecutableName = argv[0];
     workItems.reserve(argc);
 
-    argc--;
-    argv++;
-    for (; argc >= 1; argc--, argv++) {
+    const auto bumpArg = [&]() {
+        if (argc > 0) {
+            argc--;
+            argv++;
+        }
+    };
+
+    // read a string directly attached to a single-letter option
+    const auto getStringOperand = [&](const char* desc) {
+        if (argv[0][2] == 0) {
+            printf("%s must immediately follow option (no spaces)\n", desc);
+            exit(EFailUsage);
+        }
+        return argv[0] + 2;
+    };
+
+    // read a number attached to a single-letter option
+    const auto getAttachedNumber = [&](const char* desc) {
+        int num = atoi(argv[0] + 2);
+        if (num == 0) {
+            printf("%s: expected attached non-0 number\n", desc);
+            exit(EFailUsage);
+        }
+        return num;
+    };
+
+    // minimum needed (without overriding something else) to target Vulkan SPIR-V
+    const auto setVulkanSpv = []() {
+        Options |= EOptionSpv;
+        Options |= EOptionVulkanRules;
+        Options |= EOptionLinkProgram;
+    };
+
+    // minimum needed (without overriding something else) to target OpenGL SPIR-V
+    const auto setOpenGlSpv = []() {
+        Options |= EOptionSpv;
+        Options |= EOptionLinkProgram;
+        // undo a -H default to Vulkan
+        Options &= ~EOptionVulkanRules;
+    };
+
+    for (bumpArg(); argc >= 1; bumpArg()) {
         if (argv[0][0] == '-') {
             switch (argv[0][1]) {
             case '-':
@@ -321,18 +388,59 @@
                     std::transform(lowerword.begin(), lowerword.end(), lowerword.begin(), ::tolower);
 
                     // handle --word style options
-                    if (lowerword == "shift-sampler-bindings" || // synonyms
-                        lowerword == "shift-sampler-binding"  ||
-                        lowerword == "ssb") {
-                        ProcessBindingBase(argc, argv, baseSamplerBinding);
-                    } else if (lowerword == "shift-texture-bindings" ||  // synonyms
-                               lowerword == "shift-texture-binding"  ||
-                               lowerword == "stb") {
-                        ProcessBindingBase(argc, argv, baseTextureBinding);
+                    if (lowerword == "auto-map-bindings" ||  // synonyms
+                        lowerword == "auto-map-binding"  ||
+                        lowerword == "amb") {
+                        Options |= EOptionAutoMapBindings;
+                    } else if (lowerword == "auto-map-locations" || // synonyms
+                               lowerword == "aml") {
+                        Options |= EOptionAutoMapLocations;
+                    } else if (lowerword == "client") {
+                        if (argc > 1) {
+                            if (strcmp(argv[1], "vulkan100") == 0)
+                                setVulkanSpv();
+                            else if (strcmp(argv[1], "opengl100") == 0)
+                                setOpenGlSpv();
+                            else
+                                Error("--client expects vulkan100 or opengl100");
+                        }
+                        bumpArg();
+                    } else if (lowerword == "flatten-uniform-arrays" || // synonyms
+                               lowerword == "flatten-uniform-array"  ||
+                               lowerword == "fua") {
+                        Options |= EOptionFlattenUniformArrays;
+                    } else if (lowerword == "hlsl-offsets") {
+                        Options |= EOptionHlslOffsets;
+                    } else if (lowerword == "hlsl-iomap" ||
+                               lowerword == "hlsl-iomapper" ||
+                               lowerword == "hlsl-iomapping") {
+                        Options |= EOptionHlslIoMapping;
+                    } else if (lowerword == "keep-uncalled" || // synonyms
+                               lowerword == "ku") {
+                        Options |= EOptionKeepUncalled;
+                    } else if (lowerword == "no-storage-format" || // synonyms
+                               lowerword == "nsf") {
+                        Options |= EOptionNoStorageFormat;
+                    } else if (lowerword == "resource-set-bindings" ||  // synonyms
+                               lowerword == "resource-set-binding"  ||
+                               lowerword == "rsb") {
+                        ProcessResourceSetBindingBase(argc, argv, baseResourceSetBinding);
                     } else if (lowerword == "shift-image-bindings" ||  // synonyms
                                lowerword == "shift-image-binding"  ||
                                lowerword == "sib") {
                         ProcessBindingBase(argc, argv, baseImageBinding);
+                    } else if (lowerword == "shift-sampler-bindings" || // synonyms
+                        lowerword == "shift-sampler-binding"  ||
+                        lowerword == "ssb") {
+                        ProcessBindingBase(argc, argv, baseSamplerBinding);
+                    } else if (lowerword == "shift-uav-bindings" ||  // synonyms
+                               lowerword == "shift-uav-binding"  ||
+                               lowerword == "suavb") {
+                        ProcessBindingBase(argc, argv, baseUavBinding);
+                    } else if (lowerword == "shift-texture-bindings" ||  // synonyms
+                               lowerword == "shift-texture-binding"  ||
+                               lowerword == "stb") {
+                        ProcessBindingBase(argc, argv, baseTextureBinding);
                     } else if (lowerword == "shift-ubo-bindings" ||  // synonyms
                                lowerword == "shift-ubo-binding"  ||
                                lowerword == "shift-cbuffer-bindings" ||
@@ -344,120 +452,93 @@
                                lowerword == "shift-ssbo-binding"  ||
                                lowerword == "sbb") {
                         ProcessBindingBase(argc, argv, baseSsboBinding);
-                    } else if (lowerword == "resource-set-bindings" ||  // synonyms
-                               lowerword == "resource-set-binding"  ||
-                               lowerword == "rsb") {
-                        ProcessResourceSetBindingBase(argc, argv, baseResourceSetBinding);
-                    } else if (lowerword == "shift-uav-bindings" ||  // synonyms
-                               lowerword == "shift-uav-binding"  ||
-                               lowerword == "suavb") {
-                        ProcessBindingBase(argc, argv, baseUavBinding);
-                    } else if (lowerword == "auto-map-bindings" ||  // synonyms
-                               lowerword == "auto-map-binding"  ||
-                               lowerword == "amb") {
-                        Options |= EOptionAutoMapBindings;
-                    } else if (lowerword == "flatten-uniform-arrays" || // synonyms
-                               lowerword == "flatten-uniform-array"  ||
-                               lowerword == "fua") {
-                        Options |= EOptionFlattenUniformArrays;
-                    } else if (lowerword == "no-storage-format" || // synonyms
-                               lowerword == "nsf") {
-                        Options |= EOptionNoStorageFormat;
+                    } else if (lowerword == "source-entrypoint" || // synonyms
+                               lowerword == "sep") {
+                        if (argc <= 1)
+                            Error("no <entry-point> provided for --source-entrypoint");
+                        sourceEntryPointName = argv[1];
+                        bumpArg();
+                        break;
+                    } else if (lowerword == "target-env") {
+                        if (argc > 1) {
+                            if (strcmp(argv[1], "vulkan1.0") == 0) {
+                                setVulkanSpv();
+                                VulkanClientVersion = 100;
+                            } else if (strcmp(argv[1], "opengl") == 0) {
+                                setOpenGlSpv();
+                                OpenGLClientVersion = 450;
+                            } else
+                                Error("--target-env expected vulkan1.0 or opengl");
+                        }
+                        bumpArg();
                     } else if (lowerword == "variable-name" || // synonyms
                         lowerword == "vn") {
                         Options |= EOptionOutputHexadecimal;
-                        variableName = argv[1];
-                        if (argc > 0) {
-                            argc--;
-                            argv++;
-                        } else
+                        if (argc <= 1)
                             Error("no <C-variable-name> provided for --variable-name");
+                        variableName = argv[1];
+                        bumpArg();
                         break;
-                    } else if (lowerword == "source-entrypoint" || // synonyms
-                               lowerword == "sep") {
-                        sourceEntryPointName = argv[1];
-                        if (argc > 0) {
-                            argc--;
-                            argv++;
-                        } else
-                            Error("no <entry-point> provided for --source-entrypoint");
-                        break;
-                    } else if (lowerword == "keep-uncalled" || // synonyms
-                               lowerword == "ku") {
-                        Options |= EOptionKeepUncalled;
-                    } else if (lowerword == "hlsl-offsets") {
-                        Options |= EOptionHlslOffsets;
-                    } else if (lowerword == "hlsl-iomap" ||
-                               lowerword == "hlsl-iomapper" ||
-                               lowerword == "hlsl-iomapping") {
-                        Options |= EOptionHlslIoMapping;
-                    } else if (lowerword == "auto-map-locations" || // synonyms
-                               lowerword == "aml") {
-                        Options |= EOptionAutoMapLocations;
                     } else {
                         usage();
                     }
                 }
                 break;
-            case 'H':
-                Options |= EOptionHumanReadableSpv;
-                if ((Options & EOptionSpv) == 0) {
-                    // default to Vulkan
-                    Options |= EOptionSpv;
-                    Options |= EOptionVulkanRules;
-                    Options |= EOptionLinkProgram;
-                }
+            case 'C':
+                Options |= EOptionCascadingErrors;
                 break;
-            case 'I':
-                if (argv[0][2] == 0) {
-                    printf("include path must immediately follow (no spaces) -I\n");
-                    exit(EFailUsage);
-                }
-                IncludeDirectoryList.push_back(argv[0]+2);
-                break;
-            case 'V':
-                Options |= EOptionSpv;
-                Options |= EOptionVulkanRules;
-                Options |= EOptionLinkProgram;
-                break;
-            case 'S':
-                shaderStageName = argv[1];
-                if (argc > 0) {
-                    argc--;
-                    argv++;
-                } else
-                    Error("no <stage> specified for -S");
-                break;
-            case 'G':
-                Options |= EOptionSpv;
-                Options |= EOptionLinkProgram;
-                // undo a -H default to Vulkan
-                Options &= ~EOptionVulkanRules;
+            case 'D':
+                if (argv[0][2] == 0)
+                    Options |= EOptionReadHlsl;
+                else
+                    UserPreamble.addDef(getStringOperand("-D<macro> macro name"));
                 break;
             case 'E':
                 Options |= EOptionOutputPreprocessed;
                 break;
+            case 'G':
+                // OpenGL Client
+                setOpenGlSpv();
+                if (argv[0][2] != 0)
+                    ClientInputSemanticsVersion = getAttachedNumber("-G<num> client input semantics");
+                break;
+            case 'H':
+                Options |= EOptionHumanReadableSpv;
+                if ((Options & EOptionSpv) == 0) {
+                    // default to Vulkan
+                    setVulkanSpv();
+                }
+                break;
+            case 'I':
+                IncludeDirectoryList.push_back(getStringOperand("-I<dir> include path"));
+                break;
+            case 'S':
+                if (argc <= 1)
+                    Error("no <stage> specified for -S");
+                shaderStageName = argv[1];
+                bumpArg();
+                break;
+            case 'U':
+                UserPreamble.addUndef(getStringOperand("-U<macro>: macro name"));
+                break;
+            case 'V':
+                setVulkanSpv();
+                if (argv[0][2] != 0)
+                    ClientInputSemanticsVersion = getAttachedNumber("-G<num> client input semantics");
+                break;
             case 'c':
                 Options |= EOptionDumpConfig;
                 break;
-            case 'C':
-                Options |= EOptionCascadingErrors;
-                break;
             case 'd':
                 Options |= EOptionDefaultDesktop;
                 break;
-            case 'D':
-                Options |= EOptionReadHlsl;
-                break;
             case 'e':
                 // HLSL todo: entry point handle needs much more sophistication.
                 // This is okay for one compilation unit with one entry point.
                 entryPointName = argv[1];
-                if (argc > 0) {
-                    argc--;
-                    argv++;
-                } else
+                if (argc <= 1)
                     Error("no <entry-point> provided for -e");
+                bumpArg();
                 break;
             case 'g':
                 Options |= EOptionDebug;
@@ -475,12 +556,10 @@
                 Options |= EOptionMemoryLeakMode;
                 break;
             case 'o':
-                binaryFileName = argv[1];
-                if (argc > 0) {
-                    argc--;
-                    argv++;
-                } else
+                if (argc <= 1)
                     Error("no <file> provided for -o");
+                binaryFileName = argv[1];
+                bumpArg();
                 break;
             case 'q':
                 Options |= EOptionDumpReflection;
@@ -590,36 +669,41 @@
 // This prevents erroneous newlines from appearing.
 void StderrIfNonEmpty(const char* str)
 {
-    if (str && str[0]) {
-      fprintf(stderr, "%s\n", str);
-    }
+    if (str && str[0])
+        fprintf(stderr, "%s\n", str);
 }
 
 // Simple bundling of what makes a compilation unit for ease in passing around,
 // and separation of handling file IO versus API (programmatic) compilation.
 struct ShaderCompUnit {
     EShLanguage stage;
-    std::string fileName;
-    char** text;             // memory owned/managed externally
-    const char* fileNameList[1];
+    static const int maxCount = 1;
+    int count;                          // live number of strings/names
+    const char* text[maxCount];         // memory owned/managed externally
+    std::string fileName[maxCount];     // hold's the memory, but...
+    const char* fileNameList[maxCount]; // downstream interface wants pointers
 
-    // Need to have a special constructors to adjust the fileNameList, since back end needs a list of ptrs
-    ShaderCompUnit(EShLanguage istage, std::string &ifileName, char** itext)
-    {
-        stage = istage;
-        fileName = ifileName;
-        text = itext;
-        fileNameList[0] = fileName.c_str();
-    }
+    ShaderCompUnit(EShLanguage stage) : stage(stage), count(0) { }
 
-    ShaderCompUnit(const ShaderCompUnit &rhs)
+    ShaderCompUnit(const ShaderCompUnit& rhs)
     {
         stage = rhs.stage;
-        fileName = rhs.fileName;
-        text = rhs.text;
-        fileNameList[0] = fileName.c_str();
+        count = rhs.count;
+        for (int i = 0; i < count; ++i) {
+            fileName[i] = rhs.fileName[i];
+            text[i] = rhs.text[i];
+            fileNameList[i] = rhs.fileName[i].c_str();
+        }
     }
 
+    void addString(std::string& ifileName, const char* itext)
+    {
+        assert(count < maxCount);
+        fileName[count] = ifileName;
+        text[count] = itext;
+        fileNameList[count] = fileName[count].c_str();
+        ++count;
+    }
 };
 
 //
@@ -646,11 +730,13 @@
     for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) {
         const auto &compUnit = *it;
         glslang::TShader* shader = new glslang::TShader(compUnit.stage);
-        shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, 1);
+        shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count);
         if (entryPointName) // HLSL todo: this needs to be tracked per compUnits
             shader->setEntryPoint(entryPointName);
         if (sourceEntryPointName)
             shader->setSourceEntryPoint(sourceEntryPointName);
+        if (UserPreamble.isSet())
+            shader->setPreamble(UserPreamble.get());
 
         shader->setShiftSamplerBinding(baseSamplerBinding[compUnit.stage]);
         shader->setShiftTextureBinding(baseTextureBinding[compUnit.stage]);
@@ -671,9 +757,27 @@
         if (Options & EOptionAutoMapLocations)
             shader->setAutoMapLocations(true);
 
+        // Set up the environment, some subsettings take precedence over earlier
+        // ways of setting things.
+        if (Options & EOptionSpv) {
+            if (Options & EOptionVulkanRules) {
+                shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
+                                                                : glslang::EShSourceGlsl,
+                                        compUnit.stage, glslang::EShClientVulkan, ClientInputSemanticsVersion);
+                shader->setEnvClient(glslang::EShClientVulkan, VulkanClientVersion);
+                shader->setEnvTarget(glslang::EshTargetSpv, TargetVersion);
+            } else {
+                shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
+                                                                : glslang::EShSourceGlsl,
+                                        compUnit.stage, glslang::EShClientOpenGL, ClientInputSemanticsVersion);
+                shader->setEnvClient(glslang::EShClientOpenGL, OpenGLClientVersion);
+                shader->setEnvTarget(glslang::EshTargetSpv, TargetVersion);
+            }
+        }
+
         shaders.push_back(shader);
 
-        const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100;
+        const int defaultVersion = Options & EOptionDefaultDesktop ? 110 : 100;
 
         DirStackFileIncluder includer;
         std::for_each(IncludeDirectoryList.rbegin(), IncludeDirectoryList.rend(), [&includer](const std::string& dir) {
@@ -697,7 +801,7 @@
 
         if (! (Options & EOptionSuppressInfolog) &&
             ! (Options & EOptionMemoryLeakMode)) {
-            PutsIfNonEmpty(compUnit.fileName.c_str());
+            PutsIfNonEmpty(compUnit.fileName[0].c_str());
             PutsIfNonEmpty(shader->getInfoLog());
             PutsIfNonEmpty(shader->getInfoDebugLog());
         }
@@ -798,17 +902,11 @@
     // they are all getting linked together.)
     glslang::TWorkItem* workItem;
     while (Worklist.remove(workItem)) {
-        ShaderCompUnit compUnit(
-            FindLanguage(workItem->name),
-            workItem->name,
-            ReadFileData(workItem->name.c_str())
-        );
-
-        if (! compUnit.text) {
+        ShaderCompUnit compUnit(FindLanguage(workItem->name));
+        char* fileText = ReadFileData(workItem->name.c_str());
+        if (fileText == nullptr)
             usage();
-            return;
-        }
-
+        compUnit.addString(workItem->name, fileText);
         compUnits.push_back(compUnit);
     }
 
@@ -823,8 +921,10 @@
             glslang::OS_DumpMemoryCounters();
     }
 
+    // free memory from ReadFileData, which got stored in a const char*
+    // as the first string above
     for (auto it = compUnits.begin(); it != compUnits.end(); ++it)
-        FreeFileData(it->text);
+        FreeFileData(const_cast<char*>(it->text[0]));
 }
 
 int C_DECL main(int argc, char* argv[])
@@ -974,29 +1074,22 @@
 void CompileFile(const char* fileName, ShHandle compiler)
 {
     int ret = 0;
-    char** shaderStrings = ReadFileData(fileName);
-    if (! shaderStrings) {
-        usage();
-    }
-
-    int* lengths = new int[NumShaderStrings];
+    char* shaderString = ReadFileData(fileName);
 
     // move to length-based strings, rather than null-terminated strings
-    for (int s = 0; s < NumShaderStrings; ++s)
-        lengths[s] = (int)strlen(shaderStrings[s]);
-
-    if (! shaderStrings) {
-        CompileFailed = true;
-        return;
-    }
+    int* lengths = new int[1];
+    lengths[0] = (int)strlen(shaderString);
 
     EShMessages messages = EShMsgDefault;
     SetMessageOptions(messages);
 
+    if (UserPreamble.isSet())
+        Error("-D and -U options require -l (linking)\n");
+
     for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) {
         for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) {
             // ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
-            ret = ShCompile(compiler, shaderStrings, NumShaderStrings, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
+            ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
             // const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err",
             //                         "or should be l", "ine 1", "string 5\n", "float glo", "bal",
             //                         ";\n#error should be line 2\n void main() {", "global = 2.3;}" };
@@ -1009,7 +1102,7 @@
     }
 
     delete [] lengths;
-    FreeFileData(shaderStrings);
+    FreeFileData(shaderString);
 
     if (ret == 0)
         CompileFailed = true;
@@ -1022,8 +1115,8 @@
 {
     printf("Usage: glslangValidator [option]... [file]...\n"
            "\n"
-           "Where: each 'file' ends in .<stage>, where <stage> is one of\n"
-           "    .conf   to provide an optional config file that replaces the default configuration\n"
+           "'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
+           "    .conf   to provide a config file that replaces the default configuration\n"
            "            (see -c option below for generating a template)\n"
            "    .vert   for a vertex shader\n"
            "    .tesc   for a tessellation control shader\n"
@@ -1032,27 +1125,35 @@
            "    .frag   for a fragment shader\n"
            "    .comp   for a compute shader\n"
            "\n"
-           "Compilation warnings and errors will be printed to stdout.\n"
-           "\n"
-           "To get other information, use one of the following options:\n"
-           "Each option must be specified separately.\n"
-           "  -V          create SPIR-V binary, under Vulkan semantics; turns on -l;\n"
+           "Options:\n"
+           "  -C          cascading errors; risk crash from accumulation of error recoveries\n"
+           "  -D          input is HLSL\n"
+           "  -D<macro=def>\n"
+           "  -D<macro>   define a pre-processor macro\n"
+           "  -E          print pre-processed GLSL; cannot be used with -l;\n"
+           "              errors will appear on stderr.\n"
+           "  -G[ver]     create SPIR-V binary, under OpenGL semantics; turns on -l;\n"
            "              default file name is <stage>.spv (-o overrides this)\n"
-           "  -G          create SPIR-V binary, under OpenGL semantics; turns on -l;\n"
-           "              default file name is <stage>.spv (-o overrides this)\n"
+           "              'ver', when present, is the version of the input semantics,\n"
+           "              which will appear in #define GL_SPIRV ver\n"
+           "              '--client opengl100' is the same as -G100\n"
+           "              a '--target-env' for OpenGL will also imply '-G'\n"
            "  -H          print human readable form of SPIR-V; turns on -V\n"
            "  -I<dir>     add dir to the include search path; includer's directory\n"
            "              is searched first, followed by left-to-right order of -I\n"
-           "  -E          print pre-processed GLSL; cannot be used with -l;\n"
-           "              errors will appear on stderr.\n"
            "  -S <stage>  uses specified stage rather than parsing the file extension\n"
-           "              valid choices for <stage> are vert, tesc, tese, geom, frag, or comp\n"
+           "              choices for <stage> are vert, tesc, tese, geom, frag, or comp\n"
+           "  -U<macro>   undefine a pre-processor macro\n"
+           "  -V[ver]     create SPIR-V binary, under Vulkan semantics; turns on -l;\n"
+           "              default file name is <stage>.spv (-o overrides this)\n"
+           "              'ver', when present, is the version of the input semantics,\n"
+           "              which will appear in #define VULKAN ver\n"
+           "              '--client vulkan100' is the same as -V100\n"
+           "              a '--target-env' for Vulkan will also imply '-V'\n"
            "  -c          configuration dump;\n"
            "              creates the default configuration file (redirect to a .conf file)\n"
-           "  -C          cascading errors; risks crashes from accumulation of error recoveries\n"
            "  -d          default to desktop (#version 110) when there is no shader #version\n"
            "              (default is ES version 100)\n"
-           "  -D          input is HLSL\n"
            "  -e          specify entry-point name\n"
            "  -g          generate debug information\n"
            "  -h          print this usage message\n"
@@ -1066,59 +1167,54 @@
            "  -t          multi-threaded mode\n"
            "  -v          print version strings\n"
            "  -w          suppress warnings (except as required by #extension : warn)\n"
-           "  -x          save 32-bit hexadecimal numbers as text, requires a binary option (e.g., -V)\n"
-           "\n"
-           "  --shift-sampler-binding [stage] num     set base binding number for samplers\n"
-           "  --ssb [stage] num                       synonym for --shift-sampler-binding\n"
-           "\n"
-           "  --shift-texture-binding [stage] num     set base binding number for textures\n"
-           "  --stb [stage] num                       synonym for --shift-texture-binding\n"
-           "\n"
-           "  --shift-image-binding [stage] num       set base binding number for images (uav)\n"
-           "  --sib [stage] num                       synonym for --shift-image-binding\n"
-           "\n"
-           "  --shift-UBO-binding [stage] num         set base binding number for UBOs\n"
-           "  --shift-cbuffer-binding [stage] num     synonym for --shift-UBO-binding\n"
-           "  --sub [stage] num                       synonym for --shift-UBO-binding\n"
-           "\n"
-           "  --shift-ssbo-binding [stage] num        set base binding number for SSBOs\n"
-           "  --sbb [stage] num                       synonym for --shift-ssbo-binding\n"
-           "\n"
-           "  --resource-set-binding [stage] num      set descriptor set and binding number for resources\n"
-           "  --rsb [stage] type set binding          synonym for --resource-set-binding\n"
-           "\n"
-           "  --shift-uav-binding [stage] num         set base binding number for UAVs\n"
-           "  --suavb [stage] num                     synonym for --shift-uav-binding\n"
-           "\n"
-           "  --auto-map-bindings                     automatically bind uniform variables without\n"
-           "                                          explicit bindings.\n"
-           "  --amb                                   synonym for --auto-map-bindings\n"
-           "\n"
-           "  --auto-map-locations                    automatically locate input/output lacking 'location'\n"
-           "                                          (fragile, not cross stage: recommend explicit\n"
-           "                                          'location' use in shader)\n"
-           "  --aml                                   synonym for --auto-map-locations\n"
-           "\n"
-           "  --flatten-uniform-arrays                flatten uniform texture & sampler arrays to scalars\n"
-           "  --fua                                   synonym for --flatten-uniform-arrays\n"
-           "\n"
-           "  --no-storage-format                     use Unknown image format\n"
-           "  --nsf                                   synonym for --no-storage-format\n"
-           "\n"
-           "  --source-entrypoint name                the given shader source function is renamed to be the entry point given in -e\n"
-           "  --sep                                   synonym for --source-entrypoint\n"
-           "\n"
-           "  --keep-uncalled                         don't eliminate uncalled functions when linking\n"
-           "  --ku                                    synonym for --keep-uncalled\n"
-           "\n"
-           "  --variable-name <name>                  Creates a C header file that contains a uint32_t array named <name>\n"
-           "                                          initialized with the shader binary code.\n"
-           "  --vn <name>                             synonym for --variable-name <name>\n"
-           "\n"
-           "  --hlsl-offsets                          Allow block offsets to follow HLSL rules instead of GLSL rules.\n"
-           "                                          Works independently of source language.\n"
-           "\n"
-           "  --hlsl-iomap                            Perform IO mapping in HLSL register space.\n"
+           "  -x          save binary output as text-based 32-bit hexadecimal numbers\n"
+           "  --auto-map-bindings                  automatically bind uniform variables\n"
+           "                                       without explicit bindings.\n"
+           "  --amb                                synonym for --auto-map-bindings\n"
+           "  --auto-map-locations                 automatically locate input/output lacking\n"
+           "                                       'location' (fragile, not cross stage)\n"
+           "  --aml                                synonym for --auto-map-locations\n"
+           "  --client {vulkan<ver>|opengl<ver>}   see -V and -G\n"
+           "  --flatten-uniform-arrays             flatten uniform texture/sampler arrays to\n"
+           "                                       scalars\n"
+           "  --fua                                synonym for --flatten-uniform-arrays\n"
+           "  --hlsl-offsets                       Allow block offsets to follow HLSL rules\n"
+           "                                       Works independently of source language\n"
+           "  --hlsl-iomap                         Perform IO mapping in HLSL register space\n"
+           "  --keep-uncalled                      don't eliminate uncalled functions\n"
+           "  --ku                                 synonym for --keep-uncalled\n"
+           "  --no-storage-format                  use Unknown image format\n"
+           "  --nsf                                synonym for --no-storage-format\n"
+           "  --resource-set-binding [stage] name set binding\n"
+           "              Set descriptor set and binding for individual resources\n"
+           "  --resource-set-binding [stage] set\n"
+           "              Set descriptor set for all resources\n"
+           "  --rsb [stage] type set binding       synonym for --resource-set-binding\n"
+           "  --shift-image-binding [stage] num    base binding number for images (uav)\n"
+           "  --sib [stage] num                    synonym for --shift-image-binding\n"
+           "  --shift-sampler-binding [stage] num  base binding number for samplers\n"
+           "  --ssb [stage] num                    synonym for --shift-sampler-binding\n"
+           "  --shift-ssbo-binding [stage] num     base binding number for SSBOs\n"
+           "  --sbb [stage] num                    synonym for --shift-ssbo-binding\n"
+           "  --shift-texture-binding [stage] num  base binding number for textures\n"
+           "  --stb [stage] num                    synonym for --shift-texture-binding\n"
+           "  --shift-uav-binding [stage] num      base binding number for UAVs\n"
+           "  --suavb [stage] num                  synonym for --shift-uav-binding\n"
+           "  --shift-UBO-binding [stage] num      base binding number for UBOs\n"
+           "  --shift-cbuffer-binding [stage] num  synonym for --shift-UBO-binding\n"
+           "  --sub [stage] num                    synonym for --shift-UBO-binding\n"
+           "  --source-entrypoint name             the given shader source function is\n"
+           "                                       renamed to be the entry point given in -e\n"
+           "  --sep                                synonym for --source-entrypoint\n"
+           "  --target-env {vulkan1.0|opengl}      set the execution environment the generated\n"
+           "                                       code will execute in (as opposed to language\n"
+           "                                       semantics selected by --client)\n"
+           "                                       default is 'vulkan1.0' under '--client vulkan'\n"
+           "                                       default is 'opengl' under '--client opengl'\n"
+           "  --variable-name <name>               Creates a C header file that contains a\n"
+           "                                       uint32_t array named <name>\n"
+           "                                       initialized with the shader binary code.\n"
+           "  --vn <name>                          synonym for --variable-name <name>\n"
            );
 
     exit(EFailUsage);
@@ -1156,76 +1252,33 @@
 //
 //   Malloc a string of sufficient size and read a string into it.
 //
-char** ReadFileData(const char* fileName)
+char* ReadFileData(const char* fileName)
 {
     FILE *in = nullptr;
     int errorCode = fopen_s(&in, fileName, "r");
-
-    int count = 0;
-    const int maxSourceStrings = 5;  // for testing splitting shader/tokens across multiple strings
-    char** return_data = (char**)malloc(sizeof(char *) * (maxSourceStrings+1)); // freed in FreeFileData()
-
     if (errorCode || in == nullptr)
         Error("unable to open input file");
 
+    int count = 0;
     while (fgetc(in) != EOF)
         count++;
 
     fseek(in, 0, SEEK_SET);
 
-    char *fdata = (char*)malloc(count+2); // freed before return of this function
-    if (! fdata)
-        Error("can't allocate memory");
-
-    if ((int)fread(fdata, 1, count, in) != count) {
-        free(fdata);
+    char* return_data = (char*)malloc(count + 1);  // freed in FreeFileData()
+    if ((int)fread(return_data, 1, count, in) != count) {
+        free(return_data);
         Error("can't read input file");
     }
 
-    fdata[count] = '\0';
+    return_data[count] = '\0';
     fclose(in);
 
-    if (count == 0) {
-        // recover from empty file
-        return_data[0] = (char*)malloc(count+2);  // freed in FreeFileData()
-        return_data[0][0]='\0';
-        NumShaderStrings = 0;
-        free(fdata);
-
-        return return_data;
-    } else
-        NumShaderStrings = 1;  // Set to larger than 1 for testing multiple strings
-
-    // compute how to split up the file into multiple strings, for testing multiple strings
-    int len = (int)(ceil)((float)count/(float)NumShaderStrings);
-    int ptr_len = 0;
-    int i = 0;
-    while (count > 0) {
-        return_data[i] = (char*)malloc(len + 2);  // freed in FreeFileData()
-        memcpy(return_data[i], fdata + ptr_len, len);
-        return_data[i][len] = '\0';
-        count -= len;
-        ptr_len += len;
-        if (count < len) {
-            if (count == 0) {
-               NumShaderStrings = i + 1;
-               break;
-            }
-            len = count;
-        }
-        ++i;
-    }
-
-    free(fdata);
-
     return return_data;
 }
 
-void FreeFileData(char** data)
+void FreeFileData(char* data)
 {
-    for(int i = 0; i < NumShaderStrings; i++)
-        free(data[i]);
-
     free(data);
 }
 
diff --git a/Test/300.vert b/Test/300.vert
index 83b9bb1..daf98b8 100644
--- a/Test/300.vert
+++ b/Test/300.vert
@@ -184,4 +184,21 @@
     yp = y;
     xp = y; // ERROR, wrong size
     yp = x; // ERROR, wrong size
+}

+
+layout(num_views = 2) in; // ERROR, no extension
+
+void mwErr()
+{
+    gl_ViewID_OVR;   // ERROR, no extension
+}
+
+#extension GL_OVR_multiview : enable
+
+layout(num_views = 2) uniform float mwUniform; // ERROR, must be global
+layout(num_views = 2) in; // OK
+
+void mwOk()
+{
+    gl_ViewID_OVR;
 }
diff --git a/Test/320.comp b/Test/320.comp
new file mode 100644
index 0000000..c31b047
--- /dev/null
+++ b/Test/320.comp
@@ -0,0 +1,5 @@
+#version 320 es

+

+void main()
+{
+}
diff --git a/Test/320.frag b/Test/320.frag
new file mode 100644
index 0000000..bed3f12
--- /dev/null
+++ b/Test/320.frag
@@ -0,0 +1,225 @@
+#version 320 es

+

+out outbname { int a; } outbinst;   // ERROR, not out block in fragment shader

+

+in inbname {

+    int a;

+    vec4 v;

+    struct { int b; } s;     // ERROR, nested struct definition

+} inbinst;

+

+in inbname2 {

+    layout(location = 12) int aAnon;

+    layout(location = 13) centroid in vec4 vAnon;

+};

+

+in layout(location = 13) vec4 aliased; // ERROR, aliased

+

+in inbname2 {                // ERROR, reuse of block name

+    int aAnon;

+    centroid in vec4 vAnon;

+};

+

+in badmember {               // ERROR, aAnon already in global scope

+    int aAnon;

+};

+

+int inbname;                 // ERROR, redefinition of block name

+

+vec4 vAnon;                  // ERROR, anon in global scope; redefinition

+

+in arrayed {

+    float f;

+} arrayedInst[4];

+uniform int i;

+void fooIO()

+{

+    vec4 v = inbinst.v + vAnon;

+    v *= arrayedInst[2].f;

+    v *= arrayedInst[i].f;

+}

+

+in vec4 gl_FragCoord;

+layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, non-ES

+

+layout(early_fragment_tests) in;

+out float gl_FragDepth;

+layout(depth_any) out float gl_FragDepth;  // ERROR, non-ES

+

+void main()

+{

+    gl_FragDepth = 0.2;  // ERROR, early_fragment_tests declared

+    bool f = gl_FrontFacing;

+}

+

+out float gl_FragDepth;

+

+void foo_GS()

+{

+    highp int l = gl_Layer;

+    highp int p = gl_PrimitiveID;

+}

+

+in vec2 inf, ing;

+uniform ivec2 offsets[4];

+uniform sampler2D sArray[4];

+uniform int sIndex;

+layout(binding = 0) uniform atomic_uint auArray[2];

+uniform ubName { int i; } ubInst[4];

+buffer bbName { int i; } bbInst[4];

+highp uniform writeonly image2D iArray[5];

+const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));

+

+void pfoo()

+{

+    precise vec2 h;

+    h = fma(inf, ing, h);

+    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));

+    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);

+    textureGatherOffsets(sArray[0], vec2(0.1), offsets);       // ERROR, offset not constant

+}

+

+precision highp imageCubeArray        ;

+precision highp iimageCubeArray       ;

+precision highp uimageCubeArray       ;

+

+precision highp samplerCubeArray      ;

+precision highp samplerCubeArrayShadow;

+precision highp isamplerCubeArray     ;

+precision highp usamplerCubeArray     ;

+

+uniform writeonly imageCubeArray  CA1;

+uniform writeonly iimageCubeArray CA2;

+uniform writeonly uimageCubeArray CA3;

+

+#ifdef GL_EXT_texture_cube_map_array

+uniform samplerCubeArray          CA4;

+uniform samplerCubeArrayShadow    CA5;

+uniform isamplerCubeArray         CA6;

+uniform usamplerCubeArray         CA7;

+#endif

+

+void CAT()

+{

+    highp vec4 b4 = texture(CA4, vec4(0.5), 0.24);

+    highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26);

+    highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27);

+}

+

+void goodSample()

+{

+    lowp     int  a1 = gl_SampleID;       

+    mediump  vec2 a2 = gl_SamplePosition; 

+    highp    int  a3 = gl_SampleMaskIn[0];

+    gl_SampleMask[0] = a3;

+    mediump int n1 = gl_MaxSamples;

+    mediump int n2 = gl_NumSamples;

+}

+

+uniform layout(r32f)  highp  image2D im2Df;

+uniform layout(r32ui) highp uimage2D im2Du;

+uniform layout(r32i)  highp iimage2D im2Di;

+uniform ivec2 P;

+

+uniform layout(rgba32f)  highp  image2D badIm2Df;  // ERROR, needs readonly or writeonly

+uniform layout(rgba8ui) highp uimage2D badIm2Du;   // ERROR, needs readonly or writeonly

+uniform layout(rgba16i)  highp iimage2D badIm2Di;  // ERROR, needs readonly or writeonly

+

+void goodImageAtom()

+{

+    float datf;

+    int dati;

+    uint datu;

+

+    imageAtomicAdd(     im2Di, P, dati);
+    imageAtomicAdd(     im2Du, P, datu);
+    imageAtomicMin(     im2Di, P, dati);
+    imageAtomicMin(     im2Du, P, datu);
+    imageAtomicMax(     im2Di, P, dati);
+    imageAtomicMax(     im2Du, P, datu);
+    imageAtomicAnd(     im2Di, P, dati);
+    imageAtomicAnd(     im2Du, P, datu);
+    imageAtomicOr(      im2Di, P, dati);
+    imageAtomicOr(      im2Du, P, datu);
+    imageAtomicXor(     im2Di, P, dati);
+    imageAtomicXor(     im2Du, P, datu);
+    imageAtomicExchange(im2Di, P, dati);
+    imageAtomicExchange(im2Du, P, datu);
+    imageAtomicExchange(im2Df, P, datf);
+    imageAtomicCompSwap(im2Di, P,  3, dati);

+    imageAtomicCompSwap(im2Du, P, 5u, datu);

+

+    imageAtomicMax(badIm2Di, P, dati);      // ERROR, not an allowed layout() on the image
+    imageAtomicMax(badIm2Du, P, datu);      // ERROR, not an allowed layout() on the image
+    imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image
+}

+

+centroid out vec4 colorCentroidBad;  // ERROR

+flat out vec4 colorBadFlat;          // ERROR

+smooth out vec4 colorBadSmooth;      // ERROR

+noperspective out vec4 colorBadNo;   // ERROR

+flat centroid in vec2 colorfc;

+in float scalarIn;

+

+sample in vec4 colorSampIn;

+sample out vec4 colorSampleBad;     // ERROR

+flat sample in vec4 colorfsi;

+sample in vec3 sampInArray[4];

+

+void interp()

+{

+    float res;

+    vec2 res2;

+    vec3 res3;

+    vec4 res4;

+

+    res2 = interpolateAtCentroid(colorfc);

+    res4 = interpolateAtCentroid(colorSampIn);

+    res4 = interpolateAtCentroid(colorfsi);

+    res  = interpolateAtCentroid(scalarIn);

+    res3 = interpolateAtCentroid(sampInArray);         // ERROR

+    res3 = interpolateAtCentroid(sampInArray[2]);

+    res2 = interpolateAtCentroid(sampInArray[2].xy);   // ERROR

+

+    res3 = interpolateAtSample(sampInArray, 1);        // ERROR

+    res3 = interpolateAtSample(sampInArray[i], 0);

+    res2 = interpolateAtSample(sampInArray[2].xy, 2);  // ERROR

+    res  = interpolateAtSample(scalarIn, 1);

+

+    res3 = interpolateAtOffset(sampInArray, vec2(0.2));         // ERROR

+    res3 = interpolateAtOffset(sampInArray[2], vec2(0.2));

+    res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2));   // ERROR, no swizzle

+    res  = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference

+    res  = interpolateAtOffset(scalarIn, vec2(0.2));

+

+    float f;

+    res  = interpolateAtCentroid(f);           // ERROR, not interpolant

+    res4 = interpolateAtSample(outp, 0);       // ERROR, not interpolant

+}

+

+layout(blend_support_multiply) out;
+layout(blend_support_screen) out;
+layout(blend_support_overlay) out;
+layout(blend_support_darken, blend_support_lighten) out;
+layout(blend_support_colordodge) layout(blend_support_colorburn) out;
+layout(blend_support_hardlight) out;
+layout(blend_support_softlight) out;
+layout(blend_support_difference) out;
+layout(blend_support_exclusion) out;
+layout(blend_support_hsl_hue) out;
+layout(blend_support_hsl_saturation) out;
+layout(blend_support_hsl_color) out;
+layout(blend_support_hsl_luminosity) out;
+layout(blend_support_all_equations) out;
+
+layout(blend_support_hsl_luminosity) out;              // okay to repeat
+
+layout(blend_support_hsl_luminosity) in;                       // ERROR, only on "out"
+layout(blend_support_hsl_luminosity) out vec4;                 // ERROR, only on standalone
+layout(blend_support_hsl_luminosity) out vec4 badout;          // ERROR, only on standalone
+layout(blend_support_hsl_luminosity) struct badS {int i;};     // ERROR, only on standalone
+layout(blend_support_hsl_luminosity) void blendFoo() { }       // ERROR, only on standalone
+void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone
+layout(blend_support_flizbit) out;                             // ERROR, no flizbit
+
+out vec4 outAA[2][2];  // ERROR
diff --git a/Test/320.geom b/Test/320.geom
new file mode 100644
index 0000000..38d71c3
--- /dev/null
+++ b/Test/320.geom
@@ -0,0 +1,134 @@
+#version 320 es

+

+precision mediump float;

+

+in fromVertex {

+    in vec3 color;

+} fromV[];

+

+in vec4 nonBlockUnsized[];

+

+out toFragment {

+    out vec3 color;

+} toF;

+

+out fromVertex {  // okay to reuse a block name for another block name

+    vec3 color;

+};

+

+out fooB {        // ERROR, cannot reuse block name as block instance

+    vec2 color;

+} fromVertex;

+

+int fromVertex;   // ERROR, cannot reuse a block name for something else

+

+out fooC {        // ERROR, cannot have same name for block and instance name

+    vec2 color;

+} fooC;

+

+void main()

+{

+    EmitVertex();

+    EndPrimitive();

+    EmitStreamVertex(1);    // ERROR

+    EndStreamPrimitive(0);  // ERROR

+

+    color = fromV[0].color;

+    gl_ClipDistance[3] =              // ERROR, no ClipDistance

+        gl_in[1].gl_ClipDistance[2];  // ERROR, no ClipDistance

+    gl_Position = gl_in[0].gl_Position;

+

+    gl_PrimitiveID = gl_PrimitiveIDIn;

+    gl_Layer = 2;

+}

+

+layout(stream = 4) out vec4 ov4; // ERROR, no streams

+

+layout(line_strip, points, triangle_strip, points, triangle_strip) out;  // just means triangle_strip"

+

+out ooutb { vec4 a; } ouuaa6;

+

+layout(max_vertices = 200) out;

+layout(max_vertices = 300) out;   // ERROR, too big

+void foo(layout(max_vertices = 4) int a)  // ERROR

+{

+    ouuaa6.a = vec4(1.0);

+}

+

+layout(line_strip, points, triangle_strip, points) out;  // ERROR, changing output primitive

+layout(line_strip, points) out; // ERROR, changing output primitive

+layout(triangle_strip) in; // ERROR, not an input primitive

+layout(triangle_strip) uniform; // ERROR

+layout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable

+layout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input

+layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0

+out outbn2 {

+    layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0

+    layout(max_vertices = 3) int b; // ERROR, not on a block member

+    layout(triangle_strip)   int c; // ERROR, not on a block member

+} outbi;

+

+layout(lines) out;  // ERROR, not on output

+layout(lines_adjacency) in;

+layout(triangles) in;             // ERROR, can't change it

+layout(triangles_adjacency) in;   // ERROR, can't change it

+layout(invocations = 4) in;

+

+in sameName {

+    int a15;

+} insn[];

+

+out sameName {

+    float f15;

+};

+

+uniform sameName {

+    bool b15;

+};

+

+const int summ = gl_MaxVertexAttribs +

+             gl_MaxGeometryInputComponents +

+             gl_MaxGeometryOutputComponents +

+             gl_MaxGeometryImageUniforms +

+             gl_MaxGeometryTextureImageUnits +

+             gl_MaxGeometryOutputVertices +

+             gl_MaxGeometryTotalOutputComponents +

+             gl_MaxGeometryUniformComponents +

+             gl_MaxGeometryAtomicCounters +

+             gl_MaxGeometryAtomicCounterBuffers +

+             gl_MaxVertexTextureImageUnits +

+             gl_MaxCombinedTextureImageUnits +

+             gl_MaxTextureImageUnits +

+             gl_MaxDrawBuffers;

+

+void fooe1()

+{

+    gl_ViewportIndex;  // ERROR, not in ES

+    gl_MaxViewports;   // ERROR, not in ES

+    insn.length();     // 4: lines_adjacency

+    int inv = gl_InvocationID;

+}

+

+in vec4 explArray[4];

+in vec4 explArrayBad[5];  // ERROR, wrong size

+in vec4 nonArrayed;       // ERROR, not an array

+flat out vec3 myColor1;

+centroid out vec3 myColor2;

+centroid in vec3 centr[];

+sample out vec4 perSampleColor;  // ERROR without sample extensions

+

+layout(max_vertices = 200) out;  // matching redecl

+

+layout(location = 7, component = 2) in float comp[];  // ERROR, es has no component

+

+void notHere()

+{

+    gl_MaxGeometryVaryingComponents;  // ERROR, not in ES

+    gl_VerticesIn;                    // ERROR, not in ES

+}

+

+void pointSize2()

+{

+    highp float ps = gl_in[3].gl_PointSize;  // ERROR, need extension

+    gl_PointSize = ps;                       // ERROR, need extension

+}

diff --git a/Test/320.tesc b/Test/320.tesc
new file mode 100644
index 0000000..4fa20f6
--- /dev/null
+++ b/Test/320.tesc
@@ -0,0 +1,150 @@
+#version 320 es

+

+layout(vertices = 4) out;

+out int outa[gl_out.length()];

+

+layout(quads) in;                   // ERROR

+layout(ccw) out;                    // ERROR

+layout(fractional_even_spacing) in; // ERROR

+

+patch in vec4 patchIn;              // ERROR

+patch out vec4 patchOut;

+

+void main()

+{

+    barrier();

+

+    int a = gl_MaxTessControlInputComponents +

+            gl_MaxTessControlOutputComponents +

+            gl_MaxTessControlTextureImageUnits +

+            gl_MaxTessControlUniformComponents +

+            gl_MaxTessControlTotalOutputComponents;

+

+    vec4 p = gl_in[1].gl_Position;

+    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension

+    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES

+

+    int pvi = gl_PatchVerticesIn;

+    int pid = gl_PrimitiveID;

+    int iid = gl_InvocationID;

+

+    gl_out[gl_InvocationID].gl_Position = p;

+    gl_out[gl_InvocationID].gl_PointSize = ps;        // ERROR, need point_size extension

+    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;  // ERROR, not in ES

+

+    gl_TessLevelOuter[3] = 3.2;

+    gl_TessLevelInner[1] = 1.3;

+

+    if (a > 10)

+        barrier();           // ERROR

+    else

+        barrier();           // ERROR

+

+    barrier();

+

+    do {

+        barrier();           // ERROR

+    } while (a > 10);

+

+    switch (a) {

+    default:

+        barrier();           // ERROR

+        break;

+    }

+    a < 12 ? a : (barrier(), a); // ERROR

+    {

+        barrier();

+    }

+

+    return;

+

+    barrier();               // ERROR

+}

+

+layout(vertices = 4) in;    // ERROR, not on in

+layout(vertices = 5) out;   // ERROR, changing #

+

+void foo()

+{

+    gl_out[4].gl_Position;  // ERROR, out of range

+

+    barrier();              // ERROR, not in main

+}

+

+in vec2 ina;                // ERROR, not array

+in vec2 inb[];

+in vec2 inc[18];            // ERROR, wrong size

+in vec2 ind[gl_MaxPatchVertices];

+patch out float implA[];    // ERROR, not sized

+

+#extension GL_ARB_separate_shader_objects : enable

+

+layout(location = 3) in vec4 ivla[];

+layout(location = 4) in vec4 ivlb[];

+layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping

+

+layout(location = 3) out vec4 ovla[];

+layout(location = 4) out vec4 ovlb[];

+layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping

+

+patch out pinbn {

+    int a;

+} pinbi;

+

+centroid out vec3 myColor2[];

+centroid in vec3 centr[];

+sample out vec4 perSampleColor[];

+

+layout(vertices = 4) out float badlay[];   // ERROR, not on a variable

+out float misSized[5];              // ERROR, size doesn't match

+out float okaySize[4];

+

+void pointSize2()

+{

+    float ps = gl_in[1].gl_PointSize;  // ERROR, need point_size extension

+    gl_out[gl_InvocationID].gl_PointSize = ps;   // ERROR, need point_size extension

+}

+

+precise vec3 pv3;

+

+void goodfoop()

+{

+    precise float d;

+

+    pv3 *= pv3;

+    pv3 = fma(pv3, pv3, pv3);

+    d = fma(d, d, d);

+}

+

+void bb()

+{

+    gl_BoundingBoxOES[0] = vec4(0.0);

+    gl_BoundingBoxOES[1] = vec4(1.0);

+    gl_BoundingBoxOES[2] = vec4(2.0);  // ERROR, overflow

+}

+

+out patch badpatchBName {  // ERROR, array size required

+    float f;

+} badpatchIName[];

+

+out patch patchBName {

+    float f;

+} patchIName[4];

+

+void outputtingOutparam(out int a)

+{

+    a = 2;

+}

+

+void outputting()

+{

+    outa[gl_InvocationID] = 2;

+    outa[1] = 2;                         // ERROR, not gl_InvocationID

+    gl_out[0].gl_Position = vec4(1.0);   // ERROR, not gl_InvocationID

+    outa[1];

+    gl_out[0];

+    outputtingOutparam(outa[0]);         // ERROR, not gl_InvocationID

+    outputtingOutparam(outa[gl_InvocationID]);

+    patchIName[1].f = 3.14;

+    outa[(gl_InvocationID)] = 2;

+}

diff --git a/Test/320.tese b/Test/320.tese
new file mode 100644
index 0000000..b1507d9
--- /dev/null
+++ b/Test/320.tese
@@ -0,0 +1,114 @@
+#version 320 es

+

+layout(vertices = 4) out; // ERROR

+layout(quads, cw) in;

+layout(triangles) in;     // ERROR

+layout(isolines) in;      // ERROR

+

+layout(ccw) in;           // ERROR

+layout(cw) in;

+

+layout(fractional_odd_spacing) in;    

+layout(equal_spacing) in;              // ERROR

+layout(fractional_even_spacing) in;    // ERROR

+

+layout(point_mode) in;

+

+patch in vec4 patchIn;

+patch out vec4 patchOut;  // ERROR

+

+void main()

+{

+    barrier(); // ERROR

+

+    int a = gl_MaxTessEvaluationInputComponents +

+            gl_MaxTessEvaluationOutputComponents +

+            gl_MaxTessEvaluationTextureImageUnits +

+            gl_MaxTessEvaluationUniformComponents +

+            gl_MaxTessPatchComponents +

+            gl_MaxPatchVertices +

+            gl_MaxTessGenLevel;

+

+    vec4 p = gl_in[1].gl_Position;

+    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension

+    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES

+

+    int pvi = gl_PatchVerticesIn;

+    int pid = gl_PrimitiveID;

+    vec3 tc = gl_TessCoord;

+    float tlo = gl_TessLevelOuter[3];

+    float tli = gl_TessLevelInner[1];

+

+    gl_Position = p;

+    gl_PointSize = ps;             // ERROR, need point_size extension

+    gl_ClipDistance[2] = cd;       // ERROR, not in ES

+}

+

+smooth patch in vec4 badp1;         // ERROR

+flat patch in vec4 badp2;           // ERROR

+noperspective patch in vec4 badp3;  // ERROR

+patch sample in vec3 badp4;         // ERROR

+

+#extension GL_ARB_separate_shader_objects : enable

+

+in gl_PerVertex           // ERROR, no size

+{

+    vec4 gl_Position;

+} gl_in[];

+

+in gl_PerVertex           // ERROR, second redeclaration of gl_in

+{

+    vec4 gl_Position;

+} gl_in[];

+

+layout(quads, cw) out;     // ERROR

+layout(triangles) out;     // ERROR

+layout(isolines) out;      // ERROR

+layout(cw) out;            // ERROR

+layout(fractional_odd_spacing) out;    // ERROR

+layout(equal_spacing) out;             // ERROR

+layout(fractional_even_spacing) out;   // ERROR

+layout(point_mode) out;                // ERROR

+

+in vec2 ina;      // ERROR, not array

+in vec2 inb[];

+in vec2 inc[18];  // ERROR, wrong size

+in vec2 ind[gl_MaxPatchVertices];

+

+in testbla {      // ERROR, not array

+    int f;

+} bla;

+

+in testblb {

+    int f;

+} blb[];

+

+in testblc { // ERROR wrong size

+    int f;

+} blc[18];

+

+in testbld {

+    int f;

+} bld[gl_MaxPatchVertices];

+

+layout(location = 23) in vec4 ivla[];

+layout(location = 24) in vec4 ivlb[];

+layout(location = 24) in vec4 ivlc[];  // ERROR, overlap

+

+layout(location = 23) out vec4 ovla[2];

+layout(location = 24) out vec4 ovlb[2];  // ERROR, overlap

+

+in float gl_TessLevelOuter[4];           // ERROR, can't redeclare

+

+patch in pinbn {

+    int a;

+} pinbi;

+

+centroid out vec3 myColor2;

+centroid in vec3 centr[];

+sample out vec4 perSampleColor;

+

+void bbbad()

+{

+    gl_BoundingBoxOES; // ERROR, wrong stage

+}

diff --git a/Test/320.vert b/Test/320.vert
new file mode 100644
index 0000000..42f1515
--- /dev/null
+++ b/Test/320.vert
@@ -0,0 +1,255 @@
+#version 320 es

+

+out outbname {

+    int a;

+    out vec4 v;

+    highp sampler2D s;   // ERROR, opaque type

+} outbinst;

+

+out outbname2 {

+    layout(location = 12) int aAnon;

+    layout(location = 13) vec4 vAnon;

+};

+

+layout(location = 12) out highp int aliased;  // ERROR, aliasing location

+

+in inbname { int a; } inbinst;  // ERROR, no in block in vertex shader

+

+out gl_PerVertex {              // ERROR, has extra member

+    highp vec4 gl_Position;

+    highp vec4 t;

+};

+

+void main()

+{

+    int sum  = gl_VertexID +

+               gl_InstanceID;

+    gl_Position = vec4(1.0);

+    gl_PointSize = 2.0;         // ERROR, removed by redeclaration

+}

+

+out gl_PerVertex {              // ERROR, already used and already redeclared

+    highp vec4 gl_Position;

+    highp vec4 t;

+};

+

+smooth out smo {                // ERROR, no smooth on a block

+    int i;

+} smon;

+

+flat out fmo {                  // ERROR, no flat on a block

+    int i;

+} fmon;

+

+centroid out cmo {              // ERROR, no centroid on a block

+    int i;

+} cmon;

+

+invariant out imo {             // ERROR, no invariant on a block

+    int i;

+} imon;

+

+in vec2 inf, ing;

+uniform ivec2 offsets[4];

+uniform sampler2D sArray[4];

+uniform int sIndex;

+layout(binding = 0) uniform atomic_uint auArray[2];

+uniform ubName { int i; } ubInst[4];

+buffer bbName { int i; } bbInst[4];

+highp uniform writeonly image2D iArray[5];

+const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));

+

+void pfoo()

+{

+    precise vec2 h;

+    h = fma(inf, ing, h);

+    sArray[sIndex + 1];

+    ubInst[sIndex + 1];

+    bbInst[sIndex - 2];      // ERROR, still not supported

+    iArray[2];

+    iArray[sIndex - 2];

+    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));

+    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);

+    textureGatherOffsets(sArray[0], vec2(0.1), offsets);   // ERROR, offset not constant

+}

+

+uniform samplerBuffer  noPreSamp1;            // ERROR, no default precision

+uniform isamplerBuffer noPreSamp2;            // ERROR, no default precision

+uniform usamplerBuffer noPreSamp3;            // ERROR, no default precision

+uniform writeonly imageBuffer    noPreSamp4;  // ERROR, no default precision

+uniform writeonly iimageBuffer   noPreSamp5;  // ERROR, no default precision

+uniform writeonly uimageBuffer   noPreSamp6;  // ERROR, no default precision

+

+precision highp samplerBuffer; 

+precision highp isamplerBuffer;

+precision highp usamplerBuffer;

+precision highp imageBuffer;   

+precision highp iimageBuffer;  

+precision highp uimageBuffer;  

+

+#ifdef GL_OES_texture_buffer

+uniform samplerBuffer  bufSamp1;          

+uniform isamplerBuffer bufSamp2;          

+uniform usamplerBuffer bufSamp3;          

+#endif

+#ifdef GL_EXT_texture_buffer

+uniform writeonly imageBuffer    bufSamp4;

+uniform writeonly iimageBuffer   bufSamp5;

+uniform writeonly uimageBuffer   bufSamp6;

+#endif

+

+void bufferT()

+{

+    highp int s1 = textureSize(bufSamp1);

+    highp int s2 = textureSize(bufSamp2);

+    highp int s3 = textureSize(bufSamp3);

+

+    highp int s4 = imageSize(bufSamp4);

+    highp int s5 = imageSize(bufSamp5);

+    highp int s6 = imageSize(bufSamp6);

+    

+    highp vec4 f1 = texelFetch(bufSamp1, s1);

+    highp ivec4 f2 = texelFetch(bufSamp2, s2);

+    highp uvec4 f3 = texelFetch(bufSamp3, s3);

+}

+

+uniform writeonly imageCubeArray  noPreCA1;   // ERROR, no default precision

+uniform writeonly iimageCubeArray noPreCA2;   // ERROR, no default precision

+uniform writeonly uimageCubeArray noPreCA3;   // ERROR, no default precision

+

+uniform samplerCubeArray          noPreCA4;   // ERROR, no default precision

+uniform samplerCubeArrayShadow    noPreCA5;   // ERROR, no default precision

+uniform isamplerCubeArray         noPreCA6;   // ERROR, no default precision

+uniform usamplerCubeArray         noPreCA7;   // ERROR, no default precision

+

+precision highp imageCubeArray        ;

+precision highp iimageCubeArray       ;

+precision highp uimageCubeArray       ;

+

+precision highp samplerCubeArray      ;

+precision highp samplerCubeArrayShadow;

+precision highp isamplerCubeArray     ;

+precision highp usamplerCubeArray     ;

+

+uniform writeonly imageCubeArray  CA1;

+uniform writeonly iimageCubeArray CA2;

+uniform writeonly uimageCubeArray CA3;

+

+layout(rgba16f) uniform readonly imageCubeArray  rCA1;

+layout(rgba32i) uniform readonly iimageCubeArray rCA2;

+layout(r32ui) uniform readonly uimageCubeArray rCA3;

+

+#ifdef GL_OES_texture_cube_map_array

+uniform samplerCubeArray          CA4;

+uniform samplerCubeArrayShadow    CA5;

+uniform isamplerCubeArray         CA6;

+uniform usamplerCubeArray         CA7;

+#endif

+

+void CAT()

+{

+    highp ivec3 s4 = textureSize(CA4, 1);

+    highp ivec3 s5 = textureSize(CA5, 1);

+    highp ivec3 s6 = textureSize(CA6, 1);

+    highp ivec3 s7 = textureSize(CA7, 1);

+    

+    highp vec4 t4 = texture(CA4, vec4(0.5));

+    highp float t5 = texture(CA5, vec4(0.5), 3.0);

+    highp ivec4 t6 = texture(CA6, vec4(0.5));

+    highp uvec4 t7 = texture(CA7, vec4(0.5));

+

+    highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24);

+    highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26);

+    highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27);

+

+    highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2));

+    highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2));

+    highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2));

+

+    highp vec4 gath4 = textureGather(CA4, vec4(0.5));

+    highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2);

+    highp ivec4 gath6 = textureGather(CA6, vec4(0.5));

+    highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1);

+    highp uvec4 gath7 = textureGather(CA7, vec4(0.5));

+    highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0);

+

+    highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5);

+

+    highp ivec3 s1 = imageSize(CA1);

+    highp ivec3 s2 = imageSize(CA2);

+    highp ivec3 s3 = imageSize(CA3);

+

+    imageStore(CA1, s3, vec4(1));

+    imageStore(CA2, s3, ivec4(1));

+    imageStore(CA3, s3, uvec4(1));

+

+    highp vec4 cl1 = imageLoad(rCA1, s3);

+    highp ivec4 cl2 = imageLoad(rCA2, s3);

+    highp uvec4 cl3 = imageLoad(rCA3, s3);

+}

+

+uniform sampler2DMSArray  noPrec2DMS;    // ERROR, no default

+uniform isampler2DMSArray noPrec2DMSi;   // ERROR, no default

+uniform usampler2DMSArray noPrec2DMSu;   // ERROR, no default

+

+precision highp sampler2DMSArray;

+precision highp isampler2DMSArray;

+precision highp usampler2DMSArray;

+

+uniform sampler2DMSArray  samp2DMSA;

+uniform isampler2DMSArray samp2DMSAi;

+uniform usampler2DMSArray samp2DMSAu;

+

+void MSA()

+{

+    vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2);

+    ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2);

+    uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2);

+    

+    ivec3 tfs = textureSize(samp2DMSA);

+    ivec3 tfsi = textureSize(samp2DMSAi);

+    ivec3 tfsb = textureSize(samp2DMSAi, 4);  // ERROR, no lod

+    ivec3 tfsu = textureSize(samp2DMSAu);

+}

+

+uniform layout(r32f)  highp  image2D im2Df;

+uniform layout(r32ui) highp uimage2D im2Du;

+uniform layout(r32i)  highp iimage2D im2Di;

+uniform ivec2 P;

+

+void goodImageAtom()

+{

+    float datf;

+    int dati;

+    uint datu;

+

+    imageAtomicAdd(     im2Di, P, dati);
+    imageAtomicAdd(     im2Du, P, datu);
+    imageAtomicMin(     im2Di, P, dati);
+    imageAtomicMin(     im2Du, P, datu);
+    imageAtomicMax(     im2Di, P, dati);
+    imageAtomicMax(     im2Du, P, datu);
+    imageAtomicAnd(     im2Di, P, dati);
+    imageAtomicAnd(     im2Du, P, datu);
+    imageAtomicOr(      im2Di, P, dati);
+    imageAtomicOr(      im2Du, P, datu);
+    imageAtomicXor(     im2Di, P, dati);
+    imageAtomicXor(     im2Du, P, datu);
+    imageAtomicExchange(im2Di, P, dati);
+    imageAtomicExchange(im2Du, P, datu);
+    imageAtomicExchange(im2Df, P, datf);
+    imageAtomicCompSwap(im2Di, P,  3, dati);

+    imageAtomicCompSwap(im2Du, P, 5u, datu);

+}

+

+sample out vec4 colorSample;

+flat sample out vec4 colorfsi;

+sample out vec3 sampInArray[4];

+in vec4 inv4;

+

+void badInterp()

+{

+    interpolateAtCentroid(inv4);             // ERROR, wrong stage

+    interpolateAtSample(inv4, 1);            // ERROR, need extension

+    interpolateAtOffset(inv4, vec2(0.2));    // ERROR, need extension

+}

diff --git a/Test/435.vert b/Test/435.vert
new file mode 100644
index 0000000..bf27ce9
--- /dev/null
+++ b/Test/435.vert
@@ -0,0 +1,2 @@
+#version 435

+void main() {}
\ No newline at end of file
diff --git a/Test/450.frag b/Test/450.frag
index 9df1391..076d0b3 100644
--- a/Test/450.frag
+++ b/Test/450.frag
@@ -64,3 +64,5 @@
     float f;

     layout(location = 13) float g;  // ERROR, location on array

 } bInst2[3];

+

+layout(early_fragment_tests) in float f; // ERROR, must be standalone

diff --git a/Test/450.geom b/Test/450.geom
index 83d99aa..45cbecb 100644
--- a/Test/450.geom
+++ b/Test/450.geom
@@ -15,3 +15,5 @@
     gl_in[3].gl_Position; // ERROR, out of range

     gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];

 }

+

+layout(points) in float f[3];  // ERROR, must be standalone

diff --git a/Test/450.tese b/Test/450.tese
index 6144793..8cdeb20 100644
--- a/Test/450.tese
+++ b/Test/450.tese
@@ -12,3 +12,10 @@
 {

     gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];

 }

+

+layout(equal_spacing)           in float f1[];  // ERROR, must be standalone

+layout(fractional_even_spacing) in float f2[];  // ERROR, must be standalone

+layout(fractional_odd_spacing)  in float f3[];  // ERROR, must be standalone

+layout(cw)                      in float f4[];  // ERROR, must be standalone

+layout(ccw)                     in float f5[];  // ERROR, must be standalone

+layout(point_mode)              in float f6[];  // ERROR, must be standalone

diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out
index ec5d5d0..507ad73 100644
--- a/Test/baseResults/300.vert.out
+++ b/Test/baseResults/300.vert.out
@@ -43,10 +43,18 @@
 ERROR: 0:175: '' : array size required 
 ERROR: 0:185: 'assign' :  cannot convert from ' temp 4-element array of highp float' to ' temp 3-element array of highp float'
 ERROR: 0:186: 'assign' :  cannot convert from ' temp 3-element array of highp float' to ' temp 4-element array of highp float'
-ERROR: 44 compilation errors.  No code generated.
+ERROR: 0:189: 'num_views' : required extension not requested: Possible extensions include:
+GL_OVR_multiview
+GL_OVR_multiview2
+ERROR: 0:193: 'gl_ViewID_OVR' : required extension not requested: Possible extensions include:
+GL_OVR_multiview
+GL_OVR_multiview2
+ERROR: 0:198: 'num_views' : can only apply to a standalone qualifier 
+ERROR: 47 compilation errors.  No code generated.
 
 
 Shader version: 300
+Requested GL_OVR_multiview
 ERROR: node is still EOpNull!
 0:27  Function Definition: main( ( global void)
 0:27    Function Parameters: 
@@ -289,6 +297,14 @@
 0:184        'y' ( temp 4-element array of highp float)
 0:185      'xp' ( temp 3-element array of highp float)
 0:186      'yp' ( temp 4-element array of highp float)
+0:191  Function Definition: mwErr( ( global void)
+0:191    Function Parameters: 
+0:193    Sequence
+0:193      'gl_ViewID_OVR' ( in highp uint ViewIndex)
+0:201  Function Definition: mwOk( ( global void)
+0:201    Function Parameters: 
+0:203    Sequence
+0:203      'gl_ViewID_OVR' ( in highp uint ViewIndex)
 0:?   Linker Objects
 0:?     'm43' ( uniform highp 4X3 matrix of float)
 0:?     'm33' ( uniform highp 3X3 matrix of float)
@@ -323,6 +339,7 @@
 0:?     'Binst' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp int a})
 0:?     'Bfoo' ( global highp int)
 0:?     'B430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a})
+0:?     'mwUniform' ( uniform highp float)
 0:?     'gl_VertexID' ( gl_VertexId highp int VertexId)
 0:?     'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
 
@@ -331,6 +348,7 @@
 
 
 Shader version: 300
+Requested GL_OVR_multiview
 ERROR: node is still EOpNull!
 0:27  Function Definition: main( ( global void)
 0:27    Function Parameters: 
@@ -481,6 +499,7 @@
 0:?     'Binst' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp int a})
 0:?     'Bfoo' ( global highp int)
 0:?     'B430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a})
+0:?     'mwUniform' ( uniform highp float)
 0:?     'gl_VertexID' ( gl_VertexId highp int VertexId)
 0:?     'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
 
diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out
index a6346b3..8107556 100644
--- a/Test/baseResults/310.frag.out
+++ b/Test/baseResults/310.frag.out
@@ -123,7 +123,7 @@
 ERROR: 0:392: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element 
 ERROR: 0:396: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element 
 ERROR: 0:397: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element 
-ERROR: 0:400: 'blend equation' : required extension not requested: GL_KHR_blend_equation_advanced
+ERROR: 0:400: 'blend equation' : not supported for this version or the enabled extensions 
 ERROR: 0:423: 'blend equation' : can only apply to 'out' 
 ERROR: 0:424: 'blend equation' : can only apply to a standalone qualifier 
 ERROR: 0:425: 'blend equation' : can only apply to a standalone qualifier 
diff --git a/Test/baseResults/320.comp.out b/Test/baseResults/320.comp.out
new file mode 100755
index 0000000..09cedd0
--- /dev/null
+++ b/Test/baseResults/320.comp.out
@@ -0,0 +1,19 @@
+320.comp
+Shader version: 320
+local_size = (1, 1, 1)
+0:? Sequence
+0:3  Function Definition: main( ( global void)
+0:3    Function Parameters: 
+0:?   Linker Objects
+
+
+Linked compute stage:
+
+
+Shader version: 320
+local_size = (1, 1, 1)
+0:? Sequence
+0:3  Function Definition: main( ( global void)
+0:3    Function Parameters: 
+0:?   Linker Objects
+
diff --git a/Test/baseResults/320.frag.out b/Test/baseResults/320.frag.out
new file mode 100755
index 0000000..76dbeaf
--- /dev/null
+++ b/Test/baseResults/320.frag.out
@@ -0,0 +1,576 @@
+320.frag
+ERROR: 0:3: 'output block' : not supported in this stage: fragment
+ERROR: 0:7: 'float' : type requires declaration of default precision qualifier 
+ERROR: 0:8: '' : cannot nest a structure definition inside a structure or block 
+ERROR: 0:16: 'location' : overlapping use of location 13
+ERROR: 0:18: 'inbname2' : Cannot reuse block name within the same interface: in
+ERROR: 0:23: 'badmember' : nameless block contains a member that already has a name at global scope 
+ERROR: 0:27: 'inbname' : redefinition 
+ERROR: 0:29: 'vAnon' : redefinition 
+ERROR: 0:43: 'origin_upper_left' : not supported with this profile: es
+ERROR: 0:43: 'pixel_center_integer' : not supported with this profile: es
+ERROR: 0:43: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
+ERROR: 0:47: 'depth layout qualifier' : not supported with this profile: es
+ERROR: 0:51: 'assign' :  l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests)
+ERROR: 0:79: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument
+ERROR: 0:124: 'rgba32f' : format requires readonly or writeonly memory qualifier 
+ERROR: 0:125: 'rgba8ui' : format requires readonly or writeonly memory qualifier 
+ERROR: 0:126: 'rgba16i' : format requires readonly or writeonly memory qualifier 
+ERROR: 0:152: 'imageAtomicMax' : only supported on image with format r32i or r32ui 
+ERROR: 0:153: 'imageAtomicMax' : only supported on image with format r32i or r32ui 
+ERROR: 0:154: 'imageAtomicExchange' : only supported on image with format r32f 
+ERROR: 0:157: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output 
+ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output 
+ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output 
+ERROR: 0:160: 'noperspective' : Reserved word. 
+ERROR: 0:160: 'noperspective' : not supported with this profile: es
+ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output 
+ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output 
+ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found 
+ERROR: 0:180: 'assign' :  cannot convert from ' const float' to ' temp mediump 3-component vector of float'
+ERROR: 0:182: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:184: 'interpolateAtSample' : no matching overloaded function found 
+ERROR: 0:184: 'assign' :  cannot convert from ' const float' to ' temp mediump 3-component vector of float'
+ERROR: 0:186: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:189: 'interpolateAtOffset' : no matching overloaded function found 
+ERROR: 0:189: 'assign' :  cannot convert from ' const float' to ' temp mediump 3-component vector of float'
+ERROR: 0:191: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:192: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:196: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:197: 'outp' : undeclared identifier 
+ERROR: 0:197: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element 
+ERROR: 0:197: 'assign' :  cannot convert from ' global float' to ' temp mediump 4-component vector of float'
+ERROR: 0:217: 'blend equation' : can only apply to 'out' 
+ERROR: 0:218: 'blend equation' : can only apply to a standalone qualifier 
+ERROR: 0:219: 'blend equation' : can only apply to a standalone qualifier 
+ERROR: 0:220: 'blend equation' : can only apply to a standalone qualifier 
+ERROR: 0:221: 'blend equation' : can only apply to a standalone qualifier 
+ERROR: 0:222: 'blend equation' : can only apply to a standalone qualifier 
+ERROR: 0:223: 'blend_support' : unknown blend equation 
+ERROR: 0:225: 'fragment-shader array-of-array output' : not supported with this profile: es
+ERROR: 49 compilation errors.  No code generated.
+
+
+Shader version: 320
+gl_FragCoord pixel center is integer
+gl_FragCoord origin is upper left
+using early_fragment_tests
+using depth_any
+using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations
+ERROR: node is still EOpNull!
+0:35  Function Definition: fooIO( ( global void)
+0:35    Function Parameters: 
+0:37    Sequence
+0:37      Sequence
+0:37        move second child to first child ( temp mediump 4-component vector of float)
+0:37          'v' ( temp mediump 4-component vector of float)
+0:37          add ( temp mediump 4-component vector of float)
+0:37            v: direct index for structure ( in mediump 4-component vector of float)
+0:37              'inbinst' ( in block{ in mediump int a,  in mediump 4-component vector of float v,  in structure{ global mediump int b} s})
+0:37              Constant:
+0:37                1 (const int)
+0:37            vAnon: direct index for structure (layout( location=13) centroid in mediump 4-component vector of float)
+0:37              'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon})
+0:37              Constant:
+0:37                1 (const uint)
+0:38      vector scale second child into first child ( temp mediump 4-component vector of float)
+0:38        'v' ( temp mediump 4-component vector of float)
+0:38        f: direct index for structure ( in mediump float)
+0:38          direct index ( temp block{ in mediump float f})
+0:38            'arrayedInst' ( in 4-element array of block{ in mediump float f})
+0:38            Constant:
+0:38              2 (const int)
+0:38          Constant:
+0:38            0 (const int)
+0:39      vector scale second child into first child ( temp mediump 4-component vector of float)
+0:39        'v' ( temp mediump 4-component vector of float)
+0:39        f: direct index for structure ( in mediump float)
+0:39          indirect index ( temp block{ in mediump float f})
+0:39            'arrayedInst' ( in 4-element array of block{ in mediump float f})
+0:39            'i' ( uniform mediump int)
+0:39          Constant:
+0:39            0 (const int)
+0:49  Function Definition: main( ( global void)
+0:49    Function Parameters: 
+0:51    Sequence
+0:51      move second child to first child ( temp highp float)
+0:51        'gl_FragDepth' ( gl_FragDepth highp float FragDepth)
+0:51        Constant:
+0:51          0.200000
+0:52      Sequence
+0:52        move second child to first child ( temp bool)
+0:52          'f' ( temp bool)
+0:52          'gl_FrontFacing' ( gl_FrontFacing bool Face)
+0:57  Function Definition: foo_GS( ( global void)
+0:57    Function Parameters: 
+0:59    Sequence
+0:59      Sequence
+0:59        move second child to first child ( temp highp int)
+0:59          'l' ( temp highp int)
+0:59          'gl_Layer' ( flat in highp int Layer)
+0:60      Sequence
+0:60        move second child to first child ( temp highp int)
+0:60          'p' ( temp highp int)
+0:60          'gl_PrimitiveID' ( flat in highp int PrimitiveID)
+0:73  Function Definition: pfoo( ( global void)
+0:73    Function Parameters: 
+0:?     Sequence
+0:76      move second child to first child ( temp mediump 2-component vector of float)
+0:76        'h' ( noContraction temp mediump 2-component vector of float)
+0:76        fma ( global mediump 2-component vector of float)
+0:76          'inf' ( smooth in mediump 2-component vector of float)
+0:76          'ing' ( smooth in mediump 2-component vector of float)
+0:76          'h' ( noContraction temp mediump 2-component vector of float)
+0:77      textureGatherOffset ( global lowp 4-component vector of float)
+0:77        direct index ( temp lowp sampler2D)
+0:77          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:77          Constant:
+0:77            0 (const int)
+0:77        Constant:
+0:77          0.100000
+0:77          0.100000
+0:77        Convert float to int ( temp lowp 2-component vector of int)
+0:77          'inf' ( smooth in mediump 2-component vector of float)
+0:78      textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump)
+0:78        direct index ( temp lowp sampler2D)
+0:78          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:78          Constant:
+0:78            0 (const int)
+0:78        Constant:
+0:78          0.100000
+0:78          0.100000
+0:78        Constant:
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:78          0 (const int)
+0:79      textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump)
+0:79        direct index ( temp lowp sampler2D)
+0:79          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:79          Constant:
+0:79            0 (const int)
+0:79        Constant:
+0:79          0.100000
+0:79          0.100000
+0:79        'offsets' ( uniform 4-element array of mediump 2-component vector of int)
+0:102  Function Definition: CAT( ( global void)
+0:102    Function Parameters: 
+0:104    Sequence
+0:104      Sequence
+0:104        move second child to first child ( temp highp 4-component vector of float)
+0:104          'b4' ( temp highp 4-component vector of float)
+0:104          texture ( global highp 4-component vector of float)
+0:104            'CA4' ( uniform highp samplerCubeArray)
+0:104            Constant:
+0:104              0.500000
+0:104              0.500000
+0:104              0.500000
+0:104              0.500000
+0:104            Constant:
+0:104              0.240000
+0:105      Sequence
+0:105        move second child to first child ( temp highp 4-component vector of int)
+0:105          'b6' ( temp highp 4-component vector of int)
+0:105          texture ( global highp 4-component vector of int)
+0:105            'CA6' ( uniform highp isamplerCubeArray)
+0:105            Constant:
+0:105              0.500000
+0:105              0.500000
+0:105              0.500000
+0:105              0.500000
+0:105            Constant:
+0:105              0.260000
+0:106      Sequence
+0:106        move second child to first child ( temp highp 4-component vector of uint)
+0:106          'b7' ( temp highp 4-component vector of uint)
+0:106          texture ( global highp 4-component vector of uint)
+0:106            'CA7' ( uniform highp usamplerCubeArray)
+0:106            Constant:
+0:106              0.500000
+0:106              0.500000
+0:106              0.500000
+0:106              0.500000
+0:106            Constant:
+0:106              0.270000
+0:109  Function Definition: goodSample( ( global void)
+0:109    Function Parameters: 
+0:111    Sequence
+0:111      Sequence
+0:111        move second child to first child ( temp lowp int)
+0:111          'a1' ( temp lowp int)
+0:111          'gl_SampleID' ( flat in lowp int SampleId)
+0:112      Sequence
+0:112        move second child to first child ( temp mediump 2-component vector of float)
+0:112          'a2' ( temp mediump 2-component vector of float)
+0:112          'gl_SamplePosition' ( smooth in mediump 2-component vector of float SamplePosition)
+0:113      Sequence
+0:113        move second child to first child ( temp highp int)
+0:113          'a3' ( temp highp int)
+0:113          direct index ( flat temp highp int SampleMaskIn)
+0:113            'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn)
+0:113            Constant:
+0:113              0 (const int)
+0:114      move second child to first child ( temp highp int)
+0:114        direct index ( temp highp int SampleMaskIn)
+0:114          'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn)
+0:114          Constant:
+0:114            0 (const int)
+0:114        'a3' ( temp highp int)
+0:115      Sequence
+0:115        move second child to first child ( temp mediump int)
+0:115          'n1' ( temp mediump int)
+0:115          Constant:
+0:115            4 (const int)
+0:116      Sequence
+0:116        move second child to first child ( temp mediump int)
+0:116          'n2' ( temp mediump int)
+0:116          'gl_NumSamples' ( uniform lowp int)
+0:128  Function Definition: goodImageAtom( ( global void)
+0:128    Function Parameters: 
+0:?     Sequence
+0:134      imageAtomicAdd ( global highp int)
+0:134        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:134        'P' ( uniform mediump 2-component vector of int)
+0:134        'dati' ( temp mediump int)
+0:135      imageAtomicAdd ( global highp uint)
+0:135        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:135        'P' ( uniform mediump 2-component vector of int)
+0:135        'datu' ( temp mediump uint)
+0:136      imageAtomicMin ( global highp int)
+0:136        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:136        'P' ( uniform mediump 2-component vector of int)
+0:136        'dati' ( temp mediump int)
+0:137      imageAtomicMin ( global highp uint)
+0:137        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:137        'P' ( uniform mediump 2-component vector of int)
+0:137        'datu' ( temp mediump uint)
+0:138      imageAtomicMax ( global highp int)
+0:138        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:138        'P' ( uniform mediump 2-component vector of int)
+0:138        'dati' ( temp mediump int)
+0:139      imageAtomicMax ( global highp uint)
+0:139        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:139        'P' ( uniform mediump 2-component vector of int)
+0:139        'datu' ( temp mediump uint)
+0:140      imageAtomicAnd ( global highp int)
+0:140        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:140        'P' ( uniform mediump 2-component vector of int)
+0:140        'dati' ( temp mediump int)
+0:141      imageAtomicAnd ( global highp uint)
+0:141        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:141        'P' ( uniform mediump 2-component vector of int)
+0:141        'datu' ( temp mediump uint)
+0:142      imageAtomicOr ( global highp int)
+0:142        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:142        'P' ( uniform mediump 2-component vector of int)
+0:142        'dati' ( temp mediump int)
+0:143      imageAtomicOr ( global highp uint)
+0:143        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:143        'P' ( uniform mediump 2-component vector of int)
+0:143        'datu' ( temp mediump uint)
+0:144      imageAtomicXor ( global highp int)
+0:144        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:144        'P' ( uniform mediump 2-component vector of int)
+0:144        'dati' ( temp mediump int)
+0:145      imageAtomicXor ( global highp uint)
+0:145        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:145        'P' ( uniform mediump 2-component vector of int)
+0:145        'datu' ( temp mediump uint)
+0:146      imageAtomicExchange ( global highp int)
+0:146        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:146        'P' ( uniform mediump 2-component vector of int)
+0:146        'dati' ( temp mediump int)
+0:147      imageAtomicExchange ( global highp uint)
+0:147        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:147        'P' ( uniform mediump 2-component vector of int)
+0:147        'datu' ( temp mediump uint)
+0:148      imageAtomicExchange ( global highp float)
+0:148        'im2Df' (layout( r32f) uniform highp image2D)
+0:148        'P' ( uniform mediump 2-component vector of int)
+0:148        'datf' ( temp mediump float)
+0:149      imageAtomicCompSwap ( global highp int)
+0:149        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:149        'P' ( uniform mediump 2-component vector of int)
+0:149        Constant:
+0:149          3 (const int)
+0:149        'dati' ( temp mediump int)
+0:150      imageAtomicCompSwap ( global highp uint)
+0:150        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:150        'P' ( uniform mediump 2-component vector of int)
+0:150        Constant:
+0:150          5 (const uint)
+0:150        'datu' ( temp mediump uint)
+0:152      imageAtomicMax ( global highp int)
+0:152        'badIm2Di' (layout( rgba16i) uniform highp iimage2D)
+0:152        'P' ( uniform mediump 2-component vector of int)
+0:152        'dati' ( temp mediump int)
+0:153      imageAtomicMax ( global highp uint)
+0:153        'badIm2Du' (layout( rgba8ui) uniform highp uimage2D)
+0:153        'P' ( uniform mediump 2-component vector of int)
+0:153        'datu' ( temp mediump uint)
+0:154      imageAtomicExchange ( global highp float)
+0:154        'badIm2Df' (layout( rgba32f) uniform highp image2D)
+0:154        'P' ( uniform mediump 2-component vector of int)
+0:154        'datf' ( temp mediump float)
+0:169  Function Definition: interp( ( global void)
+0:169    Function Parameters: 
+0:?     Sequence
+0:176      move second child to first child ( temp mediump 2-component vector of float)
+0:176        'res2' ( temp mediump 2-component vector of float)
+0:176        interpolateAtCentroid ( global mediump 2-component vector of float)
+0:176          'colorfc' ( centroid flat in mediump 2-component vector of float)
+0:177      move second child to first child ( temp mediump 4-component vector of float)
+0:177        'res4' ( temp mediump 4-component vector of float)
+0:177        interpolateAtCentroid ( global mediump 4-component vector of float)
+0:177          'colorSampIn' ( smooth sample in mediump 4-component vector of float)
+0:178      move second child to first child ( temp mediump 4-component vector of float)
+0:178        'res4' ( temp mediump 4-component vector of float)
+0:178        interpolateAtCentroid ( global mediump 4-component vector of float)
+0:178          'colorfsi' ( flat sample in mediump 4-component vector of float)
+0:179      move second child to first child ( temp mediump float)
+0:179        'res' ( temp mediump float)
+0:179        interpolateAtCentroid ( global mediump float)
+0:179          'scalarIn' ( smooth in mediump float)
+0:180      'res3' ( temp mediump 3-component vector of float)
+0:181      move second child to first child ( temp mediump 3-component vector of float)
+0:181        'res3' ( temp mediump 3-component vector of float)
+0:181        interpolateAtCentroid ( global mediump 3-component vector of float)
+0:181          direct index ( smooth sample temp mediump 3-component vector of float)
+0:181            'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:181            Constant:
+0:181              2 (const int)
+0:182      move second child to first child ( temp mediump 2-component vector of float)
+0:182        'res2' ( temp mediump 2-component vector of float)
+0:182        interpolateAtCentroid ( global mediump 2-component vector of float)
+0:182          vector swizzle ( temp mediump 2-component vector of float)
+0:182            direct index ( smooth sample temp mediump 3-component vector of float)
+0:182              'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:182              Constant:
+0:182                2 (const int)
+0:182            Sequence
+0:182              Constant:
+0:182                0 (const int)
+0:182              Constant:
+0:182                1 (const int)
+0:184      'res3' ( temp mediump 3-component vector of float)
+0:185      move second child to first child ( temp mediump 3-component vector of float)
+0:185        'res3' ( temp mediump 3-component vector of float)
+0:185        interpolateAtSample ( global mediump 3-component vector of float)
+0:185          indirect index ( smooth sample temp mediump 3-component vector of float)
+0:185            'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:185            'i' ( uniform mediump int)
+0:185          Constant:
+0:185            0 (const int)
+0:186      move second child to first child ( temp mediump 2-component vector of float)
+0:186        'res2' ( temp mediump 2-component vector of float)
+0:186        interpolateAtSample ( global mediump 2-component vector of float)
+0:186          vector swizzle ( temp mediump 2-component vector of float)
+0:186            direct index ( smooth sample temp mediump 3-component vector of float)
+0:186              'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:186              Constant:
+0:186                2 (const int)
+0:186            Sequence
+0:186              Constant:
+0:186                0 (const int)
+0:186              Constant:
+0:186                1 (const int)
+0:186          Constant:
+0:186            2 (const int)
+0:187      move second child to first child ( temp mediump float)
+0:187        'res' ( temp mediump float)
+0:187        interpolateAtSample ( global mediump float)
+0:187          'scalarIn' ( smooth in mediump float)
+0:187          Constant:
+0:187            1 (const int)
+0:189      'res3' ( temp mediump 3-component vector of float)
+0:190      move second child to first child ( temp mediump 3-component vector of float)
+0:190        'res3' ( temp mediump 3-component vector of float)
+0:190        interpolateAtOffset ( global mediump 3-component vector of float)
+0:190          direct index ( smooth sample temp mediump 3-component vector of float)
+0:190            'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:190            Constant:
+0:190              2 (const int)
+0:190          Constant:
+0:190            0.200000
+0:190            0.200000
+0:191      move second child to first child ( temp mediump 2-component vector of float)
+0:191        'res2' ( temp mediump 2-component vector of float)
+0:191        interpolateAtOffset ( global mediump 2-component vector of float)
+0:191          vector swizzle ( temp mediump 2-component vector of float)
+0:191            direct index ( smooth sample temp mediump 3-component vector of float)
+0:191              'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:191              Constant:
+0:191                2 (const int)
+0:191            Sequence
+0:191              Constant:
+0:191                0 (const int)
+0:191              Constant:
+0:191                1 (const int)
+0:191          Constant:
+0:191            0.200000
+0:191            0.200000
+0:192      move second child to first child ( temp mediump float)
+0:192        'res' ( temp mediump float)
+0:192        interpolateAtOffset ( global mediump float)
+0:192          add ( temp mediump float)
+0:192            'scalarIn' ( smooth in mediump float)
+0:192            'scalarIn' ( smooth in mediump float)
+0:192          Constant:
+0:192            0.200000
+0:192            0.200000
+0:193      move second child to first child ( temp mediump float)
+0:193        'res' ( temp mediump float)
+0:193        interpolateAtOffset ( global mediump float)
+0:193          'scalarIn' ( smooth in mediump float)
+0:193          Constant:
+0:193            0.200000
+0:193            0.200000
+0:196      move second child to first child ( temp mediump float)
+0:196        'res' ( temp mediump float)
+0:196        interpolateAtCentroid ( global mediump float)
+0:196          'f' ( temp mediump float)
+0:197      'res4' ( temp mediump 4-component vector of float)
+0:221  Function Definition: blendFoo( ( temp void)
+0:221    Function Parameters: 
+0:222  Function Definition: blendFoo(vf3; ( global void)
+0:222    Function Parameters: 
+0:222      'v' ( in mediump 3-component vector of float)
+0:?   Linker Objects
+0:?     'outbinst' ( out block{ out mediump int a})
+0:?     'inbinst' ( in block{ in mediump int a,  in mediump 4-component vector of float v,  in structure{ global mediump int b} s})
+0:?     'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon})
+0:?     'aliased' (layout( location=13) smooth in mediump 4-component vector of float)
+0:?     'arrayedInst' ( in 4-element array of block{ in mediump float f})
+0:?     'i' ( uniform mediump int)
+0:?     'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord)
+0:?     'gl_FragDepth' ( gl_FragDepth highp float FragDepth)
+0:?     'inf' ( smooth in mediump 2-component vector of float)
+0:?     'ing' ( smooth in mediump 2-component vector of float)
+0:?     'offsets' ( uniform 4-element array of mediump 2-component vector of int)
+0:?     'sArray' ( uniform 4-element array of lowp sampler2D)
+0:?     'sIndex' ( uniform mediump int)
+0:?     'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint)
+0:?     'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i})
+0:?     'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i})
+0:?     'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:?     'constOffsets' ( const 4-element array of mediump 2-component vector of int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?     'CA1' ( writeonly uniform highp imageCubeArray)
+0:?     'CA2' ( writeonly uniform highp iimageCubeArray)
+0:?     'CA3' ( writeonly uniform highp uimageCubeArray)
+0:?     'CA4' ( uniform highp samplerCubeArray)
+0:?     'CA5' ( uniform highp samplerCubeArrayShadow)
+0:?     'CA6' ( uniform highp isamplerCubeArray)
+0:?     'CA7' ( uniform highp usamplerCubeArray)
+0:?     'gl_SampleMaskIn' ( flat in implicitly-sized array of highp int SampleMaskIn)
+0:?     'gl_SampleMask' ( out implicitly-sized array of highp int SampleMaskIn)
+0:?     'im2Df' (layout( r32f) uniform highp image2D)
+0:?     'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:?     'im2Di' (layout( r32i) uniform highp iimage2D)
+0:?     'P' ( uniform mediump 2-component vector of int)
+0:?     'badIm2Df' (layout( rgba32f) uniform highp image2D)
+0:?     'badIm2Du' (layout( rgba8ui) uniform highp uimage2D)
+0:?     'badIm2Di' (layout( rgba16i) uniform highp iimage2D)
+0:?     'colorCentroidBad' ( centroid out mediump 4-component vector of float)
+0:?     'colorBadFlat' ( flat out mediump 4-component vector of float)
+0:?     'colorBadSmooth' ( smooth out mediump 4-component vector of float)
+0:?     'colorBadNo' ( noperspective out mediump 4-component vector of float)
+0:?     'colorfc' ( centroid flat in mediump 2-component vector of float)
+0:?     'scalarIn' ( smooth in mediump float)
+0:?     'colorSampIn' ( smooth sample in mediump 4-component vector of float)
+0:?     'colorSampleBad' ( sample out mediump 4-component vector of float)
+0:?     'colorfsi' ( flat sample in mediump 4-component vector of float)
+0:?     'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:?     'badout' ( out mediump 4-component vector of float)
+0:?     'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float)
+
+
+Linked fragment stage:
+
+ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers
+
+Shader version: 320
+gl_FragCoord pixel center is integer
+gl_FragCoord origin is upper left
+using early_fragment_tests
+using depth_any
+using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations
+ERROR: node is still EOpNull!
+0:49  Function Definition: main( ( global void)
+0:49    Function Parameters: 
+0:51    Sequence
+0:51      move second child to first child ( temp highp float)
+0:51        'gl_FragDepth' ( gl_FragDepth highp float FragDepth)
+0:51        Constant:
+0:51          0.200000
+0:52      Sequence
+0:52        move second child to first child ( temp bool)
+0:52          'f' ( temp bool)
+0:52          'gl_FrontFacing' ( gl_FrontFacing bool Face)
+0:?   Linker Objects
+0:?     'outbinst' ( out block{ out mediump int a})
+0:?     'inbinst' ( in block{ in mediump int a,  in mediump 4-component vector of float v,  in structure{ global mediump int b} s})
+0:?     'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon})
+0:?     'aliased' (layout( location=13) smooth in mediump 4-component vector of float)
+0:?     'arrayedInst' ( in 4-element array of block{ in mediump float f})
+0:?     'i' ( uniform mediump int)
+0:?     'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord)
+0:?     'gl_FragDepth' ( gl_FragDepth highp float FragDepth)
+0:?     'inf' ( smooth in mediump 2-component vector of float)
+0:?     'ing' ( smooth in mediump 2-component vector of float)
+0:?     'offsets' ( uniform 4-element array of mediump 2-component vector of int)
+0:?     'sArray' ( uniform 4-element array of lowp sampler2D)
+0:?     'sIndex' ( uniform mediump int)
+0:?     'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint)
+0:?     'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i})
+0:?     'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i})
+0:?     'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:?     'constOffsets' ( const 4-element array of mediump 2-component vector of int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?     'CA1' ( writeonly uniform highp imageCubeArray)
+0:?     'CA2' ( writeonly uniform highp iimageCubeArray)
+0:?     'CA3' ( writeonly uniform highp uimageCubeArray)
+0:?     'CA4' ( uniform highp samplerCubeArray)
+0:?     'CA5' ( uniform highp samplerCubeArrayShadow)
+0:?     'CA6' ( uniform highp isamplerCubeArray)
+0:?     'CA7' ( uniform highp usamplerCubeArray)
+0:?     'gl_SampleMaskIn' ( flat in 1-element array of highp int SampleMaskIn)
+0:?     'gl_SampleMask' ( out 1-element array of highp int SampleMaskIn)
+0:?     'im2Df' (layout( r32f) uniform highp image2D)
+0:?     'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:?     'im2Di' (layout( r32i) uniform highp iimage2D)
+0:?     'P' ( uniform mediump 2-component vector of int)
+0:?     'badIm2Df' (layout( rgba32f) uniform highp image2D)
+0:?     'badIm2Du' (layout( rgba8ui) uniform highp uimage2D)
+0:?     'badIm2Di' (layout( rgba16i) uniform highp iimage2D)
+0:?     'colorCentroidBad' ( centroid out mediump 4-component vector of float)
+0:?     'colorBadFlat' ( flat out mediump 4-component vector of float)
+0:?     'colorBadSmooth' ( smooth out mediump 4-component vector of float)
+0:?     'colorBadNo' ( noperspective out mediump 4-component vector of float)
+0:?     'colorfc' ( centroid flat in mediump 2-component vector of float)
+0:?     'scalarIn' ( smooth in mediump float)
+0:?     'colorSampIn' ( smooth sample in mediump 4-component vector of float)
+0:?     'colorSampleBad' ( sample out mediump 4-component vector of float)
+0:?     'colorfsi' ( flat sample in mediump 4-component vector of float)
+0:?     'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float)
+0:?     'badout' ( out mediump 4-component vector of float)
+0:?     'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float)
+
diff --git a/Test/baseResults/320.geom.out b/Test/baseResults/320.geom.out
new file mode 100755
index 0000000..f333766
--- /dev/null
+++ b/Test/baseResults/320.geom.out
@@ -0,0 +1,251 @@
+320.geom
+ERROR: 0:19: 'fromVertex' : block instance name redefinition 
+ERROR: 0:23: 'fromVertex' : redefinition 
+ERROR: 0:25: 'fooC' : block instance name redefinition 
+ERROR: 0:33: 'EmitStreamVertex' : no matching overloaded function found 
+ERROR: 0:34: 'EndStreamPrimitive' : no matching overloaded function found 
+ERROR: 0:37: 'gl_ClipDistance' : undeclared identifier 
+ERROR: 0:37: 'gl_ClipDistance' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:38: 'gl_ClipDistance' : no such field in structure 
+ERROR: 0:38: 'expression' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:37: 'assign' :  l-value required (can't modify a const)
+ERROR: 0:45: 'selecting output stream' : not supported with this profile: es
+ERROR: 0:52: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices 
+ERROR: 0:52: 'max_vertices' : cannot change previously set layout value 
+ERROR: 0:53: 'max_vertices' : can only apply to a standalone qualifier 
+ERROR: 0:58: 'points' : cannot change previously set output primitive 
+ERROR: 0:59: 'points' : cannot change previously set output primitive 
+ERROR: 0:60: 'triangle_strip' : cannot apply to input 
+ERROR: 0:61: 'triangle_strip' : cannot apply to: uniform
+ERROR: 0:62: 'triangle_strip' : can only apply to a standalone qualifier 
+ERROR: 0:63: 'triangle_strip' : can only apply to a standalone qualifier 
+ERROR: 0:64: 'invocations' : can only apply to a standalone qualifier 
+ERROR: 0:66: 'invocations' : can only apply to a standalone qualifier 
+ERROR: 0:67: 'max_vertices' : can only apply to a standalone qualifier 
+ERROR: 0:68: 'triangle_strip' : can only apply to a standalone qualifier 
+ERROR: 0:71: 'lines' : cannot apply to 'out' 
+ERROR: 0:73: 'triangles' : cannot change previously set input primitive 
+ERROR: 0:74: 'triangles_adjacency' : cannot change previously set input primitive 
+ERROR: 0:106: 'gl_ViewportIndex' : undeclared identifier 
+ERROR: 0:107: 'gl_MaxViewports' : undeclared identifier 
+ERROR: 0:113: 'lines_adjacency' : inconsistent input primitive for array size of explArrayBad
+ERROR: 0:114: 'in' : type must be an array: nonArrayed
+ERROR: 0:122: 'component' : not supported with this profile: es
+ERROR: 0:126: 'gl_MaxGeometryVaryingComponents' : undeclared identifier 
+ERROR: 0:127: 'gl_VerticesIn' : undeclared identifier 
+ERROR: 0:132: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_geometry_point_size
+GL_OES_geometry_point_size
+ERROR: 0:133: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_geometry_point_size
+GL_OES_geometry_point_size
+ERROR: 36 compilation errors.  No code generated.
+
+
+Shader version: 320
+invocations = 4
+max_vertices = 200
+input primitive = lines_adjacency
+output primitive = triangle_strip
+ERROR: node is still EOpNull!
+0:29  Function Definition: main( ( global void)
+0:29    Function Parameters: 
+0:31    Sequence
+0:31      EmitVertex ( global void)
+0:32      EndPrimitive ( global void)
+0:33      Constant:
+0:33        0.000000
+0:34      Constant:
+0:34        0.000000
+0:36      move second child to first child ( temp mediump 3-component vector of float)
+0:36        color: direct index for structure (layout( stream=0) out mediump 3-component vector of float)
+0:36          'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:36          Constant:
+0:36            0 (const uint)
+0:36        color: direct index for structure ( in mediump 3-component vector of float)
+0:36          direct index ( temp block{ in mediump 3-component vector of float color})
+0:36            'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color})
+0:36            Constant:
+0:36              0 (const int)
+0:36          Constant:
+0:36            0 (const int)
+0:37      move second child to first child ( temp float)
+0:37        Constant:
+0:37          0.000000
+0:38        Constant:
+0:38          0.000000
+0:39      move second child to first child ( temp highp 4-component vector of float)
+0:39        gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position)
+0:39          'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize})
+0:39          Constant:
+0:39            0 (const uint)
+0:39        gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:39          direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:39            'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:39            Constant:
+0:39              0 (const int)
+0:39          Constant:
+0:39            0 (const int)
+0:41      move second child to first child ( temp highp int)
+0:41        'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID)
+0:41        'gl_PrimitiveIDIn' ( in highp int PrimitiveID)
+0:42      move second child to first child ( temp highp int)
+0:42        'gl_Layer' (layout( stream=0) out highp int Layer)
+0:42        Constant:
+0:42          2 (const int)
+0:53  Function Definition: foo(i1; ( global void)
+0:53    Function Parameters: 
+0:53      'a' ( in highp int)
+0:55    Sequence
+0:55      move second child to first child ( temp mediump 4-component vector of float)
+0:55        a: direct index for structure (layout( stream=0) out mediump 4-component vector of float)
+0:55          'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a})
+0:55          Constant:
+0:55            0 (const int)
+0:55        Constant:
+0:55          1.000000
+0:55          1.000000
+0:55          1.000000
+0:55          1.000000
+0:104  Function Definition: fooe1( ( global void)
+0:104    Function Parameters: 
+0:106    Sequence
+0:106      'gl_ViewportIndex' ( temp float)
+0:107      'gl_MaxViewports' ( temp float)
+0:108      Constant:
+0:108        4 (const int)
+0:109      Sequence
+0:109        move second child to first child ( temp highp int)
+0:109          'inv' ( temp highp int)
+0:109          'gl_InvocationID' ( in highp int InvocationID)
+0:124  Function Definition: notHere( ( global void)
+0:124    Function Parameters: 
+0:126    Sequence
+0:126      'gl_MaxGeometryVaryingComponents' ( temp float)
+0:127      'gl_VerticesIn' ( temp float)
+0:130  Function Definition: pointSize2( ( global void)
+0:130    Function Parameters: 
+0:132    Sequence
+0:132      Sequence
+0:132        move second child to first child ( temp highp float)
+0:132          'ps' ( temp highp float)
+0:132          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:132            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:132              'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:132              Constant:
+0:132                3 (const int)
+0:132            Constant:
+0:132              1 (const int)
+0:133      move second child to first child ( temp highp float)
+0:133        gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize highp float PointSize)
+0:133          'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize})
+0:133          Constant:
+0:133            1 (const uint)
+0:133        'ps' ( temp highp float)
+0:?   Linker Objects
+0:?     'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color})
+0:?     'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float)
+0:?     'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:?     'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:?     'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:?     'ov4' (layout( stream=4) out mediump 4-component vector of float)
+0:?     'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a})
+0:?     'badv4' (layout( stream=0) out mediump 4-component vector of float)
+0:?     'bad2v4' ( in 4-element array of mediump 4-component vector of float)
+0:?     'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a})
+0:?     'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c})
+0:?     'insn' ( in 4-element array of block{ in highp int a15})
+0:?     'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15})
+0:?     'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15})
+0:?     'summ' ( const highp int)
+0:?       2752 (const int)
+0:?     'explArray' ( in 4-element array of mediump 4-component vector of float)
+0:?     'explArrayBad' ( in 5-element array of mediump 4-component vector of float)
+0:?     'nonArrayed' ( in mediump 4-component vector of float)
+0:?     'myColor1' (layout( stream=0) flat out mediump 3-component vector of float)
+0:?     'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float)
+0:?     'centr' ( centroid in 4-element array of mediump 3-component vector of float)
+0:?     'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float)
+0:?     'comp' (layout( location=7 component=2) in 4-element array of mediump float)
+
+
+Linked geometry stage:
+
+
+Shader version: 320
+invocations = 4
+max_vertices = 200
+input primitive = lines_adjacency
+output primitive = triangle_strip
+ERROR: node is still EOpNull!
+0:29  Function Definition: main( ( global void)
+0:29    Function Parameters: 
+0:31    Sequence
+0:31      EmitVertex ( global void)
+0:32      EndPrimitive ( global void)
+0:33      Constant:
+0:33        0.000000
+0:34      Constant:
+0:34        0.000000
+0:36      move second child to first child ( temp mediump 3-component vector of float)
+0:36        color: direct index for structure (layout( stream=0) out mediump 3-component vector of float)
+0:36          'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:36          Constant:
+0:36            0 (const uint)
+0:36        color: direct index for structure ( in mediump 3-component vector of float)
+0:36          direct index ( temp block{ in mediump 3-component vector of float color})
+0:36            'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color})
+0:36            Constant:
+0:36              0 (const int)
+0:36          Constant:
+0:36            0 (const int)
+0:37      move second child to first child ( temp float)
+0:37        Constant:
+0:37          0.000000
+0:38        Constant:
+0:38          0.000000
+0:39      move second child to first child ( temp highp 4-component vector of float)
+0:39        gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position)
+0:39          'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize})
+0:39          Constant:
+0:39            0 (const uint)
+0:39        gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:39          direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:39            'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:39            Constant:
+0:39              0 (const int)
+0:39          Constant:
+0:39            0 (const int)
+0:41      move second child to first child ( temp highp int)
+0:41        'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID)
+0:41        'gl_PrimitiveIDIn' ( in highp int PrimitiveID)
+0:42      move second child to first child ( temp highp int)
+0:42        'gl_Layer' (layout( stream=0) out highp int Layer)
+0:42        Constant:
+0:42          2 (const int)
+0:?   Linker Objects
+0:?     'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color})
+0:?     'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float)
+0:?     'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:?     'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color})
+0:?     'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize})
+0:?     'ov4' (layout( stream=4) out mediump 4-component vector of float)
+0:?     'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a})
+0:?     'badv4' (layout( stream=0) out mediump 4-component vector of float)
+0:?     'bad2v4' ( in 4-element array of mediump 4-component vector of float)
+0:?     'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a})
+0:?     'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c})
+0:?     'insn' ( in 4-element array of block{ in highp int a15})
+0:?     'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15})
+0:?     'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15})
+0:?     'summ' ( const highp int)
+0:?       2752 (const int)
+0:?     'explArray' ( in 4-element array of mediump 4-component vector of float)
+0:?     'explArrayBad' ( in 5-element array of mediump 4-component vector of float)
+0:?     'nonArrayed' ( in mediump 4-component vector of float)
+0:?     'myColor1' (layout( stream=0) flat out mediump 3-component vector of float)
+0:?     'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float)
+0:?     'centr' ( centroid in 4-element array of mediump 3-component vector of float)
+0:?     'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float)
+0:?     'comp' (layout( location=7 component=2) in 4-element array of mediump float)
+
diff --git a/Test/baseResults/320.tesc.out b/Test/baseResults/320.tesc.out
new file mode 100755
index 0000000..ff8012b
--- /dev/null
+++ b/Test/baseResults/320.tesc.out
@@ -0,0 +1,516 @@
+320.tesc
+ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) 
+ERROR: 0:7: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) 
+ERROR: 0:8: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) 
+ERROR: 0:10: 'patch' : can only use on output in tessellation-control shader 
+ERROR: 0:24: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:25: 'gl_ClipDistance' : no such field in structure 
+ERROR: 0:25: 'expression' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:32: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:33: 'gl_ClipDistance' : no such field in structure 
+ERROR: 0:33: 'expression' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:33: 'assign' :  l-value required (can't modify a const)
+ERROR: 0:39: '' : tessellation control barrier() cannot be placed within flow control 
+ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control 
+ERROR: 0:46: '' : tessellation control barrier() cannot be placed within flow control 
+ERROR: 0:51: '' : tessellation control barrier() cannot be placed within flow control 
+ERROR: 0:54: '' : tessellation control barrier() cannot be placed within flow control 
+ERROR: 0:61: '' : tessellation control barrier() cannot be placed after a return from main() 
+ERROR: 0:64: 'vertices' : can only apply to 'out' 
+ERROR: 0:65: 'vertices' : cannot change previously set layout value 
+ERROR: 0:69: '[' :  array index out of range '4'
+ERROR: 0:71: '' : tessellation control barrier() must be in main() 
+ERROR: 0:74: 'in' : type must be an array: ina
+ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized 
+ERROR: 0:78: '' : array size required 
+ERROR: 0:84: 'location' : overlapping use of location 4
+ERROR: 0:88: 'location' : overlapping use of location 4
+ERROR: 0:98: 'vertices' : can only apply to a standalone qualifier 
+ERROR: 0:99: 'vertices' : inconsistent output number of vertices for array size of misSized
+ERROR: 0:104: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:105: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:123: '[' :  array index out of range '2'
+ERROR: 0:126: '' : array size required 
+ERROR: 0:142: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:143: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:146: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 35 compilation errors.  No code generated.
+
+
+Shader version: 320
+Requested GL_ARB_separate_shader_objects
+vertices = 4
+ERROR: node is still EOpNull!
+0:13  Function Definition: main( ( global void)
+0:13    Function Parameters: 
+0:15    Sequence
+0:15      Barrier ( global void)
+0:17      Sequence
+0:17        move second child to first child ( temp highp int)
+0:17          'a' ( temp highp int)
+0:17          Constant:
+0:17            5392 (const int)
+0:23      Sequence
+0:23        move second child to first child ( temp highp 4-component vector of float)
+0:23          'p' ( temp highp 4-component vector of float)
+0:23          gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:23            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:23              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:23              Constant:
+0:23                1 (const int)
+0:23            Constant:
+0:23              0 (const int)
+0:24      Sequence
+0:24        move second child to first child ( temp highp float)
+0:24          'ps' ( temp highp float)
+0:24          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:24            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:24              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:24              Constant:
+0:24                1 (const int)
+0:24            Constant:
+0:24              1 (const int)
+0:25      Sequence
+0:25        move second child to first child ( temp highp float)
+0:25          'cd' ( temp highp float)
+0:25          Constant:
+0:25            0.000000
+0:27      Sequence
+0:27        move second child to first child ( temp highp int)
+0:27          'pvi' ( temp highp int)
+0:27          'gl_PatchVerticesIn' ( in highp int PatchVertices)
+0:28      Sequence
+0:28        move second child to first child ( temp highp int)
+0:28          'pid' ( temp highp int)
+0:28          'gl_PrimitiveID' ( in highp int PrimitiveID)
+0:29      Sequence
+0:29        move second child to first child ( temp highp int)
+0:29          'iid' ( temp highp int)
+0:29          'gl_InvocationID' ( in highp int InvocationID)
+0:31      move second child to first child ( temp highp 4-component vector of float)
+0:31        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:31          indirect index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:31            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:31            'gl_InvocationID' ( in highp int InvocationID)
+0:31          Constant:
+0:31            0 (const int)
+0:31        'p' ( temp highp 4-component vector of float)
+0:32      move second child to first child ( temp highp float)
+0:32        gl_PointSize: direct index for structure ( out highp float PointSize)
+0:32          indirect index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:32            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:32            'gl_InvocationID' ( in highp int InvocationID)
+0:32          Constant:
+0:32            1 (const int)
+0:32        'ps' ( temp highp float)
+0:33      move second child to first child ( temp highp float)
+0:33        Constant:
+0:33          0.000000
+0:33        'cd' ( temp highp float)
+0:35      move second child to first child ( temp highp float)
+0:35        direct index ( patch temp highp float TessLevelOuter)
+0:35          'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter)
+0:35          Constant:
+0:35            3 (const int)
+0:35        Constant:
+0:35          3.200000
+0:36      move second child to first child ( temp highp float)
+0:36        direct index ( patch temp highp float TessLevelInner)
+0:36          'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner)
+0:36          Constant:
+0:36            1 (const int)
+0:36        Constant:
+0:36          1.300000
+0:38      Test condition and select ( temp void)
+0:38        Condition
+0:38        Compare Greater Than ( temp bool)
+0:38          'a' ( temp highp int)
+0:38          Constant:
+0:38            10 (const int)
+0:38        true case
+0:39        Barrier ( global void)
+0:38        false case
+0:41        Barrier ( global void)
+0:43      Barrier ( global void)
+0:47      Loop with condition not tested first
+0:47        Loop Condition
+0:47        Compare Greater Than ( temp bool)
+0:47          'a' ( temp highp int)
+0:47          Constant:
+0:47            10 (const int)
+0:47        Loop Body
+0:46        Sequence
+0:46          Barrier ( global void)
+0:49      switch
+0:49      condition
+0:49        'a' ( temp highp int)
+0:49      body
+0:49        Sequence
+0:50          default: 
+0:?           Sequence
+0:51            Barrier ( global void)
+0:52            Branch: Break
+0:54      Test condition and select ( temp highp int)
+0:54        Condition
+0:54        Compare Less Than ( temp bool)
+0:54          'a' ( temp highp int)
+0:54          Constant:
+0:54            12 (const int)
+0:54        true case
+0:54        'a' ( temp highp int)
+0:54        false case
+0:54        Comma ( temp highp int)
+0:54          Barrier ( global void)
+0:54          'a' ( temp highp int)
+0:56      Sequence
+0:56        Barrier ( global void)
+0:59      Branch: Return
+0:61      Barrier ( global void)
+0:67  Function Definition: foo( ( global void)
+0:67    Function Parameters: 
+0:69    Sequence
+0:69      gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:69        direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:69          'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:69          Constant:
+0:69            4 (const int)
+0:69        Constant:
+0:69          0 (const int)
+0:71      Barrier ( global void)
+0:102  Function Definition: pointSize2( ( global void)
+0:102    Function Parameters: 
+0:104    Sequence
+0:104      Sequence
+0:104        move second child to first child ( temp highp float)
+0:104          'ps' ( temp highp float)
+0:104          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:104            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:104              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:104              Constant:
+0:104                1 (const int)
+0:104            Constant:
+0:104              1 (const int)
+0:105      move second child to first child ( temp highp float)
+0:105        gl_PointSize: direct index for structure ( out highp float PointSize)
+0:105          indirect index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:105            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:105            'gl_InvocationID' ( in highp int InvocationID)
+0:105          Constant:
+0:105            1 (const int)
+0:105        'ps' ( temp highp float)
+0:110  Function Definition: goodfoop( ( global void)
+0:110    Function Parameters: 
+0:?     Sequence
+0:114      multiply second child into first child ( temp highp 3-component vector of float)
+0:114        'pv3' ( noContraction temp highp 3-component vector of float)
+0:114        'pv3' ( noContraction temp highp 3-component vector of float)
+0:115      move second child to first child ( temp highp 3-component vector of float)
+0:115        'pv3' ( noContraction temp highp 3-component vector of float)
+0:115        fma ( global highp 3-component vector of float)
+0:115          'pv3' ( noContraction temp highp 3-component vector of float)
+0:115          'pv3' ( noContraction temp highp 3-component vector of float)
+0:115          'pv3' ( noContraction temp highp 3-component vector of float)
+0:116      move second child to first child ( temp highp float)
+0:116        'd' ( noContraction temp highp float)
+0:116        fma ( global highp float)
+0:116          'd' ( noContraction temp highp float)
+0:116          'd' ( noContraction temp highp float)
+0:116          'd' ( noContraction temp highp float)
+0:119  Function Definition: bb( ( global void)
+0:119    Function Parameters: 
+0:121    Sequence
+0:121      move second child to first child ( temp highp 4-component vector of float)
+0:121        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:121          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:121          Constant:
+0:121            0 (const int)
+0:121        Constant:
+0:121          0.000000
+0:121          0.000000
+0:121          0.000000
+0:121          0.000000
+0:122      move second child to first child ( temp highp 4-component vector of float)
+0:122        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:122          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:122          Constant:
+0:122            1 (const int)
+0:122        Constant:
+0:122          1.000000
+0:122          1.000000
+0:122          1.000000
+0:122          1.000000
+0:123      move second child to first child ( temp highp 4-component vector of float)
+0:123        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:123          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:123          Constant:
+0:123            2 (const int)
+0:123        Constant:
+0:123          2.000000
+0:123          2.000000
+0:123          2.000000
+0:123          2.000000
+0:134  Function Definition: outputtingOutparam(i1; ( global void)
+0:134    Function Parameters: 
+0:134      'a' ( out highp int)
+0:136    Sequence
+0:136      move second child to first child ( temp highp int)
+0:136        'a' ( out highp int)
+0:136        Constant:
+0:136          2 (const int)
+0:139  Function Definition: outputting( ( global void)
+0:139    Function Parameters: 
+0:141    Sequence
+0:141      move second child to first child ( temp highp int)
+0:141        indirect index ( temp highp int)
+0:141          'outa' ( out 4-element array of highp int)
+0:141          'gl_InvocationID' ( in highp int InvocationID)
+0:141        Constant:
+0:141          2 (const int)
+0:142      move second child to first child ( temp highp int)
+0:142        direct index ( temp highp int)
+0:142          'outa' ( out 4-element array of highp int)
+0:142          Constant:
+0:142            1 (const int)
+0:142        Constant:
+0:142          2 (const int)
+0:143      move second child to first child ( temp highp 4-component vector of float)
+0:143        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:143          direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:143            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:143            Constant:
+0:143              0 (const int)
+0:143          Constant:
+0:143            0 (const int)
+0:143        Constant:
+0:143          1.000000
+0:143          1.000000
+0:143          1.000000
+0:143          1.000000
+0:144      direct index ( temp highp int)
+0:144        'outa' ( out 4-element array of highp int)
+0:144        Constant:
+0:144          1 (const int)
+0:145      direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:145        'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:145        Constant:
+0:145          0 (const int)
+0:146      Function Call: outputtingOutparam(i1; ( global void)
+0:146        direct index ( temp highp int)
+0:146          'outa' ( out 4-element array of highp int)
+0:146          Constant:
+0:146            0 (const int)
+0:147      Function Call: outputtingOutparam(i1; ( global void)
+0:147        indirect index ( temp highp int)
+0:147          'outa' ( out 4-element array of highp int)
+0:147          'gl_InvocationID' ( in highp int InvocationID)
+0:148      move second child to first child ( temp highp float)
+0:148        f: direct index for structure ( out highp float)
+0:148          direct index ( patch temp block{ out highp float f})
+0:148            'patchIName' ( patch out 4-element array of block{ out highp float f})
+0:148            Constant:
+0:148              1 (const int)
+0:148          Constant:
+0:148            0 (const int)
+0:148        Constant:
+0:148          3.140000
+0:149      move second child to first child ( temp highp int)
+0:149        indirect index ( temp highp int)
+0:149          'outa' ( out 4-element array of highp int)
+0:149          'gl_InvocationID' ( in highp int InvocationID)
+0:149        Constant:
+0:149          2 (const int)
+0:?   Linker Objects
+0:?     'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:?     'outa' ( out 4-element array of highp int)
+0:?     'patchIn' ( patch in highp 4-component vector of float)
+0:?     'patchOut' ( patch out highp 4-component vector of float)
+0:?     'ina' ( in highp 2-component vector of float)
+0:?     'inb' ( in 32-element array of highp 2-component vector of float)
+0:?     'inc' ( in 32-element array of highp 2-component vector of float)
+0:?     'ind' ( in 32-element array of highp 2-component vector of float)
+0:?     'implA' ( patch out implicitly-sized array of highp float)
+0:?     'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float)
+0:?     'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float)
+0:?     'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float)
+0:?     'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float)
+0:?     'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float)
+0:?     'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float)
+0:?     'pinbi' ( patch out block{ out highp int a})
+0:?     'myColor2' ( centroid out 4-element array of highp 3-component vector of float)
+0:?     'centr' ( centroid in 32-element array of highp 3-component vector of float)
+0:?     'perSampleColor' ( sample out 4-element array of highp 4-component vector of float)
+0:?     'badlay' ( out 4-element array of highp float)
+0:?     'misSized' ( out 5-element array of highp float)
+0:?     'okaySize' ( out 4-element array of highp float)
+0:?     'pv3' ( noContraction temp highp 3-component vector of float)
+0:?     'badpatchIName' ( patch out implicitly-sized array of block{ out highp float f})
+0:?     'patchIName' ( patch out 4-element array of block{ out highp float f})
+
+
+Linked tessellation control stage:
+
+
+Shader version: 320
+Requested GL_ARB_separate_shader_objects
+vertices = 4
+ERROR: node is still EOpNull!
+0:13  Function Definition: main( ( global void)
+0:13    Function Parameters: 
+0:15    Sequence
+0:15      Barrier ( global void)
+0:17      Sequence
+0:17        move second child to first child ( temp highp int)
+0:17          'a' ( temp highp int)
+0:17          Constant:
+0:17            5392 (const int)
+0:23      Sequence
+0:23        move second child to first child ( temp highp 4-component vector of float)
+0:23          'p' ( temp highp 4-component vector of float)
+0:23          gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:23            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:23              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:23              Constant:
+0:23                1 (const int)
+0:23            Constant:
+0:23              0 (const int)
+0:24      Sequence
+0:24        move second child to first child ( temp highp float)
+0:24          'ps' ( temp highp float)
+0:24          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:24            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:24              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:24              Constant:
+0:24                1 (const int)
+0:24            Constant:
+0:24              1 (const int)
+0:25      Sequence
+0:25        move second child to first child ( temp highp float)
+0:25          'cd' ( temp highp float)
+0:25          Constant:
+0:25            0.000000
+0:27      Sequence
+0:27        move second child to first child ( temp highp int)
+0:27          'pvi' ( temp highp int)
+0:27          'gl_PatchVerticesIn' ( in highp int PatchVertices)
+0:28      Sequence
+0:28        move second child to first child ( temp highp int)
+0:28          'pid' ( temp highp int)
+0:28          'gl_PrimitiveID' ( in highp int PrimitiveID)
+0:29      Sequence
+0:29        move second child to first child ( temp highp int)
+0:29          'iid' ( temp highp int)
+0:29          'gl_InvocationID' ( in highp int InvocationID)
+0:31      move second child to first child ( temp highp 4-component vector of float)
+0:31        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:31          indirect index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:31            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:31            'gl_InvocationID' ( in highp int InvocationID)
+0:31          Constant:
+0:31            0 (const int)
+0:31        'p' ( temp highp 4-component vector of float)
+0:32      move second child to first child ( temp highp float)
+0:32        gl_PointSize: direct index for structure ( out highp float PointSize)
+0:32          indirect index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:32            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:32            'gl_InvocationID' ( in highp int InvocationID)
+0:32          Constant:
+0:32            1 (const int)
+0:32        'ps' ( temp highp float)
+0:33      move second child to first child ( temp highp float)
+0:33        Constant:
+0:33          0.000000
+0:33        'cd' ( temp highp float)
+0:35      move second child to first child ( temp highp float)
+0:35        direct index ( patch temp highp float TessLevelOuter)
+0:35          'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter)
+0:35          Constant:
+0:35            3 (const int)
+0:35        Constant:
+0:35          3.200000
+0:36      move second child to first child ( temp highp float)
+0:36        direct index ( patch temp highp float TessLevelInner)
+0:36          'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner)
+0:36          Constant:
+0:36            1 (const int)
+0:36        Constant:
+0:36          1.300000
+0:38      Test condition and select ( temp void)
+0:38        Condition
+0:38        Compare Greater Than ( temp bool)
+0:38          'a' ( temp highp int)
+0:38          Constant:
+0:38            10 (const int)
+0:38        true case
+0:39        Barrier ( global void)
+0:38        false case
+0:41        Barrier ( global void)
+0:43      Barrier ( global void)
+0:47      Loop with condition not tested first
+0:47        Loop Condition
+0:47        Compare Greater Than ( temp bool)
+0:47          'a' ( temp highp int)
+0:47          Constant:
+0:47            10 (const int)
+0:47        Loop Body
+0:46        Sequence
+0:46          Barrier ( global void)
+0:49      switch
+0:49      condition
+0:49        'a' ( temp highp int)
+0:49      body
+0:49        Sequence
+0:50          default: 
+0:?           Sequence
+0:51            Barrier ( global void)
+0:52            Branch: Break
+0:54      Test condition and select ( temp highp int)
+0:54        Condition
+0:54        Compare Less Than ( temp bool)
+0:54          'a' ( temp highp int)
+0:54          Constant:
+0:54            12 (const int)
+0:54        true case
+0:54        'a' ( temp highp int)
+0:54        false case
+0:54        Comma ( temp highp int)
+0:54          Barrier ( global void)
+0:54          'a' ( temp highp int)
+0:56      Sequence
+0:56        Barrier ( global void)
+0:59      Branch: Return
+0:61      Barrier ( global void)
+0:?   Linker Objects
+0:?     'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:?     'outa' ( out 4-element array of highp int)
+0:?     'patchIn' ( patch in highp 4-component vector of float)
+0:?     'patchOut' ( patch out highp 4-component vector of float)
+0:?     'ina' ( in highp 2-component vector of float)
+0:?     'inb' ( in 32-element array of highp 2-component vector of float)
+0:?     'inc' ( in 32-element array of highp 2-component vector of float)
+0:?     'ind' ( in 32-element array of highp 2-component vector of float)
+0:?     'implA' ( patch out 1-element array of highp float)
+0:?     'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float)
+0:?     'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float)
+0:?     'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float)
+0:?     'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float)
+0:?     'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float)
+0:?     'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float)
+0:?     'pinbi' ( patch out block{ out highp int a})
+0:?     'myColor2' ( centroid out 4-element array of highp 3-component vector of float)
+0:?     'centr' ( centroid in 32-element array of highp 3-component vector of float)
+0:?     'perSampleColor' ( sample out 4-element array of highp 4-component vector of float)
+0:?     'badlay' ( out 4-element array of highp float)
+0:?     'misSized' ( out 5-element array of highp float)
+0:?     'okaySize' ( out 4-element array of highp float)
+0:?     'pv3' ( noContraction temp highp 3-component vector of float)
+0:?     'badpatchIName' ( patch out 1-element array of block{ out highp float f})
+0:?     'patchIName' ( patch out 4-element array of block{ out highp float f})
+
diff --git a/Test/baseResults/320.tese.out b/Test/baseResults/320.tese.out
new file mode 100755
index 0000000..ad8fe72
--- /dev/null
+++ b/Test/baseResults/320.tese.out
@@ -0,0 +1,276 @@
+320.tese
+ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value 
+ERROR: 0:5: 'triangles' : cannot change previously set input primitive 
+ERROR: 0:6: 'isolines' : cannot change previously set input primitive 
+ERROR: 0:8: 'ccw' : cannot change previously set vertex order 
+ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing 
+ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing 
+ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader 
+ERROR: 0:22: 'barrier' : no matching overloaded function found 
+ERROR: 0:33: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:34: 'gl_ClipDistance' : no such field in structure 
+ERROR: 0:34: 'expression' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:43: 'gl_PointSize' : required extension not requested: Possible extensions include:
+GL_EXT_tessellation_point_size
+GL_OES_tessellation_point_size
+ERROR: 0:44: 'gl_ClipDistance' : undeclared identifier 
+ERROR: 0:44: 'gl_ClipDistance' :  left of '[' is not of type array, matrix, or vector  
+ERROR: 0:44: 'assign' :  l-value required (can't modify a const)
+ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch 
+ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch 
+ERROR: 0:49: 'noperspective' : Reserved word. 
+ERROR: 0:49: 'noperspective' : not supported with this profile: es
+ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch 
+ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) 
+ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized 
+ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use 
+ERROR: 0:64: 'quads' : cannot apply to 'out' 
+ERROR: 0:64: 'cw' : can only apply to 'in' 
+ERROR: 0:65: 'triangles' : cannot apply to 'out' 
+ERROR: 0:66: 'isolines' : cannot apply to 'out' 
+ERROR: 0:67: 'cw' : can only apply to 'in' 
+ERROR: 0:68: 'fractional_odd_spacing' : can only apply to 'in' 
+ERROR: 0:69: 'equal_spacing' : can only apply to 'in' 
+ERROR: 0:70: 'fractional_even_spacing' : can only apply to 'in' 
+ERROR: 0:71: 'point_mode' : can only apply to 'in' 
+ERROR: 0:73: 'in' : type must be an array: ina
+ERROR: 0:75: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized 
+ERROR: 0:78: 'in' : type must be an array: bla
+ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized 
+ERROR: 0:96: 'location' : overlapping use of location 24
+ERROR: 0:99: 'location' : overlapping use of location 24
+ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved 
+ERROR: 0:113: 'gl_BoundingBoxOES' : undeclared identifier 
+ERROR: 40 compilation errors.  No code generated.
+
+
+Shader version: 320
+Requested GL_ARB_separate_shader_objects
+input primitive = quads
+vertex spacing = fractional_odd_spacing
+triangle order = cw
+using point mode
+ERROR: node is still EOpNull!
+0:20  Function Definition: main( ( global void)
+0:20    Function Parameters: 
+0:22    Sequence
+0:22      Constant:
+0:22        0.000000
+0:24      Sequence
+0:24        move second child to first child ( temp highp int)
+0:24          'a' ( temp highp int)
+0:24          Constant:
+0:24            1512 (const int)
+0:32      Sequence
+0:32        move second child to first child ( temp highp 4-component vector of float)
+0:32          'p' ( temp highp 4-component vector of float)
+0:32          gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:32            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:32              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:32              Constant:
+0:32                1 (const int)
+0:32            Constant:
+0:32              0 (const int)
+0:33      Sequence
+0:33        move second child to first child ( temp highp float)
+0:33          'ps' ( temp highp float)
+0:33          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:33            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:33              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in implicitly-sized array of highp 4-component vector of float gl_PositionPerViewNV})
+0:33              Constant:
+0:33                1 (const int)
+0:33            Constant:
+0:33              1 (const int)
+0:34      Sequence
+0:34        move second child to first child ( temp highp float)
+0:34          'cd' ( temp highp float)
+0:34          Constant:
+0:34            0.000000
+0:36      Sequence
+0:36        move second child to first child ( temp highp int)
+0:36          'pvi' ( temp highp int)
+0:36          'gl_PatchVerticesIn' ( in highp int PatchVertices)
+0:37      Sequence
+0:37        move second child to first child ( temp highp int)
+0:37          'pid' ( temp highp int)
+0:37          'gl_PrimitiveID' ( in highp int PrimitiveID)
+0:38      Sequence
+0:38        move second child to first child ( temp highp 3-component vector of float)
+0:38          'tc' ( temp highp 3-component vector of float)
+0:38          'gl_TessCoord' ( in highp 3-component vector of float TessCoord)
+0:39      Sequence
+0:39        move second child to first child ( temp highp float)
+0:39          'tlo' ( temp highp float)
+0:39          direct index ( patch temp highp float TessLevelOuter)
+0:39            'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter)
+0:39            Constant:
+0:39              3 (const int)
+0:40      Sequence
+0:40        move second child to first child ( temp highp float)
+0:40          'tli' ( temp highp float)
+0:40          direct index ( patch temp highp float TessLevelInner)
+0:40            'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner)
+0:40            Constant:
+0:40              1 (const int)
+0:42      move second child to first child ( temp highp 4-component vector of float)
+0:42        gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
+0:42          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position,  gl_PointSize highp float PointSize gl_PointSize})
+0:42          Constant:
+0:42            0 (const uint)
+0:42        'p' ( temp highp 4-component vector of float)
+0:43      move second child to first child ( temp highp float)
+0:43        gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize)
+0:43          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position,  gl_PointSize highp float PointSize gl_PointSize})
+0:43          Constant:
+0:43            1 (const uint)
+0:43        'ps' ( temp highp float)
+0:44      move second child to first child ( temp highp float)
+0:44        Constant:
+0:44          0.000000
+0:44        'cd' ( temp highp float)
+0:111  Function Definition: bbbad( ( global void)
+0:111    Function Parameters: 
+0:113    Sequence
+0:113      'gl_BoundingBoxOES' ( temp float)
+0:?   Linker Objects
+0:?     'patchIn' ( patch in highp 4-component vector of float)
+0:?     'patchOut' ( patch out highp 4-component vector of float)
+0:?     'badp1' ( smooth patch in highp 4-component vector of float)
+0:?     'badp2' ( flat patch in highp 4-component vector of float)
+0:?     'badp3' ( noperspective patch in highp 4-component vector of float)
+0:?     'badp4' ( patch sample in highp 3-component vector of float)
+0:?     'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position})
+0:?     'ina' ( in highp 2-component vector of float)
+0:?     'inb' ( in 32-element array of highp 2-component vector of float)
+0:?     'inc' ( in 32-element array of highp 2-component vector of float)
+0:?     'ind' ( in 32-element array of highp 2-component vector of float)
+0:?     'bla' ( in block{ in highp int f})
+0:?     'blb' ( in 32-element array of block{ in highp int f})
+0:?     'blc' ( in 32-element array of block{ in highp int f})
+0:?     'bld' ( in 32-element array of block{ in highp int f})
+0:?     'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float)
+0:?     'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float)
+0:?     'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float)
+0:?     'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float)
+0:?     'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float)
+0:?     'pinbi' ( patch in block{ in highp int a})
+0:?     'myColor2' ( centroid out highp 3-component vector of float)
+0:?     'centr' ( centroid in 32-element array of highp 3-component vector of float)
+0:?     'perSampleColor' ( sample out highp 4-component vector of float)
+
+
+Linked tessellation evaluation stage:
+
+
+Shader version: 320
+Requested GL_ARB_separate_shader_objects
+input primitive = quads
+vertex spacing = fractional_odd_spacing
+triangle order = cw
+using point mode
+ERROR: node is still EOpNull!
+0:20  Function Definition: main( ( global void)
+0:20    Function Parameters: 
+0:22    Sequence
+0:22      Constant:
+0:22        0.000000
+0:24      Sequence
+0:24        move second child to first child ( temp highp int)
+0:24          'a' ( temp highp int)
+0:24          Constant:
+0:24            1512 (const int)
+0:32      Sequence
+0:32        move second child to first child ( temp highp 4-component vector of float)
+0:32          'p' ( temp highp 4-component vector of float)
+0:32          gl_Position: direct index for structure ( in highp 4-component vector of float Position)
+0:32            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:32              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:32              Constant:
+0:32                1 (const int)
+0:32            Constant:
+0:32              0 (const int)
+0:33      Sequence
+0:33        move second child to first child ( temp highp float)
+0:33          'ps' ( temp highp float)
+0:33          gl_PointSize: direct index for structure ( in highp float PointSize)
+0:33            direct index ( temp block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:33              'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position,  in highp float PointSize gl_PointSize,  in highp 4-component vector of float gl_SecondaryPositionNV,  in 1-element array of highp 4-component vector of float gl_PositionPerViewNV})
+0:33              Constant:
+0:33                1 (const int)
+0:33            Constant:
+0:33              1 (const int)
+0:34      Sequence
+0:34        move second child to first child ( temp highp float)
+0:34          'cd' ( temp highp float)
+0:34          Constant:
+0:34            0.000000
+0:36      Sequence
+0:36        move second child to first child ( temp highp int)
+0:36          'pvi' ( temp highp int)
+0:36          'gl_PatchVerticesIn' ( in highp int PatchVertices)
+0:37      Sequence
+0:37        move second child to first child ( temp highp int)
+0:37          'pid' ( temp highp int)
+0:37          'gl_PrimitiveID' ( in highp int PrimitiveID)
+0:38      Sequence
+0:38        move second child to first child ( temp highp 3-component vector of float)
+0:38          'tc' ( temp highp 3-component vector of float)
+0:38          'gl_TessCoord' ( in highp 3-component vector of float TessCoord)
+0:39      Sequence
+0:39        move second child to first child ( temp highp float)
+0:39          'tlo' ( temp highp float)
+0:39          direct index ( patch temp highp float TessLevelOuter)
+0:39            'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter)
+0:39            Constant:
+0:39              3 (const int)
+0:40      Sequence
+0:40        move second child to first child ( temp highp float)
+0:40          'tli' ( temp highp float)
+0:40          direct index ( patch temp highp float TessLevelInner)
+0:40            'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner)
+0:40            Constant:
+0:40              1 (const int)
+0:42      move second child to first child ( temp highp 4-component vector of float)
+0:42        gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
+0:42          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position,  gl_PointSize highp float PointSize gl_PointSize})
+0:42          Constant:
+0:42            0 (const uint)
+0:42        'p' ( temp highp 4-component vector of float)
+0:43      move second child to first child ( temp highp float)
+0:43        gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize)
+0:43          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position,  gl_PointSize highp float PointSize gl_PointSize})
+0:43          Constant:
+0:43            1 (const uint)
+0:43        'ps' ( temp highp float)
+0:44      move second child to first child ( temp highp float)
+0:44        Constant:
+0:44          0.000000
+0:44        'cd' ( temp highp float)
+0:?   Linker Objects
+0:?     'patchIn' ( patch in highp 4-component vector of float)
+0:?     'patchOut' ( patch out highp 4-component vector of float)
+0:?     'badp1' ( smooth patch in highp 4-component vector of float)
+0:?     'badp2' ( flat patch in highp 4-component vector of float)
+0:?     'badp3' ( noperspective patch in highp 4-component vector of float)
+0:?     'badp4' ( patch sample in highp 3-component vector of float)
+0:?     'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position})
+0:?     'ina' ( in highp 2-component vector of float)
+0:?     'inb' ( in 32-element array of highp 2-component vector of float)
+0:?     'inc' ( in 32-element array of highp 2-component vector of float)
+0:?     'ind' ( in 32-element array of highp 2-component vector of float)
+0:?     'bla' ( in block{ in highp int f})
+0:?     'blb' ( in 32-element array of block{ in highp int f})
+0:?     'blc' ( in 32-element array of block{ in highp int f})
+0:?     'bld' ( in 32-element array of block{ in highp int f})
+0:?     'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float)
+0:?     'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float)
+0:?     'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float)
+0:?     'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float)
+0:?     'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float)
+0:?     'pinbi' ( patch in block{ in highp int a})
+0:?     'myColor2' ( centroid out highp 3-component vector of float)
+0:?     'centr' ( centroid in 32-element array of highp 3-component vector of float)
+0:?     'perSampleColor' ( sample out highp 4-component vector of float)
+
diff --git a/Test/baseResults/320.vert.out b/Test/baseResults/320.vert.out
new file mode 100755
index 0000000..2838ab8
--- /dev/null
+++ b/Test/baseResults/320.vert.out
@@ -0,0 +1,797 @@
+320.vert
+ERROR: 0:6: 's' : member of block cannot be or contain a sampler, image, or atomic_uint type 
+ERROR: 0:14: 'location' : overlapping use of location 12
+ERROR: 0:16: 'input block' : not supported in this stage: vertex
+ERROR: 0:18: 'gl_PerVertex' : block redeclaration has extra members 
+ERROR: 0:28: 'gl_PointSize' : member of nameless block was not redeclared 
+ERROR: 0:28: 'assign' :  cannot convert from ' const float' to ' gl_PointSize highp void PointSize'
+ERROR: 0:31: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use 
+ERROR: 0:36: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block 
+ERROR: 0:40: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block 
+ERROR: 0:44: 'centroid' : cannot use centroid qualifier on an interface block 
+ERROR: 0:48: 'invariant' : cannot use invariant qualifier on an interface block 
+ERROR: 0:68: 'variable indexing buffer block array' : not supported with this profile: es
+ERROR: 0:73: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument
+ERROR: 0:76: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:77: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:78: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:79: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:80: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:81: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:116: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:117: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:118: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:120: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:121: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:122: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:123: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:191: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:192: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:193: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:211: 'textureSize' : no matching overloaded function found 
+ERROR: 0:211: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of int'
+ERROR: 0:252: 'interpolateAtCentroid' : no matching overloaded function found 
+ERROR: 0:253: 'interpolateAtSample' : no matching overloaded function found 
+ERROR: 0:254: 'interpolateAtOffset' : no matching overloaded function found 
+ERROR: 34 compilation errors.  No code generated.
+
+
+Shader version: 320
+ERROR: node is still EOpNull!
+0:23  Function Definition: main( ( global void)
+0:23    Function Parameters: 
+0:25    Sequence
+0:25      Sequence
+0:25        move second child to first child ( temp highp int)
+0:25          'sum' ( temp highp int)
+0:25          add ( temp highp int)
+0:25            'gl_VertexID' ( gl_VertexId highp int VertexId)
+0:26            'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
+0:27      move second child to first child ( temp highp 4-component vector of float)
+0:27        gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
+0:27          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:27          Constant:
+0:27            0 (const uint)
+0:27        Constant:
+0:27          1.000000
+0:27          1.000000
+0:27          1.000000
+0:27          1.000000
+0:28      gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize)
+0:28        'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:28        Constant:
+0:28          1 (const uint)
+0:62  Function Definition: pfoo( ( global void)
+0:62    Function Parameters: 
+0:?     Sequence
+0:65      move second child to first child ( temp highp 2-component vector of float)
+0:65        'h' ( noContraction temp highp 2-component vector of float)
+0:65        fma ( global highp 2-component vector of float)
+0:65          'inf' ( in highp 2-component vector of float)
+0:65          'ing' ( in highp 2-component vector of float)
+0:65          'h' ( noContraction temp highp 2-component vector of float)
+0:66      indirect index ( temp lowp sampler2D)
+0:66        'sArray' ( uniform 4-element array of lowp sampler2D)
+0:66        add ( temp highp int)
+0:66          'sIndex' ( uniform highp int)
+0:66          Constant:
+0:66            1 (const int)
+0:67      indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform highp int i})
+0:67        'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i})
+0:67        add ( temp highp int)
+0:67          'sIndex' ( uniform highp int)
+0:67          Constant:
+0:67            1 (const int)
+0:68      indirect index (layout( column_major shared) temp block{layout( column_major shared) buffer highp int i})
+0:68        'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i})
+0:68        subtract ( temp highp int)
+0:68          'sIndex' ( uniform highp int)
+0:68          Constant:
+0:68            2 (const int)
+0:69      direct index ( writeonly temp highp image2D)
+0:69        'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:69        Constant:
+0:69          2 (const int)
+0:70      indirect index ( writeonly temp highp image2D)
+0:70        'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:70        subtract ( temp highp int)
+0:70          'sIndex' ( uniform highp int)
+0:70          Constant:
+0:70            2 (const int)
+0:71      textureGatherOffset ( global lowp 4-component vector of float)
+0:71        direct index ( temp lowp sampler2D)
+0:71          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:71          Constant:
+0:71            0 (const int)
+0:71        Constant:
+0:71          0.100000
+0:71          0.100000
+0:71        Convert float to int ( temp lowp 2-component vector of int)
+0:71          'inf' ( in highp 2-component vector of float)
+0:72      textureGatherOffsets ( global lowp 4-component vector of float, operation at highp)
+0:72        direct index ( temp lowp sampler2D)
+0:72          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:72          Constant:
+0:72            0 (const int)
+0:72        Constant:
+0:72          0.100000
+0:72          0.100000
+0:72        Constant:
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:72          0 (const int)
+0:73      textureGatherOffsets ( global lowp 4-component vector of float, operation at highp)
+0:73        direct index ( temp lowp sampler2D)
+0:73          'sArray' ( uniform 4-element array of lowp sampler2D)
+0:73          Constant:
+0:73            0 (const int)
+0:73        Constant:
+0:73          0.100000
+0:73          0.100000
+0:73        'offsets' ( uniform 4-element array of highp 2-component vector of int)
+0:101  Function Definition: bufferT( ( global void)
+0:101    Function Parameters: 
+0:103    Sequence
+0:103      Sequence
+0:103        move second child to first child ( temp highp int)
+0:103          's1' ( temp highp int)
+0:103          textureSize ( global highp int)
+0:103            'bufSamp1' ( uniform highp samplerBuffer)
+0:104      Sequence
+0:104        move second child to first child ( temp highp int)
+0:104          's2' ( temp highp int)
+0:104          textureSize ( global highp int)
+0:104            'bufSamp2' ( uniform highp isamplerBuffer)
+0:105      Sequence
+0:105        move second child to first child ( temp highp int)
+0:105          's3' ( temp highp int)
+0:105          textureSize ( global highp int)
+0:105            'bufSamp3' ( uniform highp usamplerBuffer)
+0:107      Sequence
+0:107        move second child to first child ( temp highp int)
+0:107          's4' ( temp highp int)
+0:107          imageQuerySize ( global highp int)
+0:107            'bufSamp4' ( writeonly uniform highp imageBuffer)
+0:108      Sequence
+0:108        move second child to first child ( temp highp int)
+0:108          's5' ( temp highp int)
+0:108          imageQuerySize ( global highp int)
+0:108            'bufSamp5' ( writeonly uniform highp iimageBuffer)
+0:109      Sequence
+0:109        move second child to first child ( temp highp int)
+0:109          's6' ( temp highp int)
+0:109          imageQuerySize ( global highp int)
+0:109            'bufSamp6' ( writeonly uniform highp uimageBuffer)
+0:111      Sequence
+0:111        move second child to first child ( temp highp 4-component vector of float)
+0:111          'f1' ( temp highp 4-component vector of float)
+0:111          textureFetch ( global highp 4-component vector of float)
+0:111            'bufSamp1' ( uniform highp samplerBuffer)
+0:111            's1' ( temp highp int)
+0:112      Sequence
+0:112        move second child to first child ( temp highp 4-component vector of int)
+0:112          'f2' ( temp highp 4-component vector of int)
+0:112          textureFetch ( global highp 4-component vector of int)
+0:112            'bufSamp2' ( uniform highp isamplerBuffer)
+0:112            's2' ( temp highp int)
+0:113      Sequence
+0:113        move second child to first child ( temp highp 4-component vector of uint)
+0:113          'f3' ( temp highp 4-component vector of uint)
+0:113          textureFetch ( global highp 4-component vector of uint)
+0:113            'bufSamp3' ( uniform highp usamplerBuffer)
+0:113            's3' ( temp highp int)
+0:149  Function Definition: CAT( ( global void)
+0:149    Function Parameters: 
+0:151    Sequence
+0:151      Sequence
+0:151        move second child to first child ( temp highp 3-component vector of int)
+0:151          's4' ( temp highp 3-component vector of int)
+0:151          textureSize ( global highp 3-component vector of int)
+0:151            'CA4' ( uniform highp samplerCubeArray)
+0:151            Constant:
+0:151              1 (const int)
+0:152      Sequence
+0:152        move second child to first child ( temp highp 3-component vector of int)
+0:152          's5' ( temp highp 3-component vector of int)
+0:152          textureSize ( global highp 3-component vector of int)
+0:152            'CA5' ( uniform highp samplerCubeArrayShadow)
+0:152            Constant:
+0:152              1 (const int)
+0:153      Sequence
+0:153        move second child to first child ( temp highp 3-component vector of int)
+0:153          's6' ( temp highp 3-component vector of int)
+0:153          textureSize ( global highp 3-component vector of int)
+0:153            'CA6' ( uniform highp isamplerCubeArray)
+0:153            Constant:
+0:153              1 (const int)
+0:154      Sequence
+0:154        move second child to first child ( temp highp 3-component vector of int)
+0:154          's7' ( temp highp 3-component vector of int)
+0:154          textureSize ( global highp 3-component vector of int)
+0:154            'CA7' ( uniform highp usamplerCubeArray)
+0:154            Constant:
+0:154              1 (const int)
+0:156      Sequence
+0:156        move second child to first child ( temp highp 4-component vector of float)
+0:156          't4' ( temp highp 4-component vector of float)
+0:156          texture ( global highp 4-component vector of float)
+0:156            'CA4' ( uniform highp samplerCubeArray)
+0:156            Constant:
+0:156              0.500000
+0:156              0.500000
+0:156              0.500000
+0:156              0.500000
+0:157      Sequence
+0:157        move second child to first child ( temp highp float)
+0:157          't5' ( temp highp float)
+0:157          texture ( global highp float)
+0:157            'CA5' ( uniform highp samplerCubeArrayShadow)
+0:157            Constant:
+0:157              0.500000
+0:157              0.500000
+0:157              0.500000
+0:157              0.500000
+0:157            Constant:
+0:157              3.000000
+0:158      Sequence
+0:158        move second child to first child ( temp highp 4-component vector of int)
+0:158          't6' ( temp highp 4-component vector of int)
+0:158          texture ( global highp 4-component vector of int)
+0:158            'CA6' ( uniform highp isamplerCubeArray)
+0:158            Constant:
+0:158              0.500000
+0:158              0.500000
+0:158              0.500000
+0:158              0.500000
+0:159      Sequence
+0:159        move second child to first child ( temp highp 4-component vector of uint)
+0:159          't7' ( temp highp 4-component vector of uint)
+0:159          texture ( global highp 4-component vector of uint)
+0:159            'CA7' ( uniform highp usamplerCubeArray)
+0:159            Constant:
+0:159              0.500000
+0:159              0.500000
+0:159              0.500000
+0:159              0.500000
+0:161      Sequence
+0:161        move second child to first child ( temp highp 4-component vector of float)
+0:161          'L4' ( temp highp 4-component vector of float)
+0:161          textureLod ( global highp 4-component vector of float)
+0:161            'CA4' ( uniform highp samplerCubeArray)
+0:161            Constant:
+0:161              0.500000
+0:161              0.500000
+0:161              0.500000
+0:161              0.500000
+0:161            Constant:
+0:161              0.240000
+0:162      Sequence
+0:162        move second child to first child ( temp highp 4-component vector of int)
+0:162          'L6' ( temp highp 4-component vector of int)
+0:162          textureLod ( global highp 4-component vector of int)
+0:162            'CA6' ( uniform highp isamplerCubeArray)
+0:162            Constant:
+0:162              0.500000
+0:162              0.500000
+0:162              0.500000
+0:162              0.500000
+0:162            Constant:
+0:162              0.260000
+0:163      Sequence
+0:163        move second child to first child ( temp highp 4-component vector of uint)
+0:163          'L7' ( temp highp 4-component vector of uint)
+0:163          textureLod ( global highp 4-component vector of uint)
+0:163            'CA7' ( uniform highp usamplerCubeArray)
+0:163            Constant:
+0:163              0.500000
+0:163              0.500000
+0:163              0.500000
+0:163              0.500000
+0:163            Constant:
+0:163              0.270000
+0:165      Sequence
+0:165        move second child to first child ( temp highp 4-component vector of float)
+0:165          'g4' ( temp highp 4-component vector of float)
+0:165          textureGrad ( global highp 4-component vector of float)
+0:165            'CA4' ( uniform highp samplerCubeArray)
+0:165            Constant:
+0:165              0.500000
+0:165              0.500000
+0:165              0.500000
+0:165              0.500000
+0:165            Constant:
+0:165              0.100000
+0:165              0.100000
+0:165              0.100000
+0:165            Constant:
+0:165              0.200000
+0:165              0.200000
+0:165              0.200000
+0:166      Sequence
+0:166        move second child to first child ( temp highp 4-component vector of int)
+0:166          'g6' ( temp highp 4-component vector of int)
+0:166          textureGrad ( global highp 4-component vector of int)
+0:166            'CA6' ( uniform highp isamplerCubeArray)
+0:166            Constant:
+0:166              0.500000
+0:166              0.500000
+0:166              0.500000
+0:166              0.500000
+0:166            Constant:
+0:166              0.100000
+0:166              0.100000
+0:166              0.100000
+0:166            Constant:
+0:166              0.200000
+0:166              0.200000
+0:166              0.200000
+0:167      Sequence
+0:167        move second child to first child ( temp highp 4-component vector of uint)
+0:167          'g7' ( temp highp 4-component vector of uint)
+0:167          textureGrad ( global highp 4-component vector of uint)
+0:167            'CA7' ( uniform highp usamplerCubeArray)
+0:167            Constant:
+0:167              0.500000
+0:167              0.500000
+0:167              0.500000
+0:167              0.500000
+0:167            Constant:
+0:167              0.100000
+0:167              0.100000
+0:167              0.100000
+0:167            Constant:
+0:167              0.200000
+0:167              0.200000
+0:167              0.200000
+0:169      Sequence
+0:169        move second child to first child ( temp highp 4-component vector of float)
+0:169          'gath4' ( temp highp 4-component vector of float)
+0:169          textureGather ( global highp 4-component vector of float)
+0:169            'CA4' ( uniform highp samplerCubeArray)
+0:169            Constant:
+0:169              0.500000
+0:169              0.500000
+0:169              0.500000
+0:169              0.500000
+0:170      Sequence
+0:170        move second child to first child ( temp highp 4-component vector of float)
+0:170          'gathC4' ( temp highp 4-component vector of float)
+0:170          textureGather ( global highp 4-component vector of float)
+0:170            'CA4' ( uniform highp samplerCubeArray)
+0:170            Constant:
+0:170              0.500000
+0:170              0.500000
+0:170              0.500000
+0:170              0.500000
+0:170            Constant:
+0:170              2 (const int)
+0:171      Sequence
+0:171        move second child to first child ( temp highp 4-component vector of int)
+0:171          'gath6' ( temp highp 4-component vector of int)
+0:171          textureGather ( global highp 4-component vector of int)
+0:171            'CA6' ( uniform highp isamplerCubeArray)
+0:171            Constant:
+0:171              0.500000
+0:171              0.500000
+0:171              0.500000
+0:171              0.500000
+0:172      Sequence
+0:172        move second child to first child ( temp highp 4-component vector of int)
+0:172          'gathC6' ( temp highp 4-component vector of int)
+0:172          textureGather ( global highp 4-component vector of int)
+0:172            'CA6' ( uniform highp isamplerCubeArray)
+0:172            Constant:
+0:172              0.500000
+0:172              0.500000
+0:172              0.500000
+0:172              0.500000
+0:172            Constant:
+0:172              1 (const int)
+0:173      Sequence
+0:173        move second child to first child ( temp highp 4-component vector of uint)
+0:173          'gath7' ( temp highp 4-component vector of uint)
+0:173          textureGather ( global highp 4-component vector of uint)
+0:173            'CA7' ( uniform highp usamplerCubeArray)
+0:173            Constant:
+0:173              0.500000
+0:173              0.500000
+0:173              0.500000
+0:173              0.500000
+0:174      Sequence
+0:174        move second child to first child ( temp highp 4-component vector of uint)
+0:174          'gathC7' ( temp highp 4-component vector of uint)
+0:174          textureGather ( global highp 4-component vector of uint)
+0:174            'CA7' ( uniform highp usamplerCubeArray)
+0:174            Constant:
+0:174              0.500000
+0:174              0.500000
+0:174              0.500000
+0:174              0.500000
+0:174            Constant:
+0:174              0 (const int)
+0:176      Sequence
+0:176        move second child to first child ( temp highp 4-component vector of float)
+0:176          'gath5' ( temp highp 4-component vector of float)
+0:176          textureGather ( global highp 4-component vector of float)
+0:176            'CA5' ( uniform highp samplerCubeArrayShadow)
+0:176            Constant:
+0:176              0.500000
+0:176              0.500000
+0:176              0.500000
+0:176              0.500000
+0:176            Constant:
+0:176              2.500000
+0:178      Sequence
+0:178        move second child to first child ( temp highp 3-component vector of int)
+0:178          's1' ( temp highp 3-component vector of int)
+0:178          imageQuerySize ( global highp 3-component vector of int)
+0:178            'CA1' ( writeonly uniform highp imageCubeArray)
+0:179      Sequence
+0:179        move second child to first child ( temp highp 3-component vector of int)
+0:179          's2' ( temp highp 3-component vector of int)
+0:179          imageQuerySize ( global highp 3-component vector of int)
+0:179            'CA2' ( writeonly uniform highp iimageCubeArray)
+0:180      Sequence
+0:180        move second child to first child ( temp highp 3-component vector of int)
+0:180          's3' ( temp highp 3-component vector of int)
+0:180          imageQuerySize ( global highp 3-component vector of int)
+0:180            'CA3' ( writeonly uniform highp uimageCubeArray)
+0:182      imageStore ( global highp void)
+0:182        'CA1' ( writeonly uniform highp imageCubeArray)
+0:182        's3' ( temp highp 3-component vector of int)
+0:182        Constant:
+0:182          1.000000
+0:182          1.000000
+0:182          1.000000
+0:182          1.000000
+0:183      imageStore ( global highp void)
+0:183        'CA2' ( writeonly uniform highp iimageCubeArray)
+0:183        's3' ( temp highp 3-component vector of int)
+0:183        Constant:
+0:183          1 (const int)
+0:183          1 (const int)
+0:183          1 (const int)
+0:183          1 (const int)
+0:184      imageStore ( global highp void)
+0:184        'CA3' ( writeonly uniform highp uimageCubeArray)
+0:184        's3' ( temp highp 3-component vector of int)
+0:184        Constant:
+0:184          1 (const uint)
+0:184          1 (const uint)
+0:184          1 (const uint)
+0:184          1 (const uint)
+0:186      Sequence
+0:186        move second child to first child ( temp highp 4-component vector of float)
+0:186          'cl1' ( temp highp 4-component vector of float)
+0:186          imageLoad ( global highp 4-component vector of float)
+0:186            'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray)
+0:186            's3' ( temp highp 3-component vector of int)
+0:187      Sequence
+0:187        move second child to first child ( temp highp 4-component vector of int)
+0:187          'cl2' ( temp highp 4-component vector of int)
+0:187          imageLoad ( global highp 4-component vector of int)
+0:187            'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray)
+0:187            's3' ( temp highp 3-component vector of int)
+0:188      Sequence
+0:188        move second child to first child ( temp highp 4-component vector of uint)
+0:188          'cl3' ( temp highp 4-component vector of uint)
+0:188          imageLoad ( global highp 4-component vector of uint)
+0:188            'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray)
+0:188            's3' ( temp highp 3-component vector of int)
+0:203  Function Definition: MSA( ( global void)
+0:203    Function Parameters: 
+0:205    Sequence
+0:205      Sequence
+0:205        move second child to first child ( temp highp 4-component vector of float)
+0:205          'tf' ( temp highp 4-component vector of float)
+0:205          textureFetch ( global highp 4-component vector of float)
+0:205            'samp2DMSA' ( uniform highp sampler2DMSArray)
+0:205            Constant:
+0:205              5 (const int)
+0:205              5 (const int)
+0:205              5 (const int)
+0:205            Constant:
+0:205              2 (const int)
+0:206      Sequence
+0:206        move second child to first child ( temp highp 4-component vector of int)
+0:206          'tfi' ( temp highp 4-component vector of int)
+0:206          textureFetch ( global highp 4-component vector of int)
+0:206            'samp2DMSAi' ( uniform highp isampler2DMSArray)
+0:206            Constant:
+0:206              5 (const int)
+0:206              5 (const int)
+0:206              5 (const int)
+0:206            Constant:
+0:206              2 (const int)
+0:207      Sequence
+0:207        move second child to first child ( temp highp 4-component vector of uint)
+0:207          'tfu' ( temp highp 4-component vector of uint)
+0:207          textureFetch ( global highp 4-component vector of uint)
+0:207            'samp2DMSAu' ( uniform highp usampler2DMSArray)
+0:207            Constant:
+0:207              5 (const int)
+0:207              5 (const int)
+0:207              5 (const int)
+0:207            Constant:
+0:207              2 (const int)
+0:209      Sequence
+0:209        move second child to first child ( temp highp 3-component vector of int)
+0:209          'tfs' ( temp highp 3-component vector of int)
+0:209          textureSize ( global highp 3-component vector of int)
+0:209            'samp2DMSA' ( uniform highp sampler2DMSArray)
+0:210      Sequence
+0:210        move second child to first child ( temp highp 3-component vector of int)
+0:210          'tfsi' ( temp highp 3-component vector of int)
+0:210          textureSize ( global highp 3-component vector of int)
+0:210            'samp2DMSAi' ( uniform highp isampler2DMSArray)
+0:212      Sequence
+0:212        move second child to first child ( temp highp 3-component vector of int)
+0:212          'tfsu' ( temp highp 3-component vector of int)
+0:212          textureSize ( global highp 3-component vector of int)
+0:212            'samp2DMSAu' ( uniform highp usampler2DMSArray)
+0:220  Function Definition: goodImageAtom( ( global void)
+0:220    Function Parameters: 
+0:?     Sequence
+0:226      imageAtomicAdd ( global highp int)
+0:226        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:226        'P' ( uniform highp 2-component vector of int)
+0:226        'dati' ( temp highp int)
+0:227      imageAtomicAdd ( global highp uint)
+0:227        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:227        'P' ( uniform highp 2-component vector of int)
+0:227        'datu' ( temp highp uint)
+0:228      imageAtomicMin ( global highp int)
+0:228        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:228        'P' ( uniform highp 2-component vector of int)
+0:228        'dati' ( temp highp int)
+0:229      imageAtomicMin ( global highp uint)
+0:229        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:229        'P' ( uniform highp 2-component vector of int)
+0:229        'datu' ( temp highp uint)
+0:230      imageAtomicMax ( global highp int)
+0:230        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:230        'P' ( uniform highp 2-component vector of int)
+0:230        'dati' ( temp highp int)
+0:231      imageAtomicMax ( global highp uint)
+0:231        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:231        'P' ( uniform highp 2-component vector of int)
+0:231        'datu' ( temp highp uint)
+0:232      imageAtomicAnd ( global highp int)
+0:232        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:232        'P' ( uniform highp 2-component vector of int)
+0:232        'dati' ( temp highp int)
+0:233      imageAtomicAnd ( global highp uint)
+0:233        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:233        'P' ( uniform highp 2-component vector of int)
+0:233        'datu' ( temp highp uint)
+0:234      imageAtomicOr ( global highp int)
+0:234        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:234        'P' ( uniform highp 2-component vector of int)
+0:234        'dati' ( temp highp int)
+0:235      imageAtomicOr ( global highp uint)
+0:235        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:235        'P' ( uniform highp 2-component vector of int)
+0:235        'datu' ( temp highp uint)
+0:236      imageAtomicXor ( global highp int)
+0:236        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:236        'P' ( uniform highp 2-component vector of int)
+0:236        'dati' ( temp highp int)
+0:237      imageAtomicXor ( global highp uint)
+0:237        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:237        'P' ( uniform highp 2-component vector of int)
+0:237        'datu' ( temp highp uint)
+0:238      imageAtomicExchange ( global highp int)
+0:238        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:238        'P' ( uniform highp 2-component vector of int)
+0:238        'dati' ( temp highp int)
+0:239      imageAtomicExchange ( global highp uint)
+0:239        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:239        'P' ( uniform highp 2-component vector of int)
+0:239        'datu' ( temp highp uint)
+0:240      imageAtomicExchange ( global highp float)
+0:240        'im2Df' (layout( r32f) uniform highp image2D)
+0:240        'P' ( uniform highp 2-component vector of int)
+0:240        'datf' ( temp highp float)
+0:241      imageAtomicCompSwap ( global highp int)
+0:241        'im2Di' (layout( r32i) uniform highp iimage2D)
+0:241        'P' ( uniform highp 2-component vector of int)
+0:241        Constant:
+0:241          3 (const int)
+0:241        'dati' ( temp highp int)
+0:242      imageAtomicCompSwap ( global highp uint)
+0:242        'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:242        'P' ( uniform highp 2-component vector of int)
+0:242        Constant:
+0:242          5 (const uint)
+0:242        'datu' ( temp highp uint)
+0:250  Function Definition: badInterp( ( global void)
+0:250    Function Parameters: 
+0:252    Sequence
+0:252      Constant:
+0:252        0.000000
+0:253      Constant:
+0:253        0.000000
+0:254      Constant:
+0:254        0.000000
+0:?   Linker Objects
+0:?     'outbinst' ( out block{ out highp int a,  out highp 4-component vector of float v,  out highp sampler2D s})
+0:?     'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
+0:?     'aliased' (layout( location=12) smooth out highp int)
+0:?     'inbinst' ( in block{ in highp int a})
+0:?     'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:?     'smon' ( smooth out block{ out highp int i})
+0:?     'fmon' ( flat out block{ out highp int i})
+0:?     'cmon' ( centroid out block{ out highp int i})
+0:?     'imon' ( invariant out block{ out highp int i})
+0:?     'inf' ( in highp 2-component vector of float)
+0:?     'ing' ( in highp 2-component vector of float)
+0:?     'offsets' ( uniform 4-element array of highp 2-component vector of int)
+0:?     'sArray' ( uniform 4-element array of lowp sampler2D)
+0:?     'sIndex' ( uniform highp int)
+0:?     'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint)
+0:?     'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i})
+0:?     'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i})
+0:?     'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:?     'constOffsets' ( const 4-element array of highp 2-component vector of int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?     'noPreSamp1' ( uniform mediump samplerBuffer)
+0:?     'noPreSamp2' ( uniform mediump isamplerBuffer)
+0:?     'noPreSamp3' ( uniform mediump usamplerBuffer)
+0:?     'noPreSamp4' ( writeonly uniform mediump imageBuffer)
+0:?     'noPreSamp5' ( writeonly uniform mediump iimageBuffer)
+0:?     'noPreSamp6' ( writeonly uniform mediump uimageBuffer)
+0:?     'bufSamp1' ( uniform highp samplerBuffer)
+0:?     'bufSamp2' ( uniform highp isamplerBuffer)
+0:?     'bufSamp3' ( uniform highp usamplerBuffer)
+0:?     'bufSamp4' ( writeonly uniform highp imageBuffer)
+0:?     'bufSamp5' ( writeonly uniform highp iimageBuffer)
+0:?     'bufSamp6' ( writeonly uniform highp uimageBuffer)
+0:?     'noPreCA1' ( writeonly uniform mediump imageCubeArray)
+0:?     'noPreCA2' ( writeonly uniform mediump iimageCubeArray)
+0:?     'noPreCA3' ( writeonly uniform mediump uimageCubeArray)
+0:?     'noPreCA4' ( uniform mediump samplerCubeArray)
+0:?     'noPreCA5' ( uniform mediump samplerCubeArrayShadow)
+0:?     'noPreCA6' ( uniform mediump isamplerCubeArray)
+0:?     'noPreCA7' ( uniform mediump usamplerCubeArray)
+0:?     'CA1' ( writeonly uniform highp imageCubeArray)
+0:?     'CA2' ( writeonly uniform highp iimageCubeArray)
+0:?     'CA3' ( writeonly uniform highp uimageCubeArray)
+0:?     'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray)
+0:?     'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray)
+0:?     'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray)
+0:?     'CA4' ( uniform highp samplerCubeArray)
+0:?     'CA5' ( uniform highp samplerCubeArrayShadow)
+0:?     'CA6' ( uniform highp isamplerCubeArray)
+0:?     'CA7' ( uniform highp usamplerCubeArray)
+0:?     'noPrec2DMS' ( uniform mediump sampler2DMSArray)
+0:?     'noPrec2DMSi' ( uniform mediump isampler2DMSArray)
+0:?     'noPrec2DMSu' ( uniform mediump usampler2DMSArray)
+0:?     'samp2DMSA' ( uniform highp sampler2DMSArray)
+0:?     'samp2DMSAi' ( uniform highp isampler2DMSArray)
+0:?     'samp2DMSAu' ( uniform highp usampler2DMSArray)
+0:?     'im2Df' (layout( r32f) uniform highp image2D)
+0:?     'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:?     'im2Di' (layout( r32i) uniform highp iimage2D)
+0:?     'P' ( uniform highp 2-component vector of int)
+0:?     'colorSample' ( smooth sample out highp 4-component vector of float)
+0:?     'colorfsi' ( flat sample out highp 4-component vector of float)
+0:?     'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float)
+0:?     'inv4' ( in highp 4-component vector of float)
+0:?     'gl_VertexID' ( gl_VertexId highp int VertexId)
+0:?     'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
+
+
+Linked vertex stage:
+
+
+Shader version: 320
+ERROR: node is still EOpNull!
+0:23  Function Definition: main( ( global void)
+0:23    Function Parameters: 
+0:25    Sequence
+0:25      Sequence
+0:25        move second child to first child ( temp highp int)
+0:25          'sum' ( temp highp int)
+0:25          add ( temp highp int)
+0:25            'gl_VertexID' ( gl_VertexId highp int VertexId)
+0:26            'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
+0:27      move second child to first child ( temp highp 4-component vector of float)
+0:27        gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
+0:27          'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:27          Constant:
+0:27            0 (const uint)
+0:27        Constant:
+0:27          1.000000
+0:27          1.000000
+0:27          1.000000
+0:27          1.000000
+0:28      gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize)
+0:28        'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:28        Constant:
+0:28          1 (const uint)
+0:?   Linker Objects
+0:?     'outbinst' ( out block{ out highp int a,  out highp 4-component vector of float v,  out highp sampler2D s})
+0:?     'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
+0:?     'aliased' (layout( location=12) smooth out highp int)
+0:?     'inbinst' ( in block{ in highp int a})
+0:?     'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
+0:?     'smon' ( smooth out block{ out highp int i})
+0:?     'fmon' ( flat out block{ out highp int i})
+0:?     'cmon' ( centroid out block{ out highp int i})
+0:?     'imon' ( invariant out block{ out highp int i})
+0:?     'inf' ( in highp 2-component vector of float)
+0:?     'ing' ( in highp 2-component vector of float)
+0:?     'offsets' ( uniform 4-element array of highp 2-component vector of int)
+0:?     'sArray' ( uniform 4-element array of lowp sampler2D)
+0:?     'sIndex' ( uniform highp int)
+0:?     'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint)
+0:?     'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i})
+0:?     'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i})
+0:?     'iArray' ( writeonly uniform 5-element array of highp image2D)
+0:?     'constOffsets' ( const 4-element array of highp 2-component vector of int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?       0 (const int)
+0:?     'noPreSamp1' ( uniform mediump samplerBuffer)
+0:?     'noPreSamp2' ( uniform mediump isamplerBuffer)
+0:?     'noPreSamp3' ( uniform mediump usamplerBuffer)
+0:?     'noPreSamp4' ( writeonly uniform mediump imageBuffer)
+0:?     'noPreSamp5' ( writeonly uniform mediump iimageBuffer)
+0:?     'noPreSamp6' ( writeonly uniform mediump uimageBuffer)
+0:?     'bufSamp1' ( uniform highp samplerBuffer)
+0:?     'bufSamp2' ( uniform highp isamplerBuffer)
+0:?     'bufSamp3' ( uniform highp usamplerBuffer)
+0:?     'bufSamp4' ( writeonly uniform highp imageBuffer)
+0:?     'bufSamp5' ( writeonly uniform highp iimageBuffer)
+0:?     'bufSamp6' ( writeonly uniform highp uimageBuffer)
+0:?     'noPreCA1' ( writeonly uniform mediump imageCubeArray)
+0:?     'noPreCA2' ( writeonly uniform mediump iimageCubeArray)
+0:?     'noPreCA3' ( writeonly uniform mediump uimageCubeArray)
+0:?     'noPreCA4' ( uniform mediump samplerCubeArray)
+0:?     'noPreCA5' ( uniform mediump samplerCubeArrayShadow)
+0:?     'noPreCA6' ( uniform mediump isamplerCubeArray)
+0:?     'noPreCA7' ( uniform mediump usamplerCubeArray)
+0:?     'CA1' ( writeonly uniform highp imageCubeArray)
+0:?     'CA2' ( writeonly uniform highp iimageCubeArray)
+0:?     'CA3' ( writeonly uniform highp uimageCubeArray)
+0:?     'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray)
+0:?     'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray)
+0:?     'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray)
+0:?     'CA4' ( uniform highp samplerCubeArray)
+0:?     'CA5' ( uniform highp samplerCubeArrayShadow)
+0:?     'CA6' ( uniform highp isamplerCubeArray)
+0:?     'CA7' ( uniform highp usamplerCubeArray)
+0:?     'noPrec2DMS' ( uniform mediump sampler2DMSArray)
+0:?     'noPrec2DMSi' ( uniform mediump isampler2DMSArray)
+0:?     'noPrec2DMSu' ( uniform mediump usampler2DMSArray)
+0:?     'samp2DMSA' ( uniform highp sampler2DMSArray)
+0:?     'samp2DMSAi' ( uniform highp isampler2DMSArray)
+0:?     'samp2DMSAu' ( uniform highp usampler2DMSArray)
+0:?     'im2Df' (layout( r32f) uniform highp image2D)
+0:?     'im2Du' (layout( r32ui) uniform highp uimage2D)
+0:?     'im2Di' (layout( r32i) uniform highp iimage2D)
+0:?     'P' ( uniform highp 2-component vector of int)
+0:?     'colorSample' ( smooth sample out highp 4-component vector of float)
+0:?     'colorfsi' ( flat sample out highp 4-component vector of float)
+0:?     'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float)
+0:?     'inv4' ( in highp 4-component vector of float)
+0:?     'gl_VertexID' ( gl_VertexId highp int VertexId)
+0:?     'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
+
diff --git a/Test/baseResults/435.vert.out b/Test/baseResults/435.vert.out
new file mode 100755
index 0000000..188a0a4
--- /dev/null
+++ b/Test/baseResults/435.vert.out
@@ -0,0 +1,25 @@
+435.vert
+ERROR: version not supported
+ERROR: 1 compilation errors.  No code generated.
+
+
+Shader version: 450
+ERROR: node is still EOpNull!
+0:2  Function Definition: main( ( global void)
+0:2    Function Parameters: 
+0:?   Linker Objects
+0:?     'gl_VertexID' ( gl_VertexId int VertexId)
+0:?     'gl_InstanceID' ( gl_InstanceId int InstanceId)
+
+
+Linked vertex stage:
+
+
+Shader version: 450
+ERROR: node is still EOpNull!
+0:2  Function Definition: main( ( global void)
+0:2    Function Parameters: 
+0:?   Linker Objects
+0:?     'gl_VertexID' ( gl_VertexId int VertexId)
+0:?     'gl_InstanceID' ( gl_InstanceId int InstanceId)
+
diff --git a/Test/baseResults/450.frag.out b/Test/baseResults/450.frag.out
index c0db5a7..9cbb4cb 100644
--- a/Test/baseResults/450.frag.out
+++ b/Test/baseResults/450.frag.out
@@ -1,6 +1,7 @@
 450.frag
 ERROR: 0:63: 'location' : cannot use in a block array where new locations are needed for each block element 
-ERROR: 1 compilation errors.  No code generated.
+ERROR: 0:68: 'early_fragment_tests' : can only apply to a standalone qualifier 
+ERROR: 2 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -164,6 +165,7 @@
 0:?     'i2dmsa' (layout( rgba32f) uniform image2DMSArray)
 0:?     'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m})
 0:?     'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g})
+0:?     'f' ( smooth in float)
 
 
 Linked fragment stage:
@@ -279,4 +281,5 @@
 0:?     'i2dmsa' (layout( rgba32f) uniform image2DMSArray)
 0:?     'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m})
 0:?     'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g})
+0:?     'f' ( smooth in float)
 
diff --git a/Test/baseResults/450.geom.out b/Test/baseResults/450.geom.out
index ee08188..e75bf93 100644
--- a/Test/baseResults/450.geom.out
+++ b/Test/baseResults/450.geom.out
@@ -1,7 +1,8 @@
 450.geom
 ERROR: 0:15: '[' :  array index out of range '3'
 ERROR: 0:15: 'gl_Position' : no such field in structure 
-ERROR: 2 compilation errors.  No code generated.
+ERROR: 0:19: 'points' : can only apply to a standalone qualifier 
+ERROR: 3 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -38,6 +39,7 @@
 0:?   Linker Objects
 0:?     'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance})
 0:?     'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance})
+0:?     'f' ( in 3-element array of float)
 
 
 Linked geometry stage:
@@ -79,4 +81,5 @@
 0:?   Linker Objects
 0:?     'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance})
 0:?     'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance})
+0:?     'f' ( in 3-element array of float)
 
diff --git a/Test/baseResults/450.tese.out b/Test/baseResults/450.tese.out
index 7b80304..796d6f1 100644
--- a/Test/baseResults/450.tese.out
+++ b/Test/baseResults/450.tese.out
@@ -1,9 +1,18 @@
 450.tese
+ERROR: 0:16: 'equal_spacing' : can only apply to a standalone qualifier 
+ERROR: 0:17: 'fractional_even_spacing' : can only apply to a standalone qualifier 
+ERROR: 0:18: 'fractional_odd_spacing' : can only apply to a standalone qualifier 
+ERROR: 0:19: 'cw' : can only apply to a standalone qualifier 
+ERROR: 0:20: 'ccw' : can only apply to a standalone qualifier 
+ERROR: 0:21: 'point_mode' : can only apply to a standalone qualifier 
+ERROR: 6 compilation errors.  No code generated.
+
+
 Shader version: 450
 input primitive = none
 vertex spacing = none
 triangle order = none
-0:? Sequence
+ERROR: node is still EOpNull!
 0:11  Function Definition: main( ( global void)
 0:11    Function Parameters: 
 0:13    Sequence
@@ -28,6 +37,12 @@
 0:?   Linker Objects
 0:?     'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance})
 0:?     'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance})
+0:?     'f1' ( in 32-element array of float)
+0:?     'f2' ( in 32-element array of float)
+0:?     'f3' ( in 32-element array of float)
+0:?     'f4' ( in 32-element array of float)
+0:?     'f5' ( in 32-element array of float)
+0:?     'f6' ( in 32-element array of float)
 
 
 Linked tessellation evaluation stage:
@@ -38,7 +53,7 @@
 input primitive = none
 vertex spacing = equal_spacing
 triangle order = ccw
-0:? Sequence
+ERROR: node is still EOpNull!
 0:11  Function Definition: main( ( global void)
 0:11    Function Parameters: 
 0:13    Sequence
@@ -63,4 +78,10 @@
 0:?   Linker Objects
 0:?     'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance})
 0:?     'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance})
+0:?     'f1' ( in 32-element array of float)
+0:?     'f2' ( in 32-element array of float)
+0:?     'f3' ( in 32-element array of float)
+0:?     'f4' ( in 32-element array of float)
+0:?     'f5' ( in 32-element array of float)
+0:?     'f6' ( in 32-element array of float)
 
diff --git a/Test/baseResults/glsl.-D-U.frag.out b/Test/baseResults/glsl.-D-U.frag.out
new file mode 100644
index 0000000..6538e84
--- /dev/null
+++ b/Test/baseResults/glsl.-D-U.frag.out
@@ -0,0 +1,55 @@
+glsl.-D-U.frag
+Shader version: 450
+0:? Sequence
+0:7  Function Definition: main( ( global void)
+0:7    Function Parameters: 
+0:10    Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        'color' (layout( location=0) out 4-component vector of float)
+0:10        Constant:
+0:10          1.000000
+0:10          1.000000
+0:10          1.000000
+0:10          1.000000
+0:16      Post-Increment ( temp 4-component vector of float)
+0:16        'color' (layout( location=0) out 4-component vector of float)
+0:24      vector scale second child into first child ( temp 4-component vector of float)
+0:24        'color' (layout( location=0) out 4-component vector of float)
+0:24        Constant:
+0:24          3.000000
+0:28      vector scale second child into first child ( temp 4-component vector of float)
+0:28        'color' (layout( location=0) out 4-component vector of float)
+0:28        Constant:
+0:28          400.000000
+0:?   Linker Objects
+0:?     'color' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+0:? Sequence
+0:7  Function Definition: main( ( global void)
+0:7    Function Parameters: 
+0:10    Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        'color' (layout( location=0) out 4-component vector of float)
+0:10        Constant:
+0:10          1.000000
+0:10          1.000000
+0:10          1.000000
+0:10          1.000000
+0:16      Post-Increment ( temp 4-component vector of float)
+0:16        'color' (layout( location=0) out 4-component vector of float)
+0:24      vector scale second child into first child ( temp 4-component vector of float)
+0:24        'color' (layout( location=0) out 4-component vector of float)
+0:24        Constant:
+0:24          3.000000
+0:28      vector scale second child into first child ( temp 4-component vector of float)
+0:28        'color' (layout( location=0) out 4-component vector of float)
+0:28        Constant:
+0:28          400.000000
+0:?   Linker Objects
+0:?     'color' (layout( location=0) out 4-component vector of float)
+
diff --git a/Test/baseResults/glspv.frag.out b/Test/baseResults/glspv.frag.out
index 0ff15a8..36afc83 100755
--- a/Test/baseResults/glspv.frag.out
+++ b/Test/baseResults/glspv.frag.out
@@ -1,9 +1,10 @@
 glspv.frag
 ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error )  
 ERROR: 0:6: '#error' : GL_SPIR is 100  
-ERROR: 0:14: 'input_attachment_index' : only allowed when using GLSL for Vulkan 
-ERROR: 0:14: '' :  syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
-ERROR: 4 compilation errors.  No code generated.
+ERROR: 0:14: 'f' : non-opaque uniform variables need a layout(location=L) 
+ERROR: 0:19: 'input_attachment_index' : only allowed when using GLSL for Vulkan 
+ERROR: 0:19: '' :  syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
+ERROR: 5 compilation errors.  No code generated.
 
 
 SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/hlsl.-D-U.frag.out b/Test/baseResults/hlsl.-D-U.frag.out
new file mode 100644
index 0000000..06842e8
--- /dev/null
+++ b/Test/baseResults/hlsl.-D-U.frag.out
@@ -0,0 +1,65 @@
+hlsl.-D-U.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        'color' ( global 4-component vector of float)
+0:9        Constant:
+0:9          1.000000
+0:9          1.000000
+0:9          1.000000
+0:9          1.000000
+0:15      subtract second child into first child ( temp 4-component vector of float)
+0:15        'color' ( global 4-component vector of float)
+0:15        Constant:
+0:15          5.000000
+0:21      Post-Increment ( temp 4-component vector of float)
+0:21        'color' ( global 4-component vector of float)
+0:29      vector scale second child into first child ( temp 4-component vector of float)
+0:29        'color' ( global 4-component vector of float)
+0:29        Constant:
+0:29          3.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      Function Call: @main( ( temp void)
+0:?   Linker Objects
+0:?     'color' ( global 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        'color' ( global 4-component vector of float)
+0:9        Constant:
+0:9          1.000000
+0:9          1.000000
+0:9          1.000000
+0:9          1.000000
+0:15      subtract second child into first child ( temp 4-component vector of float)
+0:15        'color' ( global 4-component vector of float)
+0:15        Constant:
+0:15          5.000000
+0:21      Post-Increment ( temp 4-component vector of float)
+0:21        'color' ( global 4-component vector of float)
+0:29      vector scale second child into first child ( temp 4-component vector of float)
+0:29        'color' ( global 4-component vector of float)
+0:29        Constant:
+0:29          3.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      Function Call: @main( ( temp void)
+0:?   Linker Objects
+0:?     'color' ( global 4-component vector of float)
+
diff --git a/Test/baseResults/hlsl.amend.frag.out b/Test/baseResults/hlsl.amend.frag.out
index 7611af3..388d346 100755
--- a/Test/baseResults/hlsl.amend.frag.out
+++ b/Test/baseResults/hlsl.amend.frag.out
@@ -184,9 +184,9 @@
                               Name 22  ""
                               MemberDecorate 20($Global) 0 Offset 0
                               MemberDecorate 20($Global) 1 Offset 16
-                              MemberDecorate 20($Global) 2 Offset 20
-                              MemberDecorate 20($Global) 3 Offset 32
-                              MemberDecorate 20($Global) 4 Offset 36
+                              MemberDecorate 20($Global) 2 Offset 32
+                              MemberDecorate 20($Global) 3 Offset 44
+                              MemberDecorate 20($Global) 4 Offset 48
                               Decorate 20($Global) Block
                               Decorate 22 DescriptorSet 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.array.frag.out b/Test/baseResults/hlsl.array.frag.out
index c0c5a13..52008e3 100755
--- a/Test/baseResults/hlsl.array.frag.out
+++ b/Test/baseResults/hlsl.array.frag.out
@@ -57,7 +57,7 @@
 0:?     Sequence
 0:8      move second child to first child ( temp int)
 0:?         'i' ( temp int)
-0:?         'i' (layout( location=0) in int)
+0:?         'i' (layout( location=0) flat in int)
 0:8      move second child to first child ( temp 3-element array of 4-component vector of float)
 0:?         'input' ( temp 3-element array of 4-component vector of float)
 0:?         'input' (layout( location=1) in 3-element array of 4-component vector of float)
@@ -69,7 +69,7 @@
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a,  uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in int)
+0:?     'i' (layout( location=0) flat in int)
 0:?     'input' (layout( location=1) in 3-element array of 4-component vector of float)
 
 
@@ -134,7 +134,7 @@
 0:?     Sequence
 0:8      move second child to first child ( temp int)
 0:?         'i' ( temp int)
-0:?         'i' (layout( location=0) in int)
+0:?         'i' (layout( location=0) flat in int)
 0:8      move second child to first child ( temp 3-element array of 4-component vector of float)
 0:?         'input' ( temp 3-element array of 4-component vector of float)
 0:?         'input' (layout( location=1) in 3-element array of 4-component vector of float)
@@ -146,7 +146,7 @@
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a,  uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in int)
+0:?     'i' (layout( location=0) flat in int)
 0:?     'input' (layout( location=1) in 3-element array of 4-component vector of float)
 
 // Module Version 10000
@@ -185,6 +185,7 @@
                               MemberDecorate 26($Global) 1 Offset 64
                               Decorate 26($Global) Block
                               Decorate 28 DescriptorSet 0
+                              Decorate 68(i) Flat
                               Decorate 68(i) Location 0
                               Decorate 72(input) Location 1
                               Decorate 75(@entryPointOutput) Location 0
diff --git a/Test/baseResults/hlsl.attribute.frag.out b/Test/baseResults/hlsl.attribute.frag.out
index ccd7693..47fb677 100755
--- a/Test/baseResults/hlsl.attribute.frag.out
+++ b/Test/baseResults/hlsl.attribute.frag.out
@@ -90,7 +90,7 @@
 11(@PixelShaderFunction(vf4;):           2 Function None 9
        10(input):      8(ptr) FunctionParameter
               12:             Label
-                              SelectionMerge 16 None
+                              SelectionMerge 16 DontFlatten 
                               BranchConditional 14 15 16
               15:               Label
                                 Branch 16
diff --git a/Test/baseResults/hlsl.buffer.frag.out b/Test/baseResults/hlsl.buffer.frag.out
index faa2ad6..c0d251c 100755
--- a/Test/baseResults/hlsl.buffer.frag.out
+++ b/Test/baseResults/hlsl.buffer.frag.out
@@ -2,49 +2,57 @@
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:30  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:30  Function Definition: foo( ( temp float)
 0:30    Function Parameters: 
-0:30      'input' ( in 4-component vector of float)
 0:?     Sequence
 0:31      Branch: Return with expression
-0:31        add ( temp 4-component vector of float)
-0:31          add ( temp 4-component vector of float)
-0:31            add ( temp 4-component vector of float)
-0:31              add ( temp 4-component vector of float)
-0:31                'input' ( in 4-component vector of float)
-0:31                v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
-0:31                  'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
-0:31                  Constant:
-0:31                    0 (const uint)
-0:31              v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
-0:31                'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
-0:31                Constant:
-0:31                  0 (const uint)
-0:31            v3: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
-0:31              'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:31              Constant:
-0:31                0 (const uint)
-0:31          v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:31            'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
-0:31            Constant:
-0:31              0 (const uint)
-0:30  Function Definition: PixelShaderFunction( ( temp void)
-0:30    Function Parameters: 
+0:31        Constant:
+0:31          1.000000
+0:35  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:35    Function Parameters: 
+0:35      'input' ( in 4-component vector of float)
 0:?     Sequence
-0:30      move second child to first child ( temp 4-component vector of float)
+0:36      Branch: Return with expression
+0:36        vector-scale ( temp 4-component vector of float)
+0:36          add ( temp 4-component vector of float)
+0:36            add ( temp 4-component vector of float)
+0:36              add ( temp 4-component vector of float)
+0:36                add ( temp 4-component vector of float)
+0:36                  'input' ( in 4-component vector of float)
+0:36                  v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:36                    'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
+0:36                    Constant:
+0:36                      0 (const uint)
+0:36                v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
+0:36                  'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:36                  Constant:
+0:36                    0 (const uint)
+0:36              v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float)
+0:36                'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
+0:36                Constant:
+0:36                  0 (const uint)
+0:36            v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
+0:36              'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4})
+0:36              Constant:
+0:36                0 (const uint)
+0:36          Function Call: foo( ( temp float)
+0:35  Function Definition: PixelShaderFunction( ( temp void)
+0:35    Function Parameters: 
+0:?     Sequence
+0:35      move second child to first child ( temp 4-component vector of float)
 0:?         'input' ( temp 4-component vector of float)
-0:?         'input' (layout( location=0) in 4-component vector of float)
-0:30      move second child to first child ( temp 4-component vector of float)
+0:?         'input' ( in 4-component vector of float FragCoord)
+0:35      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:30        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:35        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
 0:?     'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
-0:?     'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:?     'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
+0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in 4-component vector of float)
+0:?     'input' ( in 4-component vector of float FragCoord)
 
 
 Linked fragment stage:
@@ -53,193 +61,209 @@
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:30  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:30  Function Definition: foo( ( temp float)
 0:30    Function Parameters: 
-0:30      'input' ( in 4-component vector of float)
 0:?     Sequence
 0:31      Branch: Return with expression
-0:31        add ( temp 4-component vector of float)
-0:31          add ( temp 4-component vector of float)
-0:31            add ( temp 4-component vector of float)
-0:31              add ( temp 4-component vector of float)
-0:31                'input' ( in 4-component vector of float)
-0:31                v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
-0:31                  'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
-0:31                  Constant:
-0:31                    0 (const uint)
-0:31              v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
-0:31                'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
-0:31                Constant:
-0:31                  0 (const uint)
-0:31            v3: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
-0:31              'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:31              Constant:
-0:31                0 (const uint)
-0:31          v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:31            'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
-0:31            Constant:
-0:31              0 (const uint)
-0:30  Function Definition: PixelShaderFunction( ( temp void)
-0:30    Function Parameters: 
+0:31        Constant:
+0:31          1.000000
+0:35  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:35    Function Parameters: 
+0:35      'input' ( in 4-component vector of float)
 0:?     Sequence
-0:30      move second child to first child ( temp 4-component vector of float)
+0:36      Branch: Return with expression
+0:36        vector-scale ( temp 4-component vector of float)
+0:36          add ( temp 4-component vector of float)
+0:36            add ( temp 4-component vector of float)
+0:36              add ( temp 4-component vector of float)
+0:36                add ( temp 4-component vector of float)
+0:36                  'input' ( in 4-component vector of float)
+0:36                  v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:36                    'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
+0:36                    Constant:
+0:36                      0 (const uint)
+0:36                v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
+0:36                  'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:36                  Constant:
+0:36                    0 (const uint)
+0:36              v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float)
+0:36                'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
+0:36                Constant:
+0:36                  0 (const uint)
+0:36            v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
+0:36              'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4})
+0:36              Constant:
+0:36                0 (const uint)
+0:36          Function Call: foo( ( temp float)
+0:35  Function Definition: PixelShaderFunction( ( temp void)
+0:35    Function Parameters: 
+0:?     Sequence
+0:35      move second child to first child ( temp 4-component vector of float)
 0:?         'input' ( temp 4-component vector of float)
-0:?         'input' (layout( location=0) in 4-component vector of float)
-0:30      move second child to first child ( temp 4-component vector of float)
+0:?         'input' ( in 4-component vector of float FragCoord)
+0:35      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:30        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:35        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
 0:?     'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
-0:?     'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:?     'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
+0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in 4-component vector of float)
+0:?     'input' ( in 4-component vector of float FragCoord)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 53
+// Id's are bound by 61
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 46 49
+                              EntryPoint Fragment 4  "PixelShaderFunction" 54 57
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "PixelShaderFunction"
-                              Name 11  "@PixelShaderFunction(vf4;"
-                              Name 10  "input"
-                              Name 14  ""
-                              MemberName 14 0  "v1"
-                              Name 16  ""
-                              Name 23  ""
-                              MemberName 23 0  "v2"
-                              Name 25  ""
-                              Name 29  "cbufName"
-                              MemberName 29(cbufName) 0  "v3"
-                              MemberName 29(cbufName) 1  "i3"
+                              Name 8  "foo("
+                              Name 14  "@PixelShaderFunction(vf4;"
+                              Name 13  "input"
+                              Name 20  "buf1"
+                              MemberName 20(buf1) 0  "v1"
+                              Name 22  ""
+                              Name 29  "buf2"
+                              MemberName 29(buf2) 0  "v2"
                               Name 31  ""
-                              Name 36  "tbufName"
-                              MemberName 36(tbufName) 0  "v4"
-                              MemberName 36(tbufName) 1  "i4"
-                              MemberName 36(tbufName) 2  "f1"
-                              MemberName 36(tbufName) 3  "f3"
-                              MemberName 36(tbufName) 4  "f4"
-                              MemberName 36(tbufName) 5  "f5"
-                              MemberName 36(tbufName) 6  "f6"
-                              MemberName 36(tbufName) 7  "f7"
-                              MemberName 36(tbufName) 8  "m1"
-                              MemberName 36(tbufName) 9  "m2"
-                              MemberName 36(tbufName) 10  "m3"
-                              MemberName 36(tbufName) 11  "m4"
-                              Name 38  ""
-                              Name 44  "input"
-                              Name 46  "input"
-                              Name 49  "@entryPointOutput"
-                              Name 50  "param"
-                              MemberDecorate 14 0 Offset 0
-                              Decorate 14 Block
-                              Decorate 16 DescriptorSet 0
-                              MemberDecorate 23 0 NonWritable
-                              MemberDecorate 23 0 Offset 0
-                              Decorate 23 BufferBlock
-                              Decorate 25 DescriptorSet 0
-                              MemberDecorate 29(cbufName) 0 Offset 0
-                              MemberDecorate 29(cbufName) 1 Offset 20
-                              Decorate 29(cbufName) Block
-                              Decorate 31 DescriptorSet 10
-                              Decorate 31 Binding 2
-                              MemberDecorate 36(tbufName) 0 NonWritable
-                              MemberDecorate 36(tbufName) 0 Offset 16
-                              MemberDecorate 36(tbufName) 1 NonWritable
-                              MemberDecorate 36(tbufName) 1 Offset 48
-                              MemberDecorate 36(tbufName) 2 NonWritable
-                              MemberDecorate 36(tbufName) 2 Offset 60
-                              MemberDecorate 36(tbufName) 3 NonWritable
-                              MemberDecorate 36(tbufName) 3 Offset 64
-                              MemberDecorate 36(tbufName) 4 NonWritable
-                              MemberDecorate 36(tbufName) 4 Offset 68
-                              MemberDecorate 36(tbufName) 5 NonWritable
-                              MemberDecorate 36(tbufName) 5 Offset 72
-                              MemberDecorate 36(tbufName) 6 NonWritable
-                              MemberDecorate 36(tbufName) 6 Offset 76
-                              MemberDecorate 36(tbufName) 7 NonWritable
-                              MemberDecorate 36(tbufName) 7 Offset 80
-                              MemberDecorate 36(tbufName) 8 RowMajor
-                              MemberDecorate 36(tbufName) 8 NonWritable
-                              MemberDecorate 36(tbufName) 8 Offset 96
-                              MemberDecorate 36(tbufName) 8 MatrixStride 16
-                              MemberDecorate 36(tbufName) 9 ColMajor
-                              MemberDecorate 36(tbufName) 9 NonWritable
-                              MemberDecorate 36(tbufName) 9 Offset 160
-                              MemberDecorate 36(tbufName) 9 MatrixStride 16
-                              MemberDecorate 36(tbufName) 10 RowMajor
-                              MemberDecorate 36(tbufName) 10 NonWritable
-                              MemberDecorate 36(tbufName) 10 Offset 208
-                              MemberDecorate 36(tbufName) 10 MatrixStride 16
-                              MemberDecorate 36(tbufName) 11 RowMajor
-                              MemberDecorate 36(tbufName) 11 NonWritable
-                              MemberDecorate 36(tbufName) 11 Offset 272
-                              MemberDecorate 36(tbufName) 11 MatrixStride 16
-                              Decorate 36(tbufName) BufferBlock
-                              Decorate 38 DescriptorSet 0
-                              Decorate 38 Binding 8
-                              Decorate 46(input) Location 0
-                              Decorate 49(@entryPointOutput) Location 0
+                              Name 35  "cbufName"
+                              MemberName 35(cbufName) 0  "v3"
+                              MemberName 35(cbufName) 1  "i3"
+                              Name 37  ""
+                              Name 42  "tbufName"
+                              MemberName 42(tbufName) 0  "v4"
+                              MemberName 42(tbufName) 1  "i4"
+                              MemberName 42(tbufName) 2  "f1"
+                              MemberName 42(tbufName) 3  "f3"
+                              MemberName 42(tbufName) 4  "f4"
+                              MemberName 42(tbufName) 5  "f5"
+                              MemberName 42(tbufName) 6  "f6"
+                              MemberName 42(tbufName) 7  "f7"
+                              MemberName 42(tbufName) 8  "m1"
+                              MemberName 42(tbufName) 9  "m2"
+                              MemberName 42(tbufName) 10  "m3"
+                              MemberName 42(tbufName) 11  "m4"
+                              Name 44  ""
+                              Name 52  "input"
+                              Name 54  "input"
+                              Name 57  "@entryPointOutput"
+                              Name 58  "param"
+                              MemberDecorate 20(buf1) 0 Offset 0
+                              Decorate 20(buf1) Block
+                              Decorate 22 DescriptorSet 0
+                              MemberDecorate 29(buf2) 0 NonWritable
+                              MemberDecorate 29(buf2) 0 Offset 0
+                              Decorate 29(buf2) BufferBlock
+                              Decorate 31 DescriptorSet 0
+                              MemberDecorate 35(cbufName) 0 Offset 0
+                              MemberDecorate 35(cbufName) 1 Offset 20
+                              Decorate 35(cbufName) Block
+                              Decorate 37 DescriptorSet 0
+                              MemberDecorate 42(tbufName) 0 NonWritable
+                              MemberDecorate 42(tbufName) 0 Offset 16
+                              MemberDecorate 42(tbufName) 1 NonWritable
+                              MemberDecorate 42(tbufName) 1 Offset 48
+                              MemberDecorate 42(tbufName) 2 NonWritable
+                              MemberDecorate 42(tbufName) 2 Offset 60
+                              MemberDecorate 42(tbufName) 3 NonWritable
+                              MemberDecorate 42(tbufName) 3 Offset 64
+                              MemberDecorate 42(tbufName) 4 NonWritable
+                              MemberDecorate 42(tbufName) 4 Offset 68
+                              MemberDecorate 42(tbufName) 5 NonWritable
+                              MemberDecorate 42(tbufName) 5 Offset 72
+                              MemberDecorate 42(tbufName) 6 NonWritable
+                              MemberDecorate 42(tbufName) 6 Offset 76
+                              MemberDecorate 42(tbufName) 7 NonWritable
+                              MemberDecorate 42(tbufName) 7 Offset 128
+                              MemberDecorate 42(tbufName) 8 RowMajor
+                              MemberDecorate 42(tbufName) 8 NonWritable
+                              MemberDecorate 42(tbufName) 8 Offset 112
+                              MemberDecorate 42(tbufName) 8 MatrixStride 16
+                              MemberDecorate 42(tbufName) 9 ColMajor
+                              MemberDecorate 42(tbufName) 9 NonWritable
+                              MemberDecorate 42(tbufName) 9 Offset 176
+                              MemberDecorate 42(tbufName) 9 MatrixStride 16
+                              MemberDecorate 42(tbufName) 10 RowMajor
+                              MemberDecorate 42(tbufName) 10 NonWritable
+                              MemberDecorate 42(tbufName) 10 Offset 240
+                              MemberDecorate 42(tbufName) 10 MatrixStride 16
+                              MemberDecorate 42(tbufName) 11 RowMajor
+                              MemberDecorate 42(tbufName) 11 NonWritable
+                              MemberDecorate 42(tbufName) 11 Offset 304
+                              MemberDecorate 42(tbufName) 11 MatrixStride 16
+                              Decorate 42(tbufName) BufferBlock
+                              Decorate 44 DescriptorSet 0
+                              Decorate 44 Binding 8
+                              Decorate 54(input) BuiltIn FragCoord
+                              Decorate 57(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
-               7:             TypeVector 6(float) 4
-               8:             TypePointer Function 7(fvec4)
-               9:             TypeFunction 7(fvec4) 8(ptr)
-              14:             TypeStruct 7(fvec4)
-              15:             TypePointer Uniform 14(struct)
-              16:     15(ptr) Variable Uniform
-              17:             TypeInt 32 1
-              18:     17(int) Constant 0
-              19:             TypePointer Uniform 7(fvec4)
-              23:             TypeStruct 7(fvec4)
-              24:             TypePointer Uniform 23(struct)
-              25:     24(ptr) Variable Uniform
-    29(cbufName):             TypeStruct 7(fvec4) 17(int)
-              30:             TypePointer Uniform 29(cbufName)
+               7:             TypeFunction 6(float)
+              10:             TypeVector 6(float) 4
+              11:             TypePointer Function 10(fvec4)
+              12:             TypeFunction 10(fvec4) 11(ptr)
+              16:    6(float) Constant 1065353216
+        20(buf1):             TypeStruct 10(fvec4)
+              21:             TypePointer Uniform 20(buf1)
+              22:     21(ptr) Variable Uniform
+              23:             TypeInt 32 1
+              24:     23(int) Constant 0
+              25:             TypePointer Uniform 10(fvec4)
+        29(buf2):             TypeStruct 10(fvec4)
+              30:             TypePointer Uniform 29(buf2)
               31:     30(ptr) Variable Uniform
-              35:             TypeMatrix 7(fvec4) 3
-    36(tbufName):             TypeStruct 7(fvec4) 17(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 35 35 35 35
-              37:             TypePointer Uniform 36(tbufName)
-              38:     37(ptr) Variable Uniform
-              45:             TypePointer Input 7(fvec4)
-       46(input):     45(ptr) Variable Input
-              48:             TypePointer Output 7(fvec4)
-49(@entryPointOutput):     48(ptr) Variable Output
+    35(cbufName):             TypeStruct 10(fvec4) 23(int)
+              36:             TypePointer Uniform 35(cbufName)
+              37:     36(ptr) Variable Uniform
+              41:             TypeMatrix 10(fvec4) 3
+    42(tbufName):             TypeStruct 10(fvec4) 23(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 41 41 41 41
+              43:             TypePointer Uniform 42(tbufName)
+              44:     43(ptr) Variable Uniform
+              53:             TypePointer Input 10(fvec4)
+       54(input):     53(ptr) Variable Input
+              56:             TypePointer Output 10(fvec4)
+57(@entryPointOutput):     56(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-       44(input):      8(ptr) Variable Function
-       50(param):      8(ptr) Variable Function
-              47:    7(fvec4) Load 46(input)
-                              Store 44(input) 47
-              51:    7(fvec4) Load 44(input)
-                              Store 50(param) 51
-              52:    7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 50(param)
-                              Store 49(@entryPointOutput) 52
+       52(input):     11(ptr) Variable Function
+       58(param):     11(ptr) Variable Function
+              55:   10(fvec4) Load 54(input)
+                              Store 52(input) 55
+              59:   10(fvec4) Load 52(input)
+                              Store 58(param) 59
+              60:   10(fvec4) FunctionCall 14(@PixelShaderFunction(vf4;) 58(param)
+                              Store 57(@entryPointOutput) 60
                               Return
                               FunctionEnd
-11(@PixelShaderFunction(vf4;):    7(fvec4) Function None 9
-       10(input):      8(ptr) FunctionParameter
-              12:             Label
-              13:    7(fvec4) Load 10(input)
-              20:     19(ptr) AccessChain 16 18
-              21:    7(fvec4) Load 20
-              22:    7(fvec4) FAdd 13 21
-              26:     19(ptr) AccessChain 25 18
-              27:    7(fvec4) Load 26
-              28:    7(fvec4) FAdd 22 27
-              32:     19(ptr) AccessChain 31 18
-              33:    7(fvec4) Load 32
-              34:    7(fvec4) FAdd 28 33
-              39:     19(ptr) AccessChain 38 18
-              40:    7(fvec4) Load 39
-              41:    7(fvec4) FAdd 34 40
-                              ReturnValue 41
+         8(foo():    6(float) Function None 7
+               9:             Label
+                              ReturnValue 16
+                              FunctionEnd
+14(@PixelShaderFunction(vf4;):   10(fvec4) Function None 12
+       13(input):     11(ptr) FunctionParameter
+              15:             Label
+              19:   10(fvec4) Load 13(input)
+              26:     25(ptr) AccessChain 22 24
+              27:   10(fvec4) Load 26
+              28:   10(fvec4) FAdd 19 27
+              32:     25(ptr) AccessChain 31 24
+              33:   10(fvec4) Load 32
+              34:   10(fvec4) FAdd 28 33
+              38:     25(ptr) AccessChain 37 24
+              39:   10(fvec4) Load 38
+              40:   10(fvec4) FAdd 34 39
+              45:     25(ptr) AccessChain 44 24
+              46:   10(fvec4) Load 45
+              47:   10(fvec4) FAdd 40 46
+              48:    6(float) FunctionCall 8(foo()
+              49:   10(fvec4) VectorTimesScalar 47 48
+                              ReturnValue 49
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-1.vert.out b/Test/baseResults/hlsl.clipdistance-1.vert.out
new file mode 100644
index 0000000..5a254ec
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-1.vert.out
@@ -0,0 +1,194 @@
+hlsl.clipdistance-1.vert
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;f1;f1; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out float)
+0:4      'cull' ( out float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        'clip' ( out float)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        'cull' ( out float)
+0:7        Constant:
+0:7          0.510000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;f1;f1; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp float)
+0:?         'cull' ( temp float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 1-element array of float ClipDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:?           'clip' ( temp float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 1-element array of float CullDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:?           'cull' ( temp float)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 1-element array of float ClipDistance)
+0:?     'cull' ( out 1-element array of float CullDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;f1;f1; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out float)
+0:4      'cull' ( out float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        'clip' ( out float)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        'cull' ( out float)
+0:7        Constant:
+0:7          0.510000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;f1;f1; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp float)
+0:?         'cull' ( temp float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 1-element array of float ClipDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:?           'clip' ( temp float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 1-element array of float CullDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:?           'cull' ( temp float)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 1-element array of float ClipDistance)
+0:?     'cull' ( out 1-element array of float CullDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 46
+
+                              Capability Shader
+                              Capability ClipDistance
+                              Capability CullDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 31 37 43
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 14  "@main(vf4;f1;f1;"
+                              Name 11  "pos"
+                              Name 12  "clip"
+                              Name 13  "cull"
+                              Name 20  "pos"
+                              Name 21  "clip"
+                              Name 22  "cull"
+                              Name 23  "param"
+                              Name 24  "param"
+                              Name 25  "param"
+                              Name 31  "pos"
+                              Name 37  "clip"
+                              Name 43  "cull"
+                              Decorate 31(pos) BuiltIn Position
+                              Decorate 37(clip) BuiltIn ClipDistance
+                              Decorate 43(cull) BuiltIn CullDistance
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Function 7(fvec4)
+               9:             TypePointer Function 6(float)
+              10:             TypeFunction 2 8(ptr) 9(ptr) 9(ptr)
+              16:    6(float) Constant 1065353216
+              17:    7(fvec4) ConstantComposite 16 16 16 16
+              18:    6(float) Constant 1056964608
+              19:    6(float) Constant 1057132380
+              30:             TypePointer Output 7(fvec4)
+         31(pos):     30(ptr) Variable Output
+              33:             TypeInt 32 0
+              34:     33(int) Constant 1
+              35:             TypeArray 6(float) 34
+              36:             TypePointer Output 35
+        37(clip):     36(ptr) Variable Output
+              38:             TypeInt 32 1
+              39:     38(int) Constant 0
+              41:             TypePointer Output 6(float)
+        43(cull):     36(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+         20(pos):      8(ptr) Variable Function
+        21(clip):      9(ptr) Variable Function
+        22(cull):      9(ptr) Variable Function
+       23(param):      8(ptr) Variable Function
+       24(param):      9(ptr) Variable Function
+       25(param):      9(ptr) Variable Function
+              26:           2 FunctionCall 14(@main(vf4;f1;f1;) 23(param) 24(param) 25(param)
+              27:    7(fvec4) Load 23(param)
+                              Store 20(pos) 27
+              28:    6(float) Load 24(param)
+                              Store 21(clip) 28
+              29:    6(float) Load 25(param)
+                              Store 22(cull) 29
+              32:    7(fvec4) Load 20(pos)
+                              Store 31(pos) 32
+              40:    6(float) Load 21(clip)
+              42:     41(ptr) AccessChain 37(clip) 39
+                              Store 42 40
+              44:    6(float) Load 22(cull)
+              45:     41(ptr) AccessChain 43(cull) 39
+                              Store 45 44
+                              Return
+                              FunctionEnd
+14(@main(vf4;f1;f1;):           2 Function None 10
+         11(pos):      8(ptr) FunctionParameter
+        12(clip):      9(ptr) FunctionParameter
+        13(cull):      9(ptr) FunctionParameter
+              15:             Label
+                              Store 11(pos) 17
+                              Store 12(clip) 18
+                              Store 13(cull) 19
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-2.vert.out b/Test/baseResults/hlsl.clipdistance-2.vert.out
new file mode 100644
index 0000000..cb6d887
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-2.vert.out
@@ -0,0 +1,561 @@
+hlsl.clipdistance-2.vert
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out 2-element array of 2-component vector of float)
+0:4      'cull' ( out 2-element array of 2-component vector of float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        direct index ( temp float)
+0:6          direct index ( temp 2-component vector of float)
+0:6            'clip' ( out 2-element array of 2-component vector of float)
+0:6            Constant:
+0:6              0 (const int)
+0:6          Constant:
+0:6            0 (const int)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        direct index ( temp float)
+0:7          direct index ( temp 2-component vector of float)
+0:7            'clip' ( out 2-element array of 2-component vector of float)
+0:7            Constant:
+0:7              0 (const int)
+0:7          Constant:
+0:7            1 (const int)
+0:7        Constant:
+0:7          0.600000
+0:8      move second child to first child ( temp float)
+0:8        direct index ( temp float)
+0:8          direct index ( temp 2-component vector of float)
+0:8            'clip' ( out 2-element array of 2-component vector of float)
+0:8            Constant:
+0:8              1 (const int)
+0:8          Constant:
+0:8            0 (const int)
+0:8        Constant:
+0:8          0.700000
+0:9      move second child to first child ( temp float)
+0:9        direct index ( temp float)
+0:9          direct index ( temp 2-component vector of float)
+0:9            'clip' ( out 2-element array of 2-component vector of float)
+0:9            Constant:
+0:9              1 (const int)
+0:9          Constant:
+0:9            1 (const int)
+0:9        Constant:
+0:9          0.800000
+0:11      move second child to first child ( temp float)
+0:11        direct index ( temp float)
+0:11          direct index ( temp 2-component vector of float)
+0:11            'cull' ( out 2-element array of 2-component vector of float)
+0:11            Constant:
+0:11              0 (const int)
+0:11          Constant:
+0:11            0 (const int)
+0:11        Constant:
+0:11          0.525000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          direct index ( temp 2-component vector of float)
+0:12            'cull' ( out 2-element array of 2-component vector of float)
+0:12            Constant:
+0:12              0 (const int)
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          0.625000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          direct index ( temp 2-component vector of float)
+0:13            'cull' ( out 2-element array of 2-component vector of float)
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.725000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          direct index ( temp 2-component vector of float)
+0:14            'cull' ( out 2-element array of 2-component vector of float)
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            1 (const int)
+0:14        Constant:
+0:14          0.825000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp 2-element array of 2-component vector of float)
+0:?         'cull' ( temp 2-element array of 2-component vector of float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              1 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              2 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              3 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              1 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              2 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              3 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 4-element array of float ClipDistance)
+0:?     'cull' ( out 4-element array of float CullDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out 2-element array of 2-component vector of float)
+0:4      'cull' ( out 2-element array of 2-component vector of float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        direct index ( temp float)
+0:6          direct index ( temp 2-component vector of float)
+0:6            'clip' ( out 2-element array of 2-component vector of float)
+0:6            Constant:
+0:6              0 (const int)
+0:6          Constant:
+0:6            0 (const int)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        direct index ( temp float)
+0:7          direct index ( temp 2-component vector of float)
+0:7            'clip' ( out 2-element array of 2-component vector of float)
+0:7            Constant:
+0:7              0 (const int)
+0:7          Constant:
+0:7            1 (const int)
+0:7        Constant:
+0:7          0.600000
+0:8      move second child to first child ( temp float)
+0:8        direct index ( temp float)
+0:8          direct index ( temp 2-component vector of float)
+0:8            'clip' ( out 2-element array of 2-component vector of float)
+0:8            Constant:
+0:8              1 (const int)
+0:8          Constant:
+0:8            0 (const int)
+0:8        Constant:
+0:8          0.700000
+0:9      move second child to first child ( temp float)
+0:9        direct index ( temp float)
+0:9          direct index ( temp 2-component vector of float)
+0:9            'clip' ( out 2-element array of 2-component vector of float)
+0:9            Constant:
+0:9              1 (const int)
+0:9          Constant:
+0:9            1 (const int)
+0:9        Constant:
+0:9          0.800000
+0:11      move second child to first child ( temp float)
+0:11        direct index ( temp float)
+0:11          direct index ( temp 2-component vector of float)
+0:11            'cull' ( out 2-element array of 2-component vector of float)
+0:11            Constant:
+0:11              0 (const int)
+0:11          Constant:
+0:11            0 (const int)
+0:11        Constant:
+0:11          0.525000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          direct index ( temp 2-component vector of float)
+0:12            'cull' ( out 2-element array of 2-component vector of float)
+0:12            Constant:
+0:12              0 (const int)
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          0.625000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          direct index ( temp 2-component vector of float)
+0:13            'cull' ( out 2-element array of 2-component vector of float)
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.725000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          direct index ( temp 2-component vector of float)
+0:14            'cull' ( out 2-element array of 2-component vector of float)
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            1 (const int)
+0:14        Constant:
+0:14          0.825000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp 2-element array of 2-component vector of float)
+0:?         'cull' ( temp 2-element array of 2-component vector of float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              1 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              2 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'clip' ( out 4-element array of float ClipDistance)
+0:4            Constant:
+0:4              3 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'clip' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:?       Sequence
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              0 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              1 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                0 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              2 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              0 (const int)
+0:4        move second child to first child ( temp float)
+0:4          direct index ( temp float)
+0:?             'cull' ( out 4-element array of float CullDistance)
+0:4            Constant:
+0:4              3 (const int)
+0:4          direct index ( temp float)
+0:4            direct index ( temp 2-component vector of float)
+0:?               'cull' ( temp 2-element array of 2-component vector of float)
+0:4              Constant:
+0:4                1 (const int)
+0:4            Constant:
+0:4              1 (const int)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 4-element array of float ClipDistance)
+0:?     'cull' ( out 4-element array of float CullDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 89
+
+                              Capability Shader
+                              Capability ClipDistance
+                              Capability CullDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 55 60 76
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 18  "@main(vf4;vf2[2];vf2[2];"
+                              Name 15  "pos"
+                              Name 16  "clip"
+                              Name 17  "cull"
+                              Name 44  "pos"
+                              Name 45  "clip"
+                              Name 46  "cull"
+                              Name 47  "param"
+                              Name 48  "param"
+                              Name 49  "param"
+                              Name 55  "pos"
+                              Name 60  "clip"
+                              Name 76  "cull"
+                              Decorate 55(pos) BuiltIn Position
+                              Decorate 60(clip) BuiltIn ClipDistance
+                              Decorate 76(cull) BuiltIn CullDistance
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Function 7(fvec4)
+               9:             TypeVector 6(float) 2
+              10:             TypeInt 32 0
+              11:     10(int) Constant 2
+              12:             TypeArray 9(fvec2) 11
+              13:             TypePointer Function 12
+              14:             TypeFunction 2 8(ptr) 13(ptr) 13(ptr)
+              20:    6(float) Constant 1065353216
+              21:    7(fvec4) ConstantComposite 20 20 20 20
+              22:             TypeInt 32 1
+              23:     22(int) Constant 0
+              24:    6(float) Constant 1056964608
+              25:     10(int) Constant 0
+              26:             TypePointer Function 6(float)
+              28:    6(float) Constant 1058642330
+              29:     10(int) Constant 1
+              31:     22(int) Constant 1
+              32:    6(float) Constant 1060320051
+              34:    6(float) Constant 1061997773
+              36:    6(float) Constant 1057384038
+              38:    6(float) Constant 1059061760
+              40:    6(float) Constant 1060739482
+              42:    6(float) Constant 1062417203
+              54:             TypePointer Output 7(fvec4)
+         55(pos):     54(ptr) Variable Output
+              57:     10(int) Constant 4
+              58:             TypeArray 6(float) 57
+              59:             TypePointer Output 58
+        60(clip):     59(ptr) Variable Output
+              63:             TypePointer Output 6(float)
+              68:     22(int) Constant 2
+              72:     22(int) Constant 3
+        76(cull):     59(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+         44(pos):      8(ptr) Variable Function
+        45(clip):     13(ptr) Variable Function
+        46(cull):     13(ptr) Variable Function
+       47(param):      8(ptr) Variable Function
+       48(param):     13(ptr) Variable Function
+       49(param):     13(ptr) Variable Function
+              50:           2 FunctionCall 18(@main(vf4;vf2[2];vf2[2];) 47(param) 48(param) 49(param)
+              51:    7(fvec4) Load 47(param)
+                              Store 44(pos) 51
+              52:          12 Load 48(param)
+                              Store 45(clip) 52
+              53:          12 Load 49(param)
+                              Store 46(cull) 53
+              56:    7(fvec4) Load 44(pos)
+                              Store 55(pos) 56
+              61:     26(ptr) AccessChain 45(clip) 23 25
+              62:    6(float) Load 61
+              64:     63(ptr) AccessChain 60(clip) 23
+                              Store 64 62
+              65:     26(ptr) AccessChain 45(clip) 23 29
+              66:    6(float) Load 65
+              67:     63(ptr) AccessChain 60(clip) 31
+                              Store 67 66
+              69:     26(ptr) AccessChain 45(clip) 31 25
+              70:    6(float) Load 69
+              71:     63(ptr) AccessChain 60(clip) 68
+                              Store 71 70
+              73:     26(ptr) AccessChain 45(clip) 31 29
+              74:    6(float) Load 73
+              75:     63(ptr) AccessChain 60(clip) 72
+                              Store 75 74
+              77:     26(ptr) AccessChain 46(cull) 23 25
+              78:    6(float) Load 77
+              79:     63(ptr) AccessChain 76(cull) 23
+                              Store 79 78
+              80:     26(ptr) AccessChain 46(cull) 23 29
+              81:    6(float) Load 80
+              82:     63(ptr) AccessChain 76(cull) 31
+                              Store 82 81
+              83:     26(ptr) AccessChain 46(cull) 31 25
+              84:    6(float) Load 83
+              85:     63(ptr) AccessChain 76(cull) 68
+                              Store 85 84
+              86:     26(ptr) AccessChain 46(cull) 31 29
+              87:    6(float) Load 86
+              88:     63(ptr) AccessChain 76(cull) 72
+                              Store 88 87
+                              Return
+                              FunctionEnd
+18(@main(vf4;vf2[2];vf2[2];):           2 Function None 14
+         15(pos):      8(ptr) FunctionParameter
+        16(clip):     13(ptr) FunctionParameter
+        17(cull):     13(ptr) FunctionParameter
+              19:             Label
+                              Store 15(pos) 21
+              27:     26(ptr) AccessChain 16(clip) 23 25
+                              Store 27 24
+              30:     26(ptr) AccessChain 16(clip) 23 29
+                              Store 30 28
+              33:     26(ptr) AccessChain 16(clip) 31 25
+                              Store 33 32
+              35:     26(ptr) AccessChain 16(clip) 31 29
+                              Store 35 34
+              37:     26(ptr) AccessChain 17(cull) 23 25
+                              Store 37 36
+              39:     26(ptr) AccessChain 17(cull) 23 29
+                              Store 39 38
+              41:     26(ptr) AccessChain 17(cull) 31 25
+                              Store 41 40
+              43:     26(ptr) AccessChain 17(cull) 31 29
+                              Store 43 42
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-3.vert.out b/Test/baseResults/hlsl.clipdistance-3.vert.out
new file mode 100644
index 0000000..a301b34
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-3.vert.out
@@ -0,0 +1,229 @@
+hlsl.clipdistance-3.vert
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;f1[2];f1[2]; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out 2-element array of float)
+0:4      'cull' ( out 2-element array of float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        direct index ( temp float)
+0:6          'clip' ( out 2-element array of float)
+0:6          Constant:
+0:6            0 (const int)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        direct index ( temp float)
+0:7          'clip' ( out 2-element array of float)
+0:7          Constant:
+0:7            1 (const int)
+0:7        Constant:
+0:7          0.600000
+0:9      move second child to first child ( temp float)
+0:9        direct index ( temp float)
+0:9          'cull' ( out 2-element array of float)
+0:9          Constant:
+0:9            0 (const int)
+0:9        Constant:
+0:9          0.525000
+0:10      move second child to first child ( temp float)
+0:10        direct index ( temp float)
+0:10          'cull' ( out 2-element array of float)
+0:10          Constant:
+0:10            1 (const int)
+0:10        Constant:
+0:10          0.625000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;f1[2];f1[2]; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp 2-element array of float)
+0:?         'cull' ( temp 2-element array of float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp 2-element array of float)
+0:?           'clip' ( out 2-element array of float ClipDistance)
+0:?           'clip' ( temp 2-element array of float)
+0:?       Sequence
+0:4        move second child to first child ( temp 2-element array of float)
+0:?           'cull' ( out 2-element array of float CullDistance)
+0:?           'cull' ( temp 2-element array of float)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 2-element array of float ClipDistance)
+0:?     'cull' ( out 2-element array of float CullDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:4  Function Definition: @main(vf4;f1[2];f1[2]; ( temp void)
+0:4    Function Parameters: 
+0:4      'pos' ( out 4-component vector of float)
+0:4      'clip' ( out 2-element array of float)
+0:4      'cull' ( out 2-element array of float)
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:5        'pos' ( out 4-component vector of float)
+0:5        Constant:
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:5          1.000000
+0:6      move second child to first child ( temp float)
+0:6        direct index ( temp float)
+0:6          'clip' ( out 2-element array of float)
+0:6          Constant:
+0:6            0 (const int)
+0:6        Constant:
+0:6          0.500000
+0:7      move second child to first child ( temp float)
+0:7        direct index ( temp float)
+0:7          'clip' ( out 2-element array of float)
+0:7          Constant:
+0:7            1 (const int)
+0:7        Constant:
+0:7          0.600000
+0:9      move second child to first child ( temp float)
+0:9        direct index ( temp float)
+0:9          'cull' ( out 2-element array of float)
+0:9          Constant:
+0:9            0 (const int)
+0:9        Constant:
+0:9          0.525000
+0:10      move second child to first child ( temp float)
+0:10        direct index ( temp float)
+0:10          'cull' ( out 2-element array of float)
+0:10          Constant:
+0:10            1 (const int)
+0:10        Constant:
+0:10          0.625000
+0:4  Function Definition: main( ( temp void)
+0:4    Function Parameters: 
+0:?     Sequence
+0:4      Function Call: @main(vf4;f1[2];f1[2]; ( temp void)
+0:?         'pos' ( temp 4-component vector of float)
+0:?         'clip' ( temp 2-element array of float)
+0:?         'cull' ( temp 2-element array of float)
+0:4      move second child to first child ( temp 4-component vector of float)
+0:?         'pos' ( out 4-component vector of float Position)
+0:?         'pos' ( temp 4-component vector of float)
+0:?       Sequence
+0:4        move second child to first child ( temp 2-element array of float)
+0:?           'clip' ( out 2-element array of float ClipDistance)
+0:?           'clip' ( temp 2-element array of float)
+0:?       Sequence
+0:4        move second child to first child ( temp 2-element array of float)
+0:?           'cull' ( out 2-element array of float CullDistance)
+0:?           'cull' ( temp 2-element array of float)
+0:?   Linker Objects
+0:?     'pos' ( out 4-component vector of float Position)
+0:?     'clip' ( out 2-element array of float ClipDistance)
+0:?     'cull' ( out 2-element array of float CullDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 51
+
+                              Capability Shader
+                              Capability ClipDistance
+                              Capability CullDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 44 47 49
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 17  "@main(vf4;f1[2];f1[2];"
+                              Name 14  "pos"
+                              Name 15  "clip"
+                              Name 16  "cull"
+                              Name 33  "pos"
+                              Name 34  "clip"
+                              Name 35  "cull"
+                              Name 36  "param"
+                              Name 37  "param"
+                              Name 38  "param"
+                              Name 44  "pos"
+                              Name 47  "clip"
+                              Name 49  "cull"
+                              Decorate 44(pos) BuiltIn Position
+                              Decorate 47(clip) BuiltIn ClipDistance
+                              Decorate 49(cull) BuiltIn CullDistance
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Function 7(fvec4)
+               9:             TypeInt 32 0
+              10:      9(int) Constant 2
+              11:             TypeArray 6(float) 10
+              12:             TypePointer Function 11
+              13:             TypeFunction 2 8(ptr) 12(ptr) 12(ptr)
+              19:    6(float) Constant 1065353216
+              20:    7(fvec4) ConstantComposite 19 19 19 19
+              21:             TypeInt 32 1
+              22:     21(int) Constant 0
+              23:    6(float) Constant 1056964608
+              24:             TypePointer Function 6(float)
+              26:     21(int) Constant 1
+              27:    6(float) Constant 1058642330
+              29:    6(float) Constant 1057384038
+              31:    6(float) Constant 1059061760
+              43:             TypePointer Output 7(fvec4)
+         44(pos):     43(ptr) Variable Output
+              46:             TypePointer Output 11
+        47(clip):     46(ptr) Variable Output
+        49(cull):     46(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+         33(pos):      8(ptr) Variable Function
+        34(clip):     12(ptr) Variable Function
+        35(cull):     12(ptr) Variable Function
+       36(param):      8(ptr) Variable Function
+       37(param):     12(ptr) Variable Function
+       38(param):     12(ptr) Variable Function
+              39:           2 FunctionCall 17(@main(vf4;f1[2];f1[2];) 36(param) 37(param) 38(param)
+              40:    7(fvec4) Load 36(param)
+                              Store 33(pos) 40
+              41:          11 Load 37(param)
+                              Store 34(clip) 41
+              42:          11 Load 38(param)
+                              Store 35(cull) 42
+              45:    7(fvec4) Load 33(pos)
+                              Store 44(pos) 45
+              48:          11 Load 34(clip)
+                              Store 47(clip) 48
+              50:          11 Load 35(cull)
+                              Store 49(cull) 50
+                              Return
+                              FunctionEnd
+17(@main(vf4;f1[2];f1[2];):           2 Function None 13
+         14(pos):      8(ptr) FunctionParameter
+        15(clip):     12(ptr) FunctionParameter
+        16(cull):     12(ptr) FunctionParameter
+              18:             Label
+                              Store 14(pos) 20
+              25:     24(ptr) AccessChain 15(clip) 22
+                              Store 25 23
+              28:     24(ptr) AccessChain 15(clip) 26
+                              Store 28 27
+              30:     24(ptr) AccessChain 16(cull) 22
+                              Store 30 29
+              32:     24(ptr) AccessChain 16(cull) 26
+                              Store 32 31
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-4.vert.out b/Test/baseResults/hlsl.clipdistance-4.vert.out
new file mode 100644
index 0000000..acb1100
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-4.vert.out
@@ -0,0 +1,388 @@
+hlsl.clipdistance-4.vert
+Shader version: 500
+0:? Sequence
+0:11  Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11    Function Parameters: 
+0:11      'v' ( const (read only) structure{ temp 4-component vector of float Position})
+0:?     Sequence
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        Position: direct index for structure ( temp 4-component vector of float)
+0:13          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:15            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:15            Constant:
+0:15              1 (const int)
+0:15          Constant:
+0:15            0 (const int)
+0:15        Constant:
+0:15          1.000000
+0:16      move second child to first child ( temp float)
+0:16        direct index ( temp float)
+0:16          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:16            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:16            Constant:
+0:16              1 (const int)
+0:16          Constant:
+0:16            1 (const int)
+0:16        Constant:
+0:16          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:17            Constant:
+0:17              1 (const int)
+0:17          Constant:
+0:17            2 (const int)
+0:17        Constant:
+0:17          3.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:18            Constant:
+0:18              1 (const int)
+0:18          Constant:
+0:18            3 (const int)
+0:18        Constant:
+0:18          4.000000
+0:20      Branch: Return with expression
+0:20        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11  Function Definition: main( ( temp void)
+0:11    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:11        move second child to first child ( temp 4-component vector of float)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11            Constant:
+0:11              0 (const int)
+0:?           'Position' (layout( location=0) in 4-component vector of float)
+0:11      Sequence
+0:11        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11          Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:11            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11            Constant:
+0:11              0 (const int)
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                0 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                1 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                2 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                2 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                3 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'Position' (layout( location=0) in 4-component vector of float)
+0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:11  Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11    Function Parameters: 
+0:11      'v' ( const (read only) structure{ temp 4-component vector of float Position})
+0:?     Sequence
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        Position: direct index for structure ( temp 4-component vector of float)
+0:13          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:15            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:15            Constant:
+0:15              1 (const int)
+0:15          Constant:
+0:15            0 (const int)
+0:15        Constant:
+0:15          1.000000
+0:16      move second child to first child ( temp float)
+0:16        direct index ( temp float)
+0:16          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:16            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:16            Constant:
+0:16              1 (const int)
+0:16          Constant:
+0:16            1 (const int)
+0:16        Constant:
+0:16          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:17            Constant:
+0:17              1 (const int)
+0:17          Constant:
+0:17            2 (const int)
+0:17        Constant:
+0:17          3.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          ClipRect: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:18            Constant:
+0:18              1 (const int)
+0:18          Constant:
+0:18            3 (const int)
+0:18        Constant:
+0:18          4.000000
+0:20      Branch: Return with expression
+0:20        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11  Function Definition: main( ( temp void)
+0:11    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:11        move second child to first child ( temp 4-component vector of float)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11            Constant:
+0:11              0 (const int)
+0:?           'Position' (layout( location=0) in 4-component vector of float)
+0:11      Sequence
+0:11        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11          Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:11            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11            Constant:
+0:11              0 (const int)
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                0 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                1 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                2 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                2 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                3 (const int)
+0:11            direct index ( temp float)
+0:11              ClipRect: direct index for structure ( temp 4-component vector of float)
+0:11                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float ClipRect})
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'Position' (layout( location=0) in 4-component vector of float)
+0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 75
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 43 50 56 74
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "VS_INPUT"
+                              MemberName 8(VS_INPUT) 0  "Position"
+                              Name 9  "VS_OUTPUT"
+                              MemberName 9(VS_OUTPUT) 0  "Position"
+                              MemberName 9(VS_OUTPUT) 1  "ClipRect"
+                              Name 12  "@main(struct-VS_INPUT-vf41;"
+                              Name 11  "v"
+                              Name 15  "Output"
+                              Name 41  "v"
+                              Name 43  "Position"
+                              Name 46  "flattenTemp"
+                              Name 50  "@entryPointOutput_Position"
+                              Name 56  "@entryPointOutput_ClipRect"
+                              Name 72  "VS_OUTPUT"
+                              Name 74  "@entryPointOutput"
+                              Decorate 43(Position) Location 0
+                              Decorate 50(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 56(@entryPointOutput_ClipRect) BuiltIn ClipDistance
+                              Decorate 74(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+     8(VS_INPUT):             TypeStruct 7(fvec4)
+    9(VS_OUTPUT):             TypeStruct 7(fvec4) 7(fvec4)
+              10:             TypeFunction 9(VS_OUTPUT) 8(VS_INPUT)
+              14:             TypePointer Function 9(VS_OUTPUT)
+              16:             TypeInt 32 1
+              17:     16(int) Constant 0
+              18:    6(float) Constant 0
+              19:    7(fvec4) ConstantComposite 18 18 18 18
+              20:             TypePointer Function 7(fvec4)
+              22:     16(int) Constant 1
+              23:    6(float) Constant 1065353216
+              24:             TypeInt 32 0
+              25:     24(int) Constant 0
+              26:             TypePointer Function 6(float)
+              28:    6(float) Constant 1073741824
+              29:     24(int) Constant 1
+              31:    6(float) Constant 1077936128
+              32:     24(int) Constant 2
+              34:    6(float) Constant 1082130432
+              35:     24(int) Constant 3
+              40:             TypePointer Function 8(VS_INPUT)
+              42:             TypePointer Input 7(fvec4)
+    43(Position):     42(ptr) Variable Input
+              49:             TypePointer Output 7(fvec4)
+50(@entryPointOutput_Position):     49(ptr) Variable Output
+              53:     24(int) Constant 4
+              54:             TypeArray 6(float) 53
+              55:             TypePointer Output 54
+56(@entryPointOutput_ClipRect):     55(ptr) Variable Output
+              59:             TypePointer Output 6(float)
+              64:     16(int) Constant 2
+              68:     16(int) Constant 3
+   72(VS_OUTPUT):             TypeStruct
+              73:             TypePointer Output 72(VS_OUTPUT)
+74(@entryPointOutput):     73(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+           41(v):     40(ptr) Variable Function
+ 46(flattenTemp):     14(ptr) Variable Function
+              44:    7(fvec4) Load 43(Position)
+              45:     20(ptr) AccessChain 41(v) 17
+                              Store 45 44
+              47: 8(VS_INPUT) Load 41(v)
+              48:9(VS_OUTPUT) FunctionCall 12(@main(struct-VS_INPUT-vf41;) 47
+                              Store 46(flattenTemp) 48
+              51:     20(ptr) AccessChain 46(flattenTemp) 17
+              52:    7(fvec4) Load 51
+                              Store 50(@entryPointOutput_Position) 52
+              57:     26(ptr) AccessChain 46(flattenTemp) 22 25
+              58:    6(float) Load 57
+              60:     59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 17
+                              Store 60 58
+              61:     26(ptr) AccessChain 46(flattenTemp) 22 29
+              62:    6(float) Load 61
+              63:     59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 22
+                              Store 63 62
+              65:     26(ptr) AccessChain 46(flattenTemp) 22 32
+              66:    6(float) Load 65
+              67:     59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 64
+                              Store 67 66
+              69:     26(ptr) AccessChain 46(flattenTemp) 22 35
+              70:    6(float) Load 69
+              71:     59(ptr) AccessChain 56(@entryPointOutput_ClipRect) 68
+                              Store 71 70
+                              Return
+                              FunctionEnd
+12(@main(struct-VS_INPUT-vf41;):9(VS_OUTPUT) Function None 10
+           11(v): 8(VS_INPUT) FunctionParameter
+              13:             Label
+      15(Output):     14(ptr) Variable Function
+              21:     20(ptr) AccessChain 15(Output) 17
+                              Store 21 19
+              27:     26(ptr) AccessChain 15(Output) 22 25
+                              Store 27 23
+              30:     26(ptr) AccessChain 15(Output) 22 29
+                              Store 30 28
+              33:     26(ptr) AccessChain 15(Output) 22 32
+                              Store 33 31
+              36:     26(ptr) AccessChain 15(Output) 22 35
+                              Store 36 34
+              37:9(VS_OUTPUT) Load 15(Output)
+                              ReturnValue 37
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-5.vert.out b/Test/baseResults/hlsl.clipdistance-5.vert.out
new file mode 100644
index 0000000..643a678
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-5.vert.out
@@ -0,0 +1,437 @@
+hlsl.clipdistance-5.vert
+Shader version: 500
+0:? Sequence
+0:11  Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11    Function Parameters: 
+0:11      'v' ( const (read only) structure{ temp 4-component vector of float Position})
+0:?     Sequence
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        Position: direct index for structure ( temp 4-component vector of float)
+0:13          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          direct index ( temp 2-component vector of float)
+0:15            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:15              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:15              Constant:
+0:15                1 (const int)
+0:15            Constant:
+0:15              0 (const int)
+0:15          Constant:
+0:15            0 (const int)
+0:15        Constant:
+0:15          1.000000
+0:16      move second child to first child ( temp float)
+0:16        direct index ( temp float)
+0:16          direct index ( temp 2-component vector of float)
+0:16            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:16              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:16              Constant:
+0:16                1 (const int)
+0:16            Constant:
+0:16              0 (const int)
+0:16          Constant:
+0:16            1 (const int)
+0:16        Constant:
+0:16          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          direct index ( temp 2-component vector of float)
+0:17            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:17              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:17              Constant:
+0:17                1 (const int)
+0:17            Constant:
+0:17              1 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          3.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          direct index ( temp 2-component vector of float)
+0:18            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:18              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:18              Constant:
+0:18                1 (const int)
+0:18            Constant:
+0:18              1 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          4.000000
+0:20      Branch: Return with expression
+0:20        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11  Function Definition: main( ( temp void)
+0:11    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:11        move second child to first child ( temp 4-component vector of float)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11            Constant:
+0:11              0 (const int)
+0:?           'Position' (layout( location=0) in 4-component vector of float)
+0:11      Sequence
+0:11        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11          Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:11            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11            Constant:
+0:11              0 (const int)
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                0 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  0 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                1 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  0 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                2 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                3 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'Position' (layout( location=0) in 4-component vector of float)
+0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:11  Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11    Function Parameters: 
+0:11      'v' ( const (read only) structure{ temp 4-component vector of float Position})
+0:?     Sequence
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        Position: direct index for structure ( temp 4-component vector of float)
+0:13          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:13          0.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          direct index ( temp 2-component vector of float)
+0:15            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:15              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:15              Constant:
+0:15                1 (const int)
+0:15            Constant:
+0:15              0 (const int)
+0:15          Constant:
+0:15            0 (const int)
+0:15        Constant:
+0:15          1.000000
+0:16      move second child to first child ( temp float)
+0:16        direct index ( temp float)
+0:16          direct index ( temp 2-component vector of float)
+0:16            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:16              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:16              Constant:
+0:16                1 (const int)
+0:16            Constant:
+0:16              0 (const int)
+0:16          Constant:
+0:16            1 (const int)
+0:16        Constant:
+0:16          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          direct index ( temp 2-component vector of float)
+0:17            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:17              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:17              Constant:
+0:17                1 (const int)
+0:17            Constant:
+0:17              1 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          3.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          direct index ( temp 2-component vector of float)
+0:18            ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:18              'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:18              Constant:
+0:18                1 (const int)
+0:18            Constant:
+0:18              1 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          4.000000
+0:20      Branch: Return with expression
+0:20        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11  Function Definition: main( ( temp void)
+0:11    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:11        move second child to first child ( temp 4-component vector of float)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11            Constant:
+0:11              0 (const int)
+0:?           'Position' (layout( location=0) in 4-component vector of float)
+0:11      Sequence
+0:11        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11          Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:?             'v' ( temp structure{ temp 4-component vector of float Position})
+0:11        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:11          Position: direct index for structure ( temp 4-component vector of float)
+0:11            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11            Constant:
+0:11              0 (const int)
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                0 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  0 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                1 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  0 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                2 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                0 (const int)
+0:11          move second child to first child ( temp float)
+0:11            direct index ( temp float)
+0:?               '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+0:11              Constant:
+0:11                3 (const int)
+0:11            direct index ( temp float)
+0:11              direct index ( temp 2-component vector of float)
+0:11                ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float)
+0:11                  'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 2-element array of 2-component vector of float ClipRect})
+0:11                  Constant:
+0:11                    1 (const int)
+0:11                Constant:
+0:11                  1 (const int)
+0:11              Constant:
+0:11                1 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'Position' (layout( location=0) in 4-component vector of float)
+0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 76
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 44 51 57 75
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "VS_INPUT"
+                              MemberName 8(VS_INPUT) 0  "Position"
+                              Name 13  "VS_OUTPUT"
+                              MemberName 13(VS_OUTPUT) 0  "Position"
+                              MemberName 13(VS_OUTPUT) 1  "ClipRect"
+                              Name 16  "@main(struct-VS_INPUT-vf41;"
+                              Name 15  "v"
+                              Name 19  "Output"
+                              Name 42  "v"
+                              Name 44  "Position"
+                              Name 47  "flattenTemp"
+                              Name 51  "@entryPointOutput_Position"
+                              Name 57  "@entryPointOutput_ClipRect"
+                              Name 73  "VS_OUTPUT"
+                              Name 75  "@entryPointOutput"
+                              Decorate 44(Position) Location 0
+                              Decorate 51(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 57(@entryPointOutput_ClipRect) BuiltIn ClipDistance
+                              Decorate 75(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+     8(VS_INPUT):             TypeStruct 7(fvec4)
+               9:             TypeVector 6(float) 2
+              10:             TypeInt 32 0
+              11:     10(int) Constant 2
+              12:             TypeArray 9(fvec2) 11
+   13(VS_OUTPUT):             TypeStruct 7(fvec4) 12
+              14:             TypeFunction 13(VS_OUTPUT) 8(VS_INPUT)
+              18:             TypePointer Function 13(VS_OUTPUT)
+              20:             TypeInt 32 1
+              21:     20(int) Constant 0
+              22:    6(float) Constant 0
+              23:    7(fvec4) ConstantComposite 22 22 22 22
+              24:             TypePointer Function 7(fvec4)
+              26:     20(int) Constant 1
+              27:    6(float) Constant 1065353216
+              28:     10(int) Constant 0
+              29:             TypePointer Function 6(float)
+              31:    6(float) Constant 1073741824
+              32:     10(int) Constant 1
+              34:    6(float) Constant 1077936128
+              36:    6(float) Constant 1082130432
+              41:             TypePointer Function 8(VS_INPUT)
+              43:             TypePointer Input 7(fvec4)
+    44(Position):     43(ptr) Variable Input
+              50:             TypePointer Output 7(fvec4)
+51(@entryPointOutput_Position):     50(ptr) Variable Output
+              54:     10(int) Constant 4
+              55:             TypeArray 6(float) 54
+              56:             TypePointer Output 55
+57(@entryPointOutput_ClipRect):     56(ptr) Variable Output
+              60:             TypePointer Output 6(float)
+              65:     20(int) Constant 2
+              69:     20(int) Constant 3
+   73(VS_OUTPUT):             TypeStruct
+              74:             TypePointer Output 73(VS_OUTPUT)
+75(@entryPointOutput):     74(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+           42(v):     41(ptr) Variable Function
+ 47(flattenTemp):     18(ptr) Variable Function
+              45:    7(fvec4) Load 44(Position)
+              46:     24(ptr) AccessChain 42(v) 21
+                              Store 46 45
+              48: 8(VS_INPUT) Load 42(v)
+              49:13(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-vf41;) 48
+                              Store 47(flattenTemp) 49
+              52:     24(ptr) AccessChain 47(flattenTemp) 21
+              53:    7(fvec4) Load 52
+                              Store 51(@entryPointOutput_Position) 53
+              58:     29(ptr) AccessChain 47(flattenTemp) 26 21 28
+              59:    6(float) Load 58
+              61:     60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 21
+                              Store 61 59
+              62:     29(ptr) AccessChain 47(flattenTemp) 26 21 32
+              63:    6(float) Load 62
+              64:     60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 26
+                              Store 64 63
+              66:     29(ptr) AccessChain 47(flattenTemp) 26 26 28
+              67:    6(float) Load 66
+              68:     60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 65
+                              Store 68 67
+              70:     29(ptr) AccessChain 47(flattenTemp) 26 26 32
+              71:    6(float) Load 70
+              72:     60(ptr) AccessChain 57(@entryPointOutput_ClipRect) 69
+                              Store 72 71
+                              Return
+                              FunctionEnd
+16(@main(struct-VS_INPUT-vf41;):13(VS_OUTPUT) Function None 14
+           15(v): 8(VS_INPUT) FunctionParameter
+              17:             Label
+      19(Output):     18(ptr) Variable Function
+              25:     24(ptr) AccessChain 19(Output) 21
+                              Store 25 23
+              30:     29(ptr) AccessChain 19(Output) 26 21 28
+                              Store 30 27
+              33:     29(ptr) AccessChain 19(Output) 26 21 32
+                              Store 33 31
+              35:     29(ptr) AccessChain 19(Output) 26 26 28
+                              Store 35 34
+              37:     29(ptr) AccessChain 19(Output) 26 26 32
+                              Store 37 36
+              38:13(VS_OUTPUT) Load 19(Output)
+                              ReturnValue 38
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-6.vert.out b/Test/baseResults/hlsl.clipdistance-6.vert.out
new file mode 100644
index 0000000..efce796
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-6.vert.out
@@ -0,0 +1,562 @@
+hlsl.clipdistance-6.vert
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 4-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 4-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 4-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          clip0: direct index for structure ( temp 4-component vector of float)
+0:15            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:15            Constant:
+0:15              1 (const int)
+0:15          Constant:
+0:15            3 (const int)
+0:15        Constant:
+0:15          3.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          clip1: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:17            Constant:
+0:17              2 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          4.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          clip1: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:18            Constant:
+0:18              2 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          5.000000
+0:19      move second child to first child ( temp float)
+0:19        direct index ( temp float)
+0:19          clip1: direct index for structure ( temp 4-component vector of float)
+0:19            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:19            Constant:
+0:19              2 (const int)
+0:19          Constant:
+0:19            2 (const int)
+0:19        Constant:
+0:19          6.000000
+0:20      move second child to first child ( temp float)
+0:20        direct index ( temp float)
+0:20          clip1: direct index for structure ( temp 4-component vector of float)
+0:20            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:20            Constant:
+0:20              2 (const int)
+0:20          Constant:
+0:20            3 (const int)
+0:20        Constant:
+0:20          7.000000
+0:22      Branch: Return with expression
+0:22        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                3 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                4 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                5 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                6 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                7 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 4-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 4-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 4-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:15      move second child to first child ( temp float)
+0:15        direct index ( temp float)
+0:15          clip0: direct index for structure ( temp 4-component vector of float)
+0:15            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:15            Constant:
+0:15              1 (const int)
+0:15          Constant:
+0:15            3 (const int)
+0:15        Constant:
+0:15          3.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          clip1: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:17            Constant:
+0:17              2 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          4.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          clip1: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:18            Constant:
+0:18              2 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          5.000000
+0:19      move second child to first child ( temp float)
+0:19        direct index ( temp float)
+0:19          clip1: direct index for structure ( temp 4-component vector of float)
+0:19            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:19            Constant:
+0:19              2 (const int)
+0:19          Constant:
+0:19            2 (const int)
+0:19        Constant:
+0:19          6.000000
+0:20      move second child to first child ( temp float)
+0:20        direct index ( temp float)
+0:20          clip1: direct index for structure ( temp 4-component vector of float)
+0:20            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:20            Constant:
+0:20              2 (const int)
+0:20          Constant:
+0:20            3 (const int)
+0:20        Constant:
+0:20          7.000000
+0:22      Branch: Return with expression
+0:22        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                3 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                4 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                5 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                6 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                7 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 4-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 89
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 49 55 88
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "VS_OUTPUT"
+                              MemberName 8(VS_OUTPUT) 0  "Position"
+                              MemberName 8(VS_OUTPUT) 1  "clip0"
+                              MemberName 8(VS_OUTPUT) 2  "clip1"
+                              Name 10  "@main("
+                              Name 13  "Output"
+                              Name 46  "flattenTemp"
+                              Name 49  "@entryPointOutput_Position"
+                              Name 55  "@entryPointOutput_clip1"
+                              Name 86  "VS_OUTPUT"
+                              Name 88  "@entryPointOutput"
+                              Decorate 49(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 55(@entryPointOutput_clip1) BuiltIn ClipDistance
+                              Decorate 88(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+    8(VS_OUTPUT):             TypeStruct 7(fvec4) 7(fvec4) 7(fvec4)
+               9:             TypeFunction 8(VS_OUTPUT)
+              12:             TypePointer Function 8(VS_OUTPUT)
+              14:             TypeInt 32 1
+              15:     14(int) Constant 0
+              16:    6(float) Constant 0
+              17:    7(fvec4) ConstantComposite 16 16 16 16
+              18:             TypePointer Function 7(fvec4)
+              20:     14(int) Constant 1
+              21:             TypeInt 32 0
+              22:     21(int) Constant 0
+              23:             TypePointer Function 6(float)
+              25:    6(float) Constant 1065353216
+              26:     21(int) Constant 1
+              28:    6(float) Constant 1073741824
+              29:     21(int) Constant 2
+              31:    6(float) Constant 1077936128
+              32:     21(int) Constant 3
+              34:     14(int) Constant 2
+              35:    6(float) Constant 1082130432
+              37:    6(float) Constant 1084227584
+              39:    6(float) Constant 1086324736
+              41:    6(float) Constant 1088421888
+              48:             TypePointer Output 7(fvec4)
+49(@entryPointOutput_Position):     48(ptr) Variable Output
+              52:     21(int) Constant 8
+              53:             TypeArray 6(float) 52
+              54:             TypePointer Output 53
+55(@entryPointOutput_clip1):     54(ptr) Variable Output
+              58:             TypePointer Output 6(float)
+              66:     14(int) Constant 3
+              70:     14(int) Constant 4
+              74:     14(int) Constant 5
+              78:     14(int) Constant 6
+              82:     14(int) Constant 7
+   86(VS_OUTPUT):             TypeStruct
+              87:             TypePointer Output 86(VS_OUTPUT)
+88(@entryPointOutput):     87(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+ 46(flattenTemp):     12(ptr) Variable Function
+              47:8(VS_OUTPUT) FunctionCall 10(@main()
+                              Store 46(flattenTemp) 47
+              50:     18(ptr) AccessChain 46(flattenTemp) 15
+              51:    7(fvec4) Load 50
+                              Store 49(@entryPointOutput_Position) 51
+              56:     23(ptr) AccessChain 46(flattenTemp) 20 22
+              57:    6(float) Load 56
+              59:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 15
+                              Store 59 57
+              60:     23(ptr) AccessChain 46(flattenTemp) 20 26
+              61:    6(float) Load 60
+              62:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 20
+                              Store 62 61
+              63:     23(ptr) AccessChain 46(flattenTemp) 20 29
+              64:    6(float) Load 63
+              65:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 34
+                              Store 65 64
+              67:     23(ptr) AccessChain 46(flattenTemp) 20 32
+              68:    6(float) Load 67
+              69:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 66
+                              Store 69 68
+              71:     23(ptr) AccessChain 46(flattenTemp) 34 22
+              72:    6(float) Load 71
+              73:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 70
+                              Store 73 72
+              75:     23(ptr) AccessChain 46(flattenTemp) 34 26
+              76:    6(float) Load 75
+              77:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 74
+                              Store 77 76
+              79:     23(ptr) AccessChain 46(flattenTemp) 34 29
+              80:    6(float) Load 79
+              81:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 78
+                              Store 81 80
+              83:     23(ptr) AccessChain 46(flattenTemp) 34 32
+              84:    6(float) Load 83
+              85:     58(ptr) AccessChain 55(@entryPointOutput_clip1) 82
+                              Store 85 84
+                              Return
+                              FunctionEnd
+      10(@main():8(VS_OUTPUT) Function None 9
+              11:             Label
+      13(Output):     12(ptr) Variable Function
+              19:     18(ptr) AccessChain 13(Output) 15
+                              Store 19 17
+              24:     23(ptr) AccessChain 13(Output) 20 22
+                              Store 24 16
+              27:     23(ptr) AccessChain 13(Output) 20 26
+                              Store 27 25
+              30:     23(ptr) AccessChain 13(Output) 20 29
+                              Store 30 28
+              33:     23(ptr) AccessChain 13(Output) 20 32
+                              Store 33 31
+              36:     23(ptr) AccessChain 13(Output) 34 22
+                              Store 36 35
+              38:     23(ptr) AccessChain 13(Output) 34 26
+                              Store 38 37
+              40:     23(ptr) AccessChain 13(Output) 34 29
+                              Store 40 39
+              42:     23(ptr) AccessChain 13(Output) 34 32
+                              Store 42 41
+              43:8(VS_OUTPUT) Load 13(Output)
+                              ReturnValue 43
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-7.vert.out b/Test/baseResults/hlsl.clipdistance-7.vert.out
new file mode 100644
index 0000000..324320b
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-7.vert.out
@@ -0,0 +1,511 @@
+hlsl.clipdistance-7.vert
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 3-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 3-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 3-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          clip1: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:17            Constant:
+0:17              2 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          4.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          clip1: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:18            Constant:
+0:18              2 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          5.000000
+0:19      move second child to first child ( temp float)
+0:19        direct index ( temp float)
+0:19          clip1: direct index for structure ( temp 4-component vector of float)
+0:19            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:19            Constant:
+0:19              2 (const int)
+0:19          Constant:
+0:19            2 (const int)
+0:19        Constant:
+0:19          6.000000
+0:20      move second child to first child ( temp float)
+0:20        direct index ( temp float)
+0:20          clip1: direct index for structure ( temp 4-component vector of float)
+0:20            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:20            Constant:
+0:20              2 (const int)
+0:20          Constant:
+0:20            3 (const int)
+0:20        Constant:
+0:20          7.000000
+0:22      Branch: Return with expression
+0:22        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                4 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                5 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                6 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                7 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 3-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 3-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 3-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:17      move second child to first child ( temp float)
+0:17        direct index ( temp float)
+0:17          clip1: direct index for structure ( temp 4-component vector of float)
+0:17            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:17            Constant:
+0:17              2 (const int)
+0:17          Constant:
+0:17            0 (const int)
+0:17        Constant:
+0:17          4.000000
+0:18      move second child to first child ( temp float)
+0:18        direct index ( temp float)
+0:18          clip1: direct index for structure ( temp 4-component vector of float)
+0:18            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:18            Constant:
+0:18              2 (const int)
+0:18          Constant:
+0:18            1 (const int)
+0:18        Constant:
+0:18          5.000000
+0:19      move second child to first child ( temp float)
+0:19        direct index ( temp float)
+0:19          clip1: direct index for structure ( temp 4-component vector of float)
+0:19            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:19            Constant:
+0:19              2 (const int)
+0:19          Constant:
+0:19            2 (const int)
+0:19        Constant:
+0:19          6.000000
+0:20      move second child to first child ( temp float)
+0:20        direct index ( temp float)
+0:20          clip1: direct index for structure ( temp 4-component vector of float)
+0:20            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:20            Constant:
+0:20              2 (const int)
+0:20          Constant:
+0:20            3 (const int)
+0:20        Constant:
+0:20          7.000000
+0:22      Branch: Return with expression
+0:22        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                4 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                5 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                6 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+0:8              Constant:
+0:8                7 (const int)
+0:8            direct index ( temp float)
+0:8              clip1: direct index for structure ( temp 4-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp 4-component vector of float clip1})
+0:8                Constant:
+0:8                  2 (const int)
+0:8              Constant:
+0:8                3 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 84
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 48 54 83
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "VS_OUTPUT"
+                              MemberName 9(VS_OUTPUT) 0  "Position"
+                              MemberName 9(VS_OUTPUT) 1  "clip0"
+                              MemberName 9(VS_OUTPUT) 2  "clip1"
+                              Name 11  "@main("
+                              Name 14  "Output"
+                              Name 45  "flattenTemp"
+                              Name 48  "@entryPointOutput_Position"
+                              Name 54  "@entryPointOutput_clip1"
+                              Name 81  "VS_OUTPUT"
+                              Name 83  "@entryPointOutput"
+                              Decorate 48(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 54(@entryPointOutput_clip1) BuiltIn ClipDistance
+                              Decorate 83(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeVector 6(float) 3
+    9(VS_OUTPUT):             TypeStruct 7(fvec4) 8(fvec3) 7(fvec4)
+              10:             TypeFunction 9(VS_OUTPUT)
+              13:             TypePointer Function 9(VS_OUTPUT)
+              15:             TypeInt 32 1
+              16:     15(int) Constant 0
+              17:    6(float) Constant 0
+              18:    7(fvec4) ConstantComposite 17 17 17 17
+              19:             TypePointer Function 7(fvec4)
+              21:     15(int) Constant 1
+              22:             TypeInt 32 0
+              23:     22(int) Constant 0
+              24:             TypePointer Function 6(float)
+              26:    6(float) Constant 1065353216
+              27:     22(int) Constant 1
+              29:    6(float) Constant 1073741824
+              30:     22(int) Constant 2
+              32:     15(int) Constant 2
+              33:    6(float) Constant 1082130432
+              35:    6(float) Constant 1084227584
+              37:    6(float) Constant 1086324736
+              39:    6(float) Constant 1088421888
+              40:     22(int) Constant 3
+              47:             TypePointer Output 7(fvec4)
+48(@entryPointOutput_Position):     47(ptr) Variable Output
+              51:     22(int) Constant 8
+              52:             TypeArray 6(float) 51
+              53:             TypePointer Output 52
+54(@entryPointOutput_clip1):     53(ptr) Variable Output
+              57:             TypePointer Output 6(float)
+              65:     15(int) Constant 4
+              69:     15(int) Constant 5
+              73:     15(int) Constant 6
+              77:     15(int) Constant 7
+   81(VS_OUTPUT):             TypeStruct
+              82:             TypePointer Output 81(VS_OUTPUT)
+83(@entryPointOutput):     82(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+ 45(flattenTemp):     13(ptr) Variable Function
+              46:9(VS_OUTPUT) FunctionCall 11(@main()
+                              Store 45(flattenTemp) 46
+              49:     19(ptr) AccessChain 45(flattenTemp) 16
+              50:    7(fvec4) Load 49
+                              Store 48(@entryPointOutput_Position) 50
+              55:     24(ptr) AccessChain 45(flattenTemp) 21 23
+              56:    6(float) Load 55
+              58:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 16
+                              Store 58 56
+              59:     24(ptr) AccessChain 45(flattenTemp) 21 27
+              60:    6(float) Load 59
+              61:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 21
+                              Store 61 60
+              62:     24(ptr) AccessChain 45(flattenTemp) 21 30
+              63:    6(float) Load 62
+              64:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 32
+                              Store 64 63
+              66:     24(ptr) AccessChain 45(flattenTemp) 32 23
+              67:    6(float) Load 66
+              68:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 65
+                              Store 68 67
+              70:     24(ptr) AccessChain 45(flattenTemp) 32 27
+              71:    6(float) Load 70
+              72:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 69
+                              Store 72 71
+              74:     24(ptr) AccessChain 45(flattenTemp) 32 30
+              75:    6(float) Load 74
+              76:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 73
+                              Store 76 75
+              78:     24(ptr) AccessChain 45(flattenTemp) 32 40
+              79:    6(float) Load 78
+              80:     57(ptr) AccessChain 54(@entryPointOutput_clip1) 77
+                              Store 80 79
+                              Return
+                              FunctionEnd
+      11(@main():9(VS_OUTPUT) Function None 10
+              12:             Label
+      14(Output):     13(ptr) Variable Function
+              20:     19(ptr) AccessChain 14(Output) 16
+                              Store 20 18
+              25:     24(ptr) AccessChain 14(Output) 21 23
+                              Store 25 17
+              28:     24(ptr) AccessChain 14(Output) 21 27
+                              Store 28 26
+              31:     24(ptr) AccessChain 14(Output) 21 30
+                              Store 31 29
+              34:     24(ptr) AccessChain 14(Output) 32 23
+                              Store 34 33
+              36:     24(ptr) AccessChain 14(Output) 32 27
+                              Store 36 35
+              38:     24(ptr) AccessChain 14(Output) 32 30
+                              Store 38 37
+              41:     24(ptr) AccessChain 14(Output) 32 40
+                              Store 41 39
+              42:9(VS_OUTPUT) Load 14(Output)
+                              ReturnValue 42
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-8.vert.out b/Test/baseResults/hlsl.clipdistance-8.vert.out
new file mode 100644
index 0000000..94750b1
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-8.vert.out
@@ -0,0 +1,342 @@
+hlsl.clipdistance-8.vert
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 3-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 3-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 3-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:17      move second child to first child ( temp float)
+0:17        clip1: direct index for structure ( temp float)
+0:17          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:17          Constant:
+0:17            2 (const int)
+0:17        Constant:
+0:17          3.000000
+0:19      Branch: Return with expression
+0:19        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                3 (const int)
+0:8            clip1: direct index for structure ( temp float)
+0:8              'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8              Constant:
+0:8                2 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:8  Function Definition: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:10        Position: direct index for structure ( temp 4-component vector of float)
+0:10          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:10          Constant:
+0:10            0 (const int)
+0:10        Constant:
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:10          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          clip0: direct index for structure ( temp 3-component vector of float)
+0:12            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:12            Constant:
+0:12              1 (const int)
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          0.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          clip0: direct index for structure ( temp 3-component vector of float)
+0:13            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:13            Constant:
+0:13              1 (const int)
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          1.000000
+0:14      move second child to first child ( temp float)
+0:14        direct index ( temp float)
+0:14          clip0: direct index for structure ( temp 3-component vector of float)
+0:14            'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:14            Constant:
+0:14              1 (const int)
+0:14          Constant:
+0:14            2 (const int)
+0:14        Constant:
+0:14          2.000000
+0:17      move second child to first child ( temp float)
+0:17        clip1: direct index for structure ( temp float)
+0:17          'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:17          Constant:
+0:17            2 (const int)
+0:17        Constant:
+0:17          3.000000
+0:19      Branch: Return with expression
+0:19        'Output' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8  Function Definition: main( ( temp void)
+0:8    Function Parameters: 
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8          'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8          Function Call: @main( ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:8          Position: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8            Constant:
+0:8              0 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                0 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                0 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                1 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                1 (const int)
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                2 (const int)
+0:8            direct index ( temp float)
+0:8              clip0: direct index for structure ( temp 3-component vector of float)
+0:8                'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8                Constant:
+0:8                  1 (const int)
+0:8              Constant:
+0:8                2 (const int)
+0:?         Sequence
+0:8          move second child to first child ( temp float)
+0:8            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+0:8              Constant:
+0:8                3 (const int)
+0:8            clip1: direct index for structure ( temp float)
+0:8              'flattenTemp' ( temp structure{ temp 4-component vector of float Position,  temp 3-component vector of float clip0,  temp float clip1})
+0:8              Constant:
+0:8                2 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 65
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 41 47 64
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "VS_OUTPUT"
+                              MemberName 9(VS_OUTPUT) 0  "Position"
+                              MemberName 9(VS_OUTPUT) 1  "clip0"
+                              MemberName 9(VS_OUTPUT) 2  "clip1"
+                              Name 11  "@main("
+                              Name 14  "Output"
+                              Name 38  "flattenTemp"
+                              Name 41  "@entryPointOutput_Position"
+                              Name 47  "@entryPointOutput_clip1"
+                              Name 62  "VS_OUTPUT"
+                              Name 64  "@entryPointOutput"
+                              Decorate 41(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 47(@entryPointOutput_clip1) BuiltIn ClipDistance
+                              Decorate 64(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeVector 6(float) 3
+    9(VS_OUTPUT):             TypeStruct 7(fvec4) 8(fvec3) 6(float)
+              10:             TypeFunction 9(VS_OUTPUT)
+              13:             TypePointer Function 9(VS_OUTPUT)
+              15:             TypeInt 32 1
+              16:     15(int) Constant 0
+              17:    6(float) Constant 0
+              18:    7(fvec4) ConstantComposite 17 17 17 17
+              19:             TypePointer Function 7(fvec4)
+              21:     15(int) Constant 1
+              22:             TypeInt 32 0
+              23:     22(int) Constant 0
+              24:             TypePointer Function 6(float)
+              26:    6(float) Constant 1065353216
+              27:     22(int) Constant 1
+              29:    6(float) Constant 1073741824
+              30:     22(int) Constant 2
+              32:     15(int) Constant 2
+              33:    6(float) Constant 1077936128
+              40:             TypePointer Output 7(fvec4)
+41(@entryPointOutput_Position):     40(ptr) Variable Output
+              44:     22(int) Constant 4
+              45:             TypeArray 6(float) 44
+              46:             TypePointer Output 45
+47(@entryPointOutput_clip1):     46(ptr) Variable Output
+              50:             TypePointer Output 6(float)
+              58:     15(int) Constant 3
+   62(VS_OUTPUT):             TypeStruct
+              63:             TypePointer Output 62(VS_OUTPUT)
+64(@entryPointOutput):     63(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+ 38(flattenTemp):     13(ptr) Variable Function
+              39:9(VS_OUTPUT) FunctionCall 11(@main()
+                              Store 38(flattenTemp) 39
+              42:     19(ptr) AccessChain 38(flattenTemp) 16
+              43:    7(fvec4) Load 42
+                              Store 41(@entryPointOutput_Position) 43
+              48:     24(ptr) AccessChain 38(flattenTemp) 21 23
+              49:    6(float) Load 48
+              51:     50(ptr) AccessChain 47(@entryPointOutput_clip1) 16
+                              Store 51 49
+              52:     24(ptr) AccessChain 38(flattenTemp) 21 27
+              53:    6(float) Load 52
+              54:     50(ptr) AccessChain 47(@entryPointOutput_clip1) 21
+                              Store 54 53
+              55:     24(ptr) AccessChain 38(flattenTemp) 21 30
+              56:    6(float) Load 55
+              57:     50(ptr) AccessChain 47(@entryPointOutput_clip1) 32
+                              Store 57 56
+              59:     24(ptr) AccessChain 38(flattenTemp) 32
+              60:    6(float) Load 59
+              61:     50(ptr) AccessChain 47(@entryPointOutput_clip1) 58
+                              Store 61 60
+                              Return
+                              FunctionEnd
+      11(@main():9(VS_OUTPUT) Function None 10
+              12:             Label
+      14(Output):     13(ptr) Variable Function
+              20:     19(ptr) AccessChain 14(Output) 16
+                              Store 20 18
+              25:     24(ptr) AccessChain 14(Output) 21 23
+                              Store 25 17
+              28:     24(ptr) AccessChain 14(Output) 21 27
+                              Store 28 26
+              31:     24(ptr) AccessChain 14(Output) 21 30
+                              Store 31 29
+              34:     24(ptr) AccessChain 14(Output) 32
+                              Store 34 33
+              35:9(VS_OUTPUT) Load 14(Output)
+                              ReturnValue 35
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.clipdistance-9.vert.out b/Test/baseResults/hlsl.clipdistance-9.vert.out
new file mode 100644
index 0000000..a3502b7
--- /dev/null
+++ b/Test/baseResults/hlsl.clipdistance-9.vert.out
@@ -0,0 +1,305 @@
+hlsl.clipdistance-9.vert
+Shader version: 500
+0:? Sequence
+0:7  Function Definition: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position})
+0:7    Function Parameters: 
+0:7      'clip0' ( out 3-component vector of float)
+0:7      'clip1' ( out float)
+0:?     Sequence
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        Position: direct index for structure ( temp 4-component vector of float)
+0:9          'Output' ( temp structure{ temp 4-component vector of float Position})
+0:9          Constant:
+0:9            0 (const int)
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:11      move second child to first child ( temp float)
+0:11        direct index ( temp float)
+0:11          'clip0' ( out 3-component vector of float)
+0:11          Constant:
+0:11            0 (const int)
+0:11        Constant:
+0:11          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          'clip0' ( out 3-component vector of float)
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          1.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          'clip0' ( out 3-component vector of float)
+0:13          Constant:
+0:13            2 (const int)
+0:13        Constant:
+0:13          2.000000
+0:16      move second child to first child ( temp float)
+0:16        'clip1' ( out float)
+0:16        Constant:
+0:16          3.000000
+0:18      Branch: Return with expression
+0:18        'Output' ( temp structure{ temp 4-component vector of float Position})
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      Sequence
+0:7        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:7          Position: direct index for structure ( temp 4-component vector of float)
+0:7            Function Call: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position})
+0:?               'clip0' ( temp 3-component vector of float)
+0:?               'clip1' ( temp float)
+0:7            Constant:
+0:7              0 (const int)
+0:?       Sequence
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              0 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              0 (const int)
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              1 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              1 (const int)
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              2 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              2 (const int)
+0:?       Sequence
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              3 (const int)
+0:?           'clip1' ( temp float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'clip0' ( out 4-element array of float ClipDistance)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:7  Function Definition: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position})
+0:7    Function Parameters: 
+0:7      'clip0' ( out 3-component vector of float)
+0:7      'clip1' ( out float)
+0:?     Sequence
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        Position: direct index for structure ( temp 4-component vector of float)
+0:9          'Output' ( temp structure{ temp 4-component vector of float Position})
+0:9          Constant:
+0:9            0 (const int)
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:11      move second child to first child ( temp float)
+0:11        direct index ( temp float)
+0:11          'clip0' ( out 3-component vector of float)
+0:11          Constant:
+0:11            0 (const int)
+0:11        Constant:
+0:11          0.000000
+0:12      move second child to first child ( temp float)
+0:12        direct index ( temp float)
+0:12          'clip0' ( out 3-component vector of float)
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          1.000000
+0:13      move second child to first child ( temp float)
+0:13        direct index ( temp float)
+0:13          'clip0' ( out 3-component vector of float)
+0:13          Constant:
+0:13            2 (const int)
+0:13        Constant:
+0:13          2.000000
+0:16      move second child to first child ( temp float)
+0:16        'clip1' ( out float)
+0:16        Constant:
+0:16          3.000000
+0:18      Branch: Return with expression
+0:18        'Output' ( temp structure{ temp 4-component vector of float Position})
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      Sequence
+0:7        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_Position' ( out 4-component vector of float Position)
+0:7          Position: direct index for structure ( temp 4-component vector of float)
+0:7            Function Call: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position})
+0:?               'clip0' ( temp 3-component vector of float)
+0:?               'clip1' ( temp float)
+0:7            Constant:
+0:7              0 (const int)
+0:?       Sequence
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              0 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              0 (const int)
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              1 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              1 (const int)
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              2 (const int)
+0:7          direct index ( temp float)
+0:?             'clip0' ( temp 3-component vector of float)
+0:7            Constant:
+0:7              2 (const int)
+0:?       Sequence
+0:7        move second child to first child ( temp float)
+0:7          direct index ( temp float)
+0:?             'clip0' ( out 4-element array of float ClipDistance)
+0:7            Constant:
+0:7              3 (const int)
+0:?           'clip1' ( temp float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out structure{})
+0:?     'clip0' ( out 4-element array of float ClipDistance)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 70
+
+                              Capability Shader
+                              Capability ClipDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 39 51 69
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 11  "VS_OUTPUT"
+                              MemberName 11(VS_OUTPUT) 0  "Position"
+                              Name 15  "@main(vf3;f1;"
+                              Name 13  "clip0"
+                              Name 14  "clip1"
+                              Name 18  "Output"
+                              Name 39  "@entryPointOutput_Position"
+                              Name 40  "clip0"
+                              Name 41  "clip1"
+                              Name 42  "param"
+                              Name 43  "param"
+                              Name 51  "clip0"
+                              Name 67  "VS_OUTPUT"
+                              Name 69  "@entryPointOutput"
+                              Decorate 39(@entryPointOutput_Position) BuiltIn Position
+                              Decorate 51(clip0) BuiltIn ClipDistance
+                              Decorate 69(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 3
+               8:             TypePointer Function 7(fvec3)
+               9:             TypePointer Function 6(float)
+              10:             TypeVector 6(float) 4
+   11(VS_OUTPUT):             TypeStruct 10(fvec4)
+              12:             TypeFunction 11(VS_OUTPUT) 8(ptr) 9(ptr)
+              17:             TypePointer Function 11(VS_OUTPUT)
+              19:             TypeInt 32 1
+              20:     19(int) Constant 0
+              21:    6(float) Constant 0
+              22:   10(fvec4) ConstantComposite 21 21 21 21
+              23:             TypePointer Function 10(fvec4)
+              25:             TypeInt 32 0
+              26:     25(int) Constant 0
+              28:    6(float) Constant 1065353216
+              29:     25(int) Constant 1
+              31:    6(float) Constant 1073741824
+              32:     25(int) Constant 2
+              34:    6(float) Constant 1077936128
+              38:             TypePointer Output 10(fvec4)
+39(@entryPointOutput_Position):     38(ptr) Variable Output
+              48:     25(int) Constant 4
+              49:             TypeArray 6(float) 48
+              50:             TypePointer Output 49
+       51(clip0):     50(ptr) Variable Output
+              54:             TypePointer Output 6(float)
+              56:     19(int) Constant 1
+              60:     19(int) Constant 2
+              64:     19(int) Constant 3
+   67(VS_OUTPUT):             TypeStruct
+              68:             TypePointer Output 67(VS_OUTPUT)
+69(@entryPointOutput):     68(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+       40(clip0):      8(ptr) Variable Function
+       41(clip1):      9(ptr) Variable Function
+       42(param):      8(ptr) Variable Function
+       43(param):      9(ptr) Variable Function
+              44:11(VS_OUTPUT) FunctionCall 15(@main(vf3;f1;) 42(param) 43(param)
+              45:    7(fvec3) Load 42(param)
+                              Store 40(clip0) 45
+              46:    6(float) Load 43(param)
+                              Store 41(clip1) 46
+              47:   10(fvec4) CompositeExtract 44 0
+                              Store 39(@entryPointOutput_Position) 47
+              52:      9(ptr) AccessChain 40(clip0) 26
+              53:    6(float) Load 52
+              55:     54(ptr) AccessChain 51(clip0) 20
+                              Store 55 53
+              57:      9(ptr) AccessChain 40(clip0) 29
+              58:    6(float) Load 57
+              59:     54(ptr) AccessChain 51(clip0) 56
+                              Store 59 58
+              61:      9(ptr) AccessChain 40(clip0) 32
+              62:    6(float) Load 61
+              63:     54(ptr) AccessChain 51(clip0) 60
+                              Store 63 62
+              65:    6(float) Load 41(clip1)
+              66:     54(ptr) AccessChain 51(clip0) 64
+                              Store 66 65
+                              Return
+                              FunctionEnd
+15(@main(vf3;f1;):11(VS_OUTPUT) Function None 12
+       13(clip0):      8(ptr) FunctionParameter
+       14(clip1):      9(ptr) FunctionParameter
+              16:             Label
+      18(Output):     17(ptr) Variable Function
+              24:     23(ptr) AccessChain 18(Output) 20
+                              Store 24 22
+              27:      9(ptr) AccessChain 13(clip0) 26
+                              Store 27 21
+              30:      9(ptr) AccessChain 13(clip0) 29
+                              Store 30 28
+              33:      9(ptr) AccessChain 13(clip0) 32
+                              Store 33 31
+                              Store 14(clip1) 34
+              35:11(VS_OUTPUT) Load 18(Output)
+                              ReturnValue 35
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.constructArray.vert.out b/Test/baseResults/hlsl.constructArray.vert.out
new file mode 100755
index 0000000..dd2c243
--- /dev/null
+++ b/Test/baseResults/hlsl.constructArray.vert.out
@@ -0,0 +1,381 @@
+hlsl.constructArray.vert
+Shader version: 500
+0:? Sequence
+0:2  Function Definition: @main( ( temp 4-component vector of float)
+0:2    Function Parameters: 
+0:?     Sequence
+0:4      Sequence
+0:4        move second child to first child ( temp 2-element array of 4-component vector of float)
+0:4          'float4_array_times' ( temp 2-element array of 4-component vector of float)
+0:4          Construct structure ( temp 2-element array of 4-component vector of float)
+0:4            Convert int to float ( temp 4-component vector of float)
+0:4              direct index ( temp 4-component vector of int)
+0:4                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:4                Constant:
+0:4                  0 (const int)
+0:4            Convert int to float ( temp 4-component vector of float)
+0:4              direct index ( temp 4-component vector of int)
+0:4                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:4                Constant:
+0:4                  1 (const int)
+0:5      Sequence
+0:5        move second child to first child ( temp 4-element array of 2-component vector of float)
+0:5          'float2_array_times2' ( temp 4-element array of 2-component vector of float)
+0:5          Construct structure ( temp 4-element array of 2-component vector of float)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    0 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    1 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    2 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    3 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    0 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    1 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    2 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    3 (const int)
+0:6      Sequence
+0:6        move second child to first child ( temp 2-element array of 4-component vector of int)
+0:6          'int4_array2' ( temp 2-element array of 4-component vector of int)
+0:6          Construct structure ( temp 2-element array of 4-component vector of int)
+0:6            direct index ( temp 4-component vector of int)
+0:6              'int4_array' ( temp 3-element array of 4-component vector of int)
+0:6              Constant:
+0:6                0 (const int)
+0:6            direct index ( temp 4-component vector of int)
+0:6              'int4_array' ( temp 3-element array of 4-component vector of int)
+0:6              Constant:
+0:6                1 (const int)
+0:7      Sequence
+0:7        move second child to first child ( temp 2-element array of int)
+0:7          'int1_array' ( temp 2-element array of int)
+0:7          Construct structure ( temp 2-element array of int)
+0:7            direct index ( temp int)
+0:7              direct index ( temp 4-component vector of int)
+0:7                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:7                Constant:
+0:7                  0 (const int)
+0:7              Constant:
+0:7                0 (const int)
+0:7            direct index ( temp int)
+0:7              direct index ( temp 4-component vector of int)
+0:7                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:7                Constant:
+0:7                  0 (const int)
+0:7              Constant:
+0:7                1 (const int)
+0:9      Branch: Return with expression
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:2  Function Definition: main( ( temp void)
+0:2    Function Parameters: 
+0:?     Sequence
+0:2      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' ( out 4-component vector of float Position)
+0:2        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' ( out 4-component vector of float Position)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:2  Function Definition: @main( ( temp 4-component vector of float)
+0:2    Function Parameters: 
+0:?     Sequence
+0:4      Sequence
+0:4        move second child to first child ( temp 2-element array of 4-component vector of float)
+0:4          'float4_array_times' ( temp 2-element array of 4-component vector of float)
+0:4          Construct structure ( temp 2-element array of 4-component vector of float)
+0:4            Convert int to float ( temp 4-component vector of float)
+0:4              direct index ( temp 4-component vector of int)
+0:4                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:4                Constant:
+0:4                  0 (const int)
+0:4            Convert int to float ( temp 4-component vector of float)
+0:4              direct index ( temp 4-component vector of int)
+0:4                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:4                Constant:
+0:4                  1 (const int)
+0:5      Sequence
+0:5        move second child to first child ( temp 4-element array of 2-component vector of float)
+0:5          'float2_array_times2' ( temp 4-element array of 2-component vector of float)
+0:5          Construct structure ( temp 4-element array of 2-component vector of float)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    0 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    1 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    2 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      0 (const int)
+0:5                  Constant:
+0:5                    3 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    0 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    1 (const int)
+0:5            Convert int to float ( temp 2-component vector of float)
+0:5              Construct ivec2 ( temp 2-component vector of int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    2 (const int)
+0:5                direct index ( temp int)
+0:5                  direct index ( temp 4-component vector of int)
+0:5                    'int4_array' ( temp 3-element array of 4-component vector of int)
+0:5                    Constant:
+0:5                      1 (const int)
+0:5                  Constant:
+0:5                    3 (const int)
+0:6      Sequence
+0:6        move second child to first child ( temp 2-element array of 4-component vector of int)
+0:6          'int4_array2' ( temp 2-element array of 4-component vector of int)
+0:6          Construct structure ( temp 2-element array of 4-component vector of int)
+0:6            direct index ( temp 4-component vector of int)
+0:6              'int4_array' ( temp 3-element array of 4-component vector of int)
+0:6              Constant:
+0:6                0 (const int)
+0:6            direct index ( temp 4-component vector of int)
+0:6              'int4_array' ( temp 3-element array of 4-component vector of int)
+0:6              Constant:
+0:6                1 (const int)
+0:7      Sequence
+0:7        move second child to first child ( temp 2-element array of int)
+0:7          'int1_array' ( temp 2-element array of int)
+0:7          Construct structure ( temp 2-element array of int)
+0:7            direct index ( temp int)
+0:7              direct index ( temp 4-component vector of int)
+0:7                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:7                Constant:
+0:7                  0 (const int)
+0:7              Constant:
+0:7                0 (const int)
+0:7            direct index ( temp int)
+0:7              direct index ( temp 4-component vector of int)
+0:7                'int4_array' ( temp 3-element array of 4-component vector of int)
+0:7                Constant:
+0:7                  0 (const int)
+0:7              Constant:
+0:7                1 (const int)
+0:9      Branch: Return with expression
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:2  Function Definition: main( ( temp void)
+0:2    Function Parameters: 
+0:?     Sequence
+0:2      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' ( out 4-component vector of float Position)
+0:2        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' ( out 4-component vector of float Position)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 89
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 87
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "@main("
+                              Name 15  "float4_array_times"
+                              Name 21  "int4_array"
+                              Name 36  "float2_array_times2"
+                              Name 68  "int4_array2"
+                              Name 76  "int1_array"
+                              Name 87  "@entryPointOutput"
+                              Decorate 87(@entryPointOutput) BuiltIn Position
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeFunction 7(fvec4)
+              11:             TypeInt 32 0
+              12:     11(int) Constant 2
+              13:             TypeArray 7(fvec4) 12
+              14:             TypePointer Function 13
+              16:             TypeInt 32 1
+              17:             TypeVector 16(int) 4
+              18:     11(int) Constant 3
+              19:             TypeArray 17(ivec4) 18
+              20:             TypePointer Function 19
+              22:     16(int) Constant 0
+              23:             TypePointer Function 17(ivec4)
+              27:     16(int) Constant 1
+              32:             TypeVector 6(float) 2
+              33:     11(int) Constant 4
+              34:             TypeArray 32(fvec2) 33
+              35:             TypePointer Function 34
+              37:     11(int) Constant 0
+              38:             TypePointer Function 16(int)
+              41:     11(int) Constant 1
+              44:             TypeVector 16(int) 2
+              66:             TypeArray 17(ivec4) 12
+              67:             TypePointer Function 66
+              74:             TypeArray 16(int) 12
+              75:             TypePointer Function 74
+              82:    6(float) Constant 0
+              83:    7(fvec4) ConstantComposite 82 82 82 82
+              86:             TypePointer Output 7(fvec4)
+87(@entryPointOutput):     86(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              88:    7(fvec4) FunctionCall 9(@main()
+                              Store 87(@entryPointOutput) 88
+                              Return
+                              FunctionEnd
+       9(@main():    7(fvec4) Function None 8
+              10:             Label
+15(float4_array_times):     14(ptr) Variable Function
+  21(int4_array):     20(ptr) Variable Function
+36(float2_array_times2):     35(ptr) Variable Function
+ 68(int4_array2):     67(ptr) Variable Function
+  76(int1_array):     75(ptr) Variable Function
+              24:     23(ptr) AccessChain 21(int4_array) 22
+              25:   17(ivec4) Load 24
+              26:    7(fvec4) ConvertSToF 25
+              28:     23(ptr) AccessChain 21(int4_array) 27
+              29:   17(ivec4) Load 28
+              30:    7(fvec4) ConvertSToF 29
+              31:          13 CompositeConstruct 26 30
+                              Store 15(float4_array_times) 31
+              39:     38(ptr) AccessChain 21(int4_array) 22 37
+              40:     16(int) Load 39
+              42:     38(ptr) AccessChain 21(int4_array) 22 41
+              43:     16(int) Load 42
+              45:   44(ivec2) CompositeConstruct 40 43
+              46:   32(fvec2) ConvertSToF 45
+              47:     38(ptr) AccessChain 21(int4_array) 22 12
+              48:     16(int) Load 47
+              49:     38(ptr) AccessChain 21(int4_array) 22 18
+              50:     16(int) Load 49
+              51:   44(ivec2) CompositeConstruct 48 50
+              52:   32(fvec2) ConvertSToF 51
+              53:     38(ptr) AccessChain 21(int4_array) 27 37
+              54:     16(int) Load 53
+              55:     38(ptr) AccessChain 21(int4_array) 27 41
+              56:     16(int) Load 55
+              57:   44(ivec2) CompositeConstruct 54 56
+              58:   32(fvec2) ConvertSToF 57
+              59:     38(ptr) AccessChain 21(int4_array) 27 12
+              60:     16(int) Load 59
+              61:     38(ptr) AccessChain 21(int4_array) 27 18
+              62:     16(int) Load 61
+              63:   44(ivec2) CompositeConstruct 60 62
+              64:   32(fvec2) ConvertSToF 63
+              65:          34 CompositeConstruct 46 52 58 64
+                              Store 36(float2_array_times2) 65
+              69:     23(ptr) AccessChain 21(int4_array) 22
+              70:   17(ivec4) Load 69
+              71:     23(ptr) AccessChain 21(int4_array) 27
+              72:   17(ivec4) Load 71
+              73:          66 CompositeConstruct 70 72
+                              Store 68(int4_array2) 73
+              77:     38(ptr) AccessChain 21(int4_array) 22 37
+              78:     16(int) Load 77
+              79:     38(ptr) AccessChain 21(int4_array) 22 41
+              80:     16(int) Load 79
+              81:          74 CompositeConstruct 78 80
+                              Store 76(int1_array) 81
+                              ReturnValue 83
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.entry-in.frag.out b/Test/baseResults/hlsl.entry-in.frag.out
index 81441cb..1c3b3cd 100755
--- a/Test/baseResults/hlsl.entry-in.frag.out
+++ b/Test/baseResults/hlsl.entry-in.frag.out
@@ -58,7 +58,7 @@
 0:13            Constant:
 0:13              0 (const int)
 0:13          v: direct index for structure ( temp 2-component vector of float)
-0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:13            Constant:
 0:13              0 (const int)
 0:13        move second child to first child ( temp 4-component vector of float)
@@ -72,8 +72,8 @@
 0:?             'i' ( temp structure{ temp 2-component vector of float v,  temp 4-component vector of float fragCoord,  temp 2-component vector of int i2})
 0:13            Constant:
 0:13              2 (const int)
-0:13          i2: direct index for structure ( temp 2-component vector of int)
-0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:13          i2: direct index for structure ( flat temp 2-component vector of int)
+0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:13            Constant:
 0:13              1 (const int)
 0:13      move second child to first child ( temp 4-component vector of float)
@@ -82,7 +82,7 @@
 0:?           'i' ( temp structure{ temp 2-component vector of float v,  temp 4-component vector of float fragCoord,  temp 2-component vector of int i2})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:?     'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:?     'i_fragCoord' ( in 4-component vector of float FragCoord)
 
 
@@ -148,7 +148,7 @@
 0:13            Constant:
 0:13              0 (const int)
 0:13          v: direct index for structure ( temp 2-component vector of float)
-0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:13            Constant:
 0:13              0 (const int)
 0:13        move second child to first child ( temp 4-component vector of float)
@@ -162,8 +162,8 @@
 0:?             'i' ( temp structure{ temp 2-component vector of float v,  temp 4-component vector of float fragCoord,  temp 2-component vector of int i2})
 0:13            Constant:
 0:13              2 (const int)
-0:13          i2: direct index for structure ( temp 2-component vector of int)
-0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:13          i2: direct index for structure ( flat temp 2-component vector of int)
+0:13            'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:13            Constant:
 0:13              1 (const int)
 0:13      move second child to first child ( temp 4-component vector of float)
@@ -172,7 +172,7 @@
 0:?           'i' ( temp structure{ temp 2-component vector of float v,  temp 4-component vector of float fragCoord,  temp 2-component vector of int i2})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in structure{ temp 2-component vector of float v,  temp 2-component vector of int i2})
+0:?     'i' (layout( location=0) in structure{ temp 2-component vector of float v,  flat temp 2-component vector of int i2})
 0:?     'i_fragCoord' ( in 4-component vector of float FragCoord)
 
 // Module Version 10000
@@ -207,6 +207,7 @@
                               Name 63  "i_fragCoord"
                               Name 73  "@entryPointOutput"
                               Name 74  "param"
+                              MemberDecorate 54(InParam) 1 Flat
                               Decorate 56(i) Location 0
                               Decorate 63(i_fragCoord) BuiltIn FragCoord
                               Decorate 73(@entryPointOutput) Location 0
diff --git a/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out b/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
new file mode 100644
index 0000000..4ff69a4
--- /dev/null
+++ b/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
@@ -0,0 +1,66 @@
+hlsl.explicitDescriptorSet.frag
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 31
+
+                              Capability Shader
+                              Capability Sampled1D
+                              Capability SampledBuffer
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 19
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "@main("
+                              Name 13  "g_sSamp2_amb"
+                              Name 19  "@entryPointOutput"
+                              Name 21  "g_sSamp"
+                              Name 24  "g_tTex1df4"
+                              Name 25  "$Global"
+                              MemberName 25($Global) 0  "floatval_amb"
+                              Name 27  ""
+                              Name 30  "floatbuff"
+                              Decorate 13(g_sSamp2_amb) DescriptorSet 3
+                              Decorate 13(g_sSamp2_amb) Binding 10
+                              Decorate 19(@entryPointOutput) Location 0
+                              Decorate 21(g_sSamp) DescriptorSet 3
+                              Decorate 21(g_sSamp) Binding 11
+                              Decorate 24(g_tTex1df4) DescriptorSet 3
+                              Decorate 24(g_tTex1df4) Binding 20
+                              MemberDecorate 25($Global) 0 Offset 0
+                              Decorate 25($Global) Block
+                              Decorate 27 DescriptorSet 3
+                              Decorate 30(floatbuff) DescriptorSet 3
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeFunction 7(fvec4)
+              11:             TypeSampler
+              12:             TypePointer UniformConstant 11
+13(g_sSamp2_amb):     12(ptr) Variable UniformConstant
+              14:    6(float) Constant 0
+              15:    7(fvec4) ConstantComposite 14 14 14 14
+              18:             TypePointer Output 7(fvec4)
+19(@entryPointOutput):     18(ptr) Variable Output
+     21(g_sSamp):     12(ptr) Variable UniformConstant
+              22:             TypeImage 6(float) 1D sampled format:Unknown
+              23:             TypePointer UniformConstant 22
+  24(g_tTex1df4):     23(ptr) Variable UniformConstant
+     25($Global):             TypeStruct 6(float)
+              26:             TypePointer Uniform 25($Global)
+              27:     26(ptr) Variable Uniform
+              28:             TypeImage 6(float) Buffer sampled format:R32f
+              29:             TypePointer UniformConstant 28
+   30(floatbuff):     29(ptr) Variable UniformConstant
+         4(main):           2 Function None 3
+               5:             Label
+              20:    7(fvec4) FunctionCall 9(@main()
+                              Store 19(@entryPointOutput) 20
+                              Return
+                              FunctionEnd
+       9(@main():    7(fvec4) Function None 8
+              10:             Label
+                              ReturnValue 15
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.explicitDescriptorSet.frag.out b/Test/baseResults/hlsl.explicitDescriptorSet.frag.out
new file mode 100644
index 0000000..e33f9d6
--- /dev/null
+++ b/Test/baseResults/hlsl.explicitDescriptorSet.frag.out
@@ -0,0 +1,66 @@
+hlsl.explicitDescriptorSet.frag
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 31
+
+                              Capability Shader
+                              Capability Sampled1D
+                              Capability SampledBuffer
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 19
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "@main("
+                              Name 13  "g_sSamp2_amb"
+                              Name 19  "@entryPointOutput"
+                              Name 21  "g_sSamp"
+                              Name 24  "g_tTex1df4"
+                              Name 25  "$Global"
+                              MemberName 25($Global) 0  "floatval_amb"
+                              Name 27  ""
+                              Name 30  "floatbuff"
+                              Decorate 13(g_sSamp2_amb) DescriptorSet 4
+                              Decorate 13(g_sSamp2_amb) Binding 10
+                              Decorate 19(@entryPointOutput) Location 0
+                              Decorate 21(g_sSamp) DescriptorSet 4
+                              Decorate 21(g_sSamp) Binding 11
+                              Decorate 24(g_tTex1df4) DescriptorSet 4
+                              Decorate 24(g_tTex1df4) Binding 20
+                              MemberDecorate 25($Global) 0 Offset 0
+                              Decorate 25($Global) Block
+                              Decorate 27 DescriptorSet 4
+                              Decorate 30(floatbuff) DescriptorSet 4
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeFunction 7(fvec4)
+              11:             TypeSampler
+              12:             TypePointer UniformConstant 11
+13(g_sSamp2_amb):     12(ptr) Variable UniformConstant
+              14:    6(float) Constant 0
+              15:    7(fvec4) ConstantComposite 14 14 14 14
+              18:             TypePointer Output 7(fvec4)
+19(@entryPointOutput):     18(ptr) Variable Output
+     21(g_sSamp):     12(ptr) Variable UniformConstant
+              22:             TypeImage 6(float) 1D sampled format:Unknown
+              23:             TypePointer UniformConstant 22
+  24(g_tTex1df4):     23(ptr) Variable UniformConstant
+     25($Global):             TypeStruct 6(float)
+              26:             TypePointer Uniform 25($Global)
+              27:     26(ptr) Variable Uniform
+              28:             TypeImage 6(float) Buffer sampled format:R32f
+              29:             TypePointer UniformConstant 28
+   30(floatbuff):     29(ptr) Variable UniformConstant
+         4(main):           2 Function None 3
+               5:             Label
+              20:    7(fvec4) FunctionCall 9(@main()
+                              Store 19(@entryPointOutput) 20
+                              Return
+                              FunctionEnd
+       9(@main():    7(fvec4) Function None 8
+              10:             Label
+                              ReturnValue 15
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/Test/baseResults/hlsl.flattenOpaqueInit.vert.out
new file mode 100755
index 0000000..774260f
--- /dev/null
+++ b/Test/baseResults/hlsl.flattenOpaqueInit.vert.out
@@ -0,0 +1,132 @@
+hlsl.flattenOpaqueInit.vert
+Shader version: 500
+0:? Sequence
+0:5  Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?       'smpl' ( in sampler)
+0:?       'tex' ( in texture2D)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        texture ( temp 4-component vector of float)
+0:6          Construct combined texture-sampler ( temp sampler2D)
+0:?             'tex' ( in texture2D)
+0:?             'smpl' ( in sampler)
+0:?           Constant:
+0:?             0.300000
+0:?             0.400000
+0:10  Function Definition: @main( ( temp 4-component vector of float)
+0:10    Function Parameters: 
+0:?     Sequence
+0:12      Branch: Return with expression
+0:12        Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
+0:?           'g_tInputTexture_sampler' ( uniform sampler)
+0:?           'g_tInputTexture' ( uniform texture2D)
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:10        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_tInputTexture_sampler' ( uniform sampler)
+0:?     'g_tInputTexture' ( uniform texture2D)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:5  Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?       'smpl' ( in sampler)
+0:?       'tex' ( in texture2D)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        texture ( temp 4-component vector of float)
+0:6          Construct combined texture-sampler ( temp sampler2D)
+0:?             'tex' ( in texture2D)
+0:?             'smpl' ( in sampler)
+0:?           Constant:
+0:?             0.300000
+0:?             0.400000
+0:10  Function Definition: @main( ( temp 4-component vector of float)
+0:10    Function Parameters: 
+0:?     Sequence
+0:12      Branch: Return with expression
+0:12        Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
+0:?           'g_tInputTexture_sampler' ( uniform sampler)
+0:?           'g_tInputTexture' ( uniform texture2D)
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:10        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_tInputTexture_sampler' ( uniform sampler)
+0:?     'g_tInputTexture' ( uniform texture2D)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 40
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 38
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 15  "lookUp(struct-FxaaTex-p1-t211;"
+                              Name 13  "smpl"
+                              Name 14  "tex"
+                              Name 18  "@main("
+                              Name 32  "g_tInputTexture_sampler"
+                              Name 33  "g_tInputTexture"
+                              Name 38  "@entryPointOutput"
+                              Decorate 32(g_tInputTexture_sampler) DescriptorSet 0
+                              Decorate 33(g_tInputTexture) DescriptorSet 0
+                              Decorate 38(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeSampler
+               7:             TypePointer UniformConstant 6
+               8:             TypeFloat 32
+               9:             TypeImage 8(float) 2D sampled format:Unknown
+              10:             TypePointer UniformConstant 9
+              11:             TypeVector 8(float) 4
+              12:             TypeFunction 11(fvec4) 7(ptr) 10(ptr)
+              17:             TypeFunction 11(fvec4)
+              22:             TypeSampledImage 9
+              24:             TypeVector 8(float) 2
+              25:    8(float) Constant 1050253722
+              26:    8(float) Constant 1053609165
+              27:   24(fvec2) ConstantComposite 25 26
+              28:    8(float) Constant 0
+32(g_tInputTexture_sampler):      7(ptr) Variable UniformConstant
+33(g_tInputTexture):     10(ptr) Variable UniformConstant
+              37:             TypePointer Output 11(fvec4)
+38(@entryPointOutput):     37(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              39:   11(fvec4) FunctionCall 18(@main()
+                              Store 38(@entryPointOutput) 39
+                              Return
+                              FunctionEnd
+15(lookUp(struct-FxaaTex-p1-t211;):   11(fvec4) Function None 12
+        13(smpl):      7(ptr) FunctionParameter
+         14(tex):     10(ptr) FunctionParameter
+              16:             Label
+              20:           9 Load 14(tex)
+              21:           6 Load 13(smpl)
+              23:          22 SampledImage 20 21
+              29:   11(fvec4) ImageSampleExplicitLod 23 27 Lod 28
+                              ReturnValue 29
+                              FunctionEnd
+      18(@main():   11(fvec4) Function None 17
+              19:             Label
+              34:   11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 32(g_tInputTexture_sampler) 33(g_tInputTexture)
+                              ReturnValue 34
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out b/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
new file mode 100755
index 0000000..3deaddd
--- /dev/null
+++ b/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
@@ -0,0 +1,159 @@
+hlsl.flattenOpaqueInitMix.vert
+Shader version: 500
+0:? Sequence
+0:5  Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?       'smpl' ( in sampler)
+0:?       'tex' ( in texture2D)
+0:?       'f' ( in float)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        texture ( temp 4-component vector of float)
+0:6          Construct combined texture-sampler ( temp sampler2D)
+0:?             'tex' ( in texture2D)
+0:?             'smpl' ( in sampler)
+0:?           Construct vec2 ( temp 2-component vector of float)
+0:?             'f' ( in float)
+0:?             'f' ( in float)
+0:10  Function Definition: @main( ( temp 4-component vector of float)
+0:10    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:?             'f' ( temp float)
+0:11            Constant:
+0:11              0.500000
+0:12      Branch: Return with expression
+0:12        Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
+0:?           'g_tInputTexture_sampler' ( uniform sampler)
+0:?           'g_tInputTexture' ( uniform texture2D)
+0:?           'f' ( temp float)
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:10        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_tInputTexture_sampler' ( uniform sampler)
+0:?     'g_tInputTexture' ( uniform texture2D)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:5  Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?       'smpl' ( in sampler)
+0:?       'tex' ( in texture2D)
+0:?       'f' ( in float)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        texture ( temp 4-component vector of float)
+0:6          Construct combined texture-sampler ( temp sampler2D)
+0:?             'tex' ( in texture2D)
+0:?             'smpl' ( in sampler)
+0:?           Construct vec2 ( temp 2-component vector of float)
+0:?             'f' ( in float)
+0:?             'f' ( in float)
+0:10  Function Definition: @main( ( temp 4-component vector of float)
+0:10    Function Parameters: 
+0:?     Sequence
+0:11      Sequence
+0:?         Sequence
+0:11          move second child to first child ( temp float)
+0:?             'f' ( temp float)
+0:11            Constant:
+0:11              0.500000
+0:12      Branch: Return with expression
+0:12        Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
+0:?           'g_tInputTexture_sampler' ( uniform sampler)
+0:?           'g_tInputTexture' ( uniform texture2D)
+0:?           'f' ( temp float)
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
+0:?     Sequence
+0:10      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:10        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_tInputTexture_sampler' ( uniform sampler)
+0:?     'g_tInputTexture' ( uniform texture2D)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 46
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 44
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 17  "lookUp(struct-FxaaTex-p1-t21-f11;"
+                              Name 14  "smpl"
+                              Name 15  "tex"
+                              Name 16  "f"
+                              Name 20  "@main("
+                              Name 34  "f"
+                              Name 36  "g_tInputTexture_sampler"
+                              Name 37  "g_tInputTexture"
+                              Name 38  "param"
+                              Name 44  "@entryPointOutput"
+                              Decorate 36(g_tInputTexture_sampler) DescriptorSet 0
+                              Decorate 37(g_tInputTexture) DescriptorSet 0
+                              Decorate 44(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeSampler
+               7:             TypePointer UniformConstant 6
+               8:             TypeFloat 32
+               9:             TypeImage 8(float) 2D sampled format:Unknown
+              10:             TypePointer UniformConstant 9
+              11:             TypePointer Function 8(float)
+              12:             TypeVector 8(float) 4
+              13:             TypeFunction 12(fvec4) 7(ptr) 10(ptr) 11(ptr)
+              19:             TypeFunction 12(fvec4)
+              24:             TypeSampledImage 9
+              28:             TypeVector 8(float) 2
+              30:    8(float) Constant 0
+              35:    8(float) Constant 1056964608
+36(g_tInputTexture_sampler):      7(ptr) Variable UniformConstant
+37(g_tInputTexture):     10(ptr) Variable UniformConstant
+              43:             TypePointer Output 12(fvec4)
+44(@entryPointOutput):     43(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              45:   12(fvec4) FunctionCall 20(@main()
+                              Store 44(@entryPointOutput) 45
+                              Return
+                              FunctionEnd
+17(lookUp(struct-FxaaTex-p1-t21-f11;):   12(fvec4) Function None 13
+        14(smpl):      7(ptr) FunctionParameter
+         15(tex):     10(ptr) FunctionParameter
+           16(f):     11(ptr) FunctionParameter
+              18:             Label
+              22:           9 Load 15(tex)
+              23:           6 Load 14(smpl)
+              25:          24 SampledImage 22 23
+              26:    8(float) Load 16(f)
+              27:    8(float) Load 16(f)
+              29:   28(fvec2) CompositeConstruct 26 27
+              31:   12(fvec4) ImageSampleExplicitLod 25 29 Lod 30
+                              ReturnValue 31
+                              FunctionEnd
+      20(@main():   12(fvec4) Function None 19
+              21:             Label
+           34(f):     11(ptr) Variable Function
+       38(param):     11(ptr) Variable Function
+                              Store 34(f) 35
+              39:    8(float) Load 34(f)
+                              Store 38(param) 39
+              40:   12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 36(g_tInputTexture_sampler) 37(g_tInputTexture) 38(param)
+                              ReturnValue 40
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
index 03d0325..675e178 100644
--- a/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
@@ -813,7 +813,7 @@
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 26($Global) 0 Offset 0
-                              MemberDecorate 26($Global) 1 Offset 4
+                              MemberDecorate 26($Global) 1 Offset 8
                               MemberDecorate 26($Global) 2 Offset 16
                               MemberDecorate 26($Global) 3 Offset 32
                               Decorate 26($Global) Block
diff --git a/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
index c64a4e6..4d5da52 100644
--- a/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
@@ -824,7 +824,7 @@
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 26($Global) 0 Offset 0
-                              MemberDecorate 26($Global) 1 Offset 4
+                              MemberDecorate 26($Global) 1 Offset 8
                               MemberDecorate 26($Global) 2 Offset 16
                               MemberDecorate 26($Global) 3 Offset 32
                               Decorate 26($Global) Block
diff --git a/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
index 6f68205..a4fd588 100644
--- a/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
@@ -1333,11 +1333,11 @@
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 30($Global) 0 Offset 0
-                              MemberDecorate 30($Global) 1 Offset 4
+                              MemberDecorate 30($Global) 1 Offset 8
                               MemberDecorate 30($Global) 2 Offset 16
                               MemberDecorate 30($Global) 3 Offset 32
                               MemberDecorate 30($Global) 4 Offset 48
-                              MemberDecorate 30($Global) 5 Offset 52
+                              MemberDecorate 30($Global) 5 Offset 56
                               MemberDecorate 30($Global) 6 Offset 64
                               MemberDecorate 30($Global) 7 Offset 80
                               Decorate 30($Global) Block
diff --git a/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
index ef200d8..23d26cc 100644
--- a/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
@@ -1322,11 +1322,11 @@
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 30($Global) 0 Offset 0
-                              MemberDecorate 30($Global) 1 Offset 4
+                              MemberDecorate 30($Global) 1 Offset 8
                               MemberDecorate 30($Global) 2 Offset 16
                               MemberDecorate 30($Global) 3 Offset 32
                               MemberDecorate 30($Global) 4 Offset 48
-                              MemberDecorate 30($Global) 5 Offset 52
+                              MemberDecorate 30($Global) 5 Offset 56
                               MemberDecorate 30($Global) 6 Offset 64
                               MemberDecorate 30($Global) 7 Offset 80
                               Decorate 30($Global) Block
diff --git a/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out b/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
index cbbc259..0704ee0 100644
--- a/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
+++ b/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
@@ -506,7 +506,7 @@
                               Decorate 20(g_sSampCmp) DescriptorSet 0
                               Decorate 20(g_sSampCmp) Binding 0
                               MemberDecorate 27($Global) 0 Offset 0
-                              MemberDecorate 27($Global) 1 Offset 4
+                              MemberDecorate 27($Global) 1 Offset 8
                               MemberDecorate 27($Global) 2 Offset 16
                               MemberDecorate 27($Global) 3 Offset 32
                               Decorate 27($Global) Block
diff --git a/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out b/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
index eb6a1b6..67b2f8f 100644
--- a/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
+++ b/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
@@ -812,11 +812,11 @@
                               Decorate 225(g_sSamp) DescriptorSet 0
                               Decorate 225(g_sSamp) Binding 0
                               MemberDecorate 229($Global) 0 Offset 0
-                              MemberDecorate 229($Global) 1 Offset 4
+                              MemberDecorate 229($Global) 1 Offset 8
                               MemberDecorate 229($Global) 2 Offset 16
                               MemberDecorate 229($Global) 3 Offset 32
                               MemberDecorate 229($Global) 4 Offset 48
-                              MemberDecorate 229($Global) 5 Offset 52
+                              MemberDecorate 229($Global) 5 Offset 56
                               MemberDecorate 229($Global) 6 Offset 64
                               MemberDecorate 229($Global) 7 Offset 80
                               Decorate 229($Global) Block
diff --git a/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
index d8274fa..3f346d4 100644
--- a/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
+++ b/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
@@ -260,7 +260,7 @@
 0:?     Sequence
 0:13      move second child to first child ( temp int)
 0:?         'sample' ( temp int)
-0:?         'sample' (layout( location=0) in int)
+0:?         'sample' (layout( location=0) flat in int)
 0:13      Sequence
 0:13        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -284,7 +284,7 @@
 0:?     'g_tTex2dmsf4a' ( uniform texture2DMSArray)
 0:?     'Color' (layout( location=0) out 4-component vector of float)
 0:?     'Depth' ( out float FragDepth)
-0:?     'sample' (layout( location=0) in int)
+0:?     'sample' (layout( location=0) flat in int)
 
 
 Linked fragment stage:
@@ -551,7 +551,7 @@
 0:?     Sequence
 0:13      move second child to first child ( temp int)
 0:?         'sample' ( temp int)
-0:?         'sample' (layout( location=0) in int)
+0:?         'sample' (layout( location=0) flat in int)
 0:13      Sequence
 0:13        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -575,7 +575,7 @@
 0:?     'g_tTex2dmsf4a' ( uniform texture2DMSArray)
 0:?     'Color' (layout( location=0) out 4-component vector of float)
 0:?     'Depth' ( out float FragDepth)
-0:?     'sample' (layout( location=0) in int)
+0:?     'sample' (layout( location=0) flat in int)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -619,6 +619,7 @@
                               Name 220  "g_sSamp"
                               Decorate 23(g_tTex2dmsf4) DescriptorSet 0
                               Decorate 142(g_tTex2dmsf4a) DescriptorSet 0
+                              Decorate 204(sample) Flat
                               Decorate 204(sample) Location 0
                               Decorate 211(Color) Location 0
                               Decorate 215(Depth) BuiltIn FragDepth
diff --git a/Test/baseResults/hlsl.global-const-init.frag.out b/Test/baseResults/hlsl.global-const-init.frag.out
new file mode 100644
index 0000000..659ad53
--- /dev/null
+++ b/Test/baseResults/hlsl.global-const-init.frag.out
@@ -0,0 +1,178 @@
+hlsl.global-const-init.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:6  Sequence
+0:6    move second child to first child ( temp 4-component vector of float)
+0:6      'bar' ( global 4-component vector of float)
+0:6      foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:6        'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:6        Constant:
+0:6          0 (const uint)
+0:8  Sequence
+0:8    move second child to first child ( temp 2-element array of 2-component vector of float)
+0:8      'a1' ( global 2-element array of 2-component vector of float)
+0:8      Construct vec2 ( temp 2-element array of 2-component vector of float)
+0:8        Constant:
+0:8          1.000000
+0:8          2.000000
+0:8        Construct vec2 ( temp 2-component vector of float)
+0:8          direct index ( temp float)
+0:8            foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:8              'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:8              Constant:
+0:8                0 (const uint)
+0:8            Constant:
+0:8              0 (const int)
+0:8          Constant:
+0:8            4.000000
+0:12  Function Definition: @main( ( temp 4-component vector of float)
+0:12    Function Parameters: 
+0:?     Sequence
+0:13      Branch: Return with expression
+0:13        'bar' ( global 4-component vector of float)
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:12        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:?     'bar' ( global 4-component vector of float)
+0:?     'a1' ( global 2-element array of 2-component vector of float)
+0:?     'a2' ( const 2-element array of 2-component vector of float)
+0:?       5.000000
+0:?       6.000000
+0:?       7.000000
+0:?       8.000000
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:6  Sequence
+0:6    move second child to first child ( temp 4-component vector of float)
+0:6      'bar' ( global 4-component vector of float)
+0:6      foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:6        'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:6        Constant:
+0:6          0 (const uint)
+0:8  Sequence
+0:8    move second child to first child ( temp 2-element array of 2-component vector of float)
+0:8      'a1' ( global 2-element array of 2-component vector of float)
+0:8      Construct vec2 ( temp 2-element array of 2-component vector of float)
+0:8        Constant:
+0:8          1.000000
+0:8          2.000000
+0:8        Construct vec2 ( temp 2-component vector of float)
+0:8          direct index ( temp float)
+0:8            foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:8              'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:8              Constant:
+0:8                0 (const uint)
+0:8            Constant:
+0:8              0 (const int)
+0:8          Constant:
+0:8            4.000000
+0:12  Function Definition: @main( ( temp 4-component vector of float)
+0:12    Function Parameters: 
+0:?     Sequence
+0:13      Branch: Return with expression
+0:13        'bar' ( global 4-component vector of float)
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:12        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo})
+0:?     'bar' ( global 4-component vector of float)
+0:?     'a1' ( global 2-element array of 2-component vector of float)
+0:?     'a2' ( const 2-element array of 2-component vector of float)
+0:?       5.000000
+0:?       6.000000
+0:?       7.000000
+0:?       8.000000
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 50
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 41
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "@main("
+                              Name 12  "bar"
+                              Name 13  "CB"
+                              MemberName 13(CB) 0  "foo"
+                              Name 15  ""
+                              Name 26  "a1"
+                              Name 41  "@entryPointOutput"
+                              MemberDecorate 13(CB) 0 Offset 0
+                              Decorate 13(CB) Block
+                              Decorate 15 DescriptorSet 0
+                              Decorate 41(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeFunction 7(fvec4)
+              11:             TypePointer Private 7(fvec4)
+         12(bar):     11(ptr) Variable Private
+          13(CB):             TypeStruct 7(fvec4)
+              14:             TypePointer Uniform 13(CB)
+              15:     14(ptr) Variable Uniform
+              16:             TypeInt 32 1
+              17:     16(int) Constant 0
+              18:             TypePointer Uniform 7(fvec4)
+              21:             TypeVector 6(float) 2
+              22:             TypeInt 32 0
+              23:     22(int) Constant 2
+              24:             TypeArray 21(fvec2) 23
+              25:             TypePointer Private 24
+          26(a1):     25(ptr) Variable Private
+              27:    6(float) Constant 1065353216
+              28:    6(float) Constant 1073741824
+              29:   21(fvec2) ConstantComposite 27 28
+              30:     22(int) Constant 0
+              31:             TypePointer Uniform 6(float)
+              34:    6(float) Constant 1082130432
+              40:             TypePointer Output 7(fvec4)
+41(@entryPointOutput):     40(ptr) Variable Output
+              43:    6(float) Constant 1084227584
+              44:    6(float) Constant 1086324736
+              45:   21(fvec2) ConstantComposite 43 44
+              46:    6(float) Constant 1088421888
+              47:    6(float) Constant 1090519040
+              48:   21(fvec2) ConstantComposite 46 47
+              49:          24 ConstantComposite 45 48
+         4(main):           2 Function None 3
+               5:             Label
+              19:     18(ptr) AccessChain 15 17
+              20:    7(fvec4) Load 19
+                              Store 12(bar) 20
+              32:     31(ptr) AccessChain 15 17 30
+              33:    6(float) Load 32
+              35:   21(fvec2) CompositeConstruct 33 34
+              36:          24 CompositeConstruct 29 35
+                              Store 26(a1) 36
+              42:    7(fvec4) FunctionCall 9(@main()
+                              Store 41(@entryPointOutput) 42
+                              Return
+                              FunctionEnd
+       9(@main():    7(fvec4) Function None 8
+              10:             Label
+              37:    7(fvec4) Load 12(bar)
+                              ReturnValue 37
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.hull.3.tesc.out b/Test/baseResults/hlsl.hull.3.tesc.out
new file mode 100755
index 0000000..c8b7a73
--- /dev/null
+++ b/Test/baseResults/hlsl.hull.3.tesc.out
@@ -0,0 +1,382 @@
+hlsl.hull.3.tesc
+Shader version: 500
+vertices = 4
+vertex spacing = equal_spacing
+0:? Sequence
+0:26  Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
+0:26    Function Parameters: 
+0:26      'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     Sequence
+0:28      move second child to first child ( temp 3-component vector of float)
+0:28        cpoint: direct index for structure ( temp 3-component vector of float)
+0:28          'output' ( temp structure{ temp 3-component vector of float cpoint})
+0:28          Constant:
+0:28            0 (const int)
+0:28        cpoint: direct index for structure ( temp 3-component vector of float)
+0:28          direct index ( temp structure{ temp 3-component vector of float cpoint})
+0:28            'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:28            Constant:
+0:28              0 (const int)
+0:28          Constant:
+0:28            0 (const int)
+0:29      Branch: Return with expression
+0:29        'output' ( temp structure{ temp 3-component vector of float cpoint})
+0:26  Function Definition: main( ( temp void)
+0:26    Function Parameters: 
+0:?     Sequence
+0:26      move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?         'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?         'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:26      move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
+0:26        indirect index ( temp structure{ temp 3-component vector of float cpoint})
+0:?           '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?           'InvocationId' ( in uint InvocationID)
+0:26        Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
+0:?           'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?       Barrier ( temp void)
+0:?       Test condition and select ( temp void)
+0:?         Condition
+0:?         Compare Equal ( temp bool)
+0:?           'InvocationId' ( in uint InvocationID)
+0:?           Constant:
+0:?             0 (const int)
+0:?         true case
+0:?         Sequence
+0:?           move second child to first child ( temp structure{ temp 2-element array of float edges})
+0:?             '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?             Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges})
+0:?               'pid' ( in uint PrimitiveID)
+0:?               'pos' ( in 4-component vector of float Position)
+0:?           Sequence
+0:?             move second child to first child ( temp float)
+0:?               direct index ( patch out float TessLevelOuter)
+0:?                 '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+0:?                 Constant:
+0:?                   0 (const int)
+0:?               direct index ( temp float)
+0:?                 edges: direct index for structure ( temp 2-element array of float)
+0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?                   Constant:
+0:?                     0 (const int)
+0:?                 Constant:
+0:?                   0 (const int)
+0:?             move second child to first child ( temp float)
+0:?               direct index ( patch out float TessLevelOuter)
+0:?                 '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+0:?                 Constant:
+0:?                   1 (const int)
+0:?               direct index ( temp float)
+0:?                 edges: direct index for structure ( temp 2-element array of float)
+0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?                   Constant:
+0:?                     0 (const int)
+0:?                 Constant:
+0:?                   1 (const int)
+0:33  Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges})
+0:33    Function Parameters: 
+0:33      'pid' ( in uint)
+0:33      'pos' ( in 4-component vector of float)
+0:?     Sequence
+0:36      move second child to first child ( temp float)
+0:36        direct index ( temp float)
+0:36          edges: direct index for structure ( temp 2-element array of float)
+0:36            'output' ( temp structure{ temp 2-element array of float edges})
+0:36            Constant:
+0:36              0 (const int)
+0:36          Constant:
+0:36            0 (const int)
+0:36        Constant:
+0:36          2.000000
+0:37      move second child to first child ( temp float)
+0:37        direct index ( temp float)
+0:37          edges: direct index for structure ( temp 2-element array of float)
+0:37            'output' ( temp structure{ temp 2-element array of float edges})
+0:37            Constant:
+0:37              0 (const int)
+0:37          Constant:
+0:37            1 (const int)
+0:37        Constant:
+0:37          8.000000
+0:38      Branch: Return with expression
+0:38        'output' ( temp structure{ temp 2-element array of float edges})
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     'InvocationId' ( in uint InvocationID)
+0:?     'pid' ( in uint PrimitiveID)
+0:?     'pos' ( in 4-component vector of float Position)
+0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
+0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+
+
+Linked tessellation control stage:
+
+
+Shader version: 500
+vertices = 4
+vertex spacing = equal_spacing
+0:? Sequence
+0:26  Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
+0:26    Function Parameters: 
+0:26      'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     Sequence
+0:28      move second child to first child ( temp 3-component vector of float)
+0:28        cpoint: direct index for structure ( temp 3-component vector of float)
+0:28          'output' ( temp structure{ temp 3-component vector of float cpoint})
+0:28          Constant:
+0:28            0 (const int)
+0:28        cpoint: direct index for structure ( temp 3-component vector of float)
+0:28          direct index ( temp structure{ temp 3-component vector of float cpoint})
+0:28            'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:28            Constant:
+0:28              0 (const int)
+0:28          Constant:
+0:28            0 (const int)
+0:29      Branch: Return with expression
+0:29        'output' ( temp structure{ temp 3-component vector of float cpoint})
+0:26  Function Definition: main( ( temp void)
+0:26    Function Parameters: 
+0:?     Sequence
+0:26      move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?         'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?         'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:26      move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
+0:26        indirect index ( temp structure{ temp 3-component vector of float cpoint})
+0:?           '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?           'InvocationId' ( in uint InvocationID)
+0:26        Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
+0:?           'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?       Barrier ( temp void)
+0:?       Test condition and select ( temp void)
+0:?         Condition
+0:?         Compare Equal ( temp bool)
+0:?           'InvocationId' ( in uint InvocationID)
+0:?           Constant:
+0:?             0 (const int)
+0:?         true case
+0:?         Sequence
+0:?           move second child to first child ( temp structure{ temp 2-element array of float edges})
+0:?             '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?             Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges})
+0:?               'pid' ( in uint PrimitiveID)
+0:?               'pos' ( in 4-component vector of float Position)
+0:?           Sequence
+0:?             move second child to first child ( temp float)
+0:?               direct index ( patch out float TessLevelOuter)
+0:?                 '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+0:?                 Constant:
+0:?                   0 (const int)
+0:?               direct index ( temp float)
+0:?                 edges: direct index for structure ( temp 2-element array of float)
+0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?                   Constant:
+0:?                     0 (const int)
+0:?                 Constant:
+0:?                   0 (const int)
+0:?             move second child to first child ( temp float)
+0:?               direct index ( patch out float TessLevelOuter)
+0:?                 '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+0:?                 Constant:
+0:?                   1 (const int)
+0:?               direct index ( temp float)
+0:?                 edges: direct index for structure ( temp 2-element array of float)
+0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
+0:?                   Constant:
+0:?                     0 (const int)
+0:?                 Constant:
+0:?                   1 (const int)
+0:33  Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges})
+0:33    Function Parameters: 
+0:33      'pid' ( in uint)
+0:33      'pos' ( in 4-component vector of float)
+0:?     Sequence
+0:36      move second child to first child ( temp float)
+0:36        direct index ( temp float)
+0:36          edges: direct index for structure ( temp 2-element array of float)
+0:36            'output' ( temp structure{ temp 2-element array of float edges})
+0:36            Constant:
+0:36              0 (const int)
+0:36          Constant:
+0:36            0 (const int)
+0:36        Constant:
+0:36          2.000000
+0:37      move second child to first child ( temp float)
+0:37        direct index ( temp float)
+0:37          edges: direct index for structure ( temp 2-element array of float)
+0:37            'output' ( temp structure{ temp 2-element array of float edges})
+0:37            Constant:
+0:37              0 (const int)
+0:37          Constant:
+0:37            1 (const int)
+0:37        Constant:
+0:37          8.000000
+0:38      Branch: Return with expression
+0:38        'output' ( temp structure{ temp 2-element array of float edges})
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
+0:?     'InvocationId' ( in uint InvocationID)
+0:?     'pid' ( in uint PrimitiveID)
+0:?     'pos' ( in 4-component vector of float Position)
+0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
+0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 95
+
+                              Capability Tessellation
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint TessellationControl 4  "main" 42 46 48 64 66 74 94
+                              ExecutionMode 4 OutputVertices 4
+                              ExecutionMode 4 Triangles
+                              ExecutionMode 4 SpacingEqual
+                              ExecutionMode 4 PointMode
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "VS_OUT"
+                              MemberName 8(VS_OUT) 0  "cpoint"
+                              Name 13  "HS_OUT"
+                              MemberName 13(HS_OUT) 0  "cpoint"
+                              Name 16  "@main(struct-VS_OUT-vf31[4];"
+                              Name 15  "ip"
+                              Name 23  "HS_CONSTANT_OUT"
+                              MemberName 23(HS_CONSTANT_OUT) 0  "edges"
+                              Name 27  "PCF(u1;vf4;"
+                              Name 25  "pid"
+                              Name 26  "pos"
+                              Name 30  "output"
+                              Name 40  "ip"
+                              Name 42  "ip"
+                              Name 46  "@entryPointOutput"
+                              Name 48  "InvocationId"
+                              Name 50  "param"
+                              Name 63  "@patchConstantResult"
+                              Name 64  "pid"
+                              Name 66  "pos"
+                              Name 67  "param"
+                              Name 69  "param"
+                              Name 74  "@patchConstantOutput_edges"
+                              Name 84  "output"
+                              Name 92  "HS_CONSTANT_OUT"
+                              Name 94  "@patchConstantOutput"
+                              Decorate 42(ip) Location 0
+                              Decorate 46(@entryPointOutput) Location 0
+                              Decorate 48(InvocationId) BuiltIn InvocationId
+                              Decorate 64(pid) BuiltIn PrimitiveId
+                              Decorate 66(pos) BuiltIn Position
+                              Decorate 74(@patchConstantOutput_edges) Patch
+                              Decorate 74(@patchConstantOutput_edges) BuiltIn TessLevelOuter
+                              Decorate 94(@patchConstantOutput) Patch
+                              Decorate 94(@patchConstantOutput) Location 1
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 3
+       8(VS_OUT):             TypeStruct 7(fvec3)
+               9:             TypeInt 32 0
+              10:      9(int) Constant 4
+              11:             TypeArray 8(VS_OUT) 10
+              12:             TypePointer Function 11
+      13(HS_OUT):             TypeStruct 7(fvec3)
+              14:             TypeFunction 13(HS_OUT) 12(ptr)
+              18:             TypePointer Function 9(int)
+              19:             TypeVector 6(float) 4
+              20:             TypePointer Function 19(fvec4)
+              21:      9(int) Constant 2
+              22:             TypeArray 6(float) 21
+23(HS_CONSTANT_OUT):             TypeStruct 22
+              24:             TypeFunction 23(HS_CONSTANT_OUT) 18(ptr) 20(ptr)
+              29:             TypePointer Function 13(HS_OUT)
+              31:             TypeInt 32 1
+              32:     31(int) Constant 0
+              33:             TypePointer Function 7(fvec3)
+              41:             TypePointer Input 11
+          42(ip):     41(ptr) Variable Input
+              44:             TypeArray 13(HS_OUT) 10
+              45:             TypePointer Output 44
+46(@entryPointOutput):     45(ptr) Variable Output
+              47:             TypePointer Input 9(int)
+48(InvocationId):     47(ptr) Variable Input
+              53:             TypePointer Output 13(HS_OUT)
+              55:      9(int) Constant 1
+              56:      9(int) Constant 0
+              58:             TypeBool
+              62:             TypePointer Function 23(HS_CONSTANT_OUT)
+         64(pid):     47(ptr) Variable Input
+              65:             TypePointer Input 19(fvec4)
+         66(pos):     65(ptr) Variable Input
+              72:             TypeArray 6(float) 10
+              73:             TypePointer Output 72
+74(@patchConstantOutput_edges):     73(ptr) Variable Output
+              75:             TypePointer Function 6(float)
+              78:             TypePointer Output 6(float)
+              80:     31(int) Constant 1
+              85:    6(float) Constant 1073741824
+              87:    6(float) Constant 1090519040
+92(HS_CONSTANT_OUT):             TypeStruct
+              93:             TypePointer Output 92(HS_CONSTANT_OUT)
+94(@patchConstantOutput):     93(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+          40(ip):     12(ptr) Variable Function
+       50(param):     12(ptr) Variable Function
+63(@patchConstantResult):     62(ptr) Variable Function
+       67(param):     18(ptr) Variable Function
+       69(param):     20(ptr) Variable Function
+              43:          11 Load 42(ip)
+                              Store 40(ip) 43
+              49:      9(int) Load 48(InvocationId)
+              51:          11 Load 40(ip)
+                              Store 50(param) 51
+              52:  13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param)
+              54:     53(ptr) AccessChain 46(@entryPointOutput) 49
+                              Store 54 52
+                              ControlBarrier 21 55 56
+              57:      9(int) Load 48(InvocationId)
+              59:    58(bool) IEqual 57 32
+                              SelectionMerge 61 None
+                              BranchConditional 59 60 61
+              60:               Label
+              68:      9(int)   Load 64(pid)
+                                Store 67(param) 68
+              70:   19(fvec4)   Load 66(pos)
+                                Store 69(param) 70
+              71:23(HS_CONSTANT_OUT)   FunctionCall 27(PCF(u1;vf4;) 67(param) 69(param)
+                                Store 63(@patchConstantResult) 71
+              76:     75(ptr)   AccessChain 63(@patchConstantResult) 32 32
+              77:    6(float)   Load 76
+              79:     78(ptr)   AccessChain 74(@patchConstantOutput_edges) 32
+                                Store 79 77
+              81:     75(ptr)   AccessChain 63(@patchConstantResult) 32 80
+              82:    6(float)   Load 81
+              83:     78(ptr)   AccessChain 74(@patchConstantOutput_edges) 80
+                                Store 83 82
+                                Branch 61
+              61:             Label
+                              Return
+                              FunctionEnd
+16(@main(struct-VS_OUT-vf31[4];):  13(HS_OUT) Function None 14
+          15(ip):     12(ptr) FunctionParameter
+              17:             Label
+      30(output):     29(ptr) Variable Function
+              34:     33(ptr) AccessChain 15(ip) 32 32
+              35:    7(fvec3) Load 34
+              36:     33(ptr) AccessChain 30(output) 32
+                              Store 36 35
+              37:  13(HS_OUT) Load 30(output)
+                              ReturnValue 37
+                              FunctionEnd
+ 27(PCF(u1;vf4;):23(HS_CONSTANT_OUT) Function None 24
+         25(pid):     18(ptr) FunctionParameter
+         26(pos):     20(ptr) FunctionParameter
+              28:             Label
+      84(output):     62(ptr) Variable Function
+              86:     75(ptr) AccessChain 84(output) 32 32
+                              Store 86 85
+              88:     75(ptr) AccessChain 84(output) 32 80
+                              Store 88 87
+              89:23(HS_CONSTANT_OUT) Load 84(output)
+                              ReturnValue 89
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.hull.void.tesc.out b/Test/baseResults/hlsl.hull.void.tesc.out
index b6e417a..8dc38fc 100644
--- a/Test/baseResults/hlsl.hull.void.tesc.out
+++ b/Test/baseResults/hlsl.hull.void.tesc.out
@@ -2,6 +2,7 @@
 Shader version: 500
 vertices = 3
 vertex spacing = fractional_even_spacing
+triangle order = ccw
 0:? Sequence
 0:26  Function Definition: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint})
 0:26    Function Parameters: 
@@ -57,6 +58,7 @@
 Shader version: 500
 vertices = 3
 vertex spacing = fractional_even_spacing
+triangle order = ccw
 0:? Sequence
 0:26  Function Definition: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint})
 0:26    Function Parameters: 
@@ -116,6 +118,7 @@
                               ExecutionMode 4 OutputVertices 3
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 SpacingFractionalEven
+                              ExecutionMode 4 VertexOrderCcw
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUT"
diff --git a/Test/baseResults/hlsl.if.frag.out b/Test/baseResults/hlsl.if.frag.out
index 89e0bb1..eade928 100755
--- a/Test/baseResults/hlsl.if.frag.out
+++ b/Test/baseResults/hlsl.if.frag.out
@@ -319,7 +319,7 @@
               48:    7(fvec4) Load 10(input)
               49:   16(bvec4) FOrdEqual 47 48
               50:    15(bool) All 49
-                              SelectionMerge 52 None
+                              SelectionMerge 52 Flatten 
                               BranchConditional 50 51 52
               51:               Label
               53:    7(fvec4)   Load 10(input)
diff --git a/Test/baseResults/hlsl.implicitBool.frag.out b/Test/baseResults/hlsl.implicitBool.frag.out
index 476769b..3eb559b 100755
--- a/Test/baseResults/hlsl.implicitBool.frag.out
+++ b/Test/baseResults/hlsl.implicitBool.frag.out
@@ -358,8 +358,8 @@
                               Name 138  "@entryPointOutput"
                               MemberDecorate 16($Global) 0 Offset 0
                               MemberDecorate 16($Global) 1 Offset 4
-                              MemberDecorate 16($Global) 2 Offset 8
-                              MemberDecorate 16($Global) 3 Offset 12
+                              MemberDecorate 16($Global) 2 Offset 16
+                              MemberDecorate 16($Global) 3 Offset 32
                               Decorate 16($Global) Block
                               Decorate 18 DescriptorSet 0
                               Decorate 138(@entryPointOutput) Location 0
diff --git a/Test/baseResults/hlsl.inoutquals.frag.out b/Test/baseResults/hlsl.inoutquals.frag.out
index d5cce21..3f7f139 100644
--- a/Test/baseResults/hlsl.inoutquals.frag.out
+++ b/Test/baseResults/hlsl.inoutquals.frag.out
@@ -2,11 +2,12 @@
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:8  Function Definition: MyFunc(f1;f1;f1; ( temp void)
+0:8  Function Definition: MyFunc(f1;f1;f1;f1; ( temp void)
 0:8    Function Parameters: 
 0:8      'x' ( in float)
 0:8      'y' ( out float)
 0:8      'z' ( inout float)
+0:8      'w' ( inout float)
 0:?     Sequence
 0:9      move second child to first child ( temp float)
 0:9        'y' ( out float)
@@ -18,71 +19,79 @@
 0:11        'x' ( in float)
 0:11        Constant:
 0:11          -1.000000
-0:15  Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15    Function Parameters: 
-0:15      'inpos' ( in 4-component vector of float)
-0:15      'sampleMask' ( out int)
+0:12      multiply second child into first child ( temp float)
+0:12        'w' ( inout float)
+0:12        Constant:
+0:12          1.000000
+0:16  Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16    Function Parameters: 
+0:16      'inpos' ( in 4-component vector of float)
+0:16      'sampleMask' ( out int)
 0:?     Sequence
-0:18      Sequence
-0:18        move second child to first child ( temp float)
-0:18          'x' ( temp float)
-0:18          Constant:
-0:18            7.000000
-0:18        move second child to first child ( temp float)
-0:18          'z' ( temp float)
-0:18          Constant:
-0:18            3.000000
-0:19      Function Call: MyFunc(f1;f1;f1; ( temp void)
-0:19        'x' ( temp float)
-0:19        'y' ( temp float)
-0:19        'z' ( temp float)
-0:21      move second child to first child ( temp 4-component vector of float)
-0:21        Color: direct index for structure ( temp 4-component vector of float)
-0:21          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:21          Constant:
-0:21            0 (const int)
-0:?         Construct vec4 ( temp 4-component vector of float)
-0:21          'x' ( temp float)
-0:21          'y' ( temp float)
-0:21          'z' ( temp float)
-0:21          Constant:
-0:21            1.000000
-0:22      move second child to first child ( temp float)
-0:22        Depth: direct index for structure ( temp float)
+0:19      Sequence
+0:19        move second child to first child ( temp float)
+0:19          'x' ( temp float)
+0:19          Constant:
+0:19            7.000000
+0:19        move second child to first child ( temp float)
+0:19          'z' ( temp float)
+0:19          Constant:
+0:19            3.000000
+0:20      Function Call: MyFunc(f1;f1;f1;f1; ( temp void)
+0:20        'x' ( temp float)
+0:20        'y' ( temp float)
+0:20        'z' ( temp float)
+0:20        direct index ( temp float)
+0:20          'inpos' ( in 4-component vector of float)
+0:20          Constant:
+0:20            3 (const int)
+0:22      move second child to first child ( temp 4-component vector of float)
+0:22        Color: direct index for structure ( temp 4-component vector of float)
 0:22          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:22          Constant:
-0:22            1 (const int)
-0:22        direct index ( temp float)
-0:22          'inpos' ( in 4-component vector of float)
+0:22            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:22          'x' ( temp float)
+0:22          'y' ( temp float)
+0:22          'z' ( temp float)
 0:22          Constant:
-0:22            3 (const int)
-0:24      Branch: Return with expression
-0:24        'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15  Function Definition: main( ( temp void)
-0:15    Function Parameters: 
+0:22            1.000000
+0:23      move second child to first child ( temp float)
+0:23        Depth: direct index for structure ( temp float)
+0:23          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:23          Constant:
+0:23            1 (const int)
+0:23        direct index ( temp float)
+0:23          'inpos' ( in 4-component vector of float)
+0:23          Constant:
+0:23            3 (const int)
+0:25      Branch: Return with expression
+0:25        'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16  Function Definition: main( ( temp void)
+0:16    Function Parameters: 
 0:?     Sequence
-0:15      move second child to first child ( temp 4-component vector of float)
+0:16      move second child to first child ( temp 4-component vector of float)
 0:?         'inpos' ( temp 4-component vector of float)
 0:?         'inpos' ( noperspective in 4-component vector of float FragCoord)
-0:15      Sequence
-0:15        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15          Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16      Sequence
+0:16        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16          Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:?             'inpos' ( temp 4-component vector of float)
 0:?             'sampleMask' ( temp int)
-0:15        move second child to first child ( temp 4-component vector of float)
+0:16        move second child to first child ( temp 4-component vector of float)
 0:?           'Color' (layout( location=0) out 4-component vector of float)
-0:15          Color: direct index for structure ( temp 4-component vector of float)
-0:15            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15            Constant:
-0:15              0 (const int)
-0:15        move second child to first child ( temp float)
+0:16          Color: direct index for structure ( temp 4-component vector of float)
+0:16            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16            Constant:
+0:16              0 (const int)
+0:16        move second child to first child ( temp float)
 0:?           'Depth' ( out float FragDepth)
-0:15          Depth: direct index for structure ( temp float)
-0:15            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15            Constant:
-0:15              1 (const int)
-0:15      move second child to first child ( temp int)
+0:16          Depth: direct index for structure ( temp float)
+0:16            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16            Constant:
+0:16              1 (const int)
+0:16      move second child to first child ( temp int)
 0:?         'sampleMask' ( out int SampleMaskIn)
 0:?         'sampleMask' ( temp int)
 0:?   Linker Objects
@@ -98,11 +107,12 @@
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:8  Function Definition: MyFunc(f1;f1;f1; ( temp void)
+0:8  Function Definition: MyFunc(f1;f1;f1;f1; ( temp void)
 0:8    Function Parameters: 
 0:8      'x' ( in float)
 0:8      'y' ( out float)
 0:8      'z' ( inout float)
+0:8      'w' ( inout float)
 0:?     Sequence
 0:9      move second child to first child ( temp float)
 0:9        'y' ( out float)
@@ -114,71 +124,79 @@
 0:11        'x' ( in float)
 0:11        Constant:
 0:11          -1.000000
-0:15  Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15    Function Parameters: 
-0:15      'inpos' ( in 4-component vector of float)
-0:15      'sampleMask' ( out int)
+0:12      multiply second child into first child ( temp float)
+0:12        'w' ( inout float)
+0:12        Constant:
+0:12          1.000000
+0:16  Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16    Function Parameters: 
+0:16      'inpos' ( in 4-component vector of float)
+0:16      'sampleMask' ( out int)
 0:?     Sequence
-0:18      Sequence
-0:18        move second child to first child ( temp float)
-0:18          'x' ( temp float)
-0:18          Constant:
-0:18            7.000000
-0:18        move second child to first child ( temp float)
-0:18          'z' ( temp float)
-0:18          Constant:
-0:18            3.000000
-0:19      Function Call: MyFunc(f1;f1;f1; ( temp void)
-0:19        'x' ( temp float)
-0:19        'y' ( temp float)
-0:19        'z' ( temp float)
-0:21      move second child to first child ( temp 4-component vector of float)
-0:21        Color: direct index for structure ( temp 4-component vector of float)
-0:21          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:21          Constant:
-0:21            0 (const int)
-0:?         Construct vec4 ( temp 4-component vector of float)
-0:21          'x' ( temp float)
-0:21          'y' ( temp float)
-0:21          'z' ( temp float)
-0:21          Constant:
-0:21            1.000000
-0:22      move second child to first child ( temp float)
-0:22        Depth: direct index for structure ( temp float)
+0:19      Sequence
+0:19        move second child to first child ( temp float)
+0:19          'x' ( temp float)
+0:19          Constant:
+0:19            7.000000
+0:19        move second child to first child ( temp float)
+0:19          'z' ( temp float)
+0:19          Constant:
+0:19            3.000000
+0:20      Function Call: MyFunc(f1;f1;f1;f1; ( temp void)
+0:20        'x' ( temp float)
+0:20        'y' ( temp float)
+0:20        'z' ( temp float)
+0:20        direct index ( temp float)
+0:20          'inpos' ( in 4-component vector of float)
+0:20          Constant:
+0:20            3 (const int)
+0:22      move second child to first child ( temp 4-component vector of float)
+0:22        Color: direct index for structure ( temp 4-component vector of float)
 0:22          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:22          Constant:
-0:22            1 (const int)
-0:22        direct index ( temp float)
-0:22          'inpos' ( in 4-component vector of float)
+0:22            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:22          'x' ( temp float)
+0:22          'y' ( temp float)
+0:22          'z' ( temp float)
 0:22          Constant:
-0:22            3 (const int)
-0:24      Branch: Return with expression
-0:24        'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15  Function Definition: main( ( temp void)
-0:15    Function Parameters: 
+0:22            1.000000
+0:23      move second child to first child ( temp float)
+0:23        Depth: direct index for structure ( temp float)
+0:23          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:23          Constant:
+0:23            1 (const int)
+0:23        direct index ( temp float)
+0:23          'inpos' ( in 4-component vector of float)
+0:23          Constant:
+0:23            3 (const int)
+0:25      Branch: Return with expression
+0:25        'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16  Function Definition: main( ( temp void)
+0:16    Function Parameters: 
 0:?     Sequence
-0:15      move second child to first child ( temp 4-component vector of float)
+0:16      move second child to first child ( temp 4-component vector of float)
 0:?         'inpos' ( temp 4-component vector of float)
 0:?         'inpos' ( noperspective in 4-component vector of float FragCoord)
-0:15      Sequence
-0:15        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15          Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16      Sequence
+0:16        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16          Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:?             'inpos' ( temp 4-component vector of float)
 0:?             'sampleMask' ( temp int)
-0:15        move second child to first child ( temp 4-component vector of float)
+0:16        move second child to first child ( temp 4-component vector of float)
 0:?           'Color' (layout( location=0) out 4-component vector of float)
-0:15          Color: direct index for structure ( temp 4-component vector of float)
-0:15            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15            Constant:
-0:15              0 (const int)
-0:15        move second child to first child ( temp float)
+0:16          Color: direct index for structure ( temp 4-component vector of float)
+0:16            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16            Constant:
+0:16              0 (const int)
+0:16        move second child to first child ( temp float)
 0:?           'Depth' ( out float FragDepth)
-0:15          Depth: direct index for structure ( temp float)
-0:15            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:15            Constant:
-0:15              1 (const int)
-0:15      move second child to first child ( temp int)
+0:16          Depth: direct index for structure ( temp float)
+0:16            'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:16            Constant:
+0:16              1 (const int)
+0:16      move second child to first child ( temp int)
 0:?         'sampleMask' ( out int SampleMaskIn)
 0:?         'sampleMask' ( temp int)
 0:?   Linker Objects
@@ -189,144 +207,157 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 80
+// Id's are bound by 88
 
                               Capability Shader
                               Capability SampleRateShading
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 60 70 74 78
+                              EntryPoint Fragment 4  "main" 68 78 82 86
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
-                              Name 12  "MyFunc(f1;f1;f1;"
+                              Name 13  "MyFunc(f1;f1;f1;f1;"
                               Name 9  "x"
                               Name 10  "y"
                               Name 11  "z"
-                              Name 18  "PS_OUTPUT"
-                              MemberName 18(PS_OUTPUT) 0  "Color"
-                              MemberName 18(PS_OUTPUT) 1  "Depth"
-                              Name 22  "@main(vf4;i1;"
-                              Name 20  "inpos"
-                              Name 21  "sampleMask"
-                              Name 27  "x"
-                              Name 29  "z"
-                              Name 31  "y"
-                              Name 32  "param"
-                              Name 34  "param"
-                              Name 35  "param"
-                              Name 41  "psout"
-                              Name 58  "inpos"
-                              Name 60  "inpos"
-                              Name 62  "flattenTemp"
-                              Name 63  "sampleMask"
-                              Name 64  "param"
-                              Name 66  "param"
-                              Name 70  "Color"
-                              Name 74  "Depth"
-                              Name 78  "sampleMask"
-                              Decorate 60(inpos) NoPerspective
-                              Decorate 60(inpos) BuiltIn FragCoord
-                              Decorate 70(Color) Location 0
-                              Decorate 74(Depth) BuiltIn FragDepth
-                              Decorate 78(sampleMask) BuiltIn SampleMask
+                              Name 12  "w"
+                              Name 19  "PS_OUTPUT"
+                              MemberName 19(PS_OUTPUT) 0  "Color"
+                              MemberName 19(PS_OUTPUT) 1  "Depth"
+                              Name 23  "@main(vf4;i1;"
+                              Name 21  "inpos"
+                              Name 22  "sampleMask"
+                              Name 31  "x"
+                              Name 33  "z"
+                              Name 35  "y"
+                              Name 36  "param"
+                              Name 38  "param"
+                              Name 39  "param"
+                              Name 41  "param"
+                              Name 52  "psout"
+                              Name 66  "inpos"
+                              Name 68  "inpos"
+                              Name 70  "flattenTemp"
+                              Name 71  "sampleMask"
+                              Name 72  "param"
+                              Name 74  "param"
+                              Name 78  "Color"
+                              Name 82  "Depth"
+                              Name 86  "sampleMask"
+                              Decorate 68(inpos) NoPerspective
+                              Decorate 68(inpos) BuiltIn FragCoord
+                              Decorate 78(Color) Location 0
+                              Decorate 82(Depth) BuiltIn FragDepth
+                              Decorate 86(sampleMask) BuiltIn SampleMask
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypePointer Function 6(float)
-               8:             TypeFunction 2 7(ptr) 7(ptr) 7(ptr)
-              14:             TypeVector 6(float) 4
-              15:             TypePointer Function 14(fvec4)
-              16:             TypeInt 32 1
-              17:             TypePointer Function 16(int)
-   18(PS_OUTPUT):             TypeStruct 14(fvec4) 6(float)
-              19:             TypeFunction 18(PS_OUTPUT) 15(ptr) 17(ptr)
-              26:    6(float) Constant 3212836864
-              28:    6(float) Constant 1088421888
-              30:    6(float) Constant 1077936128
-              40:             TypePointer Function 18(PS_OUTPUT)
-              42:     16(int) Constant 0
-              46:    6(float) Constant 1065353216
-              49:     16(int) Constant 1
-              50:             TypeInt 32 0
-              51:     50(int) Constant 3
-              59:             TypePointer Input 14(fvec4)
-       60(inpos):     59(ptr) Variable Input
-              69:             TypePointer Output 14(fvec4)
-       70(Color):     69(ptr) Variable Output
-              73:             TypePointer Output 6(float)
-       74(Depth):     73(ptr) Variable Output
-              77:             TypePointer Output 16(int)
-  78(sampleMask):     77(ptr) Variable Output
+               8:             TypeFunction 2 7(ptr) 7(ptr) 7(ptr) 7(ptr)
+              15:             TypeVector 6(float) 4
+              16:             TypePointer Function 15(fvec4)
+              17:             TypeInt 32 1
+              18:             TypePointer Function 17(int)
+   19(PS_OUTPUT):             TypeStruct 15(fvec4) 6(float)
+              20:             TypeFunction 19(PS_OUTPUT) 16(ptr) 18(ptr)
+              27:    6(float) Constant 3212836864
+              28:    6(float) Constant 1065353216
+              32:    6(float) Constant 1088421888
+              34:    6(float) Constant 1077936128
+              42:             TypeInt 32 0
+              43:     42(int) Constant 3
+              51:             TypePointer Function 19(PS_OUTPUT)
+              53:     17(int) Constant 0
+              59:     17(int) Constant 1
+              67:             TypePointer Input 15(fvec4)
+       68(inpos):     67(ptr) Variable Input
+              77:             TypePointer Output 15(fvec4)
+       78(Color):     77(ptr) Variable Output
+              81:             TypePointer Output 6(float)
+       82(Depth):     81(ptr) Variable Output
+              85:             TypePointer Output 17(int)
+  86(sampleMask):     85(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
-       58(inpos):     15(ptr) Variable Function
- 62(flattenTemp):     40(ptr) Variable Function
-  63(sampleMask):     17(ptr) Variable Function
-       64(param):     15(ptr) Variable Function
-       66(param):     17(ptr) Variable Function
-              61:   14(fvec4) Load 60(inpos)
-                              Store 58(inpos) 61
-              65:   14(fvec4) Load 58(inpos)
-                              Store 64(param) 65
-              67:18(PS_OUTPUT) FunctionCall 22(@main(vf4;i1;) 64(param) 66(param)
-              68:     16(int) Load 66(param)
-                              Store 63(sampleMask) 68
-                              Store 62(flattenTemp) 67
-              71:     15(ptr) AccessChain 62(flattenTemp) 42
-              72:   14(fvec4) Load 71
-                              Store 70(Color) 72
-              75:      7(ptr) AccessChain 62(flattenTemp) 49
-              76:    6(float) Load 75
-                              Store 74(Depth) 76
-              79:     16(int) Load 63(sampleMask)
-                              Store 78(sampleMask) 79
+       66(inpos):     16(ptr) Variable Function
+ 70(flattenTemp):     51(ptr) Variable Function
+  71(sampleMask):     18(ptr) Variable Function
+       72(param):     16(ptr) Variable Function
+       74(param):     18(ptr) Variable Function
+              69:   15(fvec4) Load 68(inpos)
+                              Store 66(inpos) 69
+              73:   15(fvec4) Load 66(inpos)
+                              Store 72(param) 73
+              75:19(PS_OUTPUT) FunctionCall 23(@main(vf4;i1;) 72(param) 74(param)
+              76:     17(int) Load 74(param)
+                              Store 71(sampleMask) 76
+                              Store 70(flattenTemp) 75
+              79:     16(ptr) AccessChain 70(flattenTemp) 53
+              80:   15(fvec4) Load 79
+                              Store 78(Color) 80
+              83:      7(ptr) AccessChain 70(flattenTemp) 59
+              84:    6(float) Load 83
+                              Store 82(Depth) 84
+              87:     17(int) Load 71(sampleMask)
+                              Store 86(sampleMask) 87
                               Return
                               FunctionEnd
-12(MyFunc(f1;f1;f1;):           2 Function None 8
+13(MyFunc(f1;f1;f1;f1;):           2 Function None 8
             9(x):      7(ptr) FunctionParameter
            10(y):      7(ptr) FunctionParameter
            11(z):      7(ptr) FunctionParameter
-              13:             Label
-              24:    6(float) Load 9(x)
-                              Store 10(y) 24
-              25:    6(float) Load 10(y)
-                              Store 11(z) 25
-                              Store 9(x) 26
+           12(w):      7(ptr) FunctionParameter
+              14:             Label
+              25:    6(float) Load 9(x)
+                              Store 10(y) 25
+              26:    6(float) Load 10(y)
+                              Store 11(z) 26
+                              Store 9(x) 27
+              29:    6(float) Load 12(w)
+              30:    6(float) FMul 29 28
+                              Store 12(w) 30
                               Return
                               FunctionEnd
-22(@main(vf4;i1;):18(PS_OUTPUT) Function None 19
-       20(inpos):     15(ptr) FunctionParameter
-  21(sampleMask):     17(ptr) FunctionParameter
-              23:             Label
-           27(x):      7(ptr) Variable Function
-           29(z):      7(ptr) Variable Function
-           31(y):      7(ptr) Variable Function
-       32(param):      7(ptr) Variable Function
-       34(param):      7(ptr) Variable Function
-       35(param):      7(ptr) Variable Function
-       41(psout):     40(ptr) Variable Function
-                              Store 27(x) 28
-                              Store 29(z) 30
-              33:    6(float) Load 27(x)
-                              Store 32(param) 33
-              36:    6(float) Load 29(z)
-                              Store 35(param) 36
-              37:           2 FunctionCall 12(MyFunc(f1;f1;f1;) 32(param) 34(param) 35(param)
-              38:    6(float) Load 34(param)
-                              Store 31(y) 38
-              39:    6(float) Load 35(param)
-                              Store 29(z) 39
-              43:    6(float) Load 27(x)
-              44:    6(float) Load 31(y)
-              45:    6(float) Load 29(z)
-              47:   14(fvec4) CompositeConstruct 43 44 45 46
-              48:     15(ptr) AccessChain 41(psout) 42
-                              Store 48 47
-              52:      7(ptr) AccessChain 20(inpos) 51
-              53:    6(float) Load 52
-              54:      7(ptr) AccessChain 41(psout) 49
-                              Store 54 53
-              55:18(PS_OUTPUT) Load 41(psout)
-                              ReturnValue 55
+23(@main(vf4;i1;):19(PS_OUTPUT) Function None 20
+       21(inpos):     16(ptr) FunctionParameter
+  22(sampleMask):     18(ptr) FunctionParameter
+              24:             Label
+           31(x):      7(ptr) Variable Function
+           33(z):      7(ptr) Variable Function
+           35(y):      7(ptr) Variable Function
+       36(param):      7(ptr) Variable Function
+       38(param):      7(ptr) Variable Function
+       39(param):      7(ptr) Variable Function
+       41(param):      7(ptr) Variable Function
+       52(psout):     51(ptr) Variable Function
+                              Store 31(x) 32
+                              Store 33(z) 34
+              37:    6(float) Load 31(x)
+                              Store 36(param) 37
+              40:    6(float) Load 33(z)
+                              Store 39(param) 40
+              44:      7(ptr) AccessChain 21(inpos) 43
+              45:    6(float) Load 44
+                              Store 41(param) 45
+              46:           2 FunctionCall 13(MyFunc(f1;f1;f1;f1;) 36(param) 38(param) 39(param) 41(param)
+              47:    6(float) Load 38(param)
+                              Store 35(y) 47
+              48:    6(float) Load 39(param)
+                              Store 33(z) 48
+              49:    6(float) Load 41(param)
+              50:      7(ptr) AccessChain 21(inpos) 43
+                              Store 50 49
+              54:    6(float) Load 31(x)
+              55:    6(float) Load 35(y)
+              56:    6(float) Load 33(z)
+              57:   15(fvec4) CompositeConstruct 54 55 56 28
+              58:     16(ptr) AccessChain 52(psout) 53
+                              Store 58 57
+              60:      7(ptr) AccessChain 21(inpos) 43
+              61:    6(float) Load 60
+              62:      7(ptr) AccessChain 52(psout) 59
+                              Store 62 61
+              63:19(PS_OUTPUT) Load 52(psout)
+                              ReturnValue 63
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.intrinsics.comp.out b/Test/baseResults/hlsl.intrinsics.comp.out
index bff1886..09a4a5d 100644
--- a/Test/baseResults/hlsl.intrinsics.comp.out
+++ b/Test/baseResults/hlsl.intrinsics.comp.out
@@ -11,7 +11,8 @@
 0:17      'inU1' ( in uint)
 0:?     Sequence
 0:21      all ( temp bool)
-0:21        'inF0' ( in float)
+0:21        Convert float to bool ( temp bool)
+0:21          'inF0' ( in float)
 0:24      AtomicAdd ( temp void)
 0:24        'gs_ua' ( shared uint)
 0:24        'gs_ub' ( shared uint)
@@ -92,7 +93,8 @@
 0:51      'inU1' ( in 2-component vector of uint)
 0:?     Sequence
 0:55      all ( temp bool)
-0:55        'inF0' ( in 2-component vector of float)
+0:55        Convert float to bool ( temp 2-component vector of bool)
+0:55          'inF0' ( in 2-component vector of float)
 0:58      AtomicAdd ( temp void)
 0:58        'gs_ua2' ( shared 2-component vector of uint)
 0:58        'gs_ub2' ( shared 2-component vector of uint)
@@ -165,7 +167,8 @@
 0:78      'inU1' ( in 3-component vector of uint)
 0:?     Sequence
 0:82      all ( temp bool)
-0:82        'inF0' ( in 3-component vector of float)
+0:82        Convert float to bool ( temp 3-component vector of bool)
+0:82          'inF0' ( in 3-component vector of float)
 0:85      AtomicAdd ( temp void)
 0:85        'gs_ua3' ( shared 3-component vector of uint)
 0:85        'gs_ub3' ( shared 3-component vector of uint)
@@ -239,7 +242,8 @@
 0:105      'inU1' ( in 4-component vector of uint)
 0:?     Sequence
 0:109      all ( temp bool)
-0:109        'inF0' ( in 4-component vector of float)
+0:109        Convert float to bool ( temp 4-component vector of bool)
+0:109          'inF0' ( in 4-component vector of float)
 0:112      AtomicAdd ( temp void)
 0:112        'gs_ua4' ( shared 4-component vector of uint)
 0:112        'gs_ub4' ( shared 4-component vector of uint)
@@ -367,7 +371,8 @@
 0:17      'inU1' ( in uint)
 0:?     Sequence
 0:21      all ( temp bool)
-0:21        'inF0' ( in float)
+0:21        Convert float to bool ( temp bool)
+0:21          'inF0' ( in float)
 0:24      AtomicAdd ( temp void)
 0:24        'gs_ua' ( shared uint)
 0:24        'gs_ub' ( shared uint)
@@ -448,7 +453,8 @@
 0:51      'inU1' ( in 2-component vector of uint)
 0:?     Sequence
 0:55      all ( temp bool)
-0:55        'inF0' ( in 2-component vector of float)
+0:55        Convert float to bool ( temp 2-component vector of bool)
+0:55          'inF0' ( in 2-component vector of float)
 0:58      AtomicAdd ( temp void)
 0:58        'gs_ua2' ( shared 2-component vector of uint)
 0:58        'gs_ub2' ( shared 2-component vector of uint)
@@ -521,7 +527,8 @@
 0:78      'inU1' ( in 3-component vector of uint)
 0:?     Sequence
 0:82      all ( temp bool)
-0:82        'inF0' ( in 3-component vector of float)
+0:82        Convert float to bool ( temp 3-component vector of bool)
+0:82          'inF0' ( in 3-component vector of float)
 0:85      AtomicAdd ( temp void)
 0:85        'gs_ua3' ( shared 3-component vector of uint)
 0:85        'gs_ub3' ( shared 3-component vector of uint)
@@ -595,7 +602,8 @@
 0:105      'inU1' ( in 4-component vector of uint)
 0:?     Sequence
 0:109      all ( temp bool)
-0:109        'inF0' ( in 4-component vector of float)
+0:109        Convert float to bool ( temp 4-component vector of bool)
+0:109          'inF0' ( in 4-component vector of float)
 0:112      AtomicAdd ( temp void)
 0:112        'gs_ua4' ( shared 4-component vector of uint)
 0:112        'gs_ub4' ( shared 4-component vector of uint)
@@ -709,12 +717,12 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 255
+// Id's are bound by 265
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint GLCompute 4  "ComputeShaderFunction" 227 230 233 237 240 243
+                              EntryPoint GLCompute 4  "ComputeShaderFunction" 237 240 243 247 250 253
                               ExecutionMode 4 LocalSize 1 1 1
                               Source HLSL 500
                               Name 4  "ComputeShaderFunction"
@@ -746,44 +754,44 @@
                               Name 55  "inF2"
                               Name 56  "inU0"
                               Name 57  "inU1"
-                              Name 64  "gs_ua"
-                              Name 65  "gs_ub"
-                              Name 70  "out_u1"
-                              Name 78  "gs_uc"
-                              Name 107  "gs_ua2"
-                              Name 108  "gs_ub2"
-                              Name 111  "out_u2"
-                              Name 119  "gs_uc2"
-                              Name 148  "gs_ua3"
-                              Name 149  "gs_ub3"
-                              Name 152  "out_u3"
-                              Name 160  "gs_uc3"
-                              Name 188  "gs_ua4"
-                              Name 189  "gs_ub4"
-                              Name 192  "out_u4"
-                              Name 200  "gs_uc4"
-                              Name 225  "inF0"
-                              Name 227  "inF0"
-                              Name 229  "inF1"
-                              Name 230  "inF1"
-                              Name 232  "inF2"
-                              Name 233  "inF2"
-                              Name 235  "inU0"
-                              Name 237  "inU0"
-                              Name 239  "inU1"
-                              Name 240  "inU1"
-                              Name 243  "@entryPointOutput"
-                              Name 244  "param"
-                              Name 246  "param"
-                              Name 248  "param"
-                              Name 250  "param"
-                              Name 252  "param"
-                              Decorate 227(inF0) Location 0
-                              Decorate 230(inF1) Location 1
-                              Decorate 233(inF2) Location 2
-                              Decorate 237(inU0) Location 3
-                              Decorate 240(inU1) Location 4
-                              Decorate 243(@entryPointOutput) Location 0
+                              Name 66  "gs_ua"
+                              Name 67  "gs_ub"
+                              Name 72  "out_u1"
+                              Name 80  "gs_uc"
+                              Name 111  "gs_ua2"
+                              Name 112  "gs_ub2"
+                              Name 115  "out_u2"
+                              Name 123  "gs_uc2"
+                              Name 155  "gs_ua3"
+                              Name 156  "gs_ub3"
+                              Name 159  "out_u3"
+                              Name 167  "gs_uc3"
+                              Name 198  "gs_ua4"
+                              Name 199  "gs_ub4"
+                              Name 202  "out_u4"
+                              Name 210  "gs_uc4"
+                              Name 235  "inF0"
+                              Name 237  "inF0"
+                              Name 239  "inF1"
+                              Name 240  "inF1"
+                              Name 242  "inF2"
+                              Name 243  "inF2"
+                              Name 245  "inU0"
+                              Name 247  "inU0"
+                              Name 249  "inU1"
+                              Name 250  "inU1"
+                              Name 253  "@entryPointOutput"
+                              Name 254  "param"
+                              Name 256  "param"
+                              Name 258  "param"
+                              Name 260  "param"
+                              Name 262  "param"
+                              Decorate 237(inF0) Location 0
+                              Decorate 240(inF1) Location 1
+                              Decorate 243(inF2) Location 2
+                              Decorate 247(inU0) Location 3
+                              Decorate 250(inU1) Location 4
+                              Decorate 253(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -808,75 +816,81 @@
               51:             TypePointer Function 50(ivec4)
               52:             TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr)
               61:             TypeBool
-              63:             TypePointer Workgroup 8(int)
-       64(gs_ua):     63(ptr) Variable Workgroup
-       65(gs_ub):     63(ptr) Variable Workgroup
-              67:      8(int) Constant 1
-              68:      8(int) Constant 0
-       78(gs_uc):     63(ptr) Variable Workgroup
-              99:    6(float) Constant 0
-             106:             TypePointer Workgroup 26(ivec2)
-     107(gs_ua2):    106(ptr) Variable Workgroup
-     108(gs_ub2):    106(ptr) Variable Workgroup
-     119(gs_uc2):    106(ptr) Variable Workgroup
-             140:    6(float) Constant 1065353216
-             141:    6(float) Constant 1073741824
-             142:   24(fvec2) ConstantComposite 140 141
-             147:             TypePointer Workgroup 38(ivec3)
-     148(gs_ua3):    147(ptr) Variable Workgroup
-     149(gs_ub3):    147(ptr) Variable Workgroup
-     160(gs_uc3):    147(ptr) Variable Workgroup
-             181:    6(float) Constant 1077936128
-             182:   36(fvec3) ConstantComposite 140 141 181
-             187:             TypePointer Workgroup 50(ivec4)
-     188(gs_ua4):    187(ptr) Variable Workgroup
-     189(gs_ub4):    187(ptr) Variable Workgroup
-     200(gs_uc4):    187(ptr) Variable Workgroup
-             221:    6(float) Constant 1082130432
-             222:   48(fvec4) ConstantComposite 140 141 181 221
-             226:             TypePointer Input 48(fvec4)
-       227(inF0):    226(ptr) Variable Input
-       230(inF1):    226(ptr) Variable Input
-       233(inF2):    226(ptr) Variable Input
-             236:             TypePointer Input 50(ivec4)
-       237(inU0):    236(ptr) Variable Input
-       240(inU1):    236(ptr) Variable Input
-             242:             TypePointer Output 48(fvec4)
-243(@entryPointOutput):    242(ptr) Variable Output
+              62:    6(float) Constant 0
+              65:             TypePointer Workgroup 8(int)
+       66(gs_ua):     65(ptr) Variable Workgroup
+       67(gs_ub):     65(ptr) Variable Workgroup
+              69:      8(int) Constant 1
+              70:      8(int) Constant 0
+       80(gs_uc):     65(ptr) Variable Workgroup
+             106:             TypeVector 61(bool) 2
+             107:   24(fvec2) ConstantComposite 62 62
+             110:             TypePointer Workgroup 26(ivec2)
+     111(gs_ua2):    110(ptr) Variable Workgroup
+     112(gs_ub2):    110(ptr) Variable Workgroup
+     123(gs_uc2):    110(ptr) Variable Workgroup
+             144:    6(float) Constant 1065353216
+             145:    6(float) Constant 1073741824
+             146:   24(fvec2) ConstantComposite 144 145
+             150:             TypeVector 61(bool) 3
+             151:   36(fvec3) ConstantComposite 62 62 62
+             154:             TypePointer Workgroup 38(ivec3)
+     155(gs_ua3):    154(ptr) Variable Workgroup
+     156(gs_ub3):    154(ptr) Variable Workgroup
+     167(gs_uc3):    154(ptr) Variable Workgroup
+             188:    6(float) Constant 1077936128
+             189:   36(fvec3) ConstantComposite 144 145 188
+             193:             TypeVector 61(bool) 4
+             194:   48(fvec4) ConstantComposite 62 62 62 62
+             197:             TypePointer Workgroup 50(ivec4)
+     198(gs_ua4):    197(ptr) Variable Workgroup
+     199(gs_ub4):    197(ptr) Variable Workgroup
+     210(gs_uc4):    197(ptr) Variable Workgroup
+             231:    6(float) Constant 1082130432
+             232:   48(fvec4) ConstantComposite 144 145 188 231
+             236:             TypePointer Input 48(fvec4)
+       237(inF0):    236(ptr) Variable Input
+       240(inF1):    236(ptr) Variable Input
+       243(inF2):    236(ptr) Variable Input
+             246:             TypePointer Input 50(ivec4)
+       247(inU0):    246(ptr) Variable Input
+       250(inU1):    246(ptr) Variable Input
+             252:             TypePointer Output 48(fvec4)
+253(@entryPointOutput):    252(ptr) Variable Output
 4(ComputeShaderFunction):           2 Function None 3
                5:             Label
-       225(inF0):     49(ptr) Variable Function
-       229(inF1):     49(ptr) Variable Function
-       232(inF2):     49(ptr) Variable Function
-       235(inU0):     51(ptr) Variable Function
-       239(inU1):     51(ptr) Variable Function
-      244(param):     49(ptr) Variable Function
-      246(param):     49(ptr) Variable Function
-      248(param):     49(ptr) Variable Function
-      250(param):     51(ptr) Variable Function
-      252(param):     51(ptr) Variable Function
-             228:   48(fvec4) Load 227(inF0)
-                              Store 225(inF0) 228
-             231:   48(fvec4) Load 230(inF1)
-                              Store 229(inF1) 231
-             234:   48(fvec4) Load 233(inF2)
-                              Store 232(inF2) 234
-             238:   50(ivec4) Load 237(inU0)
-                              Store 235(inU0) 238
-             241:   50(ivec4) Load 240(inU1)
-                              Store 239(inU1) 241
-             245:   48(fvec4) Load 225(inF0)
-                              Store 244(param) 245
-             247:   48(fvec4) Load 229(inF1)
-                              Store 246(param) 247
-             249:   48(fvec4) Load 232(inF2)
-                              Store 248(param) 249
-             251:   50(ivec4) Load 235(inU0)
-                              Store 250(param) 251
-             253:   50(ivec4) Load 239(inU1)
-                              Store 252(param) 253
-             254:   48(fvec4) FunctionCall 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;) 244(param) 246(param) 248(param) 250(param) 252(param)
-                              Store 243(@entryPointOutput) 254
+       235(inF0):     49(ptr) Variable Function
+       239(inF1):     49(ptr) Variable Function
+       242(inF2):     49(ptr) Variable Function
+       245(inU0):     51(ptr) Variable Function
+       249(inU1):     51(ptr) Variable Function
+      254(param):     49(ptr) Variable Function
+      256(param):     49(ptr) Variable Function
+      258(param):     49(ptr) Variable Function
+      260(param):     51(ptr) Variable Function
+      262(param):     51(ptr) Variable Function
+             238:   48(fvec4) Load 237(inF0)
+                              Store 235(inF0) 238
+             241:   48(fvec4) Load 240(inF1)
+                              Store 239(inF1) 241
+             244:   48(fvec4) Load 243(inF2)
+                              Store 242(inF2) 244
+             248:   50(ivec4) Load 247(inU0)
+                              Store 245(inU0) 248
+             251:   50(ivec4) Load 250(inU1)
+                              Store 249(inU1) 251
+             255:   48(fvec4) Load 235(inF0)
+                              Store 254(param) 255
+             257:   48(fvec4) Load 239(inF1)
+                              Store 256(param) 257
+             259:   48(fvec4) Load 242(inF2)
+                              Store 258(param) 259
+             261:   50(ivec4) Load 245(inU0)
+                              Store 260(param) 261
+             263:   50(ivec4) Load 249(inU1)
+                              Store 262(param) 263
+             264:   48(fvec4) FunctionCall 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;) 254(param) 256(param) 258(param) 260(param) 262(param)
+                              Store 253(@entryPointOutput) 264
                               Return
                               FunctionEnd
 16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;):    6(float) Function None 10
@@ -886,54 +900,55 @@
         14(inU0):      9(ptr) FunctionParameter
         15(inU1):      9(ptr) FunctionParameter
               17:             Label
-      70(out_u1):      9(ptr) Variable Function
+      72(out_u1):      9(ptr) Variable Function
               60:    6(float) Load 11(inF0)
-              62:    61(bool) All 60
-              66:      8(int) Load 65(gs_ub)
-              69:           2 AtomicIAdd 64(gs_ua) 67 68 66
-              71:      8(int) Load 65(gs_ub)
-              72:      8(int) AtomicIAdd 64(gs_ua) 67 68 71
-                              Store 70(out_u1) 72
-              73:      8(int) Load 65(gs_ub)
-              74:           2 AtomicAnd 64(gs_ua) 67 68 73
-              75:      8(int) Load 65(gs_ub)
-              76:      8(int) AtomicAnd 64(gs_ua) 67 68 75
-                              Store 70(out_u1) 76
-              77:      8(int) Load 65(gs_ub)
-              79:      8(int) Load 78(gs_uc)
-              80:      8(int) AtomicCompareExchange 64(gs_ua) 67 68 68 79 77
-                              Store 70(out_u1) 80
-              81:      8(int) Load 65(gs_ub)
-              82:      8(int) AtomicExchange 64(gs_ua) 67 68 81
-                              Store 70(out_u1) 82
-              83:      8(int) Load 65(gs_ub)
-              84:           2 AtomicSMax 64(gs_ua) 67 68 83
-              85:      8(int) Load 65(gs_ub)
-              86:      8(int) AtomicUMax 64(gs_ua) 67 68 85
-                              Store 70(out_u1) 86
-              87:      8(int) Load 65(gs_ub)
-              88:           2 AtomicSMin 64(gs_ua) 67 68 87
-              89:      8(int) Load 65(gs_ub)
-              90:      8(int) AtomicUMin 64(gs_ua) 67 68 89
-                              Store 70(out_u1) 90
-              91:      8(int) Load 65(gs_ub)
-              92:           2 AtomicOr 64(gs_ua) 67 68 91
-              93:      8(int) Load 65(gs_ub)
-              94:      8(int) AtomicOr 64(gs_ua) 67 68 93
-                              Store 70(out_u1) 94
-              95:      8(int) Load 65(gs_ub)
-              96:           2 AtomicXor 64(gs_ua) 67 68 95
-              97:      8(int) Load 65(gs_ub)
-              98:      8(int) AtomicXor 64(gs_ua) 67 68 97
-                              Store 70(out_u1) 98
-                              ReturnValue 99
+              63:    61(bool) FOrdNotEqual 60 62
+              64:    61(bool) All 63
+              68:      8(int) Load 67(gs_ub)
+              71:           2 AtomicIAdd 66(gs_ua) 69 70 68
+              73:      8(int) Load 67(gs_ub)
+              74:      8(int) AtomicIAdd 66(gs_ua) 69 70 73
+                              Store 72(out_u1) 74
+              75:      8(int) Load 67(gs_ub)
+              76:           2 AtomicAnd 66(gs_ua) 69 70 75
+              77:      8(int) Load 67(gs_ub)
+              78:      8(int) AtomicAnd 66(gs_ua) 69 70 77
+                              Store 72(out_u1) 78
+              79:      8(int) Load 67(gs_ub)
+              81:      8(int) Load 80(gs_uc)
+              82:      8(int) AtomicCompareExchange 66(gs_ua) 69 70 70 81 79
+                              Store 72(out_u1) 82
+              83:      8(int) Load 67(gs_ub)
+              84:      8(int) AtomicExchange 66(gs_ua) 69 70 83
+                              Store 72(out_u1) 84
+              85:      8(int) Load 67(gs_ub)
+              86:           2 AtomicSMax 66(gs_ua) 69 70 85
+              87:      8(int) Load 67(gs_ub)
+              88:      8(int) AtomicUMax 66(gs_ua) 69 70 87
+                              Store 72(out_u1) 88
+              89:      8(int) Load 67(gs_ub)
+              90:           2 AtomicSMin 66(gs_ua) 69 70 89
+              91:      8(int) Load 67(gs_ub)
+              92:      8(int) AtomicUMin 66(gs_ua) 69 70 91
+                              Store 72(out_u1) 92
+              93:      8(int) Load 67(gs_ub)
+              94:           2 AtomicOr 66(gs_ua) 69 70 93
+              95:      8(int) Load 67(gs_ub)
+              96:      8(int) AtomicOr 66(gs_ua) 69 70 95
+                              Store 72(out_u1) 96
+              97:      8(int) Load 67(gs_ub)
+              98:           2 AtomicXor 66(gs_ua) 69 70 97
+              99:      8(int) Load 67(gs_ub)
+             100:      8(int) AtomicXor 66(gs_ua) 69 70 99
+                              Store 72(out_u1) 100
+                              ReturnValue 62
                               FunctionEnd
 22(ComputeShaderFunction1(vf1;vf1;vf1;):    6(float) Function None 18
         19(inF0):      7(ptr) FunctionParameter
         20(inF1):      7(ptr) FunctionParameter
         21(inF2):      7(ptr) FunctionParameter
               23:             Label
-                              ReturnValue 99
+                              ReturnValue 62
                               FunctionEnd
 34(ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2;):   24(fvec2) Function None 28
         29(inF0):     25(ptr) FunctionParameter
@@ -942,47 +957,48 @@
         32(inU0):     27(ptr) FunctionParameter
         33(inU1):     27(ptr) FunctionParameter
               35:             Label
-     111(out_u2):     27(ptr) Variable Function
-             104:   24(fvec2) Load 29(inF0)
-             105:    61(bool) All 104
-             109:   26(ivec2) Load 108(gs_ub2)
-             110:           2 AtomicIAdd 107(gs_ua2) 67 68 109
-             112:   26(ivec2) Load 108(gs_ub2)
-             113:   26(ivec2) AtomicIAdd 107(gs_ua2) 67 68 112
-                              Store 111(out_u2) 113
-             114:   26(ivec2) Load 108(gs_ub2)
-             115:           2 AtomicAnd 107(gs_ua2) 67 68 114
-             116:   26(ivec2) Load 108(gs_ub2)
-             117:   26(ivec2) AtomicAnd 107(gs_ua2) 67 68 116
-                              Store 111(out_u2) 117
-             118:   26(ivec2) Load 108(gs_ub2)
-             120:   26(ivec2) Load 119(gs_uc2)
-             121:   26(ivec2) AtomicCompareExchange 107(gs_ua2) 67 68 68 120 118
-                              Store 111(out_u2) 121
-             122:   26(ivec2) Load 108(gs_ub2)
-             123:   26(ivec2) AtomicExchange 107(gs_ua2) 67 68 122
-                              Store 111(out_u2) 123
-             124:   26(ivec2) Load 108(gs_ub2)
-             125:           2 AtomicSMax 107(gs_ua2) 67 68 124
-             126:   26(ivec2) Load 108(gs_ub2)
-             127:   26(ivec2) AtomicUMax 107(gs_ua2) 67 68 126
-                              Store 111(out_u2) 127
-             128:   26(ivec2) Load 108(gs_ub2)
-             129:           2 AtomicSMin 107(gs_ua2) 67 68 128
-             130:   26(ivec2) Load 108(gs_ub2)
-             131:   26(ivec2) AtomicUMin 107(gs_ua2) 67 68 130
-                              Store 111(out_u2) 131
-             132:   26(ivec2) Load 108(gs_ub2)
-             133:           2 AtomicOr 107(gs_ua2) 67 68 132
-             134:   26(ivec2) Load 108(gs_ub2)
-             135:   26(ivec2) AtomicOr 107(gs_ua2) 67 68 134
-                              Store 111(out_u2) 135
-             136:   26(ivec2) Load 108(gs_ub2)
-             137:           2 AtomicXor 107(gs_ua2) 67 68 136
-             138:   26(ivec2) Load 108(gs_ub2)
-             139:   26(ivec2) AtomicXor 107(gs_ua2) 67 68 138
-                              Store 111(out_u2) 139
-                              ReturnValue 142
+     115(out_u2):     27(ptr) Variable Function
+             105:   24(fvec2) Load 29(inF0)
+             108:  106(bvec2) FOrdNotEqual 105 107
+             109:    61(bool) All 108
+             113:   26(ivec2) Load 112(gs_ub2)
+             114:           2 AtomicIAdd 111(gs_ua2) 69 70 113
+             116:   26(ivec2) Load 112(gs_ub2)
+             117:   26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 116
+                              Store 115(out_u2) 117
+             118:   26(ivec2) Load 112(gs_ub2)
+             119:           2 AtomicAnd 111(gs_ua2) 69 70 118
+             120:   26(ivec2) Load 112(gs_ub2)
+             121:   26(ivec2) AtomicAnd 111(gs_ua2) 69 70 120
+                              Store 115(out_u2) 121
+             122:   26(ivec2) Load 112(gs_ub2)
+             124:   26(ivec2) Load 123(gs_uc2)
+             125:   26(ivec2) AtomicCompareExchange 111(gs_ua2) 69 70 70 124 122
+                              Store 115(out_u2) 125
+             126:   26(ivec2) Load 112(gs_ub2)
+             127:   26(ivec2) AtomicExchange 111(gs_ua2) 69 70 126
+                              Store 115(out_u2) 127
+             128:   26(ivec2) Load 112(gs_ub2)
+             129:           2 AtomicSMax 111(gs_ua2) 69 70 128
+             130:   26(ivec2) Load 112(gs_ub2)
+             131:   26(ivec2) AtomicUMax 111(gs_ua2) 69 70 130
+                              Store 115(out_u2) 131
+             132:   26(ivec2) Load 112(gs_ub2)
+             133:           2 AtomicSMin 111(gs_ua2) 69 70 132
+             134:   26(ivec2) Load 112(gs_ub2)
+             135:   26(ivec2) AtomicUMin 111(gs_ua2) 69 70 134
+                              Store 115(out_u2) 135
+             136:   26(ivec2) Load 112(gs_ub2)
+             137:           2 AtomicOr 111(gs_ua2) 69 70 136
+             138:   26(ivec2) Load 112(gs_ub2)
+             139:   26(ivec2) AtomicOr 111(gs_ua2) 69 70 138
+                              Store 115(out_u2) 139
+             140:   26(ivec2) Load 112(gs_ub2)
+             141:           2 AtomicXor 111(gs_ua2) 69 70 140
+             142:   26(ivec2) Load 112(gs_ub2)
+             143:   26(ivec2) AtomicXor 111(gs_ua2) 69 70 142
+                              Store 115(out_u2) 143
+                              ReturnValue 146
                               FunctionEnd
 46(ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3;):   36(fvec3) Function None 40
         41(inF0):     37(ptr) FunctionParameter
@@ -991,47 +1007,48 @@
         44(inU0):     39(ptr) FunctionParameter
         45(inU1):     39(ptr) FunctionParameter
               47:             Label
-     152(out_u3):     39(ptr) Variable Function
-             145:   36(fvec3) Load 41(inF0)
-             146:    61(bool) All 145
-             150:   38(ivec3) Load 149(gs_ub3)
-             151:           2 AtomicIAdd 148(gs_ua3) 67 68 150
-             153:   38(ivec3) Load 149(gs_ub3)
-             154:   38(ivec3) AtomicIAdd 148(gs_ua3) 67 68 153
-                              Store 152(out_u3) 154
-             155:   38(ivec3) Load 149(gs_ub3)
-             156:           2 AtomicAnd 148(gs_ua3) 67 68 155
-             157:   38(ivec3) Load 149(gs_ub3)
-             158:   38(ivec3) AtomicAnd 148(gs_ua3) 67 68 157
-                              Store 152(out_u3) 158
-             159:   38(ivec3) Load 149(gs_ub3)
-             161:   38(ivec3) Load 160(gs_uc3)
-             162:   38(ivec3) AtomicCompareExchange 148(gs_ua3) 67 68 68 161 159
-                              Store 152(out_u3) 162
-             163:   38(ivec3) Load 149(gs_ub3)
-             164:   38(ivec3) AtomicExchange 148(gs_ua3) 67 68 163
-                              Store 152(out_u3) 164
-             165:   38(ivec3) Load 149(gs_ub3)
-             166:           2 AtomicSMax 148(gs_ua3) 67 68 165
-             167:   38(ivec3) Load 149(gs_ub3)
-             168:   38(ivec3) AtomicUMax 148(gs_ua3) 67 68 167
-                              Store 152(out_u3) 168
-             169:   38(ivec3) Load 149(gs_ub3)
-             170:           2 AtomicSMin 148(gs_ua3) 67 68 169
-             171:   38(ivec3) Load 149(gs_ub3)
-             172:   38(ivec3) AtomicUMin 148(gs_ua3) 67 68 171
-                              Store 152(out_u3) 172
-             173:   38(ivec3) Load 149(gs_ub3)
-             174:           2 AtomicOr 148(gs_ua3) 67 68 173
-             175:   38(ivec3) Load 149(gs_ub3)
-             176:   38(ivec3) AtomicOr 148(gs_ua3) 67 68 175
-                              Store 152(out_u3) 176
-             177:   38(ivec3) Load 149(gs_ub3)
-             178:           2 AtomicXor 148(gs_ua3) 67 68 177
-             179:   38(ivec3) Load 149(gs_ub3)
-             180:   38(ivec3) AtomicXor 148(gs_ua3) 67 68 179
-                              Store 152(out_u3) 180
-                              ReturnValue 182
+     159(out_u3):     39(ptr) Variable Function
+             149:   36(fvec3) Load 41(inF0)
+             152:  150(bvec3) FOrdNotEqual 149 151
+             153:    61(bool) All 152
+             157:   38(ivec3) Load 156(gs_ub3)
+             158:           2 AtomicIAdd 155(gs_ua3) 69 70 157
+             160:   38(ivec3) Load 156(gs_ub3)
+             161:   38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 160
+                              Store 159(out_u3) 161
+             162:   38(ivec3) Load 156(gs_ub3)
+             163:           2 AtomicAnd 155(gs_ua3) 69 70 162
+             164:   38(ivec3) Load 156(gs_ub3)
+             165:   38(ivec3) AtomicAnd 155(gs_ua3) 69 70 164
+                              Store 159(out_u3) 165
+             166:   38(ivec3) Load 156(gs_ub3)
+             168:   38(ivec3) Load 167(gs_uc3)
+             169:   38(ivec3) AtomicCompareExchange 155(gs_ua3) 69 70 70 168 166
+                              Store 159(out_u3) 169
+             170:   38(ivec3) Load 156(gs_ub3)
+             171:   38(ivec3) AtomicExchange 155(gs_ua3) 69 70 170
+                              Store 159(out_u3) 171
+             172:   38(ivec3) Load 156(gs_ub3)
+             173:           2 AtomicSMax 155(gs_ua3) 69 70 172
+             174:   38(ivec3) Load 156(gs_ub3)
+             175:   38(ivec3) AtomicUMax 155(gs_ua3) 69 70 174
+                              Store 159(out_u3) 175
+             176:   38(ivec3) Load 156(gs_ub3)
+             177:           2 AtomicSMin 155(gs_ua3) 69 70 176
+             178:   38(ivec3) Load 156(gs_ub3)
+             179:   38(ivec3) AtomicUMin 155(gs_ua3) 69 70 178
+                              Store 159(out_u3) 179
+             180:   38(ivec3) Load 156(gs_ub3)
+             181:           2 AtomicOr 155(gs_ua3) 69 70 180
+             182:   38(ivec3) Load 156(gs_ub3)
+             183:   38(ivec3) AtomicOr 155(gs_ua3) 69 70 182
+                              Store 159(out_u3) 183
+             184:   38(ivec3) Load 156(gs_ub3)
+             185:           2 AtomicXor 155(gs_ua3) 69 70 184
+             186:   38(ivec3) Load 156(gs_ub3)
+             187:   38(ivec3) AtomicXor 155(gs_ua3) 69 70 186
+                              Store 159(out_u3) 187
+                              ReturnValue 189
                               FunctionEnd
 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;):   48(fvec4) Function None 52
         53(inF0):     49(ptr) FunctionParameter
@@ -1040,45 +1057,46 @@
         56(inU0):     51(ptr) FunctionParameter
         57(inU1):     51(ptr) FunctionParameter
               59:             Label
-     192(out_u4):     51(ptr) Variable Function
-             185:   48(fvec4) Load 53(inF0)
-             186:    61(bool) All 185
-             190:   50(ivec4) Load 189(gs_ub4)
-             191:           2 AtomicIAdd 188(gs_ua4) 67 68 190
-             193:   50(ivec4) Load 189(gs_ub4)
-             194:   50(ivec4) AtomicIAdd 188(gs_ua4) 67 68 193
-                              Store 192(out_u4) 194
-             195:   50(ivec4) Load 189(gs_ub4)
-             196:           2 AtomicAnd 188(gs_ua4) 67 68 195
-             197:   50(ivec4) Load 189(gs_ub4)
-             198:   50(ivec4) AtomicAnd 188(gs_ua4) 67 68 197
-                              Store 192(out_u4) 198
-             199:   50(ivec4) Load 189(gs_ub4)
-             201:   50(ivec4) Load 200(gs_uc4)
-             202:   50(ivec4) AtomicCompareExchange 188(gs_ua4) 67 68 68 201 199
-                              Store 192(out_u4) 202
-             203:   50(ivec4) Load 189(gs_ub4)
-             204:   50(ivec4) AtomicExchange 188(gs_ua4) 67 68 203
-                              Store 192(out_u4) 204
-             205:   50(ivec4) Load 189(gs_ub4)
-             206:           2 AtomicSMax 188(gs_ua4) 67 68 205
-             207:   50(ivec4) Load 189(gs_ub4)
-             208:   50(ivec4) AtomicUMax 188(gs_ua4) 67 68 207
-                              Store 192(out_u4) 208
-             209:   50(ivec4) Load 189(gs_ub4)
-             210:           2 AtomicSMin 188(gs_ua4) 67 68 209
-             211:   50(ivec4) Load 189(gs_ub4)
-             212:   50(ivec4) AtomicUMin 188(gs_ua4) 67 68 211
-                              Store 192(out_u4) 212
-             213:   50(ivec4) Load 189(gs_ub4)
-             214:           2 AtomicOr 188(gs_ua4) 67 68 213
-             215:   50(ivec4) Load 189(gs_ub4)
-             216:   50(ivec4) AtomicOr 188(gs_ua4) 67 68 215
-                              Store 192(out_u4) 216
-             217:   50(ivec4) Load 189(gs_ub4)
-             218:           2 AtomicXor 188(gs_ua4) 67 68 217
-             219:   50(ivec4) Load 189(gs_ub4)
-             220:   50(ivec4) AtomicXor 188(gs_ua4) 67 68 219
-                              Store 192(out_u4) 220
-                              ReturnValue 222
+     202(out_u4):     51(ptr) Variable Function
+             192:   48(fvec4) Load 53(inF0)
+             195:  193(bvec4) FOrdNotEqual 192 194
+             196:    61(bool) All 195
+             200:   50(ivec4) Load 199(gs_ub4)
+             201:           2 AtomicIAdd 198(gs_ua4) 69 70 200
+             203:   50(ivec4) Load 199(gs_ub4)
+             204:   50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 203
+                              Store 202(out_u4) 204
+             205:   50(ivec4) Load 199(gs_ub4)
+             206:           2 AtomicAnd 198(gs_ua4) 69 70 205
+             207:   50(ivec4) Load 199(gs_ub4)
+             208:   50(ivec4) AtomicAnd 198(gs_ua4) 69 70 207
+                              Store 202(out_u4) 208
+             209:   50(ivec4) Load 199(gs_ub4)
+             211:   50(ivec4) Load 210(gs_uc4)
+             212:   50(ivec4) AtomicCompareExchange 198(gs_ua4) 69 70 70 211 209
+                              Store 202(out_u4) 212
+             213:   50(ivec4) Load 199(gs_ub4)
+             214:   50(ivec4) AtomicExchange 198(gs_ua4) 69 70 213
+                              Store 202(out_u4) 214
+             215:   50(ivec4) Load 199(gs_ub4)
+             216:           2 AtomicSMax 198(gs_ua4) 69 70 215
+             217:   50(ivec4) Load 199(gs_ub4)
+             218:   50(ivec4) AtomicUMax 198(gs_ua4) 69 70 217
+                              Store 202(out_u4) 218
+             219:   50(ivec4) Load 199(gs_ub4)
+             220:           2 AtomicSMin 198(gs_ua4) 69 70 219
+             221:   50(ivec4) Load 199(gs_ub4)
+             222:   50(ivec4) AtomicUMin 198(gs_ua4) 69 70 221
+                              Store 202(out_u4) 222
+             223:   50(ivec4) Load 199(gs_ub4)
+             224:           2 AtomicOr 198(gs_ua4) 69 70 223
+             225:   50(ivec4) Load 199(gs_ub4)
+             226:   50(ivec4) AtomicOr 198(gs_ua4) 69 70 225
+                              Store 202(out_u4) 226
+             227:   50(ivec4) Load 199(gs_ub4)
+             228:           2 AtomicXor 198(gs_ua4) 69 70 227
+             229:   50(ivec4) Load 199(gs_ub4)
+             230:   50(ivec4) AtomicXor 198(gs_ua4) 69 70 229
+                              Store 202(out_u4) 230
+                              ReturnValue 232
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.intrinsics.double.frag.out b/Test/baseResults/hlsl.intrinsics.double.frag.out
index f08775a..020817a 100644
--- a/Test/baseResults/hlsl.intrinsics.double.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.double.frag.out
@@ -35,28 +35,28 @@
 0:?     Sequence
 0:5      move second child to first child ( temp double)
 0:?         'inDV1a' ( temp double)
-0:?         'inDV1a' (layout( location=0) in double)
+0:?         'inDV1a' (layout( location=0) flat in double)
 0:5      move second child to first child ( temp double)
 0:?         'inDV1b' ( temp double)
-0:?         'inDV1b' (layout( location=1) in double)
+0:?         'inDV1b' (layout( location=1) flat in double)
 0:5      move second child to first child ( temp double)
 0:?         'inDV1c' ( temp double)
-0:?         'inDV1c' (layout( location=2) in double)
+0:?         'inDV1c' (layout( location=2) flat in double)
 0:5      move second child to first child ( temp 2-component vector of double)
 0:?         'inDV2' ( temp 2-component vector of double)
-0:?         'inDV2' (layout( location=3) in 2-component vector of double)
+0:?         'inDV2' (layout( location=3) flat in 2-component vector of double)
 0:5      move second child to first child ( temp 3-component vector of double)
 0:?         'inDV3' ( temp 3-component vector of double)
-0:?         'inDV3' (layout( location=4) in 3-component vector of double)
+0:?         'inDV3' (layout( location=4) flat in 3-component vector of double)
 0:5      move second child to first child ( temp 4-component vector of double)
 0:?         'inDV4' ( temp 4-component vector of double)
-0:?         'inDV4' (layout( location=6) in 4-component vector of double)
+0:?         'inDV4' (layout( location=6) flat in 4-component vector of double)
 0:5      move second child to first child ( temp uint)
 0:?         'inU1a' ( temp uint)
-0:?         'inU1a' (layout( location=8) in uint)
+0:?         'inU1a' (layout( location=8) flat in uint)
 0:5      move second child to first child ( temp uint)
 0:?         'inU1b' ( temp uint)
-0:?         'inU1b' (layout( location=9) in uint)
+0:?         'inU1b' (layout( location=9) flat in uint)
 0:5      move second child to first child ( temp float)
 0:?         '@entryPointOutput' (layout( location=0) out float)
 0:5        Function Call: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float)
@@ -70,14 +70,14 @@
 0:?           'inU1b' ( temp uint)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out float)
-0:?     'inDV1a' (layout( location=0) in double)
-0:?     'inDV1b' (layout( location=1) in double)
-0:?     'inDV1c' (layout( location=2) in double)
-0:?     'inDV2' (layout( location=3) in 2-component vector of double)
-0:?     'inDV3' (layout( location=4) in 3-component vector of double)
-0:?     'inDV4' (layout( location=6) in 4-component vector of double)
-0:?     'inU1a' (layout( location=8) in uint)
-0:?     'inU1b' (layout( location=9) in uint)
+0:?     'inDV1a' (layout( location=0) flat in double)
+0:?     'inDV1b' (layout( location=1) flat in double)
+0:?     'inDV1c' (layout( location=2) flat in double)
+0:?     'inDV2' (layout( location=3) flat in 2-component vector of double)
+0:?     'inDV3' (layout( location=4) flat in 3-component vector of double)
+0:?     'inDV4' (layout( location=6) flat in 4-component vector of double)
+0:?     'inU1a' (layout( location=8) flat in uint)
+0:?     'inU1b' (layout( location=9) flat in uint)
 
 
 Linked fragment stage:
@@ -119,28 +119,28 @@
 0:?     Sequence
 0:5      move second child to first child ( temp double)
 0:?         'inDV1a' ( temp double)
-0:?         'inDV1a' (layout( location=0) in double)
+0:?         'inDV1a' (layout( location=0) flat in double)
 0:5      move second child to first child ( temp double)
 0:?         'inDV1b' ( temp double)
-0:?         'inDV1b' (layout( location=1) in double)
+0:?         'inDV1b' (layout( location=1) flat in double)
 0:5      move second child to first child ( temp double)
 0:?         'inDV1c' ( temp double)
-0:?         'inDV1c' (layout( location=2) in double)
+0:?         'inDV1c' (layout( location=2) flat in double)
 0:5      move second child to first child ( temp 2-component vector of double)
 0:?         'inDV2' ( temp 2-component vector of double)
-0:?         'inDV2' (layout( location=3) in 2-component vector of double)
+0:?         'inDV2' (layout( location=3) flat in 2-component vector of double)
 0:5      move second child to first child ( temp 3-component vector of double)
 0:?         'inDV3' ( temp 3-component vector of double)
-0:?         'inDV3' (layout( location=4) in 3-component vector of double)
+0:?         'inDV3' (layout( location=4) flat in 3-component vector of double)
 0:5      move second child to first child ( temp 4-component vector of double)
 0:?         'inDV4' ( temp 4-component vector of double)
-0:?         'inDV4' (layout( location=6) in 4-component vector of double)
+0:?         'inDV4' (layout( location=6) flat in 4-component vector of double)
 0:5      move second child to first child ( temp uint)
 0:?         'inU1a' ( temp uint)
-0:?         'inU1a' (layout( location=8) in uint)
+0:?         'inU1a' (layout( location=8) flat in uint)
 0:5      move second child to first child ( temp uint)
 0:?         'inU1b' ( temp uint)
-0:?         'inU1b' (layout( location=9) in uint)
+0:?         'inU1b' (layout( location=9) flat in uint)
 0:5      move second child to first child ( temp float)
 0:?         '@entryPointOutput' (layout( location=0) out float)
 0:5        Function Call: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float)
@@ -154,14 +154,14 @@
 0:?           'inU1b' ( temp uint)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out float)
-0:?     'inDV1a' (layout( location=0) in double)
-0:?     'inDV1b' (layout( location=1) in double)
-0:?     'inDV1c' (layout( location=2) in double)
-0:?     'inDV2' (layout( location=3) in 2-component vector of double)
-0:?     'inDV3' (layout( location=4) in 3-component vector of double)
-0:?     'inDV4' (layout( location=6) in 4-component vector of double)
-0:?     'inU1a' (layout( location=8) in uint)
-0:?     'inU1b' (layout( location=9) in uint)
+0:?     'inDV1a' (layout( location=0) flat in double)
+0:?     'inDV1b' (layout( location=1) flat in double)
+0:?     'inDV1c' (layout( location=2) flat in double)
+0:?     'inDV2' (layout( location=3) flat in 2-component vector of double)
+0:?     'inDV3' (layout( location=4) flat in 3-component vector of double)
+0:?     'inDV4' (layout( location=6) flat in 4-component vector of double)
+0:?     'inU1a' (layout( location=8) flat in uint)
+0:?     'inU1b' (layout( location=9) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -211,13 +211,21 @@
                               Name 83  "param"
                               Name 85  "param"
                               Name 87  "param"
+                              Decorate 44(inDV1a) Flat
                               Decorate 44(inDV1a) Location 0
+                              Decorate 47(inDV1b) Flat
                               Decorate 47(inDV1b) Location 1
+                              Decorate 50(inDV1c) Flat
                               Decorate 50(inDV1c) Location 2
+                              Decorate 54(inDV2) Flat
                               Decorate 54(inDV2) Location 3
+                              Decorate 58(inDV3) Flat
                               Decorate 58(inDV3) Location 4
+                              Decorate 62(inDV4) Flat
                               Decorate 62(inDV4) Location 6
+                              Decorate 66(inU1a) Flat
                               Decorate 66(inU1a) Location 8
+                              Decorate 69(inU1b) Flat
                               Decorate 69(inU1b) Location 9
                               Decorate 72(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.intrinsics.evalfns.frag.out b/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
index 90a4db5..50da716 100644
--- a/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
@@ -60,7 +60,7 @@
 0:?         'inF4' (layout( location=3) in 4-component vector of float)
 0:3      move second child to first child ( temp 2-component vector of int)
 0:?         'inI2' ( temp 2-component vector of int)
-0:?         'inI2' (layout( location=4) in 2-component vector of int)
+0:?         'inI2' (layout( location=4) flat in 2-component vector of int)
 0:3      Function Call: @main(f1;vf2;vf3;vf4;vi2; ( temp void)
 0:?         'inF1' ( temp float)
 0:?         'inF2' ( temp 2-component vector of float)
@@ -72,7 +72,7 @@
 0:?     'inF2' (layout( location=1) in 2-component vector of float)
 0:?     'inF3' (layout( location=2) in 3-component vector of float)
 0:?     'inF4' (layout( location=3) in 4-component vector of float)
-0:?     'inI2' (layout( location=4) in 2-component vector of int)
+0:?     'inI2' (layout( location=4) flat in 2-component vector of int)
 
 
 Linked fragment stage:
@@ -139,7 +139,7 @@
 0:?         'inF4' (layout( location=3) in 4-component vector of float)
 0:3      move second child to first child ( temp 2-component vector of int)
 0:?         'inI2' ( temp 2-component vector of int)
-0:?         'inI2' (layout( location=4) in 2-component vector of int)
+0:?         'inI2' (layout( location=4) flat in 2-component vector of int)
 0:3      Function Call: @main(f1;vf2;vf3;vf4;vi2; ( temp void)
 0:?         'inF1' ( temp float)
 0:?         'inF2' ( temp 2-component vector of float)
@@ -151,7 +151,7 @@
 0:?     'inF2' (layout( location=1) in 2-component vector of float)
 0:?     'inF3' (layout( location=2) in 3-component vector of float)
 0:?     'inF4' (layout( location=3) in 4-component vector of float)
-0:?     'inI2' (layout( location=4) in 2-component vector of int)
+0:?     'inI2' (layout( location=4) flat in 2-component vector of int)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -190,6 +190,7 @@
                               Decorate 55(inF2) Location 1
                               Decorate 59(inF3) Location 2
                               Decorate 63(inF4) Location 3
+                              Decorate 67(inI2) Flat
                               Decorate 67(inI2) Location 4
                2:             TypeVoid
                3:             TypeFunction 2
diff --git a/Test/baseResults/hlsl.intrinsics.frag.out b/Test/baseResults/hlsl.intrinsics.frag.out
index 289592a..82da747 100644
--- a/Test/baseResults/hlsl.intrinsics.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.frag.out
@@ -14,7 +14,8 @@
 0:20        move second child to first child ( temp bool)
 0:20          'r000' ( temp bool)
 0:20          all ( temp bool)
-0:20            'inF0' ( in float)
+0:20            Convert float to bool ( temp bool)
+0:20              'inF0' ( in float)
 0:21      Sequence
 0:21        move second child to first child ( temp float)
 0:21          'r001' ( temp float)
@@ -29,7 +30,8 @@
 0:23        move second child to first child ( temp bool)
 0:23          'r003' ( temp bool)
 0:23          any ( temp bool)
-0:23            'inF0' ( in float)
+0:23            Convert float to bool ( temp bool)
+0:23              'inF0' ( in float)
 0:24      Sequence
 0:24        move second child to first child ( temp float)
 0:24          'r004' ( temp float)
@@ -355,7 +357,8 @@
 0:97        move second child to first child ( temp bool)
 0:97          'r000' ( temp bool)
 0:97          all ( temp bool)
-0:97            'inF0' ( in 2-component vector of float)
+0:97            Convert float to bool ( temp 2-component vector of bool)
+0:97              'inF0' ( in 2-component vector of float)
 0:98      Sequence
 0:98        move second child to first child ( temp 2-component vector of float)
 0:98          'r001' ( temp 2-component vector of float)
@@ -370,7 +373,8 @@
 0:100        move second child to first child ( temp bool)
 0:100          'r003' ( temp bool)
 0:100          any ( temp bool)
-0:100            'inF0' ( in 2-component vector of float)
+0:100            Convert float to bool ( temp 2-component vector of bool)
+0:100              'inF0' ( in 2-component vector of float)
 0:101      Sequence
 0:101        move second child to first child ( temp 2-component vector of float)
 0:101          'r004' ( temp 2-component vector of float)
@@ -734,7 +738,8 @@
 0:179        move second child to first child ( temp bool)
 0:179          'r000' ( temp bool)
 0:179          all ( temp bool)
-0:179            'inF0' ( in 3-component vector of float)
+0:179            Convert float to bool ( temp 3-component vector of bool)
+0:179              'inF0' ( in 3-component vector of float)
 0:180      Sequence
 0:180        move second child to first child ( temp 3-component vector of float)
 0:180          'r001' ( temp 3-component vector of float)
@@ -749,7 +754,8 @@
 0:182        move second child to first child ( temp bool)
 0:182          'r003' ( temp bool)
 0:182          any ( temp bool)
-0:182            'inF0' ( in 3-component vector of float)
+0:182            Convert float to bool ( temp 3-component vector of bool)
+0:182              'inF0' ( in 3-component vector of float)
 0:183      Sequence
 0:183        move second child to first child ( temp 3-component vector of float)
 0:183          'r004' ( temp 3-component vector of float)
@@ -1133,7 +1139,8 @@
 0:260        move second child to first child ( temp bool)
 0:260          'r000' ( temp bool)
 0:260          all ( temp bool)
-0:260            'inF0' ( in 4-component vector of float)
+0:260            Convert float to bool ( temp 4-component vector of bool)
+0:260              'inF0' ( in 4-component vector of float)
 0:261      Sequence
 0:261        move second child to first child ( temp 4-component vector of float)
 0:261          'r001' ( temp 4-component vector of float)
@@ -1148,7 +1155,8 @@
 0:263        move second child to first child ( temp bool)
 0:263          'r003' ( temp bool)
 0:263          any ( temp bool)
-0:263            'inF0' ( in 4-component vector of float)
+0:263            Convert float to bool ( temp 4-component vector of bool)
+0:263              'inF0' ( in 4-component vector of float)
 0:264      Sequence
 0:264        move second child to first child ( temp 4-component vector of float)
 0:264          'r004' ( temp 4-component vector of float)
@@ -1545,7 +1553,8 @@
 0:398        move second child to first child ( temp bool)
 0:398          'r000' ( temp bool)
 0:398          all ( temp bool)
-0:398            'inF0' ( in 2X2 matrix of float)
+0:398            Convert float to bool ( temp 2X2 matrix of bool)
+0:398              'inF0' ( in 2X2 matrix of float)
 0:398      Sequence
 0:398        move second child to first child ( temp 2X2 matrix of float)
 0:398          'r001' ( temp 2X2 matrix of float)
@@ -1557,7 +1566,8 @@
 0:398        move second child to first child ( temp bool)
 0:398          'r003' ( temp bool)
 0:398          any ( temp bool)
-0:398            'inF0' ( in 2X2 matrix of float)
+0:398            Convert float to bool ( temp 2X2 matrix of bool)
+0:398              'inF0' ( in 2X2 matrix of float)
 0:398      Sequence
 0:398        move second child to first child ( temp 2X2 matrix of float)
 0:398          'r004' ( temp 2X2 matrix of float)
@@ -1827,7 +1837,8 @@
 0:407        move second child to first child ( temp bool)
 0:407          'r000' ( temp bool)
 0:407          all ( temp bool)
-0:407            'inF0' ( in 3X3 matrix of float)
+0:407            Convert float to bool ( temp 3X3 matrix of bool)
+0:407              'inF0' ( in 3X3 matrix of float)
 0:407      Sequence
 0:407        move second child to first child ( temp 3X3 matrix of float)
 0:407          'r001' ( temp 3X3 matrix of float)
@@ -1839,7 +1850,8 @@
 0:407        move second child to first child ( temp bool)
 0:407          'r003' ( temp bool)
 0:407          any ( temp bool)
-0:407            'inF0' ( in 3X3 matrix of float)
+0:407            Convert float to bool ( temp 3X3 matrix of bool)
+0:407              'inF0' ( in 3X3 matrix of float)
 0:407      Sequence
 0:407        move second child to first child ( temp 3X3 matrix of float)
 0:407          'r004' ( temp 3X3 matrix of float)
@@ -2119,7 +2131,8 @@
 0:416        move second child to first child ( temp bool)
 0:416          'r000' ( temp bool)
 0:416          all ( temp bool)
-0:416            'inF0' ( in 4X4 matrix of float)
+0:416            Convert float to bool ( temp 4X4 matrix of bool)
+0:416              'inF0' ( in 4X4 matrix of float)
 0:416      Sequence
 0:416        move second child to first child ( temp 4X4 matrix of float)
 0:416          'r001' ( temp 4X4 matrix of float)
@@ -2131,7 +2144,8 @@
 0:416        move second child to first child ( temp bool)
 0:416          'r003' ( temp bool)
 0:416          any ( temp bool)
-0:416            'inF0' ( in 4X4 matrix of float)
+0:416            Convert float to bool ( temp 4X4 matrix of bool)
+0:416              'inF0' ( in 4X4 matrix of float)
 0:416      Sequence
 0:416        move second child to first child ( temp 4X4 matrix of float)
 0:416          'r004' ( temp 4X4 matrix of float)
@@ -2777,7 +2791,8 @@
 0:20        move second child to first child ( temp bool)
 0:20          'r000' ( temp bool)
 0:20          all ( temp bool)
-0:20            'inF0' ( in float)
+0:20            Convert float to bool ( temp bool)
+0:20              'inF0' ( in float)
 0:21      Sequence
 0:21        move second child to first child ( temp float)
 0:21          'r001' ( temp float)
@@ -2792,7 +2807,8 @@
 0:23        move second child to first child ( temp bool)
 0:23          'r003' ( temp bool)
 0:23          any ( temp bool)
-0:23            'inF0' ( in float)
+0:23            Convert float to bool ( temp bool)
+0:23              'inF0' ( in float)
 0:24      Sequence
 0:24        move second child to first child ( temp float)
 0:24          'r004' ( temp float)
@@ -3118,7 +3134,8 @@
 0:97        move second child to first child ( temp bool)
 0:97          'r000' ( temp bool)
 0:97          all ( temp bool)
-0:97            'inF0' ( in 2-component vector of float)
+0:97            Convert float to bool ( temp 2-component vector of bool)
+0:97              'inF0' ( in 2-component vector of float)
 0:98      Sequence
 0:98        move second child to first child ( temp 2-component vector of float)
 0:98          'r001' ( temp 2-component vector of float)
@@ -3133,7 +3150,8 @@
 0:100        move second child to first child ( temp bool)
 0:100          'r003' ( temp bool)
 0:100          any ( temp bool)
-0:100            'inF0' ( in 2-component vector of float)
+0:100            Convert float to bool ( temp 2-component vector of bool)
+0:100              'inF0' ( in 2-component vector of float)
 0:101      Sequence
 0:101        move second child to first child ( temp 2-component vector of float)
 0:101          'r004' ( temp 2-component vector of float)
@@ -3497,7 +3515,8 @@
 0:179        move second child to first child ( temp bool)
 0:179          'r000' ( temp bool)
 0:179          all ( temp bool)
-0:179            'inF0' ( in 3-component vector of float)
+0:179            Convert float to bool ( temp 3-component vector of bool)
+0:179              'inF0' ( in 3-component vector of float)
 0:180      Sequence
 0:180        move second child to first child ( temp 3-component vector of float)
 0:180          'r001' ( temp 3-component vector of float)
@@ -3512,7 +3531,8 @@
 0:182        move second child to first child ( temp bool)
 0:182          'r003' ( temp bool)
 0:182          any ( temp bool)
-0:182            'inF0' ( in 3-component vector of float)
+0:182            Convert float to bool ( temp 3-component vector of bool)
+0:182              'inF0' ( in 3-component vector of float)
 0:183      Sequence
 0:183        move second child to first child ( temp 3-component vector of float)
 0:183          'r004' ( temp 3-component vector of float)
@@ -3896,7 +3916,8 @@
 0:260        move second child to first child ( temp bool)
 0:260          'r000' ( temp bool)
 0:260          all ( temp bool)
-0:260            'inF0' ( in 4-component vector of float)
+0:260            Convert float to bool ( temp 4-component vector of bool)
+0:260              'inF0' ( in 4-component vector of float)
 0:261      Sequence
 0:261        move second child to first child ( temp 4-component vector of float)
 0:261          'r001' ( temp 4-component vector of float)
@@ -3911,7 +3932,8 @@
 0:263        move second child to first child ( temp bool)
 0:263          'r003' ( temp bool)
 0:263          any ( temp bool)
-0:263            'inF0' ( in 4-component vector of float)
+0:263            Convert float to bool ( temp 4-component vector of bool)
+0:263              'inF0' ( in 4-component vector of float)
 0:264      Sequence
 0:264        move second child to first child ( temp 4-component vector of float)
 0:264          'r004' ( temp 4-component vector of float)
@@ -4308,7 +4330,8 @@
 0:398        move second child to first child ( temp bool)
 0:398          'r000' ( temp bool)
 0:398          all ( temp bool)
-0:398            'inF0' ( in 2X2 matrix of float)
+0:398            Convert float to bool ( temp 2X2 matrix of bool)
+0:398              'inF0' ( in 2X2 matrix of float)
 0:398      Sequence
 0:398        move second child to first child ( temp 2X2 matrix of float)
 0:398          'r001' ( temp 2X2 matrix of float)
@@ -4320,7 +4343,8 @@
 0:398        move second child to first child ( temp bool)
 0:398          'r003' ( temp bool)
 0:398          any ( temp bool)
-0:398            'inF0' ( in 2X2 matrix of float)
+0:398            Convert float to bool ( temp 2X2 matrix of bool)
+0:398              'inF0' ( in 2X2 matrix of float)
 0:398      Sequence
 0:398        move second child to first child ( temp 2X2 matrix of float)
 0:398          'r004' ( temp 2X2 matrix of float)
@@ -4590,7 +4614,8 @@
 0:407        move second child to first child ( temp bool)
 0:407          'r000' ( temp bool)
 0:407          all ( temp bool)
-0:407            'inF0' ( in 3X3 matrix of float)
+0:407            Convert float to bool ( temp 3X3 matrix of bool)
+0:407              'inF0' ( in 3X3 matrix of float)
 0:407      Sequence
 0:407        move second child to first child ( temp 3X3 matrix of float)
 0:407          'r001' ( temp 3X3 matrix of float)
@@ -4602,7 +4627,8 @@
 0:407        move second child to first child ( temp bool)
 0:407          'r003' ( temp bool)
 0:407          any ( temp bool)
-0:407            'inF0' ( in 3X3 matrix of float)
+0:407            Convert float to bool ( temp 3X3 matrix of bool)
+0:407              'inF0' ( in 3X3 matrix of float)
 0:407      Sequence
 0:407        move second child to first child ( temp 3X3 matrix of float)
 0:407          'r004' ( temp 3X3 matrix of float)
@@ -4882,7 +4908,8 @@
 0:416        move second child to first child ( temp bool)
 0:416          'r000' ( temp bool)
 0:416          all ( temp bool)
-0:416            'inF0' ( in 4X4 matrix of float)
+0:416            Convert float to bool ( temp 4X4 matrix of bool)
+0:416              'inF0' ( in 4X4 matrix of float)
 0:416      Sequence
 0:416        move second child to first child ( temp 4X4 matrix of float)
 0:416          'r001' ( temp 4X4 matrix of float)
@@ -4894,7 +4921,8 @@
 0:416        move second child to first child ( temp bool)
 0:416          'r003' ( temp bool)
 0:416          any ( temp bool)
-0:416            'inF0' ( in 4X4 matrix of float)
+0:416            Convert float to bool ( temp 4X4 matrix of bool)
+0:416              'inF0' ( in 4X4 matrix of float)
 0:416      Sequence
 0:416        move second child to first child ( temp 4X4 matrix of float)
 0:416          'r004' ( temp 4X4 matrix of float)
@@ -5523,13 +5551,13 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 1791
+// Id's are bound by 1805
 
                               Capability Shader
                               Capability DerivativeControl
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 1772
+                              EntryPoint Fragment 4  "main" 1786
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -5608,443 +5636,443 @@
                               MemberName 131(PS_OUTPUT) 0  "color"
                               Name 133  "@main("
                               Name 137  "r000"
-                              Name 140  "r001"
-                              Name 143  "r002"
-                              Name 146  "r003"
-                              Name 149  "r004"
-                              Name 154  "r005"
-                              Name 157  "r006"
-                              Name 160  "r007"
-                              Name 163  "r009"
-                              Name 166  "r010"
-                              Name 170  "r011"
-                              Name 173  "r012"
-                              Name 184  "r014"
-                              Name 187  "r015"
-                              Name 190  "r016"
-                              Name 193  "r017"
-                              Name 196  "r018"
-                              Name 199  "r019"
-                              Name 202  "r020"
-                              Name 205  "r021"
-                              Name 208  "r022"
-                              Name 211  "r023"
-                              Name 214  "r027"
-                              Name 217  "r028"
-                              Name 220  "r029"
-                              Name 223  "r030"
-                              Name 226  "r031"
-                              Name 229  "r033"
-                              Name 233  "r034"
-                              Name 236  "r036"
-                              Name 239  "r037"
-                              Name 242  "r038"
-                              Name 245  "r039"
-                              Name 249  "r039a"
-                              Name 254  "r040"
-                              Name 257  "r041"
-                              Name 262  "r042"
-                              Name 265  "r043"
-                              Name 269  "r044"
-                              Name 273  "r045"
-                              Name 277  "r046"
-                              Name 280  "r047"
-                              Name 284  "r048"
-                              Name 288  "r049"
-                              Name 291  "r050"
-                              Name 294  "r051"
-                              Name 297  "r052"
-                              Name 300  "r053"
-                              Name 307  "r055"
-                              Name 310  "r056"
-                              Name 315  "r057"
-                              Name 318  "r058"
-                              Name 322  "r059"
-                              Name 325  "r060"
-                              Name 328  "r061"
-                              Name 335  "r000"
-                              Name 338  "r001"
-                              Name 341  "r002"
-                              Name 344  "r003"
-                              Name 347  "r004"
-                              Name 352  "r005"
-                              Name 355  "r006"
-                              Name 358  "r007"
-                              Name 361  "r009"
-                              Name 364  "r010"
-                              Name 368  "r011"
-                              Name 371  "r012"
-                              Name 384  "r013"
-                              Name 387  "r015"
-                              Name 390  "r016"
-                              Name 394  "r017"
-                              Name 397  "r018"
-                              Name 400  "r019"
-                              Name 403  "r020"
-                              Name 406  "r021"
-                              Name 409  "r022"
-                              Name 412  "r023"
-                              Name 415  "r026"
-                              Name 419  "r027"
-                              Name 423  "r028"
-                              Name 426  "r029"
-                              Name 429  "r030"
-                              Name 434  "r031"
-                              Name 439  "r032"
-                              Name 441  "r033"
-                              Name 444  "r035"
-                              Name 448  "r036"
-                              Name 451  "r038"
-                              Name 455  "r039"
-                              Name 458  "r040"
-                              Name 461  "r041"
-                              Name 465  "r039a"
-                              Name 470  "r042"
-                              Name 473  "r043"
-                              Name 476  "r044"
-                              Name 480  "r045"
-                              Name 483  "r046"
-                              Name 487  "r047"
-                              Name 491  "r048"
-                              Name 494  "r049"
-                              Name 498  "r050"
-                              Name 501  "r051"
-                              Name 505  "r052"
-                              Name 509  "r053"
-                              Name 514  "r054"
-                              Name 519  "r055"
-                              Name 522  "r056"
-                              Name 525  "r057"
-                              Name 530  "r058"
-                              Name 533  "r059"
-                              Name 540  "r060"
-                              Name 543  "r061"
-                              Name 548  "r062"
-                              Name 551  "r063"
-                              Name 555  "r064"
-                              Name 558  "r065"
-                              Name 561  "r066"
-                              Name 567  "r000"
-                              Name 570  "r001"
-                              Name 573  "r002"
-                              Name 576  "r003"
-                              Name 579  "r004"
-                              Name 584  "r005"
-                              Name 587  "r006"
-                              Name 590  "r007"
-                              Name 593  "r009"
-                              Name 596  "r010"
-                              Name 600  "r011"
-                              Name 603  "r012"
-                              Name 616  "r013"
-                              Name 619  "r014"
-                              Name 622  "r015"
-                              Name 627  "r016"
-                              Name 631  "r017"
-                              Name 634  "r018"
-                              Name 637  "r019"
-                              Name 640  "r020"
-                              Name 643  "r021"
-                              Name 646  "r022"
-                              Name 649  "r023"
-                              Name 652  "r024"
-                              Name 656  "r025"
-                              Name 660  "r029"
-                              Name 663  "r030"
-                              Name 666  "r031"
-                              Name 671  "r032"
-                              Name 675  "r033"
-                              Name 677  "r034"
-                              Name 680  "r036"
-                              Name 684  "r037"
-                              Name 687  "r039"
-                              Name 691  "r040"
-                              Name 694  "r041"
-                              Name 697  "r042"
-                              Name 701  "r039a"
-                              Name 706  "r039b"
-                              Name 712  "r043"
-                              Name 715  "r044"
-                              Name 718  "r045"
-                              Name 722  "r046"
-                              Name 725  "r047"
-                              Name 729  "r048"
-                              Name 733  "r049"
-                              Name 736  "r050"
-                              Name 740  "r051"
-                              Name 743  "r052"
-                              Name 747  "r053"
-                              Name 751  "r054"
-                              Name 755  "r055"
-                              Name 758  "r056"
-                              Name 761  "r057"
-                              Name 764  "r058"
-                              Name 769  "r059"
-                              Name 772  "r060"
-                              Name 779  "r061"
-                              Name 782  "r062"
-                              Name 787  "r063"
-                              Name 790  "r064"
-                              Name 794  "r065"
-                              Name 797  "r066"
-                              Name 800  "r067"
-                              Name 807  "r000"
-                              Name 810  "r001"
-                              Name 813  "r002"
-                              Name 816  "r003"
-                              Name 819  "r004"
-                              Name 824  "r005"
-                              Name 827  "r006"
-                              Name 830  "r007"
-                              Name 833  "r009"
-                              Name 836  "r010"
-                              Name 840  "r011"
-                              Name 843  "r012"
-                              Name 856  "r013"
-                              Name 859  "r014"
-                              Name 862  "r015"
-                              Name 865  "r016"
-                              Name 868  "r017"
-                              Name 871  "r018"
-                              Name 874  "r019"
-                              Name 877  "r020"
-                              Name 880  "r021"
-                              Name 883  "r022"
-                              Name 886  "r023"
-                              Name 890  "r024"
-                              Name 894  "r025"
-                              Name 905  "r029"
-                              Name 908  "r030"
-                              Name 911  "r031"
-                              Name 916  "r032"
-                              Name 921  "r033"
-                              Name 923  "r034"
-                              Name 926  "r036"
-                              Name 930  "r037"
-                              Name 933  "r039"
-                              Name 937  "r040"
-                              Name 940  "r041"
-                              Name 943  "r042"
-                              Name 947  "r039a"
-                              Name 952  "r043"
-                              Name 955  "r044"
-                              Name 958  "r045"
-                              Name 962  "r046"
-                              Name 965  "r047"
-                              Name 969  "r048"
-                              Name 973  "r049"
-                              Name 976  "r050"
-                              Name 980  "r051"
-                              Name 983  "r052"
-                              Name 987  "r053"
-                              Name 991  "r054"
-                              Name 995  "r055"
-                              Name 998  "r056"
-                              Name 1001  "r057"
-                              Name 1004  "r058"
-                              Name 1009  "r059"
-                              Name 1012  "r060"
-                              Name 1019  "r061"
-                              Name 1022  "r062"
-                              Name 1027  "r063"
-                              Name 1030  "r064"
-                              Name 1034  "r065"
-                              Name 1037  "r066"
-                              Name 1040  "r067"
-                              Name 1047  "r000"
-                              Name 1050  "r001"
-                              Name 1055  "r003"
-                              Name 1058  "r004"
-                              Name 1061  "r005"
-                              Name 1064  "r006"
-                              Name 1068  "r007"
-                              Name 1079  "r008"
-                              Name 1084  "r009"
-                              Name 1087  "r010"
-                              Name 1090  "r011"
-                              Name 1093  "r012"
-                              Name 1096  "r013"
-                              Name 1099  "r014"
-                              Name 1102  "r015"
-                              Name 1105  "r016"
-                              Name 1108  "r017"
-                              Name 1111  "r018"
-                              Name 1114  "r019"
-                              Name 1117  "R020"
-                              Name 1120  "r021"
-                              Name 1123  "r022"
-                              Name 1133  "r023"
-                              Name 1136  "r025"
-                              Name 1139  "r026"
-                              Name 1143  "r026a"
-                              Name 1148  "r027"
-                              Name 1151  "r028"
-                              Name 1155  "r029"
-                              Name 1158  "r030"
-                              Name 1162  "r031"
-                              Name 1166  "r032"
-                              Name 1170  "r033"
-                              Name 1173  "r034"
-                              Name 1176  "r035"
-                              Name 1179  "r036"
-                              Name 1184  "r037"
-                              Name 1187  "r038"
-                              Name 1194  "r039"
-                              Name 1197  "r049"
-                              Name 1202  "r041"
-                              Name 1205  "r042"
-                              Name 1209  "r043"
-                              Name 1212  "r044"
-                              Name 1217  "r046"
-                              Name 1224  "r000"
-                              Name 1227  "r001"
-                              Name 1232  "r003"
-                              Name 1235  "r004"
-                              Name 1238  "r005"
-                              Name 1241  "r006"
-                              Name 1245  "r007"
-                              Name 1256  "r008"
-                              Name 1261  "r009"
-                              Name 1264  "r010"
-                              Name 1267  "r011"
-                              Name 1270  "r012"
-                              Name 1273  "r013"
-                              Name 1276  "r014"
-                              Name 1279  "r015"
-                              Name 1282  "r016"
-                              Name 1285  "r017"
-                              Name 1288  "r018"
-                              Name 1291  "r019"
-                              Name 1294  "R020"
-                              Name 1297  "r021"
-                              Name 1300  "r022"
-                              Name 1313  "r023"
-                              Name 1316  "r025"
-                              Name 1319  "r026"
-                              Name 1323  "r026a"
-                              Name 1328  "r027"
-                              Name 1331  "r028"
-                              Name 1335  "r029"
-                              Name 1338  "r030"
-                              Name 1342  "r031"
-                              Name 1346  "r032"
-                              Name 1350  "r033"
-                              Name 1353  "r034"
-                              Name 1356  "r035"
-                              Name 1359  "r036"
-                              Name 1364  "r037"
-                              Name 1367  "r038"
-                              Name 1374  "r039"
-                              Name 1377  "r049"
-                              Name 1382  "r041"
-                              Name 1385  "r042"
-                              Name 1389  "r043"
-                              Name 1392  "r044"
-                              Name 1397  "r046"
-                              Name 1404  "r000"
-                              Name 1407  "r001"
-                              Name 1412  "r003"
-                              Name 1415  "r004"
-                              Name 1418  "r005"
-                              Name 1421  "r006"
-                              Name 1425  "r007"
-                              Name 1436  "r008"
-                              Name 1441  "r009"
-                              Name 1444  "r010"
-                              Name 1447  "r011"
-                              Name 1450  "r012"
-                              Name 1453  "r013"
-                              Name 1456  "r014"
-                              Name 1459  "r015"
-                              Name 1462  "r016"
-                              Name 1465  "r017"
-                              Name 1468  "r018"
-                              Name 1471  "r019"
-                              Name 1474  "R020"
-                              Name 1477  "r021"
-                              Name 1480  "r022"
-                              Name 1496  "r023"
-                              Name 1499  "r025"
-                              Name 1502  "r026"
-                              Name 1506  "r026a"
-                              Name 1511  "r027"
-                              Name 1514  "r028"
-                              Name 1518  "r029"
-                              Name 1521  "r030"
-                              Name 1525  "r031"
-                              Name 1529  "r032"
-                              Name 1533  "r033"
-                              Name 1536  "r034"
-                              Name 1539  "r035"
-                              Name 1542  "r036"
-                              Name 1547  "r037"
-                              Name 1550  "r038"
-                              Name 1557  "r039"
-                              Name 1560  "r049"
-                              Name 1565  "r041"
-                              Name 1568  "r042"
-                              Name 1572  "r043"
-                              Name 1575  "r044"
-                              Name 1580  "r046"
-                              Name 1587  "r0"
-                              Name 1591  "r1"
-                              Name 1595  "r2"
-                              Name 1599  "r3"
-                              Name 1603  "r4"
-                              Name 1607  "r5"
-                              Name 1611  "r6"
-                              Name 1615  "r7"
-                              Name 1619  "r8"
-                              Name 1623  "r0"
-                              Name 1627  "r1"
-                              Name 1631  "r2"
-                              Name 1635  "r3"
-                              Name 1639  "r4"
-                              Name 1643  "r5"
-                              Name 1647  "r6"
-                              Name 1651  "r7"
-                              Name 1655  "r8"
-                              Name 1659  "r0"
-                              Name 1663  "r1"
-                              Name 1667  "r2"
-                              Name 1671  "r3"
-                              Name 1675  "r4"
-                              Name 1679  "r5"
-                              Name 1683  "r6"
-                              Name 1687  "r7"
-                              Name 1691  "r8"
-                              Name 1695  "r00"
-                              Name 1699  "r01"
-                              Name 1703  "r02"
-                              Name 1707  "r03"
-                              Name 1711  "r04"
-                              Name 1715  "r05"
-                              Name 1719  "r06"
-                              Name 1723  "r07"
-                              Name 1727  "r08"
-                              Name 1731  "r09"
-                              Name 1735  "r10"
-                              Name 1739  "r11"
-                              Name 1743  "r12"
-                              Name 1747  "r13"
-                              Name 1751  "r14"
-                              Name 1755  "r15"
-                              Name 1759  "r16"
-                              Name 1764  "ps_output"
-                              Name 1772  "color"
-                              Name 1776  "gs_ua"
-                              Name 1777  "gs_ub"
-                              Name 1778  "gs_uc"
-                              Name 1780  "gs_ua2"
-                              Name 1781  "gs_ub2"
-                              Name 1782  "gs_uc2"
-                              Name 1784  "gs_ua3"
-                              Name 1785  "gs_ub3"
-                              Name 1786  "gs_uc3"
-                              Name 1788  "gs_ua4"
-                              Name 1789  "gs_ub4"
-                              Name 1790  "gs_uc4"
-                              Decorate 1772(color) Location 0
+                              Name 142  "r001"
+                              Name 145  "r002"
+                              Name 148  "r003"
+                              Name 152  "r004"
+                              Name 157  "r005"
+                              Name 160  "r006"
+                              Name 163  "r007"
+                              Name 166  "r009"
+                              Name 169  "r010"
+                              Name 173  "r011"
+                              Name 176  "r012"
+                              Name 186  "r014"
+                              Name 189  "r015"
+                              Name 192  "r016"
+                              Name 195  "r017"
+                              Name 198  "r018"
+                              Name 201  "r019"
+                              Name 204  "r020"
+                              Name 207  "r021"
+                              Name 210  "r022"
+                              Name 213  "r023"
+                              Name 216  "r027"
+                              Name 219  "r028"
+                              Name 222  "r029"
+                              Name 225  "r030"
+                              Name 228  "r031"
+                              Name 231  "r033"
+                              Name 235  "r034"
+                              Name 238  "r036"
+                              Name 241  "r037"
+                              Name 244  "r038"
+                              Name 247  "r039"
+                              Name 251  "r039a"
+                              Name 256  "r040"
+                              Name 259  "r041"
+                              Name 264  "r042"
+                              Name 267  "r043"
+                              Name 271  "r044"
+                              Name 275  "r045"
+                              Name 279  "r046"
+                              Name 282  "r047"
+                              Name 286  "r048"
+                              Name 290  "r049"
+                              Name 293  "r050"
+                              Name 296  "r051"
+                              Name 299  "r052"
+                              Name 302  "r053"
+                              Name 309  "r055"
+                              Name 312  "r056"
+                              Name 317  "r057"
+                              Name 320  "r058"
+                              Name 324  "r059"
+                              Name 327  "r060"
+                              Name 330  "r061"
+                              Name 337  "r000"
+                              Name 343  "r001"
+                              Name 346  "r002"
+                              Name 349  "r003"
+                              Name 353  "r004"
+                              Name 358  "r005"
+                              Name 361  "r006"
+                              Name 364  "r007"
+                              Name 367  "r009"
+                              Name 370  "r010"
+                              Name 374  "r011"
+                              Name 377  "r012"
+                              Name 388  "r013"
+                              Name 391  "r015"
+                              Name 394  "r016"
+                              Name 398  "r017"
+                              Name 401  "r018"
+                              Name 404  "r019"
+                              Name 407  "r020"
+                              Name 410  "r021"
+                              Name 413  "r022"
+                              Name 416  "r023"
+                              Name 419  "r026"
+                              Name 423  "r027"
+                              Name 427  "r028"
+                              Name 430  "r029"
+                              Name 433  "r030"
+                              Name 438  "r031"
+                              Name 443  "r032"
+                              Name 445  "r033"
+                              Name 448  "r035"
+                              Name 452  "r036"
+                              Name 455  "r038"
+                              Name 459  "r039"
+                              Name 462  "r040"
+                              Name 465  "r041"
+                              Name 469  "r039a"
+                              Name 474  "r042"
+                              Name 477  "r043"
+                              Name 480  "r044"
+                              Name 484  "r045"
+                              Name 487  "r046"
+                              Name 491  "r047"
+                              Name 495  "r048"
+                              Name 498  "r049"
+                              Name 502  "r050"
+                              Name 505  "r051"
+                              Name 509  "r052"
+                              Name 513  "r053"
+                              Name 518  "r054"
+                              Name 523  "r055"
+                              Name 526  "r056"
+                              Name 529  "r057"
+                              Name 534  "r058"
+                              Name 537  "r059"
+                              Name 544  "r060"
+                              Name 547  "r061"
+                              Name 552  "r062"
+                              Name 555  "r063"
+                              Name 559  "r064"
+                              Name 562  "r065"
+                              Name 565  "r066"
+                              Name 571  "r000"
+                              Name 577  "r001"
+                              Name 580  "r002"
+                              Name 583  "r003"
+                              Name 587  "r004"
+                              Name 592  "r005"
+                              Name 595  "r006"
+                              Name 598  "r007"
+                              Name 601  "r009"
+                              Name 604  "r010"
+                              Name 608  "r011"
+                              Name 611  "r012"
+                              Name 622  "r013"
+                              Name 625  "r014"
+                              Name 628  "r015"
+                              Name 633  "r016"
+                              Name 637  "r017"
+                              Name 640  "r018"
+                              Name 643  "r019"
+                              Name 646  "r020"
+                              Name 649  "r021"
+                              Name 652  "r022"
+                              Name 655  "r023"
+                              Name 658  "r024"
+                              Name 662  "r025"
+                              Name 666  "r029"
+                              Name 669  "r030"
+                              Name 672  "r031"
+                              Name 677  "r032"
+                              Name 681  "r033"
+                              Name 683  "r034"
+                              Name 686  "r036"
+                              Name 690  "r037"
+                              Name 693  "r039"
+                              Name 697  "r040"
+                              Name 700  "r041"
+                              Name 703  "r042"
+                              Name 707  "r039a"
+                              Name 712  "r039b"
+                              Name 718  "r043"
+                              Name 721  "r044"
+                              Name 724  "r045"
+                              Name 728  "r046"
+                              Name 731  "r047"
+                              Name 735  "r048"
+                              Name 739  "r049"
+                              Name 742  "r050"
+                              Name 746  "r051"
+                              Name 749  "r052"
+                              Name 753  "r053"
+                              Name 757  "r054"
+                              Name 761  "r055"
+                              Name 764  "r056"
+                              Name 767  "r057"
+                              Name 770  "r058"
+                              Name 775  "r059"
+                              Name 778  "r060"
+                              Name 785  "r061"
+                              Name 788  "r062"
+                              Name 793  "r063"
+                              Name 796  "r064"
+                              Name 800  "r065"
+                              Name 803  "r066"
+                              Name 806  "r067"
+                              Name 813  "r000"
+                              Name 819  "r001"
+                              Name 822  "r002"
+                              Name 825  "r003"
+                              Name 829  "r004"
+                              Name 834  "r005"
+                              Name 837  "r006"
+                              Name 840  "r007"
+                              Name 843  "r009"
+                              Name 846  "r010"
+                              Name 850  "r011"
+                              Name 853  "r012"
+                              Name 864  "r013"
+                              Name 867  "r014"
+                              Name 870  "r015"
+                              Name 873  "r016"
+                              Name 876  "r017"
+                              Name 879  "r018"
+                              Name 882  "r019"
+                              Name 885  "r020"
+                              Name 888  "r021"
+                              Name 891  "r022"
+                              Name 894  "r023"
+                              Name 898  "r024"
+                              Name 902  "r025"
+                              Name 913  "r029"
+                              Name 916  "r030"
+                              Name 919  "r031"
+                              Name 924  "r032"
+                              Name 929  "r033"
+                              Name 931  "r034"
+                              Name 934  "r036"
+                              Name 938  "r037"
+                              Name 941  "r039"
+                              Name 945  "r040"
+                              Name 948  "r041"
+                              Name 951  "r042"
+                              Name 955  "r039a"
+                              Name 960  "r043"
+                              Name 963  "r044"
+                              Name 966  "r045"
+                              Name 970  "r046"
+                              Name 973  "r047"
+                              Name 977  "r048"
+                              Name 981  "r049"
+                              Name 984  "r050"
+                              Name 988  "r051"
+                              Name 991  "r052"
+                              Name 995  "r053"
+                              Name 999  "r054"
+                              Name 1003  "r055"
+                              Name 1006  "r056"
+                              Name 1009  "r057"
+                              Name 1012  "r058"
+                              Name 1017  "r059"
+                              Name 1020  "r060"
+                              Name 1027  "r061"
+                              Name 1030  "r062"
+                              Name 1035  "r063"
+                              Name 1038  "r064"
+                              Name 1042  "r065"
+                              Name 1045  "r066"
+                              Name 1048  "r067"
+                              Name 1055  "r000"
+                              Name 1060  "r001"
+                              Name 1065  "r003"
+                              Name 1069  "r004"
+                              Name 1072  "r005"
+                              Name 1075  "r006"
+                              Name 1079  "r007"
+                              Name 1089  "r008"
+                              Name 1094  "r009"
+                              Name 1097  "r010"
+                              Name 1100  "r011"
+                              Name 1103  "r012"
+                              Name 1106  "r013"
+                              Name 1109  "r014"
+                              Name 1112  "r015"
+                              Name 1115  "r016"
+                              Name 1118  "r017"
+                              Name 1121  "r018"
+                              Name 1124  "r019"
+                              Name 1127  "R020"
+                              Name 1130  "r021"
+                              Name 1133  "r022"
+                              Name 1143  "r023"
+                              Name 1146  "r025"
+                              Name 1149  "r026"
+                              Name 1153  "r026a"
+                              Name 1158  "r027"
+                              Name 1161  "r028"
+                              Name 1165  "r029"
+                              Name 1168  "r030"
+                              Name 1172  "r031"
+                              Name 1176  "r032"
+                              Name 1180  "r033"
+                              Name 1183  "r034"
+                              Name 1186  "r035"
+                              Name 1189  "r036"
+                              Name 1194  "r037"
+                              Name 1197  "r038"
+                              Name 1204  "r039"
+                              Name 1207  "r049"
+                              Name 1212  "r041"
+                              Name 1215  "r042"
+                              Name 1219  "r043"
+                              Name 1222  "r044"
+                              Name 1227  "r046"
+                              Name 1234  "r000"
+                              Name 1239  "r001"
+                              Name 1244  "r003"
+                              Name 1248  "r004"
+                              Name 1251  "r005"
+                              Name 1254  "r006"
+                              Name 1258  "r007"
+                              Name 1268  "r008"
+                              Name 1273  "r009"
+                              Name 1276  "r010"
+                              Name 1279  "r011"
+                              Name 1282  "r012"
+                              Name 1285  "r013"
+                              Name 1288  "r014"
+                              Name 1291  "r015"
+                              Name 1294  "r016"
+                              Name 1297  "r017"
+                              Name 1300  "r018"
+                              Name 1303  "r019"
+                              Name 1306  "R020"
+                              Name 1309  "r021"
+                              Name 1312  "r022"
+                              Name 1325  "r023"
+                              Name 1328  "r025"
+                              Name 1331  "r026"
+                              Name 1335  "r026a"
+                              Name 1340  "r027"
+                              Name 1343  "r028"
+                              Name 1347  "r029"
+                              Name 1350  "r030"
+                              Name 1354  "r031"
+                              Name 1358  "r032"
+                              Name 1362  "r033"
+                              Name 1365  "r034"
+                              Name 1368  "r035"
+                              Name 1371  "r036"
+                              Name 1376  "r037"
+                              Name 1379  "r038"
+                              Name 1386  "r039"
+                              Name 1389  "r049"
+                              Name 1394  "r041"
+                              Name 1397  "r042"
+                              Name 1401  "r043"
+                              Name 1404  "r044"
+                              Name 1409  "r046"
+                              Name 1416  "r000"
+                              Name 1421  "r001"
+                              Name 1426  "r003"
+                              Name 1430  "r004"
+                              Name 1433  "r005"
+                              Name 1436  "r006"
+                              Name 1440  "r007"
+                              Name 1450  "r008"
+                              Name 1455  "r009"
+                              Name 1458  "r010"
+                              Name 1461  "r011"
+                              Name 1464  "r012"
+                              Name 1467  "r013"
+                              Name 1470  "r014"
+                              Name 1473  "r015"
+                              Name 1476  "r016"
+                              Name 1479  "r017"
+                              Name 1482  "r018"
+                              Name 1485  "r019"
+                              Name 1488  "R020"
+                              Name 1491  "r021"
+                              Name 1494  "r022"
+                              Name 1510  "r023"
+                              Name 1513  "r025"
+                              Name 1516  "r026"
+                              Name 1520  "r026a"
+                              Name 1525  "r027"
+                              Name 1528  "r028"
+                              Name 1532  "r029"
+                              Name 1535  "r030"
+                              Name 1539  "r031"
+                              Name 1543  "r032"
+                              Name 1547  "r033"
+                              Name 1550  "r034"
+                              Name 1553  "r035"
+                              Name 1556  "r036"
+                              Name 1561  "r037"
+                              Name 1564  "r038"
+                              Name 1571  "r039"
+                              Name 1574  "r049"
+                              Name 1579  "r041"
+                              Name 1582  "r042"
+                              Name 1586  "r043"
+                              Name 1589  "r044"
+                              Name 1594  "r046"
+                              Name 1601  "r0"
+                              Name 1605  "r1"
+                              Name 1609  "r2"
+                              Name 1613  "r3"
+                              Name 1617  "r4"
+                              Name 1621  "r5"
+                              Name 1625  "r6"
+                              Name 1629  "r7"
+                              Name 1633  "r8"
+                              Name 1637  "r0"
+                              Name 1641  "r1"
+                              Name 1645  "r2"
+                              Name 1649  "r3"
+                              Name 1653  "r4"
+                              Name 1657  "r5"
+                              Name 1661  "r6"
+                              Name 1665  "r7"
+                              Name 1669  "r8"
+                              Name 1673  "r0"
+                              Name 1677  "r1"
+                              Name 1681  "r2"
+                              Name 1685  "r3"
+                              Name 1689  "r4"
+                              Name 1693  "r5"
+                              Name 1697  "r6"
+                              Name 1701  "r7"
+                              Name 1705  "r8"
+                              Name 1709  "r00"
+                              Name 1713  "r01"
+                              Name 1717  "r02"
+                              Name 1721  "r03"
+                              Name 1725  "r04"
+                              Name 1729  "r05"
+                              Name 1733  "r06"
+                              Name 1737  "r07"
+                              Name 1741  "r08"
+                              Name 1745  "r09"
+                              Name 1749  "r10"
+                              Name 1753  "r11"
+                              Name 1757  "r12"
+                              Name 1761  "r13"
+                              Name 1765  "r14"
+                              Name 1769  "r15"
+                              Name 1773  "r16"
+                              Name 1778  "ps_output"
+                              Name 1786  "color"
+                              Name 1790  "gs_ua"
+                              Name 1791  "gs_ub"
+                              Name 1792  "gs_uc"
+                              Name 1794  "gs_ua2"
+                              Name 1795  "gs_ub2"
+                              Name 1796  "gs_uc2"
+                              Name 1798  "gs_ua3"
+                              Name 1799  "gs_ub3"
+                              Name 1800  "gs_uc3"
+                              Name 1802  "gs_ua4"
+                              Name 1803  "gs_ub4"
+                              Name 1804  "gs_uc4"
+                              Decorate 1786(color) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -6093,92 +6121,92 @@
              132:             TypeFunction 131(PS_OUTPUT)
              135:             TypeBool
              136:             TypePointer Function 135(bool)
-             152:             TypeInt 32 1
-             153:             TypePointer Function 152(int)
-             179:    6(float) Constant 0
-             191:    152(int) Constant 7
-             260:    6(float) Constant 1050288283
-             281:    6(float) Constant 1065353216
-             285:    152(int) Constant 2
-             350:             TypeVector 152(int) 2
-             351:             TypePointer Function 350(ivec2)
-             377:   24(fvec2) ConstantComposite 179 179
-             378:             TypeVector 135(bool) 2
-             391:    152(int) Constant 3
-             392:  350(ivec2) ConstantComposite 191 391
-             435:      8(int) Constant 7
-             436:      8(int) Constant 8
-             437:   26(ivec2) ConstantComposite 435 436
-             454:             TypePointer Function 378(bvec2)
-             512:    6(float) Constant 1073741824
-             515:      8(int) Constant 1
-             516:      8(int) Constant 2
-             517:   26(ivec2) ConstantComposite 515 516
-             564:   24(fvec2) ConstantComposite 281 512
-             582:             TypeVector 152(int) 3
-             583:             TypePointer Function 582(ivec3)
-             609:   36(fvec3) ConstantComposite 179 179 179
-             610:             TypeVector 135(bool) 3
-             623:      8(int) Constant 3
-             624:      8(int) Constant 5
-             625:   38(ivec3) ConstantComposite 435 623 624
-             672:      8(int) Constant 4
-             673:   38(ivec3) ConstantComposite 516 623 672
-             690:             TypePointer Function 610(bvec3)
-             709:    6(float) Constant 1050253722
-             756:   38(ivec3) ConstantComposite 515 516 623
-             803:    6(float) Constant 1077936128
-             804:   36(fvec3) ConstantComposite 281 512 803
-             822:             TypeVector 152(int) 4
-             823:             TypePointer Function 822(ivec4)
-             849:   48(fvec4) ConstantComposite 179 179 179 179
-             850:             TypeVector 135(bool) 4
-             863:   50(ivec4) ConstantComposite 435 623 624 516
-             917:      8(int) Constant 9
-             918:      8(int) Constant 10
-             919:   50(ivec4) ConstantComposite 435 436 917 918
-             936:             TypePointer Function 850(bvec4)
-             996:   50(ivec4) ConstantComposite 515 516 623 672
-            1043:    6(float) Constant 1082130432
-            1044:   48(fvec4) ConstantComposite 281 512 803 1043
-            1072:          60 ConstantComposite 377 377
-            1073:             TypeMatrix 378(bvec2) 2
-            1220:   24(fvec2) ConstantComposite 512 512
-            1221:          60 ConstantComposite 1220 1220
-            1249:          68 ConstantComposite 609 609 609
-            1250:             TypeMatrix 610(bvec3) 3
-            1400:   36(fvec3) ConstantComposite 803 803 803
-            1401:          68 ConstantComposite 1400 1400 1400
-            1429:          76 ConstantComposite 849 849 849 849
-            1430:             TypeMatrix 850(bvec4) 4
-            1583:   48(fvec4) ConstantComposite 1043 1043 1043 1043
-            1584:          76 ConstantComposite 1583 1583 1583 1583
-            1763:             TypePointer Function 131(PS_OUTPUT)
-            1765:    152(int) Constant 0
-            1766:   48(fvec4) ConstantComposite 281 281 281 281
-            1771:             TypePointer Output 48(fvec4)
-     1772(color):   1771(ptr) Variable Output
-            1775:             TypePointer Workgroup 8(int)
-     1776(gs_ua):   1775(ptr) Variable Workgroup
-     1777(gs_ub):   1775(ptr) Variable Workgroup
-     1778(gs_uc):   1775(ptr) Variable Workgroup
-            1779:             TypePointer Workgroup 26(ivec2)
-    1780(gs_ua2):   1779(ptr) Variable Workgroup
-    1781(gs_ub2):   1779(ptr) Variable Workgroup
-    1782(gs_uc2):   1779(ptr) Variable Workgroup
-            1783:             TypePointer Workgroup 38(ivec3)
-    1784(gs_ua3):   1783(ptr) Variable Workgroup
-    1785(gs_ub3):   1783(ptr) Variable Workgroup
-    1786(gs_uc3):   1783(ptr) Variable Workgroup
-            1787:             TypePointer Workgroup 50(ivec4)
-    1788(gs_ua4):   1787(ptr) Variable Workgroup
-    1789(gs_ub4):   1787(ptr) Variable Workgroup
-    1790(gs_uc4):   1787(ptr) Variable Workgroup
+             139:    6(float) Constant 0
+             155:             TypeInt 32 1
+             156:             TypePointer Function 155(int)
+             193:    155(int) Constant 7
+             262:    6(float) Constant 1050288283
+             283:    6(float) Constant 1065353216
+             287:    155(int) Constant 2
+             339:             TypeVector 135(bool) 2
+             340:   24(fvec2) ConstantComposite 139 139
+             356:             TypeVector 155(int) 2
+             357:             TypePointer Function 356(ivec2)
+             395:    155(int) Constant 3
+             396:  356(ivec2) ConstantComposite 193 395
+             439:      8(int) Constant 7
+             440:      8(int) Constant 8
+             441:   26(ivec2) ConstantComposite 439 440
+             458:             TypePointer Function 339(bvec2)
+             516:    6(float) Constant 1073741824
+             519:      8(int) Constant 1
+             520:      8(int) Constant 2
+             521:   26(ivec2) ConstantComposite 519 520
+             568:   24(fvec2) ConstantComposite 283 516
+             573:             TypeVector 135(bool) 3
+             574:   36(fvec3) ConstantComposite 139 139 139
+             590:             TypeVector 155(int) 3
+             591:             TypePointer Function 590(ivec3)
+             629:      8(int) Constant 3
+             630:      8(int) Constant 5
+             631:   38(ivec3) ConstantComposite 439 629 630
+             678:      8(int) Constant 4
+             679:   38(ivec3) ConstantComposite 520 629 678
+             696:             TypePointer Function 573(bvec3)
+             715:    6(float) Constant 1050253722
+             762:   38(ivec3) ConstantComposite 519 520 629
+             809:    6(float) Constant 1077936128
+             810:   36(fvec3) ConstantComposite 283 516 809
+             815:             TypeVector 135(bool) 4
+             816:   48(fvec4) ConstantComposite 139 139 139 139
+             832:             TypeVector 155(int) 4
+             833:             TypePointer Function 832(ivec4)
+             871:   50(ivec4) ConstantComposite 439 629 630 520
+             925:      8(int) Constant 9
+             926:      8(int) Constant 10
+             927:   50(ivec4) ConstantComposite 439 440 925 926
+             944:             TypePointer Function 815(bvec4)
+            1004:   50(ivec4) ConstantComposite 519 520 629 678
+            1051:    6(float) Constant 1082130432
+            1052:   48(fvec4) ConstantComposite 283 516 809 1051
+            1057:             TypeMatrix 339(bvec2) 2
+            1083:          60 ConstantComposite 340 340
+            1230:   24(fvec2) ConstantComposite 516 516
+            1231:          60 ConstantComposite 1230 1230
+            1236:             TypeMatrix 573(bvec3) 3
+            1262:          68 ConstantComposite 574 574 574
+            1412:   36(fvec3) ConstantComposite 809 809 809
+            1413:          68 ConstantComposite 1412 1412 1412
+            1418:             TypeMatrix 815(bvec4) 4
+            1444:          76 ConstantComposite 816 816 816 816
+            1597:   48(fvec4) ConstantComposite 1051 1051 1051 1051
+            1598:          76 ConstantComposite 1597 1597 1597 1597
+            1777:             TypePointer Function 131(PS_OUTPUT)
+            1779:    155(int) Constant 0
+            1780:   48(fvec4) ConstantComposite 283 283 283 283
+            1785:             TypePointer Output 48(fvec4)
+     1786(color):   1785(ptr) Variable Output
+            1789:             TypePointer Workgroup 8(int)
+     1790(gs_ua):   1789(ptr) Variable Workgroup
+     1791(gs_ub):   1789(ptr) Variable Workgroup
+     1792(gs_uc):   1789(ptr) Variable Workgroup
+            1793:             TypePointer Workgroup 26(ivec2)
+    1794(gs_ua2):   1793(ptr) Variable Workgroup
+    1795(gs_ub2):   1793(ptr) Variable Workgroup
+    1796(gs_uc2):   1793(ptr) Variable Workgroup
+            1797:             TypePointer Workgroup 38(ivec3)
+    1798(gs_ua3):   1797(ptr) Variable Workgroup
+    1799(gs_ub3):   1797(ptr) Variable Workgroup
+    1800(gs_uc3):   1797(ptr) Variable Workgroup
+            1801:             TypePointer Workgroup 50(ivec4)
+    1802(gs_ua4):   1801(ptr) Variable Workgroup
+    1803(gs_ub4):   1801(ptr) Variable Workgroup
+    1804(gs_uc4):   1801(ptr) Variable Workgroup
          4(main):           2 Function None 3
                5:             Label
-            1773:131(PS_OUTPUT) FunctionCall 133(@main()
-            1774:   48(fvec4) CompositeExtract 1773 0
-                              Store 1772(color) 1774
+            1787:131(PS_OUTPUT) FunctionCall 133(@main()
+            1788:   48(fvec4) CompositeExtract 1787 0
+                              Store 1786(color) 1788
                               Return
                               FunctionEnd
 16(PixelShaderFunctionS(f1;f1;f1;u1;u1;):    6(float) Function None 10
@@ -6189,259 +6217,261 @@
         15(inU1):      9(ptr) FunctionParameter
               17:             Label
        137(r000):    136(ptr) Variable Function
-       140(r001):      7(ptr) Variable Function
-       143(r002):      7(ptr) Variable Function
-       146(r003):    136(ptr) Variable Function
-       149(r004):      7(ptr) Variable Function
-       154(r005):    153(ptr) Variable Function
-       157(r006):      9(ptr) Variable Function
-       160(r007):      7(ptr) Variable Function
-       163(r009):      7(ptr) Variable Function
-       166(r010):      7(ptr) Variable Function
-       170(r011):      7(ptr) Variable Function
-       173(r012):      7(ptr) Variable Function
-       184(r014):      7(ptr) Variable Function
-       187(r015):      7(ptr) Variable Function
-       190(r016):    153(ptr) Variable Function
-       193(r017):      7(ptr) Variable Function
-       196(r018):      7(ptr) Variable Function
-       199(r019):      7(ptr) Variable Function
-       202(r020):      7(ptr) Variable Function
-       205(r021):      7(ptr) Variable Function
-       208(r022):      7(ptr) Variable Function
-       211(r023):      7(ptr) Variable Function
-       214(r027):      7(ptr) Variable Function
-       217(r028):      7(ptr) Variable Function
-       220(r029):      9(ptr) Variable Function
-       223(r030):      9(ptr) Variable Function
-       226(r031):      7(ptr) Variable Function
-       229(r033):      7(ptr) Variable Function
-       233(r034):      7(ptr) Variable Function
-       236(r036):      7(ptr) Variable Function
-       239(r037):    136(ptr) Variable Function
-       242(r038):    136(ptr) Variable Function
-       245(r039):      7(ptr) Variable Function
-      249(r039a):      7(ptr) Variable Function
-       254(r040):      7(ptr) Variable Function
-       257(r041):      7(ptr) Variable Function
-       262(r042):      7(ptr) Variable Function
-       265(r043):      7(ptr) Variable Function
-       269(r044):      7(ptr) Variable Function
-       273(r045):      7(ptr) Variable Function
-       277(r046):      7(ptr) Variable Function
-       280(r047):      7(ptr) Variable Function
-       284(r048):      9(ptr) Variable Function
-       288(r049):      7(ptr) Variable Function
-       291(r050):      7(ptr) Variable Function
-       294(r051):      7(ptr) Variable Function
-       297(r052):      7(ptr) Variable Function
-       300(r053):      7(ptr) Variable Function
-       307(r055):      7(ptr) Variable Function
-       310(r056):      7(ptr) Variable Function
-       315(r057):      7(ptr) Variable Function
-       318(r058):      7(ptr) Variable Function
-       322(r059):      7(ptr) Variable Function
-       325(r060):      7(ptr) Variable Function
-       328(r061):      7(ptr) Variable Function
+       142(r001):      7(ptr) Variable Function
+       145(r002):      7(ptr) Variable Function
+       148(r003):    136(ptr) Variable Function
+       152(r004):      7(ptr) Variable Function
+       157(r005):    156(ptr) Variable Function
+       160(r006):      9(ptr) Variable Function
+       163(r007):      7(ptr) Variable Function
+       166(r009):      7(ptr) Variable Function
+       169(r010):      7(ptr) Variable Function
+       173(r011):      7(ptr) Variable Function
+       176(r012):      7(ptr) Variable Function
+       186(r014):      7(ptr) Variable Function
+       189(r015):      7(ptr) Variable Function
+       192(r016):    156(ptr) Variable Function
+       195(r017):      7(ptr) Variable Function
+       198(r018):      7(ptr) Variable Function
+       201(r019):      7(ptr) Variable Function
+       204(r020):      7(ptr) Variable Function
+       207(r021):      7(ptr) Variable Function
+       210(r022):      7(ptr) Variable Function
+       213(r023):      7(ptr) Variable Function
+       216(r027):      7(ptr) Variable Function
+       219(r028):      7(ptr) Variable Function
+       222(r029):      9(ptr) Variable Function
+       225(r030):      9(ptr) Variable Function
+       228(r031):      7(ptr) Variable Function
+       231(r033):      7(ptr) Variable Function
+       235(r034):      7(ptr) Variable Function
+       238(r036):      7(ptr) Variable Function
+       241(r037):    136(ptr) Variable Function
+       244(r038):    136(ptr) Variable Function
+       247(r039):      7(ptr) Variable Function
+      251(r039a):      7(ptr) Variable Function
+       256(r040):      7(ptr) Variable Function
+       259(r041):      7(ptr) Variable Function
+       264(r042):      7(ptr) Variable Function
+       267(r043):      7(ptr) Variable Function
+       271(r044):      7(ptr) Variable Function
+       275(r045):      7(ptr) Variable Function
+       279(r046):      7(ptr) Variable Function
+       282(r047):      7(ptr) Variable Function
+       286(r048):      9(ptr) Variable Function
+       290(r049):      7(ptr) Variable Function
+       293(r050):      7(ptr) Variable Function
+       296(r051):      7(ptr) Variable Function
+       299(r052):      7(ptr) Variable Function
+       302(r053):      7(ptr) Variable Function
+       309(r055):      7(ptr) Variable Function
+       312(r056):      7(ptr) Variable Function
+       317(r057):      7(ptr) Variable Function
+       320(r058):      7(ptr) Variable Function
+       324(r059):      7(ptr) Variable Function
+       327(r060):      7(ptr) Variable Function
+       330(r061):      7(ptr) Variable Function
              138:    6(float) Load 11(inF0)
-             139:   135(bool) All 138
-                              Store 137(r000) 139
-             141:    6(float) Load 11(inF0)
-             142:    6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 141
-                              Store 140(r001) 142
-             144:    6(float) Load 11(inF0)
-             145:    6(float) ExtInst 1(GLSL.std.450) 17(Acos) 144
-                              Store 143(r002) 145
-             147:    6(float) Load 11(inF0)
-             148:   135(bool) Any 147
-                              Store 146(r003) 148
-             150:    6(float) Load 11(inF0)
-             151:    6(float) ExtInst 1(GLSL.std.450) 16(Asin) 150
-                              Store 149(r004) 151
-             155:    6(float) Load 11(inF0)
-             156:    152(int) Bitcast 155
-                              Store 154(r005) 156
+             140:   135(bool) FOrdNotEqual 138 139
+             141:   135(bool) All 140
+                              Store 137(r000) 141
+             143:    6(float) Load 11(inF0)
+             144:    6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 143
+                              Store 142(r001) 144
+             146:    6(float) Load 11(inF0)
+             147:    6(float) ExtInst 1(GLSL.std.450) 17(Acos) 146
+                              Store 145(r002) 147
+             149:    6(float) Load 11(inF0)
+             150:   135(bool) FOrdNotEqual 149 139
+             151:   135(bool) Any 150
+                              Store 148(r003) 151
+             153:    6(float) Load 11(inF0)
+             154:    6(float) ExtInst 1(GLSL.std.450) 16(Asin) 153
+                              Store 152(r004) 154
              158:    6(float) Load 11(inF0)
-             159:      8(int) Bitcast 158
-                              Store 157(r006) 159
-             161:      8(int) Load 14(inU0)
-             162:    6(float) Bitcast 161
-                              Store 160(r007) 162
-             164:    6(float) Load 11(inF0)
-             165:    6(float) ExtInst 1(GLSL.std.450) 18(Atan) 164
-                              Store 163(r009) 165
+             159:    155(int) Bitcast 158
+                              Store 157(r005) 159
+             161:    6(float) Load 11(inF0)
+             162:      8(int) Bitcast 161
+                              Store 160(r006) 162
+             164:      8(int) Load 14(inU0)
+             165:    6(float) Bitcast 164
+                              Store 163(r007) 165
              167:    6(float) Load 11(inF0)
-             168:    6(float) Load 12(inF1)
-             169:    6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 167 168
-                              Store 166(r010) 169
-             171:    6(float) Load 11(inF0)
-             172:    6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 171
-                              Store 170(r011) 172
+             168:    6(float) ExtInst 1(GLSL.std.450) 18(Atan) 167
+                              Store 166(r009) 168
+             170:    6(float) Load 11(inF0)
+             171:    6(float) Load 12(inF1)
+             172:    6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 170 171
+                              Store 169(r010) 172
              174:    6(float) Load 11(inF0)
-             175:    6(float) Load 12(inF1)
-             176:    6(float) Load 13(inF2)
-             177:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 174 175 176
-                              Store 173(r012) 177
-             178:    6(float) Load 11(inF0)
-             180:   135(bool) FOrdLessThan 178 179
-                              SelectionMerge 182 None
-                              BranchConditional 180 181 182
-             181:               Label
+             175:    6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 174
+                              Store 173(r011) 175
+             177:    6(float) Load 11(inF0)
+             178:    6(float) Load 12(inF1)
+             179:    6(float) Load 13(inF2)
+             180:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 177 178 179
+                              Store 176(r012) 180
+             181:    6(float) Load 11(inF0)
+             182:   135(bool) FOrdLessThan 181 139
+                              SelectionMerge 184 None
+                              BranchConditional 182 183 184
+             183:               Label
                                 Kill
-             182:             Label
-             185:    6(float) Load 11(inF0)
-             186:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 185
-                              Store 184(r014) 186
-             188:    6(float) Load 11(inF0)
-             189:    6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 188
-                              Store 187(r015) 189
-             192:    152(int) BitCount 191
-                              Store 190(r016) 192
-             194:    6(float) Load 11(inF0)
-             195:    6(float) DPdx 194
-                              Store 193(r017) 195
-             197:    6(float) Load 11(inF0)
-             198:    6(float) DPdxCoarse 197
-                              Store 196(r018) 198
-             200:    6(float) Load 11(inF0)
-             201:    6(float) DPdxFine 200
-                              Store 199(r019) 201
-             203:    6(float) Load 11(inF0)
-             204:    6(float) DPdy 203
-                              Store 202(r020) 204
-             206:    6(float) Load 11(inF0)
-             207:    6(float) DPdyCoarse 206
-                              Store 205(r021) 207
-             209:    6(float) Load 11(inF0)
-             210:    6(float) DPdyFine 209
-                              Store 208(r022) 210
-             212:    6(float) Load 11(inF0)
-             213:    6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 212
-                              Store 211(r023) 213
-             215:    6(float) Load 11(inF0)
-             216:    6(float) ExtInst 1(GLSL.std.450) 27(Exp) 215
-                              Store 214(r027) 216
-             218:    6(float) Load 11(inF0)
-             219:    6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 218
-                              Store 217(r028) 219
-             221:    152(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 191
-             222:      8(int) Bitcast 221
-                              Store 220(r029) 222
-             224:    152(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 191
-             225:      8(int) Bitcast 224
-                              Store 223(r030) 225
-             227:    6(float) Load 11(inF0)
-             228:    6(float) ExtInst 1(GLSL.std.450) 8(Floor) 227
-                              Store 226(r031) 228
-             230:    6(float) Load 11(inF0)
-             231:    6(float) Load 12(inF1)
-             232:    6(float) FMod 230 231
-                              Store 229(r033) 232
-             234:    6(float) Load 11(inF0)
-             235:    6(float) ExtInst 1(GLSL.std.450) 10(Fract) 234
-                              Store 233(r034) 235
-             237:    6(float) Load 11(inF0)
-             238:    6(float) Fwidth 237
-                              Store 236(r036) 238
-             240:    6(float) Load 11(inF0)
-             241:   135(bool) IsInf 240
-                              Store 239(r037) 241
-             243:    6(float) Load 11(inF0)
-             244:   135(bool) IsNan 243
-                              Store 242(r038) 244
-             246:    6(float) Load 11(inF0)
-             247:    6(float) Load 12(inF1)
-             248:    6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 246 247
-                              Store 245(r039) 248
-             250:    6(float) Load 11(inF0)
-             251:    6(float) Load 12(inF1)
-             252:    6(float) Load 13(inF2)
-             253:    6(float) ExtInst 1(GLSL.std.450) 46(FMix) 250 251 252
-                              Store 249(r039a) 253
-             255:    6(float) Load 11(inF0)
-             256:    6(float) ExtInst 1(GLSL.std.450) 28(Log) 255
-                              Store 254(r040) 256
-             258:    6(float) Load 11(inF0)
-             259:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 258
-             261:    6(float) FMul 259 260
-                              Store 257(r041) 261
-             263:    6(float) Load 11(inF0)
-             264:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 263
-                              Store 262(r042) 264
-             266:    6(float) Load 11(inF0)
-             267:    6(float) Load 12(inF1)
-             268:    6(float) ExtInst 1(GLSL.std.450) 40(FMax) 266 267
-                              Store 265(r043) 268
-             270:    6(float) Load 11(inF0)
-             271:    6(float) Load 12(inF1)
-             272:    6(float) ExtInst 1(GLSL.std.450) 37(FMin) 270 271
-                              Store 269(r044) 272
-             274:    6(float) Load 11(inF0)
-             275:    6(float) Load 12(inF1)
-             276:    6(float) ExtInst 1(GLSL.std.450) 26(Pow) 274 275
-                              Store 273(r045) 276
-             278:    6(float) Load 11(inF0)
-             279:    6(float) ExtInst 1(GLSL.std.450) 11(Radians) 278
-                              Store 277(r046) 279
-             282:    6(float) Load 11(inF0)
-             283:    6(float) FDiv 281 282
-                              Store 280(r047) 283
-             286:    152(int) BitReverse 285
-             287:      8(int) Bitcast 286
-                              Store 284(r048) 287
-             289:    6(float) Load 11(inF0)
-             290:    6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 289
-                              Store 288(r049) 290
-             292:    6(float) Load 11(inF0)
-             293:    6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 292
-                              Store 291(r050) 293
-             295:    6(float) Load 11(inF0)
-             296:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 295 179 281
-                              Store 294(r051) 296
-             298:    6(float) Load 11(inF0)
-             299:    6(float) ExtInst 1(GLSL.std.450) 6(FSign) 298
-                              Store 297(r052) 299
-             301:    6(float) Load 11(inF0)
-             302:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 301
-                              Store 300(r053) 302
+             184:             Label
+             187:    6(float) Load 11(inF0)
+             188:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 187
+                              Store 186(r014) 188
+             190:    6(float) Load 11(inF0)
+             191:    6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 190
+                              Store 189(r015) 191
+             194:    155(int) BitCount 193
+                              Store 192(r016) 194
+             196:    6(float) Load 11(inF0)
+             197:    6(float) DPdx 196
+                              Store 195(r017) 197
+             199:    6(float) Load 11(inF0)
+             200:    6(float) DPdxCoarse 199
+                              Store 198(r018) 200
+             202:    6(float) Load 11(inF0)
+             203:    6(float) DPdxFine 202
+                              Store 201(r019) 203
+             205:    6(float) Load 11(inF0)
+             206:    6(float) DPdy 205
+                              Store 204(r020) 206
+             208:    6(float) Load 11(inF0)
+             209:    6(float) DPdyCoarse 208
+                              Store 207(r021) 209
+             211:    6(float) Load 11(inF0)
+             212:    6(float) DPdyFine 211
+                              Store 210(r022) 212
+             214:    6(float) Load 11(inF0)
+             215:    6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 214
+                              Store 213(r023) 215
+             217:    6(float) Load 11(inF0)
+             218:    6(float) ExtInst 1(GLSL.std.450) 27(Exp) 217
+                              Store 216(r027) 218
+             220:    6(float) Load 11(inF0)
+             221:    6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 220
+                              Store 219(r028) 221
+             223:    155(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 193
+             224:      8(int) Bitcast 223
+                              Store 222(r029) 224
+             226:    155(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 193
+             227:      8(int) Bitcast 226
+                              Store 225(r030) 227
+             229:    6(float) Load 11(inF0)
+             230:    6(float) ExtInst 1(GLSL.std.450) 8(Floor) 229
+                              Store 228(r031) 230
+             232:    6(float) Load 11(inF0)
+             233:    6(float) Load 12(inF1)
+             234:    6(float) FMod 232 233
+                              Store 231(r033) 234
+             236:    6(float) Load 11(inF0)
+             237:    6(float) ExtInst 1(GLSL.std.450) 10(Fract) 236
+                              Store 235(r034) 237
+             239:    6(float) Load 11(inF0)
+             240:    6(float) Fwidth 239
+                              Store 238(r036) 240
+             242:    6(float) Load 11(inF0)
+             243:   135(bool) IsInf 242
+                              Store 241(r037) 243
+             245:    6(float) Load 11(inF0)
+             246:   135(bool) IsNan 245
+                              Store 244(r038) 246
+             248:    6(float) Load 11(inF0)
+             249:    6(float) Load 12(inF1)
+             250:    6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 248 249
+                              Store 247(r039) 250
+             252:    6(float) Load 11(inF0)
+             253:    6(float) Load 12(inF1)
+             254:    6(float) Load 13(inF2)
+             255:    6(float) ExtInst 1(GLSL.std.450) 46(FMix) 252 253 254
+                              Store 251(r039a) 255
+             257:    6(float) Load 11(inF0)
+             258:    6(float) ExtInst 1(GLSL.std.450) 28(Log) 257
+                              Store 256(r040) 258
+             260:    6(float) Load 11(inF0)
+             261:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 260
+             263:    6(float) FMul 261 262
+                              Store 259(r041) 263
+             265:    6(float) Load 11(inF0)
+             266:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 265
+                              Store 264(r042) 266
+             268:    6(float) Load 11(inF0)
+             269:    6(float) Load 12(inF1)
+             270:    6(float) ExtInst 1(GLSL.std.450) 40(FMax) 268 269
+                              Store 267(r043) 270
+             272:    6(float) Load 11(inF0)
+             273:    6(float) Load 12(inF1)
+             274:    6(float) ExtInst 1(GLSL.std.450) 37(FMin) 272 273
+                              Store 271(r044) 274
+             276:    6(float) Load 11(inF0)
+             277:    6(float) Load 12(inF1)
+             278:    6(float) ExtInst 1(GLSL.std.450) 26(Pow) 276 277
+                              Store 275(r045) 278
+             280:    6(float) Load 11(inF0)
+             281:    6(float) ExtInst 1(GLSL.std.450) 11(Radians) 280
+                              Store 279(r046) 281
+             284:    6(float) Load 11(inF0)
+             285:    6(float) FDiv 283 284
+                              Store 282(r047) 285
+             288:    155(int) BitReverse 287
+             289:      8(int) Bitcast 288
+                              Store 286(r048) 289
+             291:    6(float) Load 11(inF0)
+             292:    6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 291
+                              Store 290(r049) 292
+             294:    6(float) Load 11(inF0)
+             295:    6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 294
+                              Store 293(r050) 295
+             297:    6(float) Load 11(inF0)
+             298:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 297 139 283
+                              Store 296(r051) 298
+             300:    6(float) Load 11(inF0)
+             301:    6(float) ExtInst 1(GLSL.std.450) 6(FSign) 300
+                              Store 299(r052) 301
              303:    6(float) Load 11(inF0)
              304:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 303
-                              Store 12(inF1) 304
+                              Store 302(r053) 304
              305:    6(float) Load 11(inF0)
-             306:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 305
-                              Store 13(inF2) 306
-             308:    6(float) Load 11(inF0)
-             309:    6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 308
-                              Store 307(r055) 309
-             311:    6(float) Load 11(inF0)
-             312:    6(float) Load 12(inF1)
-             313:    6(float) Load 13(inF2)
-             314:    6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 311 312 313
-                              Store 310(r056) 314
-             316:    6(float) Load 11(inF0)
-             317:    6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 316
-                              Store 315(r057) 317
-             319:    6(float) Load 11(inF0)
-             320:    6(float) Load 12(inF1)
-             321:    6(float) ExtInst 1(GLSL.std.450) 48(Step) 319 320
-                              Store 318(r058) 321
-             323:    6(float) Load 11(inF0)
-             324:    6(float) ExtInst 1(GLSL.std.450) 15(Tan) 323
-                              Store 322(r059) 324
-             326:    6(float) Load 11(inF0)
-             327:    6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 326
-                              Store 325(r060) 327
-             329:    6(float) Load 11(inF0)
-             330:    6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 329
-                              Store 328(r061) 330
-                              ReturnValue 179
+             306:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 305
+                              Store 12(inF1) 306
+             307:    6(float) Load 11(inF0)
+             308:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 307
+                              Store 13(inF2) 308
+             310:    6(float) Load 11(inF0)
+             311:    6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 310
+                              Store 309(r055) 311
+             313:    6(float) Load 11(inF0)
+             314:    6(float) Load 12(inF1)
+             315:    6(float) Load 13(inF2)
+             316:    6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 313 314 315
+                              Store 312(r056) 316
+             318:    6(float) Load 11(inF0)
+             319:    6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 318
+                              Store 317(r057) 319
+             321:    6(float) Load 11(inF0)
+             322:    6(float) Load 12(inF1)
+             323:    6(float) ExtInst 1(GLSL.std.450) 48(Step) 321 322
+                              Store 320(r058) 323
+             325:    6(float) Load 11(inF0)
+             326:    6(float) ExtInst 1(GLSL.std.450) 15(Tan) 325
+                              Store 324(r059) 326
+             328:    6(float) Load 11(inF0)
+             329:    6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 328
+                              Store 327(r060) 329
+             331:    6(float) Load 11(inF0)
+             332:    6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 331
+                              Store 330(r061) 332
+                              ReturnValue 139
                               FunctionEnd
 22(PixelShaderFunction1(vf1;vf1;vf1;):    6(float) Function None 18
         19(inF0):      7(ptr) FunctionParameter
         20(inF1):      7(ptr) FunctionParameter
         21(inF2):      7(ptr) FunctionParameter
               23:             Label
-                              ReturnValue 179
+                              ReturnValue 139
                               FunctionEnd
 34(PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;):   24(fvec2) Function None 28
         29(inF0):     25(ptr) FunctionParameter
@@ -6450,288 +6480,290 @@
         32(inU0):     27(ptr) FunctionParameter
         33(inU1):     27(ptr) FunctionParameter
               35:             Label
-       335(r000):    136(ptr) Variable Function
-       338(r001):     25(ptr) Variable Function
-       341(r002):     25(ptr) Variable Function
-       344(r003):    136(ptr) Variable Function
-       347(r004):     25(ptr) Variable Function
-       352(r005):    351(ptr) Variable Function
-       355(r006):     27(ptr) Variable Function
-       358(r007):     25(ptr) Variable Function
-       361(r009):     25(ptr) Variable Function
-       364(r010):     25(ptr) Variable Function
-       368(r011):     25(ptr) Variable Function
-       371(r012):     25(ptr) Variable Function
-       384(r013):     25(ptr) Variable Function
-       387(r015):     25(ptr) Variable Function
-       390(r016):    351(ptr) Variable Function
-       394(r017):     25(ptr) Variable Function
-       397(r018):     25(ptr) Variable Function
-       400(r019):     25(ptr) Variable Function
-       403(r020):     25(ptr) Variable Function
-       406(r021):     25(ptr) Variable Function
-       409(r022):     25(ptr) Variable Function
-       412(r023):     25(ptr) Variable Function
-       415(r026):      7(ptr) Variable Function
-       419(r027):      7(ptr) Variable Function
-       423(r028):     25(ptr) Variable Function
-       426(r029):     25(ptr) Variable Function
-       429(r030):     25(ptr) Variable Function
-       434(r031):     27(ptr) Variable Function
-       439(r032):     27(ptr) Variable Function
-       441(r033):     25(ptr) Variable Function
-       444(r035):     25(ptr) Variable Function
-       448(r036):     25(ptr) Variable Function
-       451(r038):     25(ptr) Variable Function
-       455(r039):    454(ptr) Variable Function
-       458(r040):    454(ptr) Variable Function
-       461(r041):     25(ptr) Variable Function
-      465(r039a):     25(ptr) Variable Function
-       470(r042):      7(ptr) Variable Function
-       473(r043):     25(ptr) Variable Function
-       476(r044):     25(ptr) Variable Function
-       480(r045):     25(ptr) Variable Function
-       483(r046):     25(ptr) Variable Function
-       487(r047):     25(ptr) Variable Function
-       491(r048):     25(ptr) Variable Function
-       494(r049):     25(ptr) Variable Function
-       498(r050):     25(ptr) Variable Function
-       501(r051):     25(ptr) Variable Function
-       505(r052):     25(ptr) Variable Function
-       509(r053):     25(ptr) Variable Function
-       514(r054):     27(ptr) Variable Function
-       519(r055):     25(ptr) Variable Function
-       522(r056):     25(ptr) Variable Function
-       525(r057):     25(ptr) Variable Function
-       530(r058):     25(ptr) Variable Function
-       533(r059):     25(ptr) Variable Function
-       540(r060):     25(ptr) Variable Function
-       543(r061):     25(ptr) Variable Function
-       548(r062):     25(ptr) Variable Function
-       551(r063):     25(ptr) Variable Function
-       555(r064):     25(ptr) Variable Function
-       558(r065):     25(ptr) Variable Function
-       561(r066):     25(ptr) Variable Function
-             336:   24(fvec2) Load 29(inF0)
-             337:   135(bool) All 336
-                              Store 335(r000) 337
-             339:   24(fvec2) Load 29(inF0)
-             340:   24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 339
-                              Store 338(r001) 340
-             342:   24(fvec2) Load 29(inF0)
-             343:   24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 342
-                              Store 341(r002) 343
-             345:   24(fvec2) Load 29(inF0)
-             346:   135(bool) Any 345
-                              Store 344(r003) 346
-             348:   24(fvec2) Load 29(inF0)
-             349:   24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 348
-                              Store 347(r004) 349
-             353:   24(fvec2) Load 29(inF0)
-             354:  350(ivec2) Bitcast 353
-                              Store 352(r005) 354
-             356:   24(fvec2) Load 29(inF0)
-             357:   26(ivec2) Bitcast 356
-                              Store 355(r006) 357
-             359:   26(ivec2) Load 32(inU0)
-             360:   24(fvec2) Bitcast 359
-                              Store 358(r007) 360
+       337(r000):    136(ptr) Variable Function
+       343(r001):     25(ptr) Variable Function
+       346(r002):     25(ptr) Variable Function
+       349(r003):    136(ptr) Variable Function
+       353(r004):     25(ptr) Variable Function
+       358(r005):    357(ptr) Variable Function
+       361(r006):     27(ptr) Variable Function
+       364(r007):     25(ptr) Variable Function
+       367(r009):     25(ptr) Variable Function
+       370(r010):     25(ptr) Variable Function
+       374(r011):     25(ptr) Variable Function
+       377(r012):     25(ptr) Variable Function
+       388(r013):     25(ptr) Variable Function
+       391(r015):     25(ptr) Variable Function
+       394(r016):    357(ptr) Variable Function
+       398(r017):     25(ptr) Variable Function
+       401(r018):     25(ptr) Variable Function
+       404(r019):     25(ptr) Variable Function
+       407(r020):     25(ptr) Variable Function
+       410(r021):     25(ptr) Variable Function
+       413(r022):     25(ptr) Variable Function
+       416(r023):     25(ptr) Variable Function
+       419(r026):      7(ptr) Variable Function
+       423(r027):      7(ptr) Variable Function
+       427(r028):     25(ptr) Variable Function
+       430(r029):     25(ptr) Variable Function
+       433(r030):     25(ptr) Variable Function
+       438(r031):     27(ptr) Variable Function
+       443(r032):     27(ptr) Variable Function
+       445(r033):     25(ptr) Variable Function
+       448(r035):     25(ptr) Variable Function
+       452(r036):     25(ptr) Variable Function
+       455(r038):     25(ptr) Variable Function
+       459(r039):    458(ptr) Variable Function
+       462(r040):    458(ptr) Variable Function
+       465(r041):     25(ptr) Variable Function
+      469(r039a):     25(ptr) Variable Function
+       474(r042):      7(ptr) Variable Function
+       477(r043):     25(ptr) Variable Function
+       480(r044):     25(ptr) Variable Function
+       484(r045):     25(ptr) Variable Function
+       487(r046):     25(ptr) Variable Function
+       491(r047):     25(ptr) Variable Function
+       495(r048):     25(ptr) Variable Function
+       498(r049):     25(ptr) Variable Function
+       502(r050):     25(ptr) Variable Function
+       505(r051):     25(ptr) Variable Function
+       509(r052):     25(ptr) Variable Function
+       513(r053):     25(ptr) Variable Function
+       518(r054):     27(ptr) Variable Function
+       523(r055):     25(ptr) Variable Function
+       526(r056):     25(ptr) Variable Function
+       529(r057):     25(ptr) Variable Function
+       534(r058):     25(ptr) Variable Function
+       537(r059):     25(ptr) Variable Function
+       544(r060):     25(ptr) Variable Function
+       547(r061):     25(ptr) Variable Function
+       552(r062):     25(ptr) Variable Function
+       555(r063):     25(ptr) Variable Function
+       559(r064):     25(ptr) Variable Function
+       562(r065):     25(ptr) Variable Function
+       565(r066):     25(ptr) Variable Function
+             338:   24(fvec2) Load 29(inF0)
+             341:  339(bvec2) FOrdNotEqual 338 340
+             342:   135(bool) All 341
+                              Store 337(r000) 342
+             344:   24(fvec2) Load 29(inF0)
+             345:   24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 344
+                              Store 343(r001) 345
+             347:   24(fvec2) Load 29(inF0)
+             348:   24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 347
+                              Store 346(r002) 348
+             350:   24(fvec2) Load 29(inF0)
+             351:  339(bvec2) FOrdNotEqual 350 340
+             352:   135(bool) Any 351
+                              Store 349(r003) 352
+             354:   24(fvec2) Load 29(inF0)
+             355:   24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 354
+                              Store 353(r004) 355
+             359:   24(fvec2) Load 29(inF0)
+             360:  356(ivec2) Bitcast 359
+                              Store 358(r005) 360
              362:   24(fvec2) Load 29(inF0)
-             363:   24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 362
-                              Store 361(r009) 363
-             365:   24(fvec2) Load 29(inF0)
-             366:   24(fvec2) Load 30(inF1)
-             367:   24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 365 366
-                              Store 364(r010) 367
-             369:   24(fvec2) Load 29(inF0)
-             370:   24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 369
-                              Store 368(r011) 370
-             372:   24(fvec2) Load 29(inF0)
-             373:   24(fvec2) Load 30(inF1)
-             374:   24(fvec2) Load 31(inF2)
-             375:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 372 373 374
-                              Store 371(r012) 375
-             376:   24(fvec2) Load 29(inF0)
-             379:  378(bvec2) FOrdLessThan 376 377
-             380:   135(bool) Any 379
-                              SelectionMerge 382 None
-                              BranchConditional 380 381 382
-             381:               Label
+             363:   26(ivec2) Bitcast 362
+                              Store 361(r006) 363
+             365:   26(ivec2) Load 32(inU0)
+             366:   24(fvec2) Bitcast 365
+                              Store 364(r007) 366
+             368:   24(fvec2) Load 29(inF0)
+             369:   24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 368
+                              Store 367(r009) 369
+             371:   24(fvec2) Load 29(inF0)
+             372:   24(fvec2) Load 30(inF1)
+             373:   24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 371 372
+                              Store 370(r010) 373
+             375:   24(fvec2) Load 29(inF0)
+             376:   24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 375
+                              Store 374(r011) 376
+             378:   24(fvec2) Load 29(inF0)
+             379:   24(fvec2) Load 30(inF1)
+             380:   24(fvec2) Load 31(inF2)
+             381:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 378 379 380
+                              Store 377(r012) 381
+             382:   24(fvec2) Load 29(inF0)
+             383:  339(bvec2) FOrdLessThan 382 340
+             384:   135(bool) Any 383
+                              SelectionMerge 386 None
+                              BranchConditional 384 385 386
+             385:               Label
                                 Kill
-             382:             Label
-             385:   24(fvec2) Load 29(inF0)
-             386:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 385
-                              Store 384(r013) 386
-             388:   24(fvec2) Load 29(inF0)
-             389:   24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 388
-                              Store 387(r015) 389
-             393:  350(ivec2) BitCount 392
-                              Store 390(r016) 393
-             395:   24(fvec2) Load 29(inF0)
-             396:   24(fvec2) DPdx 395
-                              Store 394(r017) 396
-             398:   24(fvec2) Load 29(inF0)
-             399:   24(fvec2) DPdxCoarse 398
-                              Store 397(r018) 399
-             401:   24(fvec2) Load 29(inF0)
-             402:   24(fvec2) DPdxFine 401
-                              Store 400(r019) 402
-             404:   24(fvec2) Load 29(inF0)
-             405:   24(fvec2) DPdy 404
-                              Store 403(r020) 405
-             407:   24(fvec2) Load 29(inF0)
-             408:   24(fvec2) DPdyCoarse 407
-                              Store 406(r021) 408
-             410:   24(fvec2) Load 29(inF0)
-             411:   24(fvec2) DPdyFine 410
-                              Store 409(r022) 411
-             413:   24(fvec2) Load 29(inF0)
-             414:   24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 413
-                              Store 412(r023) 414
-             416:   24(fvec2) Load 29(inF0)
-             417:   24(fvec2) Load 30(inF1)
-             418:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 416 417
-                              Store 415(r026) 418
+             386:             Label
+             389:   24(fvec2) Load 29(inF0)
+             390:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 389
+                              Store 388(r013) 390
+             392:   24(fvec2) Load 29(inF0)
+             393:   24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 392
+                              Store 391(r015) 393
+             397:  356(ivec2) BitCount 396
+                              Store 394(r016) 397
+             399:   24(fvec2) Load 29(inF0)
+             400:   24(fvec2) DPdx 399
+                              Store 398(r017) 400
+             402:   24(fvec2) Load 29(inF0)
+             403:   24(fvec2) DPdxCoarse 402
+                              Store 401(r018) 403
+             405:   24(fvec2) Load 29(inF0)
+             406:   24(fvec2) DPdxFine 405
+                              Store 404(r019) 406
+             408:   24(fvec2) Load 29(inF0)
+             409:   24(fvec2) DPdy 408
+                              Store 407(r020) 409
+             411:   24(fvec2) Load 29(inF0)
+             412:   24(fvec2) DPdyCoarse 411
+                              Store 410(r021) 412
+             414:   24(fvec2) Load 29(inF0)
+             415:   24(fvec2) DPdyFine 414
+                              Store 413(r022) 415
+             417:   24(fvec2) Load 29(inF0)
+             418:   24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 417
+                              Store 416(r023) 418
              420:   24(fvec2) Load 29(inF0)
              421:   24(fvec2) Load 30(inF1)
-             422:    6(float) Dot 420 421
-                              Store 419(r027) 422
+             422:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421
+                              Store 419(r026) 422
              424:   24(fvec2) Load 29(inF0)
-             425:   24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 424
-                              Store 423(r028) 425
-             427:   24(fvec2) Load 29(inF0)
-             428:   24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 427
-                              Store 426(r029) 428
-             430:   24(fvec2) Load 29(inF0)
-             431:   24(fvec2) Load 30(inF1)
-             432:   24(fvec2) Load 31(inF2)
-             433:   24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 430 431 432
-                              Store 429(r030) 433
-             438:   26(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 437
-                              Store 434(r031) 438
-             440:   26(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 437
-                              Store 439(r032) 440
-             442:   24(fvec2) Load 29(inF0)
-             443:   24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 442
-                              Store 441(r033) 443
-             445:   24(fvec2) Load 29(inF0)
-             446:   24(fvec2) Load 30(inF1)
-             447:   24(fvec2) FMod 445 446
-                              Store 444(r035) 447
+             425:   24(fvec2) Load 30(inF1)
+             426:    6(float) Dot 424 425
+                              Store 423(r027) 426
+             428:   24(fvec2) Load 29(inF0)
+             429:   24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 428
+                              Store 427(r028) 429
+             431:   24(fvec2) Load 29(inF0)
+             432:   24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 431
+                              Store 430(r029) 432
+             434:   24(fvec2) Load 29(inF0)
+             435:   24(fvec2) Load 30(inF1)
+             436:   24(fvec2) Load 31(inF2)
+             437:   24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 434 435 436
+                              Store 433(r030) 437
+             442:   26(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 441
+                              Store 438(r031) 442
+             444:   26(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 441
+                              Store 443(r032) 444
+             446:   24(fvec2) Load 29(inF0)
+             447:   24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 446
+                              Store 445(r033) 447
              449:   24(fvec2) Load 29(inF0)
-             450:   24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 449
-                              Store 448(r036) 450
-             452:   24(fvec2) Load 29(inF0)
-             453:   24(fvec2) Fwidth 452
-                              Store 451(r038) 453
+             450:   24(fvec2) Load 30(inF1)
+             451:   24(fvec2) FMod 449 450
+                              Store 448(r035) 451
+             453:   24(fvec2) Load 29(inF0)
+             454:   24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 453
+                              Store 452(r036) 454
              456:   24(fvec2) Load 29(inF0)
-             457:  378(bvec2) IsInf 456
-                              Store 455(r039) 457
-             459:   24(fvec2) Load 29(inF0)
-             460:  378(bvec2) IsNan 459
-                              Store 458(r040) 460
-             462:   24(fvec2) Load 29(inF0)
-             463:   24(fvec2) Load 30(inF1)
-             464:   24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 462 463
-                              Store 461(r041) 464
+             457:   24(fvec2) Fwidth 456
+                              Store 455(r038) 457
+             460:   24(fvec2) Load 29(inF0)
+             461:  339(bvec2) IsInf 460
+                              Store 459(r039) 461
+             463:   24(fvec2) Load 29(inF0)
+             464:  339(bvec2) IsNan 463
+                              Store 462(r040) 464
              466:   24(fvec2) Load 29(inF0)
              467:   24(fvec2) Load 30(inF1)
-             468:   24(fvec2) Load 31(inF2)
-             469:   24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 466 467 468
-                              Store 465(r039a) 469
-             471:   24(fvec2) Load 29(inF0)
-             472:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 471
-                              Store 470(r042) 472
-             474:   24(fvec2) Load 29(inF0)
-             475:   24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 474
-                              Store 473(r043) 475
-             477:   24(fvec2) Load 29(inF0)
-             478:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 477
-             479:   24(fvec2) VectorTimesScalar 478 260
-                              Store 476(r044) 479
+             468:   24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 466 467
+                              Store 465(r041) 468
+             470:   24(fvec2) Load 29(inF0)
+             471:   24(fvec2) Load 30(inF1)
+             472:   24(fvec2) Load 31(inF2)
+             473:   24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 470 471 472
+                              Store 469(r039a) 473
+             475:   24(fvec2) Load 29(inF0)
+             476:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 475
+                              Store 474(r042) 476
+             478:   24(fvec2) Load 29(inF0)
+             479:   24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 478
+                              Store 477(r043) 479
              481:   24(fvec2) Load 29(inF0)
              482:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 481
-                              Store 480(r045) 482
-             484:   24(fvec2) Load 29(inF0)
-             485:   24(fvec2) Load 30(inF1)
-             486:   24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 484 485
-                              Store 483(r046) 486
+             483:   24(fvec2) VectorTimesScalar 482 262
+                              Store 480(r044) 483
+             485:   24(fvec2) Load 29(inF0)
+             486:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 485
+                              Store 484(r045) 486
              488:   24(fvec2) Load 29(inF0)
              489:   24(fvec2) Load 30(inF1)
-             490:   24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 488 489
-                              Store 487(r047) 490
+             490:   24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 488 489
+                              Store 487(r046) 490
              492:   24(fvec2) Load 29(inF0)
-             493:   24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 492
-                              Store 491(r048) 493
-             495:   24(fvec2) Load 29(inF0)
-             496:   24(fvec2) Load 30(inF1)
-             497:   24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 495 496
-                              Store 494(r049) 497
+             493:   24(fvec2) Load 30(inF1)
+             494:   24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 492 493
+                              Store 491(r047) 494
+             496:   24(fvec2) Load 29(inF0)
+             497:   24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 496
+                              Store 495(r048) 497
              499:   24(fvec2) Load 29(inF0)
-             500:   24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 499
-                              Store 498(r050) 500
-             502:   24(fvec2) Load 29(inF0)
-             503:   24(fvec2) CompositeConstruct 281 281
-             504:   24(fvec2) FDiv 503 502
-                              Store 501(r051) 504
+             500:   24(fvec2) Load 30(inF1)
+             501:   24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 499 500
+                              Store 498(r049) 501
+             503:   24(fvec2) Load 29(inF0)
+             504:   24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 503
+                              Store 502(r050) 504
              506:   24(fvec2) Load 29(inF0)
-             507:   24(fvec2) Load 30(inF1)
-             508:   24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 506 507
-                              Store 505(r052) 508
+             507:   24(fvec2) CompositeConstruct 283 283
+             508:   24(fvec2) FDiv 507 506
+                              Store 505(r051) 508
              510:   24(fvec2) Load 29(inF0)
              511:   24(fvec2) Load 30(inF1)
-             513:   24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 510 511 512
-                              Store 509(r053) 513
-             518:   26(ivec2) BitReverse 517
-                              Store 514(r054) 518
-             520:   24(fvec2) Load 29(inF0)
-             521:   24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 520
-                              Store 519(r055) 521
-             523:   24(fvec2) Load 29(inF0)
-             524:   24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 523
-                              Store 522(r056) 524
-             526:   24(fvec2) Load 29(inF0)
-             527:   24(fvec2) CompositeConstruct 179 179
-             528:   24(fvec2) CompositeConstruct 281 281
-             529:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 526 527 528
-                              Store 525(r057) 529
-             531:   24(fvec2) Load 29(inF0)
-             532:   24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 531
-                              Store 530(r058) 532
-             534:   24(fvec2) Load 29(inF0)
-             535:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 534
-                              Store 533(r059) 535
-             536:   24(fvec2) Load 29(inF0)
-             537:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 536
-                              Store 30(inF1) 537
+             512:   24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 510 511
+                              Store 509(r052) 512
+             514:   24(fvec2) Load 29(inF0)
+             515:   24(fvec2) Load 30(inF1)
+             517:   24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 514 515 516
+                              Store 513(r053) 517
+             522:   26(ivec2) BitReverse 521
+                              Store 518(r054) 522
+             524:   24(fvec2) Load 29(inF0)
+             525:   24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 524
+                              Store 523(r055) 525
+             527:   24(fvec2) Load 29(inF0)
+             528:   24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 527
+                              Store 526(r056) 528
+             530:   24(fvec2) Load 29(inF0)
+             531:   24(fvec2) CompositeConstruct 139 139
+             532:   24(fvec2) CompositeConstruct 283 283
+             533:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 530 531 532
+                              Store 529(r057) 533
+             535:   24(fvec2) Load 29(inF0)
+             536:   24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 535
+                              Store 534(r058) 536
              538:   24(fvec2) Load 29(inF0)
-             539:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 538
-                              Store 31(inF2) 539
-             541:   24(fvec2) Load 29(inF0)
-             542:   24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 541
-                              Store 540(r060) 542
-             544:   24(fvec2) Load 29(inF0)
-             545:   24(fvec2) Load 30(inF1)
-             546:   24(fvec2) Load 31(inF2)
-             547:   24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 544 545 546
-                              Store 543(r061) 547
-             549:   24(fvec2) Load 29(inF0)
-             550:   24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 549
-                              Store 548(r062) 550
-             552:   24(fvec2) Load 29(inF0)
-             553:   24(fvec2) Load 30(inF1)
-             554:   24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 552 553
-                              Store 551(r063) 554
+             539:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 538
+                              Store 537(r059) 539
+             540:   24(fvec2) Load 29(inF0)
+             541:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 540
+                              Store 30(inF1) 541
+             542:   24(fvec2) Load 29(inF0)
+             543:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 542
+                              Store 31(inF2) 543
+             545:   24(fvec2) Load 29(inF0)
+             546:   24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 545
+                              Store 544(r060) 546
+             548:   24(fvec2) Load 29(inF0)
+             549:   24(fvec2) Load 30(inF1)
+             550:   24(fvec2) Load 31(inF2)
+             551:   24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 548 549 550
+                              Store 547(r061) 551
+             553:   24(fvec2) Load 29(inF0)
+             554:   24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 553
+                              Store 552(r062) 554
              556:   24(fvec2) Load 29(inF0)
-             557:   24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 556
-                              Store 555(r064) 557
-             559:   24(fvec2) Load 29(inF0)
-             560:   24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 559
-                              Store 558(r065) 560
-             562:   24(fvec2) Load 29(inF0)
-             563:   24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 562
-                              Store 561(r066) 563
-                              ReturnValue 564
+             557:   24(fvec2) Load 30(inF1)
+             558:   24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 556 557
+                              Store 555(r063) 558
+             560:   24(fvec2) Load 29(inF0)
+             561:   24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 560
+                              Store 559(r064) 561
+             563:   24(fvec2) Load 29(inF0)
+             564:   24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 563
+                              Store 562(r065) 564
+             566:   24(fvec2) Load 29(inF0)
+             567:   24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 566
+                              Store 565(r066) 567
+                              ReturnValue 568
                               FunctionEnd
 46(PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;):   36(fvec3) Function None 40
         41(inF0):     37(ptr) FunctionParameter
@@ -6740,299 +6772,301 @@
         44(inU0):     39(ptr) FunctionParameter
         45(inU1):     39(ptr) FunctionParameter
               47:             Label
-       567(r000):    136(ptr) Variable Function
-       570(r001):     37(ptr) Variable Function
-       573(r002):     37(ptr) Variable Function
-       576(r003):    136(ptr) Variable Function
-       579(r004):     37(ptr) Variable Function
-       584(r005):    583(ptr) Variable Function
-       587(r006):     39(ptr) Variable Function
-       590(r007):     37(ptr) Variable Function
-       593(r009):     37(ptr) Variable Function
-       596(r010):     37(ptr) Variable Function
-       600(r011):     37(ptr) Variable Function
-       603(r012):     37(ptr) Variable Function
-       616(r013):     37(ptr) Variable Function
-       619(r014):     37(ptr) Variable Function
-       622(r015):     39(ptr) Variable Function
-       627(r016):     37(ptr) Variable Function
-       631(r017):     37(ptr) Variable Function
-       634(r018):     37(ptr) Variable Function
-       637(r019):     37(ptr) Variable Function
-       640(r020):     37(ptr) Variable Function
-       643(r021):     37(ptr) Variable Function
-       646(r022):     37(ptr) Variable Function
-       649(r023):     37(ptr) Variable Function
-       652(r024):      7(ptr) Variable Function
-       656(r025):      7(ptr) Variable Function
-       660(r029):     37(ptr) Variable Function
-       663(r030):     37(ptr) Variable Function
-       666(r031):     37(ptr) Variable Function
-       671(r032):     39(ptr) Variable Function
-       675(r033):     39(ptr) Variable Function
-       677(r034):     37(ptr) Variable Function
-       680(r036):     37(ptr) Variable Function
-       684(r037):     37(ptr) Variable Function
-       687(r039):     37(ptr) Variable Function
-       691(r040):    690(ptr) Variable Function
-       694(r041):    690(ptr) Variable Function
-       697(r042):     37(ptr) Variable Function
-      701(r039a):     37(ptr) Variable Function
-      706(r039b):     37(ptr) Variable Function
-       712(r043):      7(ptr) Variable Function
-       715(r044):     37(ptr) Variable Function
-       718(r045):     37(ptr) Variable Function
-       722(r046):     37(ptr) Variable Function
-       725(r047):     37(ptr) Variable Function
-       729(r048):     37(ptr) Variable Function
-       733(r049):     37(ptr) Variable Function
-       736(r050):     37(ptr) Variable Function
-       740(r051):     37(ptr) Variable Function
-       743(r052):     37(ptr) Variable Function
-       747(r053):     37(ptr) Variable Function
-       751(r054):     37(ptr) Variable Function
-       755(r055):     39(ptr) Variable Function
-       758(r056):     37(ptr) Variable Function
-       761(r057):     37(ptr) Variable Function
-       764(r058):     37(ptr) Variable Function
-       769(r059):     37(ptr) Variable Function
-       772(r060):     37(ptr) Variable Function
-       779(r061):     37(ptr) Variable Function
-       782(r062):     37(ptr) Variable Function
-       787(r063):     37(ptr) Variable Function
-       790(r064):     37(ptr) Variable Function
-       794(r065):     37(ptr) Variable Function
-       797(r066):     37(ptr) Variable Function
-       800(r067):     37(ptr) Variable Function
-             568:   36(fvec3) Load 41(inF0)
-             569:   135(bool) All 568
-                              Store 567(r000) 569
-             571:   36(fvec3) Load 41(inF0)
-             572:   36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 571
-                              Store 570(r001) 572
-             574:   36(fvec3) Load 41(inF0)
-             575:   36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 574
-                              Store 573(r002) 575
-             577:   36(fvec3) Load 41(inF0)
-             578:   135(bool) Any 577
-                              Store 576(r003) 578
-             580:   36(fvec3) Load 41(inF0)
-             581:   36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 580
-                              Store 579(r004) 581
-             585:   36(fvec3) Load 41(inF0)
-             586:  582(ivec3) Bitcast 585
-                              Store 584(r005) 586
+       571(r000):    136(ptr) Variable Function
+       577(r001):     37(ptr) Variable Function
+       580(r002):     37(ptr) Variable Function
+       583(r003):    136(ptr) Variable Function
+       587(r004):     37(ptr) Variable Function
+       592(r005):    591(ptr) Variable Function
+       595(r006):     39(ptr) Variable Function
+       598(r007):     37(ptr) Variable Function
+       601(r009):     37(ptr) Variable Function
+       604(r010):     37(ptr) Variable Function
+       608(r011):     37(ptr) Variable Function
+       611(r012):     37(ptr) Variable Function
+       622(r013):     37(ptr) Variable Function
+       625(r014):     37(ptr) Variable Function
+       628(r015):     39(ptr) Variable Function
+       633(r016):     37(ptr) Variable Function
+       637(r017):     37(ptr) Variable Function
+       640(r018):     37(ptr) Variable Function
+       643(r019):     37(ptr) Variable Function
+       646(r020):     37(ptr) Variable Function
+       649(r021):     37(ptr) Variable Function
+       652(r022):     37(ptr) Variable Function
+       655(r023):     37(ptr) Variable Function
+       658(r024):      7(ptr) Variable Function
+       662(r025):      7(ptr) Variable Function
+       666(r029):     37(ptr) Variable Function
+       669(r030):     37(ptr) Variable Function
+       672(r031):     37(ptr) Variable Function
+       677(r032):     39(ptr) Variable Function
+       681(r033):     39(ptr) Variable Function
+       683(r034):     37(ptr) Variable Function
+       686(r036):     37(ptr) Variable Function
+       690(r037):     37(ptr) Variable Function
+       693(r039):     37(ptr) Variable Function
+       697(r040):    696(ptr) Variable Function
+       700(r041):    696(ptr) Variable Function
+       703(r042):     37(ptr) Variable Function
+      707(r039a):     37(ptr) Variable Function
+      712(r039b):     37(ptr) Variable Function
+       718(r043):      7(ptr) Variable Function
+       721(r044):     37(ptr) Variable Function
+       724(r045):     37(ptr) Variable Function
+       728(r046):     37(ptr) Variable Function
+       731(r047):     37(ptr) Variable Function
+       735(r048):     37(ptr) Variable Function
+       739(r049):     37(ptr) Variable Function
+       742(r050):     37(ptr) Variable Function
+       746(r051):     37(ptr) Variable Function
+       749(r052):     37(ptr) Variable Function
+       753(r053):     37(ptr) Variable Function
+       757(r054):     37(ptr) Variable Function
+       761(r055):     39(ptr) Variable Function
+       764(r056):     37(ptr) Variable Function
+       767(r057):     37(ptr) Variable Function
+       770(r058):     37(ptr) Variable Function
+       775(r059):     37(ptr) Variable Function
+       778(r060):     37(ptr) Variable Function
+       785(r061):     37(ptr) Variable Function
+       788(r062):     37(ptr) Variable Function
+       793(r063):     37(ptr) Variable Function
+       796(r064):     37(ptr) Variable Function
+       800(r065):     37(ptr) Variable Function
+       803(r066):     37(ptr) Variable Function
+       806(r067):     37(ptr) Variable Function
+             572:   36(fvec3) Load 41(inF0)
+             575:  573(bvec3) FOrdNotEqual 572 574
+             576:   135(bool) All 575
+                              Store 571(r000) 576
+             578:   36(fvec3) Load 41(inF0)
+             579:   36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 578
+                              Store 577(r001) 579
+             581:   36(fvec3) Load 41(inF0)
+             582:   36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 581
+                              Store 580(r002) 582
+             584:   36(fvec3) Load 41(inF0)
+             585:  573(bvec3) FOrdNotEqual 584 574
+             586:   135(bool) Any 585
+                              Store 583(r003) 586
              588:   36(fvec3) Load 41(inF0)
-             589:   38(ivec3) Bitcast 588
-                              Store 587(r006) 589
-             591:   38(ivec3) Load 44(inU0)
-             592:   36(fvec3) Bitcast 591
-                              Store 590(r007) 592
-             594:   36(fvec3) Load 41(inF0)
-             595:   36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 594
-                              Store 593(r009) 595
-             597:   36(fvec3) Load 41(inF0)
-             598:   36(fvec3) Load 42(inF1)
-             599:   36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 597 598
-                              Store 596(r010) 599
-             601:   36(fvec3) Load 41(inF0)
-             602:   36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 601
-                              Store 600(r011) 602
-             604:   36(fvec3) Load 41(inF0)
-             605:   36(fvec3) Load 42(inF1)
-             606:   36(fvec3) Load 43(inF2)
-             607:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 604 605 606
-                              Store 603(r012) 607
-             608:   36(fvec3) Load 41(inF0)
-             611:  610(bvec3) FOrdLessThan 608 609
-             612:   135(bool) Any 611
-                              SelectionMerge 614 None
-                              BranchConditional 612 613 614
-             613:               Label
+             589:   36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 588
+                              Store 587(r004) 589
+             593:   36(fvec3) Load 41(inF0)
+             594:  590(ivec3) Bitcast 593
+                              Store 592(r005) 594
+             596:   36(fvec3) Load 41(inF0)
+             597:   38(ivec3) Bitcast 596
+                              Store 595(r006) 597
+             599:   38(ivec3) Load 44(inU0)
+             600:   36(fvec3) Bitcast 599
+                              Store 598(r007) 600
+             602:   36(fvec3) Load 41(inF0)
+             603:   36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 602
+                              Store 601(r009) 603
+             605:   36(fvec3) Load 41(inF0)
+             606:   36(fvec3) Load 42(inF1)
+             607:   36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 605 606
+                              Store 604(r010) 607
+             609:   36(fvec3) Load 41(inF0)
+             610:   36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 609
+                              Store 608(r011) 610
+             612:   36(fvec3) Load 41(inF0)
+             613:   36(fvec3) Load 42(inF1)
+             614:   36(fvec3) Load 43(inF2)
+             615:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 612 613 614
+                              Store 611(r012) 615
+             616:   36(fvec3) Load 41(inF0)
+             617:  573(bvec3) FOrdLessThan 616 574
+             618:   135(bool) Any 617
+                              SelectionMerge 620 None
+                              BranchConditional 618 619 620
+             619:               Label
                                 Kill
-             614:             Label
-             617:   36(fvec3) Load 41(inF0)
-             618:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 617
-                              Store 616(r013) 618
-             620:   36(fvec3) Load 41(inF0)
-             621:   36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 620
-                              Store 619(r014) 621
-             626:   38(ivec3) BitCount 625
-                              Store 622(r015) 626
-             628:   36(fvec3) Load 41(inF0)
-             629:   36(fvec3) Load 42(inF1)
-             630:   36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 628 629
-                              Store 627(r016) 630
-             632:   36(fvec3) Load 41(inF0)
-             633:   36(fvec3) DPdx 632
-                              Store 631(r017) 633
-             635:   36(fvec3) Load 41(inF0)
-             636:   36(fvec3) DPdxCoarse 635
-                              Store 634(r018) 636
+             620:             Label
+             623:   36(fvec3) Load 41(inF0)
+             624:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 623
+                              Store 622(r013) 624
+             626:   36(fvec3) Load 41(inF0)
+             627:   36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 626
+                              Store 625(r014) 627
+             632:   38(ivec3) BitCount 631
+                              Store 628(r015) 632
+             634:   36(fvec3) Load 41(inF0)
+             635:   36(fvec3) Load 42(inF1)
+             636:   36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 634 635
+                              Store 633(r016) 636
              638:   36(fvec3) Load 41(inF0)
-             639:   36(fvec3) DPdxFine 638
-                              Store 637(r019) 639
+             639:   36(fvec3) DPdx 638
+                              Store 637(r017) 639
              641:   36(fvec3) Load 41(inF0)
-             642:   36(fvec3) DPdy 641
-                              Store 640(r020) 642
+             642:   36(fvec3) DPdxCoarse 641
+                              Store 640(r018) 642
              644:   36(fvec3) Load 41(inF0)
-             645:   36(fvec3) DPdyCoarse 644
-                              Store 643(r021) 645
+             645:   36(fvec3) DPdxFine 644
+                              Store 643(r019) 645
              647:   36(fvec3) Load 41(inF0)
-             648:   36(fvec3) DPdyFine 647
-                              Store 646(r022) 648
+             648:   36(fvec3) DPdy 647
+                              Store 646(r020) 648
              650:   36(fvec3) Load 41(inF0)
-             651:   36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 650
-                              Store 649(r023) 651
+             651:   36(fvec3) DPdyCoarse 650
+                              Store 649(r021) 651
              653:   36(fvec3) Load 41(inF0)
-             654:   36(fvec3) Load 42(inF1)
-             655:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 653 654
-                              Store 652(r024) 655
-             657:   36(fvec3) Load 41(inF0)
-             658:   36(fvec3) Load 42(inF1)
-             659:    6(float) Dot 657 658
-                              Store 656(r025) 659
-             661:   36(fvec3) Load 41(inF0)
-             662:   36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 661
-                              Store 660(r029) 662
-             664:   36(fvec3) Load 41(inF0)
-             665:   36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 664
-                              Store 663(r030) 665
+             654:   36(fvec3) DPdyFine 653
+                              Store 652(r022) 654
+             656:   36(fvec3) Load 41(inF0)
+             657:   36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 656
+                              Store 655(r023) 657
+             659:   36(fvec3) Load 41(inF0)
+             660:   36(fvec3) Load 42(inF1)
+             661:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 659 660
+                              Store 658(r024) 661
+             663:   36(fvec3) Load 41(inF0)
+             664:   36(fvec3) Load 42(inF1)
+             665:    6(float) Dot 663 664
+                              Store 662(r025) 665
              667:   36(fvec3) Load 41(inF0)
-             668:   36(fvec3) Load 42(inF1)
-             669:   36(fvec3) Load 43(inF2)
-             670:   36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 667 668 669
-                              Store 666(r031) 670
-             674:   38(ivec3) ExtInst 1(GLSL.std.450) 75(FindUMsb) 673
-                              Store 671(r032) 674
-             676:   38(ivec3) ExtInst 1(GLSL.std.450) 73(FindILsb) 673
-                              Store 675(r033) 676
-             678:   36(fvec3) Load 41(inF0)
-             679:   36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 678
-                              Store 677(r034) 679
-             681:   36(fvec3) Load 41(inF0)
-             682:   36(fvec3) Load 42(inF1)
-             683:   36(fvec3) FMod 681 682
-                              Store 680(r036) 683
-             685:   36(fvec3) Load 41(inF0)
-             686:   36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 685
-                              Store 684(r037) 686
-             688:   36(fvec3) Load 41(inF0)
-             689:   36(fvec3) Fwidth 688
-                              Store 687(r039) 689
-             692:   36(fvec3) Load 41(inF0)
-             693:  610(bvec3) IsInf 692
-                              Store 691(r040) 693
-             695:   36(fvec3) Load 41(inF0)
-             696:  610(bvec3) IsNan 695
-                              Store 694(r041) 696
+             668:   36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 667
+                              Store 666(r029) 668
+             670:   36(fvec3) Load 41(inF0)
+             671:   36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 670
+                              Store 669(r030) 671
+             673:   36(fvec3) Load 41(inF0)
+             674:   36(fvec3) Load 42(inF1)
+             675:   36(fvec3) Load 43(inF2)
+             676:   36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 673 674 675
+                              Store 672(r031) 676
+             680:   38(ivec3) ExtInst 1(GLSL.std.450) 75(FindUMsb) 679
+                              Store 677(r032) 680
+             682:   38(ivec3) ExtInst 1(GLSL.std.450) 73(FindILsb) 679
+                              Store 681(r033) 682
+             684:   36(fvec3) Load 41(inF0)
+             685:   36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 684
+                              Store 683(r034) 685
+             687:   36(fvec3) Load 41(inF0)
+             688:   36(fvec3) Load 42(inF1)
+             689:   36(fvec3) FMod 687 688
+                              Store 686(r036) 689
+             691:   36(fvec3) Load 41(inF0)
+             692:   36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 691
+                              Store 690(r037) 692
+             694:   36(fvec3) Load 41(inF0)
+             695:   36(fvec3) Fwidth 694
+                              Store 693(r039) 695
              698:   36(fvec3) Load 41(inF0)
-             699:   36(fvec3) Load 42(inF1)
-             700:   36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 698 699
-                              Store 697(r042) 700
-             702:   36(fvec3) Load 41(inF0)
-             703:   36(fvec3) Load 42(inF1)
-             704:   36(fvec3) Load 43(inF2)
-             705:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 702 703 704
-                              Store 701(r039a) 705
-             707:   36(fvec3) Load 41(inF0)
-             708:   36(fvec3) Load 42(inF1)
-             710:   36(fvec3) CompositeConstruct 709 709 709
-             711:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 707 708 710
-                              Store 706(r039b) 711
+             699:  573(bvec3) IsInf 698
+                              Store 697(r040) 699
+             701:   36(fvec3) Load 41(inF0)
+             702:  573(bvec3) IsNan 701
+                              Store 700(r041) 702
+             704:   36(fvec3) Load 41(inF0)
+             705:   36(fvec3) Load 42(inF1)
+             706:   36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 704 705
+                              Store 703(r042) 706
+             708:   36(fvec3) Load 41(inF0)
+             709:   36(fvec3) Load 42(inF1)
+             710:   36(fvec3) Load 43(inF2)
+             711:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 708 709 710
+                              Store 707(r039a) 711
              713:   36(fvec3) Load 41(inF0)
-             714:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 713
-                              Store 712(r043) 714
-             716:   36(fvec3) Load 41(inF0)
-             717:   36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 716
-                              Store 715(r044) 717
+             714:   36(fvec3) Load 42(inF1)
+             716:   36(fvec3) CompositeConstruct 715 715 715
+             717:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 713 714 716
+                              Store 712(r039b) 717
              719:   36(fvec3) Load 41(inF0)
-             720:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 719
-             721:   36(fvec3) VectorTimesScalar 720 260
-                              Store 718(r045) 721
-             723:   36(fvec3) Load 41(inF0)
-             724:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 723
-                              Store 722(r046) 724
-             726:   36(fvec3) Load 41(inF0)
-             727:   36(fvec3) Load 42(inF1)
-             728:   36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 726 727
-                              Store 725(r047) 728
-             730:   36(fvec3) Load 41(inF0)
-             731:   36(fvec3) Load 42(inF1)
-             732:   36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 730 731
-                              Store 729(r048) 732
-             734:   36(fvec3) Load 41(inF0)
-             735:   36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 734
-                              Store 733(r049) 735
-             737:   36(fvec3) Load 41(inF0)
-             738:   36(fvec3) Load 42(inF1)
-             739:   36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 737 738
-                              Store 736(r050) 739
-             741:   36(fvec3) Load 41(inF0)
-             742:   36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 741
-                              Store 740(r051) 742
-             744:   36(fvec3) Load 41(inF0)
-             745:   36(fvec3) CompositeConstruct 281 281 281
-             746:   36(fvec3) FDiv 745 744
-                              Store 743(r052) 746
-             748:   36(fvec3) Load 41(inF0)
-             749:   36(fvec3) Load 42(inF1)
-             750:   36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 748 749
-                              Store 747(r053) 750
-             752:   36(fvec3) Load 41(inF0)
-             753:   36(fvec3) Load 42(inF1)
-             754:   36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 752 753 512
-                              Store 751(r054) 754
-             757:   38(ivec3) BitReverse 756
-                              Store 755(r055) 757
-             759:   36(fvec3) Load 41(inF0)
-             760:   36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 759
-                              Store 758(r056) 760
-             762:   36(fvec3) Load 41(inF0)
-             763:   36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 762
-                              Store 761(r057) 763
+             720:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 719
+                              Store 718(r043) 720
+             722:   36(fvec3) Load 41(inF0)
+             723:   36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 722
+                              Store 721(r044) 723
+             725:   36(fvec3) Load 41(inF0)
+             726:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 725
+             727:   36(fvec3) VectorTimesScalar 726 262
+                              Store 724(r045) 727
+             729:   36(fvec3) Load 41(inF0)
+             730:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 729
+                              Store 728(r046) 730
+             732:   36(fvec3) Load 41(inF0)
+             733:   36(fvec3) Load 42(inF1)
+             734:   36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 732 733
+                              Store 731(r047) 734
+             736:   36(fvec3) Load 41(inF0)
+             737:   36(fvec3) Load 42(inF1)
+             738:   36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 736 737
+                              Store 735(r048) 738
+             740:   36(fvec3) Load 41(inF0)
+             741:   36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 740
+                              Store 739(r049) 741
+             743:   36(fvec3) Load 41(inF0)
+             744:   36(fvec3) Load 42(inF1)
+             745:   36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 743 744
+                              Store 742(r050) 745
+             747:   36(fvec3) Load 41(inF0)
+             748:   36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 747
+                              Store 746(r051) 748
+             750:   36(fvec3) Load 41(inF0)
+             751:   36(fvec3) CompositeConstruct 283 283 283
+             752:   36(fvec3) FDiv 751 750
+                              Store 749(r052) 752
+             754:   36(fvec3) Load 41(inF0)
+             755:   36(fvec3) Load 42(inF1)
+             756:   36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 754 755
+                              Store 753(r053) 756
+             758:   36(fvec3) Load 41(inF0)
+             759:   36(fvec3) Load 42(inF1)
+             760:   36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 758 759 516
+                              Store 757(r054) 760
+             763:   38(ivec3) BitReverse 762
+                              Store 761(r055) 763
              765:   36(fvec3) Load 41(inF0)
-             766:   36(fvec3) CompositeConstruct 179 179 179
-             767:   36(fvec3) CompositeConstruct 281 281 281
-             768:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 765 766 767
-                              Store 764(r058) 768
-             770:   36(fvec3) Load 41(inF0)
-             771:   36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 770
-                              Store 769(r059) 771
-             773:   36(fvec3) Load 41(inF0)
-             774:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 773
-                              Store 772(r060) 774
-             775:   36(fvec3) Load 41(inF0)
-             776:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 775
-                              Store 42(inF1) 776
-             777:   36(fvec3) Load 41(inF0)
-             778:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 777
-                              Store 43(inF2) 778
-             780:   36(fvec3) Load 41(inF0)
-             781:   36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 780
-                              Store 779(r061) 781
+             766:   36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 765
+                              Store 764(r056) 766
+             768:   36(fvec3) Load 41(inF0)
+             769:   36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 768
+                              Store 767(r057) 769
+             771:   36(fvec3) Load 41(inF0)
+             772:   36(fvec3) CompositeConstruct 139 139 139
+             773:   36(fvec3) CompositeConstruct 283 283 283
+             774:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 771 772 773
+                              Store 770(r058) 774
+             776:   36(fvec3) Load 41(inF0)
+             777:   36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 776
+                              Store 775(r059) 777
+             779:   36(fvec3) Load 41(inF0)
+             780:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 779
+                              Store 778(r060) 780
+             781:   36(fvec3) Load 41(inF0)
+             782:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 781
+                              Store 42(inF1) 782
              783:   36(fvec3) Load 41(inF0)
-             784:   36(fvec3) Load 42(inF1)
-             785:   36(fvec3) Load 43(inF2)
-             786:   36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 783 784 785
-                              Store 782(r062) 786
-             788:   36(fvec3) Load 41(inF0)
-             789:   36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 788
-                              Store 787(r063) 789
-             791:   36(fvec3) Load 41(inF0)
-             792:   36(fvec3) Load 42(inF1)
-             793:   36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 791 792
-                              Store 790(r064) 793
-             795:   36(fvec3) Load 41(inF0)
-             796:   36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 795
-                              Store 794(r065) 796
-             798:   36(fvec3) Load 41(inF0)
-             799:   36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 798
-                              Store 797(r066) 799
+             784:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 783
+                              Store 43(inF2) 784
+             786:   36(fvec3) Load 41(inF0)
+             787:   36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 786
+                              Store 785(r061) 787
+             789:   36(fvec3) Load 41(inF0)
+             790:   36(fvec3) Load 42(inF1)
+             791:   36(fvec3) Load 43(inF2)
+             792:   36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 789 790 791
+                              Store 788(r062) 792
+             794:   36(fvec3) Load 41(inF0)
+             795:   36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 794
+                              Store 793(r063) 795
+             797:   36(fvec3) Load 41(inF0)
+             798:   36(fvec3) Load 42(inF1)
+             799:   36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 797 798
+                              Store 796(r064) 799
              801:   36(fvec3) Load 41(inF0)
-             802:   36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 801
-                              Store 800(r067) 802
-                              ReturnValue 804
+             802:   36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 801
+                              Store 800(r065) 802
+             804:   36(fvec3) Load 41(inF0)
+             805:   36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 804
+                              Store 803(r066) 805
+             807:   36(fvec3) Load 41(inF0)
+             808:   36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 807
+                              Store 806(r067) 808
+                              ReturnValue 810
                               FunctionEnd
 58(PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;):   48(fvec4) Function None 52
         53(inF0):     49(ptr) FunctionParameter
@@ -7041,990 +7075,998 @@
         56(inU0):     51(ptr) FunctionParameter
         57(inU1):     51(ptr) FunctionParameter
               59:             Label
-       807(r000):    136(ptr) Variable Function
-       810(r001):     49(ptr) Variable Function
-       813(r002):     49(ptr) Variable Function
-       816(r003):    136(ptr) Variable Function
-       819(r004):     49(ptr) Variable Function
-       824(r005):    823(ptr) Variable Function
-       827(r006):     51(ptr) Variable Function
-       830(r007):     49(ptr) Variable Function
-       833(r009):     49(ptr) Variable Function
-       836(r010):     49(ptr) Variable Function
-       840(r011):     49(ptr) Variable Function
-       843(r012):     49(ptr) Variable Function
-       856(r013):     49(ptr) Variable Function
-       859(r014):     49(ptr) Variable Function
-       862(r015):     51(ptr) Variable Function
-       865(r016):     49(ptr) Variable Function
-       868(r017):     49(ptr) Variable Function
-       871(r018):     49(ptr) Variable Function
-       874(r019):     49(ptr) Variable Function
-       877(r020):     49(ptr) Variable Function
-       880(r021):     49(ptr) Variable Function
-       883(r022):     49(ptr) Variable Function
-       886(r023):      7(ptr) Variable Function
-       890(r024):      7(ptr) Variable Function
-       894(r025):     49(ptr) Variable Function
-       905(r029):     49(ptr) Variable Function
-       908(r030):     49(ptr) Variable Function
-       911(r031):     49(ptr) Variable Function
-       916(r032):     51(ptr) Variable Function
-       921(r033):     51(ptr) Variable Function
-       923(r034):     49(ptr) Variable Function
-       926(r036):     49(ptr) Variable Function
-       930(r037):     49(ptr) Variable Function
-       933(r039):     49(ptr) Variable Function
-       937(r040):    936(ptr) Variable Function
-       940(r041):    936(ptr) Variable Function
-       943(r042):     49(ptr) Variable Function
-      947(r039a):     49(ptr) Variable Function
-       952(r043):      7(ptr) Variable Function
-       955(r044):     49(ptr) Variable Function
-       958(r045):     49(ptr) Variable Function
-       962(r046):     49(ptr) Variable Function
-       965(r047):     49(ptr) Variable Function
-       969(r048):     49(ptr) Variable Function
-       973(r049):     49(ptr) Variable Function
-       976(r050):     49(ptr) Variable Function
-       980(r051):     49(ptr) Variable Function
-       983(r052):     49(ptr) Variable Function
-       987(r053):     49(ptr) Variable Function
-       991(r054):     49(ptr) Variable Function
-       995(r055):     51(ptr) Variable Function
-       998(r056):     49(ptr) Variable Function
-      1001(r057):     49(ptr) Variable Function
-      1004(r058):     49(ptr) Variable Function
-      1009(r059):     49(ptr) Variable Function
-      1012(r060):     49(ptr) Variable Function
-      1019(r061):     49(ptr) Variable Function
-      1022(r062):     49(ptr) Variable Function
-      1027(r063):     49(ptr) Variable Function
-      1030(r064):     49(ptr) Variable Function
-      1034(r065):     49(ptr) Variable Function
-      1037(r066):     49(ptr) Variable Function
-      1040(r067):     49(ptr) Variable Function
-             808:   48(fvec4) Load 53(inF0)
-             809:   135(bool) All 808
-                              Store 807(r000) 809
-             811:   48(fvec4) Load 53(inF0)
-             812:   48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 811
-                              Store 810(r001) 812
+       813(r000):    136(ptr) Variable Function
+       819(r001):     49(ptr) Variable Function
+       822(r002):     49(ptr) Variable Function
+       825(r003):    136(ptr) Variable Function
+       829(r004):     49(ptr) Variable Function
+       834(r005):    833(ptr) Variable Function
+       837(r006):     51(ptr) Variable Function
+       840(r007):     49(ptr) Variable Function
+       843(r009):     49(ptr) Variable Function
+       846(r010):     49(ptr) Variable Function
+       850(r011):     49(ptr) Variable Function
+       853(r012):     49(ptr) Variable Function
+       864(r013):     49(ptr) Variable Function
+       867(r014):     49(ptr) Variable Function
+       870(r015):     51(ptr) Variable Function
+       873(r016):     49(ptr) Variable Function
+       876(r017):     49(ptr) Variable Function
+       879(r018):     49(ptr) Variable Function
+       882(r019):     49(ptr) Variable Function
+       885(r020):     49(ptr) Variable Function
+       888(r021):     49(ptr) Variable Function
+       891(r022):     49(ptr) Variable Function
+       894(r023):      7(ptr) Variable Function
+       898(r024):      7(ptr) Variable Function
+       902(r025):     49(ptr) Variable Function
+       913(r029):     49(ptr) Variable Function
+       916(r030):     49(ptr) Variable Function
+       919(r031):     49(ptr) Variable Function
+       924(r032):     51(ptr) Variable Function
+       929(r033):     51(ptr) Variable Function
+       931(r034):     49(ptr) Variable Function
+       934(r036):     49(ptr) Variable Function
+       938(r037):     49(ptr) Variable Function
+       941(r039):     49(ptr) Variable Function
+       945(r040):    944(ptr) Variable Function
+       948(r041):    944(ptr) Variable Function
+       951(r042):     49(ptr) Variable Function
+      955(r039a):     49(ptr) Variable Function
+       960(r043):      7(ptr) Variable Function
+       963(r044):     49(ptr) Variable Function
+       966(r045):     49(ptr) Variable Function
+       970(r046):     49(ptr) Variable Function
+       973(r047):     49(ptr) Variable Function
+       977(r048):     49(ptr) Variable Function
+       981(r049):     49(ptr) Variable Function
+       984(r050):     49(ptr) Variable Function
+       988(r051):     49(ptr) Variable Function
+       991(r052):     49(ptr) Variable Function
+       995(r053):     49(ptr) Variable Function
+       999(r054):     49(ptr) Variable Function
+      1003(r055):     51(ptr) Variable Function
+      1006(r056):     49(ptr) Variable Function
+      1009(r057):     49(ptr) Variable Function
+      1012(r058):     49(ptr) Variable Function
+      1017(r059):     49(ptr) Variable Function
+      1020(r060):     49(ptr) Variable Function
+      1027(r061):     49(ptr) Variable Function
+      1030(r062):     49(ptr) Variable Function
+      1035(r063):     49(ptr) Variable Function
+      1038(r064):     49(ptr) Variable Function
+      1042(r065):     49(ptr) Variable Function
+      1045(r066):     49(ptr) Variable Function
+      1048(r067):     49(ptr) Variable Function
              814:   48(fvec4) Load 53(inF0)
-             815:   48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 814
-                              Store 813(r002) 815
-             817:   48(fvec4) Load 53(inF0)
-             818:   135(bool) Any 817
-                              Store 816(r003) 818
+             817:  815(bvec4) FOrdNotEqual 814 816
+             818:   135(bool) All 817
+                              Store 813(r000) 818
              820:   48(fvec4) Load 53(inF0)
-             821:   48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 820
-                              Store 819(r004) 821
-             825:   48(fvec4) Load 53(inF0)
-             826:  822(ivec4) Bitcast 825
-                              Store 824(r005) 826
-             828:   48(fvec4) Load 53(inF0)
-             829:   50(ivec4) Bitcast 828
-                              Store 827(r006) 829
-             831:   50(ivec4) Load 56(inU0)
-             832:   48(fvec4) Bitcast 831
-                              Store 830(r007) 832
-             834:   48(fvec4) Load 53(inF0)
-             835:   48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 834
-                              Store 833(r009) 835
-             837:   48(fvec4) Load 53(inF0)
-             838:   48(fvec4) Load 54(inF1)
-             839:   48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 837 838
-                              Store 836(r010) 839
-             841:   48(fvec4) Load 53(inF0)
-             842:   48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 841
-                              Store 840(r011) 842
+             821:   48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 820
+                              Store 819(r001) 821
+             823:   48(fvec4) Load 53(inF0)
+             824:   48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 823
+                              Store 822(r002) 824
+             826:   48(fvec4) Load 53(inF0)
+             827:  815(bvec4) FOrdNotEqual 826 816
+             828:   135(bool) Any 827
+                              Store 825(r003) 828
+             830:   48(fvec4) Load 53(inF0)
+             831:   48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 830
+                              Store 829(r004) 831
+             835:   48(fvec4) Load 53(inF0)
+             836:  832(ivec4) Bitcast 835
+                              Store 834(r005) 836
+             838:   48(fvec4) Load 53(inF0)
+             839:   50(ivec4) Bitcast 838
+                              Store 837(r006) 839
+             841:   50(ivec4) Load 56(inU0)
+             842:   48(fvec4) Bitcast 841
+                              Store 840(r007) 842
              844:   48(fvec4) Load 53(inF0)
-             845:   48(fvec4) Load 54(inF1)
-             846:   48(fvec4) Load 55(inF2)
-             847:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 844 845 846
-                              Store 843(r012) 847
-             848:   48(fvec4) Load 53(inF0)
-             851:  850(bvec4) FOrdLessThan 848 849
-             852:   135(bool) Any 851
-                              SelectionMerge 854 None
-                              BranchConditional 852 853 854
-             853:               Label
+             845:   48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 844
+                              Store 843(r009) 845
+             847:   48(fvec4) Load 53(inF0)
+             848:   48(fvec4) Load 54(inF1)
+             849:   48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 847 848
+                              Store 846(r010) 849
+             851:   48(fvec4) Load 53(inF0)
+             852:   48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 851
+                              Store 850(r011) 852
+             854:   48(fvec4) Load 53(inF0)
+             855:   48(fvec4) Load 54(inF1)
+             856:   48(fvec4) Load 55(inF2)
+             857:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 854 855 856
+                              Store 853(r012) 857
+             858:   48(fvec4) Load 53(inF0)
+             859:  815(bvec4) FOrdLessThan 858 816
+             860:   135(bool) Any 859
+                              SelectionMerge 862 None
+                              BranchConditional 860 861 862
+             861:               Label
                                 Kill
-             854:             Label
-             857:   48(fvec4) Load 53(inF0)
-             858:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 857
-                              Store 856(r013) 858
-             860:   48(fvec4) Load 53(inF0)
-             861:   48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 860
-                              Store 859(r014) 861
-             864:   50(ivec4) BitCount 863
-                              Store 862(r015) 864
-             866:   48(fvec4) Load 53(inF0)
-             867:   48(fvec4) DPdx 866
-                              Store 865(r016) 867
-             869:   48(fvec4) Load 53(inF0)
-             870:   48(fvec4) DPdxCoarse 869
-                              Store 868(r017) 870
-             872:   48(fvec4) Load 53(inF0)
-             873:   48(fvec4) DPdxFine 872
-                              Store 871(r018) 873
-             875:   48(fvec4) Load 53(inF0)
-             876:   48(fvec4) DPdy 875
-                              Store 874(r019) 876
-             878:   48(fvec4) Load 53(inF0)
-             879:   48(fvec4) DPdyCoarse 878
-                              Store 877(r020) 879
-             881:   48(fvec4) Load 53(inF0)
-             882:   48(fvec4) DPdyFine 881
-                              Store 880(r021) 882
-             884:   48(fvec4) Load 53(inF0)
-             885:   48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 884
-                              Store 883(r022) 885
-             887:   48(fvec4) Load 53(inF0)
-             888:   48(fvec4) Load 54(inF1)
-             889:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 887 888
-                              Store 886(r023) 889
-             891:   48(fvec4) Load 53(inF0)
-             892:   48(fvec4) Load 54(inF1)
-             893:    6(float) Dot 891 892
-                              Store 890(r024) 893
-             895:      7(ptr) AccessChain 53(inF0) 515
-             896:    6(float) Load 895
-             897:      7(ptr) AccessChain 54(inF1) 515
-             898:    6(float) Load 897
-             899:    6(float) FMul 896 898
-             900:      7(ptr) AccessChain 53(inF0) 516
-             901:    6(float) Load 900
-             902:      7(ptr) AccessChain 54(inF1) 623
-             903:    6(float) Load 902
-             904:   48(fvec4) CompositeConstruct 281 899 901 903
-                              Store 894(r025) 904
-             906:   48(fvec4) Load 53(inF0)
-             907:   48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 906
-                              Store 905(r029) 907
-             909:   48(fvec4) Load 53(inF0)
-             910:   48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 909
-                              Store 908(r030) 910
-             912:   48(fvec4) Load 53(inF0)
-             913:   48(fvec4) Load 54(inF1)
-             914:   48(fvec4) Load 55(inF2)
-             915:   48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 912 913 914
-                              Store 911(r031) 915
-             920:   50(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 919
-                              Store 916(r032) 920
-             922:   50(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 919
-                              Store 921(r033) 922
-             924:   48(fvec4) Load 53(inF0)
-             925:   48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 924
-                              Store 923(r034) 925
-             927:   48(fvec4) Load 53(inF0)
-             928:   48(fvec4) Load 54(inF1)
-             929:   48(fvec4) FMod 927 928
-                              Store 926(r036) 929
-             931:   48(fvec4) Load 53(inF0)
-             932:   48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 931
-                              Store 930(r037) 932
-             934:   48(fvec4) Load 53(inF0)
-             935:   48(fvec4) Fwidth 934
-                              Store 933(r039) 935
-             938:   48(fvec4) Load 53(inF0)
-             939:  850(bvec4) IsInf 938
-                              Store 937(r040) 939
-             941:   48(fvec4) Load 53(inF0)
-             942:  850(bvec4) IsNan 941
-                              Store 940(r041) 942
-             944:   48(fvec4) Load 53(inF0)
-             945:   48(fvec4) Load 54(inF1)
-             946:   48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 944 945
-                              Store 943(r042) 946
-             948:   48(fvec4) Load 53(inF0)
-             949:   48(fvec4) Load 54(inF1)
-             950:   48(fvec4) Load 55(inF2)
-             951:   48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 948 949 950
-                              Store 947(r039a) 951
-             953:   48(fvec4) Load 53(inF0)
-             954:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 953
-                              Store 952(r043) 954
+             862:             Label
+             865:   48(fvec4) Load 53(inF0)
+             866:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 865
+                              Store 864(r013) 866
+             868:   48(fvec4) Load 53(inF0)
+             869:   48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 868
+                              Store 867(r014) 869
+             872:   50(ivec4) BitCount 871
+                              Store 870(r015) 872
+             874:   48(fvec4) Load 53(inF0)
+             875:   48(fvec4) DPdx 874
+                              Store 873(r016) 875
+             877:   48(fvec4) Load 53(inF0)
+             878:   48(fvec4) DPdxCoarse 877
+                              Store 876(r017) 878
+             880:   48(fvec4) Load 53(inF0)
+             881:   48(fvec4) DPdxFine 880
+                              Store 879(r018) 881
+             883:   48(fvec4) Load 53(inF0)
+             884:   48(fvec4) DPdy 883
+                              Store 882(r019) 884
+             886:   48(fvec4) Load 53(inF0)
+             887:   48(fvec4) DPdyCoarse 886
+                              Store 885(r020) 887
+             889:   48(fvec4) Load 53(inF0)
+             890:   48(fvec4) DPdyFine 889
+                              Store 888(r021) 890
+             892:   48(fvec4) Load 53(inF0)
+             893:   48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 892
+                              Store 891(r022) 893
+             895:   48(fvec4) Load 53(inF0)
+             896:   48(fvec4) Load 54(inF1)
+             897:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 895 896
+                              Store 894(r023) 897
+             899:   48(fvec4) Load 53(inF0)
+             900:   48(fvec4) Load 54(inF1)
+             901:    6(float) Dot 899 900
+                              Store 898(r024) 901
+             903:      7(ptr) AccessChain 53(inF0) 519
+             904:    6(float) Load 903
+             905:      7(ptr) AccessChain 54(inF1) 519
+             906:    6(float) Load 905
+             907:    6(float) FMul 904 906
+             908:      7(ptr) AccessChain 53(inF0) 520
+             909:    6(float) Load 908
+             910:      7(ptr) AccessChain 54(inF1) 629
+             911:    6(float) Load 910
+             912:   48(fvec4) CompositeConstruct 283 907 909 911
+                              Store 902(r025) 912
+             914:   48(fvec4) Load 53(inF0)
+             915:   48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 914
+                              Store 913(r029) 915
+             917:   48(fvec4) Load 53(inF0)
+             918:   48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 917
+                              Store 916(r030) 918
+             920:   48(fvec4) Load 53(inF0)
+             921:   48(fvec4) Load 54(inF1)
+             922:   48(fvec4) Load 55(inF2)
+             923:   48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 920 921 922
+                              Store 919(r031) 923
+             928:   50(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 927
+                              Store 924(r032) 928
+             930:   50(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 927
+                              Store 929(r033) 930
+             932:   48(fvec4) Load 53(inF0)
+             933:   48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 932
+                              Store 931(r034) 933
+             935:   48(fvec4) Load 53(inF0)
+             936:   48(fvec4) Load 54(inF1)
+             937:   48(fvec4) FMod 935 936
+                              Store 934(r036) 937
+             939:   48(fvec4) Load 53(inF0)
+             940:   48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 939
+                              Store 938(r037) 940
+             942:   48(fvec4) Load 53(inF0)
+             943:   48(fvec4) Fwidth 942
+                              Store 941(r039) 943
+             946:   48(fvec4) Load 53(inF0)
+             947:  815(bvec4) IsInf 946
+                              Store 945(r040) 947
+             949:   48(fvec4) Load 53(inF0)
+             950:  815(bvec4) IsNan 949
+                              Store 948(r041) 950
+             952:   48(fvec4) Load 53(inF0)
+             953:   48(fvec4) Load 54(inF1)
+             954:   48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 952 953
+                              Store 951(r042) 954
              956:   48(fvec4) Load 53(inF0)
-             957:   48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 956
-                              Store 955(r044) 957
-             959:   48(fvec4) Load 53(inF0)
-             960:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 959
-             961:   48(fvec4) VectorTimesScalar 960 260
-                              Store 958(r045) 961
-             963:   48(fvec4) Load 53(inF0)
-             964:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 963
-                              Store 962(r046) 964
-             966:   48(fvec4) Load 53(inF0)
-             967:   48(fvec4) Load 54(inF1)
-             968:   48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 966 967
-                              Store 965(r047) 968
-             970:   48(fvec4) Load 53(inF0)
-             971:   48(fvec4) Load 54(inF1)
-             972:   48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 970 971
-                              Store 969(r048) 972
+             957:   48(fvec4) Load 54(inF1)
+             958:   48(fvec4) Load 55(inF2)
+             959:   48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 956 957 958
+                              Store 955(r039a) 959
+             961:   48(fvec4) Load 53(inF0)
+             962:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 961
+                              Store 960(r043) 962
+             964:   48(fvec4) Load 53(inF0)
+             965:   48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 964
+                              Store 963(r044) 965
+             967:   48(fvec4) Load 53(inF0)
+             968:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 967
+             969:   48(fvec4) VectorTimesScalar 968 262
+                              Store 966(r045) 969
+             971:   48(fvec4) Load 53(inF0)
+             972:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 971
+                              Store 970(r046) 972
              974:   48(fvec4) Load 53(inF0)
-             975:   48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 974
-                              Store 973(r049) 975
-             977:   48(fvec4) Load 53(inF0)
-             978:   48(fvec4) Load 54(inF1)
-             979:   48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 977 978
-                              Store 976(r050) 979
-             981:   48(fvec4) Load 53(inF0)
-             982:   48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 981
-                              Store 980(r051) 982
-             984:   48(fvec4) Load 53(inF0)
-             985:   48(fvec4) CompositeConstruct 281 281 281 281
-             986:   48(fvec4) FDiv 985 984
-                              Store 983(r052) 986
-             988:   48(fvec4) Load 53(inF0)
-             989:   48(fvec4) Load 54(inF1)
-             990:   48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 988 989
-                              Store 987(r053) 990
+             975:   48(fvec4) Load 54(inF1)
+             976:   48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 974 975
+                              Store 973(r047) 976
+             978:   48(fvec4) Load 53(inF0)
+             979:   48(fvec4) Load 54(inF1)
+             980:   48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 978 979
+                              Store 977(r048) 980
+             982:   48(fvec4) Load 53(inF0)
+             983:   48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 982
+                              Store 981(r049) 983
+             985:   48(fvec4) Load 53(inF0)
+             986:   48(fvec4) Load 54(inF1)
+             987:   48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 985 986
+                              Store 984(r050) 987
+             989:   48(fvec4) Load 53(inF0)
+             990:   48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 989
+                              Store 988(r051) 990
              992:   48(fvec4) Load 53(inF0)
-             993:   48(fvec4) Load 54(inF1)
-             994:   48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 992 993 512
-                              Store 991(r054) 994
-             997:   50(ivec4) BitReverse 996
-                              Store 995(r055) 997
-             999:   48(fvec4) Load 53(inF0)
-            1000:   48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 999
-                              Store 998(r056) 1000
-            1002:   48(fvec4) Load 53(inF0)
-            1003:   48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1002
-                              Store 1001(r057) 1003
-            1005:   48(fvec4) Load 53(inF0)
-            1006:   48(fvec4) CompositeConstruct 179 179 179 179
-            1007:   48(fvec4) CompositeConstruct 281 281 281 281
-            1008:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 1005 1006 1007
-                              Store 1004(r058) 1008
+             993:   48(fvec4) CompositeConstruct 283 283 283 283
+             994:   48(fvec4) FDiv 993 992
+                              Store 991(r052) 994
+             996:   48(fvec4) Load 53(inF0)
+             997:   48(fvec4) Load 54(inF1)
+             998:   48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 996 997
+                              Store 995(r053) 998
+            1000:   48(fvec4) Load 53(inF0)
+            1001:   48(fvec4) Load 54(inF1)
+            1002:   48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 1000 1001 516
+                              Store 999(r054) 1002
+            1005:   50(ivec4) BitReverse 1004
+                              Store 1003(r055) 1005
+            1007:   48(fvec4) Load 53(inF0)
+            1008:   48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 1007
+                              Store 1006(r056) 1008
             1010:   48(fvec4) Load 53(inF0)
-            1011:   48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 1010
-                              Store 1009(r059) 1011
+            1011:   48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1010
+                              Store 1009(r057) 1011
             1013:   48(fvec4) Load 53(inF0)
-            1014:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1013
-                              Store 1012(r060) 1014
-            1015:   48(fvec4) Load 53(inF0)
-            1016:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1015
-                              Store 54(inF1) 1016
-            1017:   48(fvec4) Load 53(inF0)
-            1018:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 1017
-                              Store 55(inF2) 1018
-            1020:   48(fvec4) Load 53(inF0)
-            1021:   48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 1020
-                              Store 1019(r061) 1021
+            1014:   48(fvec4) CompositeConstruct 139 139 139 139
+            1015:   48(fvec4) CompositeConstruct 283 283 283 283
+            1016:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 1013 1014 1015
+                              Store 1012(r058) 1016
+            1018:   48(fvec4) Load 53(inF0)
+            1019:   48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 1018
+                              Store 1017(r059) 1019
+            1021:   48(fvec4) Load 53(inF0)
+            1022:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1021
+                              Store 1020(r060) 1022
             1023:   48(fvec4) Load 53(inF0)
-            1024:   48(fvec4) Load 54(inF1)
-            1025:   48(fvec4) Load 55(inF2)
-            1026:   48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 1023 1024 1025
-                              Store 1022(r062) 1026
+            1024:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1023
+                              Store 54(inF1) 1024
+            1025:   48(fvec4) Load 53(inF0)
+            1026:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 1025
+                              Store 55(inF2) 1026
             1028:   48(fvec4) Load 53(inF0)
-            1029:   48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 1028
-                              Store 1027(r063) 1029
+            1029:   48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 1028
+                              Store 1027(r061) 1029
             1031:   48(fvec4) Load 53(inF0)
             1032:   48(fvec4) Load 54(inF1)
-            1033:   48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 1031 1032
-                              Store 1030(r064) 1033
-            1035:   48(fvec4) Load 53(inF0)
-            1036:   48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 1035
-                              Store 1034(r065) 1036
-            1038:   48(fvec4) Load 53(inF0)
-            1039:   48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 1038
-                              Store 1037(r066) 1039
-            1041:   48(fvec4) Load 53(inF0)
-            1042:   48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 1041
-                              Store 1040(r067) 1042
-                              ReturnValue 1044
+            1033:   48(fvec4) Load 55(inF2)
+            1034:   48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 1031 1032 1033
+                              Store 1030(r062) 1034
+            1036:   48(fvec4) Load 53(inF0)
+            1037:   48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 1036
+                              Store 1035(r063) 1037
+            1039:   48(fvec4) Load 53(inF0)
+            1040:   48(fvec4) Load 54(inF1)
+            1041:   48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 1039 1040
+                              Store 1038(r064) 1041
+            1043:   48(fvec4) Load 53(inF0)
+            1044:   48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 1043
+                              Store 1042(r065) 1044
+            1046:   48(fvec4) Load 53(inF0)
+            1047:   48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 1046
+                              Store 1045(r066) 1047
+            1049:   48(fvec4) Load 53(inF0)
+            1050:   48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 1049
+                              Store 1048(r067) 1050
+                              ReturnValue 1052
                               FunctionEnd
 66(PixelShaderFunction2x2(mf22;mf22;mf22;):          60 Function None 62
         63(inF0):     61(ptr) FunctionParameter
         64(inF1):     61(ptr) FunctionParameter
         65(inF2):     61(ptr) FunctionParameter
               67:             Label
-      1047(r000):    136(ptr) Variable Function
-      1050(r001):     61(ptr) Variable Function
-      1055(r003):    136(ptr) Variable Function
-      1058(r004):     61(ptr) Variable Function
-      1061(r005):     61(ptr) Variable Function
-      1064(r006):     61(ptr) Variable Function
-      1068(r007):     61(ptr) Variable Function
-      1079(r008):     61(ptr) Variable Function
-      1084(r009):     61(ptr) Variable Function
-      1087(r010):     61(ptr) Variable Function
-      1090(r011):     61(ptr) Variable Function
-      1093(r012):     61(ptr) Variable Function
-      1096(r013):     61(ptr) Variable Function
-      1099(r014):     61(ptr) Variable Function
-      1102(r015):     61(ptr) Variable Function
-      1105(r016):     61(ptr) Variable Function
-      1108(r017):     61(ptr) Variable Function
-      1111(r018):      7(ptr) Variable Function
-      1114(r019):     61(ptr) Variable Function
-      1117(R020):     61(ptr) Variable Function
-      1120(r021):     61(ptr) Variable Function
-      1123(r022):     61(ptr) Variable Function
-      1133(r023):     61(ptr) Variable Function
-      1136(r025):     61(ptr) Variable Function
-      1139(r026):     61(ptr) Variable Function
-     1143(r026a):     61(ptr) Variable Function
-      1148(r027):     61(ptr) Variable Function
-      1151(r028):     61(ptr) Variable Function
-      1155(r029):     61(ptr) Variable Function
-      1158(r030):     61(ptr) Variable Function
-      1162(r031):     61(ptr) Variable Function
-      1166(r032):     61(ptr) Variable Function
-      1170(r033):     61(ptr) Variable Function
-      1173(r034):     61(ptr) Variable Function
-      1176(r035):     61(ptr) Variable Function
-      1179(r036):     61(ptr) Variable Function
-      1184(r037):     61(ptr) Variable Function
-      1187(r038):     61(ptr) Variable Function
-      1194(r039):     61(ptr) Variable Function
-      1197(r049):     61(ptr) Variable Function
-      1202(r041):     61(ptr) Variable Function
-      1205(r042):     61(ptr) Variable Function
-      1209(r043):     61(ptr) Variable Function
-      1212(r044):     61(ptr) Variable Function
-      1217(r046):     61(ptr) Variable Function
-            1048:          60 Load 63(inF0)
-            1049:   135(bool) All 1048
-                              Store 1047(r000) 1049
-            1051:          60 Load 63(inF0)
-            1052:          60 ExtInst 1(GLSL.std.450) 4(FAbs) 1051
-                              Store 1050(r001) 1052
-            1053:          60 Load 63(inF0)
-            1054:          60 ExtInst 1(GLSL.std.450) 17(Acos) 1053
+      1055(r000):    136(ptr) Variable Function
+      1060(r001):     61(ptr) Variable Function
+      1065(r003):    136(ptr) Variable Function
+      1069(r004):     61(ptr) Variable Function
+      1072(r005):     61(ptr) Variable Function
+      1075(r006):     61(ptr) Variable Function
+      1079(r007):     61(ptr) Variable Function
+      1089(r008):     61(ptr) Variable Function
+      1094(r009):     61(ptr) Variable Function
+      1097(r010):     61(ptr) Variable Function
+      1100(r011):     61(ptr) Variable Function
+      1103(r012):     61(ptr) Variable Function
+      1106(r013):     61(ptr) Variable Function
+      1109(r014):     61(ptr) Variable Function
+      1112(r015):     61(ptr) Variable Function
+      1115(r016):     61(ptr) Variable Function
+      1118(r017):     61(ptr) Variable Function
+      1121(r018):      7(ptr) Variable Function
+      1124(r019):     61(ptr) Variable Function
+      1127(R020):     61(ptr) Variable Function
+      1130(r021):     61(ptr) Variable Function
+      1133(r022):     61(ptr) Variable Function
+      1143(r023):     61(ptr) Variable Function
+      1146(r025):     61(ptr) Variable Function
+      1149(r026):     61(ptr) Variable Function
+     1153(r026a):     61(ptr) Variable Function
+      1158(r027):     61(ptr) Variable Function
+      1161(r028):     61(ptr) Variable Function
+      1165(r029):     61(ptr) Variable Function
+      1168(r030):     61(ptr) Variable Function
+      1172(r031):     61(ptr) Variable Function
+      1176(r032):     61(ptr) Variable Function
+      1180(r033):     61(ptr) Variable Function
+      1183(r034):     61(ptr) Variable Function
+      1186(r035):     61(ptr) Variable Function
+      1189(r036):     61(ptr) Variable Function
+      1194(r037):     61(ptr) Variable Function
+      1197(r038):     61(ptr) Variable Function
+      1204(r039):     61(ptr) Variable Function
+      1207(r049):     61(ptr) Variable Function
+      1212(r041):     61(ptr) Variable Function
+      1215(r042):     61(ptr) Variable Function
+      1219(r043):     61(ptr) Variable Function
+      1222(r044):     61(ptr) Variable Function
+      1227(r046):     61(ptr) Variable Function
             1056:          60 Load 63(inF0)
-            1057:   135(bool) Any 1056
-                              Store 1055(r003) 1057
-            1059:          60 Load 63(inF0)
-            1060:          60 ExtInst 1(GLSL.std.450) 16(Asin) 1059
-                              Store 1058(r004) 1060
-            1062:          60 Load 63(inF0)
-            1063:          60 ExtInst 1(GLSL.std.450) 18(Atan) 1062
-                              Store 1061(r005) 1063
-            1065:          60 Load 63(inF0)
-            1066:          60 Load 64(inF1)
-            1067:          60 ExtInst 1(GLSL.std.450) 25(Atan2) 1065 1066
-                              Store 1064(r006) 1067
-            1069:          60 Load 63(inF0)
-            1070:          60 ExtInst 1(GLSL.std.450) 9(Ceil) 1069
-                              Store 1068(r007) 1070
-            1071:          60 Load 63(inF0)
-            1074:        1073 FOrdLessThan 1071 1072
-            1075:   135(bool) Any 1074
-                              SelectionMerge 1077 None
-                              BranchConditional 1075 1076 1077
-            1076:               Label
-                                Kill
-            1077:             Label
+            1058:        1057 FOrdNotEqual 1056 139
+            1059:   135(bool) All 1058
+                              Store 1055(r000) 1059
+            1061:          60 Load 63(inF0)
+            1062:          60 ExtInst 1(GLSL.std.450) 4(FAbs) 1061
+                              Store 1060(r001) 1062
+            1063:          60 Load 63(inF0)
+            1064:          60 ExtInst 1(GLSL.std.450) 17(Acos) 1063
+            1066:          60 Load 63(inF0)
+            1067:        1057 FOrdNotEqual 1066 139
+            1068:   135(bool) Any 1067
+                              Store 1065(r003) 1068
+            1070:          60 Load 63(inF0)
+            1071:          60 ExtInst 1(GLSL.std.450) 16(Asin) 1070
+                              Store 1069(r004) 1071
+            1073:          60 Load 63(inF0)
+            1074:          60 ExtInst 1(GLSL.std.450) 18(Atan) 1073
+                              Store 1072(r005) 1074
+            1076:          60 Load 63(inF0)
+            1077:          60 Load 64(inF1)
+            1078:          60 ExtInst 1(GLSL.std.450) 25(Atan2) 1076 1077
+                              Store 1075(r006) 1078
             1080:          60 Load 63(inF0)
-            1081:          60 Load 64(inF1)
-            1082:          60 Load 65(inF2)
-            1083:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 1080 1081 1082
-                              Store 1079(r008) 1083
-            1085:          60 Load 63(inF0)
-            1086:          60 ExtInst 1(GLSL.std.450) 14(Cos) 1085
-                              Store 1084(r009) 1086
-            1088:          60 Load 63(inF0)
-            1089:          60 ExtInst 1(GLSL.std.450) 20(Cosh) 1088
-                              Store 1087(r010) 1089
-            1091:          60 Load 63(inF0)
-            1092:          60 DPdx 1091
-                              Store 1090(r011) 1092
-            1094:          60 Load 63(inF0)
-            1095:          60 DPdxCoarse 1094
-                              Store 1093(r012) 1095
-            1097:          60 Load 63(inF0)
-            1098:          60 DPdxFine 1097
-                              Store 1096(r013) 1098
-            1100:          60 Load 63(inF0)
-            1101:          60 DPdy 1100
-                              Store 1099(r014) 1101
-            1103:          60 Load 63(inF0)
-            1104:          60 DPdyCoarse 1103
-                              Store 1102(r015) 1104
-            1106:          60 Load 63(inF0)
-            1107:          60 DPdyFine 1106
-                              Store 1105(r016) 1107
-            1109:          60 Load 63(inF0)
-            1110:          60 ExtInst 1(GLSL.std.450) 12(Degrees) 1109
-                              Store 1108(r017) 1110
-            1112:          60 Load 63(inF0)
-            1113:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1112
-                              Store 1111(r018) 1113
-            1115:          60 Load 63(inF0)
-            1116:          60 ExtInst 1(GLSL.std.450) 27(Exp) 1115
-                              Store 1114(r019) 1116
-            1118:          60 Load 63(inF0)
-            1119:          60 ExtInst 1(GLSL.std.450) 29(Exp2) 1118
-                              Store 1117(R020) 1119
-            1121:          60 Load 63(inF0)
-            1122:          60 ExtInst 1(GLSL.std.450) 8(Floor) 1121
-                              Store 1120(r021) 1122
-            1124:          60 Load 63(inF0)
-            1125:          60 Load 64(inF1)
-            1126:   24(fvec2) CompositeExtract 1124 0
-            1127:   24(fvec2) CompositeExtract 1125 0
-            1128:   24(fvec2) FMod 1126 1127
-            1129:   24(fvec2) CompositeExtract 1124 1
-            1130:   24(fvec2) CompositeExtract 1125 1
-            1131:   24(fvec2) FMod 1129 1130
-            1132:          60 CompositeConstruct 1128 1131
-                              Store 1123(r022) 1132
+            1081:          60 ExtInst 1(GLSL.std.450) 9(Ceil) 1080
+                              Store 1079(r007) 1081
+            1082:          60 Load 63(inF0)
+            1084:        1057 FOrdLessThan 1082 1083
+            1085:   135(bool) Any 1084
+                              SelectionMerge 1087 None
+                              BranchConditional 1085 1086 1087
+            1086:               Label
+                                Kill
+            1087:             Label
+            1090:          60 Load 63(inF0)
+            1091:          60 Load 64(inF1)
+            1092:          60 Load 65(inF2)
+            1093:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 1090 1091 1092
+                              Store 1089(r008) 1093
+            1095:          60 Load 63(inF0)
+            1096:          60 ExtInst 1(GLSL.std.450) 14(Cos) 1095
+                              Store 1094(r009) 1096
+            1098:          60 Load 63(inF0)
+            1099:          60 ExtInst 1(GLSL.std.450) 20(Cosh) 1098
+                              Store 1097(r010) 1099
+            1101:          60 Load 63(inF0)
+            1102:          60 DPdx 1101
+                              Store 1100(r011) 1102
+            1104:          60 Load 63(inF0)
+            1105:          60 DPdxCoarse 1104
+                              Store 1103(r012) 1105
+            1107:          60 Load 63(inF0)
+            1108:          60 DPdxFine 1107
+                              Store 1106(r013) 1108
+            1110:          60 Load 63(inF0)
+            1111:          60 DPdy 1110
+                              Store 1109(r014) 1111
+            1113:          60 Load 63(inF0)
+            1114:          60 DPdyCoarse 1113
+                              Store 1112(r015) 1114
+            1116:          60 Load 63(inF0)
+            1117:          60 DPdyFine 1116
+                              Store 1115(r016) 1117
+            1119:          60 Load 63(inF0)
+            1120:          60 ExtInst 1(GLSL.std.450) 12(Degrees) 1119
+                              Store 1118(r017) 1120
+            1122:          60 Load 63(inF0)
+            1123:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1122
+                              Store 1121(r018) 1123
+            1125:          60 Load 63(inF0)
+            1126:          60 ExtInst 1(GLSL.std.450) 27(Exp) 1125
+                              Store 1124(r019) 1126
+            1128:          60 Load 63(inF0)
+            1129:          60 ExtInst 1(GLSL.std.450) 29(Exp2) 1128
+                              Store 1127(R020) 1129
+            1131:          60 Load 63(inF0)
+            1132:          60 ExtInst 1(GLSL.std.450) 8(Floor) 1131
+                              Store 1130(r021) 1132
             1134:          60 Load 63(inF0)
-            1135:          60 ExtInst 1(GLSL.std.450) 10(Fract) 1134
-                              Store 1133(r023) 1135
-            1137:          60 Load 63(inF0)
-            1138:          60 Fwidth 1137
-                              Store 1136(r025) 1138
-            1140:          60 Load 63(inF0)
-            1141:          60 Load 64(inF1)
-            1142:          60 ExtInst 1(GLSL.std.450) 53(Ldexp) 1140 1141
-                              Store 1139(r026) 1142
+            1135:          60 Load 64(inF1)
+            1136:   24(fvec2) CompositeExtract 1134 0
+            1137:   24(fvec2) CompositeExtract 1135 0
+            1138:   24(fvec2) FMod 1136 1137
+            1139:   24(fvec2) CompositeExtract 1134 1
+            1140:   24(fvec2) CompositeExtract 1135 1
+            1141:   24(fvec2) FMod 1139 1140
+            1142:          60 CompositeConstruct 1138 1141
+                              Store 1133(r022) 1142
             1144:          60 Load 63(inF0)
-            1145:          60 Load 64(inF1)
-            1146:          60 Load 65(inF2)
-            1147:          60 ExtInst 1(GLSL.std.450) 46(FMix) 1144 1145 1146
-                              Store 1143(r026a) 1147
-            1149:          60 Load 63(inF0)
-            1150:          60 ExtInst 1(GLSL.std.450) 28(Log) 1149
-                              Store 1148(r027) 1150
-            1152:          60 Load 63(inF0)
-            1153:          60 ExtInst 1(GLSL.std.450) 30(Log2) 1152
-            1154:          60 MatrixTimesScalar 1153 260
-                              Store 1151(r028) 1154
-            1156:          60 Load 63(inF0)
-            1157:          60 ExtInst 1(GLSL.std.450) 30(Log2) 1156
-                              Store 1155(r029) 1157
+            1145:          60 ExtInst 1(GLSL.std.450) 10(Fract) 1144
+                              Store 1143(r023) 1145
+            1147:          60 Load 63(inF0)
+            1148:          60 Fwidth 1147
+                              Store 1146(r025) 1148
+            1150:          60 Load 63(inF0)
+            1151:          60 Load 64(inF1)
+            1152:          60 ExtInst 1(GLSL.std.450) 53(Ldexp) 1150 1151
+                              Store 1149(r026) 1152
+            1154:          60 Load 63(inF0)
+            1155:          60 Load 64(inF1)
+            1156:          60 Load 65(inF2)
+            1157:          60 ExtInst 1(GLSL.std.450) 46(FMix) 1154 1155 1156
+                              Store 1153(r026a) 1157
             1159:          60 Load 63(inF0)
-            1160:          60 Load 64(inF1)
-            1161:          60 ExtInst 1(GLSL.std.450) 40(FMax) 1159 1160
-                              Store 1158(r030) 1161
-            1163:          60 Load 63(inF0)
-            1164:          60 Load 64(inF1)
-            1165:          60 ExtInst 1(GLSL.std.450) 37(FMin) 1163 1164
-                              Store 1162(r031) 1165
-            1167:          60 Load 63(inF0)
-            1168:          60 Load 64(inF1)
-            1169:          60 ExtInst 1(GLSL.std.450) 26(Pow) 1167 1168
-                              Store 1166(r032) 1169
-            1171:          60 Load 63(inF0)
-            1172:          60 ExtInst 1(GLSL.std.450) 11(Radians) 1171
-                              Store 1170(r033) 1172
-            1174:          60 Load 63(inF0)
-            1175:          60 ExtInst 1(GLSL.std.450) 2(RoundEven) 1174
-                              Store 1173(r034) 1175
+            1160:          60 ExtInst 1(GLSL.std.450) 28(Log) 1159
+                              Store 1158(r027) 1160
+            1162:          60 Load 63(inF0)
+            1163:          60 ExtInst 1(GLSL.std.450) 30(Log2) 1162
+            1164:          60 MatrixTimesScalar 1163 262
+                              Store 1161(r028) 1164
+            1166:          60 Load 63(inF0)
+            1167:          60 ExtInst 1(GLSL.std.450) 30(Log2) 1166
+                              Store 1165(r029) 1167
+            1169:          60 Load 63(inF0)
+            1170:          60 Load 64(inF1)
+            1171:          60 ExtInst 1(GLSL.std.450) 40(FMax) 1169 1170
+                              Store 1168(r030) 1171
+            1173:          60 Load 63(inF0)
+            1174:          60 Load 64(inF1)
+            1175:          60 ExtInst 1(GLSL.std.450) 37(FMin) 1173 1174
+                              Store 1172(r031) 1175
             1177:          60 Load 63(inF0)
-            1178:          60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1177
-                              Store 1176(r035) 1178
-            1180:          60 Load 63(inF0)
-            1181:   24(fvec2) CompositeConstruct 179 179
-            1182:   24(fvec2) CompositeConstruct 281 281
-            1183:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 1180 1181 1182
-                              Store 1179(r036) 1183
-            1185:          60 Load 63(inF0)
-            1186:          60 ExtInst 1(GLSL.std.450) 6(FSign) 1185
-                              Store 1184(r037) 1186
-            1188:          60 Load 63(inF0)
-            1189:          60 ExtInst 1(GLSL.std.450) 13(Sin) 1188
-                              Store 1187(r038) 1189
+            1178:          60 Load 64(inF1)
+            1179:          60 ExtInst 1(GLSL.std.450) 26(Pow) 1177 1178
+                              Store 1176(r032) 1179
+            1181:          60 Load 63(inF0)
+            1182:          60 ExtInst 1(GLSL.std.450) 11(Radians) 1181
+                              Store 1180(r033) 1182
+            1184:          60 Load 63(inF0)
+            1185:          60 ExtInst 1(GLSL.std.450) 2(RoundEven) 1184
+                              Store 1183(r034) 1185
+            1187:          60 Load 63(inF0)
+            1188:          60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1187
+                              Store 1186(r035) 1188
             1190:          60 Load 63(inF0)
-            1191:          60 ExtInst 1(GLSL.std.450) 13(Sin) 1190
-                              Store 64(inF1) 1191
-            1192:          60 Load 63(inF0)
-            1193:          60 ExtInst 1(GLSL.std.450) 14(Cos) 1192
-                              Store 65(inF2) 1193
+            1191:   24(fvec2) CompositeConstruct 139 139
+            1192:   24(fvec2) CompositeConstruct 283 283
+            1193:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 1190 1191 1192
+                              Store 1189(r036) 1193
             1195:          60 Load 63(inF0)
-            1196:          60 ExtInst 1(GLSL.std.450) 19(Sinh) 1195
-                              Store 1194(r039) 1196
+            1196:          60 ExtInst 1(GLSL.std.450) 6(FSign) 1195
+                              Store 1194(r037) 1196
             1198:          60 Load 63(inF0)
-            1199:          60 Load 64(inF1)
-            1200:          60 Load 65(inF2)
-            1201:          60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1198 1199 1200
-                              Store 1197(r049) 1201
-            1203:          60 Load 63(inF0)
-            1204:          60 ExtInst 1(GLSL.std.450) 31(Sqrt) 1203
-                              Store 1202(r041) 1204
-            1206:          60 Load 63(inF0)
-            1207:          60 Load 64(inF1)
-            1208:          60 ExtInst 1(GLSL.std.450) 48(Step) 1206 1207
-                              Store 1205(r042) 1208
-            1210:          60 Load 63(inF0)
-            1211:          60 ExtInst 1(GLSL.std.450) 15(Tan) 1210
-                              Store 1209(r043) 1211
+            1199:          60 ExtInst 1(GLSL.std.450) 13(Sin) 1198
+                              Store 1197(r038) 1199
+            1200:          60 Load 63(inF0)
+            1201:          60 ExtInst 1(GLSL.std.450) 13(Sin) 1200
+                              Store 64(inF1) 1201
+            1202:          60 Load 63(inF0)
+            1203:          60 ExtInst 1(GLSL.std.450) 14(Cos) 1202
+                              Store 65(inF2) 1203
+            1205:          60 Load 63(inF0)
+            1206:          60 ExtInst 1(GLSL.std.450) 19(Sinh) 1205
+                              Store 1204(r039) 1206
+            1208:          60 Load 63(inF0)
+            1209:          60 Load 64(inF1)
+            1210:          60 Load 65(inF2)
+            1211:          60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1208 1209 1210
+                              Store 1207(r049) 1211
             1213:          60 Load 63(inF0)
-            1214:          60 ExtInst 1(GLSL.std.450) 21(Tanh) 1213
-                              Store 1212(r044) 1214
-            1215:          60 Load 63(inF0)
-            1216:          60 Transpose 1215
-            1218:          60 Load 63(inF0)
-            1219:          60 ExtInst 1(GLSL.std.450) 3(Trunc) 1218
-                              Store 1217(r046) 1219
-                              ReturnValue 1221
+            1214:          60 ExtInst 1(GLSL.std.450) 31(Sqrt) 1213
+                              Store 1212(r041) 1214
+            1216:          60 Load 63(inF0)
+            1217:          60 Load 64(inF1)
+            1218:          60 ExtInst 1(GLSL.std.450) 48(Step) 1216 1217
+                              Store 1215(r042) 1218
+            1220:          60 Load 63(inF0)
+            1221:          60 ExtInst 1(GLSL.std.450) 15(Tan) 1220
+                              Store 1219(r043) 1221
+            1223:          60 Load 63(inF0)
+            1224:          60 ExtInst 1(GLSL.std.450) 21(Tanh) 1223
+                              Store 1222(r044) 1224
+            1225:          60 Load 63(inF0)
+            1226:          60 Transpose 1225
+            1228:          60 Load 63(inF0)
+            1229:          60 ExtInst 1(GLSL.std.450) 3(Trunc) 1228
+                              Store 1227(r046) 1229
+                              ReturnValue 1231
                               FunctionEnd
 74(PixelShaderFunction3x3(mf33;mf33;mf33;):          68 Function None 70
         71(inF0):     69(ptr) FunctionParameter
         72(inF1):     69(ptr) FunctionParameter
         73(inF2):     69(ptr) FunctionParameter
               75:             Label
-      1224(r000):    136(ptr) Variable Function
-      1227(r001):     69(ptr) Variable Function
-      1232(r003):    136(ptr) Variable Function
-      1235(r004):     69(ptr) Variable Function
-      1238(r005):     69(ptr) Variable Function
-      1241(r006):     69(ptr) Variable Function
-      1245(r007):     69(ptr) Variable Function
-      1256(r008):     69(ptr) Variable Function
-      1261(r009):     69(ptr) Variable Function
-      1264(r010):     69(ptr) Variable Function
-      1267(r011):     69(ptr) Variable Function
-      1270(r012):     69(ptr) Variable Function
-      1273(r013):     69(ptr) Variable Function
-      1276(r014):     69(ptr) Variable Function
-      1279(r015):     69(ptr) Variable Function
-      1282(r016):     69(ptr) Variable Function
-      1285(r017):     69(ptr) Variable Function
-      1288(r018):      7(ptr) Variable Function
-      1291(r019):     69(ptr) Variable Function
-      1294(R020):     69(ptr) Variable Function
-      1297(r021):     69(ptr) Variable Function
-      1300(r022):     69(ptr) Variable Function
-      1313(r023):     69(ptr) Variable Function
-      1316(r025):     69(ptr) Variable Function
-      1319(r026):     69(ptr) Variable Function
-     1323(r026a):     69(ptr) Variable Function
-      1328(r027):     69(ptr) Variable Function
-      1331(r028):     69(ptr) Variable Function
-      1335(r029):     69(ptr) Variable Function
-      1338(r030):     69(ptr) Variable Function
-      1342(r031):     69(ptr) Variable Function
-      1346(r032):     69(ptr) Variable Function
-      1350(r033):     69(ptr) Variable Function
-      1353(r034):     69(ptr) Variable Function
-      1356(r035):     69(ptr) Variable Function
-      1359(r036):     69(ptr) Variable Function
-      1364(r037):     69(ptr) Variable Function
-      1367(r038):     69(ptr) Variable Function
-      1374(r039):     69(ptr) Variable Function
-      1377(r049):     69(ptr) Variable Function
-      1382(r041):     69(ptr) Variable Function
-      1385(r042):     69(ptr) Variable Function
-      1389(r043):     69(ptr) Variable Function
-      1392(r044):     69(ptr) Variable Function
-      1397(r046):     69(ptr) Variable Function
-            1225:          68 Load 71(inF0)
-            1226:   135(bool) All 1225
-                              Store 1224(r000) 1226
-            1228:          68 Load 71(inF0)
-            1229:          68 ExtInst 1(GLSL.std.450) 4(FAbs) 1228
-                              Store 1227(r001) 1229
-            1230:          68 Load 71(inF0)
-            1231:          68 ExtInst 1(GLSL.std.450) 17(Acos) 1230
-            1233:          68 Load 71(inF0)
-            1234:   135(bool) Any 1233
-                              Store 1232(r003) 1234
-            1236:          68 Load 71(inF0)
-            1237:          68 ExtInst 1(GLSL.std.450) 16(Asin) 1236
-                              Store 1235(r004) 1237
-            1239:          68 Load 71(inF0)
-            1240:          68 ExtInst 1(GLSL.std.450) 18(Atan) 1239
-                              Store 1238(r005) 1240
+      1234(r000):    136(ptr) Variable Function
+      1239(r001):     69(ptr) Variable Function
+      1244(r003):    136(ptr) Variable Function
+      1248(r004):     69(ptr) Variable Function
+      1251(r005):     69(ptr) Variable Function
+      1254(r006):     69(ptr) Variable Function
+      1258(r007):     69(ptr) Variable Function
+      1268(r008):     69(ptr) Variable Function
+      1273(r009):     69(ptr) Variable Function
+      1276(r010):     69(ptr) Variable Function
+      1279(r011):     69(ptr) Variable Function
+      1282(r012):     69(ptr) Variable Function
+      1285(r013):     69(ptr) Variable Function
+      1288(r014):     69(ptr) Variable Function
+      1291(r015):     69(ptr) Variable Function
+      1294(r016):     69(ptr) Variable Function
+      1297(r017):     69(ptr) Variable Function
+      1300(r018):      7(ptr) Variable Function
+      1303(r019):     69(ptr) Variable Function
+      1306(R020):     69(ptr) Variable Function
+      1309(r021):     69(ptr) Variable Function
+      1312(r022):     69(ptr) Variable Function
+      1325(r023):     69(ptr) Variable Function
+      1328(r025):     69(ptr) Variable Function
+      1331(r026):     69(ptr) Variable Function
+     1335(r026a):     69(ptr) Variable Function
+      1340(r027):     69(ptr) Variable Function
+      1343(r028):     69(ptr) Variable Function
+      1347(r029):     69(ptr) Variable Function
+      1350(r030):     69(ptr) Variable Function
+      1354(r031):     69(ptr) Variable Function
+      1358(r032):     69(ptr) Variable Function
+      1362(r033):     69(ptr) Variable Function
+      1365(r034):     69(ptr) Variable Function
+      1368(r035):     69(ptr) Variable Function
+      1371(r036):     69(ptr) Variable Function
+      1376(r037):     69(ptr) Variable Function
+      1379(r038):     69(ptr) Variable Function
+      1386(r039):     69(ptr) Variable Function
+      1389(r049):     69(ptr) Variable Function
+      1394(r041):     69(ptr) Variable Function
+      1397(r042):     69(ptr) Variable Function
+      1401(r043):     69(ptr) Variable Function
+      1404(r044):     69(ptr) Variable Function
+      1409(r046):     69(ptr) Variable Function
+            1235:          68 Load 71(inF0)
+            1237:        1236 FOrdNotEqual 1235 139
+            1238:   135(bool) All 1237
+                              Store 1234(r000) 1238
+            1240:          68 Load 71(inF0)
+            1241:          68 ExtInst 1(GLSL.std.450) 4(FAbs) 1240
+                              Store 1239(r001) 1241
             1242:          68 Load 71(inF0)
-            1243:          68 Load 72(inF1)
-            1244:          68 ExtInst 1(GLSL.std.450) 25(Atan2) 1242 1243
-                              Store 1241(r006) 1244
-            1246:          68 Load 71(inF0)
-            1247:          68 ExtInst 1(GLSL.std.450) 9(Ceil) 1246
-                              Store 1245(r007) 1247
-            1248:          68 Load 71(inF0)
-            1251:        1250 FOrdLessThan 1248 1249
-            1252:   135(bool) Any 1251
-                              SelectionMerge 1254 None
-                              BranchConditional 1252 1253 1254
-            1253:               Label
+            1243:          68 ExtInst 1(GLSL.std.450) 17(Acos) 1242
+            1245:          68 Load 71(inF0)
+            1246:        1236 FOrdNotEqual 1245 139
+            1247:   135(bool) Any 1246
+                              Store 1244(r003) 1247
+            1249:          68 Load 71(inF0)
+            1250:          68 ExtInst 1(GLSL.std.450) 16(Asin) 1249
+                              Store 1248(r004) 1250
+            1252:          68 Load 71(inF0)
+            1253:          68 ExtInst 1(GLSL.std.450) 18(Atan) 1252
+                              Store 1251(r005) 1253
+            1255:          68 Load 71(inF0)
+            1256:          68 Load 72(inF1)
+            1257:          68 ExtInst 1(GLSL.std.450) 25(Atan2) 1255 1256
+                              Store 1254(r006) 1257
+            1259:          68 Load 71(inF0)
+            1260:          68 ExtInst 1(GLSL.std.450) 9(Ceil) 1259
+                              Store 1258(r007) 1260
+            1261:          68 Load 71(inF0)
+            1263:        1236 FOrdLessThan 1261 1262
+            1264:   135(bool) Any 1263
+                              SelectionMerge 1266 None
+                              BranchConditional 1264 1265 1266
+            1265:               Label
                                 Kill
-            1254:             Label
-            1257:          68 Load 71(inF0)
-            1258:          68 Load 72(inF1)
-            1259:          68 Load 73(inF2)
-            1260:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 1257 1258 1259
-                              Store 1256(r008) 1260
-            1262:          68 Load 71(inF0)
-            1263:          68 ExtInst 1(GLSL.std.450) 14(Cos) 1262
-                              Store 1261(r009) 1263
-            1265:          68 Load 71(inF0)
-            1266:          68 ExtInst 1(GLSL.std.450) 20(Cosh) 1265
-                              Store 1264(r010) 1266
-            1268:          68 Load 71(inF0)
-            1269:          68 DPdx 1268
-                              Store 1267(r011) 1269
-            1271:          68 Load 71(inF0)
-            1272:          68 DPdxCoarse 1271
-                              Store 1270(r012) 1272
+            1266:             Label
+            1269:          68 Load 71(inF0)
+            1270:          68 Load 72(inF1)
+            1271:          68 Load 73(inF2)
+            1272:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 1269 1270 1271
+                              Store 1268(r008) 1272
             1274:          68 Load 71(inF0)
-            1275:          68 DPdxFine 1274
-                              Store 1273(r013) 1275
+            1275:          68 ExtInst 1(GLSL.std.450) 14(Cos) 1274
+                              Store 1273(r009) 1275
             1277:          68 Load 71(inF0)
-            1278:          68 DPdy 1277
-                              Store 1276(r014) 1278
+            1278:          68 ExtInst 1(GLSL.std.450) 20(Cosh) 1277
+                              Store 1276(r010) 1278
             1280:          68 Load 71(inF0)
-            1281:          68 DPdyCoarse 1280
-                              Store 1279(r015) 1281
+            1281:          68 DPdx 1280
+                              Store 1279(r011) 1281
             1283:          68 Load 71(inF0)
-            1284:          68 DPdyFine 1283
-                              Store 1282(r016) 1284
+            1284:          68 DPdxCoarse 1283
+                              Store 1282(r012) 1284
             1286:          68 Load 71(inF0)
-            1287:          68 ExtInst 1(GLSL.std.450) 12(Degrees) 1286
-                              Store 1285(r017) 1287
+            1287:          68 DPdxFine 1286
+                              Store 1285(r013) 1287
             1289:          68 Load 71(inF0)
-            1290:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1289
-                              Store 1288(r018) 1290
+            1290:          68 DPdy 1289
+                              Store 1288(r014) 1290
             1292:          68 Load 71(inF0)
-            1293:          68 ExtInst 1(GLSL.std.450) 27(Exp) 1292
-                              Store 1291(r019) 1293
+            1293:          68 DPdyCoarse 1292
+                              Store 1291(r015) 1293
             1295:          68 Load 71(inF0)
-            1296:          68 ExtInst 1(GLSL.std.450) 29(Exp2) 1295
-                              Store 1294(R020) 1296
+            1296:          68 DPdyFine 1295
+                              Store 1294(r016) 1296
             1298:          68 Load 71(inF0)
-            1299:          68 ExtInst 1(GLSL.std.450) 8(Floor) 1298
-                              Store 1297(r021) 1299
+            1299:          68 ExtInst 1(GLSL.std.450) 12(Degrees) 1298
+                              Store 1297(r017) 1299
             1301:          68 Load 71(inF0)
-            1302:          68 Load 72(inF1)
-            1303:   36(fvec3) CompositeExtract 1301 0
-            1304:   36(fvec3) CompositeExtract 1302 0
-            1305:   36(fvec3) FMod 1303 1304
-            1306:   36(fvec3) CompositeExtract 1301 1
-            1307:   36(fvec3) CompositeExtract 1302 1
-            1308:   36(fvec3) FMod 1306 1307
-            1309:   36(fvec3) CompositeExtract 1301 2
-            1310:   36(fvec3) CompositeExtract 1302 2
-            1311:   36(fvec3) FMod 1309 1310
-            1312:          68 CompositeConstruct 1305 1308 1311
-                              Store 1300(r022) 1312
-            1314:          68 Load 71(inF0)
-            1315:          68 ExtInst 1(GLSL.std.450) 10(Fract) 1314
-                              Store 1313(r023) 1315
-            1317:          68 Load 71(inF0)
-            1318:          68 Fwidth 1317
-                              Store 1316(r025) 1318
-            1320:          68 Load 71(inF0)
-            1321:          68 Load 72(inF1)
-            1322:          68 ExtInst 1(GLSL.std.450) 53(Ldexp) 1320 1321
-                              Store 1319(r026) 1322
-            1324:          68 Load 71(inF0)
-            1325:          68 Load 72(inF1)
-            1326:          68 Load 73(inF2)
-            1327:          68 ExtInst 1(GLSL.std.450) 46(FMix) 1324 1325 1326
-                              Store 1323(r026a) 1327
+            1302:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1301
+                              Store 1300(r018) 1302
+            1304:          68 Load 71(inF0)
+            1305:          68 ExtInst 1(GLSL.std.450) 27(Exp) 1304
+                              Store 1303(r019) 1305
+            1307:          68 Load 71(inF0)
+            1308:          68 ExtInst 1(GLSL.std.450) 29(Exp2) 1307
+                              Store 1306(R020) 1308
+            1310:          68 Load 71(inF0)
+            1311:          68 ExtInst 1(GLSL.std.450) 8(Floor) 1310
+                              Store 1309(r021) 1311
+            1313:          68 Load 71(inF0)
+            1314:          68 Load 72(inF1)
+            1315:   36(fvec3) CompositeExtract 1313 0
+            1316:   36(fvec3) CompositeExtract 1314 0
+            1317:   36(fvec3) FMod 1315 1316
+            1318:   36(fvec3) CompositeExtract 1313 1
+            1319:   36(fvec3) CompositeExtract 1314 1
+            1320:   36(fvec3) FMod 1318 1319
+            1321:   36(fvec3) CompositeExtract 1313 2
+            1322:   36(fvec3) CompositeExtract 1314 2
+            1323:   36(fvec3) FMod 1321 1322
+            1324:          68 CompositeConstruct 1317 1320 1323
+                              Store 1312(r022) 1324
+            1326:          68 Load 71(inF0)
+            1327:          68 ExtInst 1(GLSL.std.450) 10(Fract) 1326
+                              Store 1325(r023) 1327
             1329:          68 Load 71(inF0)
-            1330:          68 ExtInst 1(GLSL.std.450) 28(Log) 1329
-                              Store 1328(r027) 1330
+            1330:          68 Fwidth 1329
+                              Store 1328(r025) 1330
             1332:          68 Load 71(inF0)
-            1333:          68 ExtInst 1(GLSL.std.450) 30(Log2) 1332
-            1334:          68 MatrixTimesScalar 1333 260
-                              Store 1331(r028) 1334
+            1333:          68 Load 72(inF1)
+            1334:          68 ExtInst 1(GLSL.std.450) 53(Ldexp) 1332 1333
+                              Store 1331(r026) 1334
             1336:          68 Load 71(inF0)
-            1337:          68 ExtInst 1(GLSL.std.450) 30(Log2) 1336
-                              Store 1335(r029) 1337
-            1339:          68 Load 71(inF0)
-            1340:          68 Load 72(inF1)
-            1341:          68 ExtInst 1(GLSL.std.450) 40(FMax) 1339 1340
-                              Store 1338(r030) 1341
-            1343:          68 Load 71(inF0)
-            1344:          68 Load 72(inF1)
-            1345:          68 ExtInst 1(GLSL.std.450) 37(FMin) 1343 1344
-                              Store 1342(r031) 1345
-            1347:          68 Load 71(inF0)
-            1348:          68 Load 72(inF1)
-            1349:          68 ExtInst 1(GLSL.std.450) 26(Pow) 1347 1348
-                              Store 1346(r032) 1349
+            1337:          68 Load 72(inF1)
+            1338:          68 Load 73(inF2)
+            1339:          68 ExtInst 1(GLSL.std.450) 46(FMix) 1336 1337 1338
+                              Store 1335(r026a) 1339
+            1341:          68 Load 71(inF0)
+            1342:          68 ExtInst 1(GLSL.std.450) 28(Log) 1341
+                              Store 1340(r027) 1342
+            1344:          68 Load 71(inF0)
+            1345:          68 ExtInst 1(GLSL.std.450) 30(Log2) 1344
+            1346:          68 MatrixTimesScalar 1345 262
+                              Store 1343(r028) 1346
+            1348:          68 Load 71(inF0)
+            1349:          68 ExtInst 1(GLSL.std.450) 30(Log2) 1348
+                              Store 1347(r029) 1349
             1351:          68 Load 71(inF0)
-            1352:          68 ExtInst 1(GLSL.std.450) 11(Radians) 1351
-                              Store 1350(r033) 1352
-            1354:          68 Load 71(inF0)
-            1355:          68 ExtInst 1(GLSL.std.450) 2(RoundEven) 1354
-                              Store 1353(r034) 1355
-            1357:          68 Load 71(inF0)
-            1358:          68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1357
-                              Store 1356(r035) 1358
-            1360:          68 Load 71(inF0)
-            1361:   36(fvec3) CompositeConstruct 179 179 179
-            1362:   36(fvec3) CompositeConstruct 281 281 281
-            1363:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 1360 1361 1362
-                              Store 1359(r036) 1363
-            1365:          68 Load 71(inF0)
-            1366:          68 ExtInst 1(GLSL.std.450) 6(FSign) 1365
-                              Store 1364(r037) 1366
-            1368:          68 Load 71(inF0)
-            1369:          68 ExtInst 1(GLSL.std.450) 13(Sin) 1368
-                              Store 1367(r038) 1369
-            1370:          68 Load 71(inF0)
-            1371:          68 ExtInst 1(GLSL.std.450) 13(Sin) 1370
-                              Store 72(inF1) 1371
+            1352:          68 Load 72(inF1)
+            1353:          68 ExtInst 1(GLSL.std.450) 40(FMax) 1351 1352
+                              Store 1350(r030) 1353
+            1355:          68 Load 71(inF0)
+            1356:          68 Load 72(inF1)
+            1357:          68 ExtInst 1(GLSL.std.450) 37(FMin) 1355 1356
+                              Store 1354(r031) 1357
+            1359:          68 Load 71(inF0)
+            1360:          68 Load 72(inF1)
+            1361:          68 ExtInst 1(GLSL.std.450) 26(Pow) 1359 1360
+                              Store 1358(r032) 1361
+            1363:          68 Load 71(inF0)
+            1364:          68 ExtInst 1(GLSL.std.450) 11(Radians) 1363
+                              Store 1362(r033) 1364
+            1366:          68 Load 71(inF0)
+            1367:          68 ExtInst 1(GLSL.std.450) 2(RoundEven) 1366
+                              Store 1365(r034) 1367
+            1369:          68 Load 71(inF0)
+            1370:          68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1369
+                              Store 1368(r035) 1370
             1372:          68 Load 71(inF0)
-            1373:          68 ExtInst 1(GLSL.std.450) 14(Cos) 1372
-                              Store 73(inF2) 1373
-            1375:          68 Load 71(inF0)
-            1376:          68 ExtInst 1(GLSL.std.450) 19(Sinh) 1375
-                              Store 1374(r039) 1376
-            1378:          68 Load 71(inF0)
-            1379:          68 Load 72(inF1)
-            1380:          68 Load 73(inF2)
-            1381:          68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1378 1379 1380
-                              Store 1377(r049) 1381
-            1383:          68 Load 71(inF0)
-            1384:          68 ExtInst 1(GLSL.std.450) 31(Sqrt) 1383
-                              Store 1382(r041) 1384
-            1386:          68 Load 71(inF0)
-            1387:          68 Load 72(inF1)
-            1388:          68 ExtInst 1(GLSL.std.450) 48(Step) 1386 1387
-                              Store 1385(r042) 1388
+            1373:   36(fvec3) CompositeConstruct 139 139 139
+            1374:   36(fvec3) CompositeConstruct 283 283 283
+            1375:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 1372 1373 1374
+                              Store 1371(r036) 1375
+            1377:          68 Load 71(inF0)
+            1378:          68 ExtInst 1(GLSL.std.450) 6(FSign) 1377
+                              Store 1376(r037) 1378
+            1380:          68 Load 71(inF0)
+            1381:          68 ExtInst 1(GLSL.std.450) 13(Sin) 1380
+                              Store 1379(r038) 1381
+            1382:          68 Load 71(inF0)
+            1383:          68 ExtInst 1(GLSL.std.450) 13(Sin) 1382
+                              Store 72(inF1) 1383
+            1384:          68 Load 71(inF0)
+            1385:          68 ExtInst 1(GLSL.std.450) 14(Cos) 1384
+                              Store 73(inF2) 1385
+            1387:          68 Load 71(inF0)
+            1388:          68 ExtInst 1(GLSL.std.450) 19(Sinh) 1387
+                              Store 1386(r039) 1388
             1390:          68 Load 71(inF0)
-            1391:          68 ExtInst 1(GLSL.std.450) 15(Tan) 1390
-                              Store 1389(r043) 1391
-            1393:          68 Load 71(inF0)
-            1394:          68 ExtInst 1(GLSL.std.450) 21(Tanh) 1393
-                              Store 1392(r044) 1394
+            1391:          68 Load 72(inF1)
+            1392:          68 Load 73(inF2)
+            1393:          68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1390 1391 1392
+                              Store 1389(r049) 1393
             1395:          68 Load 71(inF0)
-            1396:          68 Transpose 1395
+            1396:          68 ExtInst 1(GLSL.std.450) 31(Sqrt) 1395
+                              Store 1394(r041) 1396
             1398:          68 Load 71(inF0)
-            1399:          68 ExtInst 1(GLSL.std.450) 3(Trunc) 1398
-                              Store 1397(r046) 1399
-                              ReturnValue 1401
+            1399:          68 Load 72(inF1)
+            1400:          68 ExtInst 1(GLSL.std.450) 48(Step) 1398 1399
+                              Store 1397(r042) 1400
+            1402:          68 Load 71(inF0)
+            1403:          68 ExtInst 1(GLSL.std.450) 15(Tan) 1402
+                              Store 1401(r043) 1403
+            1405:          68 Load 71(inF0)
+            1406:          68 ExtInst 1(GLSL.std.450) 21(Tanh) 1405
+                              Store 1404(r044) 1406
+            1407:          68 Load 71(inF0)
+            1408:          68 Transpose 1407
+            1410:          68 Load 71(inF0)
+            1411:          68 ExtInst 1(GLSL.std.450) 3(Trunc) 1410
+                              Store 1409(r046) 1411
+                              ReturnValue 1413
                               FunctionEnd
 82(PixelShaderFunction4x4(mf44;mf44;mf44;):          76 Function None 78
         79(inF0):     77(ptr) FunctionParameter
         80(inF1):     77(ptr) FunctionParameter
         81(inF2):     77(ptr) FunctionParameter
               83:             Label
-      1404(r000):    136(ptr) Variable Function
-      1407(r001):     77(ptr) Variable Function
-      1412(r003):    136(ptr) Variable Function
-      1415(r004):     77(ptr) Variable Function
-      1418(r005):     77(ptr) Variable Function
-      1421(r006):     77(ptr) Variable Function
-      1425(r007):     77(ptr) Variable Function
-      1436(r008):     77(ptr) Variable Function
-      1441(r009):     77(ptr) Variable Function
-      1444(r010):     77(ptr) Variable Function
-      1447(r011):     77(ptr) Variable Function
-      1450(r012):     77(ptr) Variable Function
-      1453(r013):     77(ptr) Variable Function
-      1456(r014):     77(ptr) Variable Function
-      1459(r015):     77(ptr) Variable Function
-      1462(r016):     77(ptr) Variable Function
-      1465(r017):     77(ptr) Variable Function
-      1468(r018):      7(ptr) Variable Function
-      1471(r019):     77(ptr) Variable Function
-      1474(R020):     77(ptr) Variable Function
-      1477(r021):     77(ptr) Variable Function
-      1480(r022):     77(ptr) Variable Function
-      1496(r023):     77(ptr) Variable Function
-      1499(r025):     77(ptr) Variable Function
-      1502(r026):     77(ptr) Variable Function
-     1506(r026a):     77(ptr) Variable Function
-      1511(r027):     77(ptr) Variable Function
-      1514(r028):     77(ptr) Variable Function
-      1518(r029):     77(ptr) Variable Function
-      1521(r030):     77(ptr) Variable Function
-      1525(r031):     77(ptr) Variable Function
-      1529(r032):     77(ptr) Variable Function
-      1533(r033):     77(ptr) Variable Function
-      1536(r034):     77(ptr) Variable Function
-      1539(r035):     77(ptr) Variable Function
-      1542(r036):     77(ptr) Variable Function
-      1547(r037):     77(ptr) Variable Function
-      1550(r038):     77(ptr) Variable Function
-      1557(r039):     77(ptr) Variable Function
-      1560(r049):     77(ptr) Variable Function
-      1565(r041):     77(ptr) Variable Function
-      1568(r042):     77(ptr) Variable Function
-      1572(r043):     77(ptr) Variable Function
-      1575(r044):     77(ptr) Variable Function
-      1580(r046):     77(ptr) Variable Function
-            1405:          76 Load 79(inF0)
-            1406:   135(bool) All 1405
-                              Store 1404(r000) 1406
-            1408:          76 Load 79(inF0)
-            1409:          76 ExtInst 1(GLSL.std.450) 4(FAbs) 1408
-                              Store 1407(r001) 1409
-            1410:          76 Load 79(inF0)
-            1411:          76 ExtInst 1(GLSL.std.450) 17(Acos) 1410
-            1413:          76 Load 79(inF0)
-            1414:   135(bool) Any 1413
-                              Store 1412(r003) 1414
-            1416:          76 Load 79(inF0)
-            1417:          76 ExtInst 1(GLSL.std.450) 16(Asin) 1416
-                              Store 1415(r004) 1417
-            1419:          76 Load 79(inF0)
-            1420:          76 ExtInst 1(GLSL.std.450) 18(Atan) 1419
-                              Store 1418(r005) 1420
+      1416(r000):    136(ptr) Variable Function
+      1421(r001):     77(ptr) Variable Function
+      1426(r003):    136(ptr) Variable Function
+      1430(r004):     77(ptr) Variable Function
+      1433(r005):     77(ptr) Variable Function
+      1436(r006):     77(ptr) Variable Function
+      1440(r007):     77(ptr) Variable Function
+      1450(r008):     77(ptr) Variable Function
+      1455(r009):     77(ptr) Variable Function
+      1458(r010):     77(ptr) Variable Function
+      1461(r011):     77(ptr) Variable Function
+      1464(r012):     77(ptr) Variable Function
+      1467(r013):     77(ptr) Variable Function
+      1470(r014):     77(ptr) Variable Function
+      1473(r015):     77(ptr) Variable Function
+      1476(r016):     77(ptr) Variable Function
+      1479(r017):     77(ptr) Variable Function
+      1482(r018):      7(ptr) Variable Function
+      1485(r019):     77(ptr) Variable Function
+      1488(R020):     77(ptr) Variable Function
+      1491(r021):     77(ptr) Variable Function
+      1494(r022):     77(ptr) Variable Function
+      1510(r023):     77(ptr) Variable Function
+      1513(r025):     77(ptr) Variable Function
+      1516(r026):     77(ptr) Variable Function
+     1520(r026a):     77(ptr) Variable Function
+      1525(r027):     77(ptr) Variable Function
+      1528(r028):     77(ptr) Variable Function
+      1532(r029):     77(ptr) Variable Function
+      1535(r030):     77(ptr) Variable Function
+      1539(r031):     77(ptr) Variable Function
+      1543(r032):     77(ptr) Variable Function
+      1547(r033):     77(ptr) Variable Function
+      1550(r034):     77(ptr) Variable Function
+      1553(r035):     77(ptr) Variable Function
+      1556(r036):     77(ptr) Variable Function
+      1561(r037):     77(ptr) Variable Function
+      1564(r038):     77(ptr) Variable Function
+      1571(r039):     77(ptr) Variable Function
+      1574(r049):     77(ptr) Variable Function
+      1579(r041):     77(ptr) Variable Function
+      1582(r042):     77(ptr) Variable Function
+      1586(r043):     77(ptr) Variable Function
+      1589(r044):     77(ptr) Variable Function
+      1594(r046):     77(ptr) Variable Function
+            1417:          76 Load 79(inF0)
+            1419:        1418 FOrdNotEqual 1417 139
+            1420:   135(bool) All 1419
+                              Store 1416(r000) 1420
             1422:          76 Load 79(inF0)
-            1423:          76 Load 80(inF1)
-            1424:          76 ExtInst 1(GLSL.std.450) 25(Atan2) 1422 1423
-                              Store 1421(r006) 1424
-            1426:          76 Load 79(inF0)
-            1427:          76 ExtInst 1(GLSL.std.450) 9(Ceil) 1426
-                              Store 1425(r007) 1427
-            1428:          76 Load 79(inF0)
-            1431:        1430 FOrdLessThan 1428 1429
-            1432:   135(bool) Any 1431
-                              SelectionMerge 1434 None
-                              BranchConditional 1432 1433 1434
-            1433:               Label
-                                Kill
-            1434:             Label
+            1423:          76 ExtInst 1(GLSL.std.450) 4(FAbs) 1422
+                              Store 1421(r001) 1423
+            1424:          76 Load 79(inF0)
+            1425:          76 ExtInst 1(GLSL.std.450) 17(Acos) 1424
+            1427:          76 Load 79(inF0)
+            1428:        1418 FOrdNotEqual 1427 139
+            1429:   135(bool) Any 1428
+                              Store 1426(r003) 1429
+            1431:          76 Load 79(inF0)
+            1432:          76 ExtInst 1(GLSL.std.450) 16(Asin) 1431
+                              Store 1430(r004) 1432
+            1434:          76 Load 79(inF0)
+            1435:          76 ExtInst 1(GLSL.std.450) 18(Atan) 1434
+                              Store 1433(r005) 1435
             1437:          76 Load 79(inF0)
             1438:          76 Load 80(inF1)
-            1439:          76 Load 81(inF2)
-            1440:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 1437 1438 1439
-                              Store 1436(r008) 1440
-            1442:          76 Load 79(inF0)
-            1443:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1442
-                              Store 1441(r009) 1443
-            1445:          76 Load 79(inF0)
-            1446:          76 ExtInst 1(GLSL.std.450) 20(Cosh) 1445
-                              Store 1444(r010) 1446
-            1448:          76 Load 79(inF0)
-            1449:          76 DPdx 1448
-                              Store 1447(r011) 1449
+            1439:          76 ExtInst 1(GLSL.std.450) 25(Atan2) 1437 1438
+                              Store 1436(r006) 1439
+            1441:          76 Load 79(inF0)
+            1442:          76 ExtInst 1(GLSL.std.450) 9(Ceil) 1441
+                              Store 1440(r007) 1442
+            1443:          76 Load 79(inF0)
+            1445:        1418 FOrdLessThan 1443 1444
+            1446:   135(bool) Any 1445
+                              SelectionMerge 1448 None
+                              BranchConditional 1446 1447 1448
+            1447:               Label
+                                Kill
+            1448:             Label
             1451:          76 Load 79(inF0)
-            1452:          76 DPdxCoarse 1451
-                              Store 1450(r012) 1452
-            1454:          76 Load 79(inF0)
-            1455:          76 DPdxFine 1454
-                              Store 1453(r013) 1455
-            1457:          76 Load 79(inF0)
-            1458:          76 DPdy 1457
-                              Store 1456(r014) 1458
-            1460:          76 Load 79(inF0)
-            1461:          76 DPdyCoarse 1460
-                              Store 1459(r015) 1461
-            1463:          76 Load 79(inF0)
-            1464:          76 DPdyFine 1463
-                              Store 1462(r016) 1464
-            1466:          76 Load 79(inF0)
-            1467:          76 ExtInst 1(GLSL.std.450) 12(Degrees) 1466
-                              Store 1465(r017) 1467
-            1469:          76 Load 79(inF0)
-            1470:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1469
-                              Store 1468(r018) 1470
-            1472:          76 Load 79(inF0)
-            1473:          76 ExtInst 1(GLSL.std.450) 27(Exp) 1472
-                              Store 1471(r019) 1473
-            1475:          76 Load 79(inF0)
-            1476:          76 ExtInst 1(GLSL.std.450) 29(Exp2) 1475
-                              Store 1474(R020) 1476
-            1478:          76 Load 79(inF0)
-            1479:          76 ExtInst 1(GLSL.std.450) 8(Floor) 1478
-                              Store 1477(r021) 1479
-            1481:          76 Load 79(inF0)
-            1482:          76 Load 80(inF1)
-            1483:   48(fvec4) CompositeExtract 1481 0
-            1484:   48(fvec4) CompositeExtract 1482 0
-            1485:   48(fvec4) FMod 1483 1484
-            1486:   48(fvec4) CompositeExtract 1481 1
-            1487:   48(fvec4) CompositeExtract 1482 1
-            1488:   48(fvec4) FMod 1486 1487
-            1489:   48(fvec4) CompositeExtract 1481 2
-            1490:   48(fvec4) CompositeExtract 1482 2
-            1491:   48(fvec4) FMod 1489 1490
-            1492:   48(fvec4) CompositeExtract 1481 3
-            1493:   48(fvec4) CompositeExtract 1482 3
-            1494:   48(fvec4) FMod 1492 1493
-            1495:          76 CompositeConstruct 1485 1488 1491 1494
-                              Store 1480(r022) 1495
-            1497:          76 Load 79(inF0)
-            1498:          76 ExtInst 1(GLSL.std.450) 10(Fract) 1497
-                              Store 1496(r023) 1498
-            1500:          76 Load 79(inF0)
-            1501:          76 Fwidth 1500
-                              Store 1499(r025) 1501
-            1503:          76 Load 79(inF0)
-            1504:          76 Load 80(inF1)
-            1505:          76 ExtInst 1(GLSL.std.450) 53(Ldexp) 1503 1504
-                              Store 1502(r026) 1505
-            1507:          76 Load 79(inF0)
-            1508:          76 Load 80(inF1)
-            1509:          76 Load 81(inF2)
-            1510:          76 ExtInst 1(GLSL.std.450) 46(FMix) 1507 1508 1509
-                              Store 1506(r026a) 1510
-            1512:          76 Load 79(inF0)
-            1513:          76 ExtInst 1(GLSL.std.450) 28(Log) 1512
-                              Store 1511(r027) 1513
-            1515:          76 Load 79(inF0)
-            1516:          76 ExtInst 1(GLSL.std.450) 30(Log2) 1515
-            1517:          76 MatrixTimesScalar 1516 260
-                              Store 1514(r028) 1517
-            1519:          76 Load 79(inF0)
-            1520:          76 ExtInst 1(GLSL.std.450) 30(Log2) 1519
-                              Store 1518(r029) 1520
-            1522:          76 Load 79(inF0)
-            1523:          76 Load 80(inF1)
-            1524:          76 ExtInst 1(GLSL.std.450) 40(FMax) 1522 1523
-                              Store 1521(r030) 1524
+            1452:          76 Load 80(inF1)
+            1453:          76 Load 81(inF2)
+            1454:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 1451 1452 1453
+                              Store 1450(r008) 1454
+            1456:          76 Load 79(inF0)
+            1457:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1456
+                              Store 1455(r009) 1457
+            1459:          76 Load 79(inF0)
+            1460:          76 ExtInst 1(GLSL.std.450) 20(Cosh) 1459
+                              Store 1458(r010) 1460
+            1462:          76 Load 79(inF0)
+            1463:          76 DPdx 1462
+                              Store 1461(r011) 1463
+            1465:          76 Load 79(inF0)
+            1466:          76 DPdxCoarse 1465
+                              Store 1464(r012) 1466
+            1468:          76 Load 79(inF0)
+            1469:          76 DPdxFine 1468
+                              Store 1467(r013) 1469
+            1471:          76 Load 79(inF0)
+            1472:          76 DPdy 1471
+                              Store 1470(r014) 1472
+            1474:          76 Load 79(inF0)
+            1475:          76 DPdyCoarse 1474
+                              Store 1473(r015) 1475
+            1477:          76 Load 79(inF0)
+            1478:          76 DPdyFine 1477
+                              Store 1476(r016) 1478
+            1480:          76 Load 79(inF0)
+            1481:          76 ExtInst 1(GLSL.std.450) 12(Degrees) 1480
+                              Store 1479(r017) 1481
+            1483:          76 Load 79(inF0)
+            1484:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1483
+                              Store 1482(r018) 1484
+            1486:          76 Load 79(inF0)
+            1487:          76 ExtInst 1(GLSL.std.450) 27(Exp) 1486
+                              Store 1485(r019) 1487
+            1489:          76 Load 79(inF0)
+            1490:          76 ExtInst 1(GLSL.std.450) 29(Exp2) 1489
+                              Store 1488(R020) 1490
+            1492:          76 Load 79(inF0)
+            1493:          76 ExtInst 1(GLSL.std.450) 8(Floor) 1492
+                              Store 1491(r021) 1493
+            1495:          76 Load 79(inF0)
+            1496:          76 Load 80(inF1)
+            1497:   48(fvec4) CompositeExtract 1495 0
+            1498:   48(fvec4) CompositeExtract 1496 0
+            1499:   48(fvec4) FMod 1497 1498
+            1500:   48(fvec4) CompositeExtract 1495 1
+            1501:   48(fvec4) CompositeExtract 1496 1
+            1502:   48(fvec4) FMod 1500 1501
+            1503:   48(fvec4) CompositeExtract 1495 2
+            1504:   48(fvec4) CompositeExtract 1496 2
+            1505:   48(fvec4) FMod 1503 1504
+            1506:   48(fvec4) CompositeExtract 1495 3
+            1507:   48(fvec4) CompositeExtract 1496 3
+            1508:   48(fvec4) FMod 1506 1507
+            1509:          76 CompositeConstruct 1499 1502 1505 1508
+                              Store 1494(r022) 1509
+            1511:          76 Load 79(inF0)
+            1512:          76 ExtInst 1(GLSL.std.450) 10(Fract) 1511
+                              Store 1510(r023) 1512
+            1514:          76 Load 79(inF0)
+            1515:          76 Fwidth 1514
+                              Store 1513(r025) 1515
+            1517:          76 Load 79(inF0)
+            1518:          76 Load 80(inF1)
+            1519:          76 ExtInst 1(GLSL.std.450) 53(Ldexp) 1517 1518
+                              Store 1516(r026) 1519
+            1521:          76 Load 79(inF0)
+            1522:          76 Load 80(inF1)
+            1523:          76 Load 81(inF2)
+            1524:          76 ExtInst 1(GLSL.std.450) 46(FMix) 1521 1522 1523
+                              Store 1520(r026a) 1524
             1526:          76 Load 79(inF0)
-            1527:          76 Load 80(inF1)
-            1528:          76 ExtInst 1(GLSL.std.450) 37(FMin) 1526 1527
-                              Store 1525(r031) 1528
-            1530:          76 Load 79(inF0)
-            1531:          76 Load 80(inF1)
-            1532:          76 ExtInst 1(GLSL.std.450) 26(Pow) 1530 1531
-                              Store 1529(r032) 1532
-            1534:          76 Load 79(inF0)
-            1535:          76 ExtInst 1(GLSL.std.450) 11(Radians) 1534
-                              Store 1533(r033) 1535
-            1537:          76 Load 79(inF0)
-            1538:          76 ExtInst 1(GLSL.std.450) 2(RoundEven) 1537
-                              Store 1536(r034) 1538
+            1527:          76 ExtInst 1(GLSL.std.450) 28(Log) 1526
+                              Store 1525(r027) 1527
+            1529:          76 Load 79(inF0)
+            1530:          76 ExtInst 1(GLSL.std.450) 30(Log2) 1529
+            1531:          76 MatrixTimesScalar 1530 262
+                              Store 1528(r028) 1531
+            1533:          76 Load 79(inF0)
+            1534:          76 ExtInst 1(GLSL.std.450) 30(Log2) 1533
+                              Store 1532(r029) 1534
+            1536:          76 Load 79(inF0)
+            1537:          76 Load 80(inF1)
+            1538:          76 ExtInst 1(GLSL.std.450) 40(FMax) 1536 1537
+                              Store 1535(r030) 1538
             1540:          76 Load 79(inF0)
-            1541:          76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1540
-                              Store 1539(r035) 1541
-            1543:          76 Load 79(inF0)
-            1544:   48(fvec4) CompositeConstruct 179 179 179 179
-            1545:   48(fvec4) CompositeConstruct 281 281 281 281
-            1546:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 1543 1544 1545
-                              Store 1542(r036) 1546
+            1541:          76 Load 80(inF1)
+            1542:          76 ExtInst 1(GLSL.std.450) 37(FMin) 1540 1541
+                              Store 1539(r031) 1542
+            1544:          76 Load 79(inF0)
+            1545:          76 Load 80(inF1)
+            1546:          76 ExtInst 1(GLSL.std.450) 26(Pow) 1544 1545
+                              Store 1543(r032) 1546
             1548:          76 Load 79(inF0)
-            1549:          76 ExtInst 1(GLSL.std.450) 6(FSign) 1548
-                              Store 1547(r037) 1549
+            1549:          76 ExtInst 1(GLSL.std.450) 11(Radians) 1548
+                              Store 1547(r033) 1549
             1551:          76 Load 79(inF0)
-            1552:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1551
-                              Store 1550(r038) 1552
-            1553:          76 Load 79(inF0)
-            1554:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1553
-                              Store 80(inF1) 1554
-            1555:          76 Load 79(inF0)
-            1556:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1555
-                              Store 81(inF2) 1556
-            1558:          76 Load 79(inF0)
-            1559:          76 ExtInst 1(GLSL.std.450) 19(Sinh) 1558
-                              Store 1557(r039) 1559
-            1561:          76 Load 79(inF0)
-            1562:          76 Load 80(inF1)
-            1563:          76 Load 81(inF2)
-            1564:          76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1561 1562 1563
-                              Store 1560(r049) 1564
-            1566:          76 Load 79(inF0)
-            1567:          76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1566
-                              Store 1565(r041) 1567
+            1552:          76 ExtInst 1(GLSL.std.450) 2(RoundEven) 1551
+                              Store 1550(r034) 1552
+            1554:          76 Load 79(inF0)
+            1555:          76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1554
+                              Store 1553(r035) 1555
+            1557:          76 Load 79(inF0)
+            1558:   48(fvec4) CompositeConstruct 139 139 139 139
+            1559:   48(fvec4) CompositeConstruct 283 283 283 283
+            1560:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 1557 1558 1559
+                              Store 1556(r036) 1560
+            1562:          76 Load 79(inF0)
+            1563:          76 ExtInst 1(GLSL.std.450) 6(FSign) 1562
+                              Store 1561(r037) 1563
+            1565:          76 Load 79(inF0)
+            1566:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1565
+                              Store 1564(r038) 1566
+            1567:          76 Load 79(inF0)
+            1568:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1567
+                              Store 80(inF1) 1568
             1569:          76 Load 79(inF0)
-            1570:          76 Load 80(inF1)
-            1571:          76 ExtInst 1(GLSL.std.450) 48(Step) 1569 1570
-                              Store 1568(r042) 1571
-            1573:          76 Load 79(inF0)
-            1574:          76 ExtInst 1(GLSL.std.450) 15(Tan) 1573
-                              Store 1572(r043) 1574
-            1576:          76 Load 79(inF0)
-            1577:          76 ExtInst 1(GLSL.std.450) 21(Tanh) 1576
-                              Store 1575(r044) 1577
-            1578:          76 Load 79(inF0)
-            1579:          76 Transpose 1578
-            1581:          76 Load 79(inF0)
-            1582:          76 ExtInst 1(GLSL.std.450) 3(Trunc) 1581
-                              Store 1580(r046) 1582
-                              ReturnValue 1584
+            1570:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1569
+                              Store 81(inF2) 1570
+            1572:          76 Load 79(inF0)
+            1573:          76 ExtInst 1(GLSL.std.450) 19(Sinh) 1572
+                              Store 1571(r039) 1573
+            1575:          76 Load 79(inF0)
+            1576:          76 Load 80(inF1)
+            1577:          76 Load 81(inF2)
+            1578:          76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1575 1576 1577
+                              Store 1574(r049) 1578
+            1580:          76 Load 79(inF0)
+            1581:          76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1580
+                              Store 1579(r041) 1581
+            1583:          76 Load 79(inF0)
+            1584:          76 Load 80(inF1)
+            1585:          76 ExtInst 1(GLSL.std.450) 48(Step) 1583 1584
+                              Store 1582(r042) 1585
+            1587:          76 Load 79(inF0)
+            1588:          76 ExtInst 1(GLSL.std.450) 15(Tan) 1587
+                              Store 1586(r043) 1588
+            1590:          76 Load 79(inF0)
+            1591:          76 ExtInst 1(GLSL.std.450) 21(Tanh) 1590
+                              Store 1589(r044) 1591
+            1592:          76 Load 79(inF0)
+            1593:          76 Transpose 1592
+            1595:          76 Load 79(inF0)
+            1596:          76 ExtInst 1(GLSL.std.450) 3(Trunc) 1595
+                              Store 1594(r046) 1596
+                              ReturnValue 1598
                               FunctionEnd
 91(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;):           2 Function None 84
         85(inF0):      7(ptr) FunctionParameter
@@ -8034,51 +8076,51 @@
        89(inFM0):     61(ptr) FunctionParameter
        90(inFM1):     61(ptr) FunctionParameter
               92:             Label
-        1587(r0):      7(ptr) Variable Function
-        1591(r1):     25(ptr) Variable Function
-        1595(r2):     25(ptr) Variable Function
-        1599(r3):      7(ptr) Variable Function
-        1603(r4):     25(ptr) Variable Function
-        1607(r5):     25(ptr) Variable Function
-        1611(r6):     61(ptr) Variable Function
-        1615(r7):     61(ptr) Variable Function
-        1619(r8):     61(ptr) Variable Function
-            1588:    6(float) Load 86(inF1)
-            1589:    6(float) Load 85(inF0)
-            1590:    6(float) FMul 1588 1589
-                              Store 1587(r0) 1590
-            1592:    6(float) Load 85(inF0)
-            1593:   24(fvec2) Load 87(inFV0)
-            1594:   24(fvec2) VectorTimesScalar 1593 1592
-                              Store 1591(r1) 1594
-            1596:   24(fvec2) Load 87(inFV0)
-            1597:    6(float) Load 85(inF0)
-            1598:   24(fvec2) VectorTimesScalar 1596 1597
-                              Store 1595(r2) 1598
-            1600:   24(fvec2) Load 87(inFV0)
-            1601:   24(fvec2) Load 88(inFV1)
-            1602:    6(float) Dot 1600 1601
-                              Store 1599(r3) 1602
-            1604:   24(fvec2) Load 87(inFV0)
-            1605:          60 Load 89(inFM0)
-            1606:   24(fvec2) VectorTimesMatrix 1604 1605
-                              Store 1603(r4) 1606
-            1608:          60 Load 89(inFM0)
-            1609:   24(fvec2) Load 87(inFV0)
-            1610:   24(fvec2) MatrixTimesVector 1608 1609
-                              Store 1607(r5) 1610
-            1612:    6(float) Load 85(inF0)
-            1613:          60 Load 89(inFM0)
-            1614:          60 MatrixTimesScalar 1613 1612
-                              Store 1611(r6) 1614
-            1616:          60 Load 89(inFM0)
-            1617:    6(float) Load 85(inF0)
-            1618:          60 MatrixTimesScalar 1616 1617
-                              Store 1615(r7) 1618
-            1620:          60 Load 90(inFM1)
-            1621:          60 Load 89(inFM0)
-            1622:          60 MatrixTimesMatrix 1620 1621
-                              Store 1619(r8) 1622
+        1601(r0):      7(ptr) Variable Function
+        1605(r1):     25(ptr) Variable Function
+        1609(r2):     25(ptr) Variable Function
+        1613(r3):      7(ptr) Variable Function
+        1617(r4):     25(ptr) Variable Function
+        1621(r5):     25(ptr) Variable Function
+        1625(r6):     61(ptr) Variable Function
+        1629(r7):     61(ptr) Variable Function
+        1633(r8):     61(ptr) Variable Function
+            1602:    6(float) Load 86(inF1)
+            1603:    6(float) Load 85(inF0)
+            1604:    6(float) FMul 1602 1603
+                              Store 1601(r0) 1604
+            1606:    6(float) Load 85(inF0)
+            1607:   24(fvec2) Load 87(inFV0)
+            1608:   24(fvec2) VectorTimesScalar 1607 1606
+                              Store 1605(r1) 1608
+            1610:   24(fvec2) Load 87(inFV0)
+            1611:    6(float) Load 85(inF0)
+            1612:   24(fvec2) VectorTimesScalar 1610 1611
+                              Store 1609(r2) 1612
+            1614:   24(fvec2) Load 87(inFV0)
+            1615:   24(fvec2) Load 88(inFV1)
+            1616:    6(float) Dot 1614 1615
+                              Store 1613(r3) 1616
+            1618:   24(fvec2) Load 87(inFV0)
+            1619:          60 Load 89(inFM0)
+            1620:   24(fvec2) VectorTimesMatrix 1618 1619
+                              Store 1617(r4) 1620
+            1622:          60 Load 89(inFM0)
+            1623:   24(fvec2) Load 87(inFV0)
+            1624:   24(fvec2) MatrixTimesVector 1622 1623
+                              Store 1621(r5) 1624
+            1626:    6(float) Load 85(inF0)
+            1627:          60 Load 89(inFM0)
+            1628:          60 MatrixTimesScalar 1627 1626
+                              Store 1625(r6) 1628
+            1630:          60 Load 89(inFM0)
+            1631:    6(float) Load 85(inF0)
+            1632:          60 MatrixTimesScalar 1630 1631
+                              Store 1629(r7) 1632
+            1634:          60 Load 90(inFM1)
+            1635:          60 Load 89(inFM0)
+            1636:          60 MatrixTimesMatrix 1634 1635
+                              Store 1633(r8) 1636
                               Return
                               FunctionEnd
 100(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;):           2 Function None 93
@@ -8089,51 +8131,51 @@
        98(inFM0):     69(ptr) FunctionParameter
        99(inFM1):     69(ptr) FunctionParameter
              101:             Label
-        1623(r0):      7(ptr) Variable Function
-        1627(r1):     37(ptr) Variable Function
-        1631(r2):     37(ptr) Variable Function
-        1635(r3):      7(ptr) Variable Function
-        1639(r4):     37(ptr) Variable Function
-        1643(r5):     37(ptr) Variable Function
-        1647(r6):     69(ptr) Variable Function
-        1651(r7):     69(ptr) Variable Function
-        1655(r8):     69(ptr) Variable Function
-            1624:    6(float) Load 95(inF1)
-            1625:    6(float) Load 94(inF0)
-            1626:    6(float) FMul 1624 1625
-                              Store 1623(r0) 1626
-            1628:    6(float) Load 94(inF0)
-            1629:   36(fvec3) Load 96(inFV0)
-            1630:   36(fvec3) VectorTimesScalar 1629 1628
-                              Store 1627(r1) 1630
-            1632:   36(fvec3) Load 96(inFV0)
-            1633:    6(float) Load 94(inF0)
-            1634:   36(fvec3) VectorTimesScalar 1632 1633
-                              Store 1631(r2) 1634
-            1636:   36(fvec3) Load 96(inFV0)
-            1637:   36(fvec3) Load 97(inFV1)
-            1638:    6(float) Dot 1636 1637
-                              Store 1635(r3) 1638
-            1640:   36(fvec3) Load 96(inFV0)
-            1641:          68 Load 98(inFM0)
-            1642:   36(fvec3) VectorTimesMatrix 1640 1641
-                              Store 1639(r4) 1642
-            1644:          68 Load 98(inFM0)
-            1645:   36(fvec3) Load 96(inFV0)
-            1646:   36(fvec3) MatrixTimesVector 1644 1645
-                              Store 1643(r5) 1646
-            1648:    6(float) Load 94(inF0)
-            1649:          68 Load 98(inFM0)
-            1650:          68 MatrixTimesScalar 1649 1648
-                              Store 1647(r6) 1650
-            1652:          68 Load 98(inFM0)
-            1653:    6(float) Load 94(inF0)
-            1654:          68 MatrixTimesScalar 1652 1653
-                              Store 1651(r7) 1654
-            1656:          68 Load 99(inFM1)
-            1657:          68 Load 98(inFM0)
-            1658:          68 MatrixTimesMatrix 1656 1657
-                              Store 1655(r8) 1658
+        1637(r0):      7(ptr) Variable Function
+        1641(r1):     37(ptr) Variable Function
+        1645(r2):     37(ptr) Variable Function
+        1649(r3):      7(ptr) Variable Function
+        1653(r4):     37(ptr) Variable Function
+        1657(r5):     37(ptr) Variable Function
+        1661(r6):     69(ptr) Variable Function
+        1665(r7):     69(ptr) Variable Function
+        1669(r8):     69(ptr) Variable Function
+            1638:    6(float) Load 95(inF1)
+            1639:    6(float) Load 94(inF0)
+            1640:    6(float) FMul 1638 1639
+                              Store 1637(r0) 1640
+            1642:    6(float) Load 94(inF0)
+            1643:   36(fvec3) Load 96(inFV0)
+            1644:   36(fvec3) VectorTimesScalar 1643 1642
+                              Store 1641(r1) 1644
+            1646:   36(fvec3) Load 96(inFV0)
+            1647:    6(float) Load 94(inF0)
+            1648:   36(fvec3) VectorTimesScalar 1646 1647
+                              Store 1645(r2) 1648
+            1650:   36(fvec3) Load 96(inFV0)
+            1651:   36(fvec3) Load 97(inFV1)
+            1652:    6(float) Dot 1650 1651
+                              Store 1649(r3) 1652
+            1654:   36(fvec3) Load 96(inFV0)
+            1655:          68 Load 98(inFM0)
+            1656:   36(fvec3) VectorTimesMatrix 1654 1655
+                              Store 1653(r4) 1656
+            1658:          68 Load 98(inFM0)
+            1659:   36(fvec3) Load 96(inFV0)
+            1660:   36(fvec3) MatrixTimesVector 1658 1659
+                              Store 1657(r5) 1660
+            1662:    6(float) Load 94(inF0)
+            1663:          68 Load 98(inFM0)
+            1664:          68 MatrixTimesScalar 1663 1662
+                              Store 1661(r6) 1664
+            1666:          68 Load 98(inFM0)
+            1667:    6(float) Load 94(inF0)
+            1668:          68 MatrixTimesScalar 1666 1667
+                              Store 1665(r7) 1668
+            1670:          68 Load 99(inFM1)
+            1671:          68 Load 98(inFM0)
+            1672:          68 MatrixTimesMatrix 1670 1671
+                              Store 1669(r8) 1672
                               Return
                               FunctionEnd
 109(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;):           2 Function None 102
@@ -8144,51 +8186,51 @@
       107(inFM0):     77(ptr) FunctionParameter
       108(inFM1):     77(ptr) FunctionParameter
              110:             Label
-        1659(r0):      7(ptr) Variable Function
-        1663(r1):     49(ptr) Variable Function
-        1667(r2):     49(ptr) Variable Function
-        1671(r3):      7(ptr) Variable Function
-        1675(r4):     49(ptr) Variable Function
-        1679(r5):     49(ptr) Variable Function
-        1683(r6):     77(ptr) Variable Function
-        1687(r7):     77(ptr) Variable Function
-        1691(r8):     77(ptr) Variable Function
-            1660:    6(float) Load 104(inF1)
-            1661:    6(float) Load 103(inF0)
-            1662:    6(float) FMul 1660 1661
-                              Store 1659(r0) 1662
-            1664:    6(float) Load 103(inF0)
-            1665:   48(fvec4) Load 105(inFV0)
-            1666:   48(fvec4) VectorTimesScalar 1665 1664
-                              Store 1663(r1) 1666
-            1668:   48(fvec4) Load 105(inFV0)
-            1669:    6(float) Load 103(inF0)
-            1670:   48(fvec4) VectorTimesScalar 1668 1669
-                              Store 1667(r2) 1670
-            1672:   48(fvec4) Load 105(inFV0)
-            1673:   48(fvec4) Load 106(inFV1)
-            1674:    6(float) Dot 1672 1673
-                              Store 1671(r3) 1674
-            1676:   48(fvec4) Load 105(inFV0)
-            1677:          76 Load 107(inFM0)
-            1678:   48(fvec4) VectorTimesMatrix 1676 1677
-                              Store 1675(r4) 1678
-            1680:          76 Load 107(inFM0)
-            1681:   48(fvec4) Load 105(inFV0)
-            1682:   48(fvec4) MatrixTimesVector 1680 1681
-                              Store 1679(r5) 1682
-            1684:    6(float) Load 103(inF0)
-            1685:          76 Load 107(inFM0)
-            1686:          76 MatrixTimesScalar 1685 1684
-                              Store 1683(r6) 1686
-            1688:          76 Load 107(inFM0)
-            1689:    6(float) Load 103(inF0)
-            1690:          76 MatrixTimesScalar 1688 1689
-                              Store 1687(r7) 1690
-            1692:          76 Load 108(inFM1)
-            1693:          76 Load 107(inFM0)
-            1694:          76 MatrixTimesMatrix 1692 1693
-                              Store 1691(r8) 1694
+        1673(r0):      7(ptr) Variable Function
+        1677(r1):     49(ptr) Variable Function
+        1681(r2):     49(ptr) Variable Function
+        1685(r3):      7(ptr) Variable Function
+        1689(r4):     49(ptr) Variable Function
+        1693(r5):     49(ptr) Variable Function
+        1697(r6):     77(ptr) Variable Function
+        1701(r7):     77(ptr) Variable Function
+        1705(r8):     77(ptr) Variable Function
+            1674:    6(float) Load 104(inF1)
+            1675:    6(float) Load 103(inF0)
+            1676:    6(float) FMul 1674 1675
+                              Store 1673(r0) 1676
+            1678:    6(float) Load 103(inF0)
+            1679:   48(fvec4) Load 105(inFV0)
+            1680:   48(fvec4) VectorTimesScalar 1679 1678
+                              Store 1677(r1) 1680
+            1682:   48(fvec4) Load 105(inFV0)
+            1683:    6(float) Load 103(inF0)
+            1684:   48(fvec4) VectorTimesScalar 1682 1683
+                              Store 1681(r2) 1684
+            1686:   48(fvec4) Load 105(inFV0)
+            1687:   48(fvec4) Load 106(inFV1)
+            1688:    6(float) Dot 1686 1687
+                              Store 1685(r3) 1688
+            1690:   48(fvec4) Load 105(inFV0)
+            1691:          76 Load 107(inFM0)
+            1692:   48(fvec4) VectorTimesMatrix 1690 1691
+                              Store 1689(r4) 1692
+            1694:          76 Load 107(inFM0)
+            1695:   48(fvec4) Load 105(inFV0)
+            1696:   48(fvec4) MatrixTimesVector 1694 1695
+                              Store 1693(r5) 1696
+            1698:    6(float) Load 103(inF0)
+            1699:          76 Load 107(inFM0)
+            1700:          76 MatrixTimesScalar 1699 1698
+                              Store 1697(r6) 1700
+            1702:          76 Load 107(inFM0)
+            1703:    6(float) Load 103(inF0)
+            1704:          76 MatrixTimesScalar 1702 1703
+                              Store 1701(r7) 1704
+            1706:          76 Load 108(inFM1)
+            1707:          76 Load 107(inFM0)
+            1708:          76 MatrixTimesMatrix 1706 1707
+                              Store 1705(r8) 1708
                               Return
                               FunctionEnd
 129(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;):           2 Function None 119
@@ -8202,98 +8244,98 @@
     127(inFM3x4):    116(ptr) FunctionParameter
     128(inFM2x4):    118(ptr) FunctionParameter
              130:             Label
-       1695(r00):      7(ptr) Variable Function
-       1699(r01):     25(ptr) Variable Function
-       1703(r02):     37(ptr) Variable Function
-       1707(r03):     25(ptr) Variable Function
-       1711(r04):     37(ptr) Variable Function
-       1715(r05):      7(ptr) Variable Function
-       1719(r06):      7(ptr) Variable Function
-       1723(r07):     37(ptr) Variable Function
-       1727(r08):     25(ptr) Variable Function
-       1731(r09):     25(ptr) Variable Function
-       1735(r10):     37(ptr) Variable Function
-       1739(r11):    112(ptr) Variable Function
-       1743(r12):    114(ptr) Variable Function
-       1747(r13):     61(ptr) Variable Function
-       1751(r14):    112(ptr) Variable Function
-       1755(r15):    118(ptr) Variable Function
-       1759(r16):    116(ptr) Variable Function
-            1696:    6(float) Load 121(inF1)
-            1697:    6(float) Load 120(inF0)
-            1698:    6(float) FMul 1696 1697
-                              Store 1695(r00) 1698
-            1700:    6(float) Load 120(inF0)
-            1701:   24(fvec2) Load 122(inFV2)
-            1702:   24(fvec2) VectorTimesScalar 1701 1700
-                              Store 1699(r01) 1702
-            1704:    6(float) Load 120(inF0)
-            1705:   36(fvec3) Load 123(inFV3)
-            1706:   36(fvec3) VectorTimesScalar 1705 1704
-                              Store 1703(r02) 1706
-            1708:   24(fvec2) Load 122(inFV2)
-            1709:    6(float) Load 120(inF0)
-            1710:   24(fvec2) VectorTimesScalar 1708 1709
-                              Store 1707(r03) 1710
-            1712:   36(fvec3) Load 123(inFV3)
-            1713:    6(float) Load 120(inF0)
-            1714:   36(fvec3) VectorTimesScalar 1712 1713
-                              Store 1711(r04) 1714
-            1716:   24(fvec2) Load 122(inFV2)
-            1717:   24(fvec2) Load 122(inFV2)
-            1718:    6(float) Dot 1716 1717
-                              Store 1715(r05) 1718
-            1720:   36(fvec3) Load 123(inFV3)
-            1721:   36(fvec3) Load 123(inFV3)
-            1722:    6(float) Dot 1720 1721
-                              Store 1719(r06) 1722
-            1724:         111 Load 124(inFM2x3)
-            1725:   24(fvec2) Load 122(inFV2)
-            1726:   36(fvec3) MatrixTimesVector 1724 1725
-                              Store 1723(r07) 1726
-            1728:         113 Load 125(inFM3x2)
-            1729:   36(fvec3) Load 123(inFV3)
-            1730:   24(fvec2) MatrixTimesVector 1728 1729
-                              Store 1727(r08) 1730
-            1732:   36(fvec3) Load 123(inFV3)
-            1733:         111 Load 124(inFM2x3)
-            1734:   24(fvec2) VectorTimesMatrix 1732 1733
-                              Store 1731(r09) 1734
-            1736:   24(fvec2) Load 122(inFV2)
-            1737:         113 Load 125(inFM3x2)
-            1738:   36(fvec3) VectorTimesMatrix 1736 1737
-                              Store 1735(r10) 1738
-            1740:    6(float) Load 120(inF0)
-            1741:         111 Load 124(inFM2x3)
-            1742:         111 MatrixTimesScalar 1741 1740
-                              Store 1739(r11) 1742
-            1744:    6(float) Load 120(inF0)
-            1745:         113 Load 125(inFM3x2)
-            1746:         113 MatrixTimesScalar 1745 1744
-                              Store 1743(r12) 1746
-            1748:         113 Load 125(inFM3x2)
-            1749:         111 Load 124(inFM2x3)
-            1750:          60 MatrixTimesMatrix 1748 1749
-                              Store 1747(r13) 1750
-            1752:          68 Load 126(inFM3x3)
-            1753:         111 Load 124(inFM2x3)
-            1754:         111 MatrixTimesMatrix 1752 1753
-                              Store 1751(r14) 1754
-            1756:         115 Load 127(inFM3x4)
-            1757:         111 Load 124(inFM2x3)
-            1758:         117 MatrixTimesMatrix 1756 1757
-                              Store 1755(r15) 1758
-            1760:         117 Load 128(inFM2x4)
-            1761:         113 Load 125(inFM3x2)
-            1762:         115 MatrixTimesMatrix 1760 1761
-                              Store 1759(r16) 1762
+       1709(r00):      7(ptr) Variable Function
+       1713(r01):     25(ptr) Variable Function
+       1717(r02):     37(ptr) Variable Function
+       1721(r03):     25(ptr) Variable Function
+       1725(r04):     37(ptr) Variable Function
+       1729(r05):      7(ptr) Variable Function
+       1733(r06):      7(ptr) Variable Function
+       1737(r07):     37(ptr) Variable Function
+       1741(r08):     25(ptr) Variable Function
+       1745(r09):     25(ptr) Variable Function
+       1749(r10):     37(ptr) Variable Function
+       1753(r11):    112(ptr) Variable Function
+       1757(r12):    114(ptr) Variable Function
+       1761(r13):     61(ptr) Variable Function
+       1765(r14):    112(ptr) Variable Function
+       1769(r15):    118(ptr) Variable Function
+       1773(r16):    116(ptr) Variable Function
+            1710:    6(float) Load 121(inF1)
+            1711:    6(float) Load 120(inF0)
+            1712:    6(float) FMul 1710 1711
+                              Store 1709(r00) 1712
+            1714:    6(float) Load 120(inF0)
+            1715:   24(fvec2) Load 122(inFV2)
+            1716:   24(fvec2) VectorTimesScalar 1715 1714
+                              Store 1713(r01) 1716
+            1718:    6(float) Load 120(inF0)
+            1719:   36(fvec3) Load 123(inFV3)
+            1720:   36(fvec3) VectorTimesScalar 1719 1718
+                              Store 1717(r02) 1720
+            1722:   24(fvec2) Load 122(inFV2)
+            1723:    6(float) Load 120(inF0)
+            1724:   24(fvec2) VectorTimesScalar 1722 1723
+                              Store 1721(r03) 1724
+            1726:   36(fvec3) Load 123(inFV3)
+            1727:    6(float) Load 120(inF0)
+            1728:   36(fvec3) VectorTimesScalar 1726 1727
+                              Store 1725(r04) 1728
+            1730:   24(fvec2) Load 122(inFV2)
+            1731:   24(fvec2) Load 122(inFV2)
+            1732:    6(float) Dot 1730 1731
+                              Store 1729(r05) 1732
+            1734:   36(fvec3) Load 123(inFV3)
+            1735:   36(fvec3) Load 123(inFV3)
+            1736:    6(float) Dot 1734 1735
+                              Store 1733(r06) 1736
+            1738:         111 Load 124(inFM2x3)
+            1739:   24(fvec2) Load 122(inFV2)
+            1740:   36(fvec3) MatrixTimesVector 1738 1739
+                              Store 1737(r07) 1740
+            1742:         113 Load 125(inFM3x2)
+            1743:   36(fvec3) Load 123(inFV3)
+            1744:   24(fvec2) MatrixTimesVector 1742 1743
+                              Store 1741(r08) 1744
+            1746:   36(fvec3) Load 123(inFV3)
+            1747:         111 Load 124(inFM2x3)
+            1748:   24(fvec2) VectorTimesMatrix 1746 1747
+                              Store 1745(r09) 1748
+            1750:   24(fvec2) Load 122(inFV2)
+            1751:         113 Load 125(inFM3x2)
+            1752:   36(fvec3) VectorTimesMatrix 1750 1751
+                              Store 1749(r10) 1752
+            1754:    6(float) Load 120(inF0)
+            1755:         111 Load 124(inFM2x3)
+            1756:         111 MatrixTimesScalar 1755 1754
+                              Store 1753(r11) 1756
+            1758:    6(float) Load 120(inF0)
+            1759:         113 Load 125(inFM3x2)
+            1760:         113 MatrixTimesScalar 1759 1758
+                              Store 1757(r12) 1760
+            1762:         113 Load 125(inFM3x2)
+            1763:         111 Load 124(inFM2x3)
+            1764:          60 MatrixTimesMatrix 1762 1763
+                              Store 1761(r13) 1764
+            1766:          68 Load 126(inFM3x3)
+            1767:         111 Load 124(inFM2x3)
+            1768:         111 MatrixTimesMatrix 1766 1767
+                              Store 1765(r14) 1768
+            1770:         115 Load 127(inFM3x4)
+            1771:         111 Load 124(inFM2x3)
+            1772:         117 MatrixTimesMatrix 1770 1771
+                              Store 1769(r15) 1772
+            1774:         117 Load 128(inFM2x4)
+            1775:         113 Load 125(inFM3x2)
+            1776:         115 MatrixTimesMatrix 1774 1775
+                              Store 1773(r16) 1776
                               Return
                               FunctionEnd
      133(@main():131(PS_OUTPUT) Function None 132
              134:             Label
- 1764(ps_output):   1763(ptr) Variable Function
-            1767:     49(ptr) AccessChain 1764(ps_output) 1765
-                              Store 1767 1766
-            1768:131(PS_OUTPUT) Load 1764(ps_output)
-                              ReturnValue 1768
+ 1778(ps_output):   1777(ptr) Variable Function
+            1781:     49(ptr) AccessChain 1778(ps_output) 1779
+                              Store 1781 1780
+            1782:131(PS_OUTPUT) Load 1778(ps_output)
+                              ReturnValue 1782
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.intrinsics.negative.frag.out b/Test/baseResults/hlsl.intrinsics.negative.frag.out
index 591ad13..980cc96 100644
--- a/Test/baseResults/hlsl.intrinsics.negative.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.negative.frag.out
@@ -1,10 +1,10 @@
 hlsl.intrinsics.negative.frag
-ERROR: 0:10: 'determinant' : no matching overloaded function found 
+ERROR: 0:10: 'determinant' : ambiguous best function under implicit type conversion 
 ERROR: 0:25: 'normalize' : ambiguous best function under implicit type conversion 
 ERROR: 0:26: 'reflect' : ambiguous best function under implicit type conversion 
 ERROR: 0:27: 'refract' : ambiguous best function under implicit type conversion 
 ERROR: 0:28: 'refract' : no matching overloaded function found 
-ERROR: 0:30: 'transpose' : no matching overloaded function found 
+ERROR: 0:30: 'transpose' : ambiguous best function under implicit type conversion 
 ERROR: 0:39: 'GetRenderTargetSamplePosition' : no matching overloaded function found 
 ERROR: 0:46: 'asdouble' : double2 conversion not implemented 
 ERROR: 0:47: 'CheckAccessFullyMapped' : no matching overloaded function found 
@@ -104,8 +104,9 @@
 0:9                0 (const int)
 0:9              Constant:
 0:9                3 (const int)
-0:10      Constant:
-0:10        0.000000
+0:10      determinant ( temp float)
+ERROR: node is still EOpNull!
+0:10          'inF0' ( in float)
 0:12      direct index ( temp float)
 0:12        unpackHalf2x16 ( temp 2-component vector of float)
 0:12          Convert float to uint ( temp uint)
@@ -150,8 +151,9 @@
 0:29      bitFieldReverse ( temp uint)
 0:29        Convert float to uint ( temp uint)
 0:29          'inF0' ( in float)
-0:30      Constant:
-0:30        0.000000
+0:30      transpose ( temp 1X1 matrix of float)
+ERROR: node is still EOpNull!
+0:30          'inF0' ( in float)
 0:32      Branch: Return with expression
 0:32        Constant:
 0:32          0.000000
@@ -372,7 +374,7 @@
 0:?         'inF2' (layout( location=2) in 4-component vector of float)
 0:80      move second child to first child ( temp 4-component vector of int)
 0:?         'inI0' ( temp 4-component vector of int)
-0:?         'inI0' (layout( location=3) in 4-component vector of int)
+0:?         'inI0' (layout( location=3) flat in 4-component vector of int)
 0:80      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:80        Function Call: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float)
@@ -516,7 +518,7 @@
 0:?     'inF0' (layout( location=0) in 4-component vector of float)
 0:?     'inF1' (layout( location=1) in 4-component vector of float)
 0:?     'inF2' (layout( location=2) in 4-component vector of float)
-0:?     'inI0' (layout( location=3) in 4-component vector of int)
+0:?     'inI0' (layout( location=3) flat in 4-component vector of int)
 
 
 Linked fragment stage:
@@ -565,8 +567,9 @@
 0:9                0 (const int)
 0:9              Constant:
 0:9                3 (const int)
-0:10      Constant:
-0:10        0.000000
+0:10      determinant ( temp float)
+ERROR: node is still EOpNull!
+0:10          'inF0' ( in float)
 0:12      direct index ( temp float)
 0:12        unpackHalf2x16 ( temp 2-component vector of float)
 0:12          Convert float to uint ( temp uint)
@@ -611,8 +614,9 @@
 0:29      bitFieldReverse ( temp uint)
 0:29        Convert float to uint ( temp uint)
 0:29          'inF0' ( in float)
-0:30      Constant:
-0:30        0.000000
+0:30      transpose ( temp 1X1 matrix of float)
+ERROR: node is still EOpNull!
+0:30          'inF0' ( in float)
 0:32      Branch: Return with expression
 0:32        Constant:
 0:32          0.000000
@@ -833,7 +837,7 @@
 0:?         'inF2' (layout( location=2) in 4-component vector of float)
 0:80      move second child to first child ( temp 4-component vector of int)
 0:?         'inI0' ( temp 4-component vector of int)
-0:?         'inI0' (layout( location=3) in 4-component vector of int)
+0:?         'inI0' (layout( location=3) flat in 4-component vector of int)
 0:80      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:80        Function Call: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float)
@@ -977,6 +981,6 @@
 0:?     'inF0' (layout( location=0) in 4-component vector of float)
 0:?     'inF1' (layout( location=1) in 4-component vector of float)
 0:?     'inF2' (layout( location=2) in 4-component vector of float)
-0:?     'inI0' (layout( location=3) in 4-component vector of int)
+0:?     'inI0' (layout( location=3) flat in 4-component vector of int)
 
 SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/hlsl.intrinsics.vert.out b/Test/baseResults/hlsl.intrinsics.vert.out
index 82bb18e..ee85a9d 100644
--- a/Test/baseResults/hlsl.intrinsics.vert.out
+++ b/Test/baseResults/hlsl.intrinsics.vert.out
@@ -10,13 +10,15 @@
 0:2      'inU1' ( in uint)
 0:?     Sequence
 0:3      all ( temp bool)
-0:3        'inF0' ( in float)
+0:3        Convert float to bool ( temp bool)
+0:3          'inF0' ( in float)
 0:4      Absolute value ( temp float)
 0:4        'inF0' ( in float)
 0:5      arc cosine ( temp float)
 0:5        'inF0' ( in float)
 0:6      any ( temp bool)
-0:6        'inF0' ( in float)
+0:6        Convert float to bool ( temp bool)
+0:6          'inF0' ( in float)
 0:7      arc sine ( temp float)
 0:7        'inF0' ( in float)
 0:8      floatBitsToInt ( temp int)
@@ -157,13 +159,15 @@
 0:69      'inU1' ( in 2-component vector of uint)
 0:?     Sequence
 0:70      all ( temp bool)
-0:70        'inF0' ( in 2-component vector of float)
+0:70        Convert float to bool ( temp 2-component vector of bool)
+0:70          'inF0' ( in 2-component vector of float)
 0:71      Absolute value ( temp 2-component vector of float)
 0:71        'inF0' ( in 2-component vector of float)
 0:72      arc cosine ( temp 2-component vector of float)
 0:72        'inF0' ( in 2-component vector of float)
 0:73      any ( temp bool)
-0:73        'inF0' ( in 2-component vector of float)
+0:73        Convert float to bool ( temp 2-component vector of bool)
+0:73          'inF0' ( in 2-component vector of float)
 0:74      arc sine ( temp 2-component vector of float)
 0:74        'inF0' ( in 2-component vector of float)
 0:75      floatBitsToInt ( temp 2-component vector of int)
@@ -320,13 +324,15 @@
 0:138      'inU1' ( in 3-component vector of uint)
 0:?     Sequence
 0:139      all ( temp bool)
-0:139        'inF0' ( in 3-component vector of float)
+0:139        Convert float to bool ( temp 3-component vector of bool)
+0:139          'inF0' ( in 3-component vector of float)
 0:140      Absolute value ( temp 3-component vector of float)
 0:140        'inF0' ( in 3-component vector of float)
 0:141      arc cosine ( temp 3-component vector of float)
 0:141        'inF0' ( in 3-component vector of float)
 0:142      any ( temp bool)
-0:142        'inF0' ( in 3-component vector of float)
+0:142        Convert float to bool ( temp 3-component vector of bool)
+0:142          'inF0' ( in 3-component vector of float)
 0:143      arc sine ( temp 3-component vector of float)
 0:143        'inF0' ( in 3-component vector of float)
 0:144      floatBitsToInt ( temp 3-component vector of int)
@@ -489,13 +495,15 @@
 0:208      'inU1' ( in 4-component vector of uint)
 0:?     Sequence
 0:209      all ( temp bool)
-0:209        'inF0' ( in 4-component vector of float)
+0:209        Convert float to bool ( temp 4-component vector of bool)
+0:209          'inF0' ( in 4-component vector of float)
 0:210      Absolute value ( temp 4-component vector of float)
 0:210        'inF0' ( in 4-component vector of float)
 0:211      arc cosine ( temp 4-component vector of float)
 0:211        'inF0' ( in 4-component vector of float)
 0:212      any ( temp bool)
-0:212        'inF0' ( in 4-component vector of float)
+0:212        Convert float to bool ( temp 4-component vector of bool)
+0:212          'inF0' ( in 4-component vector of float)
 0:213      arc sine ( temp 4-component vector of float)
 0:213        'inF0' ( in 4-component vector of float)
 0:214      floatBitsToInt ( temp 4-component vector of int)
@@ -676,13 +684,15 @@
 0:331      'inF2' ( in 2X2 matrix of float)
 0:?     Sequence
 0:333      all ( temp bool)
-0:333        'inF0' ( in 2X2 matrix of float)
+0:333        Convert float to bool ( temp 2X2 matrix of bool)
+0:333          'inF0' ( in 2X2 matrix of float)
 0:333      Absolute value ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      arc cosine ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      any ( temp bool)
-0:333        'inF0' ( in 2X2 matrix of float)
+0:333        Convert float to bool ( temp 2X2 matrix of bool)
+0:333          'inF0' ( in 2X2 matrix of float)
 0:333      arc sine ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      arc tangent ( temp 2X2 matrix of float)
@@ -803,13 +813,15 @@
 0:340      'inF2' ( in 3X3 matrix of float)
 0:?     Sequence
 0:342      all ( temp bool)
-0:342        'inF0' ( in 3X3 matrix of float)
+0:342        Convert float to bool ( temp 3X3 matrix of bool)
+0:342          'inF0' ( in 3X3 matrix of float)
 0:342      Absolute value ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      arc cosine ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      any ( temp bool)
-0:342        'inF0' ( in 3X3 matrix of float)
+0:342        Convert float to bool ( temp 3X3 matrix of bool)
+0:342          'inF0' ( in 3X3 matrix of float)
 0:342      arc sine ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      arc tangent ( temp 3X3 matrix of float)
@@ -935,13 +947,15 @@
 0:349      'inF2' ( in 4X4 matrix of float)
 0:?     Sequence
 0:351      all ( temp bool)
-0:351        'inF0' ( in 4X4 matrix of float)
+0:351        Convert float to bool ( temp 4X4 matrix of bool)
+0:351          'inF0' ( in 4X4 matrix of float)
 0:351      Absolute value ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      arc cosine ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      any ( temp bool)
-0:351        'inF0' ( in 4X4 matrix of float)
+0:351        Convert float to bool ( temp 4X4 matrix of bool)
+0:351          'inF0' ( in 4X4 matrix of float)
 0:351      arc sine ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      arc tangent ( temp 4X4 matrix of float)
@@ -1388,13 +1402,15 @@
 0:2      'inU1' ( in uint)
 0:?     Sequence
 0:3      all ( temp bool)
-0:3        'inF0' ( in float)
+0:3        Convert float to bool ( temp bool)
+0:3          'inF0' ( in float)
 0:4      Absolute value ( temp float)
 0:4        'inF0' ( in float)
 0:5      arc cosine ( temp float)
 0:5        'inF0' ( in float)
 0:6      any ( temp bool)
-0:6        'inF0' ( in float)
+0:6        Convert float to bool ( temp bool)
+0:6          'inF0' ( in float)
 0:7      arc sine ( temp float)
 0:7        'inF0' ( in float)
 0:8      floatBitsToInt ( temp int)
@@ -1535,13 +1551,15 @@
 0:69      'inU1' ( in 2-component vector of uint)
 0:?     Sequence
 0:70      all ( temp bool)
-0:70        'inF0' ( in 2-component vector of float)
+0:70        Convert float to bool ( temp 2-component vector of bool)
+0:70          'inF0' ( in 2-component vector of float)
 0:71      Absolute value ( temp 2-component vector of float)
 0:71        'inF0' ( in 2-component vector of float)
 0:72      arc cosine ( temp 2-component vector of float)
 0:72        'inF0' ( in 2-component vector of float)
 0:73      any ( temp bool)
-0:73        'inF0' ( in 2-component vector of float)
+0:73        Convert float to bool ( temp 2-component vector of bool)
+0:73          'inF0' ( in 2-component vector of float)
 0:74      arc sine ( temp 2-component vector of float)
 0:74        'inF0' ( in 2-component vector of float)
 0:75      floatBitsToInt ( temp 2-component vector of int)
@@ -1698,13 +1716,15 @@
 0:138      'inU1' ( in 3-component vector of uint)
 0:?     Sequence
 0:139      all ( temp bool)
-0:139        'inF0' ( in 3-component vector of float)
+0:139        Convert float to bool ( temp 3-component vector of bool)
+0:139          'inF0' ( in 3-component vector of float)
 0:140      Absolute value ( temp 3-component vector of float)
 0:140        'inF0' ( in 3-component vector of float)
 0:141      arc cosine ( temp 3-component vector of float)
 0:141        'inF0' ( in 3-component vector of float)
 0:142      any ( temp bool)
-0:142        'inF0' ( in 3-component vector of float)
+0:142        Convert float to bool ( temp 3-component vector of bool)
+0:142          'inF0' ( in 3-component vector of float)
 0:143      arc sine ( temp 3-component vector of float)
 0:143        'inF0' ( in 3-component vector of float)
 0:144      floatBitsToInt ( temp 3-component vector of int)
@@ -1867,13 +1887,15 @@
 0:208      'inU1' ( in 4-component vector of uint)
 0:?     Sequence
 0:209      all ( temp bool)
-0:209        'inF0' ( in 4-component vector of float)
+0:209        Convert float to bool ( temp 4-component vector of bool)
+0:209          'inF0' ( in 4-component vector of float)
 0:210      Absolute value ( temp 4-component vector of float)
 0:210        'inF0' ( in 4-component vector of float)
 0:211      arc cosine ( temp 4-component vector of float)
 0:211        'inF0' ( in 4-component vector of float)
 0:212      any ( temp bool)
-0:212        'inF0' ( in 4-component vector of float)
+0:212        Convert float to bool ( temp 4-component vector of bool)
+0:212          'inF0' ( in 4-component vector of float)
 0:213      arc sine ( temp 4-component vector of float)
 0:213        'inF0' ( in 4-component vector of float)
 0:214      floatBitsToInt ( temp 4-component vector of int)
@@ -2054,13 +2076,15 @@
 0:331      'inF2' ( in 2X2 matrix of float)
 0:?     Sequence
 0:333      all ( temp bool)
-0:333        'inF0' ( in 2X2 matrix of float)
+0:333        Convert float to bool ( temp 2X2 matrix of bool)
+0:333          'inF0' ( in 2X2 matrix of float)
 0:333      Absolute value ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      arc cosine ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      any ( temp bool)
-0:333        'inF0' ( in 2X2 matrix of float)
+0:333        Convert float to bool ( temp 2X2 matrix of bool)
+0:333          'inF0' ( in 2X2 matrix of float)
 0:333      arc sine ( temp 2X2 matrix of float)
 0:333        'inF0' ( in 2X2 matrix of float)
 0:333      arc tangent ( temp 2X2 matrix of float)
@@ -2181,13 +2205,15 @@
 0:340      'inF2' ( in 3X3 matrix of float)
 0:?     Sequence
 0:342      all ( temp bool)
-0:342        'inF0' ( in 3X3 matrix of float)
+0:342        Convert float to bool ( temp 3X3 matrix of bool)
+0:342          'inF0' ( in 3X3 matrix of float)
 0:342      Absolute value ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      arc cosine ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      any ( temp bool)
-0:342        'inF0' ( in 3X3 matrix of float)
+0:342        Convert float to bool ( temp 3X3 matrix of bool)
+0:342          'inF0' ( in 3X3 matrix of float)
 0:342      arc sine ( temp 3X3 matrix of float)
 0:342        'inF0' ( in 3X3 matrix of float)
 0:342      arc tangent ( temp 3X3 matrix of float)
@@ -2313,13 +2339,15 @@
 0:349      'inF2' ( in 4X4 matrix of float)
 0:?     Sequence
 0:351      all ( temp bool)
-0:351        'inF0' ( in 4X4 matrix of float)
+0:351        Convert float to bool ( temp 4X4 matrix of bool)
+0:351          'inF0' ( in 4X4 matrix of float)
 0:351      Absolute value ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      arc cosine ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      any ( temp bool)
-0:351        'inF0' ( in 4X4 matrix of float)
+0:351        Convert float to bool ( temp 4X4 matrix of bool)
+0:351          'inF0' ( in 4X4 matrix of float)
 0:351      arc sine ( temp 4X4 matrix of float)
 0:351        'inF0' ( in 4X4 matrix of float)
 0:351      arc tangent ( temp 4X4 matrix of float)
@@ -2752,7 +2780,7 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 1205
+// Id's are bound by 1225
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
@@ -2831,50 +2859,50 @@
                               Name 126  "inFM3x3"
                               Name 127  "inFM3x4"
                               Name 128  "inFM2x4"
-                              Name 1029  "r0"
-                              Name 1033  "r1"
-                              Name 1037  "r2"
-                              Name 1041  "r3"
-                              Name 1045  "r4"
-                              Name 1049  "r5"
-                              Name 1053  "r6"
-                              Name 1057  "r7"
-                              Name 1061  "r8"
-                              Name 1065  "r0"
-                              Name 1069  "r1"
-                              Name 1073  "r2"
-                              Name 1077  "r3"
-                              Name 1081  "r4"
-                              Name 1085  "r5"
-                              Name 1089  "r6"
-                              Name 1093  "r7"
-                              Name 1097  "r8"
-                              Name 1101  "r0"
-                              Name 1105  "r1"
-                              Name 1109  "r2"
-                              Name 1113  "r3"
-                              Name 1117  "r4"
-                              Name 1121  "r5"
-                              Name 1125  "r6"
-                              Name 1129  "r7"
-                              Name 1133  "r8"
-                              Name 1137  "r00"
-                              Name 1141  "r01"
-                              Name 1145  "r02"
-                              Name 1149  "r03"
-                              Name 1153  "r04"
-                              Name 1157  "r05"
-                              Name 1161  "r06"
-                              Name 1165  "r07"
-                              Name 1169  "r08"
-                              Name 1173  "r09"
-                              Name 1177  "r10"
-                              Name 1181  "r11"
-                              Name 1185  "r12"
-                              Name 1189  "r13"
-                              Name 1193  "r14"
-                              Name 1197  "r15"
-                              Name 1201  "r16"
+                              Name 1049  "r0"
+                              Name 1053  "r1"
+                              Name 1057  "r2"
+                              Name 1061  "r3"
+                              Name 1065  "r4"
+                              Name 1069  "r5"
+                              Name 1073  "r6"
+                              Name 1077  "r7"
+                              Name 1081  "r8"
+                              Name 1085  "r0"
+                              Name 1089  "r1"
+                              Name 1093  "r2"
+                              Name 1097  "r3"
+                              Name 1101  "r4"
+                              Name 1105  "r5"
+                              Name 1109  "r6"
+                              Name 1113  "r7"
+                              Name 1117  "r8"
+                              Name 1121  "r0"
+                              Name 1125  "r1"
+                              Name 1129  "r2"
+                              Name 1133  "r3"
+                              Name 1137  "r4"
+                              Name 1141  "r5"
+                              Name 1145  "r6"
+                              Name 1149  "r7"
+                              Name 1153  "r8"
+                              Name 1157  "r00"
+                              Name 1161  "r01"
+                              Name 1165  "r02"
+                              Name 1169  "r03"
+                              Name 1173  "r04"
+                              Name 1177  "r05"
+                              Name 1181  "r06"
+                              Name 1185  "r07"
+                              Name 1189  "r08"
+                              Name 1193  "r09"
+                              Name 1197  "r10"
+                              Name 1201  "r11"
+                              Name 1205  "r12"
+                              Name 1209  "r13"
+                              Name 1213  "r14"
+                              Name 1217  "r15"
+                              Name 1221  "r16"
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -2920,43 +2948,49 @@
              118:             TypePointer Function 117
              119:             TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 37(ptr) 112(ptr) 114(ptr) 69(ptr) 116(ptr) 118(ptr)
              132:             TypeBool
-             143:             TypeInt 32 1
-             164:    143(int) Constant 7
-             196:    6(float) Constant 1050288283
-             211:    143(int) Constant 2
-             218:    6(float) Constant 0
-             219:    6(float) Constant 1065353216
-             261:             TypeVector 143(int) 2
-             282:    143(int) Constant 3
-             283:  261(ivec2) ConstantComposite 164 282
-             311:             TypeVector 132(bool) 2
-             349:    6(float) Constant 1073741824
-             351:    143(int) Constant 1
-             352:  261(ivec2) ConstantComposite 351 211
-             387:   24(fvec2) ConstantComposite 219 349
-             401:             TypeVector 143(int) 3
-             422:    143(int) Constant 5
-             423:  401(ivec3) ConstantComposite 164 282 422
-             454:             TypeVector 132(bool) 3
-             493:  401(ivec3) ConstantComposite 351 211 282
-             528:    6(float) Constant 1077936128
-             529:   36(fvec3) ConstantComposite 219 349 528
-             543:             TypeVector 143(int) 4
-             564:  543(ivec4) ConstantComposite 164 282 422 211
-             574:      8(int) Constant 1
-             580:      8(int) Constant 2
-             583:      8(int) Constant 3
-             605:             TypeVector 132(bool) 4
-             644:    143(int) Constant 4
-             645:  543(ivec4) ConstantComposite 351 211 282 644
-             680:    6(float) Constant 1082130432
-             681:   48(fvec4) ConstantComposite 219 349 528 680
-             792:   24(fvec2) ConstantComposite 349 349
-             793:          60 ConstantComposite 792 792
-             907:   36(fvec3) ConstantComposite 528 528 528
-             908:          68 ConstantComposite 907 907 907
-            1025:   48(fvec4) ConstantComposite 680 680 680 680
-            1026:          76 ConstantComposite 1025 1025 1025 1025
+             133:    6(float) Constant 0
+             146:             TypeInt 32 1
+             167:    146(int) Constant 7
+             199:    6(float) Constant 1050288283
+             214:    146(int) Constant 2
+             221:    6(float) Constant 1065353216
+             253:             TypeVector 132(bool) 2
+             254:   24(fvec2) ConstantComposite 133 133
+             267:             TypeVector 146(int) 2
+             288:    146(int) Constant 3
+             289:  267(ivec2) ConstantComposite 167 288
+             354:    6(float) Constant 1073741824
+             356:    146(int) Constant 1
+             357:  267(ivec2) ConstantComposite 356 214
+             392:   24(fvec2) ConstantComposite 221 354
+             396:             TypeVector 132(bool) 3
+             397:   36(fvec3) ConstantComposite 133 133 133
+             410:             TypeVector 146(int) 3
+             431:    146(int) Constant 5
+             432:  410(ivec3) ConstantComposite 167 288 431
+             501:  410(ivec3) ConstantComposite 356 214 288
+             536:    6(float) Constant 1077936128
+             537:   36(fvec3) ConstantComposite 221 354 536
+             541:             TypeVector 132(bool) 4
+             542:   48(fvec4) ConstantComposite 133 133 133 133
+             555:             TypeVector 146(int) 4
+             576:  555(ivec4) ConstantComposite 167 288 431 214
+             586:      8(int) Constant 1
+             592:      8(int) Constant 2
+             595:      8(int) Constant 3
+             655:    146(int) Constant 4
+             656:  555(ivec4) ConstantComposite 356 214 288 655
+             691:    6(float) Constant 1082130432
+             692:   48(fvec4) ConstantComposite 221 354 536 691
+             696:             TypeMatrix 253(bvec2) 2
+             806:   24(fvec2) ConstantComposite 354 354
+             807:          60 ConstantComposite 806 806
+             811:             TypeMatrix 396(bvec3) 3
+             924:   36(fvec3) ConstantComposite 536 536 536
+             925:          68 ConstantComposite 924 924 924
+             929:             TypeMatrix 541(bvec4) 4
+            1045:   48(fvec4) ConstantComposite 691 691 691 691
+            1046:          76 ConstantComposite 1045 1045 1045 1045
 4(VertexShaderFunction):           2 Function None 3
                5:             Label
                               Return
@@ -2969,123 +3003,125 @@
         15(inU1):      9(ptr) FunctionParameter
               17:             Label
              131:    6(float) Load 11(inF0)
-             133:   132(bool) All 131
-             134:    6(float) Load 11(inF0)
-             135:    6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 134
+             134:   132(bool) FOrdNotEqual 131 133
+             135:   132(bool) All 134
              136:    6(float) Load 11(inF0)
-             137:    6(float) ExtInst 1(GLSL.std.450) 17(Acos) 136
+             137:    6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 136
              138:    6(float) Load 11(inF0)
-             139:   132(bool) Any 138
+             139:    6(float) ExtInst 1(GLSL.std.450) 17(Acos) 138
              140:    6(float) Load 11(inF0)
-             141:    6(float) ExtInst 1(GLSL.std.450) 16(Asin) 140
-             142:    6(float) Load 11(inF0)
-             144:    143(int) Bitcast 142
+             141:   132(bool) FOrdNotEqual 140 133
+             142:   132(bool) Any 141
+             143:    6(float) Load 11(inF0)
+             144:    6(float) ExtInst 1(GLSL.std.450) 16(Asin) 143
              145:    6(float) Load 11(inF0)
-             146:      8(int) Bitcast 145
-             147:      8(int) Load 14(inU0)
-             148:    6(float) Bitcast 147
-             149:    6(float) Load 11(inF0)
-             150:    6(float) ExtInst 1(GLSL.std.450) 18(Atan) 149
-             151:    6(float) Load 11(inF0)
-             152:    6(float) Load 12(inF1)
-             153:    6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 151 152
+             147:    146(int) Bitcast 145
+             148:    6(float) Load 11(inF0)
+             149:      8(int) Bitcast 148
+             150:      8(int) Load 14(inU0)
+             151:    6(float) Bitcast 150
+             152:    6(float) Load 11(inF0)
+             153:    6(float) ExtInst 1(GLSL.std.450) 18(Atan) 152
              154:    6(float) Load 11(inF0)
-             155:    6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 154
-             156:    6(float) Load 11(inF0)
-             157:    6(float) Load 12(inF1)
-             158:    6(float) Load 13(inF2)
-             159:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 156 157 158
-             160:    6(float) Load 11(inF0)
-             161:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 160
-             162:    6(float) Load 11(inF0)
-             163:    6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 162
-             165:    143(int) BitCount 164
-             166:    6(float) Load 11(inF0)
-             167:    6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 166
-             168:    6(float) Load 11(inF0)
-             169:    6(float) ExtInst 1(GLSL.std.450) 27(Exp) 168
-             170:    6(float) Load 11(inF0)
-             171:    6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 170
-             172:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             173:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
-             174:    6(float) Load 11(inF0)
-             175:    6(float) ExtInst 1(GLSL.std.450) 8(Floor) 174
-             176:    6(float) Load 11(inF0)
-             177:    6(float) Load 12(inF1)
-             178:    6(float) FMod 176 177
+             155:    6(float) Load 12(inF1)
+             156:    6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 154 155
+             157:    6(float) Load 11(inF0)
+             158:    6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 157
+             159:    6(float) Load 11(inF0)
+             160:    6(float) Load 12(inF1)
+             161:    6(float) Load 13(inF2)
+             162:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 159 160 161
+             163:    6(float) Load 11(inF0)
+             164:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 163
+             165:    6(float) Load 11(inF0)
+             166:    6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 165
+             168:    146(int) BitCount 167
+             169:    6(float) Load 11(inF0)
+             170:    6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 169
+             171:    6(float) Load 11(inF0)
+             172:    6(float) ExtInst 1(GLSL.std.450) 27(Exp) 171
+             173:    6(float) Load 11(inF0)
+             174:    6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 173
+             175:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             176:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             177:    6(float) Load 11(inF0)
+             178:    6(float) ExtInst 1(GLSL.std.450) 8(Floor) 177
              179:    6(float) Load 11(inF0)
-             180:    6(float) ExtInst 1(GLSL.std.450) 10(Fract) 179
-             181:    6(float) Load 11(inF0)
-             182:   132(bool) IsInf 181
-             183:    6(float) Load 11(inF0)
-             184:   132(bool) IsNan 183
-             185:    6(float) Load 11(inF0)
-             186:    6(float) Load 12(inF1)
-             187:    6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 185 186
+             180:    6(float) Load 12(inF1)
+             181:    6(float) FMod 179 180
+             182:    6(float) Load 11(inF0)
+             183:    6(float) ExtInst 1(GLSL.std.450) 10(Fract) 182
+             184:    6(float) Load 11(inF0)
+             185:   132(bool) IsInf 184
+             186:    6(float) Load 11(inF0)
+             187:   132(bool) IsNan 186
              188:    6(float) Load 11(inF0)
              189:    6(float) Load 12(inF1)
-             190:    6(float) Load 13(inF2)
-             191:    6(float) ExtInst 1(GLSL.std.450) 46(FMix) 188 189 190
-             192:    6(float) Load 11(inF0)
-             193:    6(float) ExtInst 1(GLSL.std.450) 28(Log) 192
-             194:    6(float) Load 11(inF0)
-             195:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 194
-             197:    6(float) FMul 195 196
-             198:    6(float) Load 11(inF0)
-             199:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 198
-             200:    6(float) Load 11(inF0)
-             201:    6(float) Load 12(inF1)
-             202:    6(float) ExtInst 1(GLSL.std.450) 40(FMax) 200 201
+             190:    6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 188 189
+             191:    6(float) Load 11(inF0)
+             192:    6(float) Load 12(inF1)
+             193:    6(float) Load 13(inF2)
+             194:    6(float) ExtInst 1(GLSL.std.450) 46(FMix) 191 192 193
+             195:    6(float) Load 11(inF0)
+             196:    6(float) ExtInst 1(GLSL.std.450) 28(Log) 195
+             197:    6(float) Load 11(inF0)
+             198:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 197
+             200:    6(float) FMul 198 199
+             201:    6(float) Load 11(inF0)
+             202:    6(float) ExtInst 1(GLSL.std.450) 30(Log2) 201
              203:    6(float) Load 11(inF0)
              204:    6(float) Load 12(inF1)
-             205:    6(float) ExtInst 1(GLSL.std.450) 37(FMin) 203 204
+             205:    6(float) ExtInst 1(GLSL.std.450) 40(FMax) 203 204
              206:    6(float) Load 11(inF0)
              207:    6(float) Load 12(inF1)
-             208:    6(float) ExtInst 1(GLSL.std.450) 26(Pow) 206 207
+             208:    6(float) ExtInst 1(GLSL.std.450) 37(FMin) 206 207
              209:    6(float) Load 11(inF0)
-             210:    6(float) ExtInst 1(GLSL.std.450) 11(Radians) 209
-             212:    143(int) BitReverse 211
-             213:    6(float) Load 11(inF0)
-             214:    6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 213
-             215:    6(float) Load 11(inF0)
-             216:    6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 215
-             217:    6(float) Load 11(inF0)
-             220:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 217 218 219
-             221:    6(float) Load 11(inF0)
-             222:    6(float) ExtInst 1(GLSL.std.450) 6(FSign) 221
+             210:    6(float) Load 12(inF1)
+             211:    6(float) ExtInst 1(GLSL.std.450) 26(Pow) 209 210
+             212:    6(float) Load 11(inF0)
+             213:    6(float) ExtInst 1(GLSL.std.450) 11(Radians) 212
+             215:    146(int) BitReverse 214
+             216:    6(float) Load 11(inF0)
+             217:    6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 216
+             218:    6(float) Load 11(inF0)
+             219:    6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 218
+             220:    6(float) Load 11(inF0)
+             222:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 220 133 221
              223:    6(float) Load 11(inF0)
-             224:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 223
+             224:    6(float) ExtInst 1(GLSL.std.450) 6(FSign) 223
              225:    6(float) Load 11(inF0)
              226:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 225
-                              Store 12(inF1) 226
              227:    6(float) Load 11(inF0)
-             228:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 227
-                              Store 13(inF2) 228
+             228:    6(float) ExtInst 1(GLSL.std.450) 13(Sin) 227
+                              Store 12(inF1) 228
              229:    6(float) Load 11(inF0)
-             230:    6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 229
+             230:    6(float) ExtInst 1(GLSL.std.450) 14(Cos) 229
+                              Store 13(inF2) 230
              231:    6(float) Load 11(inF0)
-             232:    6(float) Load 12(inF1)
-             233:    6(float) Load 13(inF2)
-             234:    6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 231 232 233
-             235:    6(float) Load 11(inF0)
-             236:    6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 235
+             232:    6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 231
+             233:    6(float) Load 11(inF0)
+             234:    6(float) Load 12(inF1)
+             235:    6(float) Load 13(inF2)
+             236:    6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 233 234 235
              237:    6(float) Load 11(inF0)
-             238:    6(float) Load 12(inF1)
-             239:    6(float) ExtInst 1(GLSL.std.450) 48(Step) 237 238
-             240:    6(float) Load 11(inF0)
-             241:    6(float) ExtInst 1(GLSL.std.450) 15(Tan) 240
+             238:    6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 237
+             239:    6(float) Load 11(inF0)
+             240:    6(float) Load 12(inF1)
+             241:    6(float) ExtInst 1(GLSL.std.450) 48(Step) 239 240
              242:    6(float) Load 11(inF0)
-             243:    6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 242
+             243:    6(float) ExtInst 1(GLSL.std.450) 15(Tan) 242
              244:    6(float) Load 11(inF0)
-             245:    6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 244
-                              ReturnValue 218
+             245:    6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 244
+             246:    6(float) Load 11(inF0)
+             247:    6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 246
+                              ReturnValue 133
                               FunctionEnd
 22(VertexShaderFunction1(vf1;vf1;vf1;):    6(float) Function None 18
         19(inF0):      7(ptr) FunctionParameter
         20(inF1):      7(ptr) FunctionParameter
         21(inF2):      7(ptr) FunctionParameter
               23:             Label
-                              ReturnValue 218
+                              ReturnValue 133
                               FunctionEnd
 34(VertexShaderFunction2(vf2;vf2;vf2;vu2;vu2;):   24(fvec2) Function None 28
         29(inF0):     25(ptr) FunctionParameter
@@ -3094,139 +3130,141 @@
         32(inU0):     27(ptr) FunctionParameter
         33(inU1):     27(ptr) FunctionParameter
               35:             Label
-             250:   24(fvec2) Load 29(inF0)
-             251:   132(bool) All 250
              252:   24(fvec2) Load 29(inF0)
-             253:   24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 252
-             254:   24(fvec2) Load 29(inF0)
-             255:   24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 254
-             256:   24(fvec2) Load 29(inF0)
-             257:   132(bool) Any 256
-             258:   24(fvec2) Load 29(inF0)
-             259:   24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 258
-             260:   24(fvec2) Load 29(inF0)
-             262:  261(ivec2) Bitcast 260
-             263:   24(fvec2) Load 29(inF0)
-             264:   26(ivec2) Bitcast 263
-             265:   26(ivec2) Load 32(inU0)
-             266:   24(fvec2) Bitcast 265
-             267:   24(fvec2) Load 29(inF0)
-             268:   24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 267
+             255:  253(bvec2) FOrdNotEqual 252 254
+             256:   132(bool) All 255
+             257:   24(fvec2) Load 29(inF0)
+             258:   24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 257
+             259:   24(fvec2) Load 29(inF0)
+             260:   24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 259
+             261:   24(fvec2) Load 29(inF0)
+             262:  253(bvec2) FOrdNotEqual 261 254
+             263:   132(bool) Any 262
+             264:   24(fvec2) Load 29(inF0)
+             265:   24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 264
+             266:   24(fvec2) Load 29(inF0)
+             268:  267(ivec2) Bitcast 266
              269:   24(fvec2) Load 29(inF0)
-             270:   24(fvec2) Load 30(inF1)
-             271:   24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 269 270
-             272:   24(fvec2) Load 29(inF0)
-             273:   24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 272
-             274:   24(fvec2) Load 29(inF0)
-             275:   24(fvec2) Load 30(inF1)
-             276:   24(fvec2) Load 31(inF2)
-             277:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 274 275 276
+             270:   26(ivec2) Bitcast 269
+             271:   26(ivec2) Load 32(inU0)
+             272:   24(fvec2) Bitcast 271
+             273:   24(fvec2) Load 29(inF0)
+             274:   24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 273
+             275:   24(fvec2) Load 29(inF0)
+             276:   24(fvec2) Load 30(inF1)
+             277:   24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 275 276
              278:   24(fvec2) Load 29(inF0)
-             279:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 278
+             279:   24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 278
              280:   24(fvec2) Load 29(inF0)
-             281:   24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 280
-             284:  261(ivec2) BitCount 283
-             285:   24(fvec2) Load 29(inF0)
-             286:   24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 285
-             287:   24(fvec2) Load 29(inF0)
-             288:   24(fvec2) Load 30(inF1)
-             289:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 287 288
-             290:   24(fvec2) Load 29(inF0)
-             291:   24(fvec2) Load 30(inF1)
-             292:    6(float) Dot 290 291
+             281:   24(fvec2) Load 30(inF1)
+             282:   24(fvec2) Load 31(inF2)
+             283:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 280 281 282
+             284:   24(fvec2) Load 29(inF0)
+             285:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 284
+             286:   24(fvec2) Load 29(inF0)
+             287:   24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 286
+             290:  267(ivec2) BitCount 289
+             291:   24(fvec2) Load 29(inF0)
+             292:   24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 291
              293:   24(fvec2) Load 29(inF0)
-             294:   24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 293
-             295:   24(fvec2) Load 29(inF0)
-             296:   24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 295
-             297:   24(fvec2) Load 29(inF0)
-             298:   24(fvec2) Load 30(inF1)
-             299:   24(fvec2) Load 31(inF2)
-             300:   24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 297 298 299
-             301:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             302:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
+             294:   24(fvec2) Load 30(inF1)
+             295:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 293 294
+             296:   24(fvec2) Load 29(inF0)
+             297:   24(fvec2) Load 30(inF1)
+             298:    6(float) Dot 296 297
+             299:   24(fvec2) Load 29(inF0)
+             300:   24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 299
+             301:   24(fvec2) Load 29(inF0)
+             302:   24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 301
              303:   24(fvec2) Load 29(inF0)
-             304:   24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 303
-             305:   24(fvec2) Load 29(inF0)
-             306:   24(fvec2) Load 30(inF1)
-             307:   24(fvec2) FMod 305 306
-             308:   24(fvec2) Load 29(inF0)
-             309:   24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 308
-             310:   24(fvec2) Load 29(inF0)
-             312:  311(bvec2) IsInf 310
-             313:   24(fvec2) Load 29(inF0)
-             314:  311(bvec2) IsNan 313
-             315:   24(fvec2) Load 29(inF0)
-             316:   24(fvec2) Load 30(inF1)
-             317:   24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 315 316
+             304:   24(fvec2) Load 30(inF1)
+             305:   24(fvec2) Load 31(inF2)
+             306:   24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 303 304 305
+             307:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             308:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             309:   24(fvec2) Load 29(inF0)
+             310:   24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 309
+             311:   24(fvec2) Load 29(inF0)
+             312:   24(fvec2) Load 30(inF1)
+             313:   24(fvec2) FMod 311 312
+             314:   24(fvec2) Load 29(inF0)
+             315:   24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 314
+             316:   24(fvec2) Load 29(inF0)
+             317:  253(bvec2) IsInf 316
              318:   24(fvec2) Load 29(inF0)
-             319:   24(fvec2) Load 30(inF1)
-             320:   24(fvec2) Load 31(inF2)
-             321:   24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 318 319 320
-             322:   24(fvec2) Load 29(inF0)
-             323:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 322
-             324:   24(fvec2) Load 29(inF0)
-             325:   24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 324
-             326:   24(fvec2) Load 29(inF0)
-             327:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 326
-             328:   24(fvec2) VectorTimesScalar 327 196
+             319:  253(bvec2) IsNan 318
+             320:   24(fvec2) Load 29(inF0)
+             321:   24(fvec2) Load 30(inF1)
+             322:   24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 320 321
+             323:   24(fvec2) Load 29(inF0)
+             324:   24(fvec2) Load 30(inF1)
+             325:   24(fvec2) Load 31(inF2)
+             326:   24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 323 324 325
+             327:   24(fvec2) Load 29(inF0)
+             328:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 327
              329:   24(fvec2) Load 29(inF0)
-             330:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 329
+             330:   24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 329
              331:   24(fvec2) Load 29(inF0)
-             332:   24(fvec2) Load 30(inF1)
-             333:   24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 331 332
+             332:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 331
+             333:   24(fvec2) VectorTimesScalar 332 199
              334:   24(fvec2) Load 29(inF0)
-             335:   24(fvec2) Load 30(inF1)
-             336:   24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 334 335
-             337:   24(fvec2) Load 29(inF0)
-             338:   24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 337
+             335:   24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 334
+             336:   24(fvec2) Load 29(inF0)
+             337:   24(fvec2) Load 30(inF1)
+             338:   24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 336 337
              339:   24(fvec2) Load 29(inF0)
              340:   24(fvec2) Load 30(inF1)
-             341:   24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 339 340
+             341:   24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 339 340
              342:   24(fvec2) Load 29(inF0)
-             343:   24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 342
+             343:   24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 342
              344:   24(fvec2) Load 29(inF0)
              345:   24(fvec2) Load 30(inF1)
-             346:   24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 344 345
+             346:   24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 344 345
              347:   24(fvec2) Load 29(inF0)
-             348:   24(fvec2) Load 30(inF1)
-             350:   24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 347 348 349
-             353:  261(ivec2) BitReverse 352
-             354:   24(fvec2) Load 29(inF0)
-             355:   24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 354
-             356:   24(fvec2) Load 29(inF0)
-             357:   24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 356
-             358:   24(fvec2) Load 29(inF0)
-             359:   24(fvec2) CompositeConstruct 218 218
-             360:   24(fvec2) CompositeConstruct 219 219
-             361:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 358 359 360
-             362:   24(fvec2) Load 29(inF0)
-             363:   24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 362
-             364:   24(fvec2) Load 29(inF0)
-             365:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 364
-             366:   24(fvec2) Load 29(inF0)
-             367:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 366
-                              Store 30(inF1) 367
-             368:   24(fvec2) Load 29(inF0)
-             369:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 368
-                              Store 31(inF2) 369
-             370:   24(fvec2) Load 29(inF0)
-             371:   24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 370
-             372:   24(fvec2) Load 29(inF0)
-             373:   24(fvec2) Load 30(inF1)
-             374:   24(fvec2) Load 31(inF2)
-             375:   24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 372 373 374
-             376:   24(fvec2) Load 29(inF0)
-             377:   24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 376
-             378:   24(fvec2) Load 29(inF0)
-             379:   24(fvec2) Load 30(inF1)
-             380:   24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 378 379
+             348:   24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 347
+             349:   24(fvec2) Load 29(inF0)
+             350:   24(fvec2) Load 30(inF1)
+             351:   24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 349 350
+             352:   24(fvec2) Load 29(inF0)
+             353:   24(fvec2) Load 30(inF1)
+             355:   24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 352 353 354
+             358:  267(ivec2) BitReverse 357
+             359:   24(fvec2) Load 29(inF0)
+             360:   24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 359
+             361:   24(fvec2) Load 29(inF0)
+             362:   24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 361
+             363:   24(fvec2) Load 29(inF0)
+             364:   24(fvec2) CompositeConstruct 133 133
+             365:   24(fvec2) CompositeConstruct 221 221
+             366:   24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 363 364 365
+             367:   24(fvec2) Load 29(inF0)
+             368:   24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 367
+             369:   24(fvec2) Load 29(inF0)
+             370:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 369
+             371:   24(fvec2) Load 29(inF0)
+             372:   24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 371
+                              Store 30(inF1) 372
+             373:   24(fvec2) Load 29(inF0)
+             374:   24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 373
+                              Store 31(inF2) 374
+             375:   24(fvec2) Load 29(inF0)
+             376:   24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 375
+             377:   24(fvec2) Load 29(inF0)
+             378:   24(fvec2) Load 30(inF1)
+             379:   24(fvec2) Load 31(inF2)
+             380:   24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 377 378 379
              381:   24(fvec2) Load 29(inF0)
-             382:   24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 381
+             382:   24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 381
              383:   24(fvec2) Load 29(inF0)
-             384:   24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 383
-             385:   24(fvec2) Load 29(inF0)
-             386:   24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 385
-                              ReturnValue 387
+             384:   24(fvec2) Load 30(inF1)
+             385:   24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 383 384
+             386:   24(fvec2) Load 29(inF0)
+             387:   24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 386
+             388:   24(fvec2) Load 29(inF0)
+             389:   24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 388
+             390:   24(fvec2) Load 29(inF0)
+             391:   24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 390
+                              ReturnValue 392
                               FunctionEnd
 46(VertexShaderFunction3(vf3;vf3;vf3;vu3;vu3;):   36(fvec3) Function None 40
         41(inF0):     37(ptr) FunctionParameter
@@ -3235,142 +3273,144 @@
         44(inU0):     39(ptr) FunctionParameter
         45(inU1):     39(ptr) FunctionParameter
               47:             Label
-             390:   36(fvec3) Load 41(inF0)
-             391:   132(bool) All 390
-             392:   36(fvec3) Load 41(inF0)
-             393:   36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 392
-             394:   36(fvec3) Load 41(inF0)
-             395:   36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 394
-             396:   36(fvec3) Load 41(inF0)
-             397:   132(bool) Any 396
-             398:   36(fvec3) Load 41(inF0)
-             399:   36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 398
+             395:   36(fvec3) Load 41(inF0)
+             398:  396(bvec3) FOrdNotEqual 395 397
+             399:   132(bool) All 398
              400:   36(fvec3) Load 41(inF0)
-             402:  401(ivec3) Bitcast 400
-             403:   36(fvec3) Load 41(inF0)
-             404:   38(ivec3) Bitcast 403
-             405:   38(ivec3) Load 44(inU0)
-             406:   36(fvec3) Bitcast 405
+             401:   36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 400
+             402:   36(fvec3) Load 41(inF0)
+             403:   36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 402
+             404:   36(fvec3) Load 41(inF0)
+             405:  396(bvec3) FOrdNotEqual 404 397
+             406:   132(bool) Any 405
              407:   36(fvec3) Load 41(inF0)
-             408:   36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 407
+             408:   36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 407
              409:   36(fvec3) Load 41(inF0)
-             410:   36(fvec3) Load 42(inF1)
-             411:   36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 409 410
+             411:  410(ivec3) Bitcast 409
              412:   36(fvec3) Load 41(inF0)
-             413:   36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 412
-             414:   36(fvec3) Load 41(inF0)
-             415:   36(fvec3) Load 42(inF1)
-             416:   36(fvec3) Load 43(inF2)
-             417:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 414 415 416
+             413:   38(ivec3) Bitcast 412
+             414:   38(ivec3) Load 44(inU0)
+             415:   36(fvec3) Bitcast 414
+             416:   36(fvec3) Load 41(inF0)
+             417:   36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 416
              418:   36(fvec3) Load 41(inF0)
-             419:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 418
-             420:   36(fvec3) Load 41(inF0)
-             421:   36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 420
-             424:  401(ivec3) BitCount 423
-             425:   36(fvec3) Load 41(inF0)
-             426:   36(fvec3) Load 42(inF1)
-             427:   36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 425 426
-             428:   36(fvec3) Load 41(inF0)
-             429:   36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 428
-             430:   36(fvec3) Load 41(inF0)
-             431:   36(fvec3) Load 42(inF1)
-             432:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 430 431
-             433:   36(fvec3) Load 41(inF0)
-             434:   36(fvec3) Load 42(inF1)
-             435:    6(float) Dot 433 434
-             436:   36(fvec3) Load 41(inF0)
-             437:   36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 436
-             438:   36(fvec3) Load 41(inF0)
-             439:   36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 438
-             440:   36(fvec3) Load 41(inF0)
-             441:   36(fvec3) Load 42(inF1)
-             442:   36(fvec3) Load 43(inF2)
-             443:   36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 440 441 442
-             444:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             445:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
-             446:   36(fvec3) Load 41(inF0)
-             447:   36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 446
-             448:   36(fvec3) Load 41(inF0)
-             449:   36(fvec3) Load 42(inF1)
-             450:   36(fvec3) FMod 448 449
-             451:   36(fvec3) Load 41(inF0)
-             452:   36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 451
-             453:   36(fvec3) Load 41(inF0)
-             455:  454(bvec3) IsInf 453
-             456:   36(fvec3) Load 41(inF0)
-             457:  454(bvec3) IsNan 456
-             458:   36(fvec3) Load 41(inF0)
-             459:   36(fvec3) Load 42(inF1)
-             460:   36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 458 459
-             461:   36(fvec3) Load 41(inF0)
-             462:   36(fvec3) Load 42(inF1)
-             463:   36(fvec3) Load 43(inF2)
-             464:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 461 462 463
-             465:   36(fvec3) Load 41(inF0)
-             466:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 465
-             467:   36(fvec3) Load 41(inF0)
-             468:   36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 467
+             419:   36(fvec3) Load 42(inF1)
+             420:   36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 418 419
+             421:   36(fvec3) Load 41(inF0)
+             422:   36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 421
+             423:   36(fvec3) Load 41(inF0)
+             424:   36(fvec3) Load 42(inF1)
+             425:   36(fvec3) Load 43(inF2)
+             426:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 423 424 425
+             427:   36(fvec3) Load 41(inF0)
+             428:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 427
+             429:   36(fvec3) Load 41(inF0)
+             430:   36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 429
+             433:  410(ivec3) BitCount 432
+             434:   36(fvec3) Load 41(inF0)
+             435:   36(fvec3) Load 42(inF1)
+             436:   36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 434 435
+             437:   36(fvec3) Load 41(inF0)
+             438:   36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 437
+             439:   36(fvec3) Load 41(inF0)
+             440:   36(fvec3) Load 42(inF1)
+             441:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 439 440
+             442:   36(fvec3) Load 41(inF0)
+             443:   36(fvec3) Load 42(inF1)
+             444:    6(float) Dot 442 443
+             445:   36(fvec3) Load 41(inF0)
+             446:   36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 445
+             447:   36(fvec3) Load 41(inF0)
+             448:   36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 447
+             449:   36(fvec3) Load 41(inF0)
+             450:   36(fvec3) Load 42(inF1)
+             451:   36(fvec3) Load 43(inF2)
+             452:   36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 449 450 451
+             453:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             454:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             455:   36(fvec3) Load 41(inF0)
+             456:   36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 455
+             457:   36(fvec3) Load 41(inF0)
+             458:   36(fvec3) Load 42(inF1)
+             459:   36(fvec3) FMod 457 458
+             460:   36(fvec3) Load 41(inF0)
+             461:   36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 460
+             462:   36(fvec3) Load 41(inF0)
+             463:  396(bvec3) IsInf 462
+             464:   36(fvec3) Load 41(inF0)
+             465:  396(bvec3) IsNan 464
+             466:   36(fvec3) Load 41(inF0)
+             467:   36(fvec3) Load 42(inF1)
+             468:   36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 466 467
              469:   36(fvec3) Load 41(inF0)
-             470:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 469
-             471:   36(fvec3) VectorTimesScalar 470 196
-             472:   36(fvec3) Load 41(inF0)
-             473:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 472
-             474:   36(fvec3) Load 41(inF0)
-             475:   36(fvec3) Load 42(inF1)
-             476:   36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 474 475
+             470:   36(fvec3) Load 42(inF1)
+             471:   36(fvec3) Load 43(inF2)
+             472:   36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 469 470 471
+             473:   36(fvec3) Load 41(inF0)
+             474:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 473
+             475:   36(fvec3) Load 41(inF0)
+             476:   36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 475
              477:   36(fvec3) Load 41(inF0)
-             478:   36(fvec3) Load 42(inF1)
-             479:   36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 477 478
+             478:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 477
+             479:   36(fvec3) VectorTimesScalar 478 199
              480:   36(fvec3) Load 41(inF0)
-             481:   36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 480
+             481:   36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 480
              482:   36(fvec3) Load 41(inF0)
              483:   36(fvec3) Load 42(inF1)
-             484:   36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 482 483
+             484:   36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 482 483
              485:   36(fvec3) Load 41(inF0)
-             486:   36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 485
-             487:   36(fvec3) Load 41(inF0)
-             488:   36(fvec3) Load 42(inF1)
-             489:   36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 487 488
+             486:   36(fvec3) Load 42(inF1)
+             487:   36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 485 486
+             488:   36(fvec3) Load 41(inF0)
+             489:   36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 488
              490:   36(fvec3) Load 41(inF0)
              491:   36(fvec3) Load 42(inF1)
-             492:   36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 490 491 349
-             494:  401(ivec3) BitReverse 493
+             492:   36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 490 491
+             493:   36(fvec3) Load 41(inF0)
+             494:   36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 493
              495:   36(fvec3) Load 41(inF0)
-             496:   36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 495
-             497:   36(fvec3) Load 41(inF0)
-             498:   36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 497
-             499:   36(fvec3) Load 41(inF0)
-             500:   36(fvec3) CompositeConstruct 218 218 218
-             501:   36(fvec3) CompositeConstruct 219 219 219
-             502:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 499 500 501
+             496:   36(fvec3) Load 42(inF1)
+             497:   36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 495 496
+             498:   36(fvec3) Load 41(inF0)
+             499:   36(fvec3) Load 42(inF1)
+             500:   36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 498 499 354
+             502:  410(ivec3) BitReverse 501
              503:   36(fvec3) Load 41(inF0)
-             504:   36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 503
+             504:   36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 503
              505:   36(fvec3) Load 41(inF0)
-             506:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 505
+             506:   36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 505
              507:   36(fvec3) Load 41(inF0)
-             508:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 507
-                              Store 42(inF1) 508
-             509:   36(fvec3) Load 41(inF0)
-             510:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 509
-                              Store 43(inF2) 510
+             508:   36(fvec3) CompositeConstruct 133 133 133
+             509:   36(fvec3) CompositeConstruct 221 221 221
+             510:   36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 507 508 509
              511:   36(fvec3) Load 41(inF0)
-             512:   36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 511
+             512:   36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 511
              513:   36(fvec3) Load 41(inF0)
-             514:   36(fvec3) Load 42(inF1)
-             515:   36(fvec3) Load 43(inF2)
-             516:   36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 513 514 515
+             514:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 513
+             515:   36(fvec3) Load 41(inF0)
+             516:   36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 515
+                              Store 42(inF1) 516
              517:   36(fvec3) Load 41(inF0)
-             518:   36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 517
+             518:   36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 517
+                              Store 43(inF2) 518
              519:   36(fvec3) Load 41(inF0)
-             520:   36(fvec3) Load 42(inF1)
-             521:   36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 519 520
-             522:   36(fvec3) Load 41(inF0)
-             523:   36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 522
-             524:   36(fvec3) Load 41(inF0)
-             525:   36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 524
-             526:   36(fvec3) Load 41(inF0)
-             527:   36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 526
-                              ReturnValue 529
+             520:   36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 519
+             521:   36(fvec3) Load 41(inF0)
+             522:   36(fvec3) Load 42(inF1)
+             523:   36(fvec3) Load 43(inF2)
+             524:   36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 521 522 523
+             525:   36(fvec3) Load 41(inF0)
+             526:   36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 525
+             527:   36(fvec3) Load 41(inF0)
+             528:   36(fvec3) Load 42(inF1)
+             529:   36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 527 528
+             530:   36(fvec3) Load 41(inF0)
+             531:   36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 530
+             532:   36(fvec3) Load 41(inF0)
+             533:   36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 532
+             534:   36(fvec3) Load 41(inF0)
+             535:   36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 534
+                              ReturnValue 537
                               FunctionEnd
 58(VertexShaderFunction4(vf4;vf4;vf4;vu4;vu4;):   48(fvec4) Function None 52
         53(inF0):     49(ptr) FunctionParameter
@@ -3379,509 +3419,517 @@
         56(inU0):     51(ptr) FunctionParameter
         57(inU1):     51(ptr) FunctionParameter
               59:             Label
-             532:   48(fvec4) Load 53(inF0)
-             533:   132(bool) All 532
-             534:   48(fvec4) Load 53(inF0)
-             535:   48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 534
-             536:   48(fvec4) Load 53(inF0)
-             537:   48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 536
-             538:   48(fvec4) Load 53(inF0)
-             539:   132(bool) Any 538
              540:   48(fvec4) Load 53(inF0)
-             541:   48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 540
-             542:   48(fvec4) Load 53(inF0)
-             544:  543(ivec4) Bitcast 542
+             543:  541(bvec4) FOrdNotEqual 540 542
+             544:   132(bool) All 543
              545:   48(fvec4) Load 53(inF0)
-             546:   50(ivec4) Bitcast 545
-             547:   50(ivec4) Load 56(inU0)
-             548:   48(fvec4) Bitcast 547
+             546:   48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 545
+             547:   48(fvec4) Load 53(inF0)
+             548:   48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 547
              549:   48(fvec4) Load 53(inF0)
-             550:   48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 549
-             551:   48(fvec4) Load 53(inF0)
-             552:   48(fvec4) Load 54(inF1)
-             553:   48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 551 552
+             550:  541(bvec4) FOrdNotEqual 549 542
+             551:   132(bool) Any 550
+             552:   48(fvec4) Load 53(inF0)
+             553:   48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 552
              554:   48(fvec4) Load 53(inF0)
-             555:   48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 554
-             556:   48(fvec4) Load 53(inF0)
-             557:   48(fvec4) Load 54(inF1)
-             558:   48(fvec4) Load 55(inF2)
-             559:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 556 557 558
-             560:   48(fvec4) Load 53(inF0)
-             561:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 560
-             562:   48(fvec4) Load 53(inF0)
-             563:   48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 562
-             565:  543(ivec4) BitCount 564
+             556:  555(ivec4) Bitcast 554
+             557:   48(fvec4) Load 53(inF0)
+             558:   50(ivec4) Bitcast 557
+             559:   50(ivec4) Load 56(inU0)
+             560:   48(fvec4) Bitcast 559
+             561:   48(fvec4) Load 53(inF0)
+             562:   48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 561
+             563:   48(fvec4) Load 53(inF0)
+             564:   48(fvec4) Load 54(inF1)
+             565:   48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 563 564
              566:   48(fvec4) Load 53(inF0)
-             567:   48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 566
+             567:   48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 566
              568:   48(fvec4) Load 53(inF0)
              569:   48(fvec4) Load 54(inF1)
-             570:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 568 569
-             571:   48(fvec4) Load 53(inF0)
-             572:   48(fvec4) Load 54(inF1)
-             573:    6(float) Dot 571 572
-             575:      7(ptr) AccessChain 53(inF0) 574
-             576:    6(float) Load 575
-             577:      7(ptr) AccessChain 54(inF1) 574
-             578:    6(float) Load 577
-             579:    6(float) FMul 576 578
-             581:      7(ptr) AccessChain 53(inF0) 580
-             582:    6(float) Load 581
-             584:      7(ptr) AccessChain 54(inF1) 583
-             585:    6(float) Load 584
-             586:   48(fvec4) CompositeConstruct 219 579 582 585
-             587:   48(fvec4) Load 53(inF0)
-             588:   48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 587
-             589:   48(fvec4) Load 53(inF0)
-             590:   48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 589
-             591:   48(fvec4) Load 53(inF0)
-             592:   48(fvec4) Load 54(inF1)
-             593:   48(fvec4) Load 55(inF2)
-             594:   48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 591 592 593
-             595:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             596:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
-             597:   48(fvec4) Load 53(inF0)
-             598:   48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 597
+             570:   48(fvec4) Load 55(inF2)
+             571:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 568 569 570
+             572:   48(fvec4) Load 53(inF0)
+             573:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 572
+             574:   48(fvec4) Load 53(inF0)
+             575:   48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 574
+             577:  555(ivec4) BitCount 576
+             578:   48(fvec4) Load 53(inF0)
+             579:   48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 578
+             580:   48(fvec4) Load 53(inF0)
+             581:   48(fvec4) Load 54(inF1)
+             582:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 580 581
+             583:   48(fvec4) Load 53(inF0)
+             584:   48(fvec4) Load 54(inF1)
+             585:    6(float) Dot 583 584
+             587:      7(ptr) AccessChain 53(inF0) 586
+             588:    6(float) Load 587
+             589:      7(ptr) AccessChain 54(inF1) 586
+             590:    6(float) Load 589
+             591:    6(float) FMul 588 590
+             593:      7(ptr) AccessChain 53(inF0) 592
+             594:    6(float) Load 593
+             596:      7(ptr) AccessChain 54(inF1) 595
+             597:    6(float) Load 596
+             598:   48(fvec4) CompositeConstruct 221 591 594 597
              599:   48(fvec4) Load 53(inF0)
-             600:   48(fvec4) Load 54(inF1)
-             601:   48(fvec4) FMod 599 600
-             602:   48(fvec4) Load 53(inF0)
-             603:   48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 602
-             604:   48(fvec4) Load 53(inF0)
-             606:  605(bvec4) IsInf 604
-             607:   48(fvec4) Load 53(inF0)
-             608:  605(bvec4) IsNan 607
+             600:   48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 599
+             601:   48(fvec4) Load 53(inF0)
+             602:   48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 601
+             603:   48(fvec4) Load 53(inF0)
+             604:   48(fvec4) Load 54(inF1)
+             605:   48(fvec4) Load 55(inF2)
+             606:   48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 603 604 605
+             607:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             608:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
              609:   48(fvec4) Load 53(inF0)
-             610:   48(fvec4) Load 54(inF1)
-             611:   48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 609 610
-             612:   48(fvec4) Load 53(inF0)
-             613:   48(fvec4) Load 54(inF1)
-             614:   48(fvec4) Load 55(inF2)
-             615:   48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 612 613 614
+             610:   48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 609
+             611:   48(fvec4) Load 53(inF0)
+             612:   48(fvec4) Load 54(inF1)
+             613:   48(fvec4) FMod 611 612
+             614:   48(fvec4) Load 53(inF0)
+             615:   48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 614
              616:   48(fvec4) Load 53(inF0)
-             617:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 616
+             617:  541(bvec4) IsInf 616
              618:   48(fvec4) Load 53(inF0)
-             619:   48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 618
+             619:  541(bvec4) IsNan 618
              620:   48(fvec4) Load 53(inF0)
-             621:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 620
-             622:   48(fvec4) VectorTimesScalar 621 196
+             621:   48(fvec4) Load 54(inF1)
+             622:   48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 620 621
              623:   48(fvec4) Load 53(inF0)
-             624:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 623
-             625:   48(fvec4) Load 53(inF0)
-             626:   48(fvec4) Load 54(inF1)
-             627:   48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 625 626
-             628:   48(fvec4) Load 53(inF0)
-             629:   48(fvec4) Load 54(inF1)
-             630:   48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 628 629
+             624:   48(fvec4) Load 54(inF1)
+             625:   48(fvec4) Load 55(inF2)
+             626:   48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 623 624 625
+             627:   48(fvec4) Load 53(inF0)
+             628:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 627
+             629:   48(fvec4) Load 53(inF0)
+             630:   48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 629
              631:   48(fvec4) Load 53(inF0)
-             632:   48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 631
-             633:   48(fvec4) Load 53(inF0)
-             634:   48(fvec4) Load 54(inF1)
-             635:   48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 633 634
+             632:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 631
+             633:   48(fvec4) VectorTimesScalar 632 199
+             634:   48(fvec4) Load 53(inF0)
+             635:   48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 634
              636:   48(fvec4) Load 53(inF0)
-             637:   48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 636
-             638:   48(fvec4) Load 53(inF0)
-             639:   48(fvec4) Load 54(inF1)
-             640:   48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 638 639
-             641:   48(fvec4) Load 53(inF0)
-             642:   48(fvec4) Load 54(inF1)
-             643:   48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 641 642 349
-             646:  543(ivec4) BitReverse 645
+             637:   48(fvec4) Load 54(inF1)
+             638:   48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 636 637
+             639:   48(fvec4) Load 53(inF0)
+             640:   48(fvec4) Load 54(inF1)
+             641:   48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 639 640
+             642:   48(fvec4) Load 53(inF0)
+             643:   48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 642
+             644:   48(fvec4) Load 53(inF0)
+             645:   48(fvec4) Load 54(inF1)
+             646:   48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 644 645
              647:   48(fvec4) Load 53(inF0)
-             648:   48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 647
+             648:   48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 647
              649:   48(fvec4) Load 53(inF0)
-             650:   48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 649
-             651:   48(fvec4) Load 53(inF0)
-             652:   48(fvec4) CompositeConstruct 218 218 218 218
-             653:   48(fvec4) CompositeConstruct 219 219 219 219
-             654:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 651 652 653
-             655:   48(fvec4) Load 53(inF0)
-             656:   48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 655
-             657:   48(fvec4) Load 53(inF0)
-             658:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 657
-             659:   48(fvec4) Load 53(inF0)
-             660:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 659
-                              Store 54(inF1) 660
-             661:   48(fvec4) Load 53(inF0)
-             662:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 661
-                              Store 55(inF2) 662
-             663:   48(fvec4) Load 53(inF0)
-             664:   48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 663
-             665:   48(fvec4) Load 53(inF0)
-             666:   48(fvec4) Load 54(inF1)
-             667:   48(fvec4) Load 55(inF2)
-             668:   48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 665 666 667
-             669:   48(fvec4) Load 53(inF0)
-             670:   48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 669
-             671:   48(fvec4) Load 53(inF0)
-             672:   48(fvec4) Load 54(inF1)
-             673:   48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 671 672
+             650:   48(fvec4) Load 54(inF1)
+             651:   48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 649 650
+             652:   48(fvec4) Load 53(inF0)
+             653:   48(fvec4) Load 54(inF1)
+             654:   48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 652 653 354
+             657:  555(ivec4) BitReverse 656
+             658:   48(fvec4) Load 53(inF0)
+             659:   48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 658
+             660:   48(fvec4) Load 53(inF0)
+             661:   48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 660
+             662:   48(fvec4) Load 53(inF0)
+             663:   48(fvec4) CompositeConstruct 133 133 133 133
+             664:   48(fvec4) CompositeConstruct 221 221 221 221
+             665:   48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 662 663 664
+             666:   48(fvec4) Load 53(inF0)
+             667:   48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 666
+             668:   48(fvec4) Load 53(inF0)
+             669:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 668
+             670:   48(fvec4) Load 53(inF0)
+             671:   48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 670
+                              Store 54(inF1) 671
+             672:   48(fvec4) Load 53(inF0)
+             673:   48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 672
+                              Store 55(inF2) 673
              674:   48(fvec4) Load 53(inF0)
-             675:   48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 674
+             675:   48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 674
              676:   48(fvec4) Load 53(inF0)
-             677:   48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 676
-             678:   48(fvec4) Load 53(inF0)
-             679:   48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 678
-                              ReturnValue 681
+             677:   48(fvec4) Load 54(inF1)
+             678:   48(fvec4) Load 55(inF2)
+             679:   48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 676 677 678
+             680:   48(fvec4) Load 53(inF0)
+             681:   48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 680
+             682:   48(fvec4) Load 53(inF0)
+             683:   48(fvec4) Load 54(inF1)
+             684:   48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 682 683
+             685:   48(fvec4) Load 53(inF0)
+             686:   48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 685
+             687:   48(fvec4) Load 53(inF0)
+             688:   48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 687
+             689:   48(fvec4) Load 53(inF0)
+             690:   48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 689
+                              ReturnValue 692
                               FunctionEnd
 66(VertexShaderFunction2x2(mf22;mf22;mf22;):          60 Function None 62
         63(inF0):     61(ptr) FunctionParameter
         64(inF1):     61(ptr) FunctionParameter
         65(inF2):     61(ptr) FunctionParameter
               67:             Label
-             684:          60 Load 63(inF0)
-             685:   132(bool) All 684
-             686:          60 Load 63(inF0)
-             687:          60 ExtInst 1(GLSL.std.450) 4(FAbs) 686
-             688:          60 Load 63(inF0)
-             689:          60 ExtInst 1(GLSL.std.450) 17(Acos) 688
-             690:          60 Load 63(inF0)
-             691:   132(bool) Any 690
-             692:          60 Load 63(inF0)
-             693:          60 ExtInst 1(GLSL.std.450) 16(Asin) 692
-             694:          60 Load 63(inF0)
-             695:          60 ExtInst 1(GLSL.std.450) 18(Atan) 694
-             696:          60 Load 63(inF0)
-             697:          60 Load 64(inF1)
-             698:          60 ExtInst 1(GLSL.std.450) 25(Atan2) 696 697
+             695:          60 Load 63(inF0)
+             697:         696 FOrdNotEqual 695 133
+             698:   132(bool) All 697
              699:          60 Load 63(inF0)
-             700:          60 ExtInst 1(GLSL.std.450) 9(Ceil) 699
+             700:          60 ExtInst 1(GLSL.std.450) 4(FAbs) 699
              701:          60 Load 63(inF0)
-             702:          60 Load 64(inF1)
-             703:          60 Load 65(inF2)
-             704:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 701 702 703
-             705:          60 Load 63(inF0)
-             706:          60 ExtInst 1(GLSL.std.450) 14(Cos) 705
-             707:          60 Load 63(inF0)
-             708:          60 ExtInst 1(GLSL.std.450) 20(Cosh) 707
-             709:          60 Load 63(inF0)
-             710:          60 ExtInst 1(GLSL.std.450) 12(Degrees) 709
-             711:          60 Load 63(inF0)
-             712:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 711
+             702:          60 ExtInst 1(GLSL.std.450) 17(Acos) 701
+             703:          60 Load 63(inF0)
+             704:         696 FOrdNotEqual 703 133
+             705:   132(bool) Any 704
+             706:          60 Load 63(inF0)
+             707:          60 ExtInst 1(GLSL.std.450) 16(Asin) 706
+             708:          60 Load 63(inF0)
+             709:          60 ExtInst 1(GLSL.std.450) 18(Atan) 708
+             710:          60 Load 63(inF0)
+             711:          60 Load 64(inF1)
+             712:          60 ExtInst 1(GLSL.std.450) 25(Atan2) 710 711
              713:          60 Load 63(inF0)
-             714:          60 ExtInst 1(GLSL.std.450) 27(Exp) 713
+             714:          60 ExtInst 1(GLSL.std.450) 9(Ceil) 713
              715:          60 Load 63(inF0)
-             716:          60 ExtInst 1(GLSL.std.450) 29(Exp2) 715
-             717:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             718:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
+             716:          60 Load 64(inF1)
+             717:          60 Load 65(inF2)
+             718:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 715 716 717
              719:          60 Load 63(inF0)
-             720:          60 ExtInst 1(GLSL.std.450) 8(Floor) 719
+             720:          60 ExtInst 1(GLSL.std.450) 14(Cos) 719
              721:          60 Load 63(inF0)
-             722:          60 Load 64(inF1)
-             723:   24(fvec2) CompositeExtract 721 0
-             724:   24(fvec2) CompositeExtract 722 0
-             725:   24(fvec2) FMod 723 724
-             726:   24(fvec2) CompositeExtract 721 1
-             727:   24(fvec2) CompositeExtract 722 1
-             728:   24(fvec2) FMod 726 727
-             729:          60 CompositeConstruct 725 728
-             730:          60 Load 63(inF0)
-             731:          60 ExtInst 1(GLSL.std.450) 10(Fract) 730
-             732:          60 Load 63(inF0)
-             733:          60 Load 64(inF1)
-             734:          60 ExtInst 1(GLSL.std.450) 53(Ldexp) 732 733
+             722:          60 ExtInst 1(GLSL.std.450) 20(Cosh) 721
+             723:          60 Load 63(inF0)
+             724:          60 ExtInst 1(GLSL.std.450) 12(Degrees) 723
+             725:          60 Load 63(inF0)
+             726:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 725
+             727:          60 Load 63(inF0)
+             728:          60 ExtInst 1(GLSL.std.450) 27(Exp) 727
+             729:          60 Load 63(inF0)
+             730:          60 ExtInst 1(GLSL.std.450) 29(Exp2) 729
+             731:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             732:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             733:          60 Load 63(inF0)
+             734:          60 ExtInst 1(GLSL.std.450) 8(Floor) 733
              735:          60 Load 63(inF0)
              736:          60 Load 64(inF1)
-             737:          60 Load 65(inF2)
-             738:          60 ExtInst 1(GLSL.std.450) 46(FMix) 735 736 737
-             739:          60 Load 63(inF0)
-             740:          60 ExtInst 1(GLSL.std.450) 28(Log) 739
-             741:          60 Load 63(inF0)
-             742:          60 ExtInst 1(GLSL.std.450) 30(Log2) 741
-             743:          60 MatrixTimesScalar 742 196
+             737:   24(fvec2) CompositeExtract 735 0
+             738:   24(fvec2) CompositeExtract 736 0
+             739:   24(fvec2) FMod 737 738
+             740:   24(fvec2) CompositeExtract 735 1
+             741:   24(fvec2) CompositeExtract 736 1
+             742:   24(fvec2) FMod 740 741
+             743:          60 CompositeConstruct 739 742
              744:          60 Load 63(inF0)
-             745:          60 ExtInst 1(GLSL.std.450) 30(Log2) 744
+             745:          60 ExtInst 1(GLSL.std.450) 10(Fract) 744
              746:          60 Load 63(inF0)
              747:          60 Load 64(inF1)
-             748:          60 ExtInst 1(GLSL.std.450) 40(FMax) 746 747
+             748:          60 ExtInst 1(GLSL.std.450) 53(Ldexp) 746 747
              749:          60 Load 63(inF0)
              750:          60 Load 64(inF1)
-             751:          60 ExtInst 1(GLSL.std.450) 37(FMin) 749 750
-             752:          60 Load 63(inF0)
-             753:          60 Load 64(inF1)
-             754:          60 ExtInst 1(GLSL.std.450) 26(Pow) 752 753
+             751:          60 Load 65(inF2)
+             752:          60 ExtInst 1(GLSL.std.450) 46(FMix) 749 750 751
+             753:          60 Load 63(inF0)
+             754:          60 ExtInst 1(GLSL.std.450) 28(Log) 753
              755:          60 Load 63(inF0)
-             756:          60 ExtInst 1(GLSL.std.450) 11(Radians) 755
-             757:          60 Load 63(inF0)
-             758:          60 ExtInst 1(GLSL.std.450) 2(RoundEven) 757
-             759:          60 Load 63(inF0)
-             760:          60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 759
-             761:          60 Load 63(inF0)
-             762:   24(fvec2) CompositeConstruct 218 218
-             763:   24(fvec2) CompositeConstruct 219 219
-             764:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 761 762 763
-             765:          60 Load 63(inF0)
-             766:          60 ExtInst 1(GLSL.std.450) 6(FSign) 765
-             767:          60 Load 63(inF0)
-             768:          60 ExtInst 1(GLSL.std.450) 13(Sin) 767
+             756:          60 ExtInst 1(GLSL.std.450) 30(Log2) 755
+             757:          60 MatrixTimesScalar 756 199
+             758:          60 Load 63(inF0)
+             759:          60 ExtInst 1(GLSL.std.450) 30(Log2) 758
+             760:          60 Load 63(inF0)
+             761:          60 Load 64(inF1)
+             762:          60 ExtInst 1(GLSL.std.450) 40(FMax) 760 761
+             763:          60 Load 63(inF0)
+             764:          60 Load 64(inF1)
+             765:          60 ExtInst 1(GLSL.std.450) 37(FMin) 763 764
+             766:          60 Load 63(inF0)
+             767:          60 Load 64(inF1)
+             768:          60 ExtInst 1(GLSL.std.450) 26(Pow) 766 767
              769:          60 Load 63(inF0)
-             770:          60 ExtInst 1(GLSL.std.450) 13(Sin) 769
-                              Store 64(inF1) 770
+             770:          60 ExtInst 1(GLSL.std.450) 11(Radians) 769
              771:          60 Load 63(inF0)
-             772:          60 ExtInst 1(GLSL.std.450) 14(Cos) 771
-                              Store 65(inF2) 772
+             772:          60 ExtInst 1(GLSL.std.450) 2(RoundEven) 771
              773:          60 Load 63(inF0)
-             774:          60 ExtInst 1(GLSL.std.450) 19(Sinh) 773
+             774:          60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 773
              775:          60 Load 63(inF0)
-             776:          60 Load 64(inF1)
-             777:          60 Load 65(inF2)
-             778:          60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 775 776 777
+             776:   24(fvec2) CompositeConstruct 133 133
+             777:   24(fvec2) CompositeConstruct 221 221
+             778:          60 ExtInst 1(GLSL.std.450) 43(FClamp) 775 776 777
              779:          60 Load 63(inF0)
-             780:          60 ExtInst 1(GLSL.std.450) 31(Sqrt) 779
+             780:          60 ExtInst 1(GLSL.std.450) 6(FSign) 779
              781:          60 Load 63(inF0)
-             782:          60 Load 64(inF1)
-             783:          60 ExtInst 1(GLSL.std.450) 48(Step) 781 782
-             784:          60 Load 63(inF0)
-             785:          60 ExtInst 1(GLSL.std.450) 15(Tan) 784
-             786:          60 Load 63(inF0)
-             787:          60 ExtInst 1(GLSL.std.450) 21(Tanh) 786
-             788:          60 Load 63(inF0)
-             789:          60 Transpose 788
-             790:          60 Load 63(inF0)
-             791:          60 ExtInst 1(GLSL.std.450) 3(Trunc) 790
-                              ReturnValue 793
+             782:          60 ExtInst 1(GLSL.std.450) 13(Sin) 781
+             783:          60 Load 63(inF0)
+             784:          60 ExtInst 1(GLSL.std.450) 13(Sin) 783
+                              Store 64(inF1) 784
+             785:          60 Load 63(inF0)
+             786:          60 ExtInst 1(GLSL.std.450) 14(Cos) 785
+                              Store 65(inF2) 786
+             787:          60 Load 63(inF0)
+             788:          60 ExtInst 1(GLSL.std.450) 19(Sinh) 787
+             789:          60 Load 63(inF0)
+             790:          60 Load 64(inF1)
+             791:          60 Load 65(inF2)
+             792:          60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 789 790 791
+             793:          60 Load 63(inF0)
+             794:          60 ExtInst 1(GLSL.std.450) 31(Sqrt) 793
+             795:          60 Load 63(inF0)
+             796:          60 Load 64(inF1)
+             797:          60 ExtInst 1(GLSL.std.450) 48(Step) 795 796
+             798:          60 Load 63(inF0)
+             799:          60 ExtInst 1(GLSL.std.450) 15(Tan) 798
+             800:          60 Load 63(inF0)
+             801:          60 ExtInst 1(GLSL.std.450) 21(Tanh) 800
+             802:          60 Load 63(inF0)
+             803:          60 Transpose 802
+             804:          60 Load 63(inF0)
+             805:          60 ExtInst 1(GLSL.std.450) 3(Trunc) 804
+                              ReturnValue 807
                               FunctionEnd
 74(VertexShaderFunction3x3(mf33;mf33;mf33;):          68 Function None 70
         71(inF0):     69(ptr) FunctionParameter
         72(inF1):     69(ptr) FunctionParameter
         73(inF2):     69(ptr) FunctionParameter
               75:             Label
-             796:          68 Load 71(inF0)
-             797:   132(bool) All 796
-             798:          68 Load 71(inF0)
-             799:          68 ExtInst 1(GLSL.std.450) 4(FAbs) 798
-             800:          68 Load 71(inF0)
-             801:          68 ExtInst 1(GLSL.std.450) 17(Acos) 800
-             802:          68 Load 71(inF0)
-             803:   132(bool) Any 802
-             804:          68 Load 71(inF0)
-             805:          68 ExtInst 1(GLSL.std.450) 16(Asin) 804
-             806:          68 Load 71(inF0)
-             807:          68 ExtInst 1(GLSL.std.450) 18(Atan) 806
-             808:          68 Load 71(inF0)
-             809:          68 Load 72(inF1)
-             810:          68 ExtInst 1(GLSL.std.450) 25(Atan2) 808 809
-             811:          68 Load 71(inF0)
-             812:          68 ExtInst 1(GLSL.std.450) 9(Ceil) 811
-             813:          68 Load 71(inF0)
-             814:          68 Load 72(inF1)
-             815:          68 Load 73(inF2)
-             816:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 813 814 815
-             817:          68 Load 71(inF0)
-             818:          68 ExtInst 1(GLSL.std.450) 14(Cos) 817
-             819:          68 Load 71(inF0)
-             820:          68 ExtInst 1(GLSL.std.450) 20(Cosh) 819
+             810:          68 Load 71(inF0)
+             812:         811 FOrdNotEqual 810 133
+             813:   132(bool) All 812
+             814:          68 Load 71(inF0)
+             815:          68 ExtInst 1(GLSL.std.450) 4(FAbs) 814
+             816:          68 Load 71(inF0)
+             817:          68 ExtInst 1(GLSL.std.450) 17(Acos) 816
+             818:          68 Load 71(inF0)
+             819:         811 FOrdNotEqual 818 133
+             820:   132(bool) Any 819
              821:          68 Load 71(inF0)
-             822:          68 ExtInst 1(GLSL.std.450) 12(Degrees) 821
+             822:          68 ExtInst 1(GLSL.std.450) 16(Asin) 821
              823:          68 Load 71(inF0)
-             824:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 823
+             824:          68 ExtInst 1(GLSL.std.450) 18(Atan) 823
              825:          68 Load 71(inF0)
-             826:          68 ExtInst 1(GLSL.std.450) 27(Exp) 825
-             827:          68 Load 71(inF0)
-             828:          68 ExtInst 1(GLSL.std.450) 29(Exp2) 827
-             829:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             830:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
-             831:          68 Load 71(inF0)
-             832:          68 ExtInst 1(GLSL.std.450) 8(Floor) 831
-             833:          68 Load 71(inF0)
-             834:          68 Load 72(inF1)
-             835:   36(fvec3) CompositeExtract 833 0
-             836:   36(fvec3) CompositeExtract 834 0
-             837:   36(fvec3) FMod 835 836
-             838:   36(fvec3) CompositeExtract 833 1
-             839:   36(fvec3) CompositeExtract 834 1
-             840:   36(fvec3) FMod 838 839
-             841:   36(fvec3) CompositeExtract 833 2
-             842:   36(fvec3) CompositeExtract 834 2
-             843:   36(fvec3) FMod 841 842
-             844:          68 CompositeConstruct 837 840 843
-             845:          68 Load 71(inF0)
-             846:          68 ExtInst 1(GLSL.std.450) 10(Fract) 845
-             847:          68 Load 71(inF0)
-             848:          68 Load 72(inF1)
-             849:          68 ExtInst 1(GLSL.std.450) 53(Ldexp) 847 848
+             826:          68 Load 72(inF1)
+             827:          68 ExtInst 1(GLSL.std.450) 25(Atan2) 825 826
+             828:          68 Load 71(inF0)
+             829:          68 ExtInst 1(GLSL.std.450) 9(Ceil) 828
+             830:          68 Load 71(inF0)
+             831:          68 Load 72(inF1)
+             832:          68 Load 73(inF2)
+             833:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 830 831 832
+             834:          68 Load 71(inF0)
+             835:          68 ExtInst 1(GLSL.std.450) 14(Cos) 834
+             836:          68 Load 71(inF0)
+             837:          68 ExtInst 1(GLSL.std.450) 20(Cosh) 836
+             838:          68 Load 71(inF0)
+             839:          68 ExtInst 1(GLSL.std.450) 12(Degrees) 838
+             840:          68 Load 71(inF0)
+             841:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 840
+             842:          68 Load 71(inF0)
+             843:          68 ExtInst 1(GLSL.std.450) 27(Exp) 842
+             844:          68 Load 71(inF0)
+             845:          68 ExtInst 1(GLSL.std.450) 29(Exp2) 844
+             846:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             847:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             848:          68 Load 71(inF0)
+             849:          68 ExtInst 1(GLSL.std.450) 8(Floor) 848
              850:          68 Load 71(inF0)
              851:          68 Load 72(inF1)
-             852:          68 Load 73(inF2)
-             853:          68 ExtInst 1(GLSL.std.450) 46(FMix) 850 851 852
-             854:          68 Load 71(inF0)
-             855:          68 ExtInst 1(GLSL.std.450) 28(Log) 854
-             856:          68 Load 71(inF0)
-             857:          68 ExtInst 1(GLSL.std.450) 30(Log2) 856
-             858:          68 MatrixTimesScalar 857 196
-             859:          68 Load 71(inF0)
-             860:          68 ExtInst 1(GLSL.std.450) 30(Log2) 859
-             861:          68 Load 71(inF0)
-             862:          68 Load 72(inF1)
-             863:          68 ExtInst 1(GLSL.std.450) 40(FMax) 861 862
+             852:   36(fvec3) CompositeExtract 850 0
+             853:   36(fvec3) CompositeExtract 851 0
+             854:   36(fvec3) FMod 852 853
+             855:   36(fvec3) CompositeExtract 850 1
+             856:   36(fvec3) CompositeExtract 851 1
+             857:   36(fvec3) FMod 855 856
+             858:   36(fvec3) CompositeExtract 850 2
+             859:   36(fvec3) CompositeExtract 851 2
+             860:   36(fvec3) FMod 858 859
+             861:          68 CompositeConstruct 854 857 860
+             862:          68 Load 71(inF0)
+             863:          68 ExtInst 1(GLSL.std.450) 10(Fract) 862
              864:          68 Load 71(inF0)
              865:          68 Load 72(inF1)
-             866:          68 ExtInst 1(GLSL.std.450) 37(FMin) 864 865
+             866:          68 ExtInst 1(GLSL.std.450) 53(Ldexp) 864 865
              867:          68 Load 71(inF0)
              868:          68 Load 72(inF1)
-             869:          68 ExtInst 1(GLSL.std.450) 26(Pow) 867 868
-             870:          68 Load 71(inF0)
-             871:          68 ExtInst 1(GLSL.std.450) 11(Radians) 870
-             872:          68 Load 71(inF0)
-             873:          68 ExtInst 1(GLSL.std.450) 2(RoundEven) 872
-             874:          68 Load 71(inF0)
-             875:          68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 874
+             869:          68 Load 73(inF2)
+             870:          68 ExtInst 1(GLSL.std.450) 46(FMix) 867 868 869
+             871:          68 Load 71(inF0)
+             872:          68 ExtInst 1(GLSL.std.450) 28(Log) 871
+             873:          68 Load 71(inF0)
+             874:          68 ExtInst 1(GLSL.std.450) 30(Log2) 873
+             875:          68 MatrixTimesScalar 874 199
              876:          68 Load 71(inF0)
-             877:   36(fvec3) CompositeConstruct 218 218 218
-             878:   36(fvec3) CompositeConstruct 219 219 219
-             879:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 876 877 878
-             880:          68 Load 71(inF0)
-             881:          68 ExtInst 1(GLSL.std.450) 6(FSign) 880
-             882:          68 Load 71(inF0)
-             883:          68 ExtInst 1(GLSL.std.450) 13(Sin) 882
+             877:          68 ExtInst 1(GLSL.std.450) 30(Log2) 876
+             878:          68 Load 71(inF0)
+             879:          68 Load 72(inF1)
+             880:          68 ExtInst 1(GLSL.std.450) 40(FMax) 878 879
+             881:          68 Load 71(inF0)
+             882:          68 Load 72(inF1)
+             883:          68 ExtInst 1(GLSL.std.450) 37(FMin) 881 882
              884:          68 Load 71(inF0)
-             885:          68 ExtInst 1(GLSL.std.450) 13(Sin) 884
-                              Store 72(inF1) 885
-             886:          68 Load 71(inF0)
-             887:          68 ExtInst 1(GLSL.std.450) 14(Cos) 886
-                              Store 73(inF2) 887
-             888:          68 Load 71(inF0)
-             889:          68 ExtInst 1(GLSL.std.450) 19(Sinh) 888
-             890:          68 Load 71(inF0)
-             891:          68 Load 72(inF1)
-             892:          68 Load 73(inF2)
-             893:          68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 890 891 892
-             894:          68 Load 71(inF0)
-             895:          68 ExtInst 1(GLSL.std.450) 31(Sqrt) 894
-             896:          68 Load 71(inF0)
-             897:          68 Load 72(inF1)
-             898:          68 ExtInst 1(GLSL.std.450) 48(Step) 896 897
+             885:          68 Load 72(inF1)
+             886:          68 ExtInst 1(GLSL.std.450) 26(Pow) 884 885
+             887:          68 Load 71(inF0)
+             888:          68 ExtInst 1(GLSL.std.450) 11(Radians) 887
+             889:          68 Load 71(inF0)
+             890:          68 ExtInst 1(GLSL.std.450) 2(RoundEven) 889
+             891:          68 Load 71(inF0)
+             892:          68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 891
+             893:          68 Load 71(inF0)
+             894:   36(fvec3) CompositeConstruct 133 133 133
+             895:   36(fvec3) CompositeConstruct 221 221 221
+             896:          68 ExtInst 1(GLSL.std.450) 43(FClamp) 893 894 895
+             897:          68 Load 71(inF0)
+             898:          68 ExtInst 1(GLSL.std.450) 6(FSign) 897
              899:          68 Load 71(inF0)
-             900:          68 ExtInst 1(GLSL.std.450) 15(Tan) 899
+             900:          68 ExtInst 1(GLSL.std.450) 13(Sin) 899
              901:          68 Load 71(inF0)
-             902:          68 ExtInst 1(GLSL.std.450) 21(Tanh) 901
+             902:          68 ExtInst 1(GLSL.std.450) 13(Sin) 901
+                              Store 72(inF1) 902
              903:          68 Load 71(inF0)
-             904:          68 Transpose 903
+             904:          68 ExtInst 1(GLSL.std.450) 14(Cos) 903
+                              Store 73(inF2) 904
              905:          68 Load 71(inF0)
-             906:          68 ExtInst 1(GLSL.std.450) 3(Trunc) 905
-                              ReturnValue 908
+             906:          68 ExtInst 1(GLSL.std.450) 19(Sinh) 905
+             907:          68 Load 71(inF0)
+             908:          68 Load 72(inF1)
+             909:          68 Load 73(inF2)
+             910:          68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 907 908 909
+             911:          68 Load 71(inF0)
+             912:          68 ExtInst 1(GLSL.std.450) 31(Sqrt) 911
+             913:          68 Load 71(inF0)
+             914:          68 Load 72(inF1)
+             915:          68 ExtInst 1(GLSL.std.450) 48(Step) 913 914
+             916:          68 Load 71(inF0)
+             917:          68 ExtInst 1(GLSL.std.450) 15(Tan) 916
+             918:          68 Load 71(inF0)
+             919:          68 ExtInst 1(GLSL.std.450) 21(Tanh) 918
+             920:          68 Load 71(inF0)
+             921:          68 Transpose 920
+             922:          68 Load 71(inF0)
+             923:          68 ExtInst 1(GLSL.std.450) 3(Trunc) 922
+                              ReturnValue 925
                               FunctionEnd
 82(VertexShaderFunction4x4(mf44;mf44;mf44;):          76 Function None 78
         79(inF0):     77(ptr) FunctionParameter
         80(inF1):     77(ptr) FunctionParameter
         81(inF2):     77(ptr) FunctionParameter
               83:             Label
-             911:          76 Load 79(inF0)
-             912:   132(bool) All 911
-             913:          76 Load 79(inF0)
-             914:          76 ExtInst 1(GLSL.std.450) 4(FAbs) 913
-             915:          76 Load 79(inF0)
-             916:          76 ExtInst 1(GLSL.std.450) 17(Acos) 915
-             917:          76 Load 79(inF0)
-             918:   132(bool) Any 917
-             919:          76 Load 79(inF0)
-             920:          76 ExtInst 1(GLSL.std.450) 16(Asin) 919
-             921:          76 Load 79(inF0)
-             922:          76 ExtInst 1(GLSL.std.450) 18(Atan) 921
-             923:          76 Load 79(inF0)
-             924:          76 Load 80(inF1)
-             925:          76 ExtInst 1(GLSL.std.450) 25(Atan2) 923 924
-             926:          76 Load 79(inF0)
-             927:          76 ExtInst 1(GLSL.std.450) 9(Ceil) 926
              928:          76 Load 79(inF0)
-             929:          76 Load 80(inF1)
-             930:          76 Load 81(inF2)
-             931:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 928 929 930
+             930:         929 FOrdNotEqual 928 133
+             931:   132(bool) All 930
              932:          76 Load 79(inF0)
-             933:          76 ExtInst 1(GLSL.std.450) 14(Cos) 932
+             933:          76 ExtInst 1(GLSL.std.450) 4(FAbs) 932
              934:          76 Load 79(inF0)
-             935:          76 ExtInst 1(GLSL.std.450) 20(Cosh) 934
+             935:          76 ExtInst 1(GLSL.std.450) 17(Acos) 934
              936:          76 Load 79(inF0)
-             937:          76 ExtInst 1(GLSL.std.450) 12(Degrees) 936
-             938:          76 Load 79(inF0)
-             939:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 938
-             940:          76 Load 79(inF0)
-             941:          76 ExtInst 1(GLSL.std.450) 27(Exp) 940
-             942:          76 Load 79(inF0)
-             943:          76 ExtInst 1(GLSL.std.450) 29(Exp2) 942
-             944:    143(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 164
-             945:    143(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 164
+             937:         929 FOrdNotEqual 936 133
+             938:   132(bool) Any 937
+             939:          76 Load 79(inF0)
+             940:          76 ExtInst 1(GLSL.std.450) 16(Asin) 939
+             941:          76 Load 79(inF0)
+             942:          76 ExtInst 1(GLSL.std.450) 18(Atan) 941
+             943:          76 Load 79(inF0)
+             944:          76 Load 80(inF1)
+             945:          76 ExtInst 1(GLSL.std.450) 25(Atan2) 943 944
              946:          76 Load 79(inF0)
-             947:          76 ExtInst 1(GLSL.std.450) 8(Floor) 946
+             947:          76 ExtInst 1(GLSL.std.450) 9(Ceil) 946
              948:          76 Load 79(inF0)
              949:          76 Load 80(inF1)
-             950:   48(fvec4) CompositeExtract 948 0
-             951:   48(fvec4) CompositeExtract 949 0
-             952:   48(fvec4) FMod 950 951
-             953:   48(fvec4) CompositeExtract 948 1
-             954:   48(fvec4) CompositeExtract 949 1
-             955:   48(fvec4) FMod 953 954
-             956:   48(fvec4) CompositeExtract 948 2
-             957:   48(fvec4) CompositeExtract 949 2
-             958:   48(fvec4) FMod 956 957
-             959:   48(fvec4) CompositeExtract 948 3
-             960:   48(fvec4) CompositeExtract 949 3
-             961:   48(fvec4) FMod 959 960
-             962:          76 CompositeConstruct 952 955 958 961
-             963:          76 Load 79(inF0)
-             964:          76 ExtInst 1(GLSL.std.450) 10(Fract) 963
-             965:          76 Load 79(inF0)
-             966:          76 Load 80(inF1)
-             967:          76 ExtInst 1(GLSL.std.450) 53(Ldexp) 965 966
+             950:          76 Load 81(inF2)
+             951:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 948 949 950
+             952:          76 Load 79(inF0)
+             953:          76 ExtInst 1(GLSL.std.450) 14(Cos) 952
+             954:          76 Load 79(inF0)
+             955:          76 ExtInst 1(GLSL.std.450) 20(Cosh) 954
+             956:          76 Load 79(inF0)
+             957:          76 ExtInst 1(GLSL.std.450) 12(Degrees) 956
+             958:          76 Load 79(inF0)
+             959:    6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 958
+             960:          76 Load 79(inF0)
+             961:          76 ExtInst 1(GLSL.std.450) 27(Exp) 960
+             962:          76 Load 79(inF0)
+             963:          76 ExtInst 1(GLSL.std.450) 29(Exp2) 962
+             964:    146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167
+             965:    146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167
+             966:          76 Load 79(inF0)
+             967:          76 ExtInst 1(GLSL.std.450) 8(Floor) 966
              968:          76 Load 79(inF0)
              969:          76 Load 80(inF1)
-             970:          76 Load 81(inF2)
-             971:          76 ExtInst 1(GLSL.std.450) 46(FMix) 968 969 970
-             972:          76 Load 79(inF0)
-             973:          76 ExtInst 1(GLSL.std.450) 28(Log) 972
-             974:          76 Load 79(inF0)
-             975:          76 ExtInst 1(GLSL.std.450) 30(Log2) 974
-             976:          76 MatrixTimesScalar 975 196
-             977:          76 Load 79(inF0)
-             978:          76 ExtInst 1(GLSL.std.450) 30(Log2) 977
-             979:          76 Load 79(inF0)
-             980:          76 Load 80(inF1)
-             981:          76 ExtInst 1(GLSL.std.450) 40(FMax) 979 980
-             982:          76 Load 79(inF0)
-             983:          76 Load 80(inF1)
-             984:          76 ExtInst 1(GLSL.std.450) 37(FMin) 982 983
+             970:   48(fvec4) CompositeExtract 968 0
+             971:   48(fvec4) CompositeExtract 969 0
+             972:   48(fvec4) FMod 970 971
+             973:   48(fvec4) CompositeExtract 968 1
+             974:   48(fvec4) CompositeExtract 969 1
+             975:   48(fvec4) FMod 973 974
+             976:   48(fvec4) CompositeExtract 968 2
+             977:   48(fvec4) CompositeExtract 969 2
+             978:   48(fvec4) FMod 976 977
+             979:   48(fvec4) CompositeExtract 968 3
+             980:   48(fvec4) CompositeExtract 969 3
+             981:   48(fvec4) FMod 979 980
+             982:          76 CompositeConstruct 972 975 978 981
+             983:          76 Load 79(inF0)
+             984:          76 ExtInst 1(GLSL.std.450) 10(Fract) 983
              985:          76 Load 79(inF0)
              986:          76 Load 80(inF1)
-             987:          76 ExtInst 1(GLSL.std.450) 26(Pow) 985 986
+             987:          76 ExtInst 1(GLSL.std.450) 53(Ldexp) 985 986
              988:          76 Load 79(inF0)
-             989:          76 ExtInst 1(GLSL.std.450) 11(Radians) 988
-             990:          76 Load 79(inF0)
-             991:          76 ExtInst 1(GLSL.std.450) 2(RoundEven) 990
+             989:          76 Load 80(inF1)
+             990:          76 Load 81(inF2)
+             991:          76 ExtInst 1(GLSL.std.450) 46(FMix) 988 989 990
              992:          76 Load 79(inF0)
-             993:          76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 992
+             993:          76 ExtInst 1(GLSL.std.450) 28(Log) 992
              994:          76 Load 79(inF0)
-             995:   48(fvec4) CompositeConstruct 218 218 218 218
-             996:   48(fvec4) CompositeConstruct 219 219 219 219
-             997:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 994 995 996
-             998:          76 Load 79(inF0)
-             999:          76 ExtInst 1(GLSL.std.450) 6(FSign) 998
-            1000:          76 Load 79(inF0)
-            1001:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1000
+             995:          76 ExtInst 1(GLSL.std.450) 30(Log2) 994
+             996:          76 MatrixTimesScalar 995 199
+             997:          76 Load 79(inF0)
+             998:          76 ExtInst 1(GLSL.std.450) 30(Log2) 997
+             999:          76 Load 79(inF0)
+            1000:          76 Load 80(inF1)
+            1001:          76 ExtInst 1(GLSL.std.450) 40(FMax) 999 1000
             1002:          76 Load 79(inF0)
-            1003:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1002
-                              Store 80(inF1) 1003
-            1004:          76 Load 79(inF0)
-            1005:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1004
-                              Store 81(inF2) 1005
-            1006:          76 Load 79(inF0)
-            1007:          76 ExtInst 1(GLSL.std.450) 19(Sinh) 1006
+            1003:          76 Load 80(inF1)
+            1004:          76 ExtInst 1(GLSL.std.450) 37(FMin) 1002 1003
+            1005:          76 Load 79(inF0)
+            1006:          76 Load 80(inF1)
+            1007:          76 ExtInst 1(GLSL.std.450) 26(Pow) 1005 1006
             1008:          76 Load 79(inF0)
-            1009:          76 Load 80(inF1)
-            1010:          76 Load 81(inF2)
-            1011:          76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1008 1009 1010
+            1009:          76 ExtInst 1(GLSL.std.450) 11(Radians) 1008
+            1010:          76 Load 79(inF0)
+            1011:          76 ExtInst 1(GLSL.std.450) 2(RoundEven) 1010
             1012:          76 Load 79(inF0)
-            1013:          76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1012
+            1013:          76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1012
             1014:          76 Load 79(inF0)
-            1015:          76 Load 80(inF1)
-            1016:          76 ExtInst 1(GLSL.std.450) 48(Step) 1014 1015
-            1017:          76 Load 79(inF0)
-            1018:          76 ExtInst 1(GLSL.std.450) 15(Tan) 1017
-            1019:          76 Load 79(inF0)
-            1020:          76 ExtInst 1(GLSL.std.450) 21(Tanh) 1019
-            1021:          76 Load 79(inF0)
-            1022:          76 Transpose 1021
-            1023:          76 Load 79(inF0)
-            1024:          76 ExtInst 1(GLSL.std.450) 3(Trunc) 1023
-                              ReturnValue 1026
+            1015:   48(fvec4) CompositeConstruct 133 133 133 133
+            1016:   48(fvec4) CompositeConstruct 221 221 221 221
+            1017:          76 ExtInst 1(GLSL.std.450) 43(FClamp) 1014 1015 1016
+            1018:          76 Load 79(inF0)
+            1019:          76 ExtInst 1(GLSL.std.450) 6(FSign) 1018
+            1020:          76 Load 79(inF0)
+            1021:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1020
+            1022:          76 Load 79(inF0)
+            1023:          76 ExtInst 1(GLSL.std.450) 13(Sin) 1022
+                              Store 80(inF1) 1023
+            1024:          76 Load 79(inF0)
+            1025:          76 ExtInst 1(GLSL.std.450) 14(Cos) 1024
+                              Store 81(inF2) 1025
+            1026:          76 Load 79(inF0)
+            1027:          76 ExtInst 1(GLSL.std.450) 19(Sinh) 1026
+            1028:          76 Load 79(inF0)
+            1029:          76 Load 80(inF1)
+            1030:          76 Load 81(inF2)
+            1031:          76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1028 1029 1030
+            1032:          76 Load 79(inF0)
+            1033:          76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1032
+            1034:          76 Load 79(inF0)
+            1035:          76 Load 80(inF1)
+            1036:          76 ExtInst 1(GLSL.std.450) 48(Step) 1034 1035
+            1037:          76 Load 79(inF0)
+            1038:          76 ExtInst 1(GLSL.std.450) 15(Tan) 1037
+            1039:          76 Load 79(inF0)
+            1040:          76 ExtInst 1(GLSL.std.450) 21(Tanh) 1039
+            1041:          76 Load 79(inF0)
+            1042:          76 Transpose 1041
+            1043:          76 Load 79(inF0)
+            1044:          76 ExtInst 1(GLSL.std.450) 3(Trunc) 1043
+                              ReturnValue 1046
                               FunctionEnd
 91(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;):           2 Function None 84
         85(inF0):      7(ptr) FunctionParameter
@@ -3891,51 +3939,51 @@
        89(inFM0):     61(ptr) FunctionParameter
        90(inFM1):     61(ptr) FunctionParameter
               92:             Label
-        1029(r0):      7(ptr) Variable Function
-        1033(r1):     25(ptr) Variable Function
-        1037(r2):     25(ptr) Variable Function
-        1041(r3):      7(ptr) Variable Function
-        1045(r4):     25(ptr) Variable Function
-        1049(r5):     25(ptr) Variable Function
-        1053(r6):     61(ptr) Variable Function
-        1057(r7):     61(ptr) Variable Function
-        1061(r8):     61(ptr) Variable Function
-            1030:    6(float) Load 86(inF1)
-            1031:    6(float) Load 85(inF0)
-            1032:    6(float) FMul 1030 1031
-                              Store 1029(r0) 1032
-            1034:    6(float) Load 85(inF0)
-            1035:   24(fvec2) Load 87(inFV0)
-            1036:   24(fvec2) VectorTimesScalar 1035 1034
-                              Store 1033(r1) 1036
-            1038:   24(fvec2) Load 87(inFV0)
-            1039:    6(float) Load 85(inF0)
-            1040:   24(fvec2) VectorTimesScalar 1038 1039
-                              Store 1037(r2) 1040
-            1042:   24(fvec2) Load 87(inFV0)
-            1043:   24(fvec2) Load 88(inFV1)
-            1044:    6(float) Dot 1042 1043
-                              Store 1041(r3) 1044
-            1046:   24(fvec2) Load 87(inFV0)
-            1047:          60 Load 89(inFM0)
-            1048:   24(fvec2) VectorTimesMatrix 1046 1047
-                              Store 1045(r4) 1048
-            1050:          60 Load 89(inFM0)
-            1051:   24(fvec2) Load 87(inFV0)
-            1052:   24(fvec2) MatrixTimesVector 1050 1051
-                              Store 1049(r5) 1052
+        1049(r0):      7(ptr) Variable Function
+        1053(r1):     25(ptr) Variable Function
+        1057(r2):     25(ptr) Variable Function
+        1061(r3):      7(ptr) Variable Function
+        1065(r4):     25(ptr) Variable Function
+        1069(r5):     25(ptr) Variable Function
+        1073(r6):     61(ptr) Variable Function
+        1077(r7):     61(ptr) Variable Function
+        1081(r8):     61(ptr) Variable Function
+            1050:    6(float) Load 86(inF1)
+            1051:    6(float) Load 85(inF0)
+            1052:    6(float) FMul 1050 1051
+                              Store 1049(r0) 1052
             1054:    6(float) Load 85(inF0)
-            1055:          60 Load 89(inFM0)
-            1056:          60 MatrixTimesScalar 1055 1054
-                              Store 1053(r6) 1056
-            1058:          60 Load 89(inFM0)
+            1055:   24(fvec2) Load 87(inFV0)
+            1056:   24(fvec2) VectorTimesScalar 1055 1054
+                              Store 1053(r1) 1056
+            1058:   24(fvec2) Load 87(inFV0)
             1059:    6(float) Load 85(inF0)
-            1060:          60 MatrixTimesScalar 1058 1059
-                              Store 1057(r7) 1060
-            1062:          60 Load 90(inFM1)
-            1063:          60 Load 89(inFM0)
-            1064:          60 MatrixTimesMatrix 1062 1063
-                              Store 1061(r8) 1064
+            1060:   24(fvec2) VectorTimesScalar 1058 1059
+                              Store 1057(r2) 1060
+            1062:   24(fvec2) Load 87(inFV0)
+            1063:   24(fvec2) Load 88(inFV1)
+            1064:    6(float) Dot 1062 1063
+                              Store 1061(r3) 1064
+            1066:   24(fvec2) Load 87(inFV0)
+            1067:          60 Load 89(inFM0)
+            1068:   24(fvec2) VectorTimesMatrix 1066 1067
+                              Store 1065(r4) 1068
+            1070:          60 Load 89(inFM0)
+            1071:   24(fvec2) Load 87(inFV0)
+            1072:   24(fvec2) MatrixTimesVector 1070 1071
+                              Store 1069(r5) 1072
+            1074:    6(float) Load 85(inF0)
+            1075:          60 Load 89(inFM0)
+            1076:          60 MatrixTimesScalar 1075 1074
+                              Store 1073(r6) 1076
+            1078:          60 Load 89(inFM0)
+            1079:    6(float) Load 85(inF0)
+            1080:          60 MatrixTimesScalar 1078 1079
+                              Store 1077(r7) 1080
+            1082:          60 Load 90(inFM1)
+            1083:          60 Load 89(inFM0)
+            1084:          60 MatrixTimesMatrix 1082 1083
+                              Store 1081(r8) 1084
                               Return
                               FunctionEnd
 100(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;):           2 Function None 93
@@ -3946,51 +3994,51 @@
        98(inFM0):     69(ptr) FunctionParameter
        99(inFM1):     69(ptr) FunctionParameter
              101:             Label
-        1065(r0):      7(ptr) Variable Function
-        1069(r1):     37(ptr) Variable Function
-        1073(r2):     37(ptr) Variable Function
-        1077(r3):      7(ptr) Variable Function
-        1081(r4):     37(ptr) Variable Function
-        1085(r5):     37(ptr) Variable Function
-        1089(r6):     69(ptr) Variable Function
-        1093(r7):     69(ptr) Variable Function
-        1097(r8):     69(ptr) Variable Function
-            1066:    6(float) Load 95(inF1)
-            1067:    6(float) Load 94(inF0)
-            1068:    6(float) FMul 1066 1067
-                              Store 1065(r0) 1068
-            1070:    6(float) Load 94(inF0)
-            1071:   36(fvec3) Load 96(inFV0)
-            1072:   36(fvec3) VectorTimesScalar 1071 1070
-                              Store 1069(r1) 1072
-            1074:   36(fvec3) Load 96(inFV0)
-            1075:    6(float) Load 94(inF0)
-            1076:   36(fvec3) VectorTimesScalar 1074 1075
-                              Store 1073(r2) 1076
-            1078:   36(fvec3) Load 96(inFV0)
-            1079:   36(fvec3) Load 97(inFV1)
-            1080:    6(float) Dot 1078 1079
-                              Store 1077(r3) 1080
-            1082:   36(fvec3) Load 96(inFV0)
-            1083:          68 Load 98(inFM0)
-            1084:   36(fvec3) VectorTimesMatrix 1082 1083
-                              Store 1081(r4) 1084
-            1086:          68 Load 98(inFM0)
-            1087:   36(fvec3) Load 96(inFV0)
-            1088:   36(fvec3) MatrixTimesVector 1086 1087
-                              Store 1085(r5) 1088
+        1085(r0):      7(ptr) Variable Function
+        1089(r1):     37(ptr) Variable Function
+        1093(r2):     37(ptr) Variable Function
+        1097(r3):      7(ptr) Variable Function
+        1101(r4):     37(ptr) Variable Function
+        1105(r5):     37(ptr) Variable Function
+        1109(r6):     69(ptr) Variable Function
+        1113(r7):     69(ptr) Variable Function
+        1117(r8):     69(ptr) Variable Function
+            1086:    6(float) Load 95(inF1)
+            1087:    6(float) Load 94(inF0)
+            1088:    6(float) FMul 1086 1087
+                              Store 1085(r0) 1088
             1090:    6(float) Load 94(inF0)
-            1091:          68 Load 98(inFM0)
-            1092:          68 MatrixTimesScalar 1091 1090
-                              Store 1089(r6) 1092
-            1094:          68 Load 98(inFM0)
+            1091:   36(fvec3) Load 96(inFV0)
+            1092:   36(fvec3) VectorTimesScalar 1091 1090
+                              Store 1089(r1) 1092
+            1094:   36(fvec3) Load 96(inFV0)
             1095:    6(float) Load 94(inF0)
-            1096:          68 MatrixTimesScalar 1094 1095
-                              Store 1093(r7) 1096
-            1098:          68 Load 99(inFM1)
-            1099:          68 Load 98(inFM0)
-            1100:          68 MatrixTimesMatrix 1098 1099
-                              Store 1097(r8) 1100
+            1096:   36(fvec3) VectorTimesScalar 1094 1095
+                              Store 1093(r2) 1096
+            1098:   36(fvec3) Load 96(inFV0)
+            1099:   36(fvec3) Load 97(inFV1)
+            1100:    6(float) Dot 1098 1099
+                              Store 1097(r3) 1100
+            1102:   36(fvec3) Load 96(inFV0)
+            1103:          68 Load 98(inFM0)
+            1104:   36(fvec3) VectorTimesMatrix 1102 1103
+                              Store 1101(r4) 1104
+            1106:          68 Load 98(inFM0)
+            1107:   36(fvec3) Load 96(inFV0)
+            1108:   36(fvec3) MatrixTimesVector 1106 1107
+                              Store 1105(r5) 1108
+            1110:    6(float) Load 94(inF0)
+            1111:          68 Load 98(inFM0)
+            1112:          68 MatrixTimesScalar 1111 1110
+                              Store 1109(r6) 1112
+            1114:          68 Load 98(inFM0)
+            1115:    6(float) Load 94(inF0)
+            1116:          68 MatrixTimesScalar 1114 1115
+                              Store 1113(r7) 1116
+            1118:          68 Load 99(inFM1)
+            1119:          68 Load 98(inFM0)
+            1120:          68 MatrixTimesMatrix 1118 1119
+                              Store 1117(r8) 1120
                               Return
                               FunctionEnd
 109(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;):           2 Function None 102
@@ -4001,51 +4049,51 @@
       107(inFM0):     77(ptr) FunctionParameter
       108(inFM1):     77(ptr) FunctionParameter
              110:             Label
-        1101(r0):      7(ptr) Variable Function
-        1105(r1):     49(ptr) Variable Function
-        1109(r2):     49(ptr) Variable Function
-        1113(r3):      7(ptr) Variable Function
-        1117(r4):     49(ptr) Variable Function
-        1121(r5):     49(ptr) Variable Function
-        1125(r6):     77(ptr) Variable Function
-        1129(r7):     77(ptr) Variable Function
-        1133(r8):     77(ptr) Variable Function
-            1102:    6(float) Load 104(inF1)
-            1103:    6(float) Load 103(inF0)
-            1104:    6(float) FMul 1102 1103
-                              Store 1101(r0) 1104
-            1106:    6(float) Load 103(inF0)
-            1107:   48(fvec4) Load 105(inFV0)
-            1108:   48(fvec4) VectorTimesScalar 1107 1106
-                              Store 1105(r1) 1108
-            1110:   48(fvec4) Load 105(inFV0)
-            1111:    6(float) Load 103(inF0)
-            1112:   48(fvec4) VectorTimesScalar 1110 1111
-                              Store 1109(r2) 1112
-            1114:   48(fvec4) Load 105(inFV0)
-            1115:   48(fvec4) Load 106(inFV1)
-            1116:    6(float) Dot 1114 1115
-                              Store 1113(r3) 1116
-            1118:   48(fvec4) Load 105(inFV0)
-            1119:          76 Load 107(inFM0)
-            1120:   48(fvec4) VectorTimesMatrix 1118 1119
-                              Store 1117(r4) 1120
-            1122:          76 Load 107(inFM0)
-            1123:   48(fvec4) Load 105(inFV0)
-            1124:   48(fvec4) MatrixTimesVector 1122 1123
-                              Store 1121(r5) 1124
+        1121(r0):      7(ptr) Variable Function
+        1125(r1):     49(ptr) Variable Function
+        1129(r2):     49(ptr) Variable Function
+        1133(r3):      7(ptr) Variable Function
+        1137(r4):     49(ptr) Variable Function
+        1141(r5):     49(ptr) Variable Function
+        1145(r6):     77(ptr) Variable Function
+        1149(r7):     77(ptr) Variable Function
+        1153(r8):     77(ptr) Variable Function
+            1122:    6(float) Load 104(inF1)
+            1123:    6(float) Load 103(inF0)
+            1124:    6(float) FMul 1122 1123
+                              Store 1121(r0) 1124
             1126:    6(float) Load 103(inF0)
-            1127:          76 Load 107(inFM0)
-            1128:          76 MatrixTimesScalar 1127 1126
-                              Store 1125(r6) 1128
-            1130:          76 Load 107(inFM0)
+            1127:   48(fvec4) Load 105(inFV0)
+            1128:   48(fvec4) VectorTimesScalar 1127 1126
+                              Store 1125(r1) 1128
+            1130:   48(fvec4) Load 105(inFV0)
             1131:    6(float) Load 103(inF0)
-            1132:          76 MatrixTimesScalar 1130 1131
-                              Store 1129(r7) 1132
-            1134:          76 Load 108(inFM1)
-            1135:          76 Load 107(inFM0)
-            1136:          76 MatrixTimesMatrix 1134 1135
-                              Store 1133(r8) 1136
+            1132:   48(fvec4) VectorTimesScalar 1130 1131
+                              Store 1129(r2) 1132
+            1134:   48(fvec4) Load 105(inFV0)
+            1135:   48(fvec4) Load 106(inFV1)
+            1136:    6(float) Dot 1134 1135
+                              Store 1133(r3) 1136
+            1138:   48(fvec4) Load 105(inFV0)
+            1139:          76 Load 107(inFM0)
+            1140:   48(fvec4) VectorTimesMatrix 1138 1139
+                              Store 1137(r4) 1140
+            1142:          76 Load 107(inFM0)
+            1143:   48(fvec4) Load 105(inFV0)
+            1144:   48(fvec4) MatrixTimesVector 1142 1143
+                              Store 1141(r5) 1144
+            1146:    6(float) Load 103(inF0)
+            1147:          76 Load 107(inFM0)
+            1148:          76 MatrixTimesScalar 1147 1146
+                              Store 1145(r6) 1148
+            1150:          76 Load 107(inFM0)
+            1151:    6(float) Load 103(inF0)
+            1152:          76 MatrixTimesScalar 1150 1151
+                              Store 1149(r7) 1152
+            1154:          76 Load 108(inFM1)
+            1155:          76 Load 107(inFM0)
+            1156:          76 MatrixTimesMatrix 1154 1155
+                              Store 1153(r8) 1156
                               Return
                               FunctionEnd
 129(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;):           2 Function None 119
@@ -4059,90 +4107,90 @@
     127(inFM3x4):    116(ptr) FunctionParameter
     128(inFM2x4):    118(ptr) FunctionParameter
              130:             Label
-       1137(r00):      7(ptr) Variable Function
-       1141(r01):     25(ptr) Variable Function
-       1145(r02):     37(ptr) Variable Function
-       1149(r03):     25(ptr) Variable Function
-       1153(r04):     37(ptr) Variable Function
-       1157(r05):      7(ptr) Variable Function
-       1161(r06):      7(ptr) Variable Function
-       1165(r07):     37(ptr) Variable Function
-       1169(r08):     25(ptr) Variable Function
-       1173(r09):     25(ptr) Variable Function
-       1177(r10):     37(ptr) Variable Function
-       1181(r11):    112(ptr) Variable Function
-       1185(r12):    114(ptr) Variable Function
-       1189(r13):     61(ptr) Variable Function
-       1193(r14):    112(ptr) Variable Function
-       1197(r15):    118(ptr) Variable Function
-       1201(r16):    116(ptr) Variable Function
-            1138:    6(float) Load 121(inF1)
-            1139:    6(float) Load 120(inF0)
-            1140:    6(float) FMul 1138 1139
-                              Store 1137(r00) 1140
-            1142:    6(float) Load 120(inF0)
-            1143:   24(fvec2) Load 122(inFV2)
-            1144:   24(fvec2) VectorTimesScalar 1143 1142
-                              Store 1141(r01) 1144
-            1146:    6(float) Load 120(inF0)
-            1147:   36(fvec3) Load 123(inFV3)
-            1148:   36(fvec3) VectorTimesScalar 1147 1146
-                              Store 1145(r02) 1148
-            1150:   24(fvec2) Load 122(inFV2)
-            1151:    6(float) Load 120(inF0)
-            1152:   24(fvec2) VectorTimesScalar 1150 1151
-                              Store 1149(r03) 1152
-            1154:   36(fvec3) Load 123(inFV3)
-            1155:    6(float) Load 120(inF0)
-            1156:   36(fvec3) VectorTimesScalar 1154 1155
-                              Store 1153(r04) 1156
-            1158:   24(fvec2) Load 122(inFV2)
-            1159:   24(fvec2) Load 122(inFV2)
-            1160:    6(float) Dot 1158 1159
-                              Store 1157(r05) 1160
-            1162:   36(fvec3) Load 123(inFV3)
-            1163:   36(fvec3) Load 123(inFV3)
-            1164:    6(float) Dot 1162 1163
-                              Store 1161(r06) 1164
-            1166:         111 Load 124(inFM2x3)
-            1167:   24(fvec2) Load 122(inFV2)
-            1168:   36(fvec3) MatrixTimesVector 1166 1167
-                              Store 1165(r07) 1168
-            1170:         113 Load 125(inFM3x2)
-            1171:   36(fvec3) Load 123(inFV3)
-            1172:   24(fvec2) MatrixTimesVector 1170 1171
-                              Store 1169(r08) 1172
+       1157(r00):      7(ptr) Variable Function
+       1161(r01):     25(ptr) Variable Function
+       1165(r02):     37(ptr) Variable Function
+       1169(r03):     25(ptr) Variable Function
+       1173(r04):     37(ptr) Variable Function
+       1177(r05):      7(ptr) Variable Function
+       1181(r06):      7(ptr) Variable Function
+       1185(r07):     37(ptr) Variable Function
+       1189(r08):     25(ptr) Variable Function
+       1193(r09):     25(ptr) Variable Function
+       1197(r10):     37(ptr) Variable Function
+       1201(r11):    112(ptr) Variable Function
+       1205(r12):    114(ptr) Variable Function
+       1209(r13):     61(ptr) Variable Function
+       1213(r14):    112(ptr) Variable Function
+       1217(r15):    118(ptr) Variable Function
+       1221(r16):    116(ptr) Variable Function
+            1158:    6(float) Load 121(inF1)
+            1159:    6(float) Load 120(inF0)
+            1160:    6(float) FMul 1158 1159
+                              Store 1157(r00) 1160
+            1162:    6(float) Load 120(inF0)
+            1163:   24(fvec2) Load 122(inFV2)
+            1164:   24(fvec2) VectorTimesScalar 1163 1162
+                              Store 1161(r01) 1164
+            1166:    6(float) Load 120(inF0)
+            1167:   36(fvec3) Load 123(inFV3)
+            1168:   36(fvec3) VectorTimesScalar 1167 1166
+                              Store 1165(r02) 1168
+            1170:   24(fvec2) Load 122(inFV2)
+            1171:    6(float) Load 120(inF0)
+            1172:   24(fvec2) VectorTimesScalar 1170 1171
+                              Store 1169(r03) 1172
             1174:   36(fvec3) Load 123(inFV3)
-            1175:         111 Load 124(inFM2x3)
-            1176:   24(fvec2) VectorTimesMatrix 1174 1175
-                              Store 1173(r09) 1176
+            1175:    6(float) Load 120(inF0)
+            1176:   36(fvec3) VectorTimesScalar 1174 1175
+                              Store 1173(r04) 1176
             1178:   24(fvec2) Load 122(inFV2)
-            1179:         113 Load 125(inFM3x2)
-            1180:   36(fvec3) VectorTimesMatrix 1178 1179
-                              Store 1177(r10) 1180
-            1182:    6(float) Load 120(inF0)
-            1183:         111 Load 124(inFM2x3)
-            1184:         111 MatrixTimesScalar 1183 1182
-                              Store 1181(r11) 1184
-            1186:    6(float) Load 120(inF0)
-            1187:         113 Load 125(inFM3x2)
-            1188:         113 MatrixTimesScalar 1187 1186
-                              Store 1185(r12) 1188
+            1179:   24(fvec2) Load 122(inFV2)
+            1180:    6(float) Dot 1178 1179
+                              Store 1177(r05) 1180
+            1182:   36(fvec3) Load 123(inFV3)
+            1183:   36(fvec3) Load 123(inFV3)
+            1184:    6(float) Dot 1182 1183
+                              Store 1181(r06) 1184
+            1186:         111 Load 124(inFM2x3)
+            1187:   24(fvec2) Load 122(inFV2)
+            1188:   36(fvec3) MatrixTimesVector 1186 1187
+                              Store 1185(r07) 1188
             1190:         113 Load 125(inFM3x2)
-            1191:         111 Load 124(inFM2x3)
-            1192:          60 MatrixTimesMatrix 1190 1191
-                              Store 1189(r13) 1192
-            1194:          68 Load 126(inFM3x3)
+            1191:   36(fvec3) Load 123(inFV3)
+            1192:   24(fvec2) MatrixTimesVector 1190 1191
+                              Store 1189(r08) 1192
+            1194:   36(fvec3) Load 123(inFV3)
             1195:         111 Load 124(inFM2x3)
-            1196:         111 MatrixTimesMatrix 1194 1195
-                              Store 1193(r14) 1196
-            1198:         115 Load 127(inFM3x4)
-            1199:         111 Load 124(inFM2x3)
-            1200:         117 MatrixTimesMatrix 1198 1199
-                              Store 1197(r15) 1200
-            1202:         117 Load 128(inFM2x4)
-            1203:         113 Load 125(inFM3x2)
-            1204:         115 MatrixTimesMatrix 1202 1203
-                              Store 1201(r16) 1204
+            1196:   24(fvec2) VectorTimesMatrix 1194 1195
+                              Store 1193(r09) 1196
+            1198:   24(fvec2) Load 122(inFV2)
+            1199:         113 Load 125(inFM3x2)
+            1200:   36(fvec3) VectorTimesMatrix 1198 1199
+                              Store 1197(r10) 1200
+            1202:    6(float) Load 120(inF0)
+            1203:         111 Load 124(inFM2x3)
+            1204:         111 MatrixTimesScalar 1203 1202
+                              Store 1201(r11) 1204
+            1206:    6(float) Load 120(inF0)
+            1207:         113 Load 125(inFM3x2)
+            1208:         113 MatrixTimesScalar 1207 1206
+                              Store 1205(r12) 1208
+            1210:         113 Load 125(inFM3x2)
+            1211:         111 Load 124(inFM2x3)
+            1212:          60 MatrixTimesMatrix 1210 1211
+                              Store 1209(r13) 1212
+            1214:          68 Load 126(inFM3x3)
+            1215:         111 Load 124(inFM2x3)
+            1216:         111 MatrixTimesMatrix 1214 1215
+                              Store 1213(r14) 1216
+            1218:         115 Load 127(inFM3x4)
+            1219:         111 Load 124(inFM2x3)
+            1220:         117 MatrixTimesMatrix 1218 1219
+                              Store 1217(r15) 1220
+            1222:         117 Load 128(inFM2x4)
+            1223:         113 Load 125(inFM3x2)
+            1224:         115 MatrixTimesMatrix 1222 1223
+                              Store 1221(r16) 1224
                               Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.isfinite.frag.out b/Test/baseResults/hlsl.isfinite.frag.out
index 3850be9..7eebb85 100644
--- a/Test/baseResults/hlsl.isfinite.frag.out
+++ b/Test/baseResults/hlsl.isfinite.frag.out
@@ -196,7 +196,7 @@
                               Name 65  "@finitetmp"
                               Name 83  "@entryPointOutput"
                               MemberDecorate 35($Global) 0 Offset 0
-                              MemberDecorate 35($Global) 1 Offset 4
+                              MemberDecorate 35($Global) 1 Offset 8
                               MemberDecorate 35($Global) 2 Offset 16
                               Decorate 35($Global) Block
                               Decorate 37 DescriptorSet 0
diff --git a/Test/baseResults/hlsl.load.2dms.dx10.frag.out b/Test/baseResults/hlsl.load.2dms.dx10.frag.out
index 712541a..251d56e 100644
--- a/Test/baseResults/hlsl.load.2dms.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.2dms.dx10.frag.out
@@ -395,11 +395,11 @@
                               Name 129  "g_sSamp"
                               Decorate 14(g_tTex2dmsf4) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.array.dx10.frag.out b/Test/baseResults/hlsl.load.array.dx10.frag.out
index dfd9a15..78e2b2c 100644
--- a/Test/baseResults/hlsl.load.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.array.dx10.frag.out
@@ -440,11 +440,11 @@
                               Name 158  "g_tTexcdu4a"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.basic.dx10.frag.out b/Test/baseResults/hlsl.load.basic.dx10.frag.out
index 53b94c1..0da4048 100644
--- a/Test/baseResults/hlsl.load.basic.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.basic.dx10.frag.out
@@ -543,11 +543,11 @@
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.basic.dx10.vert.out b/Test/baseResults/hlsl.load.basic.dx10.vert.out
index 3893232..c3b7dc2 100644
--- a/Test/baseResults/hlsl.load.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.load.basic.dx10.vert.out
@@ -505,11 +505,11 @@
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.buffer.dx10.frag.out b/Test/baseResults/hlsl.load.buffer.dx10.frag.out
index 3512a99..e68e5f9 100644
--- a/Test/baseResults/hlsl.load.buffer.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.buffer.dx10.frag.out
@@ -202,11 +202,11 @@
                               Name 71  "g_tTexbf4_test"
                               Decorate 16(g_tTexbf4) DescriptorSet 0
                               MemberDecorate 22($Global) 0 Offset 0
-                              MemberDecorate 22($Global) 1 Offset 4
+                              MemberDecorate 22($Global) 1 Offset 8
                               MemberDecorate 22($Global) 2 Offset 16
                               MemberDecorate 22($Global) 3 Offset 32
                               MemberDecorate 22($Global) 4 Offset 48
-                              MemberDecorate 22($Global) 5 Offset 52
+                              MemberDecorate 22($Global) 5 Offset 56
                               MemberDecorate 22($Global) 6 Offset 64
                               MemberDecorate 22($Global) 7 Offset 80
                               Decorate 22($Global) Block
diff --git a/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out b/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
index 5718b81..ff686a3 100644
--- a/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
@@ -208,11 +208,11 @@
                               Name 74  "g_tTexbfs_test"
                               Decorate 16(g_tTexbfs) DescriptorSet 0
                               MemberDecorate 22($Global) 0 Offset 0
-                              MemberDecorate 22($Global) 1 Offset 4
+                              MemberDecorate 22($Global) 1 Offset 8
                               MemberDecorate 22($Global) 2 Offset 16
                               MemberDecorate 22($Global) 3 Offset 32
                               MemberDecorate 22($Global) 4 Offset 48
-                              MemberDecorate 22($Global) 5 Offset 52
+                              MemberDecorate 22($Global) 5 Offset 56
                               MemberDecorate 22($Global) 6 Offset 64
                               MemberDecorate 22($Global) 7 Offset 80
                               Decorate 22($Global) Block
diff --git a/Test/baseResults/hlsl.load.offset.dx10.frag.out b/Test/baseResults/hlsl.load.offset.dx10.frag.out
index 54b03de..473db61 100644
--- a/Test/baseResults/hlsl.load.offset.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.offset.dx10.frag.out
@@ -616,11 +616,11 @@
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out b/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
index fc2f09c..4b6a09f 100644
--- a/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
@@ -489,11 +489,11 @@
                               Name 173  "g_tTexcdu4a"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out b/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
index 048b5e6..3e748cc 100644
--- a/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
@@ -141,11 +141,11 @@
                               Name 54  "Color"
                               Decorate 14(g_tBuffF) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out b/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
index a5c818d..884ed8f 100644
--- a/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
@@ -253,11 +253,11 @@
                               Name 118  "g_tTex3du4"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out b/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
index 6e3e5ce..3061867 100644
--- a/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
+++ b/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
@@ -290,11 +290,11 @@
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 4
+                              MemberDecorate 20($Global) 1 Offset 8
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 52
+                              MemberDecorate 20($Global) 5 Offset 56
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block
diff --git a/Test/baseResults/hlsl.precedence2.frag.out b/Test/baseResults/hlsl.precedence2.frag.out
index 31e76c3..cd223a6 100755
--- a/Test/baseResults/hlsl.precedence2.frag.out
+++ b/Test/baseResults/hlsl.precedence2.frag.out
@@ -30,16 +30,16 @@
 0:?     Sequence
 0:7      move second child to first child ( temp int)
 0:?         'a1' ( temp int)
-0:?         'a1' (layout( location=0) in int)
+0:?         'a1' (layout( location=0) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a2' ( temp int)
-0:?         'a2' (layout( location=1) in int)
+0:?         'a2' (layout( location=1) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a3' ( temp int)
-0:?         'a3' (layout( location=2) in int)
+0:?         'a3' (layout( location=2) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a4' ( temp int)
-0:?         'a4' (layout( location=3) in int)
+0:?         'a4' (layout( location=3) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         '@entryPointOutput' (layout( location=0) out int)
 0:7        Function Call: @PixelShaderFunction(i1;i1;i1;i1; ( temp int)
@@ -49,10 +49,10 @@
 0:?           'a4' ( temp int)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out int)
-0:?     'a1' (layout( location=0) in int)
-0:?     'a2' (layout( location=1) in int)
-0:?     'a3' (layout( location=2) in int)
-0:?     'a4' (layout( location=3) in int)
+0:?     'a1' (layout( location=0) flat in int)
+0:?     'a2' (layout( location=1) flat in int)
+0:?     'a3' (layout( location=2) flat in int)
+0:?     'a4' (layout( location=3) flat in int)
 
 
 Linked fragment stage:
@@ -89,16 +89,16 @@
 0:?     Sequence
 0:7      move second child to first child ( temp int)
 0:?         'a1' ( temp int)
-0:?         'a1' (layout( location=0) in int)
+0:?         'a1' (layout( location=0) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a2' ( temp int)
-0:?         'a2' (layout( location=1) in int)
+0:?         'a2' (layout( location=1) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a3' ( temp int)
-0:?         'a3' (layout( location=2) in int)
+0:?         'a3' (layout( location=2) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         'a4' ( temp int)
-0:?         'a4' (layout( location=3) in int)
+0:?         'a4' (layout( location=3) flat in int)
 0:7      move second child to first child ( temp int)
 0:?         '@entryPointOutput' (layout( location=0) out int)
 0:7        Function Call: @PixelShaderFunction(i1;i1;i1;i1; ( temp int)
@@ -108,10 +108,10 @@
 0:?           'a4' ( temp int)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out int)
-0:?     'a1' (layout( location=0) in int)
-0:?     'a2' (layout( location=1) in int)
-0:?     'a3' (layout( location=2) in int)
-0:?     'a4' (layout( location=3) in int)
+0:?     'a1' (layout( location=0) flat in int)
+0:?     'a2' (layout( location=1) flat in int)
+0:?     'a3' (layout( location=2) flat in int)
+0:?     'a4' (layout( location=3) flat in int)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -142,9 +142,13 @@
                               Name 49  "param"
                               Name 51  "param"
                               Name 53  "param"
+                              Decorate 34(a1) Flat
                               Decorate 34(a1) Location 0
+                              Decorate 37(a2) Flat
                               Decorate 37(a2) Location 1
+                              Decorate 40(a3) Flat
                               Decorate 40(a3) Location 2
+                              Decorate 43(a4) Flat
                               Decorate 43(a4) Location 3
                               Decorate 46(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.reflection.vert.out b/Test/baseResults/hlsl.reflection.vert.out
index 8ecfde6..5f7a033 100644
--- a/Test/baseResults/hlsl.reflection.vert.out
+++ b/Test/baseResults/hlsl.reflection.vert.out
@@ -2,26 +2,19 @@
 Uniform reflection:
 anonMember3: offset 80, type 8b52, size 1, index 0, binding -1
 s.a: offset 0, type 1404, size 1, index 1, binding -1
-ablock.scalar: offset 12, type 1404, size 1, index 2, binding -1
 m23: offset 16, type 8b67, size 1, index 0, binding -1
 scalarAfterm23: offset 48, type 1404, size 1, index 0, binding -1
-c_m23: offset 16, type 8b67, size 1, index 3, binding -1
-c_scalarAfterm23: offset 48, type 1404, size 1, index 3, binding -1
+c_m23: offset 16, type 8b67, size 1, index 2, binding -1
+c_scalarAfterm23: offset 48, type 1404, size 1, index 2, binding -1
 scalarBeforeArray: offset 96, type 1404, size 1, index 0, binding -1
 floatArray: offset 112, type 1406, size 5, index 0, binding -1
 scalarAfterArray: offset 192, type 1404, size 1, index 0, binding -1
-ablock.memfloat2: offset 48, type 8b50, size 1, index 2, binding -1
-ablock.memf1: offset 56, type 1406, size 1, index 2, binding -1
-ablock.memf2: offset 60, type 8b56, size 1, index 2, binding -1
-ablock.memf3: offset 64, type 1404, size 1, index 2, binding -1
-ablock.memfloat2a: offset 72, type 8b50, size 1, index 2, binding -1
-ablock.m22: offset 80, type 8b5a, size 7, index 2, binding -1
+m22: offset 208, type 8b5a, size 9, index 0, binding -1
 dm22: offset 32, type 8b5a, size 4, index 1, binding -1
-m22: offset 208, type 8b5a, size 3, index 0, binding -1
-nest.foo.n1.a: offset 0, type 1406, size 1, index 4, binding -1
-nest.foo.n2.b: offset 16, type 1406, size 1, index 4, binding -1
-nest.foo.n2.c: offset 20, type 1406, size 1, index 4, binding -1
-nest.foo.n2.d: offset 24, type 1406, size 1, index 4, binding -1
+foo.n1.a: offset 0, type 1406, size 1, index 3, binding -1
+foo.n2.b: offset 16, type 1406, size 1, index 3, binding -1
+foo.n2.c: offset 20, type 1406, size 1, index 3, binding -1
+foo.n2.d: offset 24, type 1406, size 1, index 3, binding -1
 deepA.d2.d1[2].va: offset 376, type 8b50, size 2, index 1, binding -1
 deepB.d2.d1.va: offset 984, type 8b50, size 2, index 1, binding -1
 deepB.d2.d1[0].va: offset 984, type 8b50, size 2, index 1, binding -1
@@ -61,19 +54,18 @@
 deepD[1].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1
 deepD[1].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1
 deepD[1].v3: offset 2480, type 8b54, size 1, index 1, binding -1
-arrBl.foo: offset 0, type 1406, size 1, index 5, binding -1
-arrBl2.foo: offset 0, type 1406, size 1, index 6, binding -1
+foo1: offset 0, type 1406, size 1, index 4, binding -1
+foo2: offset 0, type 1406, size 1, index 5, binding -1
 anonMember1: offset 0, type 8b51, size 1, index 0, binding -1
 uf1: offset 16, type 1406, size 1, index 1, binding -1
 
 Uniform block reflection:
 nameless: offset -1, type ffffffff, size 496, index -1, binding -1
 $Global: offset -1, type ffffffff, size 3088, index -1, binding -1
-ablock: offset -1, type ffffffff, size 304, index -1, binding -1
 c_nameless: offset -1, type ffffffff, size 96, index -1, binding -1
-nest: offset -1, type ffffffff, size 32, index -1, binding -1
-arrBl: offset -1, type ffffffff, size 4, index -1, binding -1
-arrBl2: offset -1, type ffffffff, size 4, index -1, binding -1
+nested: offset -1, type ffffffff, size 32, index -1, binding -1
+abl: offset -1, type ffffffff, size 4, index -1, binding -1
+abl2: offset -1, type ffffffff, size 4, index -1, binding -1
 
 Vertex attribute reflection:
 attributeFloat: offset 0, type 1406, size 0, index 0, binding -1
diff --git a/Test/baseResults/hlsl.rw.atomics.frag.out b/Test/baseResults/hlsl.rw.atomics.frag.out
index 00301be..08369c0 100644
--- a/Test/baseResults/hlsl.rw.atomics.frag.out
+++ b/Test/baseResults/hlsl.rw.atomics.frag.out
@@ -3998,7 +3998,7 @@
                               Name 1146  "g_tBuffF"
                               Decorate 15(g_tTex1di1) DescriptorSet 0
                               MemberDecorate 21($Global) 0 Offset 0
-                              MemberDecorate 21($Global) 1 Offset 4
+                              MemberDecorate 21($Global) 1 Offset 8
                               MemberDecorate 21($Global) 2 Offset 16
                               MemberDecorate 21($Global) 3 Offset 28
                               MemberDecorate 21($Global) 4 Offset 32
diff --git a/Test/baseResults/hlsl.rw.bracket.frag.out b/Test/baseResults/hlsl.rw.bracket.frag.out
index fdb906a..55264de 100644
--- a/Test/baseResults/hlsl.rw.bracket.frag.out
+++ b/Test/baseResults/hlsl.rw.bracket.frag.out
@@ -1881,11 +1881,11 @@
                               Name 603  "g_tTex2di4a"
                               Name 606  "g_tTex2du4a"
                               MemberDecorate 63($Global) 0 Offset 0
-                              MemberDecorate 63($Global) 1 Offset 4
+                              MemberDecorate 63($Global) 1 Offset 8
                               MemberDecorate 63($Global) 2 Offset 16
                               MemberDecorate 63($Global) 3 Offset 32
                               MemberDecorate 63($Global) 4 Offset 48
-                              MemberDecorate 63($Global) 5 Offset 52
+                              MemberDecorate 63($Global) 5 Offset 56
                               MemberDecorate 63($Global) 6 Offset 64
                               MemberDecorate 63($Global) 7 Offset 80
                               MemberDecorate 63($Global) 8 Offset 96
diff --git a/Test/baseResults/hlsl.rw.scalar.bracket.frag.out b/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
index 38cfa8f..e0e88d1 100644
--- a/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
+++ b/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
@@ -1827,11 +1827,11 @@
                               Name 567  "g_tTex2di1a"
                               Name 570  "g_tTex2du1a"
                               MemberDecorate 59($Global) 0 Offset 0
-                              MemberDecorate 59($Global) 1 Offset 4
+                              MemberDecorate 59($Global) 1 Offset 8
                               MemberDecorate 59($Global) 2 Offset 16
                               MemberDecorate 59($Global) 3 Offset 32
                               MemberDecorate 59($Global) 4 Offset 48
-                              MemberDecorate 59($Global) 5 Offset 52
+                              MemberDecorate 59($Global) 5 Offset 56
                               MemberDecorate 59($Global) 6 Offset 64
                               MemberDecorate 59($Global) 7 Offset 80
                               MemberDecorate 59($Global) 8 Offset 96
diff --git a/Test/baseResults/hlsl.rw.vec2.bracket.frag.out b/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
index 151380a..afcc52a 100644
--- a/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
+++ b/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
@@ -1846,11 +1846,11 @@
                               Name 601  "g_tTex2di2a"
                               Name 604  "g_tTex2du2a"
                               MemberDecorate 64($Global) 0 Offset 0
-                              MemberDecorate 64($Global) 1 Offset 4
+                              MemberDecorate 64($Global) 1 Offset 8
                               MemberDecorate 64($Global) 2 Offset 16
                               MemberDecorate 64($Global) 3 Offset 32
                               MemberDecorate 64($Global) 4 Offset 48
-                              MemberDecorate 64($Global) 5 Offset 52
+                              MemberDecorate 64($Global) 5 Offset 56
                               MemberDecorate 64($Global) 6 Offset 64
                               MemberDecorate 64($Global) 7 Offset 80
                               MemberDecorate 64($Global) 8 Offset 96
diff --git a/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out b/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
index 875d593..beae082 100644
--- a/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
@@ -713,7 +713,7 @@
              127:    6(float) CompositeExtract 124 2
              128:    6(float) CompositeExtract 124 3
              129:    7(fvec4) CompositeConstruct 125 126 127 128
-             130:    6(float) ImageSampleDrefExplicitLod 122 129 29 Lod 29
+             130:    6(float) ImageSampleDrefExplicitLod 122 129 29 Lod 34
                               Store 114(r60) 130
              135:         132 Load 134(g_tTexcdi4a)
              136:          18 Load 20(g_sSamp)
@@ -723,7 +723,7 @@
              142:    6(float) CompositeExtract 124 2
              143:    6(float) CompositeExtract 124 3
              144:    7(fvec4) CompositeConstruct 140 141 142 143
-             145:    6(float) ImageSampleDrefExplicitLod 139 144 29 Lod 29
+             145:    6(float) ImageSampleDrefExplicitLod 139 144 29 Lod 34
                               Store 131(r62) 145
              150:         147 Load 149(g_tTexcdu4a)
              151:          18 Load 20(g_sSamp)
@@ -733,7 +733,7 @@
              157:    6(float) CompositeExtract 124 2
              158:    6(float) CompositeExtract 124 3
              159:    7(fvec4) CompositeConstruct 155 156 157 158
-             160:    6(float) ImageSampleDrefExplicitLod 154 159 29 Lod 29
+             160:    6(float) ImageSampleDrefExplicitLod 154 159 29 Lod 34
                               Store 146(r64) 160
              167:    166(ptr) AccessChain 162(psout) 163
                               Store 167 165
diff --git a/Test/baseResults/hlsl.scalar2matrix.frag.out b/Test/baseResults/hlsl.scalar2matrix.frag.out
new file mode 100644
index 0000000..f3024b7
--- /dev/null
+++ b/Test/baseResults/hlsl.scalar2matrix.frag.out
@@ -0,0 +1,506 @@
+hlsl.scalar2matrix.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:2  Function Definition: Fn1(mf44; ( temp void)
+0:2    Function Parameters: 
+0:2      'p' ( in 4X4 matrix of float)
+0:5  Function Definition: @main( ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?     Sequence
+0:10      Sequence
+0:10        move second child to first child ( temp 4X4 matrix of float)
+0:10          'mat1' ( temp 4X4 matrix of float)
+0:10          Constant:
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:11      Sequence
+0:11        move second child to first child ( temp 4X4 matrix of float)
+0:11          'mat2' ( temp 4X4 matrix of float)
+0:11          Constant:
+0:11            3.000000
+0:11            3.100000
+0:11            3.200000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:12      Sequence
+0:12        move second child to first child ( temp 4X4 matrix of float)
+0:12          'mat3' ( temp 4X4 matrix of float)
+0:12          Constant:
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:16      move second child to first child ( temp 4X4 matrix of float)
+0:16        'mat4' ( temp 4X4 matrix of float)
+0:16        Constant:
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:17      move second child to first child ( temp 4X4 matrix of float)
+0:17        'mat4' ( temp 4X4 matrix of float)
+0:?         Constant:
+0:?           4.000000
+0:?           4.100000
+0:?           4.200000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:18      move second child to first child ( temp 4X4 matrix of float)
+0:18        'mat4' ( temp 4X4 matrix of float)
+0:18        Constant:
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:20      matrix scale second child into first child ( temp 4X4 matrix of float)
+0:20        'mat4' ( temp 4X4 matrix of float)
+0:20        Constant:
+0:20          0.750000
+0:21      add second child into first child ( temp 4X4 matrix of float)
+0:21        'mat4' ( temp 4X4 matrix of float)
+0:21        Constant:
+0:21          0.750000
+0:22      subtract second child into first child ( temp 4X4 matrix of float)
+0:22        'mat4' ( temp 4X4 matrix of float)
+0:22        Constant:
+0:22          0.500000
+0:23      divide second child into first child ( temp 4X4 matrix of float)
+0:23        'mat4' ( temp 4X4 matrix of float)
+0:23        Constant:
+0:23          2.000000
+0:25      Function Call: Fn1(mf44; ( temp void)
+0:25        Constant:
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:27      Branch: Return with expression
+0:27        add ( temp 4-component vector of float)
+0:27          add ( temp 4-component vector of float)
+0:27            Constant:
+0:27              0.300000
+0:27              0.300000
+0:27              0.300000
+0:27              0.300000
+0:27            direct index ( temp 4-component vector of float)
+0:27              'mat1' ( temp 4X4 matrix of float)
+0:27              Constant:
+0:27                1 (const int)
+0:27          direct index ( temp 4-component vector of float)
+0:27            'mat4' ( temp 4X4 matrix of float)
+0:27            Constant:
+0:27              2 (const int)
+0:5  Function Definition: main( ( temp void)
+0:5    Function Parameters: 
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:5        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:2  Function Definition: Fn1(mf44; ( temp void)
+0:2    Function Parameters: 
+0:2      'p' ( in 4X4 matrix of float)
+0:5  Function Definition: @main( ( temp 4-component vector of float)
+0:5    Function Parameters: 
+0:?     Sequence
+0:10      Sequence
+0:10        move second child to first child ( temp 4X4 matrix of float)
+0:10          'mat1' ( temp 4X4 matrix of float)
+0:10          Constant:
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:10            0.250000
+0:11      Sequence
+0:11        move second child to first child ( temp 4X4 matrix of float)
+0:11          'mat2' ( temp 4X4 matrix of float)
+0:11          Constant:
+0:11            3.000000
+0:11            3.100000
+0:11            3.200000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:11            0.000000
+0:12      Sequence
+0:12        move second child to first child ( temp 4X4 matrix of float)
+0:12          'mat3' ( temp 4X4 matrix of float)
+0:12          Constant:
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:12            0.375000
+0:16      move second child to first child ( temp 4X4 matrix of float)
+0:16        'mat4' ( temp 4X4 matrix of float)
+0:16        Constant:
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:16          0.750000
+0:17      move second child to first child ( temp 4X4 matrix of float)
+0:17        'mat4' ( temp 4X4 matrix of float)
+0:?         Constant:
+0:?           4.000000
+0:?           4.100000
+0:?           4.200000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:?           0.000000
+0:18      move second child to first child ( temp 4X4 matrix of float)
+0:18        'mat4' ( temp 4X4 matrix of float)
+0:18        Constant:
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:18          0.500000
+0:20      matrix scale second child into first child ( temp 4X4 matrix of float)
+0:20        'mat4' ( temp 4X4 matrix of float)
+0:20        Constant:
+0:20          0.750000
+0:21      add second child into first child ( temp 4X4 matrix of float)
+0:21        'mat4' ( temp 4X4 matrix of float)
+0:21        Constant:
+0:21          0.750000
+0:22      subtract second child into first child ( temp 4X4 matrix of float)
+0:22        'mat4' ( temp 4X4 matrix of float)
+0:22        Constant:
+0:22          0.500000
+0:23      divide second child into first child ( temp 4X4 matrix of float)
+0:23        'mat4' ( temp 4X4 matrix of float)
+0:23        Constant:
+0:23          2.000000
+0:25      Function Call: Fn1(mf44; ( temp void)
+0:25        Constant:
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:25          5.000000
+0:27      Branch: Return with expression
+0:27        add ( temp 4-component vector of float)
+0:27          add ( temp 4-component vector of float)
+0:27            Constant:
+0:27              0.300000
+0:27              0.300000
+0:27              0.300000
+0:27              0.300000
+0:27            direct index ( temp 4-component vector of float)
+0:27              'mat1' ( temp 4X4 matrix of float)
+0:27              Constant:
+0:27                1 (const int)
+0:27          direct index ( temp 4-component vector of float)
+0:27            'mat4' ( temp 4X4 matrix of float)
+0:27            Constant:
+0:27              2 (const int)
+0:5  Function Definition: main( ( temp void)
+0:5    Function Parameters: 
+0:?     Sequence
+0:5      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:5        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 96
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 94
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 12  "Fn1(mf44;"
+                              Name 11  "p"
+                              Name 15  "@main("
+                              Name 17  "mat1"
+                              Name 21  "mat2"
+                              Name 29  "mat3"
+                              Name 33  "mat4"
+                              Name 77  "param"
+                              Name 94  "@entryPointOutput"
+                              Decorate 94(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeMatrix 7(fvec4) 4
+               9:             TypePointer Function 8
+              10:             TypeFunction 2 9(ptr)
+              14:             TypeFunction 7(fvec4)
+              18:    6(float) Constant 1048576000
+              19:    7(fvec4) ConstantComposite 18 18 18 18
+              20:           8 ConstantComposite 19 19 19 19
+              22:    6(float) Constant 1077936128
+              23:    6(float) Constant 1078355558
+              24:    6(float) Constant 1078774989
+              25:    6(float) Constant 0
+              26:    7(fvec4) ConstantComposite 22 23 24 25
+              27:    7(fvec4) ConstantComposite 25 25 25 25
+              28:           8 ConstantComposite 26 27 27 27
+              30:    6(float) Constant 1052770304
+              31:    7(fvec4) ConstantComposite 30 30 30 30
+              32:           8 ConstantComposite 31 31 31 31
+              34:    6(float) Constant 1061158912
+              35:    7(fvec4) ConstantComposite 34 34 34 34
+              36:           8 ConstantComposite 35 35 35 35
+              37:    6(float) Constant 1082130432
+              38:    6(float) Constant 1082340147
+              39:    6(float) Constant 1082549862
+              40:    7(fvec4) ConstantComposite 37 38 39 25
+              41:           8 ConstantComposite 40 27 27 27
+              42:    6(float) Constant 1056964608
+              43:    7(fvec4) ConstantComposite 42 42 42 42
+              44:           8 ConstantComposite 43 43 43 43
+              69:    6(float) Constant 1073741824
+              71:    6(float) Constant 1065353216
+              74:    6(float) Constant 1084227584
+              75:    7(fvec4) ConstantComposite 74 74 74 74
+              76:           8 ConstantComposite 75 75 75 75
+              79:    6(float) Constant 1050253722
+              80:    7(fvec4) ConstantComposite 79 79 79 79
+              81:             TypeInt 32 1
+              82:     81(int) Constant 1
+              83:             TypePointer Function 7(fvec4)
+              87:     81(int) Constant 2
+              93:             TypePointer Output 7(fvec4)
+94(@entryPointOutput):     93(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              95:    7(fvec4) FunctionCall 15(@main()
+                              Store 94(@entryPointOutput) 95
+                              Return
+                              FunctionEnd
+   12(Fn1(mf44;):           2 Function None 10
+           11(p):      9(ptr) FunctionParameter
+              13:             Label
+                              Return
+                              FunctionEnd
+      15(@main():    7(fvec4) Function None 14
+              16:             Label
+        17(mat1):      9(ptr) Variable Function
+        21(mat2):      9(ptr) Variable Function
+        29(mat3):      9(ptr) Variable Function
+        33(mat4):      9(ptr) Variable Function
+       77(param):      9(ptr) Variable Function
+                              Store 17(mat1) 20
+                              Store 21(mat2) 28
+                              Store 29(mat3) 32
+                              Store 33(mat4) 36
+                              Store 33(mat4) 41
+                              Store 33(mat4) 44
+              45:           8 Load 33(mat4)
+              46:           8 MatrixTimesScalar 45 34
+                              Store 33(mat4) 46
+              47:           8 Load 33(mat4)
+              48:    7(fvec4) CompositeConstruct 34 34 34 34
+              49:    7(fvec4) CompositeExtract 47 0
+              50:    7(fvec4) FAdd 49 48
+              51:    7(fvec4) CompositeExtract 47 1
+              52:    7(fvec4) FAdd 51 48
+              53:    7(fvec4) CompositeExtract 47 2
+              54:    7(fvec4) FAdd 53 48
+              55:    7(fvec4) CompositeExtract 47 3
+              56:    7(fvec4) FAdd 55 48
+              57:           8 CompositeConstruct 50 52 54 56
+                              Store 33(mat4) 57
+              58:           8 Load 33(mat4)
+              59:    7(fvec4) CompositeConstruct 42 42 42 42
+              60:    7(fvec4) CompositeExtract 58 0
+              61:    7(fvec4) FSub 60 59
+              62:    7(fvec4) CompositeExtract 58 1
+              63:    7(fvec4) FSub 62 59
+              64:    7(fvec4) CompositeExtract 58 2
+              65:    7(fvec4) FSub 64 59
+              66:    7(fvec4) CompositeExtract 58 3
+              67:    7(fvec4) FSub 66 59
+              68:           8 CompositeConstruct 61 63 65 67
+                              Store 33(mat4) 68
+              70:           8 Load 33(mat4)
+              72:    6(float) FDiv 71 69
+              73:           8 MatrixTimesScalar 70 72
+                              Store 33(mat4) 73
+                              Store 77(param) 76
+              78:           2 FunctionCall 12(Fn1(mf44;) 77(param)
+              84:     83(ptr) AccessChain 17(mat1) 82
+              85:    7(fvec4) Load 84
+              86:    7(fvec4) FAdd 80 85
+              88:     83(ptr) AccessChain 33(mat4) 87
+              89:    7(fvec4) Load 88
+              90:    7(fvec4) FAdd 86 89
+                              ReturnValue 90
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.semantic.geom.out b/Test/baseResults/hlsl.semantic.geom.out
index e5d67b9..fef418f 100755
--- a/Test/baseResults/hlsl.semantic.geom.out
+++ b/Test/baseResults/hlsl.semantic.geom.out
@@ -24,18 +24,26 @@
 0:12          Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
 0:?             'VertexID' ( temp 3-element array of uint)
 0:?             'OutputStream' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12        move second child to first child ( temp float)
-0:?           'OutputStream_clip0' ( out float ClipDistance)
-0:12          clip0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12        move second child to first child ( temp float)
-0:?           'OutputStream_cull0' ( out float CullDistance)
-0:12          cull0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
+0:?         Sequence
+0:12          move second child to first child ( temp float)
+0:12            direct index ( temp float)
+0:?               'OutputStream_clip0' ( out 1-element array of float ClipDistance)
+0:12              Constant:
+0:12                0 (const int)
+0:12            clip0: direct index for structure ( temp float)
+0:12              'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
+0:12              Constant:
+0:12                0 (const int)
+0:?         Sequence
+0:12          move second child to first child ( temp float)
+0:12            direct index ( temp float)
+0:?               'OutputStream_cull0' ( out 1-element array of float CullDistance)
+0:12              Constant:
+0:12                0 (const int)
+0:12            cull0: direct index for structure ( temp float)
+0:12              'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
+0:12              Constant:
+0:12                1 (const int)
 0:12        move second child to first child ( temp uint)
 0:?           'OutputStream_vpai' ( out uint ViewportIndex)
 0:12          vpai: direct index for structure ( temp uint)
@@ -61,6 +69,8 @@
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
 0:?     'VertexID' (layout( location=0) in 3-element array of uint)
 0:?     'OutputStream' (layout( location=1) out structure{ temp int ii})
+0:?     'OutputStream_clip0' ( out 1-element array of float ClipDistance)
+0:?     'OutputStream_cull0' ( out 1-element array of float CullDistance)
 0:?     'OutputStream_vpai' ( out uint ViewportIndex)
 
 
@@ -92,18 +102,26 @@
 0:12          Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
 0:?             'VertexID' ( temp 3-element array of uint)
 0:?             'OutputStream' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12        move second child to first child ( temp float)
-0:?           'OutputStream_clip0' ( out float ClipDistance)
-0:12          clip0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12        move second child to first child ( temp float)
-0:?           'OutputStream_cull0' ( out float CullDistance)
-0:12          cull0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
+0:?         Sequence
+0:12          move second child to first child ( temp float)
+0:12            direct index ( temp float)
+0:?               'OutputStream_clip0' ( out 1-element array of float ClipDistance)
+0:12              Constant:
+0:12                0 (const int)
+0:12            clip0: direct index for structure ( temp float)
+0:12              'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
+0:12              Constant:
+0:12                0 (const int)
+0:?         Sequence
+0:12          move second child to first child ( temp float)
+0:12            direct index ( temp float)
+0:?               'OutputStream_cull0' ( out 1-element array of float CullDistance)
+0:12              Constant:
+0:12                0 (const int)
+0:12            cull0: direct index for structure ( temp float)
+0:12              'flattenTemp' ( temp structure{ temp float clip0,  temp float cull0,  temp uint vpai,  temp uint rtai,  temp int ii})
+0:12              Constant:
+0:12                1 (const int)
 0:12        move second child to first child ( temp uint)
 0:?           'OutputStream_vpai' ( out uint ViewportIndex)
 0:12          vpai: direct index for structure ( temp uint)
@@ -129,11 +147,13 @@
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
 0:?     'VertexID' (layout( location=0) in 3-element array of uint)
 0:?     'OutputStream' (layout( location=1) out structure{ temp int ii})
+0:?     'OutputStream_clip0' ( out 1-element array of float ClipDistance)
+0:?     'OutputStream_cull0' ( out 1-element array of float CullDistance)
 0:?     'OutputStream_vpai' ( out uint ViewportIndex)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 66
+// Id's are bound by 71
 
                               Capability Geometry
                               Capability ClipDistance
@@ -141,7 +161,7 @@
                               Capability MultiViewport
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Geometry 4  "main" 25 35 40 45 50 56 65
+                              EntryPoint Geometry 4  "main" 25 37 44 50 55 61 70
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 Invocations 1
                               ExecutionMode 4 OutputLineStrip
@@ -164,23 +184,23 @@
                               Name 28  "OutputStream"
                               Name 29  "param"
                               Name 31  "param"
-                              Name 35  "OutputStream_clip0"
-                              Name 40  "OutputStream_cull0"
-                              Name 45  "OutputStream_vpai"
-                              Name 50  "OutputStream_rtai"
-                              Name 54  "S"
-                              MemberName 54(S) 0  "ii"
-                              Name 56  "@entryPointOutput"
-                              Name 63  "S"
-                              MemberName 63(S) 0  "ii"
-                              Name 65  "OutputStream"
+                              Name 37  "OutputStream_clip0"
+                              Name 44  "OutputStream_cull0"
+                              Name 50  "OutputStream_vpai"
+                              Name 55  "OutputStream_rtai"
+                              Name 59  "S"
+                              MemberName 59(S) 0  "ii"
+                              Name 61  "@entryPointOutput"
+                              Name 68  "S"
+                              MemberName 68(S) 0  "ii"
+                              Name 70  "OutputStream"
                               Decorate 25(VertexID) Location 0
-                              Decorate 35(OutputStream_clip0) BuiltIn ClipDistance
-                              Decorate 40(OutputStream_cull0) BuiltIn CullDistance
-                              Decorate 45(OutputStream_vpai) BuiltIn ViewportIndex
-                              Decorate 50(OutputStream_rtai) BuiltIn Layer
-                              Decorate 56(@entryPointOutput) Location 0
-                              Decorate 65(OutputStream) Location 1
+                              Decorate 37(OutputStream_clip0) BuiltIn ClipDistance
+                              Decorate 44(OutputStream_cull0) BuiltIn CullDistance
+                              Decorate 50(OutputStream_vpai) BuiltIn ViewportIndex
+                              Decorate 55(OutputStream_rtai) BuiltIn Layer
+                              Decorate 61(@entryPointOutput) Location 0
+                              Decorate 70(OutputStream) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -194,27 +214,30 @@
               14:             TypeFunction 12(S) 9(ptr) 13(ptr)
               24:             TypePointer Input 8
     25(VertexID):     24(ptr) Variable Input
-              34:             TypePointer Output 10(float)
-35(OutputStream_clip0):     34(ptr) Variable Output
-              36:     11(int) Constant 0
-              37:             TypePointer Function 10(float)
-40(OutputStream_cull0):     34(ptr) Variable Output
-              41:     11(int) Constant 1
-              44:             TypePointer Output 6(int)
-45(OutputStream_vpai):     44(ptr) Variable Output
-              46:     11(int) Constant 2
-              47:             TypePointer Function 6(int)
-50(OutputStream_rtai):     44(ptr) Variable Output
-              51:     11(int) Constant 3
-           54(S):             TypeStruct 11(int)
-              55:             TypePointer Output 54(S)
-56(@entryPointOutput):     55(ptr) Variable Output
-              57:     11(int) Constant 4
-              58:             TypePointer Function 11(int)
-              61:             TypePointer Output 11(int)
-           63(S):             TypeStruct 11(int)
-              64:             TypePointer Output 63(S)
-65(OutputStream):     64(ptr) Variable Output
+              34:      6(int) Constant 1
+              35:             TypeArray 10(float) 34
+              36:             TypePointer Output 35
+37(OutputStream_clip0):     36(ptr) Variable Output
+              38:     11(int) Constant 0
+              39:             TypePointer Function 10(float)
+              42:             TypePointer Output 10(float)
+44(OutputStream_cull0):     36(ptr) Variable Output
+              45:     11(int) Constant 1
+              49:             TypePointer Output 6(int)
+50(OutputStream_vpai):     49(ptr) Variable Output
+              51:     11(int) Constant 2
+              52:             TypePointer Function 6(int)
+55(OutputStream_rtai):     49(ptr) Variable Output
+              56:     11(int) Constant 3
+           59(S):             TypeStruct 11(int)
+              60:             TypePointer Output 59(S)
+61(@entryPointOutput):     60(ptr) Variable Output
+              62:     11(int) Constant 4
+              63:             TypePointer Function 11(int)
+              66:             TypePointer Output 11(int)
+           68(S):             TypeStruct 11(int)
+              69:             TypePointer Output 68(S)
+70(OutputStream):     69(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
     23(VertexID):      9(ptr) Variable Function
@@ -230,22 +253,24 @@
               33:       12(S) Load 31(param)
                               Store 28(OutputStream) 33
                               Store 27(flattenTemp) 32
-              38:     37(ptr) AccessChain 27(flattenTemp) 36
-              39:   10(float) Load 38
-                              Store 35(OutputStream_clip0) 39
-              42:     37(ptr) AccessChain 27(flattenTemp) 41
-              43:   10(float) Load 42
-                              Store 40(OutputStream_cull0) 43
-              48:     47(ptr) AccessChain 27(flattenTemp) 46
-              49:      6(int) Load 48
-                              Store 45(OutputStream_vpai) 49
-              52:     47(ptr) AccessChain 27(flattenTemp) 51
-              53:      6(int) Load 52
-                              Store 50(OutputStream_rtai) 53
-              59:     58(ptr) AccessChain 27(flattenTemp) 57
-              60:     11(int) Load 59
-              62:     61(ptr) AccessChain 56(@entryPointOutput) 36
-                              Store 62 60
+              40:     39(ptr) AccessChain 27(flattenTemp) 38
+              41:   10(float) Load 40
+              43:     42(ptr) AccessChain 37(OutputStream_clip0) 38
+                              Store 43 41
+              46:     39(ptr) AccessChain 27(flattenTemp) 45
+              47:   10(float) Load 46
+              48:     42(ptr) AccessChain 44(OutputStream_cull0) 38
+                              Store 48 47
+              53:     52(ptr) AccessChain 27(flattenTemp) 51
+              54:      6(int) Load 53
+                              Store 50(OutputStream_vpai) 54
+              57:     52(ptr) AccessChain 27(flattenTemp) 56
+              58:      6(int) Load 57
+                              Store 55(OutputStream_rtai) 58
+              64:     63(ptr) AccessChain 27(flattenTemp) 62
+              65:     11(int) Load 64
+              67:     66(ptr) AccessChain 61(@entryPointOutput) 38
+                              Store 67 65
                               Return
                               FunctionEnd
 17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;):       12(S) Function None 14
diff --git a/Test/baseResults/hlsl.semantic.vert.out b/Test/baseResults/hlsl.semantic.vert.out
index 3618fee..1ff53fa 100755
--- a/Test/baseResults/hlsl.semantic.vert.out
+++ b/Test/baseResults/hlsl.semantic.vert.out
@@ -1,117 +1,109 @@
 hlsl.semantic.vert
 Shader version: 500
 0:? Sequence
-0:12  Function Definition: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12    Function Parameters: 
-0:12      'ins' ( in structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
+0:10  Function Definition: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10    Function Parameters: 
+0:10      'ins' ( in structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
 0:?     Sequence
-0:14      Branch: Return with expression
-0:14        's' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12  Function Definition: main( ( temp void)
-0:12    Function Parameters: 
+0:12      Branch: Return with expression
+0:12        's' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
 0:?     Sequence
-0:12      Sequence
-0:12        move second child to first child ( temp float)
-0:12          clip: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:?           'clip' (layout( location=0) in float)
-0:12        move second child to first child ( temp float)
-0:12          clip0: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
-0:?           'clip0' (layout( location=1) in float)
-0:12        move second child to first child ( temp float)
-0:12          clip7: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              2 (const int)
-0:?           'clip7' (layout( location=2) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              3 (const int)
-0:?           'cull' (layout( location=3) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull2: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              4 (const int)
-0:?           'cull2' (layout( location=4) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull5: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              5 (const int)
-0:?           'cull5' (layout( location=5) in float)
-0:12        move second child to first child ( temp int)
-0:12          ii: direct index for structure ( temp int)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              6 (const int)
+0:10      Sequence
+0:10        move second child to first child ( temp float)
+0:10          clip0: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              0 (const int)
+0:?           'clip0' (layout( location=0) in float)
+0:10        move second child to first child ( temp float)
+0:10          clip1: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              1 (const int)
+0:?           'clip1' (layout( location=1) in float)
+0:10        move second child to first child ( temp float)
+0:10          cull0: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              2 (const int)
+0:?           'cull0' (layout( location=2) in float)
+0:10        move second child to first child ( temp float)
+0:10          cull1: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              3 (const int)
+0:?           'cull1' (layout( location=3) in float)
+0:10        move second child to first child ( temp int)
+0:10          ii: direct index for structure ( temp int)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              4 (const int)
 0:?           'ii' ( in int InstanceIndex)
-0:12      Sequence
-0:12        move second child to first child ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12          'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12          Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip7: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              2 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              3 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull2: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              4 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull5: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              5 (const int)
-0:12        move second child to first child ( temp int)
-0:12          ii: direct index for structure ( temp int)
-0:12            '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12          ii: direct index for structure ( temp int)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              6 (const int)
+0:10      Sequence
+0:10        move second child to first child ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10          'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10          Function Call: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:10              Constant:
+0:10                0 (const int)
+0:10            clip0: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                0 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:10              Constant:
+0:10                1 (const int)
+0:10            clip1: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                1 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
+0:10              Constant:
+0:10                0 (const int)
+0:10            cull0: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                2 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
+0:10              Constant:
+0:10                1 (const int)
+0:10            cull1: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                3 (const int)
+0:10        move second child to first child ( temp int)
+0:10          ii: direct index for structure ( temp int)
+0:10            '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
+0:10            Constant:
+0:10              0 (const int)
+0:10          ii: direct index for structure ( temp int)
+0:10            'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              4 (const int)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
-0:?     'clip' (layout( location=0) in float)
-0:?     'clip0' (layout( location=1) in float)
-0:?     'clip7' (layout( location=2) in float)
-0:?     'cull' (layout( location=3) in float)
-0:?     'cull2' (layout( location=4) in float)
-0:?     'cull5' (layout( location=5) in float)
+0:?     'clip0' (layout( location=0) in float)
+0:?     'clip1' (layout( location=1) in float)
+0:?     'cull0' (layout( location=2) in float)
+0:?     'cull1' (layout( location=3) in float)
 0:?     'ii' ( in int InstanceIndex)
+0:?     '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:?     '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
 
 
 Linked vertex stage:
@@ -119,253 +111,231 @@
 
 Shader version: 500
 0:? Sequence
-0:12  Function Definition: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12    Function Parameters: 
-0:12      'ins' ( in structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
+0:10  Function Definition: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10    Function Parameters: 
+0:10      'ins' ( in structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
 0:?     Sequence
-0:14      Branch: Return with expression
-0:14        's' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12  Function Definition: main( ( temp void)
-0:12    Function Parameters: 
+0:12      Branch: Return with expression
+0:12        's' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10  Function Definition: main( ( temp void)
+0:10    Function Parameters: 
 0:?     Sequence
-0:12      Sequence
-0:12        move second child to first child ( temp float)
-0:12          clip: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:?           'clip' (layout( location=0) in float)
-0:12        move second child to first child ( temp float)
-0:12          clip0: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
-0:?           'clip0' (layout( location=1) in float)
-0:12        move second child to first child ( temp float)
-0:12          clip7: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              2 (const int)
-0:?           'clip7' (layout( location=2) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              3 (const int)
-0:?           'cull' (layout( location=3) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull2: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              4 (const int)
-0:?           'cull2' (layout( location=4) in float)
-0:12        move second child to first child ( temp float)
-0:12          cull5: direct index for structure ( temp float)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              5 (const int)
-0:?           'cull5' (layout( location=5) in float)
-0:12        move second child to first child ( temp int)
-0:12          ii: direct index for structure ( temp int)
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              6 (const int)
+0:10      Sequence
+0:10        move second child to first child ( temp float)
+0:10          clip0: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              0 (const int)
+0:?           'clip0' (layout( location=0) in float)
+0:10        move second child to first child ( temp float)
+0:10          clip1: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              1 (const int)
+0:?           'clip1' (layout( location=1) in float)
+0:10        move second child to first child ( temp float)
+0:10          cull0: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              2 (const int)
+0:?           'cull0' (layout( location=2) in float)
+0:10        move second child to first child ( temp float)
+0:10          cull1: direct index for structure ( temp float)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              3 (const int)
+0:?           'cull1' (layout( location=3) in float)
+0:10        move second child to first child ( temp int)
+0:10          ii: direct index for structure ( temp int)
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              4 (const int)
 0:?           'ii' ( in int InstanceIndex)
-0:12      Sequence
-0:12        move second child to first child ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12          'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12          Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:?             'ins' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip0: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              1 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_clip7' ( out float ClipDistance)
-0:12          clip7: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              2 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              3 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull2: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              4 (const int)
-0:12        move second child to first child ( temp float)
-0:?           '@entryPointOutput_cull5' ( out float CullDistance)
-0:12          cull5: direct index for structure ( temp float)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              5 (const int)
-0:12        move second child to first child ( temp int)
-0:12          ii: direct index for structure ( temp int)
-0:12            '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
-0:12            Constant:
-0:12              0 (const int)
-0:12          ii: direct index for structure ( temp int)
-0:12            'flattenTemp' ( temp structure{ temp float clip,  temp float clip0,  temp float clip7,  temp float cull,  temp float cull2,  temp float cull5,  temp int ii})
-0:12            Constant:
-0:12              6 (const int)
+0:10      Sequence
+0:10        move second child to first child ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10          'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10          Function Call: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:?             'ins' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:10              Constant:
+0:10                0 (const int)
+0:10            clip0: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                0 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:10              Constant:
+0:10                1 (const int)
+0:10            clip1: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                1 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
+0:10              Constant:
+0:10                0 (const int)
+0:10            cull0: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                2 (const int)
+0:?         Sequence
+0:10          move second child to first child ( temp float)
+0:10            direct index ( temp float)
+0:?               '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
+0:10              Constant:
+0:10                1 (const int)
+0:10            cull1: direct index for structure ( temp float)
+0:10              'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10              Constant:
+0:10                3 (const int)
+0:10        move second child to first child ( temp int)
+0:10          ii: direct index for structure ( temp int)
+0:10            '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
+0:10            Constant:
+0:10              0 (const int)
+0:10          ii: direct index for structure ( temp int)
+0:10            'flattenTemp' ( temp structure{ temp float clip0,  temp float clip1,  temp float cull0,  temp float cull1,  temp int ii})
+0:10            Constant:
+0:10              4 (const int)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp int ii})
-0:?     'clip' (layout( location=0) in float)
-0:?     'clip0' (layout( location=1) in float)
-0:?     'clip7' (layout( location=2) in float)
-0:?     'cull' (layout( location=3) in float)
-0:?     'cull2' (layout( location=4) in float)
-0:?     'cull5' (layout( location=5) in float)
+0:?     'clip0' (layout( location=0) in float)
+0:?     'clip1' (layout( location=1) in float)
+0:?     'cull0' (layout( location=2) in float)
+0:?     'cull1' (layout( location=3) in float)
 0:?     'ii' ( in int InstanceIndex)
+0:?     '@entryPointOutput_clip1' ( out 2-element array of float ClipDistance)
+0:?     '@entryPointOutput_cull1' ( out 2-element array of float CullDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 77
+// Id's are bound by 73
 
                               Capability Shader
                               Capability ClipDistance
                               Capability CullDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 21 26 30 34 38 42 47 56 63 72
+                              EntryPoint Vertex 4  "main" 21 26 30 34 39 51 59 68
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "S"
-                              MemberName 8(S) 0  "clip"
-                              MemberName 8(S) 1  "clip0"
-                              MemberName 8(S) 2  "clip7"
-                              MemberName 8(S) 3  "cull"
-                              MemberName 8(S) 4  "cull2"
-                              MemberName 8(S) 5  "cull5"
-                              MemberName 8(S) 6  "ii"
-                              Name 12  "@main(struct-S-f1-f1-f1-f1-f1-f1-i11;"
+                              MemberName 8(S) 0  "clip0"
+                              MemberName 8(S) 1  "clip1"
+                              MemberName 8(S) 2  "cull0"
+                              MemberName 8(S) 3  "cull1"
+                              MemberName 8(S) 4  "ii"
+                              Name 12  "@main(struct-S-f1-f1-f1-f1-i11;"
                               Name 11  "ins"
                               Name 14  "s"
                               Name 18  "ins"
-                              Name 21  "clip"
-                              Name 26  "clip0"
-                              Name 30  "clip7"
-                              Name 34  "cull"
-                              Name 38  "cull2"
-                              Name 42  "cull5"
-                              Name 47  "ii"
-                              Name 51  "flattenTemp"
-                              Name 52  "param"
-                              Name 56  "@entryPointOutput_clip7"
-                              Name 63  "@entryPointOutput_cull5"
-                              Name 70  "S"
-                              MemberName 70(S) 0  "ii"
-                              Name 72  "@entryPointOutput"
-                              Decorate 21(clip) Location 0
-                              Decorate 26(clip0) Location 1
-                              Decorate 30(clip7) Location 2
-                              Decorate 34(cull) Location 3
-                              Decorate 38(cull2) Location 4
-                              Decorate 42(cull5) Location 5
-                              Decorate 47(ii) BuiltIn InstanceIndex
-                              Decorate 56(@entryPointOutput_clip7) BuiltIn ClipDistance
-                              Decorate 63(@entryPointOutput_cull5) BuiltIn CullDistance
-                              Decorate 72(@entryPointOutput) Location 0
+                              Name 21  "clip0"
+                              Name 26  "clip1"
+                              Name 30  "cull0"
+                              Name 34  "cull1"
+                              Name 39  "ii"
+                              Name 43  "flattenTemp"
+                              Name 44  "param"
+                              Name 51  "@entryPointOutput_clip1"
+                              Name 59  "@entryPointOutput_cull1"
+                              Name 66  "S"
+                              MemberName 66(S) 0  "ii"
+                              Name 68  "@entryPointOutput"
+                              Decorate 21(clip0) Location 0
+                              Decorate 26(clip1) Location 1
+                              Decorate 30(cull0) Location 2
+                              Decorate 34(cull1) Location 3
+                              Decorate 39(ii) BuiltIn InstanceIndex
+                              Decorate 51(@entryPointOutput_clip1) BuiltIn ClipDistance
+                              Decorate 59(@entryPointOutput_cull1) BuiltIn CullDistance
+                              Decorate 68(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypeInt 32 1
-            8(S):             TypeStruct 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 7(int)
+            8(S):             TypeStruct 6(float) 6(float) 6(float) 6(float) 7(int)
                9:             TypePointer Function 8(S)
               10:             TypeFunction 8(S) 9(ptr)
               19:      7(int) Constant 0
               20:             TypePointer Input 6(float)
-        21(clip):     20(ptr) Variable Input
+       21(clip0):     20(ptr) Variable Input
               23:             TypePointer Function 6(float)
               25:      7(int) Constant 1
-       26(clip0):     20(ptr) Variable Input
+       26(clip1):     20(ptr) Variable Input
               29:      7(int) Constant 2
-       30(clip7):     20(ptr) Variable Input
+       30(cull0):     20(ptr) Variable Input
               33:      7(int) Constant 3
-        34(cull):     20(ptr) Variable Input
+       34(cull1):     20(ptr) Variable Input
               37:      7(int) Constant 4
-       38(cull2):     20(ptr) Variable Input
-              41:      7(int) Constant 5
-       42(cull5):     20(ptr) Variable Input
-              45:      7(int) Constant 6
-              46:             TypePointer Input 7(int)
-          47(ii):     46(ptr) Variable Input
-              49:             TypePointer Function 7(int)
-              55:             TypePointer Output 6(float)
-56(@entryPointOutput_clip7):     55(ptr) Variable Output
-63(@entryPointOutput_cull5):     55(ptr) Variable Output
-           70(S):             TypeStruct 7(int)
-              71:             TypePointer Output 70(S)
-72(@entryPointOutput):     71(ptr) Variable Output
-              75:             TypePointer Output 7(int)
+              38:             TypePointer Input 7(int)
+          39(ii):     38(ptr) Variable Input
+              41:             TypePointer Function 7(int)
+              47:             TypeInt 32 0
+              48:     47(int) Constant 2
+              49:             TypeArray 6(float) 48
+              50:             TypePointer Output 49
+51(@entryPointOutput_clip1):     50(ptr) Variable Output
+              54:             TypePointer Output 6(float)
+59(@entryPointOutput_cull1):     50(ptr) Variable Output
+           66(S):             TypeStruct 7(int)
+              67:             TypePointer Output 66(S)
+68(@entryPointOutput):     67(ptr) Variable Output
+              71:             TypePointer Output 7(int)
          4(main):           2 Function None 3
                5:             Label
          18(ins):      9(ptr) Variable Function
- 51(flattenTemp):      9(ptr) Variable Function
-       52(param):      9(ptr) Variable Function
-              22:    6(float) Load 21(clip)
+ 43(flattenTemp):      9(ptr) Variable Function
+       44(param):      9(ptr) Variable Function
+              22:    6(float) Load 21(clip0)
               24:     23(ptr) AccessChain 18(ins) 19
                               Store 24 22
-              27:    6(float) Load 26(clip0)
+              27:    6(float) Load 26(clip1)
               28:     23(ptr) AccessChain 18(ins) 25
                               Store 28 27
-              31:    6(float) Load 30(clip7)
+              31:    6(float) Load 30(cull0)
               32:     23(ptr) AccessChain 18(ins) 29
                               Store 32 31
-              35:    6(float) Load 34(cull)
+              35:    6(float) Load 34(cull1)
               36:     23(ptr) AccessChain 18(ins) 33
                               Store 36 35
-              39:    6(float) Load 38(cull2)
-              40:     23(ptr) AccessChain 18(ins) 37
-                              Store 40 39
-              43:    6(float) Load 42(cull5)
-              44:     23(ptr) AccessChain 18(ins) 41
-                              Store 44 43
-              48:      7(int) Load 47(ii)
-              50:     49(ptr) AccessChain 18(ins) 45
-                              Store 50 48
-              53:        8(S) Load 18(ins)
-                              Store 52(param) 53
-              54:        8(S) FunctionCall 12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;) 52(param)
-                              Store 51(flattenTemp) 54
-              57:     23(ptr) AccessChain 51(flattenTemp) 19
-              58:    6(float) Load 57
-                              Store 56(@entryPointOutput_clip7) 58
-              59:     23(ptr) AccessChain 51(flattenTemp) 25
-              60:    6(float) Load 59
-                              Store 56(@entryPointOutput_clip7) 60
-              61:     23(ptr) AccessChain 51(flattenTemp) 29
-              62:    6(float) Load 61
-                              Store 56(@entryPointOutput_clip7) 62
-              64:     23(ptr) AccessChain 51(flattenTemp) 33
-              65:    6(float) Load 64
-                              Store 63(@entryPointOutput_cull5) 65
-              66:     23(ptr) AccessChain 51(flattenTemp) 37
-              67:    6(float) Load 66
-                              Store 63(@entryPointOutput_cull5) 67
-              68:     23(ptr) AccessChain 51(flattenTemp) 41
-              69:    6(float) Load 68
-                              Store 63(@entryPointOutput_cull5) 69
-              73:     49(ptr) AccessChain 51(flattenTemp) 45
-              74:      7(int) Load 73
-              76:     75(ptr) AccessChain 72(@entryPointOutput) 19
-                              Store 76 74
+              40:      7(int) Load 39(ii)
+              42:     41(ptr) AccessChain 18(ins) 37
+                              Store 42 40
+              45:        8(S) Load 18(ins)
+                              Store 44(param) 45
+              46:        8(S) FunctionCall 12(@main(struct-S-f1-f1-f1-f1-i11;) 44(param)
+                              Store 43(flattenTemp) 46
+              52:     23(ptr) AccessChain 43(flattenTemp) 19
+              53:    6(float) Load 52
+              55:     54(ptr) AccessChain 51(@entryPointOutput_clip1) 19
+                              Store 55 53
+              56:     23(ptr) AccessChain 43(flattenTemp) 25
+              57:    6(float) Load 56
+              58:     54(ptr) AccessChain 51(@entryPointOutput_clip1) 25
+                              Store 58 57
+              60:     23(ptr) AccessChain 43(flattenTemp) 29
+              61:    6(float) Load 60
+              62:     54(ptr) AccessChain 59(@entryPointOutput_cull1) 19
+                              Store 62 61
+              63:     23(ptr) AccessChain 43(flattenTemp) 33
+              64:    6(float) Load 63
+              65:     54(ptr) AccessChain 59(@entryPointOutput_cull1) 25
+                              Store 65 64
+              69:     41(ptr) AccessChain 43(flattenTemp) 37
+              70:      7(int) Load 69
+              72:     71(ptr) AccessChain 68(@entryPointOutput) 19
+                              Store 72 70
                               Return
                               FunctionEnd
-12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;):        8(S) Function None 10
+12(@main(struct-S-f1-f1-f1-f1-i11;):        8(S) Function None 10
          11(ins):      9(ptr) FunctionParameter
               13:             Label
            14(s):      9(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.struct.frag.out b/Test/baseResults/hlsl.struct.frag.out
index 6798bae..4501f80 100755
--- a/Test/baseResults/hlsl.struct.frag.out
+++ b/Test/baseResults/hlsl.struct.frag.out
@@ -44,7 +44,7 @@
 0:40            Constant:
 0:40              0 (const int)
 0:40          a: direct index for structure ( smooth temp 4-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              0 (const int)
 0:40        move second child to first child ( temp bool)
@@ -53,7 +53,7 @@
 0:40            Constant:
 0:40              1 (const int)
 0:40          b: direct index for structure ( flat temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              1 (const int)
 0:40        move second child to first child ( temp 1-component vector of float)
@@ -62,7 +62,7 @@
 0:40            Constant:
 0:40              2 (const int)
 0:40          c: direct index for structure ( centroid noperspective temp 1-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              2 (const int)
 0:40        move second child to first child ( temp 2-component vector of float)
@@ -71,7 +71,7 @@
 0:40            Constant:
 0:40              3 (const int)
 0:40          d: direct index for structure ( centroid sample temp 2-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              3 (const int)
 0:40        move second child to first child ( temp bool)
@@ -79,14 +79,14 @@
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              4 (const int)
-0:?           's_ff1' ( in bool Face)
+0:?           's_ff1' ( flat in bool Face)
 0:40        move second child to first child ( temp bool)
 0:40          ff2: direct index for structure ( temp bool)
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              5 (const int)
-0:40          ff2: direct index for structure ( temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40          ff2: direct index for structure ( flat temp bool)
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              4 (const int)
 0:40        move second child to first child ( temp bool)
@@ -94,8 +94,8 @@
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              6 (const int)
-0:40          ff3: direct index for structure ( temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40          ff3: direct index for structure ( flat temp bool)
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              5 (const int)
 0:40        move second child to first child ( temp 4-component vector of float)
@@ -104,7 +104,7 @@
 0:40            Constant:
 0:40              7 (const int)
 0:40          ff4: direct index for structure ( temp 4-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              6 (const int)
 0:40      move second child to first child ( temp 4-component vector of float)
@@ -117,8 +117,8 @@
 0:?     's2' ( global structure{ temp 4-component vector of float i})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
-0:?     's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
-0:?     's_ff1' ( in bool Face)
+0:?     's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
+0:?     's_ff1' ( flat in bool Face)
 
 
 Linked fragment stage:
@@ -165,7 +165,7 @@
 0:40            Constant:
 0:40              0 (const int)
 0:40          a: direct index for structure ( smooth temp 4-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              0 (const int)
 0:40        move second child to first child ( temp bool)
@@ -174,7 +174,7 @@
 0:40            Constant:
 0:40              1 (const int)
 0:40          b: direct index for structure ( flat temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              1 (const int)
 0:40        move second child to first child ( temp 1-component vector of float)
@@ -183,7 +183,7 @@
 0:40            Constant:
 0:40              2 (const int)
 0:40          c: direct index for structure ( centroid noperspective temp 1-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              2 (const int)
 0:40        move second child to first child ( temp 2-component vector of float)
@@ -192,7 +192,7 @@
 0:40            Constant:
 0:40              3 (const int)
 0:40          d: direct index for structure ( centroid sample temp 2-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              3 (const int)
 0:40        move second child to first child ( temp bool)
@@ -200,14 +200,14 @@
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              4 (const int)
-0:?           's_ff1' ( in bool Face)
+0:?           's_ff1' ( flat in bool Face)
 0:40        move second child to first child ( temp bool)
 0:40          ff2: direct index for structure ( temp bool)
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              5 (const int)
-0:40          ff2: direct index for structure ( temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40          ff2: direct index for structure ( flat temp bool)
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              4 (const int)
 0:40        move second child to first child ( temp bool)
@@ -215,8 +215,8 @@
 0:?             's' ( temp structure{ temp 4-component vector of float a,  temp bool b,  temp 1-component vector of float c,  temp 2-component vector of float d,  temp bool ff1,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              6 (const int)
-0:40          ff3: direct index for structure ( temp bool)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40          ff3: direct index for structure ( flat temp bool)
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              5 (const int)
 0:40        move second child to first child ( temp 4-component vector of float)
@@ -225,7 +225,7 @@
 0:40            Constant:
 0:40              7 (const int)
 0:40          ff4: direct index for structure ( temp 4-component vector of float)
-0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
+0:40            's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
 0:40            Constant:
 0:40              6 (const int)
 0:40      move second child to first child ( temp 4-component vector of float)
@@ -238,8 +238,8 @@
 0:?     's2' ( global structure{ temp 4-component vector of float i})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
-0:?     's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  temp bool ff2,  temp bool ff3,  temp 4-component vector of float ff4})
-0:?     's_ff1' ( in bool Face)
+0:?     's' (layout( location=1) in structure{ smooth temp 4-component vector of float a,  flat temp bool b,  centroid noperspective temp 1-component vector of float c,  centroid sample temp 2-component vector of float d,  flat temp bool ff2,  flat temp bool ff3,  temp 4-component vector of float ff4})
+0:?     's_ff1' ( flat in bool Face)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -306,7 +306,10 @@
                               MemberDecorate 54(IN_S) 2 NoPerspective
                               MemberDecorate 54(IN_S) 2 Centroid
                               MemberDecorate 54(IN_S) 3 Centroid
+                              MemberDecorate 54(IN_S) 4 Flat
+                              MemberDecorate 54(IN_S) 5 Flat
                               Decorate 56(s) Location 1
+                              Decorate 79(s_ff1) Flat
                               Decorate 79(s_ff1) BuiltIn FrontFacing
                               Decorate 94(@entryPointOutput) Location 0
                               MemberDecorate 101(myS) 0 Offset 0
diff --git a/Test/baseResults/hlsl.struct.split.assign.frag.out b/Test/baseResults/hlsl.struct.split.assign.frag.out
index 2228a8a..7bce9c9 100644
--- a/Test/baseResults/hlsl.struct.split.assign.frag.out
+++ b/Test/baseResults/hlsl.struct.split.assign.frag.out
@@ -20,7 +20,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp int)
 0:?         'i' ( temp int)
-0:?         'i' (layout( location=0) in int)
+0:?         'i' (layout( location=0) flat in int)
 0:7      Sequence
 0:7        move second child to first child ( temp float)
 0:7          f: direct index for structure ( temp float)
@@ -110,7 +110,7 @@
 0:?           'input' ( temp 3-element array of structure{ temp float f,  temp 4-component vector of float pos})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in int)
+0:?     'i' (layout( location=0) flat in int)
 0:?     'input' (layout( location=1) in 3-element array of structure{ temp float f})
 0:?     'input_pos' ( in 3-element array of 4-component vector of float FragCoord)
 
@@ -139,7 +139,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp int)
 0:?         'i' ( temp int)
-0:?         'i' (layout( location=0) in int)
+0:?         'i' (layout( location=0) flat in int)
 0:7      Sequence
 0:7        move second child to first child ( temp float)
 0:7          f: direct index for structure ( temp float)
@@ -229,7 +229,7 @@
 0:?           'input' ( temp 3-element array of structure{ temp float f,  temp 4-component vector of float pos})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'i' (layout( location=0) in int)
+0:?     'i' (layout( location=0) flat in int)
 0:?     'input' (layout( location=1) in 3-element array of structure{ temp float f})
 0:?     'input_pos' ( in 3-element array of 4-component vector of float FragCoord)
 
@@ -261,6 +261,7 @@
                               Name 67  "@entryPointOutput"
                               Name 68  "param"
                               Name 70  "param"
+                              Decorate 32(i) Flat
                               Decorate 32(i) Location 0
                               Decorate 39(input) Location 1
                               Decorate 48(input_pos) BuiltIn FragCoord
diff --git a/Test/baseResults/hlsl.struct.split.nested.geom.out b/Test/baseResults/hlsl.struct.split.nested.geom.out
index 2f010f5..9cb61ca 100644
--- a/Test/baseResults/hlsl.struct.split.nested.geom.out
+++ b/Test/baseResults/hlsl.struct.split.nested.geom.out
@@ -34,42 +34,78 @@
 0:?         Constant:
 0:?           5.000000
 0:?           6.000000
-0:30      Sequence
-0:30        Sequence
-0:30          move second child to first child ( temp 4-component vector of float)
-0:?             'ts_psIn_pos' ( out 4-component vector of float Position)
-0:30            pos: direct index for structure ( temp 4-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
-0:30                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                0 (const int)
-0:30          move second child to first child ( temp 2-component vector of float)
-0:30            tc: direct index for structure ( temp 2-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
-0:30                'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                0 (const int)
-0:30            tc: direct index for structure ( temp 2-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
-0:30                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                1 (const int)
-0:30          move second child to first child ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
-0:30            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
-0:30              'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30              Constant:
-0:30                1 (const int)
+0:29      move second child to first child ( temp float)
+0:29        direct index ( temp float)
+0:29          m0_array: direct index for structure ( temp 2-element array of float)
+0:29            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:29              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:29              Constant:
+0:29                1 (const int)
+0:29            Constant:
+0:29              0 (const int)
+0:29          Constant:
+0:29            0 (const int)
+0:29        Constant:
+0:29          2.300000
+0:30      move second child to first child ( temp float)
+0:30        direct index ( temp float)
+0:30          m0_array: direct index for structure ( temp 2-element array of float)
 0:30            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
 0:30              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
 0:30              Constant:
 0:30                1 (const int)
-0:30        EmitVertex ( temp void)
+0:30            Constant:
+0:30              0 (const int)
+0:30          Constant:
+0:30            1 (const int)
+0:30        Constant:
+0:30          2.300000
+0:31      move second child to first child ( temp int)
+0:31        m1: direct index for structure ( temp int)
+0:31          contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:31            'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:31            Constant:
+0:31              1 (const int)
+0:31          Constant:
+0:31            1 (const int)
+0:31        Constant:
+0:31          2 (const int)
+0:33      Sequence
+0:33        Sequence
+0:33          move second child to first child ( temp 4-component vector of float)
+0:?             'ts_psIn_pos' ( out 4-component vector of float Position)
+0:33            pos: direct index for structure ( temp 4-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
+0:33                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                0 (const int)
+0:33          move second child to first child ( temp 2-component vector of float)
+0:33            tc: direct index for structure ( temp 2-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
+0:33                'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                0 (const int)
+0:33            tc: direct index for structure ( temp 2-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
+0:33                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                1 (const int)
+0:33          move second child to first child ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33              'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33              Constant:
+0:33                1 (const int)
+0:33            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33              Constant:
+0:33                1 (const int)
+0:33        EmitVertex ( temp void)
 0:24  Function Definition: main( ( temp void)
 0:24    Function Parameters: 
 0:?     Sequence
@@ -201,42 +237,78 @@
 0:?         Constant:
 0:?           5.000000
 0:?           6.000000
-0:30      Sequence
-0:30        Sequence
-0:30          move second child to first child ( temp 4-component vector of float)
-0:?             'ts_psIn_pos' ( out 4-component vector of float Position)
-0:30            pos: direct index for structure ( temp 4-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
-0:30                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                0 (const int)
-0:30          move second child to first child ( temp 2-component vector of float)
-0:30            tc: direct index for structure ( temp 2-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
-0:30                'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                0 (const int)
-0:30            tc: direct index for structure ( temp 2-component vector of float)
-0:30              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
-0:30                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30                Constant:
-0:30                  0 (const int)
-0:30              Constant:
-0:30                1 (const int)
-0:30          move second child to first child ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
-0:30            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
-0:30              'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
-0:30              Constant:
-0:30                1 (const int)
+0:29      move second child to first child ( temp float)
+0:29        direct index ( temp float)
+0:29          m0_array: direct index for structure ( temp 2-element array of float)
+0:29            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:29              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:29              Constant:
+0:29                1 (const int)
+0:29            Constant:
+0:29              0 (const int)
+0:29          Constant:
+0:29            0 (const int)
+0:29        Constant:
+0:29          2.300000
+0:30      move second child to first child ( temp float)
+0:30        direct index ( temp float)
+0:30          m0_array: direct index for structure ( temp 2-element array of float)
 0:30            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
 0:30              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
 0:30              Constant:
 0:30                1 (const int)
-0:30        EmitVertex ( temp void)
+0:30            Constant:
+0:30              0 (const int)
+0:30          Constant:
+0:30            1 (const int)
+0:30        Constant:
+0:30          2.300000
+0:31      move second child to first child ( temp int)
+0:31        m1: direct index for structure ( temp int)
+0:31          contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:31            'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:31            Constant:
+0:31              1 (const int)
+0:31          Constant:
+0:31            1 (const int)
+0:31        Constant:
+0:31          2 (const int)
+0:33      Sequence
+0:33        Sequence
+0:33          move second child to first child ( temp 4-component vector of float)
+0:?             'ts_psIn_pos' ( out 4-component vector of float Position)
+0:33            pos: direct index for structure ( temp 4-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
+0:33                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                0 (const int)
+0:33          move second child to first child ( temp 2-component vector of float)
+0:33            tc: direct index for structure ( temp 2-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
+0:33                'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                0 (const int)
+0:33            tc: direct index for structure ( temp 2-component vector of float)
+0:33              psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc})
+0:33                'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33                Constant:
+0:33                  0 (const int)
+0:33              Constant:
+0:33                1 (const int)
+0:33          move second child to first child ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33              'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33              Constant:
+0:33                1 (const int)
+0:33            contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array,  temp int m1})
+0:33              'o' ( temp structure{ temp structure{ temp 4-component vector of float pos,  temp 2-component vector of float tc} psIn,  temp structure{ temp 2-element array of float m0_array,  temp int m1} contains_no_builtin_io})
+0:33              Constant:
+0:33                1 (const int)
+0:33        EmitVertex ( temp void)
 0:24  Function Definition: main( ( temp void)
 0:24    Function Parameters: 
 0:?     Sequence
@@ -331,12 +403,12 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 99
+// Id's are bound by 105
 
                               Capability Geometry
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Geometry 4  "main" 41 48 67 75
+                              EntryPoint Geometry 4  "main" 48 55 74 82
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 Invocations 1
                               ExecutionMode 4 OutputTriangleStrip
@@ -356,28 +428,28 @@
                               Name 21  "tin"
                               Name 22  "ts"
                               Name 25  "o"
-                              Name 41  "ts_psIn_pos"
-                              Name 44  "PS_IN"
-                              MemberName 44(PS_IN) 0  "tc"
-                              Name 45  "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO"
-                              MemberName 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0  "m0_array"
-                              MemberName 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1  "m1"
-                              Name 46  "GS_OUT"
-                              MemberName 46(GS_OUT) 0  "psIn"
-                              MemberName 46(GS_OUT) 1  "contains_no_builtin_io"
-                              Name 48  "ts"
-                              Name 64  "tin"
-                              Name 67  "tin_pos"
-                              Name 72  "PS_IN"
-                              MemberName 72(PS_IN) 0  "tc"
-                              Name 75  "tin"
-                              Name 93  "ts"
-                              Name 94  "param"
-                              Name 96  "param"
-                              Decorate 41(ts_psIn_pos) BuiltIn Position
-                              Decorate 48(ts) Location 0
-                              Decorate 67(tin_pos) BuiltIn Position
-                              Decorate 75(tin) Location 0
+                              Name 48  "ts_psIn_pos"
+                              Name 51  "PS_IN"
+                              MemberName 51(PS_IN) 0  "tc"
+                              Name 52  "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO"
+                              MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0  "m0_array"
+                              MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1  "m1"
+                              Name 53  "GS_OUT"
+                              MemberName 53(GS_OUT) 0  "psIn"
+                              MemberName 53(GS_OUT) 1  "contains_no_builtin_io"
+                              Name 55  "ts"
+                              Name 71  "tin"
+                              Name 74  "tin_pos"
+                              Name 79  "PS_IN"
+                              MemberName 79(PS_IN) 0  "tc"
+                              Name 82  "tin"
+                              Name 99  "ts"
+                              Name 100  "param"
+                              Name 102  "param"
+                              Decorate 48(ts_psIn_pos) BuiltIn Position
+                              Decorate 55(ts) Location 0
+                              Decorate 74(tin_pos) BuiltIn Position
+                              Decorate 82(tin) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -407,63 +479,66 @@
               36:    6(float) Constant 1086324736
               37:    8(fvec2) ConstantComposite 35 36
               38:             TypePointer Function 8(fvec2)
-              40:             TypePointer Output 7(fvec4)
- 41(ts_psIn_pos):     40(ptr) Variable Output
-       44(PS_IN):             TypeStruct 8(fvec2)
-45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO):             TypeStruct 15 16(int)
-      46(GS_OUT):             TypeStruct 44(PS_IN) 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
-              47:             TypePointer Output 46(GS_OUT)
-          48(ts):     47(ptr) Variable Output
-              51:             TypePointer Output 8(fvec2)
-              53:             TypePointer Function 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
-              56:             TypePointer Output 45(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
-              59:             TypePointer Output 15
-              62:             TypePointer Output 16(int)
-              65:             TypeArray 7(fvec4) 11
-              66:             TypePointer Input 65
-     67(tin_pos):     66(ptr) Variable Input
-              68:             TypePointer Input 7(fvec4)
-       72(PS_IN):             TypeStruct 8(fvec2)
-              73:             TypeArray 72(PS_IN) 11
-              74:             TypePointer Input 73
-         75(tin):     74(ptr) Variable Input
-              76:             TypePointer Input 8(fvec2)
-              86:     16(int) Constant 2
+              40:    6(float) Constant 1075000115
+              41:             TypePointer Function 6(float)
+              44:     16(int) Constant 2
+              45:             TypePointer Function 16(int)
+              47:             TypePointer Output 7(fvec4)
+ 48(ts_psIn_pos):     47(ptr) Variable Output
+       51(PS_IN):             TypeStruct 8(fvec2)
+52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO):             TypeStruct 15 16(int)
+      53(GS_OUT):             TypeStruct 51(PS_IN) 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
+              54:             TypePointer Output 53(GS_OUT)
+          55(ts):     54(ptr) Variable Output
+              58:             TypePointer Output 8(fvec2)
+              60:             TypePointer Function 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
+              63:             TypePointer Output 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
+              66:             TypePointer Output 15
+              69:             TypePointer Output 16(int)
+              72:             TypeArray 7(fvec4) 11
+              73:             TypePointer Input 72
+     74(tin_pos):     73(ptr) Variable Input
+              75:             TypePointer Input 7(fvec4)
+       79(PS_IN):             TypeStruct 8(fvec2)
+              80:             TypeArray 79(PS_IN) 11
+              81:             TypePointer Input 80
+         82(tin):     81(ptr) Variable Input
+              83:             TypePointer Input 8(fvec2)
          4(main):           2 Function None 3
                5:             Label
-         64(tin):     13(ptr) Variable Function
-          93(ts):     19(ptr) Variable Function
-       94(param):     13(ptr) Variable Function
-       96(param):     19(ptr) Variable Function
-              69:     68(ptr) AccessChain 67(tin_pos) 26
-              70:    7(fvec4) Load 69
-              71:     32(ptr) AccessChain 64(tin) 26 26
-                              Store 71 70
-              77:     76(ptr) AccessChain 75(tin) 26 26
-              78:    8(fvec2) Load 77
-              79:     38(ptr) AccessChain 64(tin) 26 34
-                              Store 79 78
-              80:     68(ptr) AccessChain 67(tin_pos) 34
-              81:    7(fvec4) Load 80
-              82:     32(ptr) AccessChain 64(tin) 34 26
-                              Store 82 81
-              83:     76(ptr) AccessChain 75(tin) 34 26
-              84:    8(fvec2) Load 83
-              85:     38(ptr) AccessChain 64(tin) 34 34
-                              Store 85 84
-              87:     68(ptr) AccessChain 67(tin_pos) 86
+         71(tin):     13(ptr) Variable Function
+          99(ts):     19(ptr) Variable Function
+      100(param):     13(ptr) Variable Function
+      102(param):     19(ptr) Variable Function
+              76:     75(ptr) AccessChain 74(tin_pos) 26
+              77:    7(fvec4) Load 76
+              78:     32(ptr) AccessChain 71(tin) 26 26
+                              Store 78 77
+              84:     83(ptr) AccessChain 82(tin) 26 26
+              85:    8(fvec2) Load 84
+              86:     38(ptr) AccessChain 71(tin) 26 34
+                              Store 86 85
+              87:     75(ptr) AccessChain 74(tin_pos) 34
               88:    7(fvec4) Load 87
-              89:     32(ptr) AccessChain 64(tin) 86 26
+              89:     32(ptr) AccessChain 71(tin) 34 26
                               Store 89 88
-              90:     76(ptr) AccessChain 75(tin) 86 26
+              90:     83(ptr) AccessChain 82(tin) 34 26
               91:    8(fvec2) Load 90
-              92:     38(ptr) AccessChain 64(tin) 86 34
+              92:     38(ptr) AccessChain 71(tin) 34 34
                               Store 92 91
-              95:          12 Load 64(tin)
-                              Store 94(param) 95
-              97:           2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 94(param) 96(param)
-              98:  18(GS_OUT) Load 96(param)
-                              Store 93(ts) 98
+              93:     75(ptr) AccessChain 74(tin_pos) 44
+              94:    7(fvec4) Load 93
+              95:     32(ptr) AccessChain 71(tin) 44 26
+                              Store 95 94
+              96:     83(ptr) AccessChain 82(tin) 44 26
+              97:    8(fvec2) Load 96
+              98:     38(ptr) AccessChain 71(tin) 44 34
+                              Store 98 97
+             101:          12 Load 71(tin)
+                              Store 100(param) 101
+             103:           2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 100(param) 102(param)
+             104:  18(GS_OUT) Load 102(param)
+                              Store 99(ts) 104
                               Return
                               FunctionEnd
 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;):           2 Function None 20
@@ -475,22 +550,28 @@
                               Store 33 31
               39:     38(ptr) AccessChain 25(o) 26 34
                               Store 39 37
-              42:     32(ptr) AccessChain 25(o) 26 26
-              43:    7(fvec4) Load 42
-                              Store 41(ts_psIn_pos) 43
-              49:     38(ptr) AccessChain 25(o) 26 34
-              50:    8(fvec2) Load 49
-              52:     51(ptr) AccessChain 48(ts) 26 26
-                              Store 52 50
-              54:     53(ptr) AccessChain 25(o) 34
-              55:17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 54
-              57:     56(ptr) AccessChain 48(ts) 34
-              58:          15 CompositeExtract 55 0
-              60:     59(ptr) AccessChain 57 26
-                              Store 60 58
-              61:     16(int) CompositeExtract 55 1
-              63:     62(ptr) AccessChain 57 34
-                              Store 63 61
+              42:     41(ptr) AccessChain 25(o) 34 26 26
+                              Store 42 40
+              43:     41(ptr) AccessChain 25(o) 34 26 34
+                              Store 43 40
+              46:     45(ptr) AccessChain 25(o) 34 34
+                              Store 46 44
+              49:     32(ptr) AccessChain 25(o) 26 26
+              50:    7(fvec4) Load 49
+                              Store 48(ts_psIn_pos) 50
+              56:     38(ptr) AccessChain 25(o) 26 34
+              57:    8(fvec2) Load 56
+              59:     58(ptr) AccessChain 55(ts) 26 26
+                              Store 59 57
+              61:     60(ptr) AccessChain 25(o) 34
+              62:17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 61
+              64:     63(ptr) AccessChain 55(ts) 34
+              65:          15 CompositeExtract 62 0
+              67:     66(ptr) AccessChain 64 26
+                              Store 67 65
+              68:     16(int) CompositeExtract 62 1
+              70:     69(ptr) AccessChain 64 34
+                              Store 70 68
                               EmitVertex
                               Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.structbuffer.append.fn.frag.out b/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
index 4872478..039d4e0 100644
--- a/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
@@ -58,7 +58,7 @@
 0:?     Sequence
 0:19      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:19      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:19        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -70,7 +70,7 @@
 0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -135,7 +135,7 @@
 0:?     Sequence
 0:19      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:19      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:19        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -147,7 +147,7 @@
 0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -192,6 +192,7 @@
                               Decorate 50(sbuf_a@count) DescriptorSet 0
                               Decorate 51(sbuf_c) DescriptorSet 0
                               Decorate 52(sbuf_c@count) DescriptorSet 0
+                              Decorate 58(pos) Flat
                               Decorate 58(pos) Location 0
                               Decorate 61(@entryPointOutput) Location 0
                               MemberDecorate 65(sbuf_a@count) 0 Offset 0
diff --git a/Test/baseResults/hlsl.structbuffer.append.frag.out b/Test/baseResults/hlsl.structbuffer.append.frag.out
index 323e960..8f63efe 100644
--- a/Test/baseResults/hlsl.structbuffer.append.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.append.frag.out
@@ -45,7 +45,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -57,7 +57,7 @@
 0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -109,7 +109,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -121,7 +121,7 @@
 0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -158,6 +158,7 @@
                               Decorate 22(sbuf_a@count) DescriptorSet 0
                               Decorate 36(sbuf_c) DescriptorSet 0
                               Decorate 37(sbuf_c@count) DescriptorSet 0
+                              Decorate 48(pos) Flat
                               Decorate 48(pos) Location 0
                               Decorate 51(@entryPointOutput) Location 0
                               Decorate 55(sbuf_unused) DescriptorSet 0
diff --git a/Test/baseResults/hlsl.structbuffer.atomics.frag.out b/Test/baseResults/hlsl.structbuffer.atomics.frag.out
index c3a3f87..04d780f 100644
--- a/Test/baseResults/hlsl.structbuffer.atomics.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.atomics.frag.out
@@ -224,7 +224,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -232,7 +232,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -463,7 +463,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -471,7 +471,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -498,6 +498,7 @@
                               MemberDecorate 15(sbuf) 0 Offset 0
                               Decorate 15(sbuf) BufferBlock
                               Decorate 17(sbuf) DescriptorSet 0
+                              Decorate 80(pos) Flat
                               Decorate 80(pos) Location 0
                               Decorate 83(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.byte.frag.out b/Test/baseResults/hlsl.structbuffer.byte.frag.out
index 6541946..c5d5dc3 100644
--- a/Test/baseResults/hlsl.structbuffer.byte.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.byte.frag.out
@@ -149,7 +149,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -157,7 +157,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -313,7 +313,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -321,7 +321,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -352,6 +352,7 @@
                               MemberDecorate 16(sbuf) 0 Offset 0
                               Decorate 16(sbuf) BufferBlock
                               Decorate 18(sbuf) DescriptorSet 0
+                              Decorate 107(pos) Flat
                               Decorate 107(pos) Location 0
                               Decorate 110(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.coherent.frag.out b/Test/baseResults/hlsl.structbuffer.coherent.frag.out
index fab95f7..702d92c 100644
--- a/Test/baseResults/hlsl.structbuffer.coherent.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.coherent.frag.out
@@ -74,7 +74,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -83,7 +83,7 @@
 0:?     'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test} @data})
 0:?     'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -164,7 +164,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -173,7 +173,7 @@
 0:?     'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test} @data})
 0:?     'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -208,15 +208,14 @@
                               MemberDecorate 15(sbuf2) 0 Offset 0
                               Decorate 15(sbuf2) BufferBlock
                               Decorate 17(sbuf2) DescriptorSet 0
-                              MemberDecorate 28(sb_t) 0 Coherent
                               MemberDecorate 28(sb_t) 0 Offset 0
-                              MemberDecorate 28(sb_t) 1 Coherent
                               MemberDecorate 28(sb_t) 1 Offset 12
                               Decorate 29 ArrayStride 16
                               MemberDecorate 30(sbuf) 0 Coherent
                               MemberDecorate 30(sbuf) 0 Offset 0
                               Decorate 30(sbuf) BufferBlock
                               Decorate 32(sbuf) DescriptorSet 0
+                              Decorate 71(pos) Flat
                               Decorate 71(pos) Location 0
                               Decorate 74(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.fn.frag.out b/Test/baseResults/hlsl.structbuffer.fn.frag.out
index 0fcdab3..2e2a44f 100644
--- a/Test/baseResults/hlsl.structbuffer.fn.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.fn.frag.out
@@ -53,7 +53,7 @@
 0:?     Sequence
 0:20      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:20      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:20        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -64,7 +64,7 @@
 0:?     'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 3-component vector of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -124,7 +124,7 @@
 0:?     Sequence
 0:20      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:20      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:20        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -135,7 +135,7 @@
 0:?     'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of 3-component vector of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -184,6 +184,7 @@
                               MemberDecorate 9 0 NonWritable
                               MemberDecorate 9 0 Offset 0
                               Decorate 9 BufferBlock
+                              Decorate 13(sb) NonWritable
                               Decorate 17 ArrayStride 16
                               MemberDecorate 18 0 Offset 0
                               Decorate 18 BufferBlock
@@ -192,6 +193,7 @@
                               Decorate 48(sbuf2@count) DescriptorSet 0
                               Decorate 50(sbuf) DescriptorSet 0
                               Decorate 50(sbuf) Binding 10
+                              Decorate 63(pos) Flat
                               Decorate 63(pos) Location 0
                               Decorate 66(@entryPointOutput) Location 0
                               MemberDecorate 70(sbuf2@count) 0 Offset 0
diff --git a/Test/baseResults/hlsl.structbuffer.fn2.comp.out b/Test/baseResults/hlsl.structbuffer.fn2.comp.out
index 686a0a2..cb12ba5 100644
--- a/Test/baseResults/hlsl.structbuffer.fn2.comp.out
+++ b/Test/baseResults/hlsl.structbuffer.fn2.comp.out
@@ -166,6 +166,7 @@
                               MemberDecorate 9 0 NonWritable
                               MemberDecorate 9 0 Offset 0
                               Decorate 9 BufferBlock
+                              Decorate 14(buffer) NonWritable
                               Decorate 44(g_input) DescriptorSet 0
                               Decorate 44(g_input) Binding 0
                               Decorate 50(g_output) DescriptorSet 0
diff --git a/Test/baseResults/hlsl.structbuffer.frag.out b/Test/baseResults/hlsl.structbuffer.frag.out
index 72fba3b..a60ce80 100644
--- a/Test/baseResults/hlsl.structbuffer.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.frag.out
@@ -80,7 +80,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -89,7 +89,7 @@
 0:?     'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
 0:?     'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -176,7 +176,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -185,7 +185,7 @@
 0:?     'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
 0:?     'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -221,11 +221,8 @@
                               Name 89  "pos"
                               Name 92  "@entryPointOutput"
                               Name 93  "param"
-                              MemberDecorate 19(sb_t) 0 NonWritable
                               MemberDecorate 19(sb_t) 0 Offset 0
-                              MemberDecorate 19(sb_t) 1 NonWritable
                               MemberDecorate 19(sb_t) 1 Offset 12
-                              MemberDecorate 19(sb_t) 2 NonWritable
                               MemberDecorate 19(sb_t) 2 Offset 16
                               Decorate 20 ArrayStride 32
                               MemberDecorate 21(sbuf) 0 NonWritable
@@ -238,6 +235,7 @@
                               MemberDecorate 59(sbuf2) 0 Offset 0
                               Decorate 59(sbuf2) BufferBlock
                               Decorate 61(sbuf2) DescriptorSet 0
+                              Decorate 89(pos) Flat
                               Decorate 89(pos) Location 0
                               Decorate 92(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.incdec.frag.out b/Test/baseResults/hlsl.structbuffer.incdec.frag.out
index ebd6941..6584210 100644
--- a/Test/baseResults/hlsl.structbuffer.incdec.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.incdec.frag.out
@@ -85,7 +85,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -97,7 +97,7 @@
 0:?     'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -189,7 +189,7 @@
 0:?     Sequence
 0:7      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -201,7 +201,7 @@
 0:?     'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
 0:?     'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -242,6 +242,7 @@
                               Decorate 34(sbuf_rw_i@count) BufferBlock
                               Decorate 36(sbuf_rw_i@count) DescriptorSet 0
                               Decorate 43(sbuf_rw_d@count) DescriptorSet 0
+                              Decorate 63(pos) Flat
                               Decorate 63(pos) Location 0
                               Decorate 66(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.rw.frag.out b/Test/baseResults/hlsl.structbuffer.rw.frag.out
index b1bba58..6d529dd 100644
--- a/Test/baseResults/hlsl.structbuffer.rw.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.rw.frag.out
@@ -74,7 +74,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -83,7 +83,7 @@
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test} @data})
 0:?     'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -164,7 +164,7 @@
 0:?     Sequence
 0:12      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:12      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:12        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -173,7 +173,7 @@
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 3-component vector of float color,  temp bool test} @data})
 0:?     'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of float @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -213,6 +213,7 @@
                               MemberDecorate 30(sbuf) 0 Offset 0
                               Decorate 30(sbuf) BufferBlock
                               Decorate 32(sbuf) DescriptorSet 0
+                              Decorate 71(pos) Flat
                               Decorate 71(pos) Location 0
                               Decorate 74(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out b/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
index 14c2eb6..80bc107 100644
--- a/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
+++ b/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
@@ -490,7 +490,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -498,7 +498,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 
 Linked fragment stage:
@@ -995,7 +995,7 @@
 0:?     Sequence
 0:5      move second child to first child ( temp uint)
 0:?         'pos' ( temp uint)
-0:?         'pos' (layout( location=0) in uint)
+0:?         'pos' (layout( location=0) flat in uint)
 0:5      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:5        Function Call: @main(u1; ( temp 4-component vector of float)
@@ -1003,7 +1003,7 @@
 0:?   Linker Objects
 0:?     'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'pos' (layout( location=0) in uint)
+0:?     'pos' (layout( location=0) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -1037,6 +1037,7 @@
                               MemberDecorate 16(sbuf) 0 Offset 0
                               Decorate 16(sbuf) BufferBlock
                               Decorate 18(sbuf) DescriptorSet 0
+                              Decorate 233(pos) Flat
                               Decorate 233(pos) Location 0
                               Decorate 236(@entryPointOutput) Location 0
                2:             TypeVoid
diff --git a/Test/baseResults/hlsl.structin.vert.out b/Test/baseResults/hlsl.structin.vert.out
index 8378de2..ff6b37a 100755
--- a/Test/baseResults/hlsl.structin.vert.out
+++ b/Test/baseResults/hlsl.structin.vert.out
@@ -1,15 +1,15 @@
 hlsl.structin.vert
 Shader version: 500
 0:? Sequence
-0:8  Function Definition: @main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8  Function Definition: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8    Function Parameters: 
 0:8      'd' ( in 4-component vector of float)
-0:8      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8      'e' ( in 4-component vector of float)
 0:?     Sequence
 0:11      move second child to first child ( temp 4-component vector of float)
 0:11        b: direct index for structure ( temp 4-component vector of float)
-0:11          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11          Constant:
 0:11            2 (const int)
 0:11        add ( temp 4-component vector of float)
@@ -18,31 +18,66 @@
 0:11              add ( temp 4-component vector of float)
 0:11                direct index ( temp 4-component vector of float)
 0:11                  m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
 0:11                      0 (const int)
 0:11                  Constant:
 0:11                    1 (const int)
 0:11                direct index ( temp 4-component vector of float)
 0:11                  m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
 0:11                      0 (const int)
 0:11                  Constant:
 0:11                    0 (const int)
 0:11              Construct vec4 ( temp 4-component vector of float)
-0:11                Convert uint to float ( temp float)
-0:11                  direct index ( temp uint)
-0:11                    coord: direct index for structure ( temp 2-component vector of uint)
-0:11                      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:11                      Constant:
-0:11                        1 (const int)
+0:11                direct index ( temp float)
+0:11                  coord: direct index for structure ( temp 4-component vector of float)
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
-0:11                      0 (const int)
+0:11                      1 (const int)
+0:11                  Constant:
+0:11                    0 (const int)
 0:11            'd' ( in 4-component vector of float)
 0:11          'e' ( in 4-component vector of float)
-0:13      Branch: Return with expression
-0:13        'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:12      move second child to first child ( temp 4-component vector of float)
+0:12        coord: direct index for structure ( temp 4-component vector of float)
+0:12          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          1.000000
+0:12          1.000000
+0:12          1.000000
+0:12          1.000000
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        direct index ( temp 4-component vector of float)
+0:13          m: direct index for structure ( temp 2-element array of 4-component vector of float)
+0:13            'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:13            Constant:
+0:13              0 (const int)
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          2.000000
+0:13          2.000000
+0:13          2.000000
+0:13          2.000000
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        direct index ( temp 4-component vector of float)
+0:14          m: direct index for structure ( temp 2-element array of 4-component vector of float)
+0:14            'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            1 (const int)
+0:14        Constant:
+0:14          3.000000
+0:14          3.000000
+0:14          3.000000
+0:14          3.000000
+0:16      Branch: Return with expression
+0:16        'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8  Function Definition: main( ( temp void)
 0:8    Function Parameters: 
 0:?     Sequence
@@ -53,7 +88,7 @@
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          direct index ( temp 4-component vector of float)
 0:8            m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8              Constant:
 0:8                0 (const int)
 0:8            Constant:
@@ -62,21 +97,21 @@
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          direct index ( temp 4-component vector of float)
 0:8            m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8              Constant:
 0:8                0 (const int)
 0:8            Constant:
 0:8              1 (const int)
 0:?           'm[1]' (layout( location=2) in 4-component vector of float)
-0:8        move second child to first child ( temp 2-component vector of uint)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:8          coord: direct index for structure ( temp 4-component vector of float)
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              1 (const int)
-0:?           'coord' (layout( location=3) in 2-component vector of uint)
+0:?           'coord' (layout( location=3) in 4-component vector of float)
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          b: direct index for structure ( temp 4-component vector of float)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              2 (const int)
 0:?           'b' (layout( location=4) in 4-component vector of float)
@@ -84,47 +119,44 @@
 0:?         'e' ( temp 4-component vector of float)
 0:?         'e' (layout( location=5) in 4-component vector of float)
 0:8      Sequence
-0:8        move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8          'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8          Function Call: @main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:8          'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:8          Function Call: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:?             'd' ( temp 4-component vector of float)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:?             'e' ( temp 4-component vector of float)
 0:8        move second child to first child ( temp 2-element array of 4-component vector of float)
 0:8          m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:8            Constant:
 0:8              0 (const int)
 0:8          m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              0 (const int)
-0:8        move second child to first child ( temp 2-component vector of uint)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8            Constant:
-0:8              1 (const int)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_coord' ( out 4-component vector of float Position)
+0:8          coord: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              1 (const int)
 0:8        move second child to first child ( temp 4-component vector of float)
-0:8          b: direct index for structure ( temp 4-component vector of float)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8          b: direct index for structure ( smooth temp 4-component vector of float)
+0:8            '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:8            Constant:
-0:8              2 (const int)
+0:8              1 (const int)
 0:8          b: direct index for structure ( temp 4-component vector of float)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              2 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:?     'd' (layout( location=0) in 4-component vector of float)
 0:?     'm[0]' (layout( location=1) in 4-component vector of float)
 0:?     'm[1]' (layout( location=2) in 4-component vector of float)
 0:?     'm[0]' (layout( location=1) in 4-component vector of float)
 0:?     'm[1]' (layout( location=2) in 4-component vector of float)
-0:?     'coord' (layout( location=3) in 2-component vector of uint)
+0:?     'coord' (layout( location=3) in 4-component vector of float)
 0:?     'b' (layout( location=4) in 4-component vector of float)
 0:?     'e' (layout( location=5) in 4-component vector of float)
 
@@ -134,15 +166,15 @@
 
 Shader version: 500
 0:? Sequence
-0:8  Function Definition: @main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8  Function Definition: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8    Function Parameters: 
 0:8      'd' ( in 4-component vector of float)
-0:8      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8      'e' ( in 4-component vector of float)
 0:?     Sequence
 0:11      move second child to first child ( temp 4-component vector of float)
 0:11        b: direct index for structure ( temp 4-component vector of float)
-0:11          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11          Constant:
 0:11            2 (const int)
 0:11        add ( temp 4-component vector of float)
@@ -151,31 +183,66 @@
 0:11              add ( temp 4-component vector of float)
 0:11                direct index ( temp 4-component vector of float)
 0:11                  m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
 0:11                      0 (const int)
 0:11                  Constant:
 0:11                    1 (const int)
 0:11                direct index ( temp 4-component vector of float)
 0:11                  m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
 0:11                      0 (const int)
 0:11                  Constant:
 0:11                    0 (const int)
 0:11              Construct vec4 ( temp 4-component vector of float)
-0:11                Convert uint to float ( temp float)
-0:11                  direct index ( temp uint)
-0:11                    coord: direct index for structure ( temp 2-component vector of uint)
-0:11                      'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:11                      Constant:
-0:11                        1 (const int)
+0:11                direct index ( temp float)
+0:11                  coord: direct index for structure ( temp 4-component vector of float)
+0:11                    'vi' ( in structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:11                    Constant:
-0:11                      0 (const int)
+0:11                      1 (const int)
+0:11                  Constant:
+0:11                    0 (const int)
 0:11            'd' ( in 4-component vector of float)
 0:11          'e' ( in 4-component vector of float)
-0:13      Branch: Return with expression
-0:13        'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:12      move second child to first child ( temp 4-component vector of float)
+0:12        coord: direct index for structure ( temp 4-component vector of float)
+0:12          'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:12          Constant:
+0:12            1 (const int)
+0:12        Constant:
+0:12          1.000000
+0:12          1.000000
+0:12          1.000000
+0:12          1.000000
+0:13      move second child to first child ( temp 4-component vector of float)
+0:13        direct index ( temp 4-component vector of float)
+0:13          m: direct index for structure ( temp 2-element array of 4-component vector of float)
+0:13            'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:13            Constant:
+0:13              0 (const int)
+0:13          Constant:
+0:13            0 (const int)
+0:13        Constant:
+0:13          2.000000
+0:13          2.000000
+0:13          2.000000
+0:13          2.000000
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        direct index ( temp 4-component vector of float)
+0:14          m: direct index for structure ( temp 2-element array of 4-component vector of float)
+0:14            'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            1 (const int)
+0:14        Constant:
+0:14          3.000000
+0:14          3.000000
+0:14          3.000000
+0:14          3.000000
+0:16      Branch: Return with expression
+0:16        'local' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8  Function Definition: main( ( temp void)
 0:8    Function Parameters: 
 0:?     Sequence
@@ -186,7 +253,7 @@
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          direct index ( temp 4-component vector of float)
 0:8            m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8              Constant:
 0:8                0 (const int)
 0:8            Constant:
@@ -195,21 +262,21 @@
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          direct index ( temp 4-component vector of float)
 0:8            m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?               'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8              Constant:
 0:8                0 (const int)
 0:8            Constant:
 0:8              1 (const int)
 0:?           'm[1]' (layout( location=2) in 4-component vector of float)
-0:8        move second child to first child ( temp 2-component vector of uint)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:8          coord: direct index for structure ( temp 4-component vector of float)
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              1 (const int)
-0:?           'coord' (layout( location=3) in 2-component vector of uint)
+0:?           'coord' (layout( location=3) in 4-component vector of float)
 0:8        move second child to first child ( temp 4-component vector of float)
 0:8          b: direct index for structure ( temp 4-component vector of float)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              2 (const int)
 0:?           'b' (layout( location=4) in 4-component vector of float)
@@ -217,94 +284,92 @@
 0:?         'e' ( temp 4-component vector of float)
 0:?         'e' (layout( location=5) in 4-component vector of float)
 0:8      Sequence
-0:8        move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8          'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8          Function Call: @main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:8          'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
+0:8          Function Call: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:?             'd' ( temp 4-component vector of float)
-0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?             'vi' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:?             'e' ( temp 4-component vector of float)
 0:8        move second child to first child ( temp 2-element array of 4-component vector of float)
 0:8          m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:8            Constant:
 0:8              0 (const int)
 0:8          m: direct index for structure ( temp 2-element array of 4-component vector of float)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              0 (const int)
-0:8        move second child to first child ( temp 2-component vector of uint)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
-0:8            Constant:
-0:8              1 (const int)
-0:8          coord: direct index for structure ( temp 2-component vector of uint)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8        move second child to first child ( temp 4-component vector of float)
+0:?           '@entryPointOutput_coord' ( out 4-component vector of float Position)
+0:8          coord: direct index for structure ( temp 4-component vector of float)
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              1 (const int)
 0:8        move second child to first child ( temp 4-component vector of float)
-0:8          b: direct index for structure ( temp 4-component vector of float)
-0:8            '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8          b: direct index for structure ( smooth temp 4-component vector of float)
+0:8            '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:8            Constant:
-0:8              2 (const int)
+0:8              1 (const int)
 0:8          b: direct index for structure ( temp 4-component vector of float)
-0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:8            'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m,  temp 4-component vector of float coord,  temp 4-component vector of float b})
 0:8            Constant:
 0:8              2 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' ( out structure Position{ temp 2-element array of 4-component vector of float m,  temp 2-component vector of uint coord,  temp 4-component vector of float b})
+0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m,  smooth temp 4-component vector of float b})
 0:?     'd' (layout( location=0) in 4-component vector of float)
 0:?     'm[0]' (layout( location=1) in 4-component vector of float)
 0:?     'm[1]' (layout( location=2) in 4-component vector of float)
 0:?     'm[0]' (layout( location=1) in 4-component vector of float)
 0:?     'm[1]' (layout( location=2) in 4-component vector of float)
-0:?     'coord' (layout( location=3) in 2-component vector of uint)
+0:?     'coord' (layout( location=3) in 4-component vector of float)
 0:?     'b' (layout( location=4) in 4-component vector of float)
 0:?     'e' (layout( location=5) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 92
+// Id's are bound by 96
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 48 51 54 58 62 66 78
+                              EntryPoint Vertex 4  "main" 55 58 61 64 67 71 83 90
                               Source HLSL 500
                               Name 4  "main"
-                              Name 13  "VI"
-                              MemberName 13(VI) 0  "m"
-                              MemberName 13(VI) 1  "coord"
-                              MemberName 13(VI) 2  "b"
-                              Name 19  "@main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4;"
-                              Name 16  "d"
-                              Name 17  "vi"
-                              Name 18  "e"
-                              Name 21  "local"
-                              Name 46  "d"
-                              Name 48  "d"
-                              Name 50  "vi"
-                              Name 51  "m[0]"
-                              Name 54  "m[1]"
-                              Name 58  "coord"
-                              Name 62  "b"
-                              Name 65  "e"
-                              Name 66  "e"
-                              Name 68  "flattenTemp"
-                              Name 69  "param"
-                              Name 71  "param"
-                              Name 73  "param"
-                              Name 76  "VI"
-                              MemberName 76(VI) 0  "m"
-                              MemberName 76(VI) 1  "coord"
-                              MemberName 76(VI) 2  "b"
-                              Name 78  "@entryPointOutput"
-                              Decorate 48(d) Location 0
-                              Decorate 51(m[0]) Location 1
-                              Decorate 54(m[1]) Location 2
-                              Decorate 58(coord) Location 3
-                              Decorate 62(b) Location 4
-                              Decorate 66(e) Location 5
-                              Decorate 78(@entryPointOutput) BuiltIn Position
+                              Name 12  "VI"
+                              MemberName 12(VI) 0  "m"
+                              MemberName 12(VI) 1  "coord"
+                              MemberName 12(VI) 2  "b"
+                              Name 18  "@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;"
+                              Name 15  "d"
+                              Name 16  "vi"
+                              Name 17  "e"
+                              Name 20  "local"
+                              Name 53  "d"
+                              Name 55  "d"
+                              Name 57  "vi"
+                              Name 58  "m[0]"
+                              Name 61  "m[1]"
+                              Name 64  "coord"
+                              Name 67  "b"
+                              Name 70  "e"
+                              Name 71  "e"
+                              Name 73  "flattenTemp"
+                              Name 74  "param"
+                              Name 76  "param"
+                              Name 78  "param"
+                              Name 81  "VI"
+                              MemberName 81(VI) 0  "m"
+                              MemberName 81(VI) 1  "b"
+                              Name 83  "@entryPointOutput"
+                              Name 90  "@entryPointOutput_coord"
+                              Decorate 55(d) Location 0
+                              Decorate 58(m[0]) Location 1
+                              Decorate 61(m[1]) Location 2
+                              Decorate 64(coord) Location 3
+                              Decorate 67(b) Location 4
+                              Decorate 71(e) Location 5
+                              Decorate 83(@entryPointOutput) Location 0
+                              Decorate 90(@entryPointOutput_coord) BuiltIn Position
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -313,101 +378,108 @@
                9:             TypeInt 32 0
               10:      9(int) Constant 2
               11:             TypeArray 7(fvec4) 10
-              12:             TypeVector 9(int) 2
-          13(VI):             TypeStruct 11 12(ivec2) 7(fvec4)
-              14:             TypePointer Function 13(VI)
-              15:             TypeFunction 13(VI) 8(ptr) 14(ptr) 8(ptr)
-              22:             TypeInt 32 1
-              23:     22(int) Constant 2
-              24:     22(int) Constant 0
-              25:     22(int) Constant 1
-              31:      9(int) Constant 0
-              32:             TypePointer Function 9(int)
-              47:             TypePointer Input 7(fvec4)
-           48(d):     47(ptr) Variable Input
-        51(m[0]):     47(ptr) Variable Input
-        54(m[1]):     47(ptr) Variable Input
-              57:             TypePointer Input 12(ivec2)
-       58(coord):     57(ptr) Variable Input
-              60:             TypePointer Function 12(ivec2)
-           62(b):     47(ptr) Variable Input
-           66(e):     47(ptr) Variable Input
-          76(VI):             TypeStruct 11 12(ivec2) 7(fvec4)
-              77:             TypePointer Output 76(VI)
-78(@entryPointOutput):     77(ptr) Variable Output
-              79:             TypePointer Function 11
-              82:             TypePointer Output 11
-              86:             TypePointer Output 12(ivec2)
-              90:             TypePointer Output 7(fvec4)
+          12(VI):             TypeStruct 11 7(fvec4) 7(fvec4)
+              13:             TypePointer Function 12(VI)
+              14:             TypeFunction 12(VI) 8(ptr) 13(ptr) 8(ptr)
+              21:             TypeInt 32 1
+              22:     21(int) Constant 2
+              23:     21(int) Constant 0
+              24:     21(int) Constant 1
+              30:      9(int) Constant 0
+              31:             TypePointer Function 6(float)
+              41:    6(float) Constant 1065353216
+              42:    7(fvec4) ConstantComposite 41 41 41 41
+              44:    6(float) Constant 1073741824
+              45:    7(fvec4) ConstantComposite 44 44 44 44
+              47:    6(float) Constant 1077936128
+              48:    7(fvec4) ConstantComposite 47 47 47 47
+              54:             TypePointer Input 7(fvec4)
+           55(d):     54(ptr) Variable Input
+        58(m[0]):     54(ptr) Variable Input
+        61(m[1]):     54(ptr) Variable Input
+       64(coord):     54(ptr) Variable Input
+           67(b):     54(ptr) Variable Input
+           71(e):     54(ptr) Variable Input
+          81(VI):             TypeStruct 11 7(fvec4)
+              82:             TypePointer Output 81(VI)
+83(@entryPointOutput):     82(ptr) Variable Output
+              84:             TypePointer Function 11
+              87:             TypePointer Output 11
+              89:             TypePointer Output 7(fvec4)
+90(@entryPointOutput_coord):     89(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
-           46(d):      8(ptr) Variable Function
-          50(vi):     14(ptr) Variable Function
-           65(e):      8(ptr) Variable Function
- 68(flattenTemp):     14(ptr) Variable Function
-       69(param):      8(ptr) Variable Function
-       71(param):     14(ptr) Variable Function
-       73(param):      8(ptr) Variable Function
-              49:    7(fvec4) Load 48(d)
-                              Store 46(d) 49
-              52:    7(fvec4) Load 51(m[0])
-              53:      8(ptr) AccessChain 50(vi) 24 24
-                              Store 53 52
-              55:    7(fvec4) Load 54(m[1])
-              56:      8(ptr) AccessChain 50(vi) 24 25
-                              Store 56 55
-              59:   12(ivec2) Load 58(coord)
-              61:     60(ptr) AccessChain 50(vi) 25
-                              Store 61 59
-              63:    7(fvec4) Load 62(b)
-              64:      8(ptr) AccessChain 50(vi) 23
-                              Store 64 63
-              67:    7(fvec4) Load 66(e)
-                              Store 65(e) 67
-              70:    7(fvec4) Load 46(d)
-                              Store 69(param) 70
-              72:      13(VI) Load 50(vi)
-                              Store 71(param) 72
-              74:    7(fvec4) Load 65(e)
-                              Store 73(param) 74
-              75:      13(VI) FunctionCall 19(@main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4;) 69(param) 71(param) 73(param)
-                              Store 68(flattenTemp) 75
-              80:     79(ptr) AccessChain 68(flattenTemp) 24
-              81:          11 Load 80
-              83:     82(ptr) AccessChain 78(@entryPointOutput) 24
-                              Store 83 81
-              84:     60(ptr) AccessChain 68(flattenTemp) 25
-              85:   12(ivec2) Load 84
-              87:     86(ptr) AccessChain 78(@entryPointOutput) 25
-                              Store 87 85
-              88:      8(ptr) AccessChain 68(flattenTemp) 23
-              89:    7(fvec4) Load 88
-              91:     90(ptr) AccessChain 78(@entryPointOutput) 23
-                              Store 91 89
+           53(d):      8(ptr) Variable Function
+          57(vi):     13(ptr) Variable Function
+           70(e):      8(ptr) Variable Function
+ 73(flattenTemp):     13(ptr) Variable Function
+       74(param):      8(ptr) Variable Function
+       76(param):     13(ptr) Variable Function
+       78(param):      8(ptr) Variable Function
+              56:    7(fvec4) Load 55(d)
+                              Store 53(d) 56
+              59:    7(fvec4) Load 58(m[0])
+              60:      8(ptr) AccessChain 57(vi) 23 23
+                              Store 60 59
+              62:    7(fvec4) Load 61(m[1])
+              63:      8(ptr) AccessChain 57(vi) 23 24
+                              Store 63 62
+              65:    7(fvec4) Load 64(coord)
+              66:      8(ptr) AccessChain 57(vi) 24
+                              Store 66 65
+              68:    7(fvec4) Load 67(b)
+              69:      8(ptr) AccessChain 57(vi) 22
+                              Store 69 68
+              72:    7(fvec4) Load 71(e)
+                              Store 70(e) 72
+              75:    7(fvec4) Load 53(d)
+                              Store 74(param) 75
+              77:      12(VI) Load 57(vi)
+                              Store 76(param) 77
+              79:    7(fvec4) Load 70(e)
+                              Store 78(param) 79
+              80:      12(VI) FunctionCall 18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;) 74(param) 76(param) 78(param)
+                              Store 73(flattenTemp) 80
+              85:     84(ptr) AccessChain 73(flattenTemp) 23
+              86:          11 Load 85
+              88:     87(ptr) AccessChain 83(@entryPointOutput) 23
+                              Store 88 86
+              91:      8(ptr) AccessChain 73(flattenTemp) 24
+              92:    7(fvec4) Load 91
+                              Store 90(@entryPointOutput_coord) 92
+              93:      8(ptr) AccessChain 73(flattenTemp) 22
+              94:    7(fvec4) Load 93
+              95:     89(ptr) AccessChain 83(@entryPointOutput) 24
+                              Store 95 94
                               Return
                               FunctionEnd
-19(@main(vf4;struct-VI-vf4[2]-vu2-vf41;vf4;):      13(VI) Function None 15
-           16(d):      8(ptr) FunctionParameter
-          17(vi):     14(ptr) FunctionParameter
-           18(e):      8(ptr) FunctionParameter
-              20:             Label
-       21(local):     14(ptr) Variable Function
-              26:      8(ptr) AccessChain 17(vi) 24 25
-              27:    7(fvec4) Load 26
-              28:      8(ptr) AccessChain 17(vi) 24 24
-              29:    7(fvec4) Load 28
-              30:    7(fvec4) FAdd 27 29
-              33:     32(ptr) AccessChain 17(vi) 25 31
-              34:      9(int) Load 33
-              35:    6(float) ConvertUToF 34
-              36:    7(fvec4) CompositeConstruct 35 35 35 35
-              37:    7(fvec4) FAdd 30 36
-              38:    7(fvec4) Load 16(d)
+18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;):      12(VI) Function None 14
+           15(d):      8(ptr) FunctionParameter
+          16(vi):     13(ptr) FunctionParameter
+           17(e):      8(ptr) FunctionParameter
+              19:             Label
+       20(local):     13(ptr) Variable Function
+              25:      8(ptr) AccessChain 16(vi) 23 24
+              26:    7(fvec4) Load 25
+              27:      8(ptr) AccessChain 16(vi) 23 23
+              28:    7(fvec4) Load 27
+              29:    7(fvec4) FAdd 26 28
+              32:     31(ptr) AccessChain 16(vi) 24 30
+              33:    6(float) Load 32
+              34:    7(fvec4) CompositeConstruct 33 33 33 33
+              35:    7(fvec4) FAdd 29 34
+              36:    7(fvec4) Load 15(d)
+              37:    7(fvec4) FAdd 35 36
+              38:    7(fvec4) Load 17(e)
               39:    7(fvec4) FAdd 37 38
-              40:    7(fvec4) Load 18(e)
-              41:    7(fvec4) FAdd 39 40
-              42:      8(ptr) AccessChain 21(local) 23
-                              Store 42 41
-              43:      13(VI) Load 21(local)
-                              ReturnValue 43
+              40:      8(ptr) AccessChain 20(local) 22
+                              Store 40 39
+              43:      8(ptr) AccessChain 20(local) 24
+                              Store 43 42
+              46:      8(ptr) AccessChain 20(local) 23 23
+                              Store 46 45
+              49:      8(ptr) AccessChain 20(local) 23 24
+                              Store 49 48
+              50:      12(VI) Load 20(local)
+                              ReturnValue 50
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.switch.frag.out b/Test/baseResults/hlsl.switch.frag.out
index c77da93..9cb52f1 100755
--- a/Test/baseResults/hlsl.switch.frag.out
+++ b/Test/baseResults/hlsl.switch.frag.out
@@ -129,10 +129,10 @@
 0:?         'input' (layout( location=0) in 4-component vector of float)
 0:2      move second child to first child ( temp int)
 0:?         'c' ( temp int)
-0:?         'c' (layout( location=1) in int)
+0:?         'c' (layout( location=1) flat in int)
 0:2      move second child to first child ( temp int)
 0:?         'd' ( temp int)
-0:?         'd' (layout( location=2) in int)
+0:?         'd' (layout( location=2) flat in int)
 0:2      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:2        Function Call: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float)
@@ -142,8 +142,8 @@
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
-0:?     'c' (layout( location=1) in int)
-0:?     'd' (layout( location=2) in int)
+0:?     'c' (layout( location=1) flat in int)
+0:?     'd' (layout( location=2) flat in int)
 
 
 Linked fragment stage:
@@ -279,10 +279,10 @@
 0:?         'input' (layout( location=0) in 4-component vector of float)
 0:2      move second child to first child ( temp int)
 0:?         'c' ( temp int)
-0:?         'c' (layout( location=1) in int)
+0:?         'c' (layout( location=1) flat in int)
 0:2      move second child to first child ( temp int)
 0:?         'd' ( temp int)
-0:?         'd' (layout( location=2) in int)
+0:?         'd' (layout( location=2) flat in int)
 0:2      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:2        Function Call: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float)
@@ -292,8 +292,8 @@
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
-0:?     'c' (layout( location=1) in int)
-0:?     'd' (layout( location=2) in int)
+0:?     'c' (layout( location=1) flat in int)
+0:?     'd' (layout( location=2) flat in int)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -321,7 +321,9 @@
                               Name 101  "param"
                               Name 103  "param"
                               Decorate 88(input) Location 0
+                              Decorate 92(c) Flat
                               Decorate 92(c) Location 1
+                              Decorate 95(d) Flat
                               Decorate 95(d) Location 2
                               Decorate 98(@entryPointOutput) Location 0
                2:             TypeVoid
@@ -397,7 +399,7 @@
                                 Branch 25
               25:             Label
               36:      9(int) Load 13(c)
-                              SelectionMerge 40 None
+                              SelectionMerge 40 DontFlatten 
                               Switch 36 39 
                                      case 1: 37
                                      case 2: 38
diff --git a/Test/baseResults/hlsl.synthesizeInput.frag.out b/Test/baseResults/hlsl.synthesizeInput.frag.out
new file mode 100755
index 0000000..aa77e25
--- /dev/null
+++ b/Test/baseResults/hlsl.synthesizeInput.frag.out
@@ -0,0 +1,151 @@
+hlsl.synthesizeInput.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:?     Sequence
+0:8      Branch: Return with expression
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:8          Convert uint to float ( temp float)
+0:8            no_interp: direct index for structure ( temp uint)
+0:8              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:8              Constant:
+0:8                1 (const int)
+0:8          interp: direct index for structure ( temp float)
+0:8            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:8            Constant:
+0:8              0 (const int)
+0:8          Constant:
+0:8            0.000000
+0:8          Constant:
+0:8            1.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
+0:?           'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:?     Sequence
+0:8      Branch: Return with expression
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:8          Convert uint to float ( temp float)
+0:8            no_interp: direct index for structure ( temp uint)
+0:8              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:8              Constant:
+0:8                1 (const int)
+0:8          interp: direct index for structure ( temp float)
+0:8            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:8            Constant:
+0:8              0 (const int)
+0:8          Constant:
+0:8            0.000000
+0:8          Constant:
+0:8            1.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
+0:?           'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 44
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 33 40
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "PSInput"
+                              MemberName 8(PSInput) 0  "interp"
+                              MemberName 8(PSInput) 1  "no_interp"
+                              Name 13  "@main(struct-PSInput-f1-u11;"
+                              Name 12  "input"
+                              Name 30  "input"
+                              Name 31  "PSInput"
+                              MemberName 31(PSInput) 0  "interp"
+                              MemberName 31(PSInput) 1  "no_interp"
+                              Name 33  "input"
+                              Name 40  "@entryPointOutput"
+                              Name 41  "param"
+                              MemberDecorate 31(PSInput) 1 Flat
+                              Decorate 33(input) Location 0
+                              Decorate 40(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeInt 32 0
+      8(PSInput):             TypeStruct 6(float) 7(int)
+               9:             TypePointer Function 8(PSInput)
+              10:             TypeVector 6(float) 4
+              11:             TypeFunction 10(fvec4) 9(ptr)
+              15:             TypeInt 32 1
+              16:     15(int) Constant 1
+              17:             TypePointer Function 7(int)
+              21:     15(int) Constant 0
+              22:             TypePointer Function 6(float)
+              25:    6(float) Constant 0
+              26:    6(float) Constant 1065353216
+     31(PSInput):             TypeStruct 6(float) 7(int)
+              32:             TypePointer Input 31(PSInput)
+       33(input):     32(ptr) Variable Input
+              39:             TypePointer Output 10(fvec4)
+40(@entryPointOutput):     39(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+       30(input):      9(ptr) Variable Function
+       41(param):      9(ptr) Variable Function
+              34: 31(PSInput) Load 33(input)
+              35:    6(float) CompositeExtract 34 0
+              36:     22(ptr) AccessChain 30(input) 21
+                              Store 36 35
+              37:      7(int) CompositeExtract 34 1
+              38:     17(ptr) AccessChain 30(input) 16
+                              Store 38 37
+              42:  8(PSInput) Load 30(input)
+                              Store 41(param) 42
+              43:   10(fvec4) FunctionCall 13(@main(struct-PSInput-f1-u11;) 41(param)
+                              Store 40(@entryPointOutput) 43
+                              Return
+                              FunctionEnd
+13(@main(struct-PSInput-f1-u11;):   10(fvec4) Function None 11
+       12(input):      9(ptr) FunctionParameter
+              14:             Label
+              18:     17(ptr) AccessChain 12(input) 16
+              19:      7(int) Load 18
+              20:    6(float) ConvertUToF 19
+              23:     22(ptr) AccessChain 12(input) 21
+              24:    6(float) Load 23
+              27:   10(fvec4) CompositeConstruct 20 24 25 26
+                              ReturnValue 27
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.target.frag.out b/Test/baseResults/hlsl.target.frag.out
new file mode 100755
index 0000000..a44931f
--- /dev/null
+++ b/Test/baseResults/hlsl.target.frag.out
@@ -0,0 +1,188 @@
+hlsl.target.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
+0:7    Function Parameters: 
+0:7      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:7      'out1' ( out 4-component vector of float)
+0:7      'out2' ( out 4-component vector of float)
+0:?     Sequence
+0:8      move second child to first child ( temp 4-component vector of float)
+0:8        'out1' ( out 4-component vector of float)
+0:8        Constant:
+0:8          1.000000
+0:8          1.000000
+0:8          1.000000
+0:8          1.000000
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        'out2' ( out 4-component vector of float)
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'out1' ( temp 4-component vector of float)
+0:?         'out2' ( temp 4-component vector of float)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         'out1' (layout( location=1) out 4-component vector of float)
+0:?         'out1' ( temp 4-component vector of float)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         'out2' (layout( location=3) out 4-component vector of float)
+0:?         'out2' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'out1' (layout( location=1) out 4-component vector of float)
+0:?     'out2' (layout( location=3) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
+0:7    Function Parameters: 
+0:7      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:7      'out1' ( out 4-component vector of float)
+0:7      'out2' ( out 4-component vector of float)
+0:?     Sequence
+0:8      move second child to first child ( temp 4-component vector of float)
+0:8        'out1' ( out 4-component vector of float)
+0:8        Constant:
+0:8          1.000000
+0:8          1.000000
+0:8          1.000000
+0:8          1.000000
+0:9      move second child to first child ( temp 4-component vector of float)
+0:9        'out2' ( out 4-component vector of float)
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'out1' ( temp 4-component vector of float)
+0:?         'out2' ( temp 4-component vector of float)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         'out1' (layout( location=1) out 4-component vector of float)
+0:?         'out1' ( temp 4-component vector of float)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         'out2' (layout( location=3) out 4-component vector of float)
+0:?         'out2' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'out1' (layout( location=1) out 4-component vector of float)
+0:?     'out2' (layout( location=3) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 50
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 25 46 48
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "PSInput"
+                              MemberName 8(PSInput) 0  "interp"
+                              MemberName 8(PSInput) 1  "no_interp"
+                              Name 16  "@main(struct-PSInput-f1-u11;vf4;vf4;"
+                              Name 13  "input"
+                              Name 14  "out1"
+                              Name 15  "out2"
+                              Name 22  "input"
+                              Name 23  "PSInput"
+                              MemberName 23(PSInput) 0  "interp"
+                              MemberName 23(PSInput) 1  "no_interp"
+                              Name 25  "input"
+                              Name 36  "out1"
+                              Name 37  "out2"
+                              Name 38  "param"
+                              Name 40  "param"
+                              Name 41  "param"
+                              Name 46  "out1"
+                              Name 48  "out2"
+                              MemberDecorate 23(PSInput) 1 Flat
+                              Decorate 25(input) Location 0
+                              Decorate 46(out1) Location 1
+                              Decorate 48(out2) Location 3
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeInt 32 0
+      8(PSInput):             TypeStruct 6(float) 7(int)
+               9:             TypePointer Function 8(PSInput)
+              10:             TypeVector 6(float) 4
+              11:             TypePointer Function 10(fvec4)
+              12:             TypeFunction 2 9(ptr) 11(ptr) 11(ptr)
+              18:    6(float) Constant 1065353216
+              19:   10(fvec4) ConstantComposite 18 18 18 18
+              20:    6(float) Constant 0
+              21:   10(fvec4) ConstantComposite 20 20 20 20
+     23(PSInput):             TypeStruct 6(float) 7(int)
+              24:             TypePointer Input 23(PSInput)
+       25(input):     24(ptr) Variable Input
+              28:             TypeInt 32 1
+              29:     28(int) Constant 0
+              30:             TypePointer Function 6(float)
+              33:     28(int) Constant 1
+              34:             TypePointer Function 7(int)
+              45:             TypePointer Output 10(fvec4)
+        46(out1):     45(ptr) Variable Output
+        48(out2):     45(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+       22(input):      9(ptr) Variable Function
+        36(out1):     11(ptr) Variable Function
+        37(out2):     11(ptr) Variable Function
+       38(param):      9(ptr) Variable Function
+       40(param):     11(ptr) Variable Function
+       41(param):     11(ptr) Variable Function
+              26: 23(PSInput) Load 25(input)
+              27:    6(float) CompositeExtract 26 0
+              31:     30(ptr) AccessChain 22(input) 29
+                              Store 31 27
+              32:      7(int) CompositeExtract 26 1
+              35:     34(ptr) AccessChain 22(input) 33
+                              Store 35 32
+              39:  8(PSInput) Load 22(input)
+                              Store 38(param) 39
+              42:           2 FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;vf4;) 38(param) 40(param) 41(param)
+              43:   10(fvec4) Load 40(param)
+                              Store 36(out1) 43
+              44:   10(fvec4) Load 41(param)
+                              Store 37(out2) 44
+              47:   10(fvec4) Load 36(out1)
+                              Store 46(out1) 47
+              49:   10(fvec4) Load 37(out2)
+                              Store 48(out2) 49
+                              Return
+                              FunctionEnd
+16(@main(struct-PSInput-f1-u11;vf4;vf4;):           2 Function None 12
+       13(input):      9(ptr) FunctionParameter
+        14(out1):     11(ptr) FunctionParameter
+        15(out2):     11(ptr) FunctionParameter
+              17:             Label
+                              Store 14(out1) 19
+                              Store 15(out2) 21
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.targetStruct1.frag.out b/Test/baseResults/hlsl.targetStruct1.frag.out
new file mode 100755
index 0000000..48fee12
--- /dev/null
+++ b/Test/baseResults/hlsl.targetStruct1.frag.out
@@ -0,0 +1,277 @@
+hlsl.targetStruct1.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:12  Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12    Function Parameters: 
+0:12      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:12      'po' ( out 4-component vector of float)
+0:?     Sequence
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        o1: direct index for structure ( temp 4-component vector of float)
+0:14          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:14          Constant:
+0:14            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:14          Convert uint to float ( temp float)
+0:14            no_interp: direct index for structure ( temp uint)
+0:14              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14              Constant:
+0:14                1 (const int)
+0:14          interp: direct index for structure ( temp float)
+0:14            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            0.000000
+0:14          Constant:
+0:14            1.000000
+0:15      move second child to first child ( temp 4-component vector of float)
+0:15        o2: direct index for structure ( temp 4-component vector of float)
+0:15          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:15          Constant:
+0:15            1 (const int)
+0:15        Constant:
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:16      move second child to first child ( temp 4-component vector of float)
+0:16        'po' ( out 4-component vector of float)
+0:16        Constant:
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:18      Branch: Return with expression
+0:18        'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?             'po' ( temp 4-component vector of float)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o1' (layout( location=2) out 4-component vector of float)
+0:12          o1: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o2' (layout( location=1) out 4-component vector of float)
+0:12          o2: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              1 (const int)
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         'po' (layout( location=0) out 4-component vector of float)
+0:?         'po' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'o1' (layout( location=2) out 4-component vector of float)
+0:?     'o2' (layout( location=1) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'po' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:12  Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12    Function Parameters: 
+0:12      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:12      'po' ( out 4-component vector of float)
+0:?     Sequence
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        o1: direct index for structure ( temp 4-component vector of float)
+0:14          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:14          Constant:
+0:14            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:14          Convert uint to float ( temp float)
+0:14            no_interp: direct index for structure ( temp uint)
+0:14              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14              Constant:
+0:14                1 (const int)
+0:14          interp: direct index for structure ( temp float)
+0:14            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            0.000000
+0:14          Constant:
+0:14            1.000000
+0:15      move second child to first child ( temp 4-component vector of float)
+0:15        o2: direct index for structure ( temp 4-component vector of float)
+0:15          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:15          Constant:
+0:15            1 (const int)
+0:15        Constant:
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:16      move second child to first child ( temp 4-component vector of float)
+0:16        'po' ( out 4-component vector of float)
+0:16        Constant:
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:18      Branch: Return with expression
+0:18        'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?             'po' ( temp 4-component vector of float)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o1' (layout( location=2) out 4-component vector of float)
+0:12          o1: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o2' (layout( location=1) out 4-component vector of float)
+0:12          o2: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              1 (const int)
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         'po' (layout( location=0) out 4-component vector of float)
+0:?         'po' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'o1' (layout( location=2) out 4-component vector of float)
+0:?     'o2' (layout( location=1) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'po' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 65
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 43 57 60 63
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "PSInput"
+                              MemberName 8(PSInput) 0  "interp"
+                              MemberName 8(PSInput) 1  "no_interp"
+                              Name 12  "PSOutput"
+                              MemberName 12(PSOutput) 0  "o1"
+                              MemberName 12(PSOutput) 1  "o2"
+                              Name 16  "@main(struct-PSInput-f1-u11;vf4;"
+                              Name 14  "input"
+                              Name 15  "po"
+                              Name 19  "pso"
+                              Name 40  "input"
+                              Name 41  "PSInput"
+                              MemberName 41(PSInput) 0  "interp"
+                              MemberName 41(PSInput) 1  "no_interp"
+                              Name 43  "input"
+                              Name 49  "flattenTemp"
+                              Name 50  "po"
+                              Name 51  "param"
+                              Name 53  "param"
+                              Name 57  "o1"
+                              Name 60  "o2"
+                              Name 63  "po"
+                              MemberDecorate 41(PSInput) 1 Flat
+                              Decorate 43(input) Location 0
+                              Decorate 57(o1) Location 2
+                              Decorate 60(o2) Location 1
+                              Decorate 63(po) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeInt 32 0
+      8(PSInput):             TypeStruct 6(float) 7(int)
+               9:             TypePointer Function 8(PSInput)
+              10:             TypeVector 6(float) 4
+              11:             TypePointer Function 10(fvec4)
+    12(PSOutput):             TypeStruct 10(fvec4) 10(fvec4)
+              13:             TypeFunction 12(PSOutput) 9(ptr) 11(ptr)
+              18:             TypePointer Function 12(PSOutput)
+              20:             TypeInt 32 1
+              21:     20(int) Constant 0
+              22:     20(int) Constant 1
+              23:             TypePointer Function 7(int)
+              27:             TypePointer Function 6(float)
+              30:    6(float) Constant 0
+              31:    6(float) Constant 1065353216
+              34:   10(fvec4) ConstantComposite 31 31 31 31
+              36:   10(fvec4) ConstantComposite 30 30 30 30
+     41(PSInput):             TypeStruct 6(float) 7(int)
+              42:             TypePointer Input 41(PSInput)
+       43(input):     42(ptr) Variable Input
+              56:             TypePointer Output 10(fvec4)
+          57(o1):     56(ptr) Variable Output
+          60(o2):     56(ptr) Variable Output
+          63(po):     56(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+       40(input):      9(ptr) Variable Function
+ 49(flattenTemp):     18(ptr) Variable Function
+          50(po):     11(ptr) Variable Function
+       51(param):      9(ptr) Variable Function
+       53(param):     11(ptr) Variable Function
+              44: 41(PSInput) Load 43(input)
+              45:    6(float) CompositeExtract 44 0
+              46:     27(ptr) AccessChain 40(input) 21
+                              Store 46 45
+              47:      7(int) CompositeExtract 44 1
+              48:     23(ptr) AccessChain 40(input) 22
+                              Store 48 47
+              52:  8(PSInput) Load 40(input)
+                              Store 51(param) 52
+              54:12(PSOutput) FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;) 51(param) 53(param)
+              55:   10(fvec4) Load 53(param)
+                              Store 50(po) 55
+                              Store 49(flattenTemp) 54
+              58:     11(ptr) AccessChain 49(flattenTemp) 21
+              59:   10(fvec4) Load 58
+                              Store 57(o1) 59
+              61:     11(ptr) AccessChain 49(flattenTemp) 22
+              62:   10(fvec4) Load 61
+                              Store 60(o2) 62
+              64:   10(fvec4) Load 50(po)
+                              Store 63(po) 64
+                              Return
+                              FunctionEnd
+16(@main(struct-PSInput-f1-u11;vf4;):12(PSOutput) Function None 13
+       14(input):      9(ptr) FunctionParameter
+          15(po):     11(ptr) FunctionParameter
+              17:             Label
+         19(pso):     18(ptr) Variable Function
+              24:     23(ptr) AccessChain 14(input) 22
+              25:      7(int) Load 24
+              26:    6(float) ConvertUToF 25
+              28:     27(ptr) AccessChain 14(input) 21
+              29:    6(float) Load 28
+              32:   10(fvec4) CompositeConstruct 26 29 30 31
+              33:     11(ptr) AccessChain 19(pso) 21
+                              Store 33 32
+              35:     11(ptr) AccessChain 19(pso) 22
+                              Store 35 34
+                              Store 15(po) 36
+              37:12(PSOutput) Load 19(pso)
+                              ReturnValue 37
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.targetStruct2.frag.out b/Test/baseResults/hlsl.targetStruct2.frag.out
new file mode 100755
index 0000000..0c2ac50
--- /dev/null
+++ b/Test/baseResults/hlsl.targetStruct2.frag.out
@@ -0,0 +1,277 @@
+hlsl.targetStruct2.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:12  Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12    Function Parameters: 
+0:12      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:12      'po' ( out 4-component vector of float)
+0:?     Sequence
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        o1: direct index for structure ( temp 4-component vector of float)
+0:14          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:14          Constant:
+0:14            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:14          Convert uint to float ( temp float)
+0:14            no_interp: direct index for structure ( temp uint)
+0:14              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14              Constant:
+0:14                1 (const int)
+0:14          interp: direct index for structure ( temp float)
+0:14            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            0.000000
+0:14          Constant:
+0:14            1.000000
+0:15      move second child to first child ( temp 4-component vector of float)
+0:15        o2: direct index for structure ( temp 4-component vector of float)
+0:15          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:15          Constant:
+0:15            1 (const int)
+0:15        Constant:
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:16      move second child to first child ( temp 4-component vector of float)
+0:16        'po' ( out 4-component vector of float)
+0:16        Constant:
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:18      Branch: Return with expression
+0:18        'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?             'po' ( temp 4-component vector of float)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o1' (layout( location=2) out 4-component vector of float)
+0:12          o1: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o2' (layout( location=3) out 4-component vector of float)
+0:12          o2: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              1 (const int)
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         'po' (layout( location=0) out 4-component vector of float)
+0:?         'po' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'o1' (layout( location=2) out 4-component vector of float)
+0:?     'o2' (layout( location=3) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'po' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:12  Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12    Function Parameters: 
+0:12      'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:12      'po' ( out 4-component vector of float)
+0:?     Sequence
+0:14      move second child to first child ( temp 4-component vector of float)
+0:14        o1: direct index for structure ( temp 4-component vector of float)
+0:14          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:14          Constant:
+0:14            0 (const int)
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:14          Convert uint to float ( temp float)
+0:14            no_interp: direct index for structure ( temp uint)
+0:14              'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14              Constant:
+0:14                1 (const int)
+0:14          interp: direct index for structure ( temp float)
+0:14            'input' ( in structure{ temp float interp,  temp uint no_interp})
+0:14            Constant:
+0:14              0 (const int)
+0:14          Constant:
+0:14            0.000000
+0:14          Constant:
+0:14            1.000000
+0:15      move second child to first child ( temp 4-component vector of float)
+0:15        o2: direct index for structure ( temp 4-component vector of float)
+0:15          'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:15          Constant:
+0:15            1 (const int)
+0:15        Constant:
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:15          1.000000
+0:16      move second child to first child ( temp 4-component vector of float)
+0:16        'po' ( out 4-component vector of float)
+0:16        Constant:
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:16          0.000000
+0:18      Branch: Return with expression
+0:18        'pso' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12          Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:?             'po' ( temp 4-component vector of float)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o1' (layout( location=2) out 4-component vector of float)
+0:12          o1: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child ( temp 4-component vector of float)
+0:?           'o2' (layout( location=3) out 4-component vector of float)
+0:12          o2: direct index for structure ( temp 4-component vector of float)
+0:12            'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
+0:12            Constant:
+0:12              1 (const int)
+0:12      move second child to first child ( temp 4-component vector of float)
+0:?         'po' (layout( location=0) out 4-component vector of float)
+0:?         'po' ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'o1' (layout( location=2) out 4-component vector of float)
+0:?     'o2' (layout( location=3) out 4-component vector of float)
+0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'po' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 65
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 43 57 60 63
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 8  "PSInput"
+                              MemberName 8(PSInput) 0  "interp"
+                              MemberName 8(PSInput) 1  "no_interp"
+                              Name 12  "PSOutput"
+                              MemberName 12(PSOutput) 0  "o1"
+                              MemberName 12(PSOutput) 1  "o2"
+                              Name 16  "@main(struct-PSInput-f1-u11;vf4;"
+                              Name 14  "input"
+                              Name 15  "po"
+                              Name 19  "pso"
+                              Name 40  "input"
+                              Name 41  "PSInput"
+                              MemberName 41(PSInput) 0  "interp"
+                              MemberName 41(PSInput) 1  "no_interp"
+                              Name 43  "input"
+                              Name 49  "flattenTemp"
+                              Name 50  "po"
+                              Name 51  "param"
+                              Name 53  "param"
+                              Name 57  "o1"
+                              Name 60  "o2"
+                              Name 63  "po"
+                              MemberDecorate 41(PSInput) 1 Flat
+                              Decorate 43(input) Location 0
+                              Decorate 57(o1) Location 2
+                              Decorate 60(o2) Location 3
+                              Decorate 63(po) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeInt 32 0
+      8(PSInput):             TypeStruct 6(float) 7(int)
+               9:             TypePointer Function 8(PSInput)
+              10:             TypeVector 6(float) 4
+              11:             TypePointer Function 10(fvec4)
+    12(PSOutput):             TypeStruct 10(fvec4) 10(fvec4)
+              13:             TypeFunction 12(PSOutput) 9(ptr) 11(ptr)
+              18:             TypePointer Function 12(PSOutput)
+              20:             TypeInt 32 1
+              21:     20(int) Constant 0
+              22:     20(int) Constant 1
+              23:             TypePointer Function 7(int)
+              27:             TypePointer Function 6(float)
+              30:    6(float) Constant 0
+              31:    6(float) Constant 1065353216
+              34:   10(fvec4) ConstantComposite 31 31 31 31
+              36:   10(fvec4) ConstantComposite 30 30 30 30
+     41(PSInput):             TypeStruct 6(float) 7(int)
+              42:             TypePointer Input 41(PSInput)
+       43(input):     42(ptr) Variable Input
+              56:             TypePointer Output 10(fvec4)
+          57(o1):     56(ptr) Variable Output
+          60(o2):     56(ptr) Variable Output
+          63(po):     56(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+       40(input):      9(ptr) Variable Function
+ 49(flattenTemp):     18(ptr) Variable Function
+          50(po):     11(ptr) Variable Function
+       51(param):      9(ptr) Variable Function
+       53(param):     11(ptr) Variable Function
+              44: 41(PSInput) Load 43(input)
+              45:    6(float) CompositeExtract 44 0
+              46:     27(ptr) AccessChain 40(input) 21
+                              Store 46 45
+              47:      7(int) CompositeExtract 44 1
+              48:     23(ptr) AccessChain 40(input) 22
+                              Store 48 47
+              52:  8(PSInput) Load 40(input)
+                              Store 51(param) 52
+              54:12(PSOutput) FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;) 51(param) 53(param)
+              55:   10(fvec4) Load 53(param)
+                              Store 50(po) 55
+                              Store 49(flattenTemp) 54
+              58:     11(ptr) AccessChain 49(flattenTemp) 21
+              59:   10(fvec4) Load 58
+                              Store 57(o1) 59
+              61:     11(ptr) AccessChain 49(flattenTemp) 22
+              62:   10(fvec4) Load 61
+                              Store 60(o2) 62
+              64:   10(fvec4) Load 50(po)
+                              Store 63(po) 64
+                              Return
+                              FunctionEnd
+16(@main(struct-PSInput-f1-u11;vf4;):12(PSOutput) Function None 13
+       14(input):      9(ptr) FunctionParameter
+          15(po):     11(ptr) FunctionParameter
+              17:             Label
+         19(pso):     18(ptr) Variable Function
+              24:     23(ptr) AccessChain 14(input) 22
+              25:      7(int) Load 24
+              26:    6(float) ConvertUToF 25
+              28:     27(ptr) AccessChain 14(input) 21
+              29:    6(float) Load 28
+              32:   10(fvec4) CompositeConstruct 26 29 30 31
+              33:     11(ptr) AccessChain 19(pso) 21
+                              Store 33 32
+              35:     11(ptr) AccessChain 19(pso) 22
+                              Store 35 34
+                              Store 15(po) 36
+              37:12(PSOutput) Load 19(pso)
+                              ReturnValue 37
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.tx.bracket.frag.out b/Test/baseResults/hlsl.tx.bracket.frag.out
index 0ea9c68..12d5f17 100644
--- a/Test/baseResults/hlsl.tx.bracket.frag.out
+++ b/Test/baseResults/hlsl.tx.bracket.frag.out
@@ -484,11 +484,11 @@
                               Name 184  "g_tTex2di4a"
                               Name 187  "g_tTex2du4a"
                               MemberDecorate 45($Global) 0 Offset 0
-                              MemberDecorate 45($Global) 1 Offset 4
+                              MemberDecorate 45($Global) 1 Offset 8
                               MemberDecorate 45($Global) 2 Offset 16
                               MemberDecorate 45($Global) 3 Offset 32
                               MemberDecorate 45($Global) 4 Offset 48
-                              MemberDecorate 45($Global) 5 Offset 52
+                              MemberDecorate 45($Global) 5 Offset 56
                               MemberDecorate 45($Global) 6 Offset 64
                               MemberDecorate 45($Global) 7 Offset 80
                               Decorate 45($Global) Block
diff --git a/Test/baseResults/hlsl.type.half.frag.out b/Test/baseResults/hlsl.type.half.frag.out
index 17eb057..50171fc 100644
--- a/Test/baseResults/hlsl.type.half.frag.out
+++ b/Test/baseResults/hlsl.type.half.frag.out
@@ -49,11 +49,11 @@
 0:16          'h23' ( temp 2X3 matrix of float)
 0:16          Constant:
 0:16            4.900000
-0:16            0.000000
-0:16            0.000000
-0:16            0.000000
 0:16            4.900000
-0:16            0.000000
+0:16            4.900000
+0:16            4.900000
+0:16            4.900000
+0:16            4.900000
 0:27      Branch: Return with expression
 0:27        Construct vec4 ( temp 4-component vector of float)
 0:27          add ( temp float)
@@ -133,11 +133,11 @@
 0:16          'h23' ( temp 2X3 matrix of float)
 0:16          Constant:
 0:16            4.900000
-0:16            0.000000
-0:16            0.000000
-0:16            0.000000
 0:16            4.900000
-0:16            0.000000
+0:16            4.900000
+0:16            4.900000
+0:16            4.900000
+0:16            4.900000
 0:27      Branch: Return with expression
 0:27        Construct vec4 ( temp 4-component vector of float)
 0:27          add ( temp float)
@@ -165,12 +165,12 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 61
+// Id's are bound by 60
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 59
+                              EntryPoint Fragment 4  "main" 58
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -182,8 +182,8 @@
                               Name 27  "h4"
                               Name 32  "h22"
                               Name 38  "h23"
-                              Name 59  "@entryPointOutput"
-                              Decorate 59(@entryPointOutput) Location 0
+                              Name 58  "@entryPointOutput"
+                              Decorate 58(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -211,20 +211,19 @@
               36:             TypeMatrix 21(fvec3) 2
               37:             TypePointer Function 36
               39:    6(float) Constant 1084017869
-              40:   21(fvec3) ConstantComposite 39 13 13
-              41:   21(fvec3) ConstantComposite 13 39 13
-              42:          36 ConstantComposite 40 41
-              43:             TypeInt 32 1
-              44:     43(int) Constant 0
-              45:             TypeInt 32 0
-              46:     45(int) Constant 0
-              49:     45(int) Constant 1
-              58:             TypePointer Output 7(fvec4)
-59(@entryPointOutput):     58(ptr) Variable Output
+              40:   21(fvec3) ConstantComposite 39 39 39
+              41:          36 ConstantComposite 40 40
+              42:             TypeInt 32 1
+              43:     42(int) Constant 0
+              44:             TypeInt 32 0
+              45:     44(int) Constant 0
+              48:     44(int) Constant 1
+              57:             TypePointer Output 7(fvec4)
+58(@entryPointOutput):     57(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
-              60:    7(fvec4) FunctionCall 9(@main()
-                              Store 59(@entryPointOutput) 60
+              59:    7(fvec4) FunctionCall 9(@main()
+                              Store 58(@entryPointOutput) 59
                               Return
                               FunctionEnd
        9(@main():    7(fvec4) Function None 8
@@ -242,14 +241,14 @@
                               Store 23(h3) 25
                               Store 27(h4) 29
                               Store 32(h22) 35
-                              Store 38(h23) 42
-              47:     11(ptr) AccessChain 38(h23) 44 46
-              48:    6(float) Load 47
-              50:     11(ptr) AccessChain 27(h4) 49
-              51:    6(float) Load 50
-              52:    6(float) FAdd 48 51
-              53:    6(float) Load 12(h0)
-              54:    6(float) FAdd 52 53
-              55:    7(fvec4) CompositeConstruct 54 54 54 54
-                              ReturnValue 55
+                              Store 38(h23) 41
+              46:     11(ptr) AccessChain 38(h23) 43 45
+              47:    6(float) Load 46
+              49:     11(ptr) AccessChain 27(h4) 48
+              50:    6(float) Load 49
+              51:    6(float) FAdd 47 50
+              52:    6(float) Load 12(h0)
+              53:    6(float) FAdd 51 52
+              54:    7(fvec4) CompositeConstruct 53 53 53 53
+                              ReturnValue 54
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.type.identifier.frag.out b/Test/baseResults/hlsl.type.identifier.frag.out
index c722e56..3ad3882 100644
--- a/Test/baseResults/hlsl.type.identifier.frag.out
+++ b/Test/baseResults/hlsl.type.identifier.frag.out
@@ -99,17 +99,28 @@
 0:25              'float' ( temp mediump float)
 0:25          Function Call: fn(f1; ( temp mediump float)
 0:25            'float' ( temp mediump float)
-0:29      Branch: Return with expression
-0:29        Construct vec4 ( temp 4-component vector of float)
-0:29          add ( temp float)
-0:29            'float' ( temp float)
-0:29            direct index ( temp float)
-0:29              direct index ( temp 3-component vector of float)
-0:29                'half2x3' ( temp 2X3 matrix of float)
-0:29                Constant:
-0:29                  0 (const int)
-0:29              Constant:
-0:29                0 (const int)
+0:28      move second child to first child ( temp float)
+0:28        direct index ( temp float)
+0:28          direct index ( temp 3-component vector of float)
+0:28            'half2x3' ( temp 2X3 matrix of float)
+0:28            Constant:
+0:28              0 (const int)
+0:28          Constant:
+0:28            0 (const int)
+0:28        component-wise multiply ( temp float)
+0:28          'float' ( temp float)
+0:28          'float' ( temp float)
+0:30      Branch: Return with expression
+0:30        Construct vec4 ( temp 4-component vector of float)
+0:30          add ( temp float)
+0:30            'float' ( temp float)
+0:30            direct index ( temp float)
+0:30              direct index ( temp 3-component vector of float)
+0:30                'half2x3' ( temp 2X3 matrix of float)
+0:30                Constant:
+0:30                  0 (const int)
+0:30              Constant:
+0:30                0 (const int)
 0:9  Function Definition: main( ( temp void)
 0:9    Function Parameters: 
 0:?     Sequence
@@ -223,17 +234,28 @@
 0:25              'float' ( temp mediump float)
 0:25          Function Call: fn(f1; ( temp mediump float)
 0:25            'float' ( temp mediump float)
-0:29      Branch: Return with expression
-0:29        Construct vec4 ( temp 4-component vector of float)
-0:29          add ( temp float)
-0:29            'float' ( temp float)
-0:29            direct index ( temp float)
-0:29              direct index ( temp 3-component vector of float)
-0:29                'half2x3' ( temp 2X3 matrix of float)
-0:29                Constant:
-0:29                  0 (const int)
-0:29              Constant:
-0:29                0 (const int)
+0:28      move second child to first child ( temp float)
+0:28        direct index ( temp float)
+0:28          direct index ( temp 3-component vector of float)
+0:28            'half2x3' ( temp 2X3 matrix of float)
+0:28            Constant:
+0:28              0 (const int)
+0:28          Constant:
+0:28            0 (const int)
+0:28        component-wise multiply ( temp float)
+0:28          'float' ( temp float)
+0:28          'float' ( temp float)
+0:30      Branch: Return with expression
+0:30        Construct vec4 ( temp 4-component vector of float)
+0:30          add ( temp float)
+0:30            'float' ( temp float)
+0:30            direct index ( temp float)
+0:30              direct index ( temp 3-component vector of float)
+0:30                'half2x3' ( temp 2X3 matrix of float)
+0:30                Constant:
+0:30                  0 (const int)
+0:30              Constant:
+0:30                0 (const int)
 0:9  Function Definition: main( ( temp void)
 0:9    Function Parameters: 
 0:?     Sequence
@@ -245,12 +267,12 @@
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 105
+// Id's are bound by 109
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 103
+                              EntryPoint Fragment 4  "main" 107
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -268,8 +290,8 @@
                               MemberName 56(foo_t) 0  "float"
                               Name 58  "float"
                               Name 86  "param"
-                              Name 94  "half2x3"
-                              Name 103  "@entryPointOutput"
+                              Name 93  "half2x3"
+                              Name 107  "@entryPointOutput"
                               Decorate 49(min16float) RelaxedPrecision
                               Decorate 50 RelaxedPrecision
                               Decorate 51 RelaxedPrecision
@@ -294,7 +316,7 @@
                               Decorate 87 RelaxedPrecision
                               Decorate 88 RelaxedPrecision
                               Decorate 89 RelaxedPrecision
-                              Decorate 103(@entryPointOutput) Location 0
+                              Decorate 107(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -319,16 +341,16 @@
        56(foo_t):             TypeStruct 6(float)
               57:             TypePointer Function 56(foo_t)
               59:    6(float) Constant 1109917696
-              91:             TypeVector 6(float) 3
-              92:             TypeMatrix 91(fvec3) 2
-              93:             TypePointer Function 92
-              95:     22(int) Constant 0
-             102:             TypePointer Output 12(fvec4)
-103(@entryPointOutput):    102(ptr) Variable Output
+              90:             TypeVector 6(float) 3
+              91:             TypeMatrix 90(fvec3) 2
+              92:             TypePointer Function 91
+              97:     22(int) Constant 0
+             106:             TypePointer Output 12(fvec4)
+107(@entryPointOutput):    106(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
-             104:   12(fvec4) FunctionCall 14(@main()
-                              Store 103(@entryPointOutput) 104
+             108:   12(fvec4) FunctionCall 14(@main()
+                              Store 107(@entryPointOutput) 108
                               Return
                               FunctionEnd
       10(fn(f1;):    6(float) Function None 8
@@ -349,7 +371,7 @@
        58(float):     57(ptr) Variable Function
               75:      7(ptr) Variable Function
        86(param):      7(ptr) Variable Function
-     94(half2x3):     93(ptr) Variable Function
+     93(half2x3):     92(ptr) Variable Function
                               Store 19(float) 20
               27:    6(float) Load 19(float)
               29:    21(bool) FOrdNotEqual 27 28
@@ -411,10 +433,15 @@
               88:    6(float) FunctionCall 10(fn(f1;) 86(param)
               89:    6(float) FAdd 85 88
                               Store 19(float) 89
-              90:    6(float) Load 19(float)
-              96:      7(ptr) AccessChain 94(half2x3) 40 95
-              97:    6(float) Load 96
-              98:    6(float) FAdd 90 97
-              99:   12(fvec4) CompositeConstruct 98 98 98 98
-                              ReturnValue 99
+              94:    6(float) Load 19(float)
+              95:    6(float) Load 19(float)
+              96:    6(float) FMul 94 95
+              98:      7(ptr) AccessChain 93(half2x3) 40 97
+                              Store 98 96
+              99:    6(float) Load 19(float)
+             100:      7(ptr) AccessChain 93(half2x3) 40 97
+             101:    6(float) Load 100
+             102:    6(float) FAdd 99 101
+             103:   12(fvec4) CompositeConstruct 102 102 102 102
+                              ReturnValue 103
                               FunctionEnd
diff --git a/Test/baseResults/reflection.vert.out b/Test/baseResults/reflection.vert.out
index de49cc4..422c049 100644
--- a/Test/baseResults/reflection.vert.out
+++ b/Test/baseResults/reflection.vert.out
@@ -70,6 +70,10 @@
 deepD[1].v3: offset -1, type 8b54, size 1, index -1, binding -1
 abl.foo: offset 0, type 1406, size 1, index 7, binding -1
 abl2.foo: offset 0, type 1406, size 1, index 11, binding -1
+buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1
+buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1
+buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1
+buf4.runtimeArray.c: offset 8, type 1406, size 1, index 15, binding -1
 anonMember1: offset 0, type 8b51, size 1, index 0, binding -1
 uf1: offset -1, type 1406, size 1, index -1, binding -1
 uf2: offset -1, type 1406, size 1, index -1, binding -1
@@ -88,6 +92,10 @@
 abl2[1]: offset -1, type ffffffff, size 4, index -1, binding -1
 abl2[2]: offset -1, type ffffffff, size 4, index -1, binding -1
 abl2[3]: offset -1, type ffffffff, size 4, index -1, binding -1
+buf1: offset -1, type ffffffff, size 4, index -1, binding -1
+buf2: offset -1, type ffffffff, size 4, index -1, binding -1
+buf3: offset -1, type ffffffff, size 4, index -1, binding -1
+buf4: offset -1, type ffffffff, size 4, index -1, binding -1
 
 Vertex attribute reflection:
 attributeFloat: offset 0, type 1406, size 0, index 0, binding -1
@@ -95,4 +103,5 @@
 attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1
 attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1
 attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1
+gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1
 
diff --git a/Test/baseResults/spv.450.tesc.out b/Test/baseResults/spv.450.tesc.out
index 18da599..6b4325b 100755
--- a/Test/baseResults/spv.450.tesc.out
+++ b/Test/baseResults/spv.450.tesc.out
@@ -36,11 +36,8 @@
                               Decorate 11(TheBlock) Block
                               Decorate 16(tcBlock) Location 12
                               MemberDecorate 17(SingleBlock) 0 Patch
-                              MemberDecorate 17(SingleBlock) 0 Location 2
                               MemberDecorate 17(SingleBlock) 1 Patch
-                              MemberDecorate 17(SingleBlock) 1 Location 3
                               MemberDecorate 17(SingleBlock) 2 Patch
-                              MemberDecorate 17(SingleBlock) 2 Location 4
                               Decorate 17(SingleBlock) Block
                               Decorate 19(singleBlock) Location 2
                               MemberDecorate 20(bn) 0 Patch
diff --git a/Test/baseResults/spv.OVR_multiview.vert.out b/Test/baseResults/spv.OVR_multiview.vert.out
new file mode 100644
index 0000000..dff67f5
--- /dev/null
+++ b/Test/baseResults/spv.OVR_multiview.vert.out
@@ -0,0 +1,57 @@
+spv.OVR_multiview.vert
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 27
+
+                              Capability Shader
+                              Capability MultiView
+                              Extension  "SPV_KHR_multiview"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 13 17 25 26
+                              Source GLSL 330
+                              SourceExtension  "GL_OVR_multiview"
+                              Name 4  "main"
+                              Name 11  "gl_PerVertex"
+                              MemberName 11(gl_PerVertex) 0  "gl_Position"
+                              MemberName 11(gl_PerVertex) 1  "gl_PointSize"
+                              MemberName 11(gl_PerVertex) 2  "gl_ClipDistance"
+                              Name 13  ""
+                              Name 17  "gl_ViewID_OVR"
+                              Name 25  "gl_VertexID"
+                              Name 26  "gl_InstanceID"
+                              MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
+                              MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
+                              MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
+                              Decorate 11(gl_PerVertex) Block
+                              Decorate 17(gl_ViewID_OVR) BuiltIn ViewIndex
+                              Decorate 25(gl_VertexID) BuiltIn VertexId
+                              Decorate 26(gl_InstanceID) BuiltIn InstanceId
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeInt 32 0
+               9:      8(int) Constant 1
+              10:             TypeArray 6(float) 9
+11(gl_PerVertex):             TypeStruct 7(fvec4) 6(float) 10
+              12:             TypePointer Output 11(gl_PerVertex)
+              13:     12(ptr) Variable Output
+              14:             TypeInt 32 1
+              15:     14(int) Constant 0
+              16:             TypePointer Input 8(int)
+17(gl_ViewID_OVR):     16(ptr) Variable Input
+              20:    6(float) Constant 0
+              22:             TypePointer Output 7(fvec4)
+              24:             TypePointer Input 14(int)
+ 25(gl_VertexID):     24(ptr) Variable Input
+26(gl_InstanceID):     24(ptr) Variable Input
+         4(main):           2 Function None 3
+               5:             Label
+              18:      8(int) Load 17(gl_ViewID_OVR)
+              19:    6(float) ConvertUToF 18
+              21:    7(fvec4) CompositeConstruct 19 20 20 20
+              23:     22(ptr) AccessChain 13 15
+                              Store 23 21
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.arbPostDepthCoverage.frag.out b/Test/baseResults/spv.arbPostDepthCoverage.frag.out
new file mode 100644
index 0000000..1d92dbe
--- /dev/null
+++ b/Test/baseResults/spv.arbPostDepthCoverage.frag.out
@@ -0,0 +1,43 @@
+spv.arbPostDepthCoverage.frag
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 18
+
+                              Capability Shader
+                              Capability SampleRateShading
+                              Capability SampleMaskPostDepthCoverage
+                              Extension  "SPV_KHR_post_depth_coverage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 8 13
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 EarlyFragmentTests
+                              ExecutionMode 4 PostDepthCoverage
+                              Source GLSL 450
+                              SourceExtension  "GL_ARB_post_depth_coverage"
+                              SourceExtension  "GL_EXT_post_depth_coverage"
+                              Name 4  "main"
+                              Name 8  "readSampleMaskIn"
+                              Name 13  "gl_SampleMaskIn"
+                              Decorate 8(readSampleMaskIn) Location 0
+                              Decorate 13(gl_SampleMaskIn) Flat
+                              Decorate 13(gl_SampleMaskIn) BuiltIn SampleMask
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypePointer Output 6(int)
+8(readSampleMaskIn):      7(ptr) Variable Output
+               9:             TypeInt 32 0
+              10:      9(int) Constant 1
+              11:             TypeArray 6(int) 10
+              12:             TypePointer Input 11
+13(gl_SampleMaskIn):     12(ptr) Variable Input
+              14:      6(int) Constant 0
+              15:             TypePointer Input 6(int)
+         4(main):           2 Function None 3
+               5:             Label
+              16:     15(ptr) AccessChain 13(gl_SampleMaskIn) 14
+              17:      6(int) Load 16
+                              Store 8(readSampleMaskIn) 17
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out b/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out
new file mode 100644
index 0000000..b210144
--- /dev/null
+++ b/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out
@@ -0,0 +1,7 @@
+spv.arbPostDepthCoverage_Error.frag
+ERROR: 0:7: 'early_fragment_tests' : can only apply to a standalone qualifier 
+ERROR: 0:7: 'post_depth_coverage' : can only apply to a standalone qualifier 
+ERROR: 2 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/spv.extPostDepthCoverage.frag.out b/Test/baseResults/spv.extPostDepthCoverage.frag.out
new file mode 100644
index 0000000..f273656
--- /dev/null
+++ b/Test/baseResults/spv.extPostDepthCoverage.frag.out
@@ -0,0 +1,23 @@
+spv.extPostDepthCoverage.frag
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 6
+
+                              Capability Shader
+                              Capability SampleMaskPostDepthCoverage
+                              Extension  "SPV_KHR_post_depth_coverage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main"
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 EarlyFragmentTests
+                              ExecutionMode 4 PostDepthCoverage
+                              Source ESSL 310
+                              SourceExtension  "GL_EXT_post_depth_coverage"
+                              Name 4  "main"
+               2:             TypeVoid
+               3:             TypeFunction 2
+         4(main):           2 Function None 3
+               5:             Label
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out b/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out
new file mode 100644
index 0000000..9ce299f
--- /dev/null
+++ b/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out
@@ -0,0 +1,4 @@
+spv.extPostDepthCoverage_Error.frag
+ERROR: Linking fragment stage: post_depth_coverage requires early_fragment_tests
+
+SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/spv.memoryQualifier.frag.out b/Test/baseResults/spv.memoryQualifier.frag.out
index d4841a4..0060868 100644
--- a/Test/baseResults/spv.memoryQualifier.frag.out
+++ b/Test/baseResults/spv.memoryQualifier.frag.out
@@ -44,9 +44,7 @@
                               Decorate 44(iCube) DescriptorSet 0
                               Decorate 44(iCube) Binding 3
                               Decorate 44(iCube) NonReadable
-                              MemberDecorate 49(Data) 0 Coherent
                               MemberDecorate 49(Data) 0 Offset 0
-                              MemberDecorate 49(Data) 1 Coherent
                               MemberDecorate 49(Data) 1 Offset 8
                               MemberDecorate 50(Buffer) 0 Coherent
                               MemberDecorate 50(Buffer) 0 Volatile
diff --git a/Test/baseResults/spv.noBuiltInLoc.vert.out b/Test/baseResults/spv.noBuiltInLoc.vert.out
new file mode 100644
index 0000000..3d980bf
--- /dev/null
+++ b/Test/baseResults/spv.noBuiltInLoc.vert.out
@@ -0,0 +1,51 @@
+spv.noBuiltInLoc.vert
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 23
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 9 11 18
+                              Source GLSL 450
+                              Name 4  "main"
+                              Name 9  "bar"
+                              Name 11  "foo"
+                              Name 16  "gl_PerVertex"
+                              MemberName 16(gl_PerVertex) 0  "gl_Position"
+                              MemberName 16(gl_PerVertex) 1  "gl_PointSize"
+                              MemberName 16(gl_PerVertex) 2  "gl_ClipDistance"
+                              MemberName 16(gl_PerVertex) 3  "gl_CullDistance"
+                              Name 18  ""
+                              Decorate 9(bar) Location 0
+                              Decorate 11(foo) Location 0
+                              MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position
+                              MemberDecorate 16(gl_PerVertex) 1 BuiltIn PointSize
+                              MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance
+                              MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance
+                              Decorate 16(gl_PerVertex) Block
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+          9(bar):      8(ptr) Variable Output
+              10:             TypePointer Input 7(fvec4)
+         11(foo):     10(ptr) Variable Input
+              13:             TypeInt 32 0
+              14:     13(int) Constant 1
+              15:             TypeArray 6(float) 14
+16(gl_PerVertex):             TypeStruct 7(fvec4) 6(float) 15 15
+              17:             TypePointer Output 16(gl_PerVertex)
+              18:     17(ptr) Variable Output
+              19:             TypeInt 32 1
+              20:     19(int) Constant 0
+         4(main):           2 Function None 3
+               5:             Label
+              12:    7(fvec4) Load 11(foo)
+                              Store 9(bar) 12
+              21:    7(fvec4) Load 11(foo)
+              22:      8(ptr) AccessChain 18 20
+                              Store 22 21
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.paramMemory.frag.out b/Test/baseResults/spv.paramMemory.frag.out
new file mode 100755
index 0000000..8b98b49
--- /dev/null
+++ b/Test/baseResults/spv.paramMemory.frag.out
@@ -0,0 +1,137 @@
+spv.paramMemory.frag
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 69
+
+                              Capability Shader
+                              Capability StorageImageReadWithoutFormat
+                              Capability StorageImageWriteWithoutFormat
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 27 66
+                              ExecutionMode 4 OriginUpperLeft
+                              Source ESSL 310
+                              Name 4  "main"
+                              Name 16  "image_load(I21;vi2;"
+                              Name 14  "image"
+                              Name 15  "coords"
+                              Name 23  "image_store(I21;vi2;vf4;"
+                              Name 20  "image"
+                              Name 21  "coords"
+                              Name 22  "data"
+                              Name 27  "in_coords"
+                              Name 35  "read1"
+                              Name 38  "image1"
+                              Name 39  "param"
+                              Name 42  "read2"
+                              Name 45  "image2"
+                              Name 46  "param"
+                              Name 49  "image3"
+                              Name 53  "param"
+                              Name 55  "param"
+                              Name 57  "image4"
+                              Name 61  "param"
+                              Name 63  "param"
+                              Name 66  "out_color"
+                              Decorate 14(image) Coherent
+                              Decorate 14(image) NonWritable
+                              Decorate 20(image) Coherent
+                              Decorate 20(image) NonReadable
+                              Decorate 27(in_coords) Flat
+                              Decorate 27(in_coords) Location 0
+                              Decorate 38(image1) DescriptorSet 0
+                              Decorate 38(image1) Binding 0
+                              Decorate 38(image1) Coherent
+                              Decorate 38(image1) NonWritable
+                              Decorate 45(image2) DescriptorSet 0
+                              Decorate 45(image2) Binding 2
+                              Decorate 45(image2) NonWritable
+                              Decorate 49(image3) DescriptorSet 0
+                              Decorate 49(image3) Binding 1
+                              Decorate 49(image3) Coherent
+                              Decorate 49(image3) NonReadable
+                              Decorate 57(image4) DescriptorSet 0
+                              Decorate 57(image4) Binding 3
+                              Decorate 57(image4) NonReadable
+                              Decorate 66(out_color) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeImage 6(float) 2D nonsampled format:Unknown
+               8:             TypePointer UniformConstant 7
+               9:             TypeInt 32 1
+              10:             TypeVector 9(int) 2
+              11:             TypePointer Function 10(ivec2)
+              12:             TypeVector 6(float) 4
+              13:             TypeFunction 12(fvec4) 8(ptr) 11(ptr)
+              18:             TypePointer Function 12(fvec4)
+              19:             TypeFunction 2 8(ptr) 11(ptr) 18(ptr)
+              26:             TypePointer Input 10(ivec2)
+   27(in_coords):     26(ptr) Variable Input
+              36:             TypeImage 6(float) 2D nonsampled format:Rgba32f
+              37:             TypePointer UniformConstant 36
+      38(image1):     37(ptr) Variable UniformConstant
+              43:             TypeImage 6(float) 2D nonsampled format:Rgba16f
+              44:             TypePointer UniformConstant 43
+      45(image2):     44(ptr) Variable UniformConstant
+      49(image3):     37(ptr) Variable UniformConstant
+              51:    6(float) Constant 1056964608
+      57(image4):     44(ptr) Variable UniformConstant
+              59:    6(float) Constant 1073741824
+              65:             TypePointer Output 12(fvec4)
+   66(out_color):     65(ptr) Variable Output
+              67:    6(float) Constant 0
+              68:   12(fvec4) ConstantComposite 67 67 67 67
+         4(main):           2 Function None 3
+               5:             Label
+       35(read1):     18(ptr) Variable Function
+       39(param):     11(ptr) Variable Function
+       42(read2):     18(ptr) Variable Function
+       46(param):     11(ptr) Variable Function
+       53(param):     11(ptr) Variable Function
+       55(param):     18(ptr) Variable Function
+       61(param):     11(ptr) Variable Function
+       63(param):     18(ptr) Variable Function
+              40:   10(ivec2) Load 27(in_coords)
+                              Store 39(param) 40
+              41:   12(fvec4) FunctionCall 16(image_load(I21;vi2;) 38(image1) 39(param)
+                              Store 35(read1) 41
+              47:   10(ivec2) Load 27(in_coords)
+                              Store 46(param) 47
+              48:   12(fvec4) FunctionCall 16(image_load(I21;vi2;) 45(image2) 46(param)
+                              Store 42(read2) 48
+              50:   12(fvec4) Load 35(read1)
+              52:   12(fvec4) VectorTimesScalar 50 51
+              54:   10(ivec2) Load 27(in_coords)
+                              Store 53(param) 54
+                              Store 55(param) 52
+              56:           2 FunctionCall 23(image_store(I21;vi2;vf4;) 49(image3) 53(param) 55(param)
+              58:   12(fvec4) Load 42(read2)
+              60:   12(fvec4) VectorTimesScalar 58 59
+              62:   10(ivec2) Load 27(in_coords)
+                              Store 61(param) 62
+                              Store 63(param) 60
+              64:           2 FunctionCall 23(image_store(I21;vi2;vf4;) 57(image4) 61(param) 63(param)
+                              Store 66(out_color) 68
+                              Return
+                              FunctionEnd
+16(image_load(I21;vi2;):   12(fvec4) Function None 13
+       14(image):      8(ptr) FunctionParameter
+      15(coords):     11(ptr) FunctionParameter
+              17:             Label
+              25:           7 Load 14(image)
+              28:   10(ivec2) Load 27(in_coords)
+              29:   12(fvec4) ImageRead 25 28
+                              ReturnValue 29
+                              FunctionEnd
+23(image_store(I21;vi2;vf4;):           2 Function None 19
+       20(image):      8(ptr) FunctionParameter
+      21(coords):     11(ptr) FunctionParameter
+        22(data):     18(ptr) FunctionParameter
+              24:             Label
+              32:           7 Load 20(image)
+              33:   10(ivec2) Load 27(in_coords)
+              34:   12(fvec4) Load 22(data)
+                              ImageWrite 32 33 34
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.shaderStencilExport.frag.out b/Test/baseResults/spv.shaderStencilExport.frag.out
new file mode 100644
index 0000000..c0c7209
--- /dev/null
+++ b/Test/baseResults/spv.shaderStencilExport.frag.out
@@ -0,0 +1,26 @@
+spv.shaderStencilExport.frag
+Missing functionality: shader stencil export
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 10
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 8
+                              ExecutionMode 4 OriginUpperLeft
+                              Source GLSL 450
+                              SourceExtension  "GL_ARB_shader_stencil_export"
+                              Name 4  "main"
+                              Name 8  "gl_FragStencilRefARB"
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypePointer Output 6(int)
+8(gl_FragStencilRefARB):      7(ptr) Variable Output
+               9:      6(int) Constant 100
+         4(main):           2 Function None 3
+               5:             Label
+                              Store 8(gl_FragStencilRefARB) 9
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out
index 6c2df3a..bcaa9fe 100644
--- a/Test/baseResults/spv.specConstant.vert.out
+++ b/Test/baseResults/spv.specConstant.vert.out
@@ -11,7 +11,7 @@
                               Source GLSL 400
                               Name 4  "main"
                               Name 9  "arraySize"
-                              Name 14  "foo(vf4[s1521];"
+                              Name 14  "foo(vf4[s1522];"
                               Name 13  "p"
                               Name 17  "builtin_spec_constant("
                               Name 20  "color"
@@ -102,10 +102,10 @@
                               Store 20(color) 46
               48:          10 Load 22(ucol)
                               Store 47(param) 48
-              49:           2 FunctionCall 14(foo(vf4[s1521];) 47(param)
+              49:           2 FunctionCall 14(foo(vf4[s1522];) 47(param)
                               Return
                               FunctionEnd
-14(foo(vf4[s1521];):           2 Function None 12
+14(foo(vf4[s1522];):           2 Function None 12
            13(p):     11(ptr) FunctionParameter
               15:             Label
               54:     24(ptr) AccessChain 53(dupUcol) 23
diff --git a/Test/baseResults/spv.ssbo.autoassign.frag.out b/Test/baseResults/spv.ssbo.autoassign.frag.out
index ca282c6..6b7c723 100644
--- a/Test/baseResults/spv.ssbo.autoassign.frag.out
+++ b/Test/baseResults/spv.ssbo.autoassign.frag.out
@@ -30,9 +30,7 @@
                               Name 92  "pos"
                               Name 95  "@entryPointOutput"
                               Name 96  "param"
-                              MemberDecorate 14(BufType) 0 NonWritable
                               MemberDecorate 14(BufType) 0 Offset 0
-                              MemberDecorate 14(BufType) 1 NonWritable
                               MemberDecorate 14(BufType) 1 Offset 16
                               Decorate 15 ArrayStride 32
                               MemberDecorate 16(SB0) 0 NonWritable
diff --git a/Test/baseResults/spv.texture.sampler.transform.frag.out b/Test/baseResults/spv.texture.sampler.transform.frag.out
index bc86ab2..ffa664e 100644
--- a/Test/baseResults/spv.texture.sampler.transform.frag.out
+++ b/Test/baseResults/spv.texture.sampler.transform.frag.out
@@ -1,19 +1,19 @@
 spv.texture.sampler.transform.frag
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 19
+// Id's are bound by 20
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 9 16
+                              EntryPoint Fragment 4  "main" 9 17
                               ExecutionMode 4 OriginUpperLeft
                               Source GLSL 440
                               Name 4  "main"
                               Name 9  "color"
-                              Name 12  "tex"
-                              Name 16  "coord"
-                              Decorate 12(tex) DescriptorSet 0
+                              Name 13  "tex"
+                              Name 17  "coord"
+                              Decorate 13(tex) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -21,16 +21,17 @@
                8:             TypePointer Output 7(fvec4)
         9(color):      8(ptr) Variable Output
               10:             TypeImage 6(float) 2D sampled format:Unknown
-              11:             TypePointer UniformConstant 10
-         12(tex):     11(ptr) Variable UniformConstant
-              14:             TypeVector 6(float) 2
-              15:             TypePointer Input 14(fvec2)
-       16(coord):     15(ptr) Variable Input
+              11:             TypeSampledImage 10
+              12:             TypePointer UniformConstant 11
+         13(tex):     12(ptr) Variable UniformConstant
+              15:             TypeVector 6(float) 2
+              16:             TypePointer Input 15(fvec2)
+       17(coord):     16(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
-              13:          10 Load 12(tex)
-              17:   14(fvec2) Load 16(coord)
-              18:    7(fvec4) ImageSampleImplicitLod 13 17
-                              Store 9(color) 18
+              14:          11 Load 13(tex)
+              18:   15(fvec2) Load 17(coord)
+              19:    7(fvec4) ImageSampleImplicitLod 14 18
+                              Store 9(color) 19
                               Return
                               FunctionEnd
diff --git a/Test/glsl.-D-U.frag b/Test/glsl.-D-U.frag
new file mode 100644
index 0000000..4d2325f
--- /dev/null
+++ b/Test/glsl.-D-U.frag
@@ -0,0 +1,32 @@
+#version 450
+
+#define IN_SHADER
+
+layout(location=0) out vec4 color;
+
+void main()
+{
+#if FOO==200
+    color = vec4(1.0);
+#else
+    #error expected FOO 200
+#endif
+
+#ifdef IN_SHADER
+    color++;
+#else
+    #error IN_SHADER was undef
+#endif
+
+#ifdef UNDEFED
+    #error UNDEFED defined
+#else
+    color *= 3.0;
+#endif
+
+#if MUL == 400
+    color *= MUL;
+#else
+    #error bad MUL
+#endif
+}
diff --git a/Test/glspv.frag b/Test/glspv.frag
index cea8e13..008d191 100644
--- a/Test/glspv.frag
+++ b/Test/glspv.frag
@@ -1,4 +1,4 @@
-#version 330

+#version 450

 

 #ifdef GL_SPIRV

 #error GL_SPIRV is set ( correct, not an error )

@@ -11,4 +11,9 @@
 {

 }

 

+uniform float f; // ERROR, no location

+layout(location = 2) uniform float g;

+uniform sampler2D s1;

+layout(location = 3) uniform sampler2D s2;

+

 layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs

diff --git a/Test/hlsl.-D-U.frag b/Test/hlsl.-D-U.frag
new file mode 100644
index 0000000..0a02222
--- /dev/null
+++ b/Test/hlsl.-D-U.frag
@@ -0,0 +1,31 @@
+
+#define IN_SHADER
+
+static float4 color;
+
+void main()
+{
+#if FOO==200
+    color = 1.0;
+#else
+    #error expected FOO 200
+#endif
+
+#ifdef FOO
+    color -= 5.0;
+#else
+    #error expected FOO 200
+#endif
+
+#ifdef IN_SHADER
+    color++;
+#else
+    #error IN_SHADER was undef
+#endif
+
+#ifdef UNDEFED
+    #error UNDEFED defined
+#else
+    color *= 3.0;
+#endif
+}
diff --git a/Test/hlsl.buffer.frag b/Test/hlsl.buffer.frag
index 1604ea4..520de09 100644
--- a/Test/hlsl.buffer.frag
+++ b/Test/hlsl.buffer.frag
@@ -1,17 +1,17 @@
-cbuffer {
+cbuffer buf1 {
     float4 v1;
-};
+}; // extraneous ;
 
-tbuffer {
+tbuffer buf2 {
     float4 v2;
-};
+}; // extraneous ;
 
-cbuffer cbufName : register(b2, space10) {
-    float4 v3;
-    int i3 : packoffset(c1.y);
-} // no semicolon is okay
+cbuffer cbufName {
+    float4 v3 : packoffset(c0);
+    int i3    : packoffset(c1.y);
+}
 
-tbuffer tbufName : register(b8) {
+tbuffer tbufName : register(t8) {
     float4 v4 : packoffset(c1);
     int i4    : packoffset(c3);
     float f1  : packoffset(c3.w);
@@ -19,14 +19,19 @@
     float f4  : packoffset(c4.y);
     float f5  : packoffset(c4.z);
     float f6  : packoffset(c);
-    float f7;
-                 float3x4 m1;
-       row_major float3x4 m2;
-    column_major float3x4 m3;
-                 float3x4 m4;
-}  // no semicolon is okay
+    float f7  : packoffset(c8);
+                 float3x4 m1 : packoffset(c7);
+       row_major float3x4 m2 : packoffset(c11);
+    column_major float3x4 m3 : packoffset(c15);
+                 float3x4 m4 : packoffset(c19);
+}
 
-float4 PixelShaderFunction(float4 input) : COLOR0
+float foo() // float looks like identifier, but can't be part of tbuffer
 {
-    return input + v1 + v2 + v3 + v4;
+    return 1.0;
+}
+
+float4 PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0
+{
+    return (input + v1 + v2 + v3 + v4) * foo();
 }
diff --git a/Test/hlsl.clipdistance-1.vert b/Test/hlsl.clipdistance-1.vert
new file mode 100644
index 0000000..bcebafc
--- /dev/null
+++ b/Test/hlsl.clipdistance-1.vert
@@ -0,0 +1,8 @@
+void main(out float4 pos : SV_Position, 
+          out float clip : SV_ClipDistance,  // scalar float
+          out float cull : SV_CullDistance)  // scalar float
+{
+    pos = 1.0f.xxxx;
+    clip = 0.5f;
+    cull = 0.51f;
+}
diff --git a/Test/hlsl.clipdistance-2.vert b/Test/hlsl.clipdistance-2.vert
new file mode 100644
index 0000000..bf8c0ee
--- /dev/null
+++ b/Test/hlsl.clipdistance-2.vert
@@ -0,0 +1,15 @@
+void main(out float4 pos : SV_Position,
+          out float2 clip[2] : SV_ClipDistance,  // array of vector float
+          out float2 cull[2] : SV_CullDistance)  // array of vector float
+{
+    pos = 1.0f.xxxx;
+    clip[0].x = 0.5f;
+    clip[0].y = 0.6f;
+    clip[1].x = 0.7f;
+    clip[1].y = 0.8f;
+
+    cull[0].x = 0.525f;
+    cull[0].y = 0.625f;
+    cull[1].x = 0.725f;
+    cull[1].y = 0.825f;
+}
diff --git a/Test/hlsl.clipdistance-3.vert b/Test/hlsl.clipdistance-3.vert
new file mode 100644
index 0000000..a759a9c
--- /dev/null
+++ b/Test/hlsl.clipdistance-3.vert
@@ -0,0 +1,13 @@
+void main(out float4 pos : SV_Position,
+          out float clip[2] : SV_ClipDistance, // array of scalar float
+          out float cull[2] : SV_CullDistance) // array of scalar float
+{
+    pos = 1.0f.xxxx;
+    clip[0] = 0.5f;
+    clip[1] = 0.6f;
+
+    cull[0] = 0.525f;
+    cull[1] = 0.625f;
+}
+
+
diff --git a/Test/hlsl.clipdistance-4.vert b/Test/hlsl.clipdistance-4.vert
new file mode 100644
index 0000000..5e0d082
--- /dev/null
+++ b/Test/hlsl.clipdistance-4.vert
@@ -0,0 +1,21 @@
+struct VS_INPUT         {
+    float4 Position             : POSITION;
+};
+
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+    float4 ClipRect             : SV_ClipDistance0;  // vector in split struct
+};
+
+VS_OUTPUT main(const VS_INPUT v)
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    Output.ClipRect.x = 1;
+    Output.ClipRect.y = 2;
+    Output.ClipRect.z = 3;
+    Output.ClipRect.w = 4;
+
+    return Output;
+}
diff --git a/Test/hlsl.clipdistance-5.vert b/Test/hlsl.clipdistance-5.vert
new file mode 100644
index 0000000..02fb862
--- /dev/null
+++ b/Test/hlsl.clipdistance-5.vert
@@ -0,0 +1,21 @@
+struct VS_INPUT         {
+    float4 Position             : POSITION;
+};
+
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+    float2 ClipRect[2]          : SV_ClipDistance0;  // array of float2 in split struct
+};
+
+VS_OUTPUT main(const VS_INPUT v)
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    Output.ClipRect[0].x = 1;
+    Output.ClipRect[0].y = 2;
+    Output.ClipRect[1].x = 3;
+    Output.ClipRect[1].y = 4;
+
+    return Output;
+}
diff --git a/Test/hlsl.clipdistance-6.vert b/Test/hlsl.clipdistance-6.vert
new file mode 100644
index 0000000..d68c225
--- /dev/null
+++ b/Test/hlsl.clipdistance-6.vert
@@ -0,0 +1,23 @@
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+    float4 clip0                : SV_ClipDistance0;  // multiple semantic IDs, two vec4s (no extra packing)
+    float4 clip1                : SV_ClipDistance1;  // ...
+};
+
+VS_OUTPUT main()
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    Output.clip0.x = 0;
+    Output.clip0.y = 1;
+    Output.clip0.z = 2;
+    Output.clip0.w = 3;
+
+    Output.clip1.x = 4;
+    Output.clip1.y = 5;
+    Output.clip1.z = 6;
+    Output.clip1.w = 7;
+
+    return Output;
+}
diff --git a/Test/hlsl.clipdistance-7.vert b/Test/hlsl.clipdistance-7.vert
new file mode 100644
index 0000000..c615d1f
--- /dev/null
+++ b/Test/hlsl.clipdistance-7.vert
@@ -0,0 +1,23 @@
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+    float3 clip0                : SV_ClipDistance0;  // multiple semantic IDs, vec3+vec4 (skip)
+    float4 clip1                : SV_ClipDistance1;  // ...
+};
+
+VS_OUTPUT main()
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    Output.clip0.x = 0;
+    Output.clip0.y = 1;
+    Output.clip0.z = 2;
+    // Position 3 is skipped
+
+    Output.clip1.x = 4;
+    Output.clip1.y = 5;
+    Output.clip1.z = 6;
+    Output.clip1.w = 7;
+
+    return Output;
+}
diff --git a/Test/hlsl.clipdistance-8.vert b/Test/hlsl.clipdistance-8.vert
new file mode 100644
index 0000000..c6377d2
--- /dev/null
+++ b/Test/hlsl.clipdistance-8.vert
@@ -0,0 +1,20 @@
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+    float3 clip0                : SV_ClipDistance0;  // multiple semantic IDs, vec3+float (pack)
+    float  clip1                : SV_ClipDistance1;  // ...
+};
+
+VS_OUTPUT main()
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    Output.clip0.x = 0;
+    Output.clip0.y = 1;
+    Output.clip0.z = 2;
+
+    // Position 3 is packed from clip1's float
+    Output.clip1   = 3;
+
+    return Output;
+}
diff --git a/Test/hlsl.clipdistance-9.vert b/Test/hlsl.clipdistance-9.vert
new file mode 100644
index 0000000..d488307
--- /dev/null
+++ b/Test/hlsl.clipdistance-9.vert
@@ -0,0 +1,19 @@
+struct VS_OUTPUT        {
+    float4 Position             : SV_Position;
+};
+
+// Test packing 0 and 1 semantics into single array[4] output, from out fn params.
+VS_OUTPUT main(out float3 clip0 : SV_ClipDistance0, out float clip1 : SV_ClipDistance1)
+{
+    VS_OUTPUT           Output;
+    Output.Position     = 0;
+
+    clip0.x = 0;
+    clip0.y = 1;
+    clip0.z = 2;
+
+    // Position 3 is packed from clip1's float
+    clip1   = 3;
+
+    return Output;
+}
diff --git a/Test/hlsl.constructArray.vert b/Test/hlsl.constructArray.vert
new file mode 100644
index 0000000..52c4b6f
--- /dev/null
+++ b/Test/hlsl.constructArray.vert
@@ -0,0 +1,10 @@
+float4 main() :  SV_POSITION 
+{
+    int4 int4_array[3];
+    float4 float4_array_times[2] = (float4[2])int4_array;
+    float2 float2_array_times2[4] = (float2[4])int4_array;
+    int4 int4_array2[2] = (int4[2])int4_array;
+    int int1_array[2] = (int[2])int4_array;
+
+    return (float4)0.0;
+}
diff --git a/Test/hlsl.explicitDescriptorSet.frag b/Test/hlsl.explicitDescriptorSet.frag
new file mode 100644
index 0000000..1cff8d3
--- /dev/null
+++ b/Test/hlsl.explicitDescriptorSet.frag
@@ -0,0 +1,15 @@
+SamplerState       g_sSamp : register(s1);
+
+Texture1D <float4> g_tTex1df4 : register(t0);
+
+SamplerState       g_sSamp2_amb;
+uniform float      floatval_amb;
+
+Buffer<float>      floatbuff;
+
+float4 main() : SV_Target0
+{
+    g_sSamp2_amb;
+
+    return 0;
+}
diff --git a/Test/hlsl.flattenOpaqueInit.vert b/Test/hlsl.flattenOpaqueInit.vert
new file mode 100644
index 0000000..5efb02e
--- /dev/null
+++ b/Test/hlsl.flattenOpaqueInit.vert
@@ -0,0 +1,13 @@
+struct FxaaTex { SamplerState smpl; Texture2D tex; };

+SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture;

+

+float4 lookUp(FxaaTex tex)

+{

+    return tex.tex.Sample(tex.smpl, float2(0.3, 0.4));

+}

+

+float4 main() : SV_TARGET0

+{

+    FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture };

+    return lookUp(tex);

+}
\ No newline at end of file
diff --git a/Test/hlsl.flattenOpaqueInitMix.vert b/Test/hlsl.flattenOpaqueInitMix.vert
new file mode 100644
index 0000000..2e712ee
--- /dev/null
+++ b/Test/hlsl.flattenOpaqueInitMix.vert
@@ -0,0 +1,13 @@
+struct FxaaTex { SamplerState smpl; Texture2D tex; float f; };

+SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture;

+

+float4 lookUp(FxaaTex tex)

+{

+    return tex.tex.Sample(tex.smpl, float2(tex.f, tex.f));

+}

+

+float4 main() : SV_TARGET0

+{

+    FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture, 0.5 };

+    return lookUp(tex);

+}
\ No newline at end of file
diff --git a/Test/hlsl.global-const-init.frag b/Test/hlsl.global-const-init.frag
new file mode 100644
index 0000000..d8f36c9
--- /dev/null
+++ b/Test/hlsl.global-const-init.frag
@@ -0,0 +1,14 @@
+
+cbuffer CB {
+    float4 foo;
+};
+
+static const float4 bar = foo; // test const (in the immutable sense) initializer from non-const.
+
+static const float2 a1[2] = { { 1, 2 }, { foo.x, 4 } }; // not entirely constant
+static const float2 a2[2] = { { 5, 6 }, { 7, 8 } };     // entirely constant
+
+float4 main() : SV_Target0
+{
+    return bar;
+}
diff --git a/Test/hlsl.hull.3.tesc b/Test/hlsl.hull.3.tesc
new file mode 100644
index 0000000..8509dca
--- /dev/null
+++ b/Test/hlsl.hull.3.tesc
@@ -0,0 +1,39 @@
+// *** 
+// invocation ID coming from synthesized variable
+// ***
+
+struct VS_OUT
+{
+    float3 cpoint : CPOINT;
+};
+
+struct HS_CONSTANT_OUT
+{
+    float edges[2] : SV_TessFactor;
+};
+
+struct HS_OUT
+{
+    float3 cpoint : CPOINT;
+};
+
+[domain("tri")]
+[partitioning("integer")]
+[outputtopology("point")]
+[outputcontrolpoints(4)]
+[patchconstantfunc("PCF")]
+HS_OUT main(InputPatch<VS_OUT, 4> ip)
+{
+    HS_OUT output;
+    output.cpoint = ip[0].cpoint;
+    return output;
+}
+
+HS_CONSTANT_OUT PCF(uint pid : SV_PrimitiveId, float4 pos : SV_Position)
+{
+    HS_CONSTANT_OUT output;
+    
+    output.edges[0] = 2.0f;
+    output.edges[1] = 8.0f;
+    return output;
+}
diff --git a/Test/hlsl.hull.void.tesc b/Test/hlsl.hull.void.tesc
index 971d613..c96ecb4 100644
--- a/Test/hlsl.hull.void.tesc
+++ b/Test/hlsl.hull.void.tesc
@@ -19,7 +19,7 @@
 
 [domain("tri")]
 [partitioning("fractional_even")]
-[outputtopology("line")]
+[outputtopology("triangle_ccw")]
 [outputcontrolpoints(3)]
 [patchconstantfunc("PCF")]
 HS_OUT main(InputPatch<VS_OUT, 3> ip)
diff --git a/Test/hlsl.inoutquals.frag b/Test/hlsl.inoutquals.frag
index 9328dfb..6a124f8 100644
--- a/Test/hlsl.inoutquals.frag
+++ b/Test/hlsl.inoutquals.frag
@@ -4,11 +4,12 @@
     float  Depth : SV_Depth;
 };
 
-inline void MyFunc(in float x, out float y, inout float z)
+inline void MyFunc(in float x, out float y, inout float z, in out float w)
 {
     y = x;
     z = y;
     x = -1; // no effect since x = in param
+    w *= 1;
 }
 
 PS_OUTPUT main(noperspective in float4 inpos : SV_Position, out int sampleMask : SV_Coverage)
@@ -16,7 +17,7 @@
    PS_OUTPUT psout;
 
    float x = 7, y, z = 3;
-   MyFunc(x, y, z);
+   MyFunc(x, y, z, inpos.w);
 
    psout.Color = float4(x, y, z, 1);
    psout.Depth = inpos.w;
diff --git a/Test/hlsl.reflection.vert b/Test/hlsl.reflection.vert
index 21cc810..06207c7 100644
--- a/Test/hlsl.reflection.vert
+++ b/Test/hlsl.reflection.vert
@@ -19,27 +19,10 @@
     float4 c_anonMember3;

 };

 

-cbuffer named {

-    float3 deadMember1;

-    int scalar;

-    float4 member2;

-    float4 member3;

-    float2 memfloat2;

-    float memf1;

-    bool  memf2;

-    int   memf3;

-    float2 memfloat2a;

-    float2x2 m22[7];

-} ablock;

-

 cbuffer namelessdead {

     int a;

 };

 

-cbuffer namedDead {

-    int b;

-} bblock;

-

 struct N1 {

     float a;

 };

@@ -57,7 +40,7 @@
 

 cbuffer nested {

     N3 foo;

-} nest;

+}

 

 struct TS {

     int a;

@@ -89,16 +72,12 @@
     int3 v3;

 };

 

-

-

-

 uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2];

 

 const bool control = true;

 

 void deadFunction()

 {

-    float3 v3 = ablock.deadMember1;

     float4 v = anonDeadMember2;

     float f = ufDead4;

 }

@@ -110,12 +89,12 @@
 }

 

 tbuffer abl {

-    float foo;

-} arrBl;

+    float foo1;

+}

 

 tbuffer abl2 {

-    float foo;

-} arrBl2;

+    float foo2;

+}

 

 void flizv(in float attributeFloat, in float2 attributeFloat2, in float3 attributeFloat3, in float4 attributeFloat4, in float4x4 attributeMat4)

 {

@@ -130,22 +109,16 @@
         liveFunction2();

         f = anonMember3.z;

         f = s.a;

-        f = ablock.scalar;

         f = m23[1].y + scalarAfterm23;

         f = c_m23[1].y + c_scalarAfterm23;

         f += scalarBeforeArray;

         f += floatArray[2];

         f += floatArray[4];

         f += scalarAfterArray;

-        f += ablock.memfloat2.x;

-        f += ablock.memf1;

-        f += float(ablock.memf2);

-        f += ablock.memf3;

-        f += ablock.memfloat2a.y;

-        f += ablock.m22[i][1][0];

+        f += m22[i][1][0];

         f += dm22[3][0][1];

         f += m22[2][1].y;

-        f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d;

+        f += foo.n1.a + foo.n2.b + foo.n2.c + foo.n2.d;

         f += deepA[i].d2.d1[2].va[1].x;

         f += deepB[1].d2.d1[i].va[1].x;

         f += deepB[i].d2.d1[i].va[1].x;

@@ -154,8 +127,8 @@
     } else

         f = ufDead3;

 

-    f += arrBl.foo + arrBl.foo;

-    f += arrBl2.foo;

+    f += foo1 + foo2;

+    f += foo2;

 

     f += attributeFloat;

     f += attributeFloat2.x;

diff --git a/Test/hlsl.scalar2matrix.frag b/Test/hlsl.scalar2matrix.frag
new file mode 100644
index 0000000..4068875
--- /dev/null
+++ b/Test/hlsl.scalar2matrix.frag
@@ -0,0 +1,28 @@
+
+void Fn1(float4x4 p) { }
+
+float4 main() : SV_TARGET
+{
+    const float4x4 mat1c = 0.20;
+    const float4x4 mat2c = {2, 2.1, 2.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+    const float4x4 mat3c = (float4x4)float1(0.1);
+
+    float4x4 mat1 = 0.25;
+    float4x4 mat2 = {3, 3.1, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+    float4x4 mat3 = (float4x4)0.375;
+    // float4x4 mat5 = (float4x4)Fn2(); // TODO: enable when compex rvalue handling is in place
+
+    float4x4 mat4;
+    mat4 = 0.75;
+    mat4 = float4x4(4, 4.1, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+    mat4 = (float4x4)0.5;
+
+    mat4 *= 0.75;
+    mat4 += 0.75;
+    mat4 -= 0.5;
+    mat4 /= 2.0;
+
+    Fn1(5.0); // test calling fn accepting matrix with scalar type
+
+    return mat1c[0] + mat3c[0] + mat1[1] + mat4[2];
+}
diff --git a/Test/hlsl.semantic.vert b/Test/hlsl.semantic.vert
index 16bba37..1845dc3 100644
--- a/Test/hlsl.semantic.vert
+++ b/Test/hlsl.semantic.vert
@@ -1,10 +1,8 @@
 struct S {
-    float clip  : SV_ClipDistance;
     float clip0 : SV_ClipDistance0;
-    float clip7 : SV_ClipDistance7;
-    float cull  : SV_CullDistance;
-    float cull2 : SV_CullDistance2;
-    float cull5 : SV_CullDistance5;
+    float clip1 : SV_ClipDistance1;
+    float cull0 : SV_CullDistance0;
+    float cull1 : SV_CullDistance1;
     int ii      : SV_InstanceID;
 };
 
diff --git a/Test/hlsl.struct.split.nested.geom b/Test/hlsl.struct.split.nested.geom
index 03bf38f..8bcc5b9 100644
--- a/Test/hlsl.struct.split.nested.geom
+++ b/Test/hlsl.struct.split.nested.geom
@@ -1,8 +1,8 @@
 
 struct STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO
 {
-    float m0_array[2];
-    int   m1;
+    float m0_array[2] : mysemA;
+    int   m1 : mysemB;
 };
 
 struct PS_IN 
@@ -26,6 +26,9 @@
 
     o.psIn.pos = float4(1,2,3,4);
     o.psIn.tc  = float2(5,6);
+    o.contains_no_builtin_io.m0_array[0] = 2.3;
+    o.contains_no_builtin_io.m0_array[1] = 2.3;
+    o.contains_no_builtin_io.m1 = 2;
 
     ts.Append(o);
 }
diff --git a/Test/hlsl.structin.vert b/Test/hlsl.structin.vert
index 43d0cfd..20a26dd 100644
--- a/Test/hlsl.structin.vert
+++ b/Test/hlsl.structin.vert
@@ -1,14 +1,17 @@
 struct VI {
-    float4 m[2];
-    uint2 coord;
-    linear float4 b;
+    float4 m[2] : mysemA;
+    float4 coord : SV_POSITION;
+    linear float4 b : mysemB;
 };
 
-VI main(float4 d, VI vi, float4 e) : SV_POSITION
+VI main(float4 d : mysem, VI vi, float4 e : mysem)
 {
     VI local;
 
-    local.b = vi.m[1] + vi.m[0] + float4(vi.coord.x) + d + e;
+    local.b = vi.m[1] + vi.m[0] + (float4)vi.coord.x + d + e;
+    local.coord = (float4)1;
+    local.m[0] = (float4)2;
+    local.m[1] = (float4)3;
 
     return local;
 }
diff --git a/Test/hlsl.switch.frag b/Test/hlsl.switch.frag
index 88239c2..78ebfef 100644
--- a/Test/hlsl.switch.frag
+++ b/Test/hlsl.switch.frag
@@ -18,7 +18,7 @@
         break;
     }
 
-    switch (c) {
+    [branch] switch (c) {
     case 1:
         ++input;
         break;
diff --git a/Test/hlsl.synthesizeInput.frag b/Test/hlsl.synthesizeInput.frag
new file mode 100644
index 0000000..c4b2fa4
--- /dev/null
+++ b/Test/hlsl.synthesizeInput.frag
@@ -0,0 +1,9 @@
+struct PSInput {

+  float interp;

+  uint no_interp;

+};

+

+float4 main(PSInput input : INPUT) : SV_TARGET

+{

+  return float4(float(input.no_interp), input.interp, 0, 1);

+}
\ No newline at end of file
diff --git a/Test/hlsl.target.frag b/Test/hlsl.target.frag
new file mode 100644
index 0000000..5317236
--- /dev/null
+++ b/Test/hlsl.target.frag
@@ -0,0 +1,10 @@
+struct PSInput {

+  float interp;

+  uint no_interp;

+};

+

+void main(PSInput input : INPUT, out float4 out1 : SV_TARGET1, out float4 out2 : SV_TARGET3)

+{

+    out1 = 1;

+    out2 = 0;

+}
\ No newline at end of file
diff --git a/Test/hlsl.targetStruct1.frag b/Test/hlsl.targetStruct1.frag
new file mode 100644
index 0000000..7fcc082
--- /dev/null
+++ b/Test/hlsl.targetStruct1.frag
@@ -0,0 +1,19 @@
+struct PSInput {

+  float interp;

+  uint no_interp;

+};

+

+struct PSOutput {

+    float4 o1 : SV_TARGET2;

+    float4 o2 : SV_TARGET1;

+};

+

+PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0)

+{

+    PSOutput pso;

+    pso.o1 = float4(float(input.no_interp), input.interp, 0, 1);

+    pso.o2 = 1;

+    po = 0;

+

+    return pso;

+}
\ No newline at end of file
diff --git a/Test/hlsl.targetStruct2.frag b/Test/hlsl.targetStruct2.frag
new file mode 100644
index 0000000..e62ba0f
--- /dev/null
+++ b/Test/hlsl.targetStruct2.frag
@@ -0,0 +1,19 @@
+struct PSInput {

+  float interp;

+  uint no_interp;

+};

+

+struct PSOutput {

+    float4 o1 : SV_TARGET1;

+    float4 o2 : SV_TARGET0;

+};

+

+PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) : SV_TARGET2

+{

+    PSOutput pso;

+    pso.o1 = float4(float(input.no_interp), input.interp, 0, 1);

+    pso.o2 = 1;

+    po = 0;

+

+    return pso;

+}
\ No newline at end of file
diff --git a/Test/hlsl.type.identifier.frag b/Test/hlsl.type.identifier.frag
index b6e2e89..4e53a82 100644
--- a/Test/hlsl.type.identifier.frag
+++ b/Test/hlsl.type.identifier.frag
@@ -25,6 +25,7 @@
     float = float + int + uint + min16float + min10float + (bool[0] ? int : float) + fn(float);
 
     half2x3 half2x3;
+    half2x3._11 = (float) * float;
 
     return float + half2x3._11;
 }
diff --git a/Test/reflection.vert b/Test/reflection.vert
index be49822..7549f08 100644
--- a/Test/reflection.vert
+++ b/Test/reflection.vert
@@ -133,6 +133,26 @@
     float foo;

 } arrBl2[4];

 

+buffer buf1 {

+    float scalar;

+    float runtimeArray[];

+} buf1i;

+

+buffer buf2 {

+    float scalar;

+    N2 runtimeArray[];

+} buf2i;

+

+buffer buf3 {

+    float scalar;

+    float runtimeArray[];

+} buf3i;

+

+buffer buf4 {

+    float scalar;

+    N2 runtimeArray[];

+} buf4i;

+

 void main()

 {

     liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);

@@ -179,4 +199,8 @@
     f += attributeFloat3.x;

     f += attributeFloat4.x;

     f += attributeMat4[0][1];

+    f += buf1i.runtimeArray[3];

+    f += buf2i.runtimeArray[3].c;

+    f += buf3i.runtimeArray[gl_InstanceID];

+    f += buf4i.runtimeArray[gl_InstanceID].c;

 }

diff --git a/Test/runtests b/Test/runtests
index 945a0f3..c5a9337 100755
--- a/Test/runtests
+++ b/Test/runtests
@@ -45,6 +45,11 @@
 $EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
 $EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
 diff singleThread.out multiThread.out || HASERROR=1
+if [ $HASERROR -eq 0 ]
+then
+    rm singleThread.out
+    rm multiThread.out
+fi
 
 #
 # entry point renaming tests
@@ -92,12 +97,20 @@
 $EXE -V -D -e main -H hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out
 diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1
 
+$EXE -V -D -e main -H hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out
+diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1
+
+$EXE -V -D -e main -H hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out
+diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1
+
 #
 # Testing location error
 #
 echo Testing SPV no location
 $EXE -V -C spv.noLocation.vert > $TARGETDIR/spv.noLocation.vert.out
 diff -b $BASEDIR/spv.noLocation.vert.out $TARGETDIR/spv.noLocation.vert.out || HASERROR=1
+$EXE -H --aml spv.noBuiltInLoc.vert > $TARGETDIR/spv.noBuiltInLoc.vert.out
+diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out || HASERROR=1
 
 #
 # Testing debug information
@@ -120,6 +133,24 @@
 diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1
 
 #
+# Testing -D and -U
+#
+$EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out
+diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1
+$EXE -D -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out
+diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1
+
+#
+# Test --client and --target-env
+#
+$EXE --client vulkan100      spv.targetVulkan.vert || HASERROR=1
+$EXE --client opengl100      spv.targetOpenGL.vert || HASERROR=1
+$EXE --target-env vulkan1.0  spv.targetVulkan.vert || HASERROR=1
+$EXE --target-env opengl     spv.targetOpenGL.vert || HASERROR=1
+$EXE -V100                   spv.targetVulkan.vert || HASERROR=1
+$EXE -G100                   spv.targetOpenGL.vert || HASERROR=1
+
+#
 # Final checking
 #
 if [ $HASERROR -eq 0 ]
@@ -129,4 +160,6 @@
     echo Tests Failed.
 fi
 
+rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
+
 exit $HASERROR
diff --git a/Test/spv.OVR_multiview.vert b/Test/spv.OVR_multiview.vert
new file mode 100644
index 0000000..c81a4d9
--- /dev/null
+++ b/Test/spv.OVR_multiview.vert
@@ -0,0 +1,9 @@
+#version 330
+
+#extension GL_OVR_multiview : enable
+
+layout(num_views = 2) in;
+
+void main() {
+    gl_Position = vec4(gl_ViewID_OVR, 0, 0, 0);
+}
diff --git a/Test/spv.arbPostDepthCoverage.frag b/Test/spv.arbPostDepthCoverage.frag
new file mode 100644
index 0000000..03b61cb
--- /dev/null
+++ b/Test/spv.arbPostDepthCoverage.frag
@@ -0,0 +1,13 @@
+#version 450

+

+#extension GL_ARB_post_depth_coverage : enable

+#extension GL_EXT_post_depth_coverage : enable //according to ARB_post_depth_coverage, 

+                                               //if both enabled, this one should be ignored

+precision highp int;

+layout(post_depth_coverage) in;

+

+layout (location = 0) out int readSampleMaskIn;

+

+void main () {

+    readSampleMaskIn = gl_SampleMaskIn[0];

+}

diff --git a/Test/spv.arbPostDepthCoverage_Error.frag b/Test/spv.arbPostDepthCoverage_Error.frag
new file mode 100644
index 0000000..652933b
--- /dev/null
+++ b/Test/spv.arbPostDepthCoverage_Error.frag
@@ -0,0 +1,12 @@
+#version 310 es

+

+#extension GL_ARB_post_depth_coverage : enable

+

+precision highp float;

+

+layout(post_depth_coverage, location = 0) in float a;  // should fail since post_depth_coverage may only

+                                                       // be declared on in only (not with variable declarations)

+

+void main () {

+

+}

diff --git a/Test/spv.extPostDepthCoverage.frag b/Test/spv.extPostDepthCoverage.frag
new file mode 100644
index 0000000..20aebc3
--- /dev/null
+++ b/Test/spv.extPostDepthCoverage.frag
@@ -0,0 +1,9 @@
+#version 310 es

+

+#extension GL_EXT_post_depth_coverage : enable

+

+layout(post_depth_coverage) in;

+layout(early_fragment_tests) in;

+

+void main () {

+}

diff --git a/Test/spv.extPostDepthCoverage_Error.frag b/Test/spv.extPostDepthCoverage_Error.frag
new file mode 100644
index 0000000..25ce2e2
--- /dev/null
+++ b/Test/spv.extPostDepthCoverage_Error.frag
@@ -0,0 +1,9 @@
+#version 450

+

+#extension GL_EXT_post_depth_coverage : enable

+

+layout(post_depth_coverage) in; // should fail since for GL_EXT_post_depth_coverage

+                                // explicit declaration of early_fragment_tests is required

+

+void main () {

+}

diff --git a/Test/spv.noBuiltInLoc.vert b/Test/spv.noBuiltInLoc.vert
new file mode 100644
index 0000000..e754892
--- /dev/null
+++ b/Test/spv.noBuiltInLoc.vert
@@ -0,0 +1,13 @@
+#version 450 core

+

+layout(location = 0)

+in  vec4 foo;

+

+layout(location = 0)

+out vec4 bar;

+

+void main()

+{

+    bar = foo;

+    gl_Position = foo;

+}
\ No newline at end of file
diff --git a/Test/spv.paramMemory.frag b/Test/spv.paramMemory.frag
new file mode 100644
index 0000000..79d2fe5
--- /dev/null
+++ b/Test/spv.paramMemory.frag
@@ -0,0 +1,30 @@
+#version 310 es
+
+readonly coherent uniform layout(set = 0, binding = 0, rgba32f) highp image2D image1;
+readonly uniform layout(set = 0, binding = 2, rgba16f) highp image2D image2;
+writeonly coherent uniform layout(set = 0, binding = 1, rgba32f) highp image2D image3;
+writeonly uniform layout(set = 0, binding = 3, rgba16f) highp image2D image4;
+
+flat in layout(location = 0) highp ivec2 in_coords;
+out layout(location = 0) highp vec4 out_color;
+
+highp vec4 image_load(readonly coherent highp image2D image, highp ivec2 coords)
+{
+	return imageLoad(image, in_coords);
+}
+
+void image_store(writeonly coherent highp image2D image, highp ivec2 coords, highp vec4 data)
+{
+	imageStore(image, in_coords, data);
+}
+
+void main()
+{
+	highp vec4 read1 = image_load(image1, in_coords);
+	highp vec4 read2 = image_load(image2, in_coords);
+	
+	image_store(image3, in_coords, read1*0.5);
+	image_store(image4, in_coords, read2*2.0);
+
+	out_color = vec4(0.0);
+}
diff --git a/Test/spv.shaderStencilExport.frag b/Test/spv.shaderStencilExport.frag
new file mode 100644
index 0000000..62e0f57
--- /dev/null
+++ b/Test/spv.shaderStencilExport.frag
@@ -0,0 +1,8 @@
+#version 450 core

+

+#extension GL_ARB_shader_stencil_export: enable

+

+void main()

+{

+    gl_FragStencilRefARB = 100;

+}

diff --git a/Test/spv.targetOpenGL.vert b/Test/spv.targetOpenGL.vert
new file mode 100755
index 0000000..6d68a33
--- /dev/null
+++ b/Test/spv.targetOpenGL.vert
@@ -0,0 +1,10 @@
+#version 450

+

+layout(constant_id = 3) const int a = 2;

+layout(location = 2) uniform float f;

+layout(location = 4) uniform sampler2D s1;

+uniform sampler2D s2;

+

+void main()

+{

+}

diff --git a/Test/spv.targetVulkan.vert b/Test/spv.targetVulkan.vert
new file mode 100755
index 0000000..d879122
--- /dev/null
+++ b/Test/spv.targetVulkan.vert
@@ -0,0 +1,9 @@
+#version 450

+

+layout(constant_id = 3) const int a = 2;

+

+layout(push_constant) uniform pc { float f; };

+

+void main()

+{

+}

diff --git a/Test/vulkan.frag b/Test/vulkan.frag
index 2b686eb..1447ec1 100644
--- a/Test/vulkan.frag
+++ b/Test/vulkan.frag
@@ -43,7 +43,7 @@
 layout(push_constant) uniform float pcfloat;  // ERROR 2X: not on a non-block, and non-opaque outside block

 

 layout(push_constant) uniform;                // ERROR, needs an object

-

+layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst;

 layout(push_constant) uniform pcb2 {

     int a;

 };                                            // Okay now to have no instance name

diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
index 7c9476d..ac39733 100644
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
@@ -79,7 +79,8 @@
 # set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp)
 
 add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
-set_property(TARGET glslang PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET glslang PROPERTY FOLDER glslang)
+set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON)
 target_link_libraries(glslang OGLCompiler OSDependent)
 if(ENABLE_HLSL)
     target_link_libraries(glslang HLSL)
@@ -93,10 +94,14 @@
     source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
 endif(WIN32)
 
-install(TARGETS glslang
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS glslang
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif(ENABLE_GLSLANG_INSTALL)
 
-foreach(file ${HEADERS})
-    get_filename_component(dir ${file} DIRECTORY)
-    install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir})
-endforeach()
+if(ENABLE_GLSLANG_INSTALL)
+    foreach(file ${HEADERS})
+        get_filename_component(dir ${file} DIRECTORY)
+        install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir})
+    endforeach()
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h
index 46392d0..08fb623 100644
--- a/glslang/Include/BaseTypes.h
+++ b/glslang/Include/BaseTypes.h
@@ -193,6 +193,7 @@
     EbvFragColor,
     EbvFragData,
     EbvFragDepth,
+    EbvFragStencilRef,
     EbvSampleId,
     EbvSamplePosition,
     EbvSampleMask,
@@ -222,7 +223,6 @@
     // to one of the above.
     EbvFragDepthGreater,
     EbvFragDepthLesser,
-    EbvStencilRef,
     EbvGsOutputStream,
     EbvOutputPatch,
     EbvInputPatch,
@@ -329,6 +329,7 @@
     case EbvFragColor:            return "FragColor";
     case EbvFragData:             return "FragData";
     case EbvFragDepth:            return "FragDepth";
+    case EbvFragStencilRef:       return "FragStencilRef";
     case EbvSampleId:             return "SampleId";
     case EbvSamplePosition:       return "SamplePosition";
     case EbvSampleMask:           return "SampleMaskIn";
diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h
index 16d8932..72c1388 100644
--- a/glslang/Include/Types.h
+++ b/glslang/Include/Types.h
@@ -968,8 +968,10 @@
     int localSize[3];         // compute shader
     int localSizeSpecId[3];   // compute shader specialization id for gl_WorkGroupSize
     bool earlyFragmentTests;  // fragment input
+    bool postDepthCoverage;   // fragment input
     TLayoutDepth layoutDepth;
     bool blendEquation;       // true if any blend equation was specified
+    int numViews;             // multiview extenstions
 
 #ifdef NV_EXTENSIONS
     bool layoutOverrideCoverage;    // true if layout override_coverage set
@@ -992,8 +994,10 @@
         localSizeSpecId[1] = TQualifier::layoutNotSet;
         localSizeSpecId[2] = TQualifier::layoutNotSet;
         earlyFragmentTests = false;
+        postDepthCoverage = false;
         layoutDepth = EldNone;
         blendEquation = false;
+        numViews = TQualifier::layoutNotSet;
 #ifdef NV_EXTENSIONS
         layoutOverrideCoverage = false;
 #endif
@@ -1029,10 +1033,14 @@
         }
         if (src.earlyFragmentTests)
             earlyFragmentTests = true;
+        if (src.postDepthCoverage)
+            postDepthCoverage = true;
         if (src.layoutDepth)
             layoutDepth = src.layoutDepth;
         if (src.blendEquation)
             blendEquation = src.blendEquation;
+        if (src.numViews != TQualifier::layoutNotSet)
+            numViews = src.numViews;
 #ifdef NV_EXTENSIONS
         if (src.layoutOverrideCoverage)
             layoutOverrideCoverage = src.layoutOverrideCoverage;
@@ -1338,7 +1346,24 @@
 #else
     virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble; }
 #endif
-
+    virtual bool isIntegerDomain() const
+    {
+        switch (basicType) {
+        case EbtInt:
+        case EbtUint:
+        case EbtInt64:
+        case EbtUint64:
+#ifdef AMD_EXTENSIONS
+        case EbtInt16:
+        case EbtUint16:
+#endif
+        case EbtAtomicUint:
+            return true;
+        default:
+            break;
+        }
+        return false;
+    }
     virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint; }
 
     // "Image" is a superset of "Subpass"
@@ -1451,9 +1476,9 @@
             case EbtUint16:
 #endif
             case EbtBool:
-            return true;
+                return true;
             default:
-            return false;
+                return false;
             }
         };
 
diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h
index 98cc554..0922d12 100644
--- a/glslang/Include/intermediate.h
+++ b/glslang/Include/intermediate.h
@@ -862,6 +862,15 @@
 };
 
 //
+// Selection control hints
+//
+enum TSelectionControl {
+    ESelectionControlNone,
+    ESelectionControlFlatten,
+    ESelectionControlDontFlatten,
+};
+
+//
 // Loop control hints
 //
 enum TLoopControl {
@@ -945,7 +954,11 @@
     // per process threadPoolAllocator, then it causes increased memory usage per compile
     // it is essential to use "symbol = sym" to assign to symbol
     TIntermSymbol(int i, const TString& n, const TType& t)
-        : TIntermTyped(t), id(i), constSubtree(nullptr)
+        : TIntermTyped(t), id(i),
+#ifdef ENABLE_HLSL
+        flattenSubset(-1),
+#endif
+        constSubtree(nullptr)
           { name = n; }
     virtual int getId() const { return id; }
     virtual const TString& getName() const { return name; }
@@ -956,9 +969,16 @@
     const TConstUnionArray& getConstArray() const { return constArray; }
     void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
     TIntermTyped* getConstSubtree() const { return constSubtree; }
+#ifdef ENABLE_HLSL
+    void setFlattenSubset(int subset) { flattenSubset = subset; }
+    int getFlattenSubset() const { return flattenSubset; } // -1 means full object
+#endif
 
 protected:
     int id;                      // the unique id of the symbol this node represents
+#ifdef ENABLE_HLSL
+    int flattenSubset;           // how deeply the flattened object rooted at id has been dereferenced
+#endif
     TString name;                // the name of the symbol this node represents
     TConstUnionArray constArray; // if the symbol is a front-end compile-time constant, this is its value
     TIntermTyped* constSubtree;
@@ -1274,19 +1294,22 @@
 class TIntermSelection : public TIntermTyped {
 public:
     TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) :
-        TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
+        TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {}
     TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) :
-        TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
+        TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {}
     virtual void traverse(TIntermTraverser*);
     virtual TIntermTyped* getCondition() const { return condition; }
     virtual TIntermNode* getTrueBlock() const { return trueBlock; }
     virtual TIntermNode* getFalseBlock() const { return falseBlock; }
     virtual       TIntermSelection* getAsSelectionNode()       { return this; }
     virtual const TIntermSelection* getAsSelectionNode() const { return this; }
+    void setSelectionControl(TSelectionControl c) { control = c; }
+    TSelectionControl getSelectionControl() const { return control; }
 protected:
     TIntermTyped* condition;
     TIntermNode* trueBlock;
     TIntermNode* falseBlock;
+    TSelectionControl control;    // selection control hint
 };
 
 //
@@ -1297,15 +1320,18 @@
 //
 class TIntermSwitch : public TIntermNode {
 public:
-    TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b) { }
+    TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), control(ESelectionControlNone) { }
     virtual void traverse(TIntermTraverser*);
     virtual TIntermNode* getCondition() const { return condition; }
     virtual TIntermAggregate* getBody() const { return body; }
     virtual       TIntermSwitch* getAsSwitchNode()       { return this; }
     virtual const TIntermSwitch* getAsSwitchNode() const { return this; }
+    void setSelectionControl(TSelectionControl c) { control = c; }
+    TSelectionControl getSelectionControl() const { return control; }
 protected:
     TIntermTyped* condition;
     TIntermAggregate* body;
+    TSelectionControl control;    // selection control hint
 };
 
 enum TVisit
diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp
index b1e510b..5cd167e 100644
--- a/glslang/MachineIndependent/Initialize.cpp
+++ b/glslang/MachineIndependent/Initialize.cpp
@@ -1333,6 +1333,9 @@
                 "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);"  // GL_EXT_shader_texture_lod
                 "vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);"  // GL_EXT_shader_texture_lod
 
+                "float shadow2DEXT(sampler2DShadow, vec3);"     // GL_EXT_shadow_samplers
+                "float shadow2DProjEXT(sampler2DShadow, vec4);" // GL_EXT_shadow_samplers
+
                 "\n");
         }
     }
@@ -3454,6 +3457,12 @@
             "\n");
     }
 
+    if (version >= 300 /* both ES and non-ES */) {
+        stageBuiltins[EShLangVertex].append(
+            "in highp uint gl_ViewID_OVR;"     // GL_OVR_multiview, GL_OVR_multiview2
+            "\n");
+    }
+
 
     //============================================================================
     //
@@ -3750,6 +3759,10 @@
             stageBuiltins[EShLangFragment].append(
                 "vec2 gl_PointCoord;"  // needs qualifier fixed later
                 );
+        if (version >= 140)
+            stageBuiltins[EShLangFragment].append(
+                "out int gl_FragStencilRefARB;"
+                );
         if (IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && version < 420))
             stageBuiltins[EShLangFragment].append(
                 "vec4 gl_FragColor;"   // needs qualifier fixed later
@@ -3898,6 +3911,12 @@
             "\n");
     }
 
+    if (version >= 300 /* both ES and non-ES */) {
+        stageBuiltins[EShLangFragment].append(
+            "flat in highp uint gl_ViewID_OVR;"     // GL_OVR_multiview, GL_OVR_multiview2
+            "\n");
+    }
+
     // printf("%s\n", commonBuiltins.c_str());
     // printf("%s\n", stageBuiltins[EShLangFragment].c_str());
 }
@@ -5297,13 +5316,14 @@
                 symbolTable.setFunctionExtensions("texture2DGradEXT",     1, &E_GL_EXT_shader_texture_lod);
                 symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod);
                 symbolTable.setFunctionExtensions("textureCubeGradEXT",   1, &E_GL_EXT_shader_texture_lod);
-                symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5);
+                if (version == 310)
+                    symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5);
             }
-            if (version >= 310)
+            if (version == 310)
                 symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5);
         }
 
-        if (profile == EEsProfile) {
+        if (profile == EEsProfile && version < 320) {
             symbolTable.setFunctionExtensions("imageAtomicAdd",      1, &E_GL_OES_shader_image_atomic);
             symbolTable.setFunctionExtensions("imageAtomicMin",      1, &E_GL_OES_shader_image_atomic);
             symbolTable.setFunctionExtensions("imageAtomicMax",      1, &E_GL_OES_shader_image_atomic);
@@ -5324,12 +5344,24 @@
             BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable);
         }
 
+        if (version >= 300 /* both ES and non-ES */) {
+            symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs);
+            BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable);
+        }
+
+        if (profile == EEsProfile) {
+            symbolTable.setFunctionExtensions("shadow2DEXT",        1, &E_GL_EXT_shadow_samplers);
+            symbolTable.setFunctionExtensions("shadow2DProjEXT",    1, &E_GL_EXT_shadow_samplers);
+        }
+
         // Fall through
 
     case EShLangTessControl:
         if (profile == EEsProfile && version >= 310) {
-            symbolTable.setVariableExtensions("gl_BoundingBoxOES", Num_AEP_primitive_bounding_box, AEP_primitive_bounding_box);
             BuiltInVariable("gl_BoundingBoxOES", EbvBoundingBox, symbolTable);
+            if (version < 320)
+                symbolTable.setVariableExtensions("gl_BoundingBoxOES", Num_AEP_primitive_bounding_box,
+                                                  AEP_primitive_bounding_box);
         }
 
         // Fall through
@@ -5465,13 +5497,18 @@
         BuiltInVariable("gl_CullDistance",    EbvCullDistance,   symbolTable);
         BuiltInVariable("gl_PrimitiveID",     EbvPrimitiveId,    symbolTable);
 
+        if (profile != EEsProfile && version >= 140) {
+            symbolTable.setVariableExtensions("gl_FragStencilRefARB", 1, &E_GL_ARB_shader_stencil_export);
+            BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable);
+        }
+
         if ((profile != EEsProfile && version >= 400) ||
             (profile == EEsProfile && version >= 310)) {
             BuiltInVariable("gl_SampleID",        EbvSampleId,       symbolTable);
             BuiltInVariable("gl_SamplePosition",  EbvSamplePosition, symbolTable);
             BuiltInVariable("gl_SampleMaskIn",    EbvSampleMask,     symbolTable);
             BuiltInVariable("gl_SampleMask",      EbvSampleMask,     symbolTable);
-            if (profile == EEsProfile) {
+            if (profile == EEsProfile && version < 320) {
                 symbolTable.setVariableExtensions("gl_SampleID",       1, &E_GL_OES_sample_variables);
                 symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_OES_sample_variables);
                 symbolTable.setVariableExtensions("gl_SampleMaskIn",   1, &E_GL_OES_sample_variables);
@@ -5505,14 +5542,15 @@
                 symbolTable.setFunctionExtensions("texture2DGradEXT",     1, &E_GL_EXT_shader_texture_lod);
                 symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod);
                 symbolTable.setFunctionExtensions("textureCubeGradEXT",   1, &E_GL_EXT_shader_texture_lod);
-                symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5);
+                if (version < 320)
+                    symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5);
             }
             if (version == 100) {
                 symbolTable.setFunctionExtensions("dFdx",   1, &E_GL_OES_standard_derivatives);
                 symbolTable.setFunctionExtensions("dFdy",   1, &E_GL_OES_standard_derivatives);
                 symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_OES_standard_derivatives);
             }
-            if (version >= 310) {
+            if (version == 310) {
                 symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5);
                 symbolTable.setFunctionExtensions("interpolateAtCentroid", 1, &E_GL_OES_shader_multisample_interpolation);
                 symbolTable.setFunctionExtensions("interpolateAtSample",   1, &E_GL_OES_shader_multisample_interpolation);
@@ -5641,12 +5679,12 @@
 
         symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth);
 
-        if (profile == EEsProfile) {
+        if (profile == EEsProfile && version < 320) {
             symbolTable.setVariableExtensions("gl_PrimitiveID",  Num_AEP_geometry_shader, AEP_geometry_shader);
             symbolTable.setVariableExtensions("gl_Layer",        Num_AEP_geometry_shader, AEP_geometry_shader);
         }
 
-        if (profile == EEsProfile) {
+        if (profile == EEsProfile && version < 320) {
             symbolTable.setFunctionExtensions("imageAtomicAdd",      1, &E_GL_OES_shader_image_atomic);
             symbolTable.setFunctionExtensions("imageAtomicMin",      1, &E_GL_OES_shader_image_atomic);
             symbolTable.setFunctionExtensions("imageAtomicMax",      1, &E_GL_OES_shader_image_atomic);
@@ -5661,6 +5699,15 @@
         BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
         symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
         BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
+        if (version >= 300 /* both ES and non-ES */) {
+            symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs);
+            BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable);
+        }
+
+        if (profile == EEsProfile) {
+            symbolTable.setFunctionExtensions("shadow2DEXT",        1, &E_GL_EXT_shadow_samplers);
+            symbolTable.setFunctionExtensions("shadow2DProjEXT",    1, &E_GL_EXT_shadow_samplers);
+        }
         break;
 
     case EShLangCompute:
@@ -6048,6 +6095,10 @@
             symbolTable.relateToOperator("sparseTextureGatherLodOffsetsAMD",    EOpSparseTextureGatherLodOffsets);
 #endif
         }
+        if (profile == EEsProfile) {
+            symbolTable.relateToOperator("shadow2DEXT",              EOpTexture);
+            symbolTable.relateToOperator("shadow2DProjEXT",          EOpTextureProj);
+        }
     }
 
     switch(language) {
diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp
index c07dab9..04a45e0 100644
--- a/glslang/MachineIndependent/Intermediate.cpp
+++ b/glslang/MachineIndependent/Intermediate.cpp
@@ -1043,6 +1043,32 @@
     // The new node that handles the conversion
     TOperator constructorOp = mapTypeToConstructorOp(type);
 
+    // HLSL has custom semantics for scalar->mat shape conversions.
+    if (source == EShSourceHlsl) {
+        if (node->getType().isScalarOrVec1() && type.isMatrix()) {
+
+            // HLSL semantics: the scalar (or vec1) is replicated to every component of the matrix.  Left to its
+            // own devices, the constructor from a scalar would populate the diagonal.  This forces replication
+            // to every matrix element.
+
+            // Note that if the node is complex (e.g, a function call), we don't want to duplicate it here
+            // repeatedly, so we copy it to a temp, then use the temp.
+            const int matSize = type.getMatrixRows() * type.getMatrixCols();
+            TIntermAggregate* rhsAggregate = new TIntermAggregate();
+
+            const bool isSimple = (node->getAsSymbolNode() != nullptr) || (node->getAsConstantUnion() != nullptr);
+
+            if (!isSimple) {
+                assert(0); // TODO: use node replicator service when available.
+            }
+            
+            for (int x=0; x<matSize; ++x)
+                rhsAggregate->getSequence().push_back(node);
+
+            return setAggregateOperator(rhsAggregate, constructorOp, type, node->getLoc());
+        }
+    }
+
     // scalar -> vector or vec1 -> vector or
     // vector -> scalar or
     // bigger vector -> smaller vector
@@ -1588,7 +1614,7 @@
 //
 // Returns the selection node created.
 //
-TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc)
+TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc, TSelectionControl control)
 {
     //
     // Don't prune the false path for compile-time constants; it's needed
@@ -1597,6 +1623,7 @@
 
     TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2);
     node->setLoc(loc);
+    node->setSelectionControl(control);
 
     return node;
 }
@@ -1639,12 +1666,12 @@
 //
 // Returns the selection node created, or nullptr if one could not be.
 //
-TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc)
+TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc, TSelectionControl control)
 {
     // If it's void, go to the if-then-else selection()
     if (trueBlock->getBasicType() == EbtVoid && falseBlock->getBasicType() == EbtVoid) {
         TIntermNodePair pair = { trueBlock, falseBlock };
-        return addSelection(cond, pair, loc);
+        return addSelection(cond, pair, loc, control);
     }
 
     //
@@ -3160,6 +3187,11 @@
 }
 
 struct TextureUpgradeAndSamplerRemovalTransform : public TIntermTraverser {
+    void visitSymbol(TIntermSymbol* symbol) override {
+        if (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isTexture()) {
+            symbol->getWritableType().getSampler().combined = true;
+        }
+    }
     bool visitAggregate(TVisit, TIntermAggregate* ag) override {
         using namespace std;
         TIntermSequence& seq = ag->getSequence();
@@ -3173,17 +3205,11 @@
         });
         seq.erase(newEnd, seq.end());
         // replace constructors with sampler/textures
-        // update textures into sampled textures
         for_each(seq.begin(), seq.end(), [](TIntermNode*& node) {
-            TIntermSymbol* symbol = node->getAsSymbolNode();
-            if (!symbol) {
-                TIntermAggregate *constructor = node->getAsAggregate();
-                if (constructor && constructor->getOp() == EOpConstructTextureSampler) {
-                    if (!constructor->getSequence().empty())
-                        node = constructor->getSequence()[0];
-                }
-            } else if (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isTexture()) {
-                symbol->getWritableType().getSampler().combined = true;
+            TIntermAggregate *constructor = node->getAsAggregate();
+            if (constructor && constructor->getOp() == EOpConstructTextureSampler) {
+                if (!constructor->getSequence().empty())
+                    node = constructor->getSequence()[0];
             }
         });
         return true;
diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp
index 12dbd16..687c211 100644
--- a/glslang/MachineIndependent/ParseHelper.cpp
+++ b/glslang/MachineIndependent/ParseHelper.cpp
@@ -50,7 +50,8 @@
 TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins,
                              int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
                              TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) :
-            TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
+            TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language,
+                              infoSink, forwardCompatible, messages),
             inMain(false),
             blockName(nullptr),
             limits(resources.limits),
@@ -382,7 +383,8 @@
                 if (base->getQualifier().storage == EvqBuffer)
                     requireProfile(base->getLoc(), ~EEsProfile, "variable indexing buffer block array");
                 else if (base->getQualifier().storage == EvqUniform)
-                    profileRequires(base->getLoc(), EEsProfile, 0, Num_AEP_gpu_shader5, AEP_gpu_shader5, "variable indexing uniform block array");
+                    profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5,
+                                    "variable indexing uniform block array");
                 else {
                     // input/output blocks either don't exist or can be variable indexed
                 }
@@ -391,7 +393,7 @@
             else if (base->getBasicType() == EbtSampler && version >= 130) {
                 const char* explanation = "variable indexing sampler array";
                 requireProfile(base->getLoc(), EEsProfile | ECoreProfile | ECompatibilityProfile, explanation);
-                profileRequires(base->getLoc(), EEsProfile, 0, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation);
+                profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation);
                 profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, nullptr, explanation);
             }
 
@@ -1385,7 +1387,6 @@
         unaryArg = callNode.getAsUnaryNode()->getOperand();
         arg0 = unaryArg;
     }
-    const TIntermSequence& aggArgs = *argp;  // only valid when unaryArg is nullptr
 
     switch (callNode.getOp()) {
     case EOpTextureGather:
@@ -1416,8 +1417,9 @@
                 profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_texture_gather, feature);
             else
                 profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_gpu_shader5, feature);
-            if (! aggArgs[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion())
-                profileRequires(loc, EEsProfile, 0, Num_AEP_gpu_shader5, AEP_gpu_shader5, "non-constant offset argument");
+            if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion())
+                profileRequires(loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5,
+                                "non-constant offset argument");
             if (! fnCandidate[0].type->getSampler().shadow)
                 compArg = 3;
             break;
@@ -1426,7 +1428,7 @@
             if (! fnCandidate[0].type->getSampler().shadow)
                 compArg = 3;
             // check for constant offsets
-            if (! aggArgs[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion())
+            if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion())
                 error(loc, "must be a compile-time constant:", feature, "offsets argument");
             break;
         default:
@@ -1434,8 +1436,8 @@
         }
 
         if (compArg > 0 && compArg < fnCandidate.getParamCount()) {
-            if (aggArgs[compArg]->getAsConstantUnion()) {
-                int value = aggArgs[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst();
+            if ((*argp)[compArg]->getAsConstantUnion()) {
+                int value = (*argp)[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst();
                 if (value < 0 || value > 3)
                     error(loc, "must be 0, 1, 2, or 3:", feature, "component argument");
             } else
@@ -1517,12 +1519,12 @@
         }
 
         if (arg > 0) {
-            if (! aggArgs[arg]->getAsConstantUnion())
+            if (! (*argp)[arg]->getAsConstantUnion())
                 error(loc, "argument must be compile-time constant", "texel offset", "");
             else {
-                const TType& type = aggArgs[arg]->getAsTyped()->getType();
+                const TType& type = (*argp)[arg]->getAsTyped()->getType();
                 for (int c = 0; c < type.getVectorSize(); ++c) {
-                    int offset = aggArgs[arg]->getAsConstantUnion()->getConstArray()[c].getIConst();
+                    int offset = (*argp)[arg]->getAsConstantUnion()->getConstArray()[c].getIConst();
                     if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset)
                         error(loc, "value is out of range:", "texel offset", "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]");
                 }
@@ -1631,7 +1633,8 @@
                     profileRequires(loc, ~EEsProfile, 400, E_GL_ARB_gpu_shader5, feature);
                 int offsetArg = fnCandidate[0].type->getSampler().shadow ? 3 : 2;
                 if (! callNode.getSequence()[offsetArg]->getAsConstantUnion())
-                    profileRequires(loc, EEsProfile, 0, Num_AEP_gpu_shader5, AEP_gpu_shader5, "non-constant offset argument");
+                    profileRequires(loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5,
+                                    "non-constant offset argument");
                 if (! fnCandidate[0].type->getSampler().shadow)
                     compArg = 3;
             } else if (fnCandidate.getName().compare("textureGatherOffsets") == 0) {
@@ -2472,16 +2475,22 @@
         error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
 }
 
-void TParseContext::transparentCheck(const TSourceLoc& loc, const TType& type, const TString& /*identifier*/)
+void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& type, const TString& identifier)
 {
     if (parsingBuiltins)
         return;
 
-    // Vulkan doesn't allow transparent uniforms outside of blocks
-    if (spvVersion.vulkan == 0 || type.getQualifier().storage != EvqUniform)
+    if (type.getQualifier().storage != EvqUniform)
         return;
-    if (type.containsNonOpaque())
-        vulkanRemoved(loc, "non-opaque uniforms outside a block");
+
+    if (type.containsNonOpaque()) {
+        // Vulkan doesn't allow transparent uniforms outside of blocks
+        if (spvVersion.vulkan > 0)
+            vulkanRemoved(loc, "non-opaque uniforms outside a block");
+        // OpenGL wants locations on these
+        if (spvVersion.openGl > 0 && !type.getQualifier().hasLocation())
+            error(loc, "non-opaque uniform variables need a layout(location=L)", identifier.c_str(), "");
+    }
 }
 
 //
@@ -3010,19 +3019,22 @@
     switch (language) {
     case EShLangGeometry:
         if (qualifier.storage == EvqVaryingIn)
-            if (extensionsTurnedOn(Num_AEP_geometry_shader, AEP_geometry_shader))
+            if ((profile == EEsProfile && version >= 320) ||
+                extensionsTurnedOn(Num_AEP_geometry_shader, AEP_geometry_shader))
                 return;
         break;
     case EShLangTessControl:
         if ( qualifier.storage == EvqVaryingIn ||
             (qualifier.storage == EvqVaryingOut && ! qualifier.patch))
-            if (extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
+            if ((profile == EEsProfile && version >= 320) ||
+                extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
                 return;
         break;
     case EShLangTessEvaluation:
         if ((qualifier.storage == EvqVaryingIn && ! qualifier.patch) ||
              qualifier.storage == EvqVaryingOut)
-            if (extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
+            if ((profile == EEsProfile && version >= 320) ||
+                extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
                 return;
         break;
     default:
@@ -3261,7 +3273,8 @@
         return nullptr;
 
     bool nonEsRedecls = (profile != EEsProfile && (version >= 130 || identifier == "gl_TexCoord"));
-    bool    esRedecls = (profile == EEsProfile && extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks));
+    bool    esRedecls = (profile == EEsProfile &&
+                         (version >= 320 || extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks)));
     if (! esRedecls && ! nonEsRedecls)
         return nullptr;
 
@@ -3400,7 +3413,7 @@
 void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes)
 {
     const char* feature = "built-in block redeclaration";
-    profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature);
+    profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature);
     profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature);
 
     if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment") {
@@ -4014,6 +4027,14 @@
             publicType.shaderQualifiers.earlyFragmentTests = true;
             return;
         }
+        if (id == "post_depth_coverage") {
+            requireExtensions(loc, Num_post_depth_coverageEXTs, post_depth_coverageEXTs, "post depth coverage");
+            if (extensionTurnedOn(E_GL_ARB_post_depth_coverage)) {
+                publicType.shaderQualifiers.earlyFragmentTests = true;
+            }
+            publicType.shaderQualifiers.postDepthCoverage = true;
+            return;
+        }
         for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) {
             if (id == TQualifier::getLayoutDepthString(depth)) {
                 requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier");
@@ -4026,7 +4047,8 @@
             bool found = false;
             for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) {
                 if (id == TQualifier::getBlendEquationString(be)) {
-                    requireExtensions(loc, 1, &E_GL_KHR_blend_equation_advanced, "blend equation");
+                    profileRequires(loc, EEsProfile, 320, E_GL_KHR_blend_equation_advanced, "blend equation");
+                    profileRequires(loc, ~EEsProfile, 0, E_GL_KHR_blend_equation_advanced, "blend equation");
                     intermediate.addBlendEquation(be);
                     publicType.shaderQualifiers.blendEquation = true;
                     found = true;
@@ -4205,6 +4227,11 @@
         }
         return;
     }
+    if (id == "num_views") {
+        requireExtensions(loc, Num_OVR_multiview_EXTs, OVR_multiview_EXTs, "num_views");
+        publicType.shaderQualifiers.numViews = value;
+        return;
+    }
 
 #if NV_EXTENSIONS
     if (language == EShLangVertex ||
@@ -4777,8 +4804,24 @@
 
     if (shaderQualifiers.geometry != ElgNone)
         error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), "");
+    if (shaderQualifiers.spacing != EvsNone)
+        error(loc, message, TQualifier::getVertexSpacingString(shaderQualifiers.spacing), "");
+    if (shaderQualifiers.order != EvoNone)
+        error(loc, message, TQualifier::getVertexOrderString(shaderQualifiers.order), "");
+    if (shaderQualifiers.pointMode)
+        error(loc, message, "point_mode", "");
     if (shaderQualifiers.invocations != TQualifier::layoutNotSet)
         error(loc, message, "invocations", "");
+    if (shaderQualifiers.earlyFragmentTests)
+        error(loc, message, "early_fragment_tests", "");
+    if (shaderQualifiers.postDepthCoverage)
+        error(loc, message, "post_depth_coverage", "");
+    for (int i = 0; i < 3; ++i) {
+        if (shaderQualifiers.localSize[i] > 1)
+            error(loc, message, "local_size", "");
+        if (shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet)
+            error(loc, message, "local_size id", "");
+    }
     if (shaderQualifiers.vertices != TQualifier::layoutNotSet) {
         if (language == EShLangGeometry)
             error(loc, message, "max_vertices", "");
@@ -4787,15 +4830,10 @@
         else
             assert(0);
     }
-    for (int i = 0; i < 3; ++i) {
-        if (shaderQualifiers.localSize[i] > 1)
-            error(loc, message, "local_size", "");
-        if (shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet)
-            error(loc, message, "local_size id", "");
-    }
     if (shaderQualifiers.blendEquation)
         error(loc, message, "blend equation", "");
-    // TBD: correctness: are any of these missing?  pixelCenterInteger, originUpperLeft, spacing, order, pointmode, earlyfragment, depth
+    if (shaderQualifiers.numViews != TQualifier::layoutNotSet)
+        error(loc, message, "num_views", "");
 }
 
 // Correct and/or advance an object's offset layout qualifier.
@@ -5083,7 +5121,7 @@
 
     samplerCheck(loc, type, identifier, initializer);
     atomicUintCheck(loc, type, identifier);
-    transparentCheck(loc, type, identifier);
+    transparentOpaqueCheck(loc, type, identifier);
 
     if (identifier != "gl_FragCoord" && (publicType.shaderQualifiers.originUpperLeft || publicType.shaderQualifiers.pixelCenterInteger))
         error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", "");
@@ -5425,6 +5463,9 @@
 // Test for the correctness of the parameters passed to various constructor functions
 // and also convert them to the right data type, if allowed and required.
 //
+// 'node' is what to construct from.
+// 'type' is what type to construct.
+//
 // Returns nullptr for an error or the constructed node (aggregate or typed) for no error.
 //
 TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* node, const TType& type)
@@ -5774,7 +5815,7 @@
             case EvqVaryingOut:
                 requireProfile(memberLoc, ECoreProfile | ECompatibilityProfile | EEsProfile, feature);
                 profileRequires(memberLoc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, feature);
-                profileRequires(memberLoc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature);
+                profileRequires(memberLoc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature);
                 memberWithLocation = true;
                 break;
             default:
@@ -5898,14 +5939,14 @@
         // "Compute shaders do not permit user-defined input variables..."
         requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask|EShLangFragmentMask), "input block");
         if (language == EShLangFragment)
-            profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block");
+            profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block");
         break;
     case EvqVaryingOut:
         profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "output block");
         requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask), "output block");
         // ES 310 can have a block before shader_io is turned on, so skip this test for built-ins
         if (language == EShLangVertex && ! parsingBuiltins)
-            profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block");
+            profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block");
         break;
     default:
         error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
@@ -6271,6 +6312,12 @@
         else
             error(loc, "can only apply to 'in'", "early_fragment_tests", "");
     }
+    if (publicType.shaderQualifiers.postDepthCoverage) {
+        if (publicType.qualifier.storage == EvqVaryingIn)
+            intermediate.setPostDepthCoverage();
+        else
+            error(loc, "can only apply to 'in'", "post_coverage_coverage", "");
+    }
     if (publicType.shaderQualifiers.blendEquation) {
         if (publicType.qualifier.storage != EvqVaryingOut)
             error(loc, "can only apply to 'out'", "blend equation", "");
diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h
index 4c5045c..73f2470 100644
--- a/glslang/MachineIndependent/ParseHelper.h
+++ b/glslang/MachineIndependent/ParseHelper.h
@@ -80,8 +80,8 @@
             statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
             postEntryPointReturn(false),
             contextPragma(true, false),
-            limits(resources.limits),
             parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
+            limits(resources.limits),
             globalUniformBlock(nullptr)
     { }
     virtual ~TParseContextBase() { }
@@ -327,7 +327,7 @@
     void boolCheck(const TSourceLoc&, const TPublicType&);
     void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer);
     void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier);
-    void transparentCheck(const TSourceLoc&, const TType&, const TString& identifier);
+    void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier);
     void globalQualifierFixCheck(const TSourceLoc&, TQualifier&);
     void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&);
     bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType);
diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp
index 3f2f40a..25122ee 100644
--- a/glslang/MachineIndependent/Scan.cpp
+++ b/glslang/MachineIndependent/Scan.cpp
@@ -864,14 +864,17 @@
 
     case PATCH:
         if (parseContext.symbolTable.atBuiltInLevel() ||
-            (parseContext.profile == EEsProfile && parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) ||
+            (parseContext.profile == EEsProfile &&
+             (parseContext.version >= 320 || 
+              parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) ||
             (parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader)))
             return keyword;
 
         return es30ReservedFromGLSL(400);
 
     case SAMPLE:
-        if (parseContext.extensionsTurnedOn(1, &E_GL_OES_shader_multisample_interpolation))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(1, &E_GL_OES_shader_multisample_interpolation))
             return keyword;
         return es30ReservedFromGLSL(400);
 
@@ -925,7 +928,8 @@
     case IIMAGEBUFFER:
     case UIMAGEBUFFER:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
             return keyword;
         return firstGenerationImage(false);
 
@@ -948,7 +952,8 @@
     case IIMAGECUBEARRAY:
     case UIMAGECUBEARRAY:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
             return keyword;
         return secondGenerationImage();
 
@@ -1030,7 +1035,8 @@
     case ISAMPLERCUBEARRAY:
     case USAMPLERCUBEARRAY:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
             return keyword;
         if (parseContext.profile == EEsProfile || (parseContext.version < 400 && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array)))
             reservedWord();
@@ -1069,14 +1075,16 @@
 
     case SAMPLERBUFFER:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
             return keyword;
         return es30ReservedFromGLSL(130);
 
     case ISAMPLERBUFFER:
     case USAMPLERBUFFER:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
             return keyword;
         return es30ReservedFromGLSL(140);
 
@@ -1092,7 +1100,8 @@
     case ISAMPLER2DMSARRAY:
     case USAMPLER2DMSARRAY:
         afterType = true;
-        if (parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array))
+        if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
+            parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array))
             return keyword;
         return es30ReservedFromGLSL(150);
 
@@ -1113,8 +1122,10 @@
 
     case SAMPLER2DSHADOW:
         afterType = true;
-        if (parseContext.profile == EEsProfile && parseContext.version < 300)
-            reservedWord();
+        if (parseContext.profile == EEsProfile && parseContext.version < 300) {
+            if (!parseContext.extensionTurnedOn(E_GL_EXT_shadow_samplers))
+                reservedWord();
+        }
         return keyword;
 
     case SAMPLER2DRECT:
@@ -1226,7 +1237,8 @@
         return keyword;
 
     case PRECISE:
-        if ((parseContext.profile == EEsProfile && parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5)) ||
+        if ((parseContext.profile == EEsProfile &&
+             (parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5))) ||
             (parseContext.profile != EEsProfile && parseContext.version >= 400))
             return keyword;
         if (parseContext.profile == EEsProfile && parseContext.version == 310) {
diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp
index bb3f4f7..2d8ac48 100644
--- a/glslang/MachineIndependent/ShaderLang.cpp
+++ b/glslang/MachineIndependent/ShaderLang.cpp
@@ -1,7 +1,7 @@
 //
 // Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
 // Copyright (C) 2013-2016 LunarG, Inc.
-// Copyright (C) 2015-2016 Google, Inc.
+// Copyright (C) 2015-2017 Google, Inc.
 //
 // All rights reserved.
 //
@@ -116,7 +116,7 @@
 
 // Local mapping functions for making arrays of symbol tables....
 
-const int VersionCount = 15;  // index range in MapVersionToIndex
+const int VersionCount = 16;  // index range in MapVersionToIndex
 
 int MapVersionToIndex(int version)
 {
@@ -138,7 +138,9 @@
     case 440: index = 12; break;
     case 310: index = 13; break;
     case 450: index = 14; break;
-    default:              break;
+    case 500: index =  0; break; // HLSL
+    case 320: index = 15; break;
+    default:  assert(0);  break;
     }
 
     assert(index < VersionCount);
@@ -447,7 +449,7 @@
         return correct;
     }
 
-    // Get a good version...
+    // Get a version...
     if (version == 0) {
         version = defaultVersion;
         // infoSink.info.message(EPrefixWarning, "#version: statement missing; use #version on first line of shader");
@@ -455,9 +457,9 @@
 
     // Get a good profile...
     if (profile == ENoProfile) {
-        if (version == 300 || version == 310) {
+        if (version == 300 || version == 310 || version == 320) {
             correct = false;
-            infoSink.info.message(EPrefixError, "#version: versions 300 and 310 require specifying the 'es' profile");
+            infoSink.info.message(EPrefixError, "#version: versions 300, 310, and 320 require specifying the 'es' profile");
             profile = EEsProfile;
         } else if (version == 100)
             profile = EEsProfile;
@@ -474,16 +476,16 @@
                 profile = EEsProfile;
             else
                 profile = ENoProfile;
-        } else if (version == 300 || version == 310) {
+        } else if (version == 300 || version == 310 || version == 320) {
             if (profile != EEsProfile) {
                 correct = false;
-                infoSink.info.message(EPrefixError, "#version: versions 300 and 310 support only the es profile");
+                infoSink.info.message(EPrefixError, "#version: versions 300, 310, and 320 support only the es profile");
             }
             profile = EEsProfile;
         } else {
             if (profile == EEsProfile) {
                 correct = false;
-                infoSink.info.message(EPrefixError, "#version: only version 300 and 310 support the es profile");
+                infoSink.info.message(EPrefixError, "#version: only version 300, 310, and 320 support the es profile");
                 if (version >= FirstProfileVersion)
                     profile = ECoreProfile;
                 else
@@ -493,6 +495,41 @@
         }
     }
 
+    // Fix version...
+    switch (version) {
+    // ES versions
+    case 100: break;
+    case 300: break;
+    case 310: break;
+    case 320: break;
+
+    // desktop versions
+    case 110: break;
+    case 120: break;
+    case 130: break;
+    case 140: break;
+    case 150: break;
+    case 330: break;
+    case 400: break;
+    case 410: break;
+    case 420: break;
+    case 430: break;
+    case 440: break;
+    case 450: break;
+
+    // unknown version
+    default:
+        correct = false;
+        infoSink.info.message(EPrefixError, "version not supported");
+        if (profile == EEsProfile)
+            version = 310;
+        else {
+            version = 450;
+            profile = ECoreProfile;
+        }
+        break;
+    }
+
     // Correct for stage type...
     switch (stage) {
     case EShLangGeometry:
@@ -569,6 +606,73 @@
     return correct;
 }
 
+// There are multiple paths in for setting environment stuff.
+// TEnvironment takes precedence, for what it sets, so sort all this out.
+// Ideally, the internal code could be made to use TEnvironment, but for
+// now, translate it to the historically used parameters.
+void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source,
+                          EShLanguage& stage, SpvVersion& spvVersion)
+{
+    // Set up environmental defaults, first ignoring 'environment'.
+    if (messages & EShMsgSpvRules)
+        spvVersion.spv = 0x00010000;
+    if (messages & EShMsgVulkanRules) {
+        spvVersion.vulkan = 100;
+        spvVersion.vulkanGlsl = 100;
+    } else if (spvVersion.spv != 0)
+        spvVersion.openGl = 100;
+
+    // Now, override, based on any content set in 'environment'.
+    // 'environment' must be cleared to ESh*None settings when items
+    // are not being set.
+    if (environment != nullptr) {
+        // input language
+        if (environment->input.languageFamily != EShSourceNone) {
+            stage = environment->input.stage;
+            switch (environment->input.dialect) {
+            case EShClientNone:
+                break;
+            case EShClientVulkan:
+                spvVersion.vulkanGlsl = environment->input.dialectVersion;
+                break;
+            case EShClientOpenGL:
+                spvVersion.openGl = environment->input.dialectVersion;
+                break;
+            }
+            switch (environment->input.languageFamily) {
+            case EShSourceNone:
+                break;
+            case EShSourceGlsl:
+                source = EShSourceGlsl;
+                messages = static_cast<EShMessages>(messages & ~EShMsgReadHlsl);
+                break;
+            case EShSourceHlsl:
+                source = EShSourceHlsl;
+                messages = static_cast<EShMessages>(messages | EShMsgReadHlsl);
+                break;
+            }
+        }
+
+        // client
+        switch (environment->client.client) {
+        case EShClientVulkan:
+            spvVersion.vulkan = environment->client.version;
+            break;
+        default:
+            break;
+        }
+
+        // generated code
+        switch (environment->target.language) {
+        case EshTargetSpv:
+            spvVersion.spv = environment->target.version;
+            break;
+        default:
+            break;
+        }
+    }
+}
+
 // This is the common setup and cleanup code for PreprocessDeferred and
 // CompileDeferred.
 // It takes any callable with a signature of
@@ -588,7 +692,7 @@
     const char* customPreamble,
     const EShOptimizationLevel optLevel,
     const TBuiltInResource* resources,
-    int defaultVersion,         // use 100 for ES environment, 110 for desktop; this is the GLSL version, not SPIR-V or Vulkan
+    int defaultVersion,  // use 100 for ES environment, 110 for desktop; this is the GLSL version, not SPIR-V or Vulkan
     EProfile defaultProfile,
     // set version/profile to defaultVersion/defaultProfile regardless of the #version
     // directive in the source code
@@ -599,8 +703,8 @@
     ProcessingContext& processingContext,
     bool requireNonempty,
     TShader::Includer& includer,
-    const std::string sourceEntryPointName = ""
-    )
+    const std::string sourceEntryPointName = "",
+    const TEnvironment* environment = nullptr)  // optional way of fully setting all versions, overriding the above
 {
     if (! InitThread())
         return false;
@@ -628,7 +732,7 @@
     const char** names = new const char*[numTotal];
     for (int s = 0; s < numStrings; ++s) {
         strings[s + numPre] = shaderStrings[s];
-        if (inputLengths == 0 || inputLengths[s] < 0)
+        if (inputLengths == nullptr || inputLengths[s] < 0)
             lengths[s + numPre] = strlen(shaderStrings[s]);
         else
             lengths[s + numPre] = inputLengths[s];
@@ -641,16 +745,25 @@
             names[s + numPre] = nullptr;
     }
 
+    // Get all the stages, languages, clients, and other environment
+    // stuff sorted out.
+    EShSource source = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl;
+    SpvVersion spvVersion;
+    EShLanguage stage = compiler->getLanguage();
+    TranslateEnvironment(environment, messages, source, stage, spvVersion);
+
     // First, without using the preprocessor or parser, find the #version, so we know what
     // symbol tables, processing rules, etc. to set up.  This does not need the extra strings
-    // outlined above, just the user shader.
-    glslang::TInputScanner userInput(numStrings, &strings[numPre], &lengths[numPre]);  // no preamble
+    // outlined above, just the user shader, after the system and user preambles.
+    glslang::TInputScanner userInput(numStrings, &strings[numPre], &lengths[numPre]);
     int version = 0;
     EProfile profile = ENoProfile;
     bool versionNotFirstToken = false;
-    bool versionNotFirst = (messages & EShMsgReadHlsl) ? true : userInput.scanVersion(version, profile, versionNotFirstToken);
+    bool versionNotFirst = (source == EShSourceHlsl)
+                                ? true
+                                : userInput.scanVersion(version, profile, versionNotFirstToken);
     bool versionNotFound = version == 0;
-    if (forceDefaultVersionAndProfile && (messages & EShMsgReadHlsl) == 0) {
+    if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
         if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
             (version != defaultVersion || profile != defaultProfile)) {
             compiler->infoSink.info << "Warning, (version, profile) forced to be ("
@@ -667,15 +780,9 @@
         version = defaultVersion;
         profile = defaultProfile;
     }
-    SpvVersion spvVersion;
-    if (messages & EShMsgSpvRules)
-        spvVersion.spv = 0x00010000;    // TODO: eventually have this come from the outside
-    EShSource source = (messages & EShMsgReadHlsl) ? EShSourceHlsl : EShSourceGlsl;
-    if (messages & EShMsgVulkanRules)
-        spvVersion.vulkan = 100;     // TODO: eventually have this come from the outside
-    else if (spvVersion.spv != 0)
-        spvVersion.openGl = 100;     // TODO: eventually have this come from the outside
-    bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, source, version, profile, spvVersion);
+
+    bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
+                                            versionNotFirst, defaultVersion, source, version, profile, spvVersion);
     bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
     bool warnVersionNotFirst = false;
     if (! versionWillBeError && versionNotFirstToken) {
@@ -691,12 +798,12 @@
     intermediate.setSpv(spvVersion);
     if (spvVersion.vulkan >= 100)
         intermediate.setOriginUpperLeft();
-    if ((messages & EShMsgHlslOffsets) || (messages & EShMsgReadHlsl))
+    if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl)
         intermediate.setHlslOffsets();
     if (messages & EShMsgDebugInfo) {
         intermediate.setSourceFile(names[numPre]);
         for (int s = 0; s < numStrings; ++s)
-            intermediate.addSourceText(strings[numPre]);
+            intermediate.addSourceText(strings[numPre + s]);
     }
     SetupBuiltinSymbolTable(version, profile, spvVersion, source);
 
@@ -704,7 +811,7 @@
                                                   [MapSpvVersionToIndex(spvVersion)]
                                                   [MapProfileToIndex(profile)]
                                                   [MapSourceToIndex(source)]
-                                                  [compiler->getLanguage()];
+                                                  [stage];
 
     // Dynamically allocate the symbol table so we can control when it is deallocated WRT the pool.
     TSymbolTable* symbolTableMemory = new TSymbolTable;
@@ -715,7 +822,7 @@
     // Add built-in symbols that are potentially context dependent;
     // they get popped again further down.
     if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion,
-                                    compiler->getLanguage(), source))
+                                    stage, source))
         return false;
 
     //
@@ -723,14 +830,14 @@
     //
 
     TParseContextBase* parseContext = CreateParseContext(symbolTable, intermediate, version, profile, source,
-                                                         compiler->getLanguage(), compiler->infoSink,
+                                                         stage, compiler->infoSink,
                                                          spvVersion, forwardCompatible, messages, false, sourceEntryPointName);
 
-    TPpContext ppContext(*parseContext, names[numPre]? names[numPre]: "", includer);
+    TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer);
 
     // only GLSL (bison triggered, really) needs an externally set scan context
     glslang::TScanContext scanContext(*parseContext);
-    if ((messages & EShMsgReadHlsl) == 0)
+    if (source == EShSourceGlsl)
         parseContext->setScanContext(&scanContext);
 
     parseContext->setPpContext(&ppContext);
@@ -1049,14 +1156,15 @@
     EShMessages messages,       // warnings/errors/AST; things to print out
     TIntermediate& intermediate,// returned tree, etc.
     TShader::Includer& includer,
-    const std::string sourceEntryPointName = "")
+    const std::string sourceEntryPointName = "",
+    TEnvironment* environment = nullptr)
 {
     DoFullParse parser;
     return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames,
                            preamble, optLevel, resources, defaultVersion,
                            defaultProfile, forceDefaultVersionAndProfile,
                            forwardCompatible, messages, intermediate, parser,
-                           true, includer, sourceEntryPointName);
+                           true, includer, sourceEntryPointName, environment);
 }
 
 } // end anonymous namespace for local functions
@@ -1482,6 +1590,12 @@
     infoSink = new TInfoSink;
     compiler = new TDeferredCompiler(stage, *infoSink);
     intermediate = new TIntermediate(s);
+
+    // clear environment (avoid constructors in them for use in a C interface)
+    environment.input.languageFamily = EShSourceNone;
+    environment.input.dialect = EShClientNone;
+    environment.client.client = EShClientNone;
+    environment.target.language = EShTargetNone;
 }
 
 TShader::~TShader()
@@ -1569,7 +1683,8 @@
     return CompileDeferred(compiler, strings, numStrings, lengths, stringNames,
                            preamble, EShOptNone, builtInResources, defaultVersion,
                            defaultProfile, forceDefaultVersionAndProfile,
-                           forwardCompatible, messages, *intermediate, includer, sourceEntryPointName);
+                           forwardCompatible, messages, *intermediate, includer, sourceEntryPointName,
+                           &environment);
 }
 
 // Fill in a string with the result of preprocessing ShaderStrings
@@ -1758,6 +1873,7 @@
 const char* TProgram::getUniformBlockName(int index) const   { return reflection->getUniformBlock(index).name.c_str(); }
 int TProgram::getUniformBlockSize(int index) const           { return reflection->getUniformBlock(index).size; }
 int TProgram::getUniformIndex(const char* name) const        { return reflection->getIndex(name); }
+int TProgram::getUniformBinding(int index) const             { return reflection->getUniform(index).getBinding(); }
 int TProgram::getUniformBlockIndex(int index) const          { return reflection->getUniform(index).index; }
 int TProgram::getUniformBlockCounterIndex(int index) const   { return reflection->getUniformBlock(index).counterIndex; }
 int TProgram::getUniformType(int index) const                { return reflection->getUniform(index).glDefineType; }
diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp
index 800956c..413a1b9 100644
--- a/glslang/MachineIndependent/Versions.cpp
+++ b/glslang/MachineIndependent/Versions.cpp
@@ -155,7 +155,7 @@
     extensionBehavior[E_GL_EXT_frag_depth]                   = EBhDisable;
     extensionBehavior[E_GL_OES_EGL_image_external]           = EBhDisable;
     extensionBehavior[E_GL_EXT_shader_texture_lod]           = EBhDisable;
-
+    extensionBehavior[E_GL_EXT_shadow_samplers]              = EBhDisable;
     extensionBehavior[E_GL_ARB_texture_rectangle]            = EBhDisable;
     extensionBehavior[E_GL_3DL_array_objects]                = EBhDisable;
     extensionBehavior[E_GL_ARB_shading_language_420pack]     = EBhDisable;
@@ -179,10 +179,13 @@
     extensionBehavior[E_GL_ARB_shader_ballot]                = EBhDisable;
     extensionBehavior[E_GL_ARB_sparse_texture2]              = EBhDisable;
     extensionBehavior[E_GL_ARB_sparse_texture_clamp]         = EBhDisable;
+    extensionBehavior[E_GL_ARB_shader_stencil_export]        = EBhDisable;
 //    extensionBehavior[E_GL_ARB_cull_distance]                = EBhDisable;    // present for 4.5, but need extension control over block members
+    extensionBehavior[E_GL_ARB_post_depth_coverage]          = EBhDisable;
 
     extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable;
-    extensionBehavior[E_GL_EXT_shader_image_load_formatted]  = EBhDisable;
+    extensionBehavior[E_GL_EXT_shader_image_load_formatted]             = EBhDisable;
+    extensionBehavior[E_GL_EXT_post_depth_coverage]                     = EBhDisable;
 
     // #line and #include
     extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive]          = EBhDisable;
@@ -238,6 +241,10 @@
     // EXT extensions
     extensionBehavior[E_GL_EXT_device_group]             = EBhDisable;
     extensionBehavior[E_GL_EXT_multiview]                = EBhDisable;
+
+    // OVR extensions
+    extensionBehavior[E_GL_OVR_multiview]                = EBhDisable;
+    extensionBehavior[E_GL_OVR_multiview2]               = EBhDisable;
 }
 
 // Get code that is not part of a shared symbol table, is specific to this shader,
@@ -253,6 +260,7 @@
             "#define GL_EXT_frag_depth 1\n"
             "#define GL_OES_EGL_image_external 1\n"
             "#define GL_EXT_shader_texture_lod 1\n"
+            "#define GL_EXT_shadow_samplers 1\n"
 
             // AEP
             "#define GL_ANDROID_extension_pack_es31a 1\n"
@@ -308,9 +316,12 @@
             "#define GL_ARB_shader_ballot 1\n"
             "#define GL_ARB_sparse_texture2 1\n"
             "#define GL_ARB_sparse_texture_clamp 1\n"
+            "#define GL_ARB_shader_stencil_export 1\n"
 //            "#define GL_ARB_cull_distance 1\n"    // present for 4.5, but need extension control over block members
+            "#define GL_ARB_post_depth_coverage 1\n"
             "#define GL_EXT_shader_non_constant_global_initializers 1\n"
             "#define GL_EXT_shader_image_load_formatted 1\n"
+            "#define GL_EXT_post_depth_coverage 1\n"
 
 #ifdef AMD_EXTENSIONS
             "#define GL_AMD_shader_ballot 1\n"
@@ -340,12 +351,19 @@
 
     if ((profile != EEsProfile && version >= 140) ||
         (profile == EEsProfile && version >= 310)) {
-        preamble += 
+        preamble +=
             "#define GL_EXT_device_group 1\n"
             "#define GL_EXT_multiview 1\n"
             ;
     }
 
+    if (version >= 300 /* both ES and non-ES */) {
+        preamble +=
+            "#define GL_OVR_multiview 1\n"
+            "#define GL_OVR_multiview2 1\n"
+            ;
+    }
+
     // #line and #include
     preamble +=
             "#define GL_GOOGLE_cpp_style_line_directive 1\n"
@@ -355,9 +373,9 @@
     // #define VULKAN XXXX
     const int numberBufSize = 12;
     char numberBuf[numberBufSize];
-    if (spvVersion.vulkan > 0) {
+    if (spvVersion.vulkanGlsl > 0) {
         preamble += "#define VULKAN ";
-        snprintf(numberBuf, numberBufSize, "%d", spvVersion.vulkan);
+        snprintf(numberBuf, numberBufSize, "%d", spvVersion.vulkanGlsl);
         preamble += numberBuf;
         preamble += "\n";
     }
diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h
index 702a5ae..a7c6009 100644
--- a/glslang/MachineIndependent/Versions.h
+++ b/glslang/MachineIndependent/Versions.h
@@ -72,14 +72,19 @@
 }
 
 //
-// SPIR-V has versions for multiple things; tie them together.
-// 0 means a target or rule set is not enabled.
+// What source rules, validation rules, target language, etc. are needed
+// desired for SPIR-V?
+//
+// 0 means a target or rule set is not enabled (ignore rules from that entity).
+// Non-0 means to apply semantic rules arising from that version of its rule set.
+// The union of all requested rule sets will be applied.
 //
 struct SpvVersion {
-    SpvVersion() : spv(0), vulkan(0), openGl(0) {}
-    unsigned int spv; // the version of the targeted SPIR-V, as defined by SPIR-V in word 1 of the SPIR-V binary header
-    int vulkan;       // the version of semantics for Vulkan; e.g., for GLSL from KHR_vulkan_glsl "#define VULKAN"
-    int openGl;       // the version of semantics for OpenGL; e.g., for GLSL from KHR_vulkan_glsl "#define GL_SPIRV"
+    SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0) {}
+    unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header
+    int vulkanGlsl;   // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX"
+    int vulkan;       // the version of Vulkan, for which SPIR-V execution environment rules to use (100 means 1.0)
+    int openGl;       // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX"
 };
 
 //
@@ -103,6 +108,7 @@
 const char* const E_GL_EXT_frag_depth                   = "GL_EXT_frag_depth";
 const char* const E_GL_OES_EGL_image_external           = "GL_OES_EGL_image_external";
 const char* const E_GL_EXT_shader_texture_lod           = "GL_EXT_shader_texture_lod";
+const char* const E_GL_EXT_shadow_samplers              = "GL_EXT_shadow_samplers";
 
 const char* const E_GL_ARB_texture_rectangle            = "GL_ARB_texture_rectangle";
 const char* const E_GL_3DL_array_objects                = "GL_3DL_array_objects";
@@ -127,7 +133,9 @@
 const char* const E_GL_ARB_shader_ballot                = "GL_ARB_shader_ballot";
 const char* const E_GL_ARB_sparse_texture2              = "GL_ARB_sparse_texture2";
 const char* const E_GL_ARB_sparse_texture_clamp         = "GL_ARB_sparse_texture_clamp";
+const char* const E_GL_ARB_shader_stencil_export        = "GL_ARB_shader_stencil_export";
 // const char* const E_GL_ARB_cull_distance            = "GL_ARB_cull_distance";  // present for 4.5, but need extension control over block members
+const char* const E_GL_ARB_post_depth_coverage          = "GL_ARB_post_depth_coverage";
 
 const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers";
 const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted";
@@ -135,6 +143,19 @@
 // EXT extensions
 const char* const E_GL_EXT_device_group                 = "GL_EXT_device_group";
 const char* const E_GL_EXT_multiview                    = "GL_EXT_multiview";
+const char* const E_GL_EXT_post_depth_coverage          = "GL_EXT_post_depth_coverage";
+
+// Arrays of extensions for the above viewportEXTs duplications
+
+const char* const post_depth_coverageEXTs[] = { E_GL_ARB_post_depth_coverage, E_GL_EXT_post_depth_coverage };
+const int Num_post_depth_coverageEXTs = sizeof(post_depth_coverageEXTs) / sizeof(post_depth_coverageEXTs[0]);
+
+// OVR extensions
+const char* const E_GL_OVR_multiview                    = "GL_OVR_multiview";
+const char* const E_GL_OVR_multiview2                   = "GL_OVR_multiview2";
+
+const char* const OVR_multiview_EXTs[] = { E_GL_OVR_multiview, E_GL_OVR_multiview2 };
+const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multiview_EXTs[0]);
 
 // #line and #include
 const char* const E_GL_GOOGLE_cpp_style_line_directive          = "GL_GOOGLE_cpp_style_line_directive";
diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp
index 7d0f155..ba7e0f5 100644
--- a/glslang/MachineIndependent/intermOut.cpp
+++ b/glslang/MachineIndependent/intermOut.cpp
@@ -1085,6 +1085,8 @@
             infoSink.debug << "gl_FragCoord origin is upper left\n";
         if (earlyFragmentTests)
             infoSink.debug << "using early_fragment_tests\n";
+        if (postDepthCoverage)
+            infoSink.debug << "using post_depth_coverage\n";
         if (depthLayout != EldNone)
             infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n";
         if (blendEquations != 0) {
diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp
index 40a0e41..9585627 100644
--- a/glslang/MachineIndependent/iomapper.cpp
+++ b/glslang/MachineIndependent/iomapper.cpp
@@ -404,6 +404,11 @@
     {
         if (type.getQualifier().hasSet())
             return type.getQualifier().layoutSet;
+
+        // If a command line or API option requested a single descriptor set, use that (if not overrided by spaceN)
+        if (baseResourceSetBinding.size() == 1)
+            return atoi(baseResourceSetBinding[0].c_str());
+
         return 0;
     }
 
@@ -413,9 +418,22 @@
     }
     int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& type, bool /*is_live*/) override
     {
-        if (!doAutoLocationMapping || type.getQualifier().hasLocation())
+        // kick out of not doing this
+        if (!doAutoLocationMapping)
             return -1;
 
+        // no locations added if already present, or a built-in variable
+        if (type.getQualifier().hasLocation() || type.getQualifier().builtIn != EbvNone)
+            return -1;
+
+        // no locations on blocks of built-in variables
+        if (type.isStruct()) {
+            if (type.getStruct()->size() < 1)
+                return -1;
+            if ((*type.getStruct())[0].type->getQualifier().builtIn != EbvNone)
+                return -1;
+        }
+
         // Placeholder.
         // TODO: It would be nice to flesh this out using 
         // intermediate->computeTypeLocationSize(type), or functions that call it like
@@ -436,7 +454,10 @@
 
     void notifyBinding(EShLanguage, const char* /*name*/, const TType&, bool /*is_live*/) override {}
     void notifyInOut(EShLanguage, const char* /*name*/, const TType&, bool /*is_live*/) override {}
-    void endNotifications() override {}
+    void endNotifications(EShLanguage) override {}
+    void beginNotifications(EShLanguage) override {}
+    void beginResolve(EShLanguage) override {}
+    void endResolve(EShLanguage) override {}
 
 protected:
     static int getLayoutSet(const glslang::TType& type) {
@@ -704,13 +725,16 @@
     TNotifyUniformAdaptor uniformNotify(stage, *resolver);
     TResolverUniformAdaptor uniformResolve(stage, *resolver, infoSink, hadError, intermediate);
     TResolverInOutAdaptor inOutResolve(stage, *resolver, infoSink, hadError, intermediate);
+    resolver->beginNotifications(stage);
     std::for_each(inVarMap.begin(), inVarMap.end(), inOutNotify);
     std::for_each(outVarMap.begin(), outVarMap.end(), inOutNotify);
     std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformNotify);
-    resolver->endNotifications();
+    resolver->endNotifications(stage);
+    resolver->beginResolve(stage);
     std::for_each(inVarMap.begin(), inVarMap.end(), inOutResolve);
     std::for_each(outVarMap.begin(), outVarMap.end(), inOutResolve);
     std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformResolve);
+    resolver->endResolve(stage);
 
     if (!hadError) {
         // sort by id again, so we can use lower bound to find entries
diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp
index 4a91a25..9ca1557 100644
--- a/glslang/MachineIndependent/linkValidate.cpp
+++ b/glslang/MachineIndependent/linkValidate.cpp
@@ -101,6 +101,9 @@
     if (! earlyFragmentTests)
         earlyFragmentTests = unit.earlyFragmentTests;
 
+    if (!postDepthCoverage)
+        postDepthCoverage = unit.postDepthCoverage;
+
     if (depthLayout == EldNone)
         depthLayout = unit.depthLayout;
     else if (depthLayout != unit.depthLayout)
@@ -459,9 +462,9 @@
             error(infoSink, "At least one shader must specify an output layout(vertices=...)");
         break;
     case EShLangTessEvaluation:
-        if (inputPrimitive == ElgNone)
-            error(infoSink, "At least one shader must specify an input layout primitive");
         if (source == EShSourceGlsl) {
+            if (inputPrimitive == ElgNone)
+                error(infoSink, "At least one shader must specify an input layout primitive");
             if (vertexSpacing == EvsNone)
                 vertexSpacing = EvsEqual;
             if (vertexOrder == EvoNone)
@@ -485,6 +488,11 @@
             error(infoSink, "At least one shader must specify a layout(max_vertices = value)");
         break;
     case EShLangFragment:
+        // for GL_ARB_post_depth_coverage, EarlyFragmentTest is set automatically in 
+        // ParseHelper.cpp. So if we reach here, this must be GL_EXT_post_depth_coverage 
+        // requiring explicit early_fragment_tests
+        if (getPostDepthCoverage() && !getEarlyFragmentTests())
+            error(infoSink, "post_depth_coverage requires early_fragment_tests");
         break;
     case EShLangCompute:
         break;
diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h
index f93182b..c1daf1b 100644
--- a/glslang/MachineIndependent/localintermediate.h
+++ b/glslang/MachineIndependent/localintermediate.h
@@ -164,8 +164,8 @@
         numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
         invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone),
         pixelCenterInteger(false), originUpperLeft(false),
-        vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0),
-        xfbMode(false), multiStream(false),
+        vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false),
+        blendEquations(0), xfbMode(false), multiStream(false),
 #ifdef NV_EXTENSIONS
         layoutOverrideCoverage(false),
         geoPassthroughEXT(false),
@@ -276,8 +276,8 @@
     TIntermAggregate* makeAggregate(const TSourceLoc&);
     TIntermTyped* setAggregateOperator(TIntermNode*, TOperator, const TType& type, TSourceLoc);
     bool areAllChildConst(TIntermAggregate* aggrNode);
-    TIntermTyped* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&);
-    TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&);
+    TIntermTyped* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&, TSelectionControl = ESelectionControlNone);
+    TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&, TSelectionControl = ESelectionControlNone);
     TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);
     TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, const TSourceLoc&);
     TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const;
@@ -403,6 +403,8 @@
     bool getPixelCenterInteger() const { return pixelCenterInteger; }
     void setEarlyFragmentTests() { earlyFragmentTests = true; }
     bool getEarlyFragmentTests() const { return earlyFragmentTests; }
+    void setPostDepthCoverage() { postDepthCoverage = true; }
+    bool getPostDepthCoverage() const { return postDepthCoverage; }
     bool setDepth(TLayoutDepth d)
     {
         if (depthLayout != EldNone)
@@ -513,6 +515,7 @@
     int localSize[3];
     int localSizeSpecId[3];
     bool earlyFragmentTests;
+    bool postDepthCoverage;
     TLayoutDepth depthLayout;
     bool depthReplacing;
     int blendEquations;        // an 'or'ing of masks of shifts of TBlendEquationShift
diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp
index f0566c6..50fb602 100644
--- a/glslang/MachineIndependent/reflection.cpp
+++ b/glslang/MachineIndependent/reflection.cpp
@@ -131,8 +131,11 @@
         for (int m = 0; m <= index; ++m) {
             // modify just the children's view of matrix layout, if there is one for this member
             TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix;
-            int memberAlignment = intermediate.getBaseAlignment(*memberList[m].type, memberSize, dummyStride, type.getQualifier().layoutPacking == ElpStd140,
-                                                                subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : type.getQualifier().layoutMatrix == ElmRowMajor);
+            int memberAlignment = intermediate.getBaseAlignment(*memberList[m].type, memberSize, dummyStride,
+                                                                type.getQualifier().layoutPacking == ElpStd140,
+                                                                subMatrixLayout != ElmNone
+                                                                    ? subMatrixLayout == ElmRowMajor
+                                                                    : type.getQualifier().layoutMatrix == ElmRowMajor);
             RoundToPow2(offset, memberAlignment);
             if (m < index)
                 offset += memberSize;
@@ -151,7 +154,8 @@
 
         int lastMemberSize;
         int dummyStride;
-        intermediate.getBaseAlignment(*memberList[lastIndex].type, lastMemberSize, dummyStride, blockType.getQualifier().layoutPacking == ElpStd140,
+        intermediate.getBaseAlignment(*memberList[lastIndex].type, lastMemberSize, dummyStride,
+                                      blockType.getQualifier().layoutPacking == ElpStd140,
                                       blockType.getQualifier().layoutMatrix == ElmRowMajor);
 
         return lastOffset + lastMemberSize;
@@ -167,7 +171,7 @@
     void blowUpActiveAggregate(const TType& baseType, const TString& baseName, const TList<TIntermBinary*>& derefs,
                                TList<TIntermBinary*>::const_iterator deref, int offset, int blockIndex, int arraySize)
     {
-        // process the part of the derefence chain that was explicit in the shader
+        // process the part of the dereference chain that was explicit in the shader
         TString name = baseName;
         const TType* terminalType = &baseType;
         for (; deref != derefs.end(); ++deref) {
@@ -177,7 +181,7 @@
             switch (visitNode->getOp()) {
             case EOpIndexIndirect:
                 // Visit all the indices of this array, and for each one add on the remaining dereferencing
-                for (int i = 0; i < visitNode->getLeft()->getType().getOuterArraySize(); ++i) {
+                for (int i = 0; i < std::max(visitNode->getLeft()->getType().getOuterArraySize(), 1); ++i) {
                     TString newBaseName = name;
                     if (baseType.getBasicType() != EbtBlock)
                         newBaseName.append(TString("[") + String(i) + "]");
@@ -212,7 +216,7 @@
             if (terminalType->isArray()) {
                 // Visit all the indices of this array, and for each one,
                 // fully explode the remaining aggregate to dereference
-                for (int i = 0; i < terminalType->getOuterArraySize(); ++i) {
+                for (int i = 0; i < std::max(terminalType->getOuterArraySize(), 1); ++i) {
                     TString newBaseName = name;
                     newBaseName.append(TString("[") + String(i) + "]");
                     TType derefType(*terminalType, 0);
@@ -235,7 +239,7 @@
         }
 
         // Finally, add a full string to the reflection database, and update the array size if necessary.
-        // If the derefenced entity to record is an array, compute the size and update the maximum size.
+        // If the dereferenced entity to record is an array, compute the size and update the maximum size.
 
         // there might not be a final array dereference, it could have been copied as an array object
         if (arraySize == 0)
@@ -244,7 +248,8 @@
         TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name);
         if (it == reflection.nameToIndex.end()) {
             reflection.nameToIndex[name] = (int)reflection.indexToUniform.size();
-            reflection.indexToUniform.push_back(TObjectReflection(name, *terminalType, offset, mapToGlType(*terminalType),
+            reflection.indexToUniform.push_back(TObjectReflection(name, *terminalType, offset,
+                                                                  mapToGlType(*terminalType),
                                                                   arraySize, blockIndex));
         } else if (arraySize > 1) {
             int& reflectedArraySize = reflection.indexToUniform[it->second].size;
@@ -417,7 +422,8 @@
                 case Esd2D:
                     switch ((int)sampler.ms) {
                     case false:  return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D;
-                    case true:   return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_INT_SAMPLER_2D_MULTISAMPLE;
+                    case true:   return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
+                                                        : GL_INT_SAMPLER_2D_MULTISAMPLE;
                     }
                 case Esd3D:
                     return GL_INT_SAMPLER_3D;
@@ -435,7 +441,8 @@
                 case Esd2D:
                     switch ((int)sampler.ms) {
                     case false:  return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D;
-                    case true:   return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
+                    case true:   return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
+                                                        : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
                     }
                 case Esd3D:
                     return GL_UNSIGNED_INT_SAMPLER_3D;
@@ -495,7 +502,8 @@
                 case Esd2D:
                     switch ((int)sampler.ms) {
                     case false:  return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D;
-                    case true:   return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
+                    case true:   return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY
+                                                        : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
                     }
                 case Esd3D:
                     return GL_UNSIGNED_INT_IMAGE_3D;
@@ -725,7 +733,9 @@
 // Returns false if the input is too malformed to do this.
 bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate)
 {
-    if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive())
+    if (intermediate.getTreeRoot() == nullptr ||
+        intermediate.getNumEntryPoints() != 1 ||
+        intermediate.isRecursive())
         return false;
 
     buildAttributeReflection(stage, intermediate);
diff --git a/glslang/MachineIndependent/reflection.h b/glslang/MachineIndependent/reflection.h
index 7a1cc8e..fedfbe8 100644
--- a/glslang/MachineIndependent/reflection.h
+++ b/glslang/MachineIndependent/reflection.h
@@ -59,7 +59,15 @@
         name(pName), offset(pOffset),
         glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()) { }
 
-    void dump() const {
+    const TType* const getType() const { return type; }
+    int getBinding() const
+    {
+        if (type == nullptr || !type->getQualifier().hasBinding())
+            return -1;
+        return type->getQualifier().layoutBinding;
+    }
+    void dump() const
+    {
         printf("%s: offset %d, type %x, size %d, index %d, binding %d",
                name.c_str(), offset, glDefineType, size, index, getBinding() );
 
@@ -68,8 +76,7 @@
 
         printf("\n");
     }
-
-    const TType* const getType() const { return type; }
+    static TObjectReflection badReflection() { return TObjectReflection(); }
 
     TString name;
     int offset;
@@ -78,15 +85,7 @@
     int index;
     int counterIndex;
 
-    static TObjectReflection badReflection() { return TObjectReflection(); }
-
 protected:
-    int getBinding() const {
-        if (type == nullptr || type->getQualifier().layoutBinding == TQualifier::layoutBindingEnd)
-            return -1;
-        return type->getQualifier().layoutBinding;
-    }
-
     TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { }
 
     const TType* type;
diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
index 99e9ce1..1bf49e1 100644
--- a/glslang/OSDependent/Unix/CMakeLists.txt
+++ b/glslang/OSDependent/Unix/CMakeLists.txt
@@ -1,5 +1,8 @@
 add_library(OSDependent STATIC ossource.cpp ../osinclude.h)
-set_property(TARGET OSDependent PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET OSDependent PROPERTY FOLDER glslang)
+set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)
 
-install(TARGETS OSDependent
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS OSDependent
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt
index cc65ad6..f257418 100644
--- a/glslang/OSDependent/Windows/CMakeLists.txt
+++ b/glslang/OSDependent/Windows/CMakeLists.txt
@@ -1,7 +1,8 @@
 set(SOURCES ossource.cpp ../osinclude.h)
 
 add_library(OSDependent STATIC ${SOURCES})
-set_property(TARGET OSDependent PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET OSDependent PROPERTY FOLDER glslang)
+set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 # MinGW GCC complains about function pointer casts to void*.
 # Turn that off with -fpermissive.
@@ -13,5 +14,7 @@
     source_group("Source" FILES ${SOURCES})
 endif(WIN32)
 
-install(TARGETS OSDependent
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS OSDependent
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h
index b2a4dea..12672ee 100644
--- a/glslang/Public/ShaderLang.h
+++ b/glslang/Public/ShaderLang.h
@@ -110,7 +110,44 @@
     EShSourceNone,
     EShSourceGlsl,
     EShSourceHlsl,
-} EShSource;          // if EShLanguage were EShStage, this could be EShLanguage instead
+} EShSource;                  // if EShLanguage were EShStage, this could be EShLanguage instead
+
+typedef enum {
+    EShClientNone,
+    EShClientVulkan,
+    EShClientOpenGL,
+} EShClient;
+
+typedef enum {
+    EShTargetNone,
+    EshTargetSpv,
+} EShTargetLanguage;
+
+struct TInputLanguage {
+    EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone
+    EShLanguage stage;        // redundant information with other input, this one overrides when not EShSourceNone
+    EShClient dialect;
+    int dialectVersion;       // version of client's language definition, not the client (when not EShClientNone)
+};
+
+struct TClient {
+    EShClient client;
+    int version;              // version of client itself (not the client's input dialect)
+};
+
+struct TTarget {
+    EShTargetLanguage language;
+    unsigned int version;     // the version to target, if SPIR-V, defined by "word 1" of the SPIR-V binary header
+};
+
+// All source/client/target versions and settings.
+// Can override previous methods of setting, when items are set here.
+// Expected to grow, as more are added, rather than growing parameter lists.
+struct TEnvironment {
+    TInputLanguage input;     // definition of the input language
+    TClient client;           // what client is the overall compilation being done for?
+    TTarget target;           // what to generate
+};
 
 const char* StageName(EShLanguage);
 
@@ -324,6 +361,25 @@
     void setNoStorageFormat(bool useUnknownFormat);
     void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
 
+    // For setting up the environment (initialized in the constructor):
+    void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version)
+    {
+        environment.input.languageFamily = lang;
+        environment.input.stage = envStage;
+        environment.input.dialect = client;
+        environment.input.dialectVersion = version;
+    }
+    void setEnvClient(EShClient client, int version)
+    {
+        environment.client.client = client;
+        environment.client.version = version;
+    }
+    void setEnvTarget(EShTargetLanguage lang, unsigned int version)
+    {
+        environment.target.language = lang;
+        environment.target.version = version;
+    }
+
     // Interface to #include handlers.
     //
     // To support #include, a client of Glslang does the following:
@@ -463,6 +519,8 @@
     // a function in the source string can be renamed FROM this TO the name given in setEntryPoint.
     std::string sourceEntryPointName;
 
+    TEnvironment environment;
+
     friend class TProgram;
 
 private:
@@ -525,7 +583,13 @@
   // Notification of a in or out variable
   virtual void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
   // Called by mapIO when it has finished the notify pass
-  virtual void endNotifications() = 0;
+  virtual void endNotifications(EShLanguage stage) = 0;
+  // Called by mapIO when it starts its notify pass for the given stage
+  virtual void beginNotifications(EShLanguage stage) = 0;
+  // Called by mipIO when it starts its resolve pass for the given stage
+  virtual void beginResolve(EShLanguage stage) = 0;
+  // Called by mapIO when it has finished the resolve pass
+  virtual void endResolve(EShLanguage stage) = 0;
 };
 
 // Make one TProgram per set of shaders that will get linked together.  Add all
@@ -555,6 +619,7 @@
     const char* getUniformBlockName(int blockIndex) const; // can be used for glGetActiveUniformBlockName()
     int getUniformBlockSize(int blockIndex) const;         // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE)
     int getUniformIndex(const char* name) const;           // can be used for glGetUniformIndices()
+    int getUniformBinding(int index) const;                // returns the binding number
     int getUniformBlockIndex(int index) const;             // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX)
     int getUniformBlockCounterIndex(int index) const;      // returns block index of associated counter.
     int getUniformType(int index) const;                   // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE)
diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp
index d8a5ef9..5e30613 100644
--- a/gtests/AST.FromFile.cpp
+++ b/gtests/AST.FromFile.cpp
@@ -101,6 +101,12 @@
         "310.tese",
         "310implicitSizeArrayError.vert",
         "310AofA.vert",
+        "320.comp",
+        "320.vert",
+        "320.geom",
+        "320.frag",
+        "320.tesc",
+        "320.tese",
         "330.frag",
         "330comp.frag",
         "constErrors.frag",
@@ -136,6 +142,7 @@
         "430.vert",
         "430.comp",
         "430AofA.frag",
+        "435.vert",
         "440.vert",
         "440.frag",
         "450.vert",
diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt
index 2616ac0..15b73f4 100644
--- a/gtests/CMakeLists.txt
+++ b/gtests/CMakeLists.txt
@@ -28,8 +28,10 @@
         add_executable(glslangtests ${TEST_SOURCES})
         set_property(TARGET glslangtests PROPERTY FOLDER tests)
         glslang_set_link_args(glslangtests)
-        install(TARGETS glslangtests
-                RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+        if(ENABLE_GLSLANG_INSTALL)
+            install(TARGETS glslangtests
+                    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+        endif(ENABLE_GLSLANG_INSTALL)
 
         set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
         # Supply a default test root directory, so that manual testing
diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp
index 51f9d49..46d8cdd 100644
--- a/gtests/Hlsl.FromFile.cpp
+++ b/gtests/Hlsl.FromFile.cpp
@@ -97,9 +97,19 @@
         {"hlsl.cast.frag", "PixelShaderFunction"},
         {"hlsl.charLit.vert", "main"},
         {"hlsl.clip.frag", "main"},
+        {"hlsl.clipdistance-1.vert", "main"},
+        {"hlsl.clipdistance-2.vert", "main"},
+        {"hlsl.clipdistance-3.vert", "main"},
+        {"hlsl.clipdistance-4.vert", "main"},
+        {"hlsl.clipdistance-5.vert", "main"},
+        {"hlsl.clipdistance-6.vert", "main"},
+        {"hlsl.clipdistance-7.vert", "main"},
+        {"hlsl.clipdistance-8.vert", "main"},
+        {"hlsl.clipdistance-9.vert", "main"},
         {"hlsl.comparison.vec.frag", "main"},
         {"hlsl.conditional.frag", "PixelShaderFunction"},
         {"hlsl.constantbuffer.frag", "main"},
+        {"hlsl.constructArray.vert", "main"},
         {"hlsl.constructexpr.frag", "main"},
         {"hlsl.constructimat.frag", "main"},
         {"hlsl.depthGreater.frag", "PixelShaderFunction"},
@@ -116,6 +126,8 @@
         {"hlsl.float4.frag", "PixelShaderFunction"},
         {"hlsl.flatten.return.frag", "main"},
         {"hlsl.flattenOpaque.frag", "main"},
+        {"hlsl.flattenOpaqueInit.vert", "main"},
+        {"hlsl.flattenOpaqueInitMix.vert", "main"},
         {"hlsl.forLoop.frag", "PixelShaderFunction"},
         {"hlsl.gather.array.dx10.frag", "main"},
         {"hlsl.gather.basic.dx10.frag", "main"},
@@ -131,12 +143,14 @@
         {"hlsl.getdimensions.rw.dx10.frag", "main"},
         {"hlsl.getdimensions.dx10.vert", "main"},
         {"hlsl.getsampleposition.dx10.frag", "main"},
+        {"hlsl.global-const-init.frag", "main"},
         {"hlsl.domain.1.tese", "main"},
         {"hlsl.domain.2.tese", "main"},
         {"hlsl.domain.3.tese", "main"},
         {"hlsl.function.frag", "main"},
         {"hlsl.hull.1.tesc", "main"},
         {"hlsl.hull.2.tesc", "main"},
+        {"hlsl.hull.3.tesc", "main"},
         {"hlsl.hull.void.tesc", "main"},
         {"hlsl.hull.ctrlpt-1.tesc", "main"},
         {"hlsl.hull.ctrlpt-2.tesc", "main"},
@@ -274,6 +288,7 @@
         {"hlsl.structin.vert", "main"},
         {"hlsl.structIoFourWay.frag", "main"},
         {"hlsl.structStructName.frag", "main"},
+        {"hlsl.synthesizeInput.frag", "main"},
         {"hlsl.texture.subvec4.frag", "main"},
         {"hlsl.this.frag", "main"},
         {"hlsl.intrinsics.vert", "VertexShaderFunction"},
@@ -284,6 +299,7 @@
         {"hlsl.max.frag", "PixelShaderFunction"},
         {"hlsl.precedence.frag", "PixelShaderFunction"},
         {"hlsl.precedence2.frag", "PixelShaderFunction"},
+        {"hlsl.scalar2matrix.frag", "main"},
         {"hlsl.semantic.geom", "main"},
         {"hlsl.semantic.vert", "main"},
         {"hlsl.scope.frag", "PixelShaderFunction"},
@@ -291,6 +307,9 @@
         {"hlsl.struct.frag", "PixelShaderFunction"},
         {"hlsl.switch.frag", "PixelShaderFunction"},
         {"hlsl.swizzle.frag", "PixelShaderFunction"},
+        {"hlsl.target.frag", "main"},
+        {"hlsl.targetStruct1.frag", "main"},
+        {"hlsl.targetStruct2.frag", "main"},
         {"hlsl.templatetypes.frag", "PixelShaderFunction"},
         {"hlsl.tx.bracket.frag", "main"},
         {"hlsl.tx.overload.frag", "main"},
diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp
index dc91486..dfad30c 100644
--- a/gtests/Spv.FromFile.cpp
+++ b/gtests/Spv.FromFile.cpp
@@ -226,6 +226,8 @@
         "spv.aggOps.frag",
         "spv.always-discard.frag",
         "spv.always-discard2.frag",
+        "spv.arbPostDepthCoverage.frag",
+        "spv.arbPostDepthCoverage_Error.frag",
         "spv.bitCast.frag",
         "spv.bool.vert",
         "spv.boolInBlock.frag",
@@ -242,6 +244,8 @@
         "spv.drawParams.vert",
         "spv.doWhileLoop.frag",
         "spv.earlyReturnDiscard.frag",
+        "spv.extPostDepthCoverage.frag",
+        "spv.extPostDepthCoverage_Error.frag",
         "spv.flowControl.frag",
         "spv.forLoop.frag",
         "spv.forwardFun.frag",
@@ -271,6 +275,7 @@
         "spv.noWorkgroup.comp",
         "spv.offsets.frag",
         "spv.Operations.frag",
+        "spv.paramMemory.frag",
         "spv.precision.frag",
         "spv.prepost.frag",
         "spv.qualifiers.vert",
@@ -278,6 +283,7 @@
         "spv.shaderBallot.comp",
         "spv.shaderDrawParams.vert",
         "spv.shaderGroupVote.comp",
+        "spv.shaderStencilExport.frag",
         "spv.shiftOps.frag",
         "spv.simpleFunctionCall.frag",
         "spv.simpleMat.vert",
@@ -332,7 +338,7 @@
         { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
         { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false },
         { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
-        { "spv.register.autoassign.rangetest.frag", "main", 
+        { "spv.register.autoassign.rangetest.frag", "main",
                 glslang::TQualifier::layoutBindingEnd-2,
                 glslang::TQualifier::layoutBindingEnd+5,
                 20, 30, true, false },
@@ -357,6 +363,7 @@
         "spv.atomic.comp",
         "spv.glFragColor.frag",
         "spv.specConst.vert",
+        "spv.OVR_multiview.vert",
     })),
     FileNameAsCustomTestSuffix
 );
diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt
index 24f5c9a..98dfad7 100755
--- a/hlsl/CMakeLists.txt
+++ b/hlsl/CMakeLists.txt
@@ -18,11 +18,14 @@
     hlslParseables.h)
 
 add_library(HLSL STATIC ${SOURCES} ${HEADERS})
-set_property(TARGET HLSL PROPERTY FOLDER hlsl POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET HLSL PROPERTY FOLDER hlsl)
+set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 if(WIN32)
     source_group("Source" FILES ${SOURCES} ${HEADERS})
 endif(WIN32)
 
-install(TARGETS HLSL
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+if(ENABLE_GLSLANG_INSTALL)
+    install(TARGETS HLSL
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif(ENABLE_GLSLANG_INSTALL)
diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp
index 0918d13..05c95d3 100755
--- a/hlsl/hlslGrammar.cpp
+++ b/hlsl/hlslGrammar.cpp
@@ -107,42 +107,14 @@
     // valid identifier, nor is "linear".  This code special cases the known instances of this, so
     // e.g, "int sample;" or "float float;" is accepted.  Other cases can be added here if needed.
 
-    TString* idString = nullptr;
-    switch (peek()) {
-    case EHTokSample:     idString = NewPoolTString("sample");     break;
-    case EHTokHalf:       idString = NewPoolTString("half");       break;
-    case EHTokHalf1x1:    idString = NewPoolTString("half1x1");    break;
-    case EHTokHalf1x2:    idString = NewPoolTString("half1x2");    break;
-    case EHTokHalf1x3:    idString = NewPoolTString("half1x3");    break;
-    case EHTokHalf1x4:    idString = NewPoolTString("half1x4");    break;
-    case EHTokHalf2x1:    idString = NewPoolTString("half2x1");    break;
-    case EHTokHalf2x2:    idString = NewPoolTString("half2x2");    break;
-    case EHTokHalf2x3:    idString = NewPoolTString("half2x3");    break;
-    case EHTokHalf2x4:    idString = NewPoolTString("half2x4");    break;
-    case EHTokHalf3x1:    idString = NewPoolTString("half3x1");    break;
-    case EHTokHalf3x2:    idString = NewPoolTString("half3x2");    break;
-    case EHTokHalf3x3:    idString = NewPoolTString("half3x3");    break;
-    case EHTokHalf3x4:    idString = NewPoolTString("half3x4");    break;
-    case EHTokHalf4x1:    idString = NewPoolTString("half4x1");    break;
-    case EHTokHalf4x2:    idString = NewPoolTString("half4x2");    break;
-    case EHTokHalf4x3:    idString = NewPoolTString("half4x3");    break;
-    case EHTokHalf4x4:    idString = NewPoolTString("half4x4");    break;
-    case EHTokBool:       idString = NewPoolTString("bool");       break;
-    case EHTokFloat:      idString = NewPoolTString("float");      break;
-    case EHTokDouble:     idString = NewPoolTString("double");     break;
-    case EHTokInt:        idString = NewPoolTString("int");        break;
-    case EHTokUint:       idString = NewPoolTString("uint");       break;
-    case EHTokMin16float: idString = NewPoolTString("min16float"); break;
-    case EHTokMin10float: idString = NewPoolTString("min10float"); break;
-    case EHTokMin16int:   idString = NewPoolTString("min16int");   break;
-    case EHTokMin12int:   idString = NewPoolTString("min12int");   break;
-    default:
+    const char* idString = getTypeString(peek());
+    if (idString == nullptr)
         return false;
-    }
 
-    token.string     = idString;
+    token.string     = NewPoolTString(idString);
     token.tokenClass = EHTokIdentifier;
-    idToken          = token;
+    idToken = token;
+    typeIdentifiers = true;
 
     advanceToken();
 
@@ -324,7 +296,8 @@
 
 // declaration
 //      : sampler_declaration_dx9 post_decls SEMICOLON
-//      | fully_specified_type declarator_list SEMICOLON(optional for cbuffer/tbuffer)
+//      | fully_specified_type                           // for cbuffer/tbuffer
+//      | fully_specified_type declarator_list SEMICOLON // for non cbuffer/tbuffer
 //      | fully_specified_type identifier function_parameters post_decls compound_statement  // function definition
 //      | fully_specified_type identifier sampler_state post_decls compound_statement        // sampler definition
 //      | typedef declaration
@@ -398,11 +371,19 @@
     // if (acceptSamplerDeclarationDX9(declaredType))
     //     return true;
 
+    bool forbidDeclarators = (peekTokenClass(EHTokCBuffer) || peekTokenClass(EHTokTBuffer));
     // fully_specified_type
     if (! acceptFullySpecifiedType(declaredType, nodeList))
         return false;
 
-    // identifier
+    // cbuffer and tbuffer end with the closing '}'.
+    // No semicolon is included.
+    if (forbidDeclarators)
+        return true;
+
+    // declarator_list
+    //    : declarator
+    //         : identifier
     HlslToken idToken;
     TIntermAggregate* initializers = nullptr;
     while (acceptIdentifier(idToken)) {
@@ -511,11 +492,10 @@
             }
         }
 
-        if (acceptTokenClass(EHTokComma)) {
+        // COMMA
+        if (acceptTokenClass(EHTokComma))
             declarator_list = true;
-            continue;
-        }
-    };
+    }
 
     // The top-level initializer node is a sequence.
     if (initializers != nullptr)
@@ -527,18 +507,15 @@
     else
         nodeList = initializers;
 
-    // SEMICOLON(optional for cbuffer/tbuffer)
+    // SEMICOLON
     if (! acceptTokenClass(EHTokSemicolon)) {
+        // This may have been a false detection of what appeared to be a declaration, but
+        // was actually an assignment such as "float = 4", where "float" is an identifier.
+        // We put the token back to let further parsing happen for cases where that may
+        // happen.  This errors on the side of caution, and mostly triggers the error.
         if (peek() == EHTokAssign || peek() == EHTokLeftBracket || peek() == EHTokDot || peek() == EHTokComma) {
-            // This may have been a false detection of what appeared to be a declaration, but
-            // was actually an assignment such as "float = 4", where "float" is an identifier.
-            // We put the token back to let further parsing happen for cases where that may
-            // happen.  This errors on the side of caution, and mostly triggers the error.
             recedeToken();
             return false;
-        } else if (declaredType.getBasicType() == EbtBlock) {
-            // cbuffer, et. al. (but not struct) don't have an ending semicolon
-            return true;
         } else {
             expected(";");
             return false;
@@ -703,10 +680,10 @@
             qualifier.noContraction = true;
             break;
         case EHTokIn:
-            qualifier.storage = EvqIn;
+            qualifier.storage = (qualifier.storage == EvqOut) ? EvqInOut : EvqIn;
             break;
         case EHTokOut:
-            qualifier.storage = EvqOut;
+            qualifier.storage = (qualifier.storage == EvqIn) ? EvqInOut : EvqOut;
             break;
         case EHTokInOut:
             qualifier.storage = EvqInOut;
@@ -1311,6 +1288,18 @@
     static const TBasicType min12int_bt   = EbtInt;
     static const TBasicType min16uint_bt  = EbtUint;
 
+    // Some types might have turned into identifiers. Take the hit for checking
+    // when this has happened.
+    if (typeIdentifiers) {
+        const char* identifierString = getTypeString(peek());
+        if (identifierString != nullptr) {
+            TString name = identifierString;
+            // if it's an identifier, it's not a type
+            if (parseContext.symbolTable.find(name) != nullptr)
+                return false;
+        }
+    }
+
     switch (peek()) {
     case EHTokVector:
         return acceptVectorTemplateType(type);
@@ -1917,18 +1906,19 @@
     TStorageQualifier storageQualifier = EvqTemporary;
     bool readonly = false;
 
-    // CBUFFER
     if (acceptTokenClass(EHTokCBuffer)) {
+        // CBUFFER
         storageQualifier = EvqUniform;
-    // TBUFFER
     } else if (acceptTokenClass(EHTokTBuffer)) {
+        // TBUFFER
         storageQualifier = EvqBuffer;
         readonly = true;
-    }
-    // CLASS
-    // STRUCT
-    else if (! acceptTokenClass(EHTokClass) && ! acceptTokenClass(EHTokStruct))
+    } else if (! acceptTokenClass(EHTokClass) && ! acceptTokenClass(EHTokStruct)) {
+        // Neither CLASS nor STRUCT
         return false;
+    }
+
+    // Now known to be one of CBUFFER, TBUFFER, CLASS, or STRUCT
 
     // IDENTIFIER
     TString structName = "";
@@ -2563,8 +2553,19 @@
             expected("assignment expression in initializer list");
             return false;
         }
+
+        const bool firstNode = (node == nullptr);
+
         node = intermediate.growAggregate(node, expr, loc);
 
+        // If every sub-node in the list has qualifier EvqConst, the returned node becomes
+        // EvqConst.  Otherwise, it becomes EvqTemporary. That doesn't happen with e.g.
+        // EvqIn or EvqPosition, since the collection isn't EvqPosition if all the members are.
+        if (firstNode && expr->getQualifier().storage == EvqConst)
+            node->getQualifier().storage = EvqConst;
+        else if (expr->getQualifier().storage != EvqConst)
+            node->getQualifier().storage = EvqTemporary;
+
         // COMMA
         if (acceptTokenClass(EHTokComma)) {
             if (acceptTokenClass(EHTokRightBrace))  // allow trailing comma
@@ -2748,9 +2749,14 @@
     if (acceptTokenClass(EHTokLeftParen)) {
         TType castType;
         if (acceptType(castType)) {
+            // recognize any array_specifier as part of the type
+            TArraySizes* arraySizes = nullptr;
+            acceptArraySpecifier(arraySizes);
+            if (arraySizes != nullptr)
+                castType.newArraySizes(*arraySizes);
+            TSourceLoc loc = token.loc;
             if (acceptTokenClass(EHTokRightParen)) {
                 // We've matched "(type)" now, get the expression to cast
-                TSourceLoc loc = token.loc;
                 if (! acceptUnaryExpression(node))
                     return false;
 
@@ -2770,6 +2776,11 @@
                 // the '(int' part.  We must back up twice.
                 recedeToken();
                 recedeToken();
+
+                // Note, there are no array constructors like
+                //   (float[2](...))
+                if (arraySizes != nullptr)
+                    parseContext.error(loc, "parenthesized array constructor not allowed", "([]())", "", "");
             }
         } else {
             // This isn't a type cast, but it still started "(", so if it is a
@@ -2870,23 +2881,6 @@
         return false;
     }
 
-    // This is to guarantee we do this no matter how we get out of the stack frame.
-    // This way there's no bug if an early return forgets to do it.
-    struct tFinalize {
-        tFinalize(HlslParseContext& p) : parseContext(p) { }
-        ~tFinalize() { parseContext.finalizeFlattening(); }
-        HlslParseContext& parseContext;
-    private:
-        const tFinalize& operator=(const tFinalize&) { return *this; }
-        tFinalize(const tFinalize& f) : parseContext(f.parseContext) { }
-    } finalize(parseContext);
-
-    // Initialize the flattening accumulation data, so we can track data across multiple bracket or
-    // dot operators.  This can also be nested, e.g, for [], so we have to track each nesting
-    // level: hence the init and finalize.  Even though in practice these must be
-    // constants, they are parsed no matter what.
-    parseContext.initFlattening();
-
     // Something was found, chain as many postfix operations as exist.
     do {
         TSourceLoc loc = token.loc;
@@ -3218,10 +3212,10 @@
         return acceptScopedCompoundStatement(statement);
 
     case EHTokIf:
-        return acceptSelectionStatement(statement);
+        return acceptSelectionStatement(statement, attributes);
 
     case EHTokSwitch:
-        return acceptSwitchStatement(statement);
+        return acceptSwitchStatement(statement, attributes);
 
     case EHTokFor:
     case EHTokDo:
@@ -3334,10 +3328,12 @@
 //      : IF LEFT_PAREN expression RIGHT_PAREN statement
 //      : IF LEFT_PAREN expression RIGHT_PAREN statement ELSE statement
 //
-bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement)
+bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributeMap& attributes)
 {
     TSourceLoc loc = token.loc;
 
+    const TSelectionControl control = parseContext.handleSelectionControl(attributes);
+
     // IF
     if (! acceptTokenClass(EHTokIf))
         return false;
@@ -3375,7 +3371,7 @@
     }
 
     // Put the pieces together
-    statement = intermediate.addSelection(condition, thenElse, loc);
+    statement = intermediate.addSelection(condition, thenElse, loc, control);
     parseContext.popScope();
     --parseContext.controlFlowNestingLevel;
 
@@ -3385,10 +3381,13 @@
 // switch_statement
 //      : SWITCH LEFT_PAREN expression RIGHT_PAREN compound_statement
 //
-bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement)
+bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributeMap& attributes)
 {
     // SWITCH
     TSourceLoc loc = token.loc;
+
+    const TSelectionControl control = parseContext.handleSelectionControl(attributes);
+
     if (! acceptTokenClass(EHTokSwitch))
         return false;
 
@@ -3408,7 +3407,7 @@
     --parseContext.controlFlowNestingLevel;
 
     if (statementOkay)
-        statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr);
+        statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, control);
 
     parseContext.popSwitchSequence();
     parseContext.popScope();
@@ -3840,4 +3839,40 @@
     return true;
 }
 
+// Return a string for just the types that can also be declared as an identifier.
+const char* HlslGrammar::getTypeString(EHlslTokenClass tokenClass) const
+{
+    switch (tokenClass) {
+    case EHTokSample:     return "sample";
+    case EHTokHalf:       return "half";
+    case EHTokHalf1x1:    return "half1x1";
+    case EHTokHalf1x2:    return "half1x2";
+    case EHTokHalf1x3:    return "half1x3";
+    case EHTokHalf1x4:    return "half1x4";
+    case EHTokHalf2x1:    return "half2x1";
+    case EHTokHalf2x2:    return "half2x2";
+    case EHTokHalf2x3:    return "half2x3";
+    case EHTokHalf2x4:    return "half2x4";
+    case EHTokHalf3x1:    return "half3x1";
+    case EHTokHalf3x2:    return "half3x2";
+    case EHTokHalf3x3:    return "half3x3";
+    case EHTokHalf3x4:    return "half3x4";
+    case EHTokHalf4x1:    return "half4x1";
+    case EHTokHalf4x2:    return "half4x2";
+    case EHTokHalf4x3:    return "half4x3";
+    case EHTokHalf4x4:    return "half4x4";
+    case EHTokBool:       return "bool";
+    case EHTokFloat:      return "float";
+    case EHTokDouble:     return "double";
+    case EHTokInt:        return "int";
+    case EHTokUint:       return "uint";
+    case EHTokMin16float: return "min16float";
+    case EHTokMin10float: return "min10float";
+    case EHTokMin16int:   return "min16int";
+    case EHTokMin12int:   return "min12int";
+    default:
+        return nullptr;
+    }
+}
+
 } // end namespace glslang
diff --git a/hlsl/hlslGrammar.h b/hlsl/hlslGrammar.h
index 135fd6c..ded8e96 100755
--- a/hlsl/hlslGrammar.h
+++ b/hlsl/hlslGrammar.h
@@ -52,7 +52,8 @@
     class HlslGrammar : public HlslTokenStream {
     public:
         HlslGrammar(HlslScanContext& scanner, HlslParseContext& parseContext)
-            : HlslTokenStream(scanner), parseContext(parseContext), intermediate(parseContext.intermediate) { }
+            : HlslTokenStream(scanner), parseContext(parseContext), intermediate(parseContext.intermediate),
+              typeIdentifiers(false) { }
         virtual ~HlslGrammar() { }
 
         bool parse();
@@ -115,8 +116,8 @@
         bool acceptStatement(TIntermNode*&);
         bool acceptNestedStatement(TIntermNode*&);
         void acceptAttributes(TAttributeMap&);
-        bool acceptSelectionStatement(TIntermNode*&);
-        bool acceptSwitchStatement(TIntermNode*&);
+        bool acceptSelectionStatement(TIntermNode*&, const TAttributeMap&);
+        bool acceptSwitchStatement(TIntermNode*&, const TAttributeMap&);
         bool acceptIterationStatement(TIntermNode*&, const TAttributeMap&);
         bool acceptJumpStatement(TIntermNode*&);
         bool acceptCaseLabel(TIntermNode*&);
@@ -126,9 +127,11 @@
         bool acceptDefaultParameterDeclaration(const TType&, TIntermTyped*&);
 
         bool captureBlockTokens(TVector<HlslToken>& tokens);
+        const char* getTypeString(EHlslTokenClass tokenClass) const;
 
         HlslParseContext& parseContext;  // state of parsing and helper functions for building the intermediate
         TIntermediate& intermediate;     // the final product, the intermediate representation, includes the AST
+        bool typeIdentifiers;            // shader uses some types as identifiers
     };
 
 } // end namespace glslang
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index 67933b4..272c494 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -53,19 +53,21 @@
 namespace glslang {
 
 HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins,
-                                   int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
+                                   int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
+                                   TInfoSink& infoSink,
                                    const TString sourceEntryPointName,
                                    bool forwardCompatible, EShMessages messages) :
-    TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
+    TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink,
+                      forwardCompatible, messages),
     annotationNestingLevel(0),
     inputPatch(nullptr),
-    builtInIoIndex(nullptr),
-    builtInIoBase(nullptr),
     nextInLocation(0), nextOutLocation(0),
     sourceEntryPointName(sourceEntryPointName),
     entryPointFunction(nullptr),
     entryPointFunctionBody(nullptr),
-    gsStreamOutput(nullptr)
+    gsStreamOutput(nullptr),
+    clipDistanceOutput(nullptr),
+    cullDistanceOutput(nullptr)
 {
     globalUniformDefaults.clear();
     globalUniformDefaults.layoutMatrix = ElmRowMajor;
@@ -78,6 +80,9 @@
     globalInputDefaults.clear();
     globalOutputDefaults.clear();
 
+    clipSemanticNSize.fill(0);
+    cullSemanticNSize.fill(0);
+
     // "Shaders in the transform
     // feedback capturing mode have an initial global default of
     //     layout(xfb_buffer = 0) out;"
@@ -128,7 +133,8 @@
         // Print a message formated such that if you click on the message it will take you right to
         // the line through most UIs.
         const glslang::TSourceLoc& sourceLoc = input.getSourceLoc();
-        infoSink.info << sourceLoc.name << "(" << sourceLoc.line << "): error at column " << sourceLoc.column << ", HLSL parsing failed.\n";
+        infoSink.info << sourceLoc.name << "(" << sourceLoc.line << "): error at column " << sourceLoc.column
+                      << ", HLSL parsing failed.\n";
         ++numErrors;
         return false;
     }
@@ -165,7 +171,8 @@
     return false;
 }
 
-void HlslParseContext::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* newTypeList)
+void HlslParseContext::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName,
+                                              TTypeList* newTypeList)
 {
     newTypeList = nullptr;
     correctUniform(memberType.getQualifier());
@@ -390,12 +397,13 @@
             // fall through...
         case EOpAssign:
             {
-                // Since this is an lvalue, we'll convert an image load to a sequence like this (to still provide the value):
+                // Since this is an lvalue, we'll convert an image load to a sequence like this
+                // (to still provide the value):
                 //   OpSequence
                 //      OpImageStore(object, lhs, rhs)
                 //      rhs
-                // But if it's not a simple symbol RHS (say, a fn call), we don't want to duplicate the RHS, so we'll convert
-                // instead to this:
+                // But if it's not a simple symbol RHS (say, a fn call), we don't want to duplicate the RHS,
+                // so we'll convert instead to this:
                 //   OpSequence
                 //      rhsTmp = rhs
                 //      OpImageStore(object, coord, rhsTmp)
@@ -506,12 +514,14 @@
 }
 
 // Deal with sampler aliasing: turning assignments into aliases
+// Return a placeholder node for higher-level code that think assignments must
+// generate code.
 TIntermTyped* HlslParseContext::handleSamplerLvalue(const TSourceLoc& loc, const char* op, TIntermTyped*& node)
 {
     // Can only alias an assignment:  "s1 = s2"
     TIntermBinary* binary = node->getAsBinaryNode();
     if (binary == nullptr || node->getAsOperator()->getOp() != EOpAssign ||
-        binary->getLeft() ->getAsSymbolNode() == nullptr ||
+        binary->getLeft()->getAsSymbolNode() == nullptr ||
         binary->getRight()->getAsSymbolNode() == nullptr) {
         error(loc, "can't modify sampler", op, "");
         return node;
@@ -520,11 +530,25 @@
     if (controlFlowNestingLevel > 0)
         warn(loc, "sampler or image aliased under control flow; consumption must be in same path", op, "");
 
+    TIntermTyped* set = setOpaqueLvalue(binary->getLeft(), binary->getRight());
+    if (set == nullptr)
+        warn(loc, "could not create alias for sampler", op, "");
+    else
+        node = set;
+
+    return node;
+}
+
+// Do an opaque assignment that needs to turn into an alias.
+// Return nullptr if it can't be done, otherwise return a placeholder
+// node for higher-level code that think assignments must generate code.
+TIntermTyped* HlslParseContext::setOpaqueLvalue(TIntermTyped* leftTyped, TIntermTyped* rightTyped)
+{
     // Best is if we are aliasing a flattened struct member "S.s1 = s2",
     // in which case we want to update the flattening information with the alias,
     // making everything else work seamlessly.
-    TIntermSymbol* left = binary->getLeft()->getAsSymbolNode();
-    TIntermSymbol* right = binary->getRight()->getAsSymbolNode();
+    TIntermSymbol* left = leftTyped->getAsSymbolNode();
+    TIntermSymbol* right = rightTyped->getAsSymbolNode();
     for (auto fit = flattenMap.begin(); fit != flattenMap.end(); ++fit) {
         for (auto mit = fit->second.members.begin(); mit != fit->second.members.end(); ++mit) {
             if ((*mit)->getUniqueId() == left->getId()) {
@@ -533,15 +557,12 @@
                 (*mit)->setUniqueId(right->getId());
                 // replace node (rest of compiler expects either an error or code to generate)
                 // with pointless access
-                node = binary->getRight();
-                return node;
+                return right;
             }
         }
     }
 
-    warn(loc, "could not create alias for sampler", op, "");
-
-    return node;
+    return nullptr;
 }
 
 void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>& tokens)
@@ -693,7 +714,7 @@
         }
 
         // Recovery, if it wasn't found or was not a variable.
-        if (! variable) {
+        if (variable == nullptr) {
             error(loc, "unknown variable", string->c_str(), "");
             variable = new TVariable(string, TType(EbtVoid));
         }
@@ -791,7 +812,7 @@
     index = makeIntegerIndex(index);
 
     if (index == nullptr) {
-        error(loc, " unknown undex type ", "", "");
+        error(loc, " unknown index type ", "", "");
         return nullptr;
     }
 
@@ -810,7 +831,8 @@
     variableCheck(base);
     if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) {
         if (base->getAsSymbolNode())
-            error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), "");
+            error(loc, " left of '[' is not of type array, matrix, or vector ",
+                  base->getAsSymbolNode()->getName().c_str(), "");
         else
             error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", "");
     } else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst)
@@ -818,15 +840,13 @@
     else {
         // at least one of base and index is variable...
 
-        if (base->getAsSymbolNode() && (wasFlattened(base) || shouldFlatten(base->getType()))) {
+        if (base->getAsSymbolNode() && wasFlattened(base)) {
             if (index->getQualifier().storage != EvqConst)
                 error(loc, "Invalid variable index to flattened array", base->getAsSymbolNode()->getName().c_str(), "");
 
             result = flattenAccess(base, indexValue);
             flattened = (result != base);
         } else {
-            splitAccessArray(loc, base, index);
-
             if (index->getQualifier().storage == EvqConst) {
                 if (base->getType().isImplicitlySizedArray())
                     updateImplicitArraySize(loc, base, indexValue);
@@ -864,17 +884,19 @@
 }
 
 // Handle seeing a binary node with a math operation.
-TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right)
+TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op,
+                                                 TIntermTyped* left, TIntermTyped* right)
 {
     TIntermTyped* result = intermediate.addBinaryMath(op, left, right, loc);
-    if (! result)
+    if (result == nullptr)
         binaryOpError(loc, str, left->getCompleteString(), right->getCompleteString());
 
     return result;
 }
 
 // Handle seeing a unary node with a math operation.
-TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* childNode)
+TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op,
+                                                TIntermTyped* childNode)
 {
     TIntermTyped* result = intermediate.addUnaryMath(op, childNode, loc);
 
@@ -939,9 +961,11 @@
             // Keep 'result' pointing to 'base', since we expect an operator[] to go by next.
         } else {
             if (field == "mips")
-                error(loc, "unexpected texture type for .mips[][] operator:", base->getType().getCompleteString().c_str(), "");
+                error(loc, "unexpected texture type for .mips[][] operator:",
+                      base->getType().getCompleteString().c_str(), "");
             else
-                error(loc, "unexpected operator on texture type:", field.c_str(), base->getType().getCompleteString().c_str());
+                error(loc, "unexpected operator on texture type:", field.c_str(),
+                      base->getType().getCompleteString().c_str());
         }
     } else if (base->isVector() || base->isScalar()) {
         TSwizzleSelectors<TVectorSelector> selectors;
@@ -975,7 +999,8 @@
             } else {
                 TIntermTyped* index = intermediate.addSwizzle(selectors, loc);
                 result = intermediate.addIndex(EOpVectorSwizzle, base, index, loc);
-                result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, selectors.size()));
+                result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision,
+                                selectors.size()));
             }
         }
     } else if (base->isMatrix()) {
@@ -989,10 +1014,14 @@
                 result = intermediate.foldDereference(base, selectors[0].coord1, loc);
                 result = intermediate.foldDereference(result, selectors[0].coord2, loc);
             } else {
-                result = intermediate.addIndex(EOpIndexDirect, base, intermediate.addConstantUnion(selectors[0].coord1, loc), loc);
+                result = intermediate.addIndex(EOpIndexDirect, base,
+                                               intermediate.addConstantUnion(selectors[0].coord1, loc),
+                                               loc);
                 TType dereferencedCol(base->getType(), 0);
                 result->setType(dereferencedCol);
-                result = intermediate.addIndex(EOpIndexDirect, result, intermediate.addConstantUnion(selectors[0].coord2, loc), loc);
+                result = intermediate.addIndex(EOpIndexDirect, result,
+                                               intermediate.addConstantUnion(selectors[0].coord2, loc),
+                                               loc);
                 TType dereferenced(dereferencedCol, 0);
                 result->setType(dereferenced);
             }
@@ -1003,7 +1032,8 @@
                 if (base->getType().getQualifier().isFrontEndConstant())
                     result = intermediate.foldDereference(base, column, loc);
                 else {
-                    result = intermediate.addIndex(EOpIndexDirect, base, intermediate.addConstantUnion(column, loc), loc);
+                    result = intermediate.addIndex(EOpIndexDirect, base, intermediate.addConstantUnion(column, loc),
+                                                   loc);
                     TType dereferenced(base->getType(), 0);
                     result->setType(dereferenced);
                 }
@@ -1011,7 +1041,8 @@
                 // general case, not a column, not a single component
                 TIntermTyped* index = intermediate.addSwizzle(selectors, loc);
                 result = intermediate.addIndex(EOpMatrixSwizzle, base, index, loc);
-                result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, selectors.size()));
+                result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision,
+                                      selectors.size()));
            }
         }
     } else if (base->getBasicType() == EbtStruct || base->getBasicType() == EbtBlock) {
@@ -1025,21 +1056,15 @@
             }
         }
         if (fieldFound) {
-            if (base->getAsSymbolNode() && (wasFlattened(base) || shouldFlatten(base->getType()))) {
+            if (base->getAsSymbolNode() && wasFlattened(base)) {
                 result = flattenAccess(base, member);
             } else {
-                // Update the base and member to access if this was a split structure.
-                result = splitAccessStruct(loc, base, member);
-                fields = base->getType().getStruct();
-
-                if (result == nullptr) {
-                    if (base->getType().getQualifier().storage == EvqConst)
-                        result = intermediate.foldDereference(base, member, loc);
-                    else {
-                        TIntermTyped* index = intermediate.addConstantUnion(member, loc);
-                        result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc);
-                        result->setType(*(*fields)[member].type);
-                    }
+                if (base->getType().getQualifier().storage == EvqConst)
+                    result = intermediate.foldDereference(base, member, loc);
+                else {
+                    TIntermTyped* index = intermediate.addConstantUnion(member, loc);
+                    result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc);
+                    result->setType(*(*fields)[member].type);
                 }
             }
         } else
@@ -1074,40 +1099,17 @@
         return false;
 }
 
-// Split the type of the given node into two structs:
-//   1. interstage IO
-//   2. everything else
-// IO members are put into the ioStruct.  The type is modified to remove them.
-void HlslParseContext::split(TIntermTyped* node)
-{
-    if (node == nullptr)
-        return;
-
-    TIntermSymbol* symNode = node->getAsSymbolNode();
-
-    if (symNode == nullptr)
-        return;
-
-    // Create a new variable:
-    TType& splitType = split(*symNode->getType().clone(), symNode->getName());
-
-    splitIoVars[symNode->getId()] = makeInternalVariable(symNode->getName(), splitType);
-}
-
-// Split the type of the given variable into two structs:
+// Split a type into
+//   1. a struct of non-I/O members
+//   2. a collection of flattened I/O variables
 void HlslParseContext::split(const TVariable& variable)
 {
-    const TType& type = variable.getType();
-
-    TString name = variable.getName();
-
     // Create a new variable:
-    TType& splitType = split(*type.clone(), name);
-
+    TType& splitType = split(*variable.getType().clone(), variable.getName());
     splitIoVars[variable.getUniqueId()] = makeInternalVariable(variable.getName(), splitType);
 }
 
-// Recursive implementation of split(const TVariable& variable).
+// Recursive implementation of split().
 // Returns reference to the modified type.
 TType& HlslParseContext::split(TType& type, TString name, const TType* outerStructType)
 {
@@ -1125,15 +1127,18 @@
     if (type.isStruct()) {
         TTypeList* userStructure = type.getWritableStruct();
 
-        // Get iterator to (now at end) set of builtin interstage IO members
+        // Get iterator to (now at end) set of built-in interstage IO members
         const auto firstIo = std::stable_partition(userStructure->begin(), userStructure->end(),
-                                                   [this](const TTypeLoc& t) {return !t.type->isBuiltInInterstageIO(language);});
+                                                   [this](const TTypeLoc& t) {
+            return !t.type->isBuiltInInterstageIO(language);
+        });
 
-        // Move those to the builtin IO.  However, we also propagate arrayness (just one level is handled
+        // Move those to the built-in IO.  However, we also propagate arrayness (just one level is handled
         // now) to this variable.
         for (auto ioType = firstIo; ioType != userStructure->end(); ++ioType) {
             const TType& memberType = *ioType->type;
-            TVariable* ioVar = makeInternalVariable(name + (name.empty() ? "" : "_") + memberType.getFieldName(), memberType);
+            TVariable* ioVar = makeInternalVariable(name + (name.empty() ? "" : "_") + memberType.getFieldName(),
+                                                    memberType);
 
             if (arraySizes)
                 ioVar->getWritableType().newArraySizes(*arraySizes);
@@ -1169,15 +1174,16 @@
 }
 
 // Top level variable flattening: construct data
-void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
+void HlslParseContext::flatten(const TVariable& variable)
 {
     const TType& type = variable.getType();
 
     auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(),
-                                                  TFlattenData(type.getQualifier().layoutBinding)));
+                                                  TFlattenData(type.getQualifier().layoutBinding,
+                                                               type.getQualifier().layoutLocation)));
 
     // the item is a map pair, so first->second is the TFlattenData itself.
-    flatten(loc, variable, type, entry.first->second, "");
+    flatten(variable, type, entry.first->second, "");
 }
 
 // Recursively flatten the given variable at the provided type, building the flattenData as we go.
@@ -1207,15 +1213,15 @@
 //
 // so the 4th flattened member in traversal order is ours.
 //
-int HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable, const TType& type,
+int HlslParseContext::flatten(const TVariable& variable, const TType& type,
                               TFlattenData& flattenData, TString name)
 {
     // If something is an arrayed struct, the array flattener will recursively call flatten()
     // to then flatten the struct, so this is an "if else": we don't do both.
     if (type.isArray())
-        return flattenArray(loc, variable, type, flattenData, name);
+        return flattenArray(variable, type, flattenData, name);
     else if (type.isStruct())
-        return flattenStruct(loc, variable, type, flattenData, name);
+        return flattenStruct(variable, type, flattenData, name);
     else {
         assert(0); // should never happen
         return -1;
@@ -1224,8 +1230,7 @@
 
 // Add a single flattened member to the flattened data being tracked for the composite
 // Returns true for the final flattening level.
-int HlslParseContext::addFlattenedMember(const TSourceLoc& loc,
-                                         const TVariable& variable, const TType& type, TFlattenData& flattenData,
+int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType& type, TFlattenData& flattenData,
                                          const TString& memberName, bool track)
 {
     if (isFinalFlattening(type)) {
@@ -1236,6 +1241,19 @@
         if (flattenData.nextBinding != TQualifier::layoutBindingEnd)
             memberVariable->getWritableType().getQualifier().layoutBinding = flattenData.nextBinding++;
 
+        if (memberVariable->getType().getQualifier().builtIn == EbvNone) {
+            // inherited locations must be auto bumped, not replicated
+            if (flattenData.nextLocation != TQualifier::layoutLocationEnd &&
+                memberVariable->getType().getQualifier().builtIn == EbvNone) {
+                memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation;
+                flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType());
+                nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation);
+            }
+        } else {
+            // inherited locations are nonsensical for built-ins
+            memberVariable->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd;
+        }
+
         flattenData.offsets.push_back(static_cast<int>(flattenData.members.size()));
         flattenData.members.push_back(memberVariable);
 
@@ -1245,7 +1263,7 @@
         return static_cast<int>(flattenData.offsets.size())-1; // location of the member reference
     } else {
         // Further recursion required
-        return flatten(loc, variable, type, flattenData, memberName);
+        return flatten(variable, type, flattenData, memberName);
     }
 }
 
@@ -1253,7 +1271,7 @@
 // equivalent set of individual variables.
 //
 // Assumes shouldFlatten() or equivalent was called first.
-int HlslParseContext::flattenStruct(const TSourceLoc& loc, const TVariable& variable, const TType& type,
+int HlslParseContext::flattenStruct(const TVariable& variable, const TType& type,
                                     TFlattenData& flattenData, TString name)
 {
     assert(type.isStruct());
@@ -1269,7 +1287,7 @@
         TType& dereferencedType = *members[member].type;
         const TString memberName = name + (name.empty() ? "" : ".") + dereferencedType.getFieldName();
 
-        const int mpos = addFlattenedMember(loc, variable, dereferencedType, flattenData, memberName, false);
+        const int mpos = addFlattenedMember(variable, dereferencedType, flattenData, memberName, false);
         flattenData.offsets[pos++] = mpos;
     }
 
@@ -1280,13 +1298,10 @@
 // equivalent set of individual variables.
 //
 // Assumes shouldFlatten() or equivalent was called first.
-int HlslParseContext::flattenArray(const TSourceLoc& loc, const TVariable& variable, const TType& type,
+int HlslParseContext::flattenArray(const TVariable& variable, const TType& type,
                                    TFlattenData& flattenData, TString name)
 {
-    assert(type.isArray());
-
-    if (type.isImplicitlySizedArray())
-        error(loc, "cannot flatten implicitly sized array", variable.getName().c_str(), "");
+    assert(type.isArray() && !type.isImplicitlySizedArray());
 
     const int size = type.getOuterArraySize();
     const TType dereferencedType(type, 0);
@@ -1302,7 +1317,7 @@
     for (int element=0; element < size; ++element) {
         char elementNumBuf[20];  // sufficient for MAXINT
         snprintf(elementNumBuf, sizeof(elementNumBuf)-1, "[%d]", element);
-        const int mpos = addFlattenedMember(loc, variable, dereferencedType, flattenData,
+        const int mpos = addFlattenedMember(variable, dereferencedType, flattenData,
                                             name + elementNumBuf, true);
 
         flattenData.offsets[pos++] = mpos;
@@ -1315,30 +1330,28 @@
 bool HlslParseContext::wasFlattened(const TIntermTyped* node) const
 {
     return node != nullptr && node->getAsSymbolNode() != nullptr &&
-        wasFlattened(node->getAsSymbolNode()->getId());
+           wasFlattened(node->getAsSymbolNode()->getId());
 }
 
 // Return true if we have split this structure
 bool HlslParseContext::wasSplit(const TIntermTyped* node) const
 {
     return node != nullptr && node->getAsSymbolNode() != nullptr &&
-        wasSplit(node->getAsSymbolNode()->getId());
+           wasSplit(node->getAsSymbolNode()->getId());
 }
 
 // Turn an access into an aggregate that was flattened to instead be
 // an access to the individual variable the member was flattened to.
-// Assumes shouldFlatten() or equivalent was called first.
-// Also assumes that initFlattening() and finalizeFlattening() bracket the usage.
+// Assumes wasFlattened() or equivalent was called first.
 TIntermTyped* HlslParseContext::flattenAccess(TIntermTyped* base, int member)
 {
     const TType dereferencedType(base->getType(), member);  // dereferenced type
     const TIntermSymbol& symbolNode = *base->getAsSymbolNode();
-
-    TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, dereferencedType);
+    TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, dereferencedType, symbolNode.getFlattenSubset());
 
     return flattened ? flattened : base;
 }
-TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, const TType& dereferencedType)
+TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, const TType& dereferencedType, int subset)
 {
     const auto flattenData = flattenMap.find(uniqueId);
 
@@ -1346,129 +1359,37 @@
         return nullptr;
 
     // Calculate new cumulative offset from the packed tree
-    flattenOffset.back() = flattenData->second.offsets[flattenOffset.back() + member];
+    int newSubset = flattenData->second.offsets[subset >= 0 ? subset + member : member];
 
+    TIntermSymbol* subsetSymbol;
     if (isFinalFlattening(dereferencedType)) {
         // Finished flattening: create symbol for variable
-        member = flattenData->second.offsets[flattenOffset.back()];
+        member = flattenData->second.offsets[newSubset];
         const TVariable* memberVariable = flattenData->second.members[member];
-        return intermediate.addSymbol(*memberVariable);
+        subsetSymbol = intermediate.addSymbol(*memberVariable);
+        subsetSymbol->setFlattenSubset(-1);
     } else {
+
         // If this is not the final flattening, accumulate the position and return
         // an object of the partially dereferenced type.
-        return new TIntermSymbol(uniqueId, "flattenShadow", dereferencedType);
+        subsetSymbol = new TIntermSymbol(uniqueId, "flattenShadow", dereferencedType);
+        subsetSymbol->setFlattenSubset(newSubset);
     }
+
+    return subsetSymbol;
 }
 
 // Find and return the split IO TVariable for id, or nullptr if none.
 TVariable* HlslParseContext::getSplitIoVar(int id) const
 {
     const auto splitIoVar = splitIoVars.find(id);
-
     if (splitIoVar == splitIoVars.end())
         return nullptr;
 
     return splitIoVar->second;
 }
 
-// Find and return the split IO TVariable for variable, or nullptr if none.
-TVariable* HlslParseContext::getSplitIoVar(const TVariable* var) const
-{
-    if (var == nullptr)
-        return nullptr;
-
-    return getSplitIoVar(var->getUniqueId());
-}
-
-// Find and return the split IO TVariable for symbol in this node, or nullptr if none.
-TVariable* HlslParseContext::getSplitIoVar(const TIntermTyped* node) const
-{
-    if (node == nullptr)
-        return nullptr;
-
-    const TIntermSymbol* symbolNode = node->getAsSymbolNode();
-
-    if (symbolNode == nullptr)
-        return nullptr;
-
-    return getSplitIoVar(symbolNode->getId());
-}
-
-// Remember the index used to dereference into this structure, in case it has to be moved to a
-// split-off builtin IO member.
-void HlslParseContext::splitAccessArray(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
-{
-    const TVariable* splitIoVar = getSplitIoVar(base);
-
-    // Not a split structure
-    if (splitIoVar == nullptr)
-        return;
-
-    if (builtInIoBase) {
-        error(loc, "only one array dimension supported for builtIn IO variable", "", "");
-        return;
-    }
-
-    builtInIoBase  = base;
-    builtInIoIndex = index;
-}
-
-// Turn an access into an struct that was split to instead be an
-// access to either the modified structure, or a direct reference to
-// one of the split member variables.
-TIntermTyped* HlslParseContext::splitAccessStruct(const TSourceLoc& loc, TIntermTyped*& base, int& member)
-{
-    // nothing to do
-    if (base == nullptr)
-        return nullptr;
-
-    // We have a pending bracket reference to an outer struct that we may want to move to an inner member.
-    if (builtInIoBase)
-        base = builtInIoBase;
-
-    const TVariable* splitIoVar = getSplitIoVar(base);
-
-    if (splitIoVar == nullptr)
-        return nullptr;
-
-    const TTypeList& members = *base->getType().getStruct();
-
-    const TType& memberType = *members[member].type;
-
-    if (memberType.isBuiltInInterstageIO(language)) {
-        // It's one of the interstage IO variables we split off.
-        TIntermTyped* builtIn = intermediate.addSymbol(*interstageBuiltInIo[tInterstageIoData(memberType, base->getType())], loc);
-
-        // If there's an array reference to an outer split struct, we re-apply it here.
-        if (builtInIoIndex != nullptr) {
-            if (builtInIoIndex->getQualifier().storage == EvqConst)
-                builtIn = intermediate.addIndex(EOpIndexDirect, builtIn, builtInIoIndex, loc);
-            else
-                builtIn = intermediate.addIndex(EOpIndexIndirect, builtIn, builtInIoIndex, loc);
-
-            builtIn->setType(memberType);
-
-            builtInIoIndex = nullptr;
-            builtInIoBase  = nullptr;
-        }
-
-        return builtIn;
-    } else {
-        // It's not an IO variable.  Find the equivalent index into the new variable.
-        base = intermediate.addSymbol(*splitIoVar, loc);
-
-        int newMember = 0;
-        for (int m=0; m<member; ++m)
-            if (!members[m].type->isBuiltInInterstageIO(language))
-                ++newMember;
-
-        member = newMember;
-
-        return nullptr;
-    }
-}
-
-// Pass through to base class after remembering builtin mappings.
+// Pass through to base class after remembering built-in mappings.
 void HlslParseContext::trackLinkage(TSymbol& symbol)
 {
     TBuiltInVariable biType = symbol.getType().getQualifier().builtIn;
@@ -1480,6 +1401,12 @@
 }
 
 
+// Returns true if the built-in is a clip or cull distance variable.
+bool HlslParseContext::isClipOrCullDistance(TBuiltInVariable builtIn)
+{
+    return builtIn == EbvClipDistance || builtIn == EbvCullDistance;
+}
+
 // Some types require fixed array sizes in SPIR-V, but can be scalars or
 // arrays of sizes SPIR-V doesn't allow.  For example, tessellation factors.
 // This creates the right size.  A conversion is performed when the internal
@@ -1492,9 +1419,7 @@
     switch (type.getQualifier().builtIn) {
     case EbvTessLevelOuter: requiredArraySize = 4; break;
     case EbvTessLevelInner: requiredArraySize = 2; break;
-    case EbvClipDistance:   // TODO: ...
-    case EbvCullDistance:   // TODO: ...
-        return;
+
     case EbvTessCoord:
         {
             // tesscoord is always a vec3 for the IO variable, no matter the shader's
@@ -1507,6 +1432,14 @@
             break;
         }
     default:
+        if (isClipOrCullDistance(type)) {
+            if (type.getQualifier().builtIn == EbvClipDistance) {
+                clipSemanticNSize[type.getQualifier().layoutLocation] = type.getVectorSize();
+            } else {
+                cullSemanticNSize[type.getQualifier().layoutLocation] = type.getVectorSize();
+            }
+        }
+
         return;
     }
 
@@ -1525,17 +1458,17 @@
 }
 
 // Variables that correspond to the user-interface in and out of a stage
-// (not the built-in interface) are assigned locations and
-// registered as a linkage node (part of the stage's external interface).
-//
+// (not the built-in interface) are
+//  - assigned locations
+//  - registered as a linkage node (part of the stage's external interface).
 // Assumes it is called in the order in which locations should be assigned.
-void HlslParseContext::assignLocations(TVariable& variable)
+void HlslParseContext::assignToInterface(TVariable& variable)
 {
     const auto assignLocation = [&](TVariable& variable) {
-        const TType& type = variable.getType();
-        const TQualifier& qualifier = type.getQualifier();
+        TType& type = variable.getWritableType();
+        TQualifier& qualifier = type.getQualifier();
         if (qualifier.storage == EvqVaryingIn || qualifier.storage == EvqVaryingOut) {
-            if (qualifier.builtIn == EbvNone) {
+            if (qualifier.builtIn == EbvNone && !qualifier.hasLocation()) {
                 // Strip off the outer array dimension for those having an extra one.
                 int size;
                 if (type.isArray() && qualifier.isArrayedIo(language)) {
@@ -1552,7 +1485,6 @@
                     nextOutLocation += size;
                 }
             }
-
             trackLinkage(variable);
         }
     };
@@ -1562,7 +1494,7 @@
         for (auto member = memberList.begin(); member != memberList.end(); ++member)
             assignLocation(**member);
     } else if (wasSplit(variable.getUniqueId())) {
-        TVariable* splitIoVar = getSplitIoVar(&variable);
+        TVariable* splitIoVar = getSplitIoVar(variable.getUniqueId());
         assignLocation(*splitIoVar);
     } else {
         assignLocation(variable);
@@ -1632,7 +1564,8 @@
 // For struct buffers with counters, we must pass the counter buffer as hidden parameter.
 // This adds the hidden parameter to the parameter list in 'paramNodes' if needed.
 // Otherwise, it's a no-op
-void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc, TParameter& param, TIntermAggregate*& paramNodes)
+void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc, TParameter& param,
+                                                         TIntermAggregate*& paramNodes)
 {
     if (! hasStructBuffCounter(*param.type))
         return;
@@ -1658,13 +1591,14 @@
 // Returns an aggregate of parameter-symbol nodes.
 //
 TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function,
-                                                             const TAttributeMap& attributes, TIntermNode*& entryPointTree)
+                                                             const TAttributeMap& attributes,
+                                                             TIntermNode*& entryPointTree)
 {
     currentCaller = function.getMangledName();
     TSymbol* symbol = symbolTable.find(function.getMangledName());
     TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr;
 
-    if (! prevDec)
+    if (prevDec == nullptr)
         error(loc, "can't find function", function.getName().c_str(), "");
     // Note:  'prevDec' could be 'function' if this is the first time we've seen function
     // as it would have just been put in the symbol table.  Otherwise, we're looking up
@@ -1721,14 +1655,13 @@
             if (shouldFlatten(variable->getType())) {
                 // Expand the AST parameter nodes (but not the name mangling or symbol table view)
                 // for structures that need to be flattened.
-                flatten(loc, *variable);
+                flatten(*variable);
                 const TTypeList* structure = variable->getType().getStruct();
                 for (int mem = 0; mem < (int)structure->size(); ++mem) {
-                    initFlattening();
                     paramNodes = intermediate.growAggregate(paramNodes,
-                                                            flattenAccess(variable->getUniqueId(), mem, *(*structure)[mem].type),
+                                                            flattenAccess(variable->getUniqueId(), mem,
+                                                            *(*structure)[mem].type),
                                                             loc);
-                    finalizeFlattening();
                 }
             } else {
                 // Add the parameter to the AST
@@ -1769,7 +1702,8 @@
     // MaxVertexCount
     const TIntermAggregate* maxVertexCount = attributes[EatMaxVertexCount];
     if (maxVertexCount != nullptr) {
-        if (! intermediate.setVertices(maxVertexCount->getSequence()[0]->getAsConstantUnion()->getConstArray()[0].getIConst())) {
+        if (! intermediate.setVertices(maxVertexCount->getSequence()[0]->getAsConstantUnion()->
+                                       getConstArray()[0].getIConst())) {
             error(loc, "cannot change previously set maxvertexcount attribute", "", "");
         }
     }
@@ -1818,35 +1752,41 @@
         }
     }
 
-    // Handle [outputtoplogy("...")]
+    // Handle [outputtopology("...")]
     const TIntermAggregate* topologyAttr = attributes[EatOutputTopology];
     if (topologyAttr != nullptr) {
         const TConstUnion& topoType = topologyAttr->getSequence()[0]->getAsConstantUnion()->getConstArray()[0];
         if (topoType.getType() != EbtString) {
-            error(loc, "invalid outputtoplogy", "", "");
+            error(loc, "invalid outputtopology", "", "");
         } else {
             TString topologyStr = *topoType.getSConst();
             std::transform(topologyStr.begin(), topologyStr.end(), topologyStr.begin(), ::tolower);
 
-            TVertexOrder topology = EvoNone;
-                
+            TVertexOrder vertexOrder = EvoNone;
+            TLayoutGeometry primitive = ElgNone;
+
             if (topologyStr == "point") {
-                topology = EvoNone;
+                intermediate.setPointMode();
             } else if (topologyStr == "line") {
-                topology = EvoNone;
+                primitive = ElgIsolines;
             } else if (topologyStr == "triangle_cw") {
-                topology = EvoCw;
+                vertexOrder = EvoCw;
+                primitive = ElgTriangles;
             } else if (topologyStr == "triangle_ccw") {
-                topology = EvoCcw;
+                vertexOrder = EvoCcw;
+                primitive = ElgTriangles;
             } else {
-                error(loc, "unsupported outputtoplogy type", topologyStr.c_str(), "");
+                error(loc, "unsupported outputtopology type", topologyStr.c_str(), "");
             }
 
-            if (topology != EvoNone) {
-                if (! intermediate.setVertexOrder(topology)) {
-                    error(loc, "cannot change previously set outputtopology", TQualifier::getVertexOrderString(topology), "");
+            if (vertexOrder != EvoNone) {
+                if (! intermediate.setVertexOrder(vertexOrder)) {
+                    error(loc, "cannot change previously set outputtopology",
+                          TQualifier::getVertexOrderString(vertexOrder), "");
                 }
             }
+            if (primitive != ElgNone)
+                intermediate.setOutputPrimitive(primitive);
         }
     }
 
@@ -1874,14 +1814,16 @@
             }
 
             if (! intermediate.setVertexSpacing(partitioning))
-                error(loc, "cannot change previously set partitioning", TQualifier::getVertexSpacingString(partitioning), "");
+                error(loc, "cannot change previously set partitioning",
+                      TQualifier::getVertexSpacingString(partitioning), "");
         }
     }
 
     // Handle [outputcontrolpoints("...")]
     const TIntermAggregate* outputControlPoints = attributes[EatOutputControlPoints]; 
     if (outputControlPoints != nullptr) {
-        const TConstUnion& ctrlPointConst = outputControlPoints->getSequence()[0]->getAsConstantUnion()->getConstArray()[0];
+        const TConstUnion& ctrlPointConst =
+            outputControlPoints->getSequence()[0]->getAsConstantUnion()->getConstArray()[0];
         if (ctrlPointConst.getType() != EbtInt) {
             error(loc, "invalid outputcontrolpoints", "", "");
         } else {
@@ -1914,16 +1856,19 @@
 //        ret = @shaderEntryPoint(args...);
 //        oargs = args<that are output>...;
 //    }
+//    retType @shaderEntryPoint(args...)
+//    { body }
 //
 // The symbol table will still map the original entry point name to the
-// the modified function and it's new name:
+// the modified function and its new name:
 //
 //    symbol table:  shaderEntryPoint  ->   @shaderEntryPoint
 //
 // Returns nullptr if no entry-point tree was built, otherwise, returns
 // a subtree that creates the entry point.
 //
-TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunction& userFunction, const TAttributeMap& attributes)
+TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunction& userFunction,
+                                                   const TAttributeMap& attributes)
 {
     // Return true if this is a tessellation patch constant function input to a domain shader.
     const auto isDsPcfInput = [this](const TType& type) {
@@ -1960,15 +1905,19 @@
             // struct inputs to the vertex stage and outputs from the fragment stage must be flattened
             if ((language == EShLangVertex   && qualifier == EvqVaryingIn) ||
                 (language == EShLangFragment && qualifier == EvqVaryingOut))
-                flatten(loc, variable);
-            // Mixture of IO and non-IO must be split
+                flatten(variable);
+            // Structs contain interstage IO must be split
             else if (variable.getType().containsBuiltInInterstageIO(language))
                 split(variable);
         }
 
-        assignLocations(variable);
+        // For clip and cull distance, multiple output variables potentially get merged
+        // into one in assignClipCullDistance.  That code in assignClipCullDistance
+        // handles the interface logic, so we avoid it here in that case.
+        if (!isClipOrCullDistance(variable.getType()))
+            assignToInterface(variable);
     };
-    if (entryPointOutput)
+    if (entryPointOutput != nullptr)
         makeVariableInOut(*entryPointOutput);
     for (auto it = inputs.begin(); it != inputs.end(); ++it)
         if (!isDsPcfInput((*it)->getType()))  // skip domain shader PCF input (see comment below)
@@ -2012,11 +1961,8 @@
     for (int i = 0; i < userFunction.getParamCount(); i++) {
         TParameter& param = userFunction[i];
         argVars.push_back(makeInternalVariable(*param.name, *param.type));
-
         argVars.back()->getWritableType().getQualifier().makeTemporary();
-
         TIntermSymbol* arg = intermediate.addSymbol(*argVars.back());
-
         handleFunctionArgument(&callee, callingArgs, arg);
         if (param.type->getQualifier().isParamInput()) {
             intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg,
@@ -2062,7 +2008,6 @@
         } else {
             returnAssign = handleAssign(loc, EOpAssign, intermediate.addSymbol(*entryPointOutput), callReturn);
         }
-        
         intermediate.growAggregate(synthBody, returnAssign);
     } else
         intermediate.growAggregate(synthBody, callReturn);
@@ -2100,7 +2045,8 @@
     return synthFunctionDef;
 }
 
-void HlslParseContext::handleFunctionBody(const TSourceLoc& loc, TFunction& function, TIntermNode* functionBody, TIntermNode*& node)
+void HlslParseContext::handleFunctionBody(const TSourceLoc& loc, TFunction& function, TIntermNode* functionBody,
+                                          TIntermNode*& node)
 {
     node = intermediate.growAggregate(node, functionBody);
     intermediate.setAggregateOperator(node, EOpFunction, function.getType(), loc);
@@ -2120,12 +2066,63 @@
 void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& returnValue,
     TVector<TVariable*>& inputs, TVector<TVariable*>& outputs)
 {
+    // We might have in input structure type with no decorations that caused it
+    // to look like an input type, yet it has (e.g.) interpolation types that
+    // must be modified that turn it into an input type.
+    // Hence, a missing ioTypeMap for 'input' might need to be synthesized.
+    const auto synthesizeEditedInput = [this](TType& type) {
+        // True if a type needs to be 'flat'
+        const auto needsFlat = [](const TType& type) {
+            return type.containsBasicType(EbtInt) ||
+                    type.containsBasicType(EbtUint) ||
+                    type.containsBasicType(EbtInt64) ||
+                    type.containsBasicType(EbtUint64) ||
+                    type.containsBasicType(EbtBool) ||
+                    type.containsBasicType(EbtDouble);
+        };
+
+        if (language == EShLangFragment && needsFlat(type)) {
+            if (type.isStruct()) {
+                TTypeList* finalList = nullptr;
+                auto it = ioTypeMap.find(type.getStruct());
+                if (it == ioTypeMap.end() || it->second.input == nullptr) {
+                    // Getting here means we have no input struct, but we need one.
+                    auto list = new TTypeList;
+                    for (auto member = type.getStruct()->begin(); member != type.getStruct()->end(); ++member) {
+                        TType* newType = new TType;
+                        newType->shallowCopy(*member->type);
+                        TTypeLoc typeLoc = { newType, member->loc };
+                        list->push_back(typeLoc);
+                    }
+                    // install the new input type
+                    if (it == ioTypeMap.end()) {
+                        tIoKinds newLists = { list, nullptr, nullptr };
+                        ioTypeMap[type.getStruct()] = newLists;
+                    } else
+                        it->second.input = list;
+                    finalList = list;
+                } else
+                    finalList = it->second.input;
+                // edit for 'flat'
+                for (auto member = finalList->begin(); member != finalList->end(); ++member) {
+                    if (needsFlat(*member->type)) {
+                        member->type->getQualifier().clearInterpolation();
+                        member->type->getQualifier().flat = true;
+                    }
+                }
+            } else {
+                type.getQualifier().clearInterpolation();
+                type.getQualifier().flat = true;
+            }
+        }
+    };
+
     // Do the actual work to make a type be a shader input or output variable,
     // and clear the original to be non-IO (for use as a normal function parameter/return).
     const auto makeIoVariable = [this](const char* name, TType& type, TStorageQualifier storage) -> TVariable* {
         TVariable* ioVariable = makeInternalVariable(name, type);
         clearUniformInputOutput(type.getQualifier());
-        if (type.getStruct() != nullptr) {
+        if (type.isStruct()) {
             auto newLists = ioTypeMap.find(ioVariable->getType().getStruct());
             if (newLists != ioTypeMap.end()) {
                 if (storage == EvqVaryingIn && newLists->second.input)
@@ -2178,6 +2175,7 @@
     for (int i = 0; i < function.getParamCount(); i++) {
         TType& paramType = *function[i].type;
         if (paramType.getQualifier().isParamInput()) {
+            synthesizeEditedInput(paramType);
             TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingIn);
             inputs.push_back(argAsGlobal);
 
@@ -2241,13 +2239,205 @@
         arguments = newArg;
 }
 
+// Clip and cull distance require special handling due to a semantic mismatch.  In HLSL,
+// these can be float scalar, float vector, or arrays of float scalar or float vector.
+// In SPIR-V, they are arrays of scalar floats in all cases.  We must copy individual components
+// (e.g, both x and y components of a float2) out into the destination float array.
+//
+// The values are assigned to sequential members of the output array.  The inner dimension
+// is vector components.  The outer dimension is array elements.
+TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc, TOperator op, int semanticId,
+                                                           TIntermTyped* left, TIntermTyped* right)
+{
+    TVariable** clipCullVar = nullptr;
+
+    const TBuiltInVariable builtInType = left->getQualifier().builtIn;
+
+    // array sizes, or 1 if it's not an array:
+    const int rhsArraySize = (right->getType().isArray() ? right->getType().getOuterArraySize() : 1);
+    // vector sizes:
+    const int rhsVectorSize = right->getType().getVectorSize();
+
+    decltype(clipSemanticNSize)* semanticNSize = nullptr;
+
+    // Refer to either the clip or the cull distance, depending on semantic.
+    switch (builtInType) {
+    case EbvClipDistance:
+        clipCullVar = &clipDistanceOutput;
+        semanticNSize = &clipSemanticNSize;
+        break;
+    case EbvCullDistance:
+        clipCullVar = &cullDistanceOutput;
+        semanticNSize = &cullSemanticNSize;
+        break;
+
+    // called invalidly: we expected a clip or a cull distance.
+    // static compile time problem: should not happen.
+    default: assert(0); return nullptr;
+    }
+
+    // This is the offset in the destination array of a given semantic's data
+    std::array<int, maxClipCullRegs> semanticOffset;
+
+    // Calculate offset of variable of semantic N in destination array
+    int arrayLoc = 0;
+    int vecItems = 0;
+
+    for (int x = 0; x < maxClipCullRegs; ++x) {
+        // See if we overflowed the vec4 packing
+        if ((vecItems + (*semanticNSize)[x]) > 4) {
+            arrayLoc = (arrayLoc + 3) & (~0x3); // round up to next multiple of 4
+            vecItems = 0;
+        }
+
+        semanticOffset[x] = arrayLoc;
+        vecItems += (*semanticNSize)[x];
+        arrayLoc += (*semanticNSize)[x];
+    }
+        
+
+    // If we haven't created the output already, create it now.
+    if (*clipCullVar == nullptr) {
+        // ClipDistance and CullDistance are handled specially in the entry point output 
+        // copy algorithm, because they may need to be unpacked from components of vectors
+        // (or a scalar) into a float array.  Here, we make the array the right size and type,
+        // which depends on the incoming data, which has several potential dimensions:
+        //    Semantic ID
+        //    vector size
+        //    array size
+        // Of those, semantic ID and array size cannot appear simultaneously.
+
+        const int requiredArraySize = arrayLoc * rhsArraySize;
+
+        TType clipCullType(EbtFloat, left->getType().getQualifier().storage, 1);
+        clipCullType.getQualifier() = left->getType().getQualifier();
+
+        // Create required array dimension
+        TArraySizes arraySizes;
+        arraySizes.addInnerSize(requiredArraySize);
+        clipCullType.newArraySizes(arraySizes);
+
+        // Obtain symbol name: we'll use that for the symbol we introduce.
+        TIntermSymbol* sym = left->getAsSymbolNode();
+        assert(sym != nullptr);
+
+        // We are moving the semantic ID from the layout location, so it is no longer needed or
+        // desired there.
+        clipCullType.getQualifier().layoutLocation = TQualifier::layoutLocationEnd;
+
+        // Create variable and track its linkage
+        *clipCullVar = makeInternalVariable(sym->getName().c_str(), clipCullType);
+
+        trackLinkage(**clipCullVar);
+    }
+
+    // Create symbol for the clip or cull variable.
+    left = intermediate.addSymbol(**clipCullVar);
+
+    // array sizes, or 1 if it's not an array:
+    const int lhsArraySize = (left->getType().isArray() ? left->getType().getOuterArraySize() : 1);
+    // vector sizes:
+    const int lhsVectorSize = left->getType().getVectorSize();
+
+    // left has got to be an array of scalar floats, per SPIR-V semantics.
+    // fixBuiltInIoType() should have handled that upstream.
+    assert(left->getType().isArray());
+    assert(left->getType().getVectorSize() == 1);
+    assert(left->getType().getBasicType() == EbtFloat);
+
+    // We may be creating multiple sub-assignments.  This is an aggregate to hold them.
+    // TODO: it would be possible to be clever sometimes and avoid the sequence node if not needed.
+    TIntermAggregate* assignList = nullptr;
+
+    // If the types are homomorphic, use a simple assign.  No need to mess about with 
+    // individual components.
+    if (left->getType().isArray() == right->getType().isArray() &&
+        lhsArraySize == rhsArraySize &&
+        lhsVectorSize == rhsVectorSize) {
+        assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc));
+        assignList->setOperator(EOpSequence);
+        return assignList;
+    }
+
+    // We are going to copy each component of the right (per array element if indicated) to sequential
+    // array elements of the left.  This tracks the lhs element we're writing to as we go along.
+    // We may be starting in the middle - e.g, for a non-zero semantic ID calculated above.
+    int lhsArrayPos = semanticOffset[semanticId];
+
+    // Loop through every component of every element of the RHS, and copy to LHS elements in turn.
+    for (int rhsArrayPos = 0; rhsArrayPos < rhsArraySize; ++rhsArrayPos) {
+        for (int rhsComponent = 0; rhsComponent < rhsVectorSize; ++rhsComponent) {
+            // LHS array member to write to:
+            TIntermTyped* lhsMember = intermediate.addIndex(EOpIndexDirect, left,
+                                                            intermediate.addConstantUnion(lhsArrayPos++, loc), loc);
+
+            TIntermTyped* rhsMember = right;
+
+            // If right is an array, extract the element of interest
+            if (right->getType().isArray()) {
+                const TType derefType(rhsMember->getType(), 0);
+                rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember,
+                                                  intermediate.addConstantUnion(rhsArrayPos, loc), loc);
+                rhsMember->setType(derefType);
+            }
+
+            // If right is a vector, extract the component of interest.
+            if (right->getType().isVector()) {
+                const TType derefType(rhsMember->getType(), 0);
+                rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember,
+                                                  intermediate.addConstantUnion(rhsComponent, loc), loc);
+                rhsMember->setType(derefType);
+            }
+
+            // Assign: to the proper lhs member.
+            assignList = intermediate.growAggregate(assignList,
+                                                    intermediate.addAssign(op, lhsMember, rhsMember, loc));
+        }
+    }
+
+    assert(assignList != nullptr);
+    assignList->setOperator(EOpSequence);
+
+    return assignList;
+}
+
+// For a declaration with an initializer, where the initialized symbol is flattened,
+// and possibly contains opaque values, such that the initializer should never exist
+// as emitted code, because even creating the initializer would write opaques.
+//
+// Decompose this into individual member-wise assignments, which themselves are
+// expected to then not exist for opaque types, because they will turn into aliases.
+//
+// Return a node that contains the non-aliased assignments that must continue to exist.
+TIntermAggregate* HlslParseContext::executeFlattenedInitializer(const TSourceLoc& loc, TIntermSymbol* symbol,
+                                                                const TIntermAggregate& initializer)
+{
+    TIntermAggregate* initList = nullptr;
+    // synthesize an access to each member, and then an assignment to it
+    const TTypeList& typeList = *symbol->getType().getStruct();
+    for (int member = 0; member < (int)typeList.size(); ++member) {
+        TIntermTyped* memberInitializer = initializer.getSequence()[member]->getAsTyped();
+        TIntermTyped* flattenedMember = flattenAccess(symbol, member);
+        if (flattenedMember->getType().containsOpaque())
+            setOpaqueLvalue(flattenedMember, memberInitializer);
+        else
+            initList = intermediate.growAggregate(initList, handleAssign(loc, EOpAssign, flattenedMember,
+                                                  memberInitializer));
+    }
+
+    if (initList)
+        initList->setOperator(EOpSequence);
+    return initList;
+}
+
 // Some simple source assignments need to be flattened to a sequence
 // of AST assignments. Catch these and flatten, otherwise, pass through
 // to intermediate.addAssign().
 //
 // Also, assignment to matrix swizzles requires multiple component assignments,
 // intercept those as well.
-TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op, TIntermTyped* left, TIntermTyped* right)
+TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op, TIntermTyped* left,
+                                             TIntermTyped* right)
 {
     if (left == nullptr || right == nullptr)
         return nullptr;
@@ -2263,8 +2453,15 @@
 
     // OK to do a single assign if both are split, or both are unsplit.  But if one is and the other
     // isn't, we fall back to a member-wise copy.
-    if (! isFlattenLeft && ! isFlattenRight && !isSplitLeft && !isSplitRight)
+    if (!isFlattenLeft && !isFlattenRight && !isSplitLeft && !isSplitRight) {
+        // Clip and cull distance requires more processing.  See comment above assignClipCullDistance.
+        if (isClipOrCullDistance(left->getType())) {
+            const int semanticId = left->getType().getQualifier().layoutLocation;
+            return assignClipCullDistance(loc, op, semanticId, left, right);
+        }
+
         return intermediate.addAssign(op, left, right, loc);
+    }
 
     TIntermAggregate* assignList = nullptr;
     const TVector<TVariable*>* leftVariables = nullptr;
@@ -2272,7 +2469,7 @@
 
     // A temporary to store the right node's value, so we don't keep indirecting into it
     // if it's not a simple symbol.
-    TVariable*     rhsTempVar   = nullptr;
+    TVariable* rhsTempVar = nullptr;
 
     // If the RHS is a simple symbol node, we'll copy it for each member.
     TIntermSymbol* cloneSymNode = nullptr;
@@ -2309,14 +2506,15 @@
                 TIntermTyped* noFlattenRHS = intermediate.addSymbol(*rhsTempVar, loc);
 
                 // Add this to the aggregate being built.
-                assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, noFlattenRHS, right, loc), loc);
+                assignList = intermediate.growAggregate(assignList,
+                                                        intermediate.addAssign(op, noFlattenRHS, right, loc), loc);
             }
         }
     }
 
     int memberIdx = 0;
 
-    // When dealing with split arrayed structures of builtins, the arrayness is moved to the extracted builtin
+    // When dealing with split arrayed structures of built-ins, the arrayness is moved to the extracted built-in
     // variables, which is awkward when copying between split and unsplit structures.  This variable tracks
     // array indirections so they can be percolated from outer structs to inner variables.
     std::vector <int> arrayElement;
@@ -2325,39 +2523,41 @@
     const TIntermTyped* outerLeft  = left;
     const TIntermTyped* outerRight = right;
 
-    const auto getMember = [&](bool isLeft, TIntermTyped* node, int member, TIntermTyped* splitNode, int splitMember) -> TIntermTyped * {
+    const auto getMember = [&](bool isLeft, TIntermTyped* node, int member, TIntermTyped* splitNode, int splitMember)
+                           -> TIntermTyped * {
+        const bool flattened = isLeft ? isFlattenLeft : isFlattenRight;
+        const bool split     = isLeft ? isSplitLeft   : isSplitRight;
+
         TIntermTyped* subTree;
-
-        const bool flattened      = isLeft ? isFlattenLeft : isFlattenRight;
-        const bool split          = isLeft ? isSplitLeft : isSplitRight;
-        const TIntermTyped* outer = isLeft ? outerLeft   : outerRight;
-        const TVector<TVariable*>& flatVariables = isLeft ? *leftVariables : *rightVariables;
-
-        // Index operator if it's an aggregate, else EOpNull
-        const TOperator op = node->getType().isArray()  ? EOpIndexDirect : 
-                             node->getType().isStruct() ? EOpIndexDirectStruct : EOpNull;
-
         const TType derefType(node->getType(), member);
-
         if (split && derefType.isBuiltInInterstageIO(language)) {
-            // copy from interstage IO builtin if needed
-            subTree = intermediate.addSymbol(*interstageBuiltInIo.find(HlslParseContext::tInterstageIoData(derefType, outer->getType()))->second);
+            // copy from interstage IO built-in if needed
+            const TIntermTyped* outer = isLeft ? outerLeft : outerRight;
+            subTree = intermediate.addSymbol(*interstageBuiltInIo.find(
+                                             HlslParseContext::tInterstageIoData(derefType, outer->getType()))->second);
 
-            // Arrayness of builtIn symbols isn't handled by the normal recursion: it's been extracted and moved to the builtin.
+            // Arrayness of builtIn symbols isn't handled by the normal recursion:
+            // it's been extracted and moved to the built-in.
             if (subTree->getType().isArray() && !arrayElement.empty()) {
                 const TType splitDerefType(subTree->getType(), arrayElement.back());
-                subTree = intermediate.addIndex(EOpIndexDirect, subTree, intermediate.addConstantUnion(arrayElement.back(), loc), loc);
+                subTree = intermediate.addIndex(EOpIndexDirect, subTree,
+                                                intermediate.addConstantUnion(arrayElement.back(), loc), loc);
                 subTree->setType(splitDerefType);
             }
         } else if (flattened && isFinalFlattening(derefType)) {
+            const TVector<TVariable*>& flatVariables = isLeft ? *leftVariables : *rightVariables;
             subTree = intermediate.addSymbol(*flatVariables[memberIdx++]);
         } else {
-            if (op == EOpNull) {
+            // Index operator if it's an aggregate, else EOpNull
+            const TOperator accessOp = node->getType().isArray()  ? EOpIndexDirect
+                                     : node->getType().isStruct() ? EOpIndexDirectStruct
+                                     : EOpNull;
+            if (accessOp == EOpNull) {
                 subTree = splitNode;
             } else {
+                subTree = intermediate.addIndex(accessOp, splitNode, intermediate.addConstantUnion(splitMember, loc),
+                                                loc);
                 const TType splitDerefType(splitNode->getType(), splitMember);
-
-                subTree = intermediate.addIndex(op, splitNode, intermediate.addConstantUnion(splitMember, loc), loc);
                 subTree->setType(splitDerefType);
             }
         }
@@ -2367,8 +2567,8 @@
 
     // Use the proper RHS node: a new symbol from a TVariable, copy
     // of an TIntermSymbol node, or sometimes the right node directly.
-    right = rhsTempVar   ? intermediate.addSymbol(*rhsTempVar, loc) :
-            cloneSymNode ? intermediate.addSymbol(*cloneSymNode) :
+    right = rhsTempVar != nullptr   ? intermediate.addSymbol(*rhsTempVar, loc) :
+            cloneSymNode != nullptr ? intermediate.addSymbol(*cloneSymNode) :
             right;
 
     // Cannot use auto here, because this is recursive, and auto can't work out the type without seeing the
@@ -2379,7 +2579,7 @@
         // flattened, so have to do member-by-member assignment:
 
         if (left->getType().isArray() || right->getType().isArray()) {
-            const int elementsL = left->getType().isArray() ? left->getType().getOuterArraySize() : 1;
+            const int elementsL = left->getType().isArray()  ? left->getType().getOuterArraySize()  : 1;
             const int elementsR = right->getType().isArray() ? right->getType().getOuterArraySize() : 1;
 
             // The arrays may not be the same size, e.g, if the size has been forced for EbvTessLevelInner or Outer.
@@ -2393,8 +2593,10 @@
                 TIntermTyped* subLeft  = getMember(true,  left,  element, left, element);
                 TIntermTyped* subRight = getMember(false, right, element, right, element);
 
-                TIntermTyped* subSplitLeft =  isSplitLeft  ? getMember(true,  left,  element, splitLeft, element) : subLeft;
-                TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, element, splitRight, element) : subRight; 
+                TIntermTyped* subSplitLeft =  isSplitLeft  ? getMember(true,  left,  element, splitLeft, element)
+                                                           : subLeft;
+                TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, element, splitRight, element)
+                                                           : subRight;
 
                 traverse(subLeft, subRight, subSplitLeft, subSplitRight);
 
@@ -2422,17 +2624,39 @@
                 TIntermTyped* subRight = getMember(false, right, member, right, member);
 
                 // If there is no splitting, use the same values to avoid inefficiency.
-                TIntermTyped* subSplitLeft =  isSplitLeft  ? getMember(true,  left,  member, splitLeft, memberL) : subLeft;
-                TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR) : subRight;
+                TIntermTyped* subSplitLeft =  isSplitLeft  ? getMember(true,  left,  member, splitLeft, memberL)
+                                                           : subLeft;
+                TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR)
+                                                           : subRight;
 
-                // If this is the final flattening (no nested types below to flatten) we'll copy the member, else
-                // recurse into the type hierarchy.  However, if splitting the struct, that means we can copy a whole
-                // subtree here IFF it does not itself contain any interstage built-in IO variables, so we only have to
-                // recurse into it if there's something for splitting to do.  That can save a lot of AST verbosity for
-                // a bunch of memberwise copies.
-                if ((!isFlattenLeft && !isFlattenRight &&
-                     !typeL.containsBuiltInInterstageIO(language) && !typeR.containsBuiltInInterstageIO(language))) {
-                    assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), loc);
+                if (isClipOrCullDistance(subSplitLeft->getType())) {
+                    // Clip and cull distance built-in assignment is complex in its own right, and is handled in
+                    // a separate function dedicated to that task.  See comment above assignClipCullDistance;
+
+                    // Since all clip/cull semantics boil down to the same built-in type, we need to get the
+                    // semantic ID from the dereferenced type's layout location, to avoid an N-1 mapping.
+                    const TType derefType(left->getType(), member);
+                    const int semanticId = derefType.getQualifier().layoutLocation;
+
+                    TIntermAggregate* clipCullAssign = assignClipCullDistance(loc, op, semanticId,
+                                                                              subSplitLeft, subSplitRight);
+
+                    assignList = intermediate.growAggregate(assignList, clipCullAssign, loc);
+
+                } else if (!isFlattenLeft && !isFlattenRight &&
+                           !typeL.containsBuiltInInterstageIO(language) &&
+                           !typeR.containsBuiltInInterstageIO(language)) {
+                    // If this is the final flattening (no nested types below to flatten)
+                    // we'll copy the member, else recurse into the type hierarchy.
+                    // However, if splitting the struct, that means we can copy a whole
+                    // subtree here IFF it does not itself contain any interstage built-in
+                    // IO variables, so we only have to recurse into it if there's something
+                    // for splitting to do.  That can save a lot of AST verbosity for
+                    // a bunch of memberwise copies.
+
+                    assignList = intermediate.growAggregate(assignList,
+                                                            intermediate.addAssign(op, subSplitLeft, subSplitRight, loc),
+                                                            loc);
                 } else {
                     traverse(subLeft, subRight, subSplitLeft, subSplitRight);
                 }
@@ -2451,12 +2675,12 @@
     TIntermTyped* splitRight = right;
 
     // If either left or right was a split structure, we must read or write it, but still have to
-    // parallel-recurse through the unsplit structure to identify the builtin IO vars.
+    // parallel-recurse through the unsplit structure to identify the built-in IO vars.
     if (isSplitLeft)
-        splitLeft = intermediate.addSymbol(*getSplitIoVar(left), loc);
+        splitLeft = intermediate.addSymbol(*getSplitIoVar(left->getAsSymbolNode()->getId()), loc);
 
     if (isSplitRight)
-        splitRight = intermediate.addSymbol(*getSplitIoVar(right), loc);
+        splitRight = intermediate.addSymbol(*getSplitIoVar(right->getAsSymbolNode()->getId()), loc);
 
     // This makes the whole assignment, recursing through subtypes as needed.
     traverse(left, right, splitLeft, splitRight);
@@ -2470,7 +2694,8 @@
 // An assignment to matrix swizzle must be decomposed into individual assignments.
 // These must be selected component-wise from the RHS and stored component-wise
 // into the LHS.
-TIntermTyped* HlslParseContext::handleAssignToMatrixSwizzle(const TSourceLoc& loc, TOperator op, TIntermTyped* left, TIntermTyped* right)
+TIntermTyped* HlslParseContext::handleAssignToMatrixSwizzle(const TSourceLoc& loc, TOperator op, TIntermTyped* left,
+                                                            TIntermTyped* right)
 {
     assert(left->getAsOperator() && left->getAsOperator()->getOp() == EOpMatrixSwizzle);
 
@@ -2552,7 +2777,8 @@
 //
 // Create a combined sampler/texture from separate sampler and texture.
 //
-TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex, TIntermTyped* argSampler)
+TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex,
+                                                                TIntermTyped* argSampler)
 {
     TIntermAggregate* txcombine = new TIntermAggregate(EOpConstructTextureSampler);
 
@@ -2712,7 +2938,8 @@
                 
 
             if (isByteAddressBuffer)
-                argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true),
+                argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex,
+                                                      intermediate.addConstantUnion(2, loc, true),
                                                       loc, TType(EbtInt));
 
             // Index into the array to find the item being loaded.
@@ -2747,7 +2974,8 @@
             // First, we'll store the address in a variable to avoid multiple shifts
             // (we must convert the byte address to an item address)
             TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex,
-                                                                   intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt));
+                                                                   intermediate.addConstantUnion(2, loc, true),
+                                                                   loc, TType(EbtInt));
 
             TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary));
             TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc);
@@ -2763,10 +2991,12 @@
 
                 // add index offset
                 if (idx != 0)
-                    offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, intermediate.addConstantUnion(idx, loc, true),
+                    offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx,
+                                                           intermediate.addConstantUnion(idx, loc, true),
                                                            loc, TType(EbtInt));
 
-                const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
+                const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect
+                                                                                        : EOpIndexIndirect;
 
                 vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc));
             }
@@ -2825,7 +3055,8 @@
                 if (idx != 0)
                     offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, idxConst, loc, TType(EbtInt));
 
-                const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
+                const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect
+                                                                                        : EOpIndexIndirect;
 
                 TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc);
                 TIntermTyped* rValue = (size == 1) ? argValue :
@@ -2858,7 +3089,8 @@
                 body = intermediate.growAggregate(body, assign, loc);
             } else {
                 const int length = argArray->getType().getOuterArraySize();
-                TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, intermediate.addConstantUnion(length, loc, true), loc);
+                TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems,
+                                                              intermediate.addConstantUnion(length, loc, true), loc);
                 body = intermediate.growAggregate(body, assign, loc);
             }
 
@@ -2869,7 +3101,8 @@
                 intermediate.getBaseAlignment(argArray->getType(), size, stride, false,
                                               argArray->getType().getQualifier().layoutMatrix == ElmRowMajor);
 
-                TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride, intermediate.addConstantUnion(stride, loc, true), loc);
+                TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride,
+                                                              intermediate.addConstantUnion(stride, loc, true), loc);
 
                 body = intermediate.growAggregate(body, assign);
             }
@@ -2944,8 +3177,9 @@
         {
             TIntermTyped* oldCounter = incDecCounter(-1);
 
-            TIntermTyped* newCounter = intermediate.addBinaryNode(EOpAdd, oldCounter, intermediate.addConstantUnion(-1, loc, true), loc,
-                                                        oldCounter->getType());
+            TIntermTyped* newCounter = intermediate.addBinaryNode(EOpAdd, oldCounter,
+                                                                  intermediate.addConstantUnion(-1, loc, true), loc,
+                                                                  oldCounter->getType());
 
             node = intermediate.addIndex(EOpIndexIndirect, argArray, newCounter, loc);
 
@@ -3031,7 +3265,7 @@
 //
 void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
 {
-    if (!node || !node->getAsOperator())
+    if (node == nullptr || !node->getAsOperator())
         return;
 
     const auto clampReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* {
@@ -3773,7 +4007,7 @@
 //
 void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
 {
-    if (!node || !node->getAsOperator())
+    if (node == nullptr || !node->getAsOperator())
         return;
 
     const TOperator op  = node->getAsOperator()->getOp();
@@ -3901,6 +4135,28 @@
             break;
         }
 
+    case EOpAny: // fall through
+    case EOpAll:
+        {
+            TIntermTyped* typedArg = arguments->getAsTyped();
+
+            // HLSL allows float/etc types here, and the SPIR-V opcode requires a bool.
+            // We'll convert here.  Note that for efficiency, we could add a smarter
+            // decomposition for some type cases, e.g, maybe by decomposing a dot product.
+            if (typedArg->getType().getBasicType() != EbtBool) {
+                const TType boolType(EbtBool, EvqTemporary,
+                                     typedArg->getVectorSize(),
+                                     typedArg->getMatrixCols(),
+                                     typedArg->getMatrixRows(),
+                                     typedArg->isVector());
+
+                typedArg = intermediate.addConversion(EOpConstructBool, boolType, typedArg);
+                node->getAsUnaryNode()->setOperand(typedArg);
+            }
+
+            break;
+        }
+
     case EOpSaturate:
         {
             // saturate(a) -> clamp(a,0,1)
@@ -4361,7 +4617,8 @@
 
             TIntermAggregate* compoundStatement = intermediate.makeAggregate(tmpArgAssign, loc);
 
-            const TType boolType(EbtBool, EvqTemporary, arg0->getVectorSize(), arg0->getMatrixCols(), arg0->getMatrixRows());
+            const TType boolType(EbtBool, EvqTemporary, arg0->getVectorSize(), arg0->getMatrixCols(),
+                                 arg0->getMatrixRows());
 
             TIntermTyped* isnan = handleUnaryMath(loc, "isnan", EOpIsNan, intermediate.addSymbol(*tempArg, loc));
             isnan->setType(boolType);
@@ -4471,7 +4728,8 @@
 
             // Error check for a function requiring specific extensions present.
             if (builtIn && fnCandidate->getNumExtensions())
-                requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str());
+                requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(),
+                                  fnCandidate->getName().c_str());
 
             // turn an implicit member-function resolution into an explicit call
             TString callerName;
@@ -4501,7 +4759,8 @@
             op = fnCandidate->getBuiltInOp();
             if (builtIn && op != EOpNull) {
                 // A function call mapped to a built-in operation.
-                result = intermediate.addBuiltInFunctionCall(loc, op, fnCandidate->getParamCount() == 1, arguments, fnCandidate->getType());
+                result = intermediate.addBuiltInFunctionCall(loc, op, fnCandidate->getParamCount() == 1, arguments,
+                                                             fnCandidate->getType());
                 if (result == nullptr)  {
                     error(arguments->getLoc(), " wrong operand type", "Internal Error",
                         "built in unary operator function.  Type: %s",
@@ -4567,7 +4826,8 @@
     }
 
     // generic error recovery
-    // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to reduce cascades
+    // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to
+    //       reduce cascades
     if (result == nullptr)
         result = intermediate.addConstantUnion(0.0, EbtFloat, loc);
 
@@ -4630,7 +4890,7 @@
             else
                 error(arg->getLoc(), "cannot convert input argument, argument", "", "%d", param);
         } else {
-            if (wasFlattened(arg) || wasSplit(arg)) {
+            if (wasFlattened(arg)) {
                 // If both formal and calling arg are to be flattened, leave that to argument
                 // expansion, not conversion.
                 if (!shouldFlatten(*function[param].type)) {
@@ -4645,7 +4905,8 @@
                                                                           internalAggregate->getType());
                     internalSymbolNode->setLoc(arg->getLoc());
                     // This makes the deepest level, the member-wise copy
-                    TIntermAggregate* assignAgg = handleAssign(arg->getLoc(), EOpAssign, internalSymbolNode, arg)->getAsAggregate();
+                    TIntermAggregate* assignAgg = handleAssign(arg->getLoc(), EOpAssign,
+                                                               internalSymbolNode, arg)->getAsAggregate();
 
                     // Now, pair that with the resulting aggregate.
                     assignAgg = intermediate.growAggregate(assignAgg, internalSymbolNode, arg->getLoc());
@@ -4712,11 +4973,8 @@
         if (wasFlattened(arg) && shouldFlatten(*function[param].type)) {
             // Need to pass the structure members instead of the structure.
             TVector<TIntermTyped*> memberArgs;
-            for (int memb = 0; memb < (int)arg->getType().getStruct()->size(); ++memb) {
-                initFlattening();
+            for (int memb = 0; memb < (int)arg->getType().getStruct()->size(); ++memb)
                 memberArgs.push_back(flattenAccess(arg, memb));
-                finalizeFlattening();
-            }
             setArgList(param + functionParamNumberOffset, memberArgs);
         }
     }
@@ -4802,7 +5060,8 @@
             TIntermSymbol* tempArgNode = intermediate.addSymbol(*tempArg, loc);
 
             // This makes the deepest level, the member-wise copy
-            TIntermTyped* tempAssign = handleAssign(arguments[i]->getLoc(), EOpAssign, arguments[i]->getAsTyped(), tempArgNode);
+            TIntermTyped* tempAssign = handleAssign(arguments[i]->getLoc(), EOpAssign, arguments[i]->getAsTyped(),
+                                                    tempArgNode);
             tempAssign = handleLvalue(arguments[i]->getLoc(), "assign", tempAssign);
             conversionTree = intermediate.growAggregate(conversionTree, tempAssign, arguments[i]->getLoc());
 
@@ -4912,7 +5171,8 @@
         case EOpTextureGather:
             // More than two arguments needs gpu_shader5, and rectangular or shadow needs gpu_shader5,
             // otherwise, need GL_ARB_texture_gather.
-            if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect || fnCandidate[0].type->getSampler().shadow) {
+            if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect ||
+                fnCandidate[0].type->getSampler().shadow) {
                 if (! fnCandidate[0].type->getSampler().shadow)
                     compArg = 2;
             }
@@ -4967,14 +5227,15 @@
         }
 
         if (arg > 0) {
-            if (! aggArgs[arg]->getAsConstantUnion())
+            if (aggArgs[arg]->getAsConstantUnion() == nullptr)
                 error(loc, "argument must be compile-time constant", "texel offset", "");
             else {
                 const TType& type = aggArgs[arg]->getAsTyped()->getType();
                 for (int c = 0; c < type.getVectorSize(); ++c) {
                     int offset = aggArgs[arg]->getAsConstantUnion()->getConstArray()[c].getIConst();
                     if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset)
-                        error(loc, "value is out of range:", "texel offset", "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]");
+                        error(loc, "value is out of range:", "texel offset",
+                              "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]");
                 }
             }
         }
@@ -5010,7 +5271,8 @@
             // desktop 4.4 and later: swizzles may be used
             const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true);
             if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn)
-                error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), "");
+                error(loc, "first argument must be an interpolant, or interpolant-array element",
+                      fnCandidate.getName().c_str(), "");
         }
         break;
 
@@ -5044,16 +5306,49 @@
 // Handle seeing a "COLON semantic" at the end of a type declaration,
 // by updating the type according to the semantic.
 //
-void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn, const TString& upperCase)
+void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn,
+                                      const TString& upperCase)
 {
-    // adjust for stage in/out
+    // Parse and return semantic number.  If limit is 0, it will be ignored.  Otherwise, if the parsed
+    // semantic number is >= limit, errorMsg is issued and 0 is returned.
+    // TODO: it would be nicer if limit and errorMsg had default parameters, but some compilers don't yet
+    // accept those in lambda functions.
+    const auto getSemanticNumber = [this, loc](const TString& semantic, unsigned int limit, const char* errorMsg) -> unsigned int {
+        size_t pos = semantic.find_last_not_of("0123456789");
+        if (pos == std::string::npos)
+            return 0u;
+
+        unsigned int semanticNum = (unsigned int)atoi(semantic.c_str() + pos + 1);
+
+        if (limit != 0 && semanticNum >= limit) {
+            error(loc, errorMsg, semantic.c_str(), "");
+            return 0u;
+        }
+
+        return semanticNum;
+    };
 
     switch(builtIn) {
+    case EbvNone:
+        // Get location numbers from fragment outputs, instead of
+        // auto-assigning them.
+        if (language == EShLangFragment && upperCase.compare(0, 9, "SV_TARGET") == 0) {
+            qualifier.layoutLocation = getSemanticNumber(upperCase, 0, nullptr);
+            nextOutLocation = std::max(nextOutLocation, qualifier.layoutLocation + 1u);
+        } else if (upperCase.compare(0, 15, "SV_CLIPDISTANCE") == 0) {
+            builtIn = EbvClipDistance;
+            qualifier.layoutLocation = getSemanticNumber(upperCase, maxClipCullRegs, "invalid clip semantic");
+        } else if (upperCase.compare(0, 15, "SV_CULLDISTANCE") == 0) {
+            builtIn = EbvCullDistance;
+            qualifier.layoutLocation = getSemanticNumber(upperCase, maxClipCullRegs, "invalid cull semantic");
+        }
+        break;
     case EbvPosition:
+        // adjust for stage in/out
         if (language == EShLangFragment)
             builtIn = EbvFragCoord;
         break;
-    case EbvStencilRef:
+    case EbvFragStencilRef:
         error(loc, "unimplemented; need ARB_shader_stencil_export", "SV_STENCILREF", "");
         break;
     case EbvTessLevelInner:
@@ -5136,7 +5431,7 @@
     }
 
     // TODO: learn what all these really mean and how they interact with regNumber and subComponent
-    std::vector<std::string> resourceInfo = intermediate.getResourceSetBinding();
+    const std::vector<std::string>& resourceInfo = intermediate.getResourceSetBinding();
     switch (std::tolower(desc[0])) {
     case 'b':
     case 't':
@@ -5144,11 +5439,17 @@
     case 's':
     case 'u':
         qualifier.layoutBinding = regNumber + subComponent;
-        for (auto it = resourceInfo.cbegin(); it != resourceInfo.cend(); it = it + 3) {
-            if (strcmp(desc.c_str(), it[0].c_str()) == 0) {
-                qualifier.layoutSet = atoi(it[1].c_str());
-                qualifier.layoutBinding = atoi(it[2].c_str()) + subComponent;
-                break;
+
+        // This handles per-register layout sets numbers.  For the global mode which sets
+        // every symbol to the same value, see setLinkageLayoutSets().
+        if ((resourceInfo.size() % 3) == 0) {
+            // Apply per-symbol resource set and binding.
+            for (auto it = resourceInfo.cbegin(); it != resourceInfo.cend(); it = it + 3) {
+                if (strcmp(desc.c_str(), it[0].c_str()) == 0) {
+                    qualifier.layoutSet = atoi(it[1].c_str());
+                    qualifier.layoutBinding = atoi(it[2].c_str()) + subComponent;
+                    break;
+                }
             }
         }
         break;
@@ -5182,14 +5483,16 @@
 
 // Convert to a scalar boolean, or if not allowed by HLSL semantics,
 // report an error and return nullptr.
-TIntermTyped* HlslParseContext::convertConditionalExpression(const TSourceLoc& loc, TIntermTyped* condition, bool mustBeScalar)
+TIntermTyped* HlslParseContext::convertConditionalExpression(const TSourceLoc& loc, TIntermTyped* condition,
+                                                             bool mustBeScalar)
 {
     if (mustBeScalar && !condition->getType().isScalarOrVec1()) {
         error(loc, "requires a scalar", "conditional expression", "");
         return nullptr;
     }
 
-    return intermediate.addConversion(EOpConstructBool, TType(EbtBool, EvqTemporary, condition->getVectorSize()), condition);
+    return intermediate.addConversion(EOpConstructBool, TType(EbtBool, EvqTemporary, condition->getVectorSize()),
+                                      condition);
 }
 
 //
@@ -5401,7 +5704,8 @@
         if (type.isImplicitlySizedArray()) {
             // auto adapt the constructor type to the number of arguments
             type.changeOuterArraySize(function.getParamCount());
-        } else if (type.getOuterArraySize() != function.getParamCount()) {
+        } else if (type.getOuterArraySize() != function.getParamCount() &&
+                   type.computeNumComponents() > size) {
             error(loc, "array constructor needs one argument per array element", "constructor", "");
             return true;
         }
@@ -5413,7 +5717,8 @@
             TArraySizes& arraySizes = type.getArraySizes();
 
             // At least the dimensionalities have to match.
-            if (! function[0].type->isArray() || arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) {
+            if (! function[0].type->isArray() ||
+                arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) {
                 error(loc, "array constructor argument not correct type to construct array element", "constructor", "");
                 return true;
             }
@@ -5430,6 +5735,12 @@
         }
     }
 
+    // Some array -> array type casts are okay
+    if (arrayArg && function.getParamCount() == 1 && op != EOpConstructStruct && type.isArray() &&
+        !type.isArrayOfArrays() && !function[0].type->isArrayOfArrays() &&
+        type.getVectorSize() >= 1 && function[0].type->getVectorSize() >= 1)
+        return false;
+
     if (arrayArg && op != EOpConstructStruct && ! type.isArrayOfArrays()) {
         error(loc, "constructing non-array constituent from array argument", "constructor", "");
         return true;
@@ -5531,7 +5842,8 @@
         return true;
     }
     if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) {
-        error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", token, "");
+        error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow",
+              token, "");
         return true;
     }
 
@@ -5621,7 +5933,8 @@
     int shadowIndex = sampler.shadow ? 1 : 0;
     int externalIndex = sampler.external ? 1 : 0;
 
-    return EsdNumDims * (EbtNumTypes * (2 * (2 * arrayIndex + shadowIndex) + externalIndex) + sampler.type) + sampler.dim;
+    return EsdNumDims *
+           (EbtNumTypes * (2 * (2 * arrayIndex + shadowIndex) + externalIndex) + sampler.type) + sampler.dim;
 }
 
 //
@@ -5697,9 +6010,10 @@
 // Do all the semantic checking for declaring or redeclaring an array, with and
 // without a size, and make the right changes to the symbol table.
 //
-void HlslParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type, TSymbol*& symbol, bool track)
+void HlslParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type,
+                                    TSymbol*& symbol, bool track)
 {
-    if (! symbol) {
+    if (symbol == nullptr) {
         bool currentScope;
         symbol = symbolTable.find(identifier, nullptr, &currentScope);
 
@@ -5730,7 +6044,7 @@
     // Process a redeclaration.
     //
 
-    if (! symbol) {
+    if (symbol == nullptr) {
         error(loc, "array variable name expected", identifier.c_str(), "");
         return;
     }
@@ -5739,7 +6053,8 @@
     TType& existingType = symbol->getWritableType();
 
     if (existingType.isExplicitlySizedArray()) {
-        // be more lenient for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size
+        // be more lenient for input arrays to geometry shaders and tessellation control outputs,
+        // where the redeclaration is the same size
         return;
     }
 
@@ -5795,7 +6110,8 @@
 //
 // Enforce non-initializer type/qualifier rules.
 //
-void HlslParseContext::fixConstInit(const TSourceLoc& loc, const TString& identifier, TType& type, TIntermTyped*& initializer)
+void HlslParseContext::fixConstInit(const TSourceLoc& loc, const TString& identifier, TType& type,
+                                    TIntermTyped*& initializer)
 {
     //
     // Make the qualifier make sense, given that there is an initializer.
@@ -5833,7 +6149,8 @@
 // Either redeclare the requested block, or give an error message why it can't be done.
 //
 // TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size
-void HlslParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes)
+void HlslParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName,
+                                             const TString* instanceName, TArraySizes* arraySizes)
 {
     // Redeclaring a built-in block...
 
@@ -5849,7 +6166,7 @@
     // If the block was not found, this must be a version/profile/stage
     // that doesn't have it, or the instance name is wrong.
     const char* errorName = instanceName ? instanceName->c_str() : newTypeList.front().type->getFieldName().c_str();
-    if (! block) {
+    if (block == nullptr) {
         error(loc, "no declaration found for redeclaration", errorName, "");
         return;
     }
@@ -5896,17 +6213,23 @@
             TType& oldType = *member->type;
             const TType& newType = *newMember->type;
             if (! newType.sameElementType(oldType))
-                error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot redeclare block member with a different type",
+                      member->type->getFieldName().c_str(), "");
             if (oldType.isArray() != newType.isArray())
-                error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot change arrayness of redeclared block member",
+                      member->type->getFieldName().c_str(), "");
             else if (! oldType.sameArrayness(newType) && oldType.isExplicitlySizedArray())
-                error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot change array size of redeclared block member",
+                      member->type->getFieldName().c_str(), "");
             if (newType.getQualifier().isMemory())
-                error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot add memory qualifier to redeclared block member",
+                      member->type->getFieldName().c_str(), "");
             if (newType.getQualifier().hasLayout())
-                error(memberLoc, "cannot add layout to redeclared block member", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot add layout to redeclared block member",
+                      member->type->getFieldName().c_str(), "");
             if (newType.getQualifier().patch)
-                error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), "");
+                error(memberLoc, "cannot add patch to redeclared block member",
+                      member->type->getFieldName().c_str(), "");
             oldType.getQualifier().centroid = newType.getQualifier().centroid;
             oldType.getQualifier().sample = newType.getQualifier().sample;
             oldType.getQualifier().invariant = newType.getQualifier().invariant;
@@ -6234,7 +6557,8 @@
 
 // Put the id's layout qualifier value into the public type, for qualifiers having a number set.
 // This is before we know any type information for error checking.
-void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qualifier, TString& id, const TIntermTyped* node)
+void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qualifier, TString& id,
+                                          const TIntermTyped* node)
 {
     const char* feature = "layout-id value";
     // const char* nonLiteralFeature = "non-literal layout-id value";
@@ -6292,7 +6616,8 @@
             // "It is a compile-time error to specify an *xfb_buffer* that is greater than
             // the implementation-dependent constant gl_MaxTransformFeedbackBuffers."
             if (value >= resources.maxTransformFeedbackBuffers)
-                error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", resources.maxTransformFeedbackBuffers);
+                error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d",
+                      resources.maxTransformFeedbackBuffers);
             if (value >= (int)TQualifier::layoutXfbBufferEnd)
                 error(loc, "buffer is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbBufferEnd - 1);
             else
@@ -6308,7 +6633,8 @@
             // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the
             // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents."
             if (value > 4 * resources.maxTransformFeedbackInterleavedComponents)
-                error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", resources.maxTransformFeedbackInterleavedComponents);
+                error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d",
+                      resources.maxTransformFeedbackInterleavedComponents);
             else if (value >= (int)TQualifier::layoutXfbStrideEnd)
                 error(loc, "stride is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbStrideEnd - 1);
             if (value < (int)TQualifier::layoutXfbStrideEnd)
@@ -6609,6 +6935,7 @@
         // shapes have to be convertible
         if ((from.isScalarOrVec1() && to.isScalarOrVec1()) ||
             (from.isScalarOrVec1() && to.isVector())    ||
+            (from.isScalarOrVec1() && to.isMatrix())    ||
             (from.isVector() && to.isVector() && from.getVectorSize() >= to.getVectorSize()))
             return true;
 
@@ -6699,7 +7026,7 @@
         return nullptr;
     }
 
-    // For builtins, we can convert across the arguments.  This will happen in several steps:
+    // For built-ins, we can convert across the arguments.  This will happen in several steps:
     // Step 1:  If there's an exact match, use it.
     // Step 2a: Otherwise, get the operator from the best match and promote arguments:
     // Step 2b: reconstruct the TFunction based on the new arg types
@@ -6918,11 +7245,27 @@
 // 'parseType' is the type part of the declaration (to the left)
 // 'arraySizes' is the arrayness tagged on the identifier (to the right)
 //
-TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TString& identifier, TType& type, TIntermTyped* initializer)
+TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TString& identifier, TType& type,
+                                               TIntermTyped* initializer)
 {
     if (voidErrorCheck(loc, identifier, type.getBasicType()))
         return nullptr;
 
+    // Global consts with initializers that are non-const act like EvqGlobal in HLSL.
+    // This test is implicitly recursive, because initializers propagate constness
+    // up the aggregate node tree during creation.  E.g, for:
+    //    { { 1, 2 }, { 3, 4 } }
+    // the initializer list is marked EvqConst at the top node, and remains so here.  However:
+    //    { 1, { myvar, 2 }, 3 }
+    // is not a const intializer, and still becomes EvqGlobal here.
+
+    const bool nonConstInitializer = (initializer != nullptr && initializer->getQualifier().storage != EvqConst);
+
+    if (type.getQualifier().storage == EvqConst && symbolTable.atGlobalLevel() && nonConstInitializer) {
+        // Force to global
+        type.getQualifier().storage = EvqGlobal;
+    }
+
     // make const and initialization consistent
     fixConstInit(loc, identifier, type, initializer);
 
@@ -6959,33 +7302,28 @@
         declareArray(loc, identifier, type, symbol, !flattenVar);
     } else {
         // non-array case
-        if (! symbol)
+        if (symbol == nullptr)
             symbol = declareNonArray(loc, identifier, type, !flattenVar);
         else if (type != symbol->getType())
             error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str());
     }
 
-    if (flattenVar)
-        flatten(loc, *symbol->getAsVariable());
+    if (symbol == nullptr)
+        return nullptr;
 
-    if (! symbol)
+    if (flattenVar)
+        flatten(*symbol->getAsVariable());
+
+    if (initializer == nullptr)
         return nullptr;
 
     // Deal with initializer
-    TIntermNode* initNode = nullptr;
-    if (symbol && initializer) {
-        if (flattenVar)
-            error(loc, "flattened array with initializer list unsupported", identifier.c_str(), "");
-
-        TVariable* variable = symbol->getAsVariable();
-        if (! variable) {
-            error(loc, "initializer requires a variable, not a member", identifier.c_str(), "");
-            return nullptr;
-        }
-        initNode = executeInitializer(loc, initializer, variable);
+    TVariable* variable = symbol->getAsVariable();
+    if (variable == nullptr) {
+        error(loc, "initializer requires a variable, not a member", identifier.c_str(), "");
+        return nullptr;
     }
-
-    return initNode;
+    return executeInitializer(loc, initializer, variable, flattenVar);
 }
 
 // Pick up global defaults from the provide global defaults into dst.
@@ -7015,7 +7353,8 @@
 }
 
 // Make a symbol node holding a new internal temporary variable.
-TIntermSymbol* HlslParseContext::makeInternalVariableNode(const TSourceLoc& loc, const char* name, const TType& type) const
+TIntermSymbol* HlslParseContext::makeInternalVariableNode(const TSourceLoc& loc, const char* name,
+                                                          const TType& type) const
 {
     TVariable* tmpVar = makeInternalVariable(name, type);
     tmpVar->getWritableType().getQualifier().makeTemporary();
@@ -7029,7 +7368,8 @@
 //
 // Return the successfully declared variable.
 //
-TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TString& identifier, const TType& type, bool track)
+TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TString& identifier, const TType& type,
+                                             bool track)
 {
     // make a new variable
     TVariable* variable = new TVariable(&identifier, type);
@@ -7051,7 +7391,8 @@
 // Returning nullptr just means there is no code to execute to handle the
 // initializer, which will, for example, be the case for constant initializers.
 //
-TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable)
+TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable,
+                                                  bool flattened)
 {
     //
     // Identifier must be of type constant, a global, or a temporary, and
@@ -7074,7 +7415,7 @@
     skeletalType.getQualifier().makeTemporary();
     if (initializer->getAsAggregate() && initializer->getAsAggregate()->getOp() == EOpNull)
         initializer = convertInitializerList(loc, skeletalType, initializer, nullptr);
-    if (! initializer) {
+    if (initializer == nullptr) {
         // error recovery; don't leave const without constant values
         if (qualifier == EvqConst)
             variable->getWritableType().getQualifier().storage = EvqTemporary;
@@ -7103,11 +7444,6 @@
         variable->getWritableType().getQualifier().storage = EvqTemporary;
         return nullptr;
     }
-    if (qualifier == EvqConst && symbolTable.atGlobalLevel() && initializer->getType().getQualifier().storage != EvqConst) {
-        error(loc, "global const initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str());
-        variable->getWritableType().getQualifier().storage = EvqTemporary;
-        return nullptr;
-    }
 
     // Const variables require a constant initializer
     if (qualifier == EvqConst) {
@@ -7136,11 +7472,20 @@
         // normal assigning of a value to a variable...
         specializationCheck(loc, initializer->getType(), "initializer");
         TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc);
-        TIntermNode* initNode = handleAssign(loc, EOpAssign, intermSymbol, initializer);
-        if (! initNode)
-            assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString());
 
-        return initNode;
+        // If we are flattening, it could be due to setting opaques, which must be handled
+        // as aliases, and the 'initializer' node cannot actually be emitted, because it
+        // itself stores the result of the constructor, and we can't store to opaques.
+        // handleAssign() will emit the initializer.
+        TIntermNode* initNode = nullptr;
+        if (flattened && intermSymbol->getType().containsOpaque())
+            return executeFlattenedInitializer(loc, intermSymbol, *initializer->getAsAggregate());
+        else {
+            initNode = handleAssign(loc, EOpAssign, intermSymbol, initializer);
+            if (initNode == nullptr)
+                assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString());
+            return initNode;
+        }
     }
 
     return nullptr;
@@ -7167,7 +7512,7 @@
 
     // see if we have bottomed out in the tree within the initializer-list part
     TIntermAggregate* initList = initializer->getAsAggregate();
-    if (! initList || initList->getOp() != EOpNull) {
+    if (initList == nullptr || initList->getOp() != EOpNull) {
         // We don't have a list, but if it's a scalar and the 'type' is a
         // composite, we need to lengthen below to make it useful.
         // Otherwise, this is an already formed object to initialize with.
@@ -7210,7 +7555,8 @@
         // recursively process each element
         TType elementType(arrayType, 0); // dereferenced type
         for (int i = 0; i < arrayType.getOuterArraySize(); ++i) {
-            initList->getSequence()[i] = convertInitializerList(loc, elementType, initList->getSequence()[i]->getAsTyped(), scalarInit);
+            initList->getSequence()[i] = convertInitializerList(loc, elementType,
+                                                                initList->getSequence()[i]->getAsTyped(), scalarInit);
             if (initList->getSequence()[i] == nullptr)
                 return nullptr;
         }
@@ -7225,7 +7571,8 @@
             return nullptr;
         }
         for (size_t i = 0; i < type.getStruct()->size(); ++i) {
-            initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type, initList->getSequence()[i]->getAsTyped(), scalarInit);
+            initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type,
+                                                                initList->getSequence()[i]->getAsTyped(), scalarInit);
             if (initList->getSequence()[i] == nullptr)
                 return nullptr;
         }
@@ -7244,7 +7591,8 @@
             }
             TType vectorType(type, 0); // dereferenced type
             for (int i = 0; i < type.getMatrixCols(); ++i) {
-                initList->getSequence()[i] = convertInitializerList(loc, vectorType, initList->getSequence()[i]->getAsTyped(), scalarInit);
+                initList->getSequence()[i] = convertInitializerList(loc, vectorType,
+                                                                    initList->getSequence()[i]->getAsTyped(), scalarInit);
                 if (initList->getSequence()[i] == nullptr)
                     return nullptr;
             }
@@ -7255,7 +7603,8 @@
 
         // error check; we're at bottom, so work is finished below
         if (type.getVectorSize() != (int)initList->getSequence().size()) {
-            error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString().c_str());
+            error(loc, "wrong vector size (or rows in a matrix column):", "initializer list",
+                  type.getCompleteString().c_str());
             return nullptr;
         }
     } else if (type.isScalar()) {
@@ -7336,17 +7685,20 @@
 
 // Add a constructor, either from the grammar, or other programmatic reasons.
 //
+// 'node' is what to construct from.
+// 'type' is what type to construct.
+//
+// Returns the constructed object.
 // Return nullptr if it can't be done.
 //
 TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
 {
-    TIntermAggregate* aggrNode = node->getAsAggregate();
     TOperator op = intermediate.mapTypeToConstructorOp(type);
 
     // Combined texture-sampler constructors are completely semantic checked
     // in constructorTextureSamplerError()
     if (op == EOpConstructTextureSampler)
-        return intermediate.setAggregateOperator(aggrNode, op, type, loc);
+        return intermediate.setAggregateOperator(node->getAsAggregate(), op, type, loc);
 
     TTypeList::const_iterator memberTypes;
     if (op == EOpConstructStruct)
@@ -7360,7 +7712,8 @@
         elementType.shallowCopy(type);
 
     bool singleArg;
-    if (aggrNode) {
+    TIntermAggregate* aggrNode = node->getAsAggregate();
+    if (aggrNode != nullptr) {
         if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
             singleArg = true;
         else
@@ -7370,14 +7723,27 @@
 
     TIntermTyped *newNode;
     if (singleArg) {
+        // Handle array -> array conversion
+        // Constructing an array of one type from an array of another type is allowed,
+        // assuming there are enough components available (semantic-checked earlier).
+        if (type.isArray() && node->isArray())
+            newNode = convertArray(node, type);
+
         // If structure constructor or array constructor is being called
         // for only one parameter inside the structure, we need to call constructAggregate function once.
-        if (type.isArray())
+        else if (type.isArray())
             newNode = constructAggregate(node, elementType, 1, node->getLoc());
         else if (op == EOpConstructStruct)
             newNode = constructAggregate(node, *(*memberTypes).type, 1, node->getLoc());
-        else
+        else {
+            // shape conversion for matrix constructor from scalar.  HLSL semantics are: scalar
+            // is replicated into every element of the matrix (not just the diagnonal), so
+            // that is handled specially here.
+            if (type.isMatrix() && node->getType().isScalarOrVec1())
+                node = intermediate.addShapeConversion(type, node);
+
             newNode = constructBuiltIn(type, op, node, node->getLoc(), false);
+        }
 
         if (newNode && (type.isArray() || op == EOpConstructStruct))
             newNode = intermediate.setAggregateOperator(newNode, EOpConstructStruct, type, loc);
@@ -7425,7 +7791,8 @@
 //
 // Returns nullptr for an error or the constructed node.
 //
-TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, bool subset)
+TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node,
+                                                 const TSourceLoc& loc, bool subset)
 {
     TIntermTyped* newNode;
     TOperator basicOp;
@@ -7537,15 +7904,88 @@
     return intermediate.setAggregateOperator(newNode, op, type, loc);
 }
 
+// Convert the array in node to the requested type, which is also an array.
+// Returns nullptr on failure, otherwise returns aggregate holding the list of
+// elements needed to construct the array.
+TIntermTyped* HlslParseContext::convertArray(TIntermTyped* node, const TType& type)
+{
+    assert(node->isArray() && type.isArray());
+    if (node->getType().computeNumComponents() < type.computeNumComponents())
+        return nullptr;
+
+    // TODO: write an argument replicator, for the case the argument should not be
+    // executed multiple times, yet multiple copies are needed.
+
+    TIntermTyped* constructee = node->getAsTyped();
+    // track where we are in consuming the argument
+    int constructeeElement = 0;
+    int constructeeComponent = 0;
+
+    // bump up to the next component to consume
+    const auto getNextComponent = [&]() {
+        TIntermTyped* component;
+        component = handleBracketDereference(node->getLoc(), constructee, 
+                                             intermediate.addConstantUnion(constructeeElement, node->getLoc()));
+        if (component->isVector())
+            component = handleBracketDereference(node->getLoc(), component,
+                                                 intermediate.addConstantUnion(constructeeComponent, node->getLoc()));
+        // bump component pointer up
+        ++constructeeComponent;
+        if (constructeeComponent == constructee->getVectorSize()) {
+            constructeeComponent = 0;
+            ++constructeeElement;
+        }
+        return component;
+    };
+
+    // make one subnode per constructed array element
+    TIntermAggregate* constructor = nullptr;
+    TType derefType(type, 0);
+    TType speculativeComponentType(derefType, 0);
+    TType* componentType = derefType.isVector() ? &speculativeComponentType : &derefType;
+    TOperator componentOp = intermediate.mapTypeToConstructorOp(*componentType);
+    TType crossType(node->getBasicType(), EvqTemporary, type.getVectorSize());
+    for (int e = 0; e < type.getOuterArraySize(); ++e) {
+        // construct an element
+        TIntermTyped* elementArg;
+        if (type.getVectorSize() == constructee->getVectorSize()) {
+            // same element shape
+            elementArg = handleBracketDereference(node->getLoc(), constructee,
+                                                  intermediate.addConstantUnion(e, node->getLoc()));
+        } else {
+            // mismatched element shapes
+            if (type.getVectorSize() == 1)
+                elementArg = getNextComponent();
+            else {
+                // make a vector
+                TIntermAggregate* elementConstructee = nullptr;
+                for (int c = 0; c < type.getVectorSize(); ++c)
+                    elementConstructee = intermediate.growAggregate(elementConstructee, getNextComponent());
+                elementArg = addConstructor(node->getLoc(), elementConstructee, crossType);
+            }
+        }
+        // convert basic types
+        elementArg = intermediate.addConversion(componentOp, derefType, elementArg);
+        if (elementArg == nullptr)
+            return nullptr;
+        // combine with top-level constructor
+        constructor = intermediate.growAggregate(constructor, elementArg);
+    }
+
+    return constructor;
+}
+
 // This function tests for the type of the parameters to the structure or array constructor. Raises
 // an error message if the expected type does not match the parameter passed to the constructor.
 //
 // Returns nullptr for an error or the input node itself if the expected and the given parameter types match.
 //
-TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, const TSourceLoc& loc)
+TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount,
+                                                   const TSourceLoc& loc)
 {
+    // Handle cases that map more 1:1 between constructor arguments and constructed.
     TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped());
-    if (! converted || converted->getType() != type) {
+    if (converted == nullptr || converted->getType() != type) {
         error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount,
             node->getAsTyped()->getType().getCompleteString().c_str(), type.getCompleteString().c_str());
 
@@ -7698,13 +8138,14 @@
 
     // Add the variable, as anonymous or named instanceName.
     // Make an anonymous variable if no name was provided.
-    if (! instanceName)
+    if (instanceName == nullptr)
         instanceName = NewPoolTString("");
 
     TVariable& variable = *new TVariable(instanceName, blockType);
     if (! symbolTable.insert(variable)) {
         if (*instanceName == "")
-            error(loc, "nameless block contains a member that already has a name at global scope", "" /* blockName->c_str() */, "");
+            error(loc, "nameless block contains a member that already has a name at global scope",
+                  "" /* blockName->c_str() */, "");
         else
             error(loc, "block instance name redefinition", variable.getName().c_str(), "");
 
@@ -7752,7 +8193,8 @@
                     memberQualifier.layoutLocation = nextLocation;
                     memberQualifier.layoutComponent = 0;
                 }
-                nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type);
+                nextLocation = memberQualifier.layoutLocation +
+                               intermediate.computeTypeLocationSize(*typeList[member].type);
             }
         }
     }
@@ -7815,8 +8257,9 @@
         int dummyStride;
         int memberAlignment = intermediate.getBaseAlignment(*typeList[member].type, memberSize, dummyStride,
                                                             qualifier.layoutPacking == ElpStd140,
-                                                            subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor
-                                                                                       : qualifier.layoutMatrix == ElmRowMajor);
+                                                            subMatrixLayout != ElmNone
+                                                                ? subMatrixLayout == ElmRowMajor
+                                                                : qualifier.layoutMatrix == ElmRowMajor);
         if (memberQualifier.hasOffset()) {
             // "The specified offset must be a multiple
             // of the base alignment of the type of the block member it qualifies, or a compile-time error results."
@@ -7848,7 +8291,7 @@
 void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, const TString& identifier)
 {
     TSymbol* symbol = symbolTable.find(identifier);
-    if (! symbol) {
+    if (symbol == nullptr) {
         error(loc, "identifier not previously declared", identifier.c_str(), "");
         return;
     }
@@ -7942,6 +8385,19 @@
 }
 
 //
+// Selection hints
+//
+TSelectionControl HlslParseContext::handleSelectionControl(const TAttributeMap& attributes) const
+{
+    if (attributes.contains(EatFlatten))
+        return ESelectionControlFlatten;
+    else if (attributes.contains(EatBranch))
+        return ESelectionControlDontFlatten;
+    else
+        return ESelectionControlNone;
+}
+
+//
 // Loop hints
 //
 TLoopControl HlslParseContext::handleLoopControl(const TAttributeMap& attributes) const
@@ -7954,7 +8410,6 @@
         return ELoopControlNone;
 }
 
-
 //
 // Updating default qualifier for the case of a declaration with just a qualifier,
 // no type, block, or identifier.
@@ -7981,12 +8436,14 @@
             case ElgIsolines:
                 break;
             default:
-                error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), "");
+                error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry),
+                      "");
             }
         } else if (publicType.qualifier.storage == EvqVaryingOut) {
             handleOutputGeometry(loc, publicType.shaderQualifiers.geometry);
         } else
-            error(loc, "cannot apply to:", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), GetStorageQualifierString(publicType.qualifier.storage));
+            error(loc, "cannot apply to:", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry),
+                  GetStorageQualifierString(publicType.qualifier.storage));
     }
     if (publicType.shaderQualifiers.spacing != EvsNone)
         intermediate.setVertexSpacing(publicType.shaderQualifiers.spacing);
@@ -8044,7 +8501,8 @@
             globalOutputDefaults.layoutXfbBuffer = qualifier.layoutXfbBuffer;
         if (globalOutputDefaults.hasXfbBuffer() && qualifier.hasXfbStride()) {
             if (! intermediate.setXfbBufferStride(globalOutputDefaults.layoutXfbBuffer, qualifier.layoutXfbStride))
-                error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d", qualifier.layoutXfbBuffer);
+                error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d",
+                      qualifier.layoutXfbBuffer);
         }
         break;
     default:
@@ -8093,7 +8551,8 @@
 // Turn the top-level node sequence built up of wrapupSwitchSubsequence
 // into a switch node.
 //
-TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, TIntermAggregate* lastStatements)
+TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression,
+                                         TIntermAggregate* lastStatements, TSelectionControl control)
 {
     wrapupSwitchSubsequence(lastStatements, nullptr);
 
@@ -8120,6 +8579,7 @@
 
     TIntermSwitch* switchNode = new TIntermSwitch(expression, body);
     switchNode->setLoc(loc);
+    switchNode->setSelectionControl(control);
 
     return switchNode;
 }
@@ -8341,6 +8801,9 @@
         qualifier.sample = false;
     }
 
+    if (isClipOrCullDistance(qualifier))
+        qualifier.layoutLocation = TQualifier::layoutLocationEnd;
+
     qualifier.clearStreamLayout();
     qualifier.clearXfbLayout();
 
@@ -8444,7 +8907,7 @@
         return;
     }
 
-    // Look for builtin variables in a function's parameter list.
+    // Look for built-in variables in a function's parameter list.
     const auto findBuiltIns = [&](const TFunction& function, std::set<tInterstageIoData>& builtIns) {
         for (int p=0; p<function.getParamCount(); ++p) {
             TStorageQualifier storage = function[p].type->getQualifier().storage;
@@ -8460,7 +8923,7 @@
     };
 
 
-    // If we synthesize a builtin interface variable, we must add it to the linkage.
+    // If we synthesize a built-in interface variable, we must add it to the linkage.
     const auto addToLinkage = [&](const TType& type, const TString* name, TIntermSymbol** symbolNode) {
         if (name == nullptr) {
             error(loc, "unable to locate patch function parameter name", "", "");
@@ -8491,11 +8954,11 @@
     // We will perform these steps.  Each is in a scoped block for separation: they could
     // become separate functions to make addPatchConstantInvocation shorter.
     // 
-    // 1. Union the interfaces, and create builtins for anything present in the PCF and
-    //    declared as a builtin variable that isn't present in the entry point's signature.
+    // 1. Union the interfaces, and create built-ins for anything present in the PCF and
+    //    declared as a built-in variable that isn't present in the entry point's signature.
     //
-    // 2. Synthesizes a call to the patchconstfunction using builtin variables from either main,
-    //    or the ones we created.  Matching is based on builtin type.  We may use synthesized
+    // 2. Synthesizes a call to the patchconstfunction using built-in variables from either main,
+    //    or the ones we created.  Matching is based on built-in type.  We may use synthesized
     //    variables from (1) above.
     // 
     // 2B: Synthesize per control point invocations of wrapped entry point if the PCF requires them.
@@ -8519,8 +8982,8 @@
     // ================ Step 1A: Union Interfaces ================
     // Our patch constant function.
     {
-        std::set<tInterstageIoData> pcfBuiltIns;  // patch constant function builtins
-        std::set<tInterstageIoData> epfBuiltIns;  // entry point function builtins
+        std::set<tInterstageIoData> pcfBuiltIns;  // patch constant function built-ins
+        std::set<tInterstageIoData> epfBuiltIns;  // entry point function built-ins
 
         assert(entryPointFunction);
         assert(entryPointFunctionBody);
@@ -8528,7 +8991,7 @@
         findBuiltIns(patchConstantFunction, pcfBuiltIns);
         findBuiltIns(*entryPointFunction,   epfBuiltIns);
 
-        // Find the set of builtins in the PCF that are not present in the entry point.
+        // Find the set of built-ins in the PCF that are not present in the entry point.
         std::set<tInterstageIoData> notInEntryPoint;
 
         notInEntryPoint = pcfBuiltIns;
@@ -8558,8 +9021,8 @@
                 if (storage == EvqConstReadOnly) // treated identically to input
                     storage = EvqIn;
 
-                // Presently, the only non-builtin we support is InputPatch, which is treated as
-                // a pseudo-builtin.
+                // Presently, the only non-built-in we support is InputPatch, which is treated as
+                // a pseudo-built-in.
                 if (biType == EbvInputPatch) {
                     builtInLinkageSymbols[biType] = inputPatch;
                 } else if (biType == EbvOutputPatch) {
@@ -8604,13 +9067,13 @@
                 }
                 inputArg = intermediate.addSymbol(*perCtrlPtVar, loc);
             } else {
-                // find which builtin it is
+                // find which built-in it is
                 const TBuiltInVariable biType = patchConstantFunction[p].getDeclaredBuiltIn();
                 
                 inputArg = findLinkageSymbol(biType);
 
                 if (inputArg == nullptr) {
-                    error(loc, "unable to find patch constant function builtin variable", "", "");
+                    error(loc, "unable to find patch constant function built-in variable", "", "");
                     return;
                 }
             }
@@ -8725,7 +9188,7 @@
         if (newLists != ioTypeMap.end())
             outType.setStruct(newLists->second.output);
 
-        // Substitute the top level type's builtin type
+        // Substitute the top level type's built-in type
         if (patchConstantFunction.getDeclaredBuiltInType() != EbvNone)
             outType.getQualifier().builtIn = patchConstantFunction.getDeclaredBuiltInType();
 
@@ -8737,7 +9200,7 @@
         if (pcfOutput->getType().containsBuiltInInterstageIO(language))
             split(*pcfOutput);
 
-        assignLocations(*pcfOutput);
+        assignToInterface(*pcfOutput);
 
         TIntermSymbol* pcfOutputSym = intermediate.addSymbol(*pcfOutput, loc);
 
@@ -8748,7 +9211,8 @@
 
         TIntermSymbol* pcfResultVar = intermediate.addSymbol(*pcfCallResult, loc);
         TIntermNode* pcfResultAssign = handleAssign(loc, EOpAssign, pcfResultVar, pcfCall);
-        TIntermNode* pcfResultToOut = handleAssign(loc, EOpAssign, pcfOutputSym, intermediate.addSymbol(*pcfCallResult, loc));
+        TIntermNode* pcfResultToOut = handleAssign(loc, EOpAssign, pcfOutputSym,
+                                                   intermediate.addSymbol(*pcfCallResult, loc));
 
         pcfCallSequence = intermediate.growAggregate(pcfCallSequence, pcfResultAssign);
         pcfCallSequence = intermediate.growAggregate(pcfCallSequence, pcfResultToOut);
diff --git a/hlsl/hlslParseHelper.h b/hlsl/hlslParseHelper.h
index 9e772d1..ef81409 100755
--- a/hlsl/hlslParseHelper.h
+++ b/hlsl/hlslParseHelper.h
@@ -39,6 +39,8 @@
 #include "../glslang/MachineIndependent/parseVersions.h"
 #include "../glslang/MachineIndependent/ParseHelper.h"
 
+#include <array>
+
 namespace glslang {
 
 class TAttributeMap; // forward declare
@@ -77,7 +79,7 @@
     TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode);
     TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field);
     bool isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field);
-    void assignLocations(TVariable& variable);
+    void assignToInterface(TVariable& variable);
     void handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype);
     TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributeMap&, TIntermNode*& entryPointTree);
     TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributeMap&);
@@ -87,9 +89,11 @@
     void remapNonEntryPointIO(TFunction& function);
     TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*);
     void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg);
+    TIntermAggregate* executeFlattenedInitializer(const TSourceLoc&, TIntermSymbol*, const TIntermAggregate&);
     TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
     TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
     TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
+    TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right);
     void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
     void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
     void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
@@ -146,6 +150,7 @@
     void lengthenList(const TSourceLoc&, TIntermSequence& list, int size, TIntermTyped* scalarInit);
     TIntermTyped* handleConstructor(const TSourceLoc&, TIntermTyped*, const TType&);
     TIntermTyped* addConstructor(const TSourceLoc&, TIntermTyped*, const TType&);
+    TIntermTyped* convertArray(TIntermTyped*, const TType&);
     TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
     TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
     void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
@@ -157,7 +162,7 @@
     void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&);
     void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&);
     void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
-    TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body);
+    TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, TSelectionControl control);
 
     void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index);
 
@@ -189,6 +194,7 @@
     // Apply L-value conversions.  E.g, turning a write to a RWTexture into an ImageStore.
     TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node);
     TIntermTyped* handleSamplerLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node);
+    TIntermTyped* setOpaqueLvalue(TIntermTyped* left, TIntermTyped* right);
     bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
 
     TLayoutFormat getLayoutFromTxType(const TSourceLoc&, const TType&);
@@ -196,27 +202,28 @@
     bool handleOutputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry);
     bool handleInputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry);
 
+    // Determine selection control from attributes
+    TSelectionControl handleSelectionControl(const TAttributeMap& attributes) const;
+
     // Determine loop control from attributes
     TLoopControl handleLoopControl(const TAttributeMap& attributes) const;
 
     // Potentially rename shader entry point function
     void renameShaderFunction(const TString*& name) const;
 
-    // Reset data for incrementally built referencing of flattened composite structures
-    void initFlattening() { flattenLevel.push_back(0); flattenOffset.push_back(0); }
-    void finalizeFlattening() { flattenLevel.pop_back(); flattenOffset.pop_back(); }
-
     // Share struct buffer deep types
     void shareStructBufferType(TType&);
 
 protected:
     struct TFlattenData {
-        TFlattenData() : nextBinding(TQualifier::layoutBindingEnd) { }
-        TFlattenData(int nb) : nextBinding(nb) { }
+        TFlattenData() : nextBinding(TQualifier::layoutBindingEnd),
+                         nextLocation(TQualifier::layoutLocationEnd) { }
+        TFlattenData(int nb, int nl) : nextBinding(nb), nextLocation(nl) { }
 
         TVector<TVariable*> members;     // individual flattened variables
-        TVector<int>        offsets;     // offset to next tree level
-        int                 nextBinding; // next binding to use.
+        TVector<int> offsets;            // offset to next tree level
+        unsigned int nextBinding;        // next binding to use.
+        unsigned int nextLocation;       // next location to use
     };
 
     void fixConstInit(const TSourceLoc&, const TString& identifier, TType& type, TIntermTyped*& initializer);
@@ -228,7 +235,7 @@
     TIntermSymbol* makeInternalVariableNode(const TSourceLoc&, const char* name, const TType&) const;
     TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&, bool track);
     void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&, bool track);
-    TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
+    TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable, bool flattened);
     TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit);
     bool isScalarConstructor(const TIntermNode*);
     TOperator mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage);
@@ -238,18 +245,15 @@
 
     // Array and struct flattening
     TIntermTyped* flattenAccess(TIntermTyped* base, int member);
-    TIntermTyped* flattenAccess(int uniqueId, int member, const TType&);
+    TIntermTyped* flattenAccess(int uniqueId, int member, const TType&, int subset = -1);
     bool shouldFlatten(const TType&) const;
     bool wasFlattened(const TIntermTyped* node) const;
     bool wasFlattened(int id) const { return flattenMap.find(id) != flattenMap.end(); }
-    int  addFlattenedMember(const TSourceLoc& loc, const TVariable&, const TType&, TFlattenData&, const TString& name, bool track);
+    int  addFlattenedMember(const TVariable&, const TType&, TFlattenData&, const TString& name, bool track);
     bool isFinalFlattening(const TType& type) const { return !(type.isStruct() || type.isArray()); }
 
     // Structure splitting (splits interstage built-in types into its own struct)
-    TIntermTyped* splitAccessStruct(const TSourceLoc& loc, TIntermTyped*& base, int& member);
-    void splitAccessArray(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index);
     TType& split(TType& type, TString name, const TType* outerStructType = nullptr);
-    void split(TIntermTyped*);
     void split(const TVariable&);
     bool wasSplit(const TIntermTyped* node) const;
     bool wasSplit(int id) const { return splitIoVars.find(id) != splitIoVars.end(); }
@@ -262,10 +266,10 @@
 
     void fixBuiltInIoType(TType&);
 
-    void flatten(const TSourceLoc& loc, const TVariable& variable);
-    int flatten(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
-    int flattenStruct(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
-    int flattenArray(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
+    void flatten(const TVariable& variable);
+    int flatten(const TVariable& variable, const TType&, TFlattenData&, TString name);
+    int flattenStruct(const TVariable& variable, const TType&, TFlattenData&, TString name);
+    int flattenArray(const TVariable& variable, const TType&, TFlattenData&, TString name);
 
     bool hasUniform(const TQualifier& qualifier) const;
     void clearUniform(TQualifier& qualifier);
@@ -303,6 +307,10 @@
     // Finalization step: remove unused buffer blocks from linkage (we don't know until the
     // shader is entirely compiled)
     void removeUnusedStructBufferCounters();
+ 
+    static bool isClipOrCullDistance(TBuiltInVariable);
+    static bool isClipOrCullDistance(const TQualifier& qual) { return isClipOrCullDistance(qual.builtIn); }
+    static bool isClipOrCullDistance(const TType& type) { return isClipOrCullDistance(type.getQualifier()); }
 
     // Pass through to base class after remembering builtin mappings.
     using TParseContextBase::trackLinkage;
@@ -363,8 +371,6 @@
     TVector<TSymbol*> ioArraySymbolResizeList;
 
     TMap<int, TFlattenData> flattenMap;
-    TVector<int> flattenLevel;  // nested postfix operator level for flattening
-    TVector<int> flattenOffset; // cumulative offset for flattening
 
     // IO-type map. Maps a pure symbol-table form of a structure-member list into
     // each of the (up to) three kinds of IO, as each as different allowed decorations,
@@ -407,12 +413,6 @@
     TMap<tInterstageIoData, TVariable*> interstageBuiltInIo; // individual builtin interstage IO vars, indexed by builtin type.
     TVariable* inputPatch;
 
-    // We have to move array references to structs containing builtin interstage IO to the split variables.
-    // This is only handled for one level.  This stores the index, because we'll need it in the future, since
-    // unlike normal array references, here the index happens before we discover what it applies to.
-    TIntermTyped* builtInIoIndex;
-    TIntermTyped* builtInIoBase;
-
     unsigned int nextInLocation;
     unsigned int nextOutLocation;
 
@@ -428,6 +428,13 @@
 
     TVariable* gsStreamOutput;               // geometry shader stream outputs, for emit (Append method)
 
+    TVariable* clipDistanceOutput;           // synthesized clip distance output variable (shader might have >1)
+    TVariable* cullDistanceOutput;           // synthesized cull distance output variable (shader might have >1)
+
+    static const int maxClipCullRegs = 2;
+    std::array<int, maxClipCullRegs> clipSemanticNSize; // vector, indexed by clip semantic ID
+    std::array<int, maxClipCullRegs> cullSemanticNSize; // vector, indexed by cull semantic ID
+
     // This tracks the first (mip level) argument to the .mips[][] operator.  Since this can be nested as
     // in tx.mips[tx.mips[0][1].x][2], we need a stack.  We also track the TSourceLoc for error reporting 
     // purposes.
diff --git a/hlsl/hlslScanContext.cpp b/hlsl/hlslScanContext.cpp
index 34f7b46..392efeb 100755
--- a/hlsl/hlslScanContext.cpp
+++ b/hlsl/hlslScanContext.cpp
@@ -420,32 +420,6 @@
     }
 
     (*SemanticMap)["SV_POSITION"] =               EbvPosition;
-    (*SemanticMap)["SV_CLIPDISTANCE"] =           EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE0"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE1"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE2"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE3"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE4"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE5"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE6"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE7"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE8"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE9"] =          EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE10"] =         EbvClipDistance;
-    (*SemanticMap)["SV_CLIPDISTANCE11"] =         EbvClipDistance;
-    (*SemanticMap)["SV_CULLDISTANCE"] =           EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE0"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE1"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE2"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE3"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE4"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE5"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE6"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE7"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE8"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE9"] =          EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE10"] =         EbvCullDistance;
-    (*SemanticMap)["SV_CULLDISTANCE11"] =         EbvCullDistance;
     (*SemanticMap)["SV_VERTEXID"] =               EbvVertexIndex;
     (*SemanticMap)["SV_VIEWPORTARRAYINDEX"] =     EbvViewportIndex;
     (*SemanticMap)["SV_TESSFACTOR"] =             EbvTessLevelOuter;
@@ -466,7 +440,7 @@
     (*SemanticMap)["SV_COVERAGE"] =               EbvSampleMask;
     (*SemanticMap)["SV_DEPTHGREATEREQUAL"] =      EbvFragDepthGreater;
     (*SemanticMap)["SV_DEPTHLESSEQUAL"] =         EbvFragDepthLesser;
-    (*SemanticMap)["SV_STENCILREF"] =             EbvStencilRef;
+    (*SemanticMap)["SV_STENCILREF"] =             EbvFragStencilRef;
 }
 
 void HlslScanContext::deleteKeywordMap()