Merge remote-tracking branch 'aosp/master' into update
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7f09fb..c03edd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 2.8.11)
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
 option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" OFF)
diff --git a/OGLCompilersDLL/InitializeDll.cpp b/OGLCompilersDLL/InitializeDll.cpp
index cc2b742..e479881 100644
--- a/OGLCompilersDLL/InitializeDll.cpp
+++ b/OGLCompilersDLL/InitializeDll.cpp
@@ -34,7 +34,7 @@
 
 #define SH_EXPORTING
 
-#include <assert.h>
+#include <cassert>
 
 #include "InitializeDll.h"
 #include "../glslang/Include/InitializeGlobals.h"
diff --git a/README-spirv-remap.txt b/README-spirv-remap.txt
index 8e3259f..3e5288a 100644
--- a/README-spirv-remap.txt
+++ b/README-spirv-remap.txt
@@ -98,7 +98,7 @@
 On error, the function supplied to registerErrorHandler() will be invoked.
 This can be a standard C/C++ function, a lambda function, or a functor.
 The default handler simply calls exit(5); The error handler is a static
-members, so need only be set up once, not once per spirvbin_t instance.
+member, so need only be set up once, not once per spirvbin_t instance.
 
 Log messages are supplied to registerLogHandler().  By default, log
 messages are eaten silently.  The log handler is also a static member.
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
index 9628a82..48a6c46 100755
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
@@ -3,21 +3,27 @@
     InReadableOrder.cpp
     Logger.cpp
     SpvBuilder.cpp
-    SPVRemapper.cpp
     doc.cpp
     disassemble.cpp)
 
+set(SPVREMAP_SOURCES
+    SPVRemapper.cpp
+    doc.cpp)
+
 set(HEADERS
     spirv.hpp
     GLSL.std.450.h
     GlslangToSpv.h
     Logger.h
     SpvBuilder.h
-    SPVRemapper.h
     spvIR.h
     doc.h
     disassemble.h)
 
+set(SPVREMAP_HEADERS
+    SPVRemapper.h
+    doc.h)
+
 if(ENABLE_AMD_EXTENSIONS)
     set(HEADERS
         GLSL.ext.AMD.h)
@@ -26,9 +32,13 @@
 add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
 set_property(TARGET SPIRV PROPERTY FOLDER glslang)
 
+add_library(SPVRemapper STATIC ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
+set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
+
 if(WIN32)
     source_group("Source" FILES ${SOURCES} ${HEADERS})
+    source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
 endif(WIN32)
 
-install(TARGETS SPIRV
+install(TARGETS SPIRV SPVRemapper
         ARCHIVE DESTINATION lib)
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 6aec9e6..7286588 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -130,13 +130,14 @@
     spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim);
     spv::Id accessChainLoad(const glslang::TType& type);
     void    accessChainStore(const glslang::TType& type, spv::Id rvalue);
+    void multiTypeStore(const glslang::TType&, spv::Id rValue);
     glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const;
     int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
     int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
     void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix);
     void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember);
 
-    bool isShaderEntrypoint(const glslang::TIntermAggregate* node);
+    bool isShaderEntryPoint(const glslang::TIntermAggregate* node);
     void makeFunctions(const glslang::TIntermSequence&);
     void makeGlobalInitializers(const glslang::TIntermSequence&);
     void visitFunctions(const glslang::TIntermSequence&);
@@ -149,11 +150,14 @@
     spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true);
     spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right);
     spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy);
-    spv::Id createUnaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy);
+    spv::Id createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy);
     spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy);
     spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
     spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
-    spv::Id createInvocationsOperation(glslang::TOperator, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy);
+    spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy);
+#ifdef AMD_EXTENSIONS
+    spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::Id typeId, spv::Id operand);
+#endif
     spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
     spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId);
     spv::Id getSymbolId(const glslang::TIntermSymbol* node);
@@ -185,7 +189,7 @@
     std::unordered_map<const char*, spv::Id> extBuiltinMap;
 
     std::unordered_map<int, spv::Id> symbolValues;
-    std::unordered_set<int> constReadOnlyParameters;  // set of formal function parameters that have glslang qualifier constReadOnly, so we know they are not local function "const" that are write-once
+    std::unordered_set<int> rValueParameters;  // set of formal function parameters passed as rValues, rather than a pointer
     std::unordered_map<std::string, spv::Function*> functionMap;
     std::unordered_map<const glslang::TTypeList*, spv::Id> structMap[glslang::ElpCount][glslang::ElmCount];
     std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper;  // for mapping glslang block indices to spv indices (e.g., due to hidden members)
@@ -212,7 +216,8 @@
             return spv::SourceLanguageUnknown;
         }
     case glslang::EShSourceHlsl:
-        return spv::SourceLanguageHLSL;
+        //Use SourceLanguageUnknown instead of SourceLanguageHLSL for now, until Vulkan knows what HLSL is
+        return spv::SourceLanguageUnknown;
     default:
         return spv::SourceLanguageUnknown;
     }
@@ -679,13 +684,17 @@
         child.writeonly = true;
 }
 
-bool HasNonLayoutQualifiers(const glslang::TQualifier& qualifier)
+bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifier& qualifier)
 {
     // This should list qualifiers that simultaneous satisfy:
-    // - struct members can inherit from a struct declaration
-    // - affect decorations on the struct members (note smooth does not, and expecting something like volatile to effect the whole object)
+    // - struct members might inherit from a struct declaration
+    //     (note that non-block structs don't explicitly inherit,
+    //      only implicitly, meaning no decoration involved)
+    // - affect decorations on the struct members
+    //     (note smooth does not, and expecting something like volatile
+    //      to effect the whole object)
     // - are not part of the offset/st430/etc or row/column-major layout
-    return qualifier.invariant || qualifier.hasLocation();
+    return qualifier.invariant || (qualifier.hasLocation() && type.getBasicType() == glslang::EbtBlock);
 }
 
 //
@@ -704,8 +713,8 @@
     builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()), glslangIntermediate->getVersion());
     stdBuiltins = builder.import("GLSL.std.450");
     builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
-    shaderEntry = builder.makeEntrypoint(glslangIntermediate->getEntryPoint().c_str());
-    entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPoint().c_str());
+    shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str());
+    entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str());
 
     // Add the source extensions
     const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions();
@@ -889,13 +898,12 @@
 
         // For now, we consider all user variables as being in memory, so they are pointers,
         // except for
-        // A) "const in" arguments to a function, which are an intermediate object.
+        // A) R-Value arguments to a function, which are an intermediate object.
         //    See comments in handleUserFunctionCall().
-        // B) Specialization constants (normal constant don't even come in as a variable),
+        // B) Specialization constants (normal constants don't even come in as a variable),
         //    These are also pure R-values.
         glslang::TQualifier qualifier = symbol->getQualifier();
-        if ((qualifier.storage == glslang::EvqConstReadOnly && constReadOnlyParameters.find(symbol->getId()) != constReadOnlyParameters.end()) ||
-             qualifier.isSpecConstant())
+        if (qualifier.isSpecConstant() || rValueParameters.find(symbol->getId()) != rValueParameters.end())
             builder.setAccessChainRValue(id);
         else
             builder.setAccessChainLValue(id);
@@ -957,7 +965,7 @@
 
             // store the result
             builder.setAccessChain(lValue);
-            accessChainStore(node->getType(), rValue);
+            multiTypeStore(node->getType(), rValue);
 
             // assignments are expressions having an rValue after they are evaluated...
             builder.clearAccessChain();
@@ -1271,7 +1279,7 @@
             // In all cases, still let the traverser visit the children for us.
             makeFunctions(node->getAsAggregate()->getSequence());
 
-            // Also, we want all globals initializers to go into the entry of main(), before
+            // Also, we want all globals initializers to go into the beginning of the entry point, before
             // anything else gets there, so visit out of order, doing them all now.
             makeGlobalInitializers(node->getAsAggregate()->getSequence());
 
@@ -1305,7 +1313,7 @@
     }
     case glslang::EOpFunction:
         if (visit == glslang::EvPreVisit) {
-            if (isShaderEntrypoint(node)) {
+            if (isShaderEntryPoint(node)) {
                 inMain = true;
                 builder.setBuildPoint(shaderEntry->getLastBlock());
             } else {
@@ -1954,7 +1962,7 @@
 
             // Try to share structs for different layouts, but not yet for other
             // kinds of qualification (primarily not yet including interpolant qualification).
-            if (! HasNonLayoutQualifiers(qualifier))
+            if (! HasNonLayoutQualifiers(type, qualifier))
                 spvType = structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers];
             if (spvType != spv::NoResult)
                 break;
@@ -2064,7 +2072,7 @@
 
     // Make the SPIR-V type
     spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str());
-    if (! HasNonLayoutQualifiers(qualifier))
+    if (! HasNonLayoutQualifiers(type, qualifier))
         structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType;
 
     // Decorate it
@@ -2231,6 +2239,8 @@
 
 // Wrap the builder's accessChainStore to:
 //  - do conversion of concrete to abstract type
+//
+// Implicitly uses the existing builder.accessChain as the storage target.
 void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::Id rvalue)
 {
     // Need to convert to abstract types when necessary
@@ -2260,6 +2270,77 @@
     builder.accessChainStore(rvalue);
 }
 
+// For storing when types match at the glslang level, but not might match at the
+// SPIR-V level.
+//
+// This especially happens when a single glslang type expands to multiple
+// SPIR-V types, like a struct that is used in an member-undecorated way as well
+// as in a member-decorated way.
+//
+// NOTE: This function can handle any store request; if it's not special it
+// simplifies to a simple OpStore.
+//
+// Implicitly uses the existing builder.accessChain as the storage target.
+void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id rValue)
+{
+    // we only do the complex path here if it's an aggregate
+    if (! type.isStruct() && ! type.isArray()) {
+        accessChainStore(type, rValue);
+        return;
+    }
+
+    // and, it has to be a case of type aliasing
+    spv::Id rType = builder.getTypeId(rValue);
+    spv::Id lValue = builder.accessChainGetLValue();
+    spv::Id lType = builder.getContainedTypeId(builder.getTypeId(lValue));
+    if (lType == rType) {
+        accessChainStore(type, rValue);
+        return;
+    }
+
+    // Recursively (as needed) copy an aggregate type to a different aggregate type,
+    // where the two types were the same type in GLSL. This requires member
+    // by member copy, recursively.
+
+    // If an array, copy element by element.
+    if (type.isArray()) {
+        glslang::TType glslangElementType(type, 0);
+        spv::Id elementRType = builder.getContainedTypeId(rType);
+        for (int index = 0; index < type.getOuterArraySize(); ++index) {
+            // get the source member
+            spv::Id elementRValue = builder.createCompositeExtract(rValue, elementRType, index);
+
+            // set up the target storage
+            builder.clearAccessChain();
+            builder.setAccessChainLValue(lValue);
+            builder.accessChainPush(builder.makeIntConstant(index));
+
+            // store the member
+            multiTypeStore(glslangElementType, elementRValue);
+        }
+    } else {
+        assert(type.isStruct());
+
+        // loop over structure members
+        const glslang::TTypeList& members = *type.getStruct();
+        for (int m = 0; m < (int)members.size(); ++m) {
+            const glslang::TType& glslangMemberType = *members[m].type;
+
+            // get the source member
+            spv::Id memberRType = builder.getContainedTypeId(rType, m);
+            spv::Id memberRValue = builder.createCompositeExtract(rValue, memberRType, m);
+
+            // set up the target storage
+            builder.clearAccessChain();
+            builder.setAccessChainLValue(lValue);
+            builder.accessChainPush(builder.makeIntConstant(m));
+
+            // store the member
+            multiTypeStore(glslangMemberType, memberRValue);
+        }
+    }
+}
+
 // Decide whether or not this type should be
 // decorated with offsets and strides, and if so
 // whether std140 or std430 rules should be applied.
@@ -2370,11 +2451,9 @@
     }
 }
 
-bool TGlslangToSpvTraverser::isShaderEntrypoint(const glslang::TIntermAggregate* node)
+bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate* node)
 {
-    // have to ignore mangling and just look at the base name
-    size_t firstOpen = node->getName().find('(');
-    return node->getName().compare(0, firstOpen, glslangIntermediate->getEntryPoint().c_str()) == 0;
+    return node->getName().compare(glslangIntermediate->getEntryPointMangledName().c_str()) == 0;
 }
 
 // Make all the functions, skeletally, without actually visiting their bodies.
@@ -2382,23 +2461,22 @@
 {
     for (int f = 0; f < (int)glslFunctions.size(); ++f) {
         glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate();
-        if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction || isShaderEntrypoint(glslFunction))
+        if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction || isShaderEntryPoint(glslFunction))
             continue;
 
         // We're on a user function.  Set up the basic interface for the function now,
-        // so that it's available to call.
-        // Translating the body will happen later.
+        // so that it's available to call.  Translating the body will happen later.
         //
         // Typically (except for a "const in" parameter), an address will be passed to the
         // function.  What it is an address of varies:
         //
-        // - "in" parameters not marked as "const" can be written to without modifying the argument,
-        //  so that write needs to be to a copy, hence the address of a copy works.
+        // - "in" parameters not marked as "const" can be written to without modifying the calling
+        //   argument so that write needs to be to a copy, hence the address of a copy works.
         //
         // - "const in" parameters can just be the r-value, as no writes need occur.
         //
-        // - "out" and "inout" arguments can't be done as direct pointers, because GLSL has
-        // copy-in/copy-out semantics.  They can be handled though with a pointer to a copy.
+        // - "out" and "inout" arguments can't be done as pointers to the calling argument, because
+        //   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;
@@ -2412,7 +2490,7 @@
             else if (paramType.getQualifier().storage != glslang::EvqConstReadOnly)
                 typeId = builder.makePointer(spv::StorageClassFunction, typeId);
             else
-                constReadOnlyParameters.insert(parameters[p]->getAsSymbolNode()->getId());
+                rValueParameters.insert(parameters[p]->getAsSymbolNode()->getId());
             paramPrecisions.push_back(TranslatePrecisionDecoration(paramType));
             paramTypes.push_back(typeId);
         }
@@ -2443,7 +2521,7 @@
         if (initializer && initializer->getOp() != glslang::EOpFunction && initializer->getOp() != glslang::EOpLinkerObjects) {
 
             // We're on a top-level node that's not a function.  Treat as an initializer, whose
-            // code goes into the beginning of main.
+            // code goes into the beginning of the entry point.
             initializer->traverse(this);
         }
     }
@@ -2897,7 +2975,9 @@
                 // need to copy the input into output space
                 builder.setAccessChain(lValues[lValueCount]);
                 spv::Id copy = accessChainLoad(*argTypes[a]);
-                builder.createStore(copy, arg);
+                builder.clearAccessChain();
+                builder.setAccessChainLValue(arg);
+                multiTypeStore(paramType, copy);
             }
             ++lValueCount;
         } else {
@@ -2914,11 +2994,12 @@
     // 4. Copy back out an "out" arguments.
     lValueCount = 0;
     for (int a = 0; a < (int)glslangArgs.size(); ++a) {
+        const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType();
         if (qualifiers[a] != glslang::EvqConstReadOnly) {
             if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) {
                 spv::Id copy = builder.createLoad(spvArgs[a]);
                 builder.setAccessChain(lValues[lValueCount]);
-                accessChainStore(glslangArgs[a]->getAsTyped()->getType(), copy);
+                multiTypeStore(paramType, copy);
             }
             ++lValueCount;
         }
@@ -3082,11 +3163,9 @@
 
     // Handle comparison instructions
 
-    if (reduceComparison && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) {
-        assert(op == glslang::EOpEqual || op == glslang::EOpNotEqual);
-
+    if (reduceComparison && (op == glslang::EOpEqual || op == glslang::EOpNotEqual)
+                         && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left)))
         return builder.createCompositeCompare(precision, left, right, op == glslang::EOpEqual);
-    }
 
     switch (op) {
     case glslang::EOpLessThan:
@@ -3443,8 +3522,7 @@
     case glslang::EOpUnpackInt2x32:
     case glslang::EOpPackUint2x32:
     case glslang::EOpUnpackUint2x32:
-        logger->missingFunctionality("shader int64");
-        libCall = spv::GLSLstd450Bad; // TODO: This is a placeholder.
+        unaryOp = spv::OpBitcast;
         break;
 
     case glslang::EOpDPdx:
@@ -3700,8 +3778,8 @@
     case glslang::EOpConvInt64ToUint64:
         if (builder.isInSpecConstCodeGenMode()) {
             // Build zero scalar or vector for OpIAdd.
-            zero = (op == glslang::EOpConvUintToInt64 ||
-                    op == glslang::EOpConvIntToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
+            zero = (op == glslang::EOpConvUint64ToInt64 ||
+                    op == glslang::EOpConvInt64ToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
             zero = makeSmearedConstant(zero, vectorSize);
             // Use OpIAdd, instead of OpBitcast to do the conversion when
             // generating for OpSpecConstantOp instruction.
@@ -3941,7 +4019,10 @@
                 spvOp = spv::OpGroupIAdd;
         }
 
-        return builder.createOp(spvOp, typeId, operands);
+        if (builder.isVectorType(typeId))
+            return CreateInvocationsVectorOperation(spvOp, typeId, operand);
+        else
+            return builder.createOp(spvOp, typeId, operands);
     }
     case glslang::EOpMinInvocationsNonUniform:
     case glslang::EOpMaxInvocationsNonUniform:
@@ -3975,7 +4056,10 @@
                 spvOp = spv::OpGroupIAddNonUniformAMD;
         }
 
-        return builder.createOp(spvOp, typeId, operands);
+        if (builder.isVectorType(typeId))
+            return CreateInvocationsVectorOperation(spvOp, typeId, operand);
+        else
+            return builder.createOp(spvOp, typeId, operands);
     }
 #endif
     default:
@@ -3984,6 +4068,48 @@
     }
 }
 
+#ifdef AMD_EXTENSIONS
+// Create group invocation operations on a vector
+spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv::Id typeId, spv::Id operand)
+{
+    assert(op == spv::OpGroupFMin || op == spv::OpGroupUMin || op == spv::OpGroupSMin ||
+           op == spv::OpGroupFMax || op == spv::OpGroupUMax || op == spv::OpGroupSMax ||
+           op == spv::OpGroupFAdd || op == spv::OpGroupIAdd ||
+           op == spv::OpGroupFMinNonUniformAMD || op == spv::OpGroupUMinNonUniformAMD || op == spv::OpGroupSMinNonUniformAMD ||
+           op == spv::OpGroupFMaxNonUniformAMD || op == spv::OpGroupUMaxNonUniformAMD || op == spv::OpGroupSMaxNonUniformAMD ||
+           op == spv::OpGroupFAddNonUniformAMD || op == spv::OpGroupIAddNonUniformAMD);
+
+    // Handle group invocation operations scalar by scalar.
+    // The result type is the same type as the original type.
+    // The algorithm is to:
+    //   - break the vector into scalars
+    //   - apply the operation to each scalar
+    //   - make a vector out the scalar results
+
+    // get the types sorted out
+    int numComponents = builder.getNumComponents(operand);
+    spv::Id scalarType = builder.getScalarTypeId(builder.getTypeId(operand));
+    std::vector<spv::Id> results;
+
+    // do each scalar op
+    for (int comp = 0; comp < numComponents; ++comp) {
+        std::vector<unsigned int> indexes;
+        indexes.push_back(comp);
+        spv::Id scalar = builder.createCompositeExtract(operand, scalarType, indexes);
+
+        std::vector<spv::Id> operands;
+        operands.push_back(builder.makeUintConstant(spv::ScopeSubgroup));
+        operands.push_back(spv::GroupOperationReduce);
+        operands.push_back(scalar);
+
+        results.push_back(builder.createOp(op, scalarType, operands));
+    }
+
+    // put the pieces together
+    return builder.createCompositeConstruct(typeId, results);
+}
+#endif
+
 spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
 {
     bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp
index 05f220a..5c551fb 100755
--- a/SPIRV/SPVRemapper.cpp
+++ b/SPIRV/SPVRemapper.cpp
@@ -127,6 +127,33 @@
         }
     }
 
+    // Return the size of a type in 32-bit words.  This currently only
+    // handles ints and floats, and is only invoked by queries which must be
+    // integer types.  If ever needed, it can be generalized.
+    unsigned spirvbin_t::typeSizeInWords(spv::Id id) const
+    {
+        const unsigned typeStart = idPos(id);
+        const spv::Op  opCode    = asOpCode(typeStart);
+
+        switch (opCode) {
+        case spv::OpTypeInt:   // fall through...
+        case spv::OpTypeFloat: return (spv[typeStart+2]+31)/32;
+        default:
+            return 0;
+        }
+    }
+
+    // Looks up the type of a given const or variable ID, and
+    // returns its size in 32-bit words.
+    unsigned spirvbin_t::idTypeSizeInWords(spv::Id id) const
+    {
+        const auto tid_it = idTypeSizeMap.find(id);
+        if (tid_it == idTypeSizeMap.end())
+            error("type size for ID not found");
+
+        return tid_it->second;
+    }
+
     // Is this an opcode we should remove when using --strip?
     bool spirvbin_t::isStripOp(spv::Op opCode) const
     {
@@ -140,6 +167,7 @@
         }
     }
 
+    // Return true if this opcode is flow control
     bool spirvbin_t::isFlowCtrl(spv::Op opCode) const
     {
         switch (opCode) {
@@ -155,6 +183,7 @@
         }
     }
 
+    // Return true if this opcode defines a type
     bool spirvbin_t::isTypeOp(spv::Op opCode) const
     {
         switch (opCode) {
@@ -182,6 +211,7 @@
         }
     }
 
+    // Return true if this opcode defines a constant
     bool spirvbin_t::isConstOp(spv::Op opCode) const
     {
         switch (opCode) {
@@ -324,7 +354,7 @@
         fnPosDCE.clear();
         fnCalls.clear();
         typeConstPos.clear();
-        typeConstPosR.clear();
+        idPosR.clear();
         entryPoint = spv::NoResult;
         largestNewId = 0;
 
@@ -340,6 +370,25 @@
                 if ((options & STRIP) && isStripOp(opCode))
                     stripInst(start);
 
+                unsigned word = start+1;
+                spv::Id  typeId = spv::NoResult;
+
+                if (spv::InstructionDesc[opCode].hasType())
+                    typeId = asId(word++);
+
+                // If there's a result ID, remember the size of its type
+                if (spv::InstructionDesc[opCode].hasResult()) {
+                    const spv::Id resultId = asId(word++);
+                    idPosR[resultId] = start;
+                    
+                    if (typeId != spv::NoResult) {
+                        const unsigned idTypeSize = typeSizeInWords(typeId);
+
+                        if (idTypeSize != 0)
+                            idTypeSizeMap[resultId] = idTypeSize;
+                    }
+                }
+
                 if (opCode == spv::Op::OpName) {
                     const spv::Id    target = asId(start+1);
                     const std::string  name = literalString(start+2);
@@ -363,11 +412,9 @@
                 } else if (isConstOp(opCode)) {
                     assert(asId(start + 2) != spv::NoResult);
                     typeConstPos.insert(start);
-                    typeConstPosR[asId(start + 2)] = start;
                 } else if (isTypeOp(opCode)) {
                     assert(asId(start + 1) != spv::NoResult);
                     typeConstPos.insert(start);
-                    typeConstPosR[asId(start + 1)] = start;
                 }
 
                 return false;
@@ -436,12 +483,19 @@
             return nextInst;
         }
 
+        // Circular buffer so we can look back at previous unmapped values during the mapping pass.
+        static const unsigned idBufferSize = 4;
+        spv::Id idBuffer[idBufferSize];
+        unsigned idBufferPos = 0;
+
         // Store IDs from instruction in our map
         for (int op = 0; numOperands > 0; ++op, --numOperands) {
             switch (spv::InstructionDesc[opCode].operands.getClass(op)) {
             case spv::OperandId:
             case spv::OperandScope:
             case spv::OperandMemorySemantics:
+                idBuffer[idBufferPos] = asId(word);
+                idBufferPos = (idBufferPos + 1) % idBufferSize;
                 idFn(asId(word++));
                 break;
 
@@ -459,13 +513,25 @@
                 // word += numOperands;
                 return nextInst;
 
-            case spv::OperandVariableLiteralId:
-                while (numOperands > 0) {
-                    ++word;             // immediate
-                    idFn(asId(word++)); // ID
-                    numOperands -= 2;
+            case spv::OperandVariableLiteralId: {
+                if (opCode == OpSwitch) {
+                    // word-2 is the position of the selector ID.  OpSwitch Literals match its type.
+                    // In case the IDs are currently being remapped, we get the word[-2] ID from
+                    // the circular idBuffer.
+                    const unsigned literalSizePos = (idBufferPos+idBufferSize-2) % idBufferSize;
+                    const unsigned literalSize = idTypeSizeInWords(idBuffer[literalSizePos]);
+                    const unsigned numLiteralIdPairs = (nextInst-word) / (1+literalSize);
+
+                    for (unsigned arg=0; arg<numLiteralIdPairs; ++arg) {
+                        word += literalSize;  // literal
+                        idFn(asId(word++));   // label
+                    }
+                } else {
+                    assert(0); // currentely, only OpSwitch uses OperandVariableLiteralId
                 }
+
                 return nextInst;
+            }
 
             case spv::OperandLiteralString: {
                 const int stringWordCount = literalStringWords(literalString(word));
@@ -966,23 +1032,27 @@
 
         std::unordered_map<spv::Id, int> typeUseCount;
 
-        // Count total type usage
-        process(inst_fn_nop,
-            [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; }
-        );
+        // This is not the most efficient algorithm, but this is an offline tool, and
+        // it's easy to write this way.  Can be improved opportunistically if needed.
+        bool changed = true;
+        while (changed) {
+            changed = false;
+            strip();
+            typeUseCount.clear();
 
-        // Remove types from deleted code
-        for (const auto& fn : fnPosDCE)
+            // Count total type usage
             process(inst_fn_nop,
-            [&](spv::Id& id) { if (isType[id]) --typeUseCount[id]; },
-            fn.second.first, fn.second.second);
+                    [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; }
+                    );
 
-        // Remove single reference types
-        for (const auto typeStart : typeConstPos) {
-            const spv::Id typeId = asTypeConstId(typeStart);
-            if (typeUseCount[typeId] == 1) {
-                --typeUseCount[typeId];
-                stripInst(typeStart);
+            // Remove single reference types
+            for (const auto typeStart : typeConstPos) {
+                const spv::Id typeId = asTypeConstId(typeStart);
+                if (typeUseCount[typeId] == 1) {
+                    changed = true;
+                    --typeUseCount[typeId];
+                    stripInst(typeStart);
+                }
             }
         }
     }
@@ -1060,12 +1130,12 @@
     }
 #endif // NOTDEF
 
-    // Return start position in SPV of given type.  error if not found.
-    unsigned spirvbin_t::typePos(spv::Id id) const
+    // Return start position in SPV of given Id.  error if not found.
+    unsigned spirvbin_t::idPos(spv::Id id) const
     {
-        const auto tid_it = typeConstPosR.find(id);
-        if (tid_it == typeConstPosR.end())
-            error("type ID not found");
+        const auto tid_it = idPosR.find(id);
+        if (tid_it == idPosR.end())
+            error("ID not found");
 
         return tid_it->second;
     }
@@ -1083,11 +1153,11 @@
         case spv::OpTypeInt:          return 3 + (spv[typeStart+3]);
         case spv::OpTypeFloat:        return 5;
         case spv::OpTypeVector:
-            return 6 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
+            return 6 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
         case spv::OpTypeMatrix:
-            return 30 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
+            return 30 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
         case spv::OpTypeImage:
-            return 120 + hashType(typePos(spv[typeStart+2])) +
+            return 120 + hashType(idPos(spv[typeStart+2])) +
                 spv[typeStart+3] +            // dimensionality
                 spv[typeStart+4] * 8 * 16 +   // depth
                 spv[typeStart+5] * 4 * 16 +   // arrayed
@@ -1098,24 +1168,24 @@
         case spv::OpTypeSampledImage:
             return 502;
         case spv::OpTypeArray:
-            return 501 + hashType(typePos(spv[typeStart+2])) * spv[typeStart+3];
+            return 501 + hashType(idPos(spv[typeStart+2])) * spv[typeStart+3];
         case spv::OpTypeRuntimeArray:
-            return 5000  + hashType(typePos(spv[typeStart+2]));
+            return 5000  + hashType(idPos(spv[typeStart+2]));
         case spv::OpTypeStruct:
             {
                 std::uint32_t hash = 10000;
                 for (unsigned w=2; w < wordCount; ++w)
-                    hash += w * hashType(typePos(spv[typeStart+w]));
+                    hash += w * hashType(idPos(spv[typeStart+w]));
                 return hash;
             }
 
         case spv::OpTypeOpaque:         return 6000 + spv[typeStart+2];
-        case spv::OpTypePointer:        return 100000  + hashType(typePos(spv[typeStart+3]));
+        case spv::OpTypePointer:        return 100000  + hashType(idPos(spv[typeStart+3]));
         case spv::OpTypeFunction:
             {
                 std::uint32_t hash = 200000;
                 for (unsigned w=2; w < wordCount; ++w)
-                    hash += w * hashType(typePos(spv[typeStart+w]));
+                    hash += w * hashType(idPos(spv[typeStart+w]));
                 return hash;
             }
 
@@ -1132,14 +1202,14 @@
         case spv::OpConstantFalse:       return 300008;
         case spv::OpConstantComposite:
             {
-                std::uint32_t hash = 300011 + hashType(typePos(spv[typeStart+1]));
+                std::uint32_t hash = 300011 + hashType(idPos(spv[typeStart+1]));
                 for (unsigned w=3; w < wordCount; ++w)
-                    hash += w * hashType(typePos(spv[typeStart+w]));
+                    hash += w * hashType(idPos(spv[typeStart+w]));
                 return hash;
             }
         case spv::OpConstant:
             {
-                std::uint32_t hash = 400011 + hashType(typePos(spv[typeStart+1]));
+                std::uint32_t hash = 400011 + hashType(idPos(spv[typeStart+1]));
                 for (unsigned w=3; w < wordCount; ++w)
                     hash += w * spv[typeStart+w];
                 return hash;
@@ -1212,19 +1282,19 @@
         msg(3, 4, std::string("ID bound: ") + std::to_string(bound()));
 
         strip();        // strip out data we decided to eliminate
-
         if (options & OPT_LOADSTORE) optLoadStore();
         if (options & OPT_FWD_LS)    forwardLoadStores();
         if (options & DCE_FUNCS)     dceFuncs();
         if (options & DCE_VARS)      dceVars();
         if (options & DCE_TYPES)     dceTypes();
+        strip();        // strip out data we decided to eliminate
+
         if (options & MAP_TYPES)     mapTypeConst();
         if (options & MAP_NAMES)     mapNames();
         if (options & MAP_FUNCS)     mapFnBodies();
 
         mapRemainder(); // map any unmapped IDs
         applyMap();     // Now remap each shader to the new IDs we've come up with
-        strip();        // strip out data we decided to eliminate
     }
 
     // remap from a memory image
diff --git a/SPIRV/SPVRemapper.h b/SPIRV/SPVRemapper.h
index e5e8e1b..43ec1ae 100755
--- a/SPIRV/SPVRemapper.h
+++ b/SPIRV/SPVRemapper.h
@@ -38,7 +38,7 @@
 
 #include <string>
 #include <vector>
-#include <stdlib.h>
+#include <cstdlib>
 
 namespace spv {
 
@@ -74,7 +74,7 @@
 } // namespace SPV
 
 #if !defined (use_cpp11)
-#include <stdio.h>
+#include <cstdio>
 
 namespace spv {
 class spirvbin_t : public spirvbin_base_t
@@ -82,7 +82,7 @@
 public:
     spirvbin_t(int /*verbose = 0*/) { }
 
-    void remap(std::vector<unsigned int>& /*spv*/, unsigned int /*opts = 0*/)
+    void remap(std::vector<std::uint32_t>& /*spv*/, unsigned int /*opts = 0*/)
     {
         printf("Tool not compiled for C++11, which is required for SPIR-V remapping.\n");
         exit(5);
@@ -159,16 +159,21 @@
    typedef std::set<int>                    posmap_t;
    typedef std::unordered_map<spv::Id, int> posmap_rev_t;
 
+   // Maps and ID to the size of its base type, if known.
+   typedef std::unordered_map<spv::Id, unsigned> typesize_map_t;
+
    // handle error
    void error(const std::string& txt) const { errorHandler(txt); }
 
-   bool    isConstOp(spv::Op opCode)       const;
-   bool    isTypeOp(spv::Op opCode)        const;
-   bool    isStripOp(spv::Op opCode)       const;
-   bool    isFlowCtrl(spv::Op opCode)      const;
-   range_t literalRange(spv::Op opCode)    const;
-   range_t typeRange(spv::Op opCode)       const;
-   range_t constRange(spv::Op opCode)      const;
+   bool     isConstOp(spv::Op opCode)      const;
+   bool     isTypeOp(spv::Op opCode)       const;
+   bool     isStripOp(spv::Op opCode)      const;
+   bool     isFlowCtrl(spv::Op opCode)     const;
+   range_t  literalRange(spv::Op opCode)   const;
+   range_t  typeRange(spv::Op opCode)      const;
+   range_t  constRange(spv::Op opCode)     const;
+   unsigned typeSizeInWords(spv::Id id)    const;
+   unsigned idTypeSizeInWords(spv::Id id)  const;
    
    spv::Id&        asId(unsigned word)                { return spv[word]; }
    const spv::Id&  asId(unsigned word)          const { return spv[word]; }
@@ -177,10 +182,10 @@
    spv::Decoration asDecoration(unsigned word)  const { return spv::Decoration(spv[word]); }
    unsigned        asWordCount(unsigned word)   const { return opWordCount(spv[word]); }
    spv::Id         asTypeConstId(unsigned word) const { return asId(word + (isTypeOp(asOpCode(word)) ? 1 : 2)); }
-   unsigned        typePos(spv::Id id)          const;
+   unsigned        idPos(spv::Id id)            const;
 
-   static unsigned    opWordCount(spirword_t data) { return data >> spv::WordCountShift; }
-   static spv::Op     opOpCode(spirword_t data)    { return spv::Op(data & spv::OpCodeMask); }
+   static unsigned opWordCount(spirword_t data) { return data >> spv::WordCountShift; }
+   static spv::Op  opOpCode(spirword_t data)    { return spv::Op(data & spv::OpCodeMask); }
 
    // Header access & set methods
    spirword_t  magic()    const       { return spv[0]; } // return magic number
@@ -263,8 +268,9 @@
    // Which functions are called, anywhere in the module, with a call count
    std::unordered_map<spv::Id, int> fnCalls;
    
-   posmap_t     typeConstPos;   // word positions that define types & consts (ordered)
-   posmap_rev_t typeConstPosR;  // reverse map from IDs to positions
+   posmap_t       typeConstPos;  // word positions that define types & consts (ordered)
+   posmap_rev_t   idPosR;        // reverse map from IDs to positions
+   typesize_map_t idTypeSizeMap; // maps each ID to its type size, if known.
    
    std::vector<spv::Id>  idMapL;   // ID {M}ap from {L}ocal to {G}lobal IDs
 
diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp
index 1411d16..a881d1b 100644
--- a/SPIRV/SpvBuilder.cpp
+++ b/SPIRV/SpvBuilder.cpp
@@ -38,8 +38,8 @@
 // SpvBuilder.h.
 //
 
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdlib>
 
 #include <unordered_set>
 #include <algorithm>
@@ -931,7 +931,7 @@
 }
 
 // Comments in header
-Function* Builder::makeEntrypoint(const char* entryPoint)
+Function* Builder::makeEntryPoint(const char* entryPoint)
 {
     assert(! mainFunction);
 
@@ -1328,15 +1328,20 @@
 // Comments in header
 Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, std::vector<unsigned>& channels)
 {
-    assert(getNumComponents(source) == (int)channels.size());
     if (channels.size() == 1 && getNumComponents(source) == 1)
         return createCompositeInsert(source, target, typeId, channels.front());
 
     Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle);
-    assert(isVector(source));
     assert(isVector(target));
     swizzle->addIdOperand(target);
-    swizzle->addIdOperand(source);
+    if (accessChain.component != NoResult)
+        // For dynamic component selection, source does not involve in l-value swizzle
+        swizzle->addIdOperand(target);
+    else {
+        assert(getNumComponents(source) == (int)channels.size());
+        assert(isVector(source));
+        swizzle->addIdOperand(source);
+    }
 
     // Set up an identity shuffle from the base value to the result value
     unsigned int components[4];
@@ -1345,8 +1350,12 @@
         components[i] = i;
 
     // Punch in the l-value swizzle
-    for (int i = 0; i < (int)channels.size(); ++i)
-        components[channels[i]] = numTargetComponents + i;
+    for (int i = 0; i < (int)channels.size(); ++i) {
+        if (accessChain.component != NoResult)
+            components[i] = channels[i]; // Only shuffle the base value
+        else
+            components[channels[i]] = numTargetComponents + i;
+    }
 
     // finish the instruction with these components selectors
     for (int i = 0; i < numTargetComponents; ++i)
@@ -2118,9 +2127,6 @@
     transferAccessChainSwizzle(true);
     Id base = collapseAccessChain();
 
-    if (accessChain.swizzle.size() && accessChain.component != NoResult)
-        logger->missingFunctionality("simultaneous l-value swizzle and dynamic component selection");
-
     // If swizzle still exists, it is out-of-order or not full, we must load the target vector,
     // extract and insert elements to perform writeMask and/or swizzle.
     Id source = NoResult;
diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h
index 00e85b8..38dc1fa 100755
--- a/SPIRV/SpvBuilder.h
+++ b/SPIRV/SpvBuilder.h
@@ -210,7 +210,7 @@
 
     // Make the entry-point function. The returned pointer is only valid
     // for the lifetime of this builder.
-    Function* makeEntrypoint(const char*);
+    Function* makeEntryPoint(const char*);
 
     // Make a shader-style function, and create its entry block if entry is non-zero.
     // Return the function, pass back the entry.
@@ -467,7 +467,7 @@
 
     //
     // the SPIR-V builder maintains a single active chain that
-    // the following methods operated on
+    // the following methods operate on
     //
 
     // for external save and restore
diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp
index b60b3ba..b1023b9 100644
--- a/SPIRV/disassemble.cpp
+++ b/SPIRV/disassemble.cpp
@@ -36,9 +36,9 @@
 // Disassembler for SPIR-V.
 //
 
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
+#include <cstdlib>
+#include <cstring>
+#include <cassert>
 #include <iomanip>
 #include <stack>
 #include <sstream>
@@ -217,10 +217,12 @@
 
 void SpirvStream::formatId(Id id, std::stringstream& idStream)
 {
-    if (id >= bound)
-        Kill(out, "Bad <id>");
-
     if (id != 0) {
+        // On instructions with no IDs, this is called with "0", which does not
+        // have to be within ID bounds on null shaders.
+        if (id >= bound)
+            Kill(out, "Bad <id>");
+
         idStream << id;
         if (idDescriptor[id].size() > 0)
             idStream << "(" << idDescriptor[id] << ")";
@@ -334,7 +336,7 @@
         idDescriptor[resultId] = (const char*)(&stream[word]);
     }
     else {
-        if (idDescriptor[resultId].size() == 0) {
+        if (resultId != 0 && idDescriptor[resultId].size() == 0) {
             switch (opCode) {
             case OpTypeInt:
                 idDescriptor[resultId] = "int";
diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp
index 9b58b59..a25f7c0 100755
--- a/SPIRV/doc.cpp
+++ b/SPIRV/doc.cpp
@@ -33,7 +33,7 @@
 //POSSIBILITY OF SUCH DAMAGE.
 
 //
-// 1) Programatically fill in instruction/operand information.
+// 1) Programmatically fill in instruction/operand information.
 //    This can be used for disassembly, printing documentation, etc.
 //
 // 2) Print documentation from this parameterization.
@@ -41,8 +41,8 @@
 
 #include "doc.h"
 
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstring>
 #include <algorithm>
 
 #ifdef AMD_EXTENSIONS
diff --git a/SPIRV/doc.h b/SPIRV/doc.h
index cf9e059..743896f 100644
--- a/SPIRV/doc.h
+++ b/SPIRV/doc.h
@@ -149,7 +149,7 @@
     OperandMemorySemantics,
     OperandMemoryAccess,
     OperandScope,
-	OperandGroupOperation,
+    OperandGroupOperation,
     OperandKernelEnqueueFlags,
     OperandKernelProfilingInfo,
     OperandCapability,
diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index d69351e..231ba27 100644
--- a/StandAlone/CMakeLists.txt
+++ b/StandAlone/CMakeLists.txt
@@ -24,6 +24,7 @@
     OSDependent
     HLSL
     SPIRV
+    SPVRemapper
     glslang-default-resource-limits)
 
 if(WIN32)
diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp
index 8019863..8a5e6f3 100644
--- a/StandAlone/ResourceLimits.cpp
+++ b/StandAlone/ResourceLimits.cpp
@@ -241,8 +241,10 @@
 void DecodeResourceLimits(TBuiltInResource* resources, char* config)
 {
     const char* delims = " \t\n\r";
+#pragma warning(suppress: 4996)
     const char* token = strtok(config, delims);
     while (token) {
+#pragma warning(suppress: 4996)
         const char* valueStr = strtok(0, delims);
         if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) {
             printf("Error: '%s' bad .conf file.  Each name must be followed by one number.\n", valueStr ? valueStr : "");
@@ -438,6 +440,7 @@
         else
             printf("Warning: unrecognized limit (%s) in configuration file.\n", token);
 
+#pragma warning(suppress: 4996)
         token = strtok(0, delims);
     }
 }
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index c014be2..606f247 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -46,9 +46,9 @@
 #include "../SPIRV/GLSL.std.450.h"
 #include "../SPIRV/doc.h"
 #include "../SPIRV/disassemble.h"
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
+#include <cstring>
+#include <cstdlib>
+#include <cmath>
 
 #include "../glslang/OSDependent/osinclude.h"
 
@@ -155,6 +155,7 @@
 const char* ExecutableName = nullptr;
 const char* binaryFileName = nullptr;
 const char* entryPointName = nullptr;
+const char* shaderStageName = nullptr;
 
 //
 // Create the default name for saving a binary if -o is not provided.
@@ -236,6 +237,15 @@
                 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;
@@ -402,7 +412,26 @@
 struct ShaderCompUnit {
     EShLanguage stage;
     std::string fileName;
-    char** text;           // memory owned/managed externally
+    char** text;             // memory owned/managed externally
+    const char*  fileNameList[1];
+
+    // 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(const ShaderCompUnit &rhs)
+    {
+        stage = rhs.stage;
+        fileName = rhs.fileName;
+        text = rhs.text;
+        fileNameList[0] = fileName.c_str();
+    }
+
 };
 
 //
@@ -429,7 +458,7 @@
     for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) {
         const auto &compUnit = *it;
         glslang::TShader* shader = new glslang::TShader(compUnit.stage);
-        shader->setStrings(compUnit.text, 1);
+        shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, 1);
         if (entryPointName) // HLSL todo: this needs to be tracked per compUnits
             shader->setEntryPoint(entryPointName);
         shaders.push_back(shader);
@@ -685,6 +714,9 @@
     }
 
     std::string suffix = name.substr(ext + 1, std::string::npos);
+    if (shaderStageName)
+        suffix = shaderStageName;
+
     if (suffix == "vert")
         return EShLangVertex;
     else if (suffix == "tesc")
@@ -778,6 +810,8 @@
            "  -H          print human readable form of SPIR-V; turns on -V\n"
            "  -E          print pre-processed GLSL; cannot be used with -l;\n"
            "              errors will appear on stderr.\n"
+           "  -S <stage>  uses explicit stage specified, rather then the file extension.\n"
+           "              valid choices are vert, tesc, tese, geom, frag, or comp\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"
diff --git a/Test/400.vert b/Test/400.vert
index 2c3dd04..315c7ea 100644
--- a/Test/400.vert
+++ b/Test/400.vert
@@ -4,6 +4,103 @@
 in dvec3 d3;   // ERROR, no doubles
 in dmat4 dm4;  // ERROR, no doubles
 
-void main()
+// function selection under type conversion
+void foo1(double a, uint b)  {}

+void foo1(double a, int b)   {}

+void foo1(double a, float b) {}

+void foo1(double a, double b){}

+

+void foo2(double a, float b) {}

+void foo2(double a, double b){}

+

+void foo3(double a, float b) {}

+void foo3(float a, double b) {}

+

+void ftd(  int,  float, double) {}

+void ftd( uint,  float, double) {}

+void ftd(float, double, double) {}

+

+void main()

+{

+    double d;

+	uint u;

+	int i;

+	float f;

+

+	foo1(d, d);

+	foo1(d, u);

+	foo1(d, i);

+	foo1(d, f);

+

+	foo1(f, d);

+	foo1(f, u);

+	foo1(f, i);

+	foo1(f, f);

+

+	foo1(u, d);

+	foo1(u, u);

+	foo1(u, i);

+	foo1(u, f);

+

+	foo1(i, d);

+	foo1(i, u);

+	foo1(i, i);

+	foo1(i, f);

+

+	foo2(d, d);

+	foo2(d, u);

+	foo2(d, i);

+	foo2(d, f);

+

+	foo2(f, d);

+	foo2(f, u);

+	foo2(f, i);

+	foo2(f, f);

+

+	foo2(u, d);

+	foo2(u, u);

+	foo2(u, i);

+	foo2(u, f);

+

+	foo2(i, d);

+	foo2(i, u);

+	foo2(i, i);

+	foo2(i, f);

+

+	foo3(d, d);  // ERROR, no match

+	foo3(d, u);

+	foo3(d, i);

+	foo3(d, f);

+

+	foo3(f, d);

+	foo3(f, u); // ERROR, ambiguous

+	foo3(f, i); // ERROR, ambiguous

+	foo3(f, f); // ERROR, ambiguous

+

+	foo3(u, d);

+	foo3(u, u); // ERROR, ambiguous

+	foo3(u, i); // ERROR, ambiguous

+	foo3(u, f); // ERROR, ambiguous

+

+	foo3(i, d);

+	foo3(i, u); // ERROR, ambiguous

+	foo3(i, i); // ERROR, ambiguous

+	foo3(i, f); // ERROR, ambiguous

+

+	ftd(i, f, f);

+	ftd(u, f, f);

+}
+
+void itf(int, float, int);
+void itf(int, double, int);
+
+void tf()
 {
+    double d;

+	uint u;

+	int i;

+	float f;

+	
+	itf(i, i, i);
+	itf(i, u, i);
 }
diff --git a/Test/440.vert b/Test/440.vert
index bfcdfd2..2e61f79 100644
--- a/Test/440.vert
+++ b/Test/440.vert
@@ -73,6 +73,9 @@
 layout(location = 56, component = 3) out float sf2o;

 layout(location = 57, component = 2) out vec2 dv3o;

 layout(location = 57, component = 3) out float sf4o;     // ERROR, overlapping component

+layout(location=58) out flat dvec3 dv3o2;                // uses part of location 59

+layout(location=59, component=2) out flat double dfo3;   // okay, fits

+layout(location=59, component=0) out flat double dfo4;   // ERROR, overlaps the dvec3 in starting in 58

 

 out bblck1 {

     vec4 bbv;

diff --git a/Test/baseResults/120.frag.out b/Test/baseResults/120.frag.out
index 0d10b0e..4fa7600 100644
--- a/Test/baseResults/120.frag.out
+++ b/Test/baseResults/120.frag.out
@@ -23,7 +23,7 @@
 ERROR: 0:85: 'assign' :  l-value required 
 ERROR: 0:91: 'int' : overloaded functions must have the same return type 
 ERROR: 0:91: 'main' : function already has a body 
-ERROR: 0:91: 'int' :  main function cannot return a value
+ERROR: 0:91: 'int' :  entry point cannot return a value
 ERROR: 0:92: 'main' : function cannot take any parameter(s) 
 ERROR: 0:94: 'a' : variables with qualifier 'const' must be initialized 
 ERROR: 0:97: 'out' : overloaded functions must have the same parameter storage qualifiers for argument 1
diff --git a/Test/baseResults/400.vert.out b/Test/baseResults/400.vert.out
index 946f21d..2b0d63d 100755
--- a/Test/baseResults/400.vert.out
+++ b/Test/baseResults/400.vert.out
@@ -3,13 +3,288 @@
 ERROR: 0:3: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions 
 ERROR: 0:4: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions 
 ERROR: 0:5: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions 
-ERROR: 3 compilation errors.  No code generated.
+ERROR: 0:70: 'foo3' : no matching overloaded function found 
+ERROR: 0:76: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:77: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:78: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:81: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:82: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:83: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:86: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:87: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 0:88: 'foo3' : ambiguous best function under implicit type conversion 
+ERROR: 13 compilation errors.  No code generated.
 
 
 Shader version: 400
 ERROR: node is still EOpNull!
-0:7  Function Definition: main( (global void)
-0:7    Function Parameters: 
+0:8  Function Definition: foo1(d1;u1; (global void)
+0:8    Function Parameters: 
+0:8      'a' (in double)
+0:8      'b' (in uint)
+0:9  Function Definition: foo1(d1;i1; (global void)
+0:9    Function Parameters: 
+0:9      'a' (in double)
+0:9      'b' (in int)
+0:10  Function Definition: foo1(d1;f1; (global void)
+0:10    Function Parameters: 
+0:10      'a' (in double)
+0:10      'b' (in float)
+0:11  Function Definition: foo1(d1;d1; (global void)
+0:11    Function Parameters: 
+0:11      'a' (in double)
+0:11      'b' (in double)
+0:13  Function Definition: foo2(d1;f1; (global void)
+0:13    Function Parameters: 
+0:13      'a' (in double)
+0:13      'b' (in float)
+0:14  Function Definition: foo2(d1;d1; (global void)
+0:14    Function Parameters: 
+0:14      'a' (in double)
+0:14      'b' (in double)
+0:16  Function Definition: foo3(d1;f1; (global void)
+0:16    Function Parameters: 
+0:16      'a' (in double)
+0:16      'b' (in float)
+0:17  Function Definition: foo3(f1;d1; (global void)
+0:17    Function Parameters: 
+0:17      'a' (in float)
+0:17      'b' (in double)
+0:19  Function Definition: ftd(i1;f1;d1; (global void)
+0:19    Function Parameters: 
+0:19      '' (in int)
+0:19      '' (in float)
+0:19      '' (in double)
+0:20  Function Definition: ftd(u1;f1;d1; (global void)
+0:20    Function Parameters: 
+0:20      '' (in uint)
+0:20      '' (in float)
+0:20      '' (in double)
+0:21  Function Definition: ftd(f1;d1;d1; (global void)
+0:21    Function Parameters: 
+0:21      '' (in float)
+0:21      '' (in double)
+0:21      '' (in double)
+0:23  Function Definition: main( (global void)
+0:23    Function Parameters: 
+0:?     Sequence
+0:30      Function Call: foo1(d1;d1; (global void)
+0:30        'd' (temp double)
+0:30        'd' (temp double)
+0:31      Function Call: foo1(d1;u1; (global void)
+0:31        'd' (temp double)
+0:31        'u' (temp uint)
+0:32      Function Call: foo1(d1;i1; (global void)
+0:32        'd' (temp double)
+0:32        'i' (temp int)
+0:33      Function Call: foo1(d1;f1; (global void)
+0:33        'd' (temp double)
+0:33        'f' (temp float)
+0:35      Function Call: foo1(d1;d1; (global void)
+0:35        Convert float to double (temp double)
+0:35          'f' (temp float)
+0:35        'd' (temp double)
+0:36      Function Call: foo1(d1;u1; (global void)
+0:36        Convert float to double (temp double)
+0:36          'f' (temp float)
+0:36        'u' (temp uint)
+0:37      Function Call: foo1(d1;i1; (global void)
+0:37        Convert float to double (temp double)
+0:37          'f' (temp float)
+0:37        'i' (temp int)
+0:38      Function Call: foo1(d1;f1; (global void)
+0:38        Convert float to double (temp double)
+0:38          'f' (temp float)
+0:38        'f' (temp float)
+0:40      Function Call: foo1(d1;d1; (global void)
+0:40        Convert uint to double (temp double)
+0:40          'u' (temp uint)
+0:40        'd' (temp double)
+0:41      Function Call: foo1(d1;u1; (global void)
+0:41        Convert uint to double (temp double)
+0:41          'u' (temp uint)
+0:41        'u' (temp uint)
+0:42      Function Call: foo1(d1;i1; (global void)
+0:42        Convert uint to double (temp double)
+0:42          'u' (temp uint)
+0:42        'i' (temp int)
+0:43      Function Call: foo1(d1;f1; (global void)
+0:43        Convert uint to double (temp double)
+0:43          'u' (temp uint)
+0:43        'f' (temp float)
+0:45      Function Call: foo1(d1;d1; (global void)
+0:45        Convert int to double (temp double)
+0:45          'i' (temp int)
+0:45        'd' (temp double)
+0:46      Function Call: foo1(d1;u1; (global void)
+0:46        Convert int to double (temp double)
+0:46          'i' (temp int)
+0:46        'u' (temp uint)
+0:47      Function Call: foo1(d1;i1; (global void)
+0:47        Convert int to double (temp double)
+0:47          'i' (temp int)
+0:47        'i' (temp int)
+0:48      Function Call: foo1(d1;f1; (global void)
+0:48        Convert int to double (temp double)
+0:48          'i' (temp int)
+0:48        'f' (temp float)
+0:50      Function Call: foo2(d1;d1; (global void)
+0:50        'd' (temp double)
+0:50        'd' (temp double)
+0:51      Function Call: foo2(d1;f1; (global void)
+0:51        'd' (temp double)
+0:51        Convert uint to float (temp float)
+0:51          'u' (temp uint)
+0:52      Function Call: foo2(d1;f1; (global void)
+0:52        'd' (temp double)
+0:52        Convert int to float (temp float)
+0:52          'i' (temp int)
+0:53      Function Call: foo2(d1;f1; (global void)
+0:53        'd' (temp double)
+0:53        'f' (temp float)
+0:55      Function Call: foo2(d1;d1; (global void)
+0:55        Convert float to double (temp double)
+0:55          'f' (temp float)
+0:55        'd' (temp double)
+0:56      Function Call: foo2(d1;f1; (global void)
+0:56        Convert float to double (temp double)
+0:56          'f' (temp float)
+0:56        Convert uint to float (temp float)
+0:56          'u' (temp uint)
+0:57      Function Call: foo2(d1;f1; (global void)
+0:57        Convert float to double (temp double)
+0:57          'f' (temp float)
+0:57        Convert int to float (temp float)
+0:57          'i' (temp int)
+0:58      Function Call: foo2(d1;f1; (global void)
+0:58        Convert float to double (temp double)
+0:58          'f' (temp float)
+0:58        'f' (temp float)
+0:60      Function Call: foo2(d1;d1; (global void)
+0:60        Convert uint to double (temp double)
+0:60          'u' (temp uint)
+0:60        'd' (temp double)
+0:61      Function Call: foo2(d1;f1; (global void)
+0:61        Convert uint to double (temp double)
+0:61          'u' (temp uint)
+0:61        Convert uint to float (temp float)
+0:61          'u' (temp uint)
+0:62      Function Call: foo2(d1;f1; (global void)
+0:62        Convert uint to double (temp double)
+0:62          'u' (temp uint)
+0:62        Convert int to float (temp float)
+0:62          'i' (temp int)
+0:63      Function Call: foo2(d1;f1; (global void)
+0:63        Convert uint to double (temp double)
+0:63          'u' (temp uint)
+0:63        'f' (temp float)
+0:65      Function Call: foo2(d1;d1; (global void)
+0:65        Convert int to double (temp double)
+0:65          'i' (temp int)
+0:65        'd' (temp double)
+0:66      Function Call: foo2(d1;f1; (global void)
+0:66        Convert int to double (temp double)
+0:66          'i' (temp int)
+0:66        Convert uint to float (temp float)
+0:66          'u' (temp uint)
+0:67      Function Call: foo2(d1;f1; (global void)
+0:67        Convert int to double (temp double)
+0:67          'i' (temp int)
+0:67        Convert int to float (temp float)
+0:67          'i' (temp int)
+0:68      Function Call: foo2(d1;f1; (global void)
+0:68        Convert int to double (temp double)
+0:68          'i' (temp int)
+0:68        'f' (temp float)
+0:70      Constant:
+0:70        0.000000
+0:71      Function Call: foo3(d1;f1; (global void)
+0:71        'd' (temp double)
+0:71        Convert uint to float (temp float)
+0:71          'u' (temp uint)
+0:72      Function Call: foo3(d1;f1; (global void)
+0:72        'd' (temp double)
+0:72        Convert int to float (temp float)
+0:72          'i' (temp int)
+0:73      Function Call: foo3(d1;f1; (global void)
+0:73        'd' (temp double)
+0:73        'f' (temp float)
+0:75      Function Call: foo3(f1;d1; (global void)
+0:75        'f' (temp float)
+0:75        'd' (temp double)
+0:76      Function Call: foo3(d1;f1; (global void)
+0:76        Convert float to double (temp double)
+0:76          'f' (temp float)
+0:76        Convert uint to float (temp float)
+0:76          'u' (temp uint)
+0:77      Function Call: foo3(d1;f1; (global void)
+0:77        Convert float to double (temp double)
+0:77          'f' (temp float)
+0:77        Convert int to float (temp float)
+0:77          'i' (temp int)
+0:78      Function Call: foo3(d1;f1; (global void)
+0:78        Convert float to double (temp double)
+0:78          'f' (temp float)
+0:78        'f' (temp float)
+0:80      Function Call: foo3(f1;d1; (global void)
+0:80        Convert uint to float (temp float)
+0:80          'u' (temp uint)
+0:80        'd' (temp double)
+0:81      Function Call: foo3(d1;f1; (global void)
+0:81        Convert uint to double (temp double)
+0:81          'u' (temp uint)
+0:81        Convert uint to float (temp float)
+0:81          'u' (temp uint)
+0:82      Function Call: foo3(d1;f1; (global void)
+0:82        Convert uint to double (temp double)
+0:82          'u' (temp uint)
+0:82        Convert int to float (temp float)
+0:82          'i' (temp int)
+0:83      Function Call: foo3(d1;f1; (global void)
+0:83        Convert uint to double (temp double)
+0:83          'u' (temp uint)
+0:83        'f' (temp float)
+0:85      Function Call: foo3(f1;d1; (global void)
+0:85        Convert int to float (temp float)
+0:85          'i' (temp int)
+0:85        'd' (temp double)
+0:86      Function Call: foo3(d1;f1; (global void)
+0:86        Convert int to double (temp double)
+0:86          'i' (temp int)
+0:86        Convert uint to float (temp float)
+0:86          'u' (temp uint)
+0:87      Function Call: foo3(d1;f1; (global void)
+0:87        Convert int to double (temp double)
+0:87          'i' (temp int)
+0:87        Convert int to float (temp float)
+0:87          'i' (temp int)
+0:88      Function Call: foo3(d1;f1; (global void)
+0:88        Convert int to double (temp double)
+0:88          'i' (temp int)
+0:88        'f' (temp float)
+0:90      Function Call: ftd(i1;f1;d1; (global void)
+0:90        'i' (temp int)
+0:90        'f' (temp float)
+0:90        Convert float to double (temp double)
+0:90          'f' (temp float)
+0:91      Function Call: ftd(u1;f1;d1; (global void)
+0:91        'u' (temp uint)
+0:91        'f' (temp float)
+0:91        Convert float to double (temp double)
+0:91          'f' (temp float)
+0:97  Function Definition: tf( (global void)
+0:97    Function Parameters: 
+0:?     Sequence
+0:104      Function Call: itf(i1;f1;i1; (global void)
+0:104        'i' (temp int)
+0:104        Convert int to float (temp float)
+0:104          'i' (temp int)
+0:104        'i' (temp int)
+0:105      Function Call: itf(i1;f1;i1; (global void)
+0:105        'i' (temp int)
+0:105        Convert uint to float (temp float)
+0:105          'u' (temp uint)
+0:105        'i' (temp int)
 0:?   Linker Objects
 0:?     'd' (in double)
 0:?     'd3' (in 3-component vector of double)
@@ -23,8 +298,273 @@
 
 Shader version: 400
 ERROR: node is still EOpNull!
-0:7  Function Definition: main( (global void)
-0:7    Function Parameters: 
+0:8  Function Definition: foo1(d1;u1; (global void)
+0:8    Function Parameters: 
+0:8      'a' (in double)
+0:8      'b' (in uint)
+0:9  Function Definition: foo1(d1;i1; (global void)
+0:9    Function Parameters: 
+0:9      'a' (in double)
+0:9      'b' (in int)
+0:10  Function Definition: foo1(d1;f1; (global void)
+0:10    Function Parameters: 
+0:10      'a' (in double)
+0:10      'b' (in float)
+0:11  Function Definition: foo1(d1;d1; (global void)
+0:11    Function Parameters: 
+0:11      'a' (in double)
+0:11      'b' (in double)
+0:13  Function Definition: foo2(d1;f1; (global void)
+0:13    Function Parameters: 
+0:13      'a' (in double)
+0:13      'b' (in float)
+0:14  Function Definition: foo2(d1;d1; (global void)
+0:14    Function Parameters: 
+0:14      'a' (in double)
+0:14      'b' (in double)
+0:16  Function Definition: foo3(d1;f1; (global void)
+0:16    Function Parameters: 
+0:16      'a' (in double)
+0:16      'b' (in float)
+0:17  Function Definition: foo3(f1;d1; (global void)
+0:17    Function Parameters: 
+0:17      'a' (in float)
+0:17      'b' (in double)
+0:19  Function Definition: ftd(i1;f1;d1; (global void)
+0:19    Function Parameters: 
+0:19      '' (in int)
+0:19      '' (in float)
+0:19      '' (in double)
+0:20  Function Definition: ftd(u1;f1;d1; (global void)
+0:20    Function Parameters: 
+0:20      '' (in uint)
+0:20      '' (in float)
+0:20      '' (in double)
+0:21  Function Definition: ftd(f1;d1;d1; (global void)
+0:21    Function Parameters: 
+0:21      '' (in float)
+0:21      '' (in double)
+0:21      '' (in double)
+0:23  Function Definition: main( (global void)
+0:23    Function Parameters: 
+0:?     Sequence
+0:30      Function Call: foo1(d1;d1; (global void)
+0:30        'd' (temp double)
+0:30        'd' (temp double)
+0:31      Function Call: foo1(d1;u1; (global void)
+0:31        'd' (temp double)
+0:31        'u' (temp uint)
+0:32      Function Call: foo1(d1;i1; (global void)
+0:32        'd' (temp double)
+0:32        'i' (temp int)
+0:33      Function Call: foo1(d1;f1; (global void)
+0:33        'd' (temp double)
+0:33        'f' (temp float)
+0:35      Function Call: foo1(d1;d1; (global void)
+0:35        Convert float to double (temp double)
+0:35          'f' (temp float)
+0:35        'd' (temp double)
+0:36      Function Call: foo1(d1;u1; (global void)
+0:36        Convert float to double (temp double)
+0:36          'f' (temp float)
+0:36        'u' (temp uint)
+0:37      Function Call: foo1(d1;i1; (global void)
+0:37        Convert float to double (temp double)
+0:37          'f' (temp float)
+0:37        'i' (temp int)
+0:38      Function Call: foo1(d1;f1; (global void)
+0:38        Convert float to double (temp double)
+0:38          'f' (temp float)
+0:38        'f' (temp float)
+0:40      Function Call: foo1(d1;d1; (global void)
+0:40        Convert uint to double (temp double)
+0:40          'u' (temp uint)
+0:40        'd' (temp double)
+0:41      Function Call: foo1(d1;u1; (global void)
+0:41        Convert uint to double (temp double)
+0:41          'u' (temp uint)
+0:41        'u' (temp uint)
+0:42      Function Call: foo1(d1;i1; (global void)
+0:42        Convert uint to double (temp double)
+0:42          'u' (temp uint)
+0:42        'i' (temp int)
+0:43      Function Call: foo1(d1;f1; (global void)
+0:43        Convert uint to double (temp double)
+0:43          'u' (temp uint)
+0:43        'f' (temp float)
+0:45      Function Call: foo1(d1;d1; (global void)
+0:45        Convert int to double (temp double)
+0:45          'i' (temp int)
+0:45        'd' (temp double)
+0:46      Function Call: foo1(d1;u1; (global void)
+0:46        Convert int to double (temp double)
+0:46          'i' (temp int)
+0:46        'u' (temp uint)
+0:47      Function Call: foo1(d1;i1; (global void)
+0:47        Convert int to double (temp double)
+0:47          'i' (temp int)
+0:47        'i' (temp int)
+0:48      Function Call: foo1(d1;f1; (global void)
+0:48        Convert int to double (temp double)
+0:48          'i' (temp int)
+0:48        'f' (temp float)
+0:50      Function Call: foo2(d1;d1; (global void)
+0:50        'd' (temp double)
+0:50        'd' (temp double)
+0:51      Function Call: foo2(d1;f1; (global void)
+0:51        'd' (temp double)
+0:51        Convert uint to float (temp float)
+0:51          'u' (temp uint)
+0:52      Function Call: foo2(d1;f1; (global void)
+0:52        'd' (temp double)
+0:52        Convert int to float (temp float)
+0:52          'i' (temp int)
+0:53      Function Call: foo2(d1;f1; (global void)
+0:53        'd' (temp double)
+0:53        'f' (temp float)
+0:55      Function Call: foo2(d1;d1; (global void)
+0:55        Convert float to double (temp double)
+0:55          'f' (temp float)
+0:55        'd' (temp double)
+0:56      Function Call: foo2(d1;f1; (global void)
+0:56        Convert float to double (temp double)
+0:56          'f' (temp float)
+0:56        Convert uint to float (temp float)
+0:56          'u' (temp uint)
+0:57      Function Call: foo2(d1;f1; (global void)
+0:57        Convert float to double (temp double)
+0:57          'f' (temp float)
+0:57        Convert int to float (temp float)
+0:57          'i' (temp int)
+0:58      Function Call: foo2(d1;f1; (global void)
+0:58        Convert float to double (temp double)
+0:58          'f' (temp float)
+0:58        'f' (temp float)
+0:60      Function Call: foo2(d1;d1; (global void)
+0:60        Convert uint to double (temp double)
+0:60          'u' (temp uint)
+0:60        'd' (temp double)
+0:61      Function Call: foo2(d1;f1; (global void)
+0:61        Convert uint to double (temp double)
+0:61          'u' (temp uint)
+0:61        Convert uint to float (temp float)
+0:61          'u' (temp uint)
+0:62      Function Call: foo2(d1;f1; (global void)
+0:62        Convert uint to double (temp double)
+0:62          'u' (temp uint)
+0:62        Convert int to float (temp float)
+0:62          'i' (temp int)
+0:63      Function Call: foo2(d1;f1; (global void)
+0:63        Convert uint to double (temp double)
+0:63          'u' (temp uint)
+0:63        'f' (temp float)
+0:65      Function Call: foo2(d1;d1; (global void)
+0:65        Convert int to double (temp double)
+0:65          'i' (temp int)
+0:65        'd' (temp double)
+0:66      Function Call: foo2(d1;f1; (global void)
+0:66        Convert int to double (temp double)
+0:66          'i' (temp int)
+0:66        Convert uint to float (temp float)
+0:66          'u' (temp uint)
+0:67      Function Call: foo2(d1;f1; (global void)
+0:67        Convert int to double (temp double)
+0:67          'i' (temp int)
+0:67        Convert int to float (temp float)
+0:67          'i' (temp int)
+0:68      Function Call: foo2(d1;f1; (global void)
+0:68        Convert int to double (temp double)
+0:68          'i' (temp int)
+0:68        'f' (temp float)
+0:70      Constant:
+0:70        0.000000
+0:71      Function Call: foo3(d1;f1; (global void)
+0:71        'd' (temp double)
+0:71        Convert uint to float (temp float)
+0:71          'u' (temp uint)
+0:72      Function Call: foo3(d1;f1; (global void)
+0:72        'd' (temp double)
+0:72        Convert int to float (temp float)
+0:72          'i' (temp int)
+0:73      Function Call: foo3(d1;f1; (global void)
+0:73        'd' (temp double)
+0:73        'f' (temp float)
+0:75      Function Call: foo3(f1;d1; (global void)
+0:75        'f' (temp float)
+0:75        'd' (temp double)
+0:76      Function Call: foo3(d1;f1; (global void)
+0:76        Convert float to double (temp double)
+0:76          'f' (temp float)
+0:76        Convert uint to float (temp float)
+0:76          'u' (temp uint)
+0:77      Function Call: foo3(d1;f1; (global void)
+0:77        Convert float to double (temp double)
+0:77          'f' (temp float)
+0:77        Convert int to float (temp float)
+0:77          'i' (temp int)
+0:78      Function Call: foo3(d1;f1; (global void)
+0:78        Convert float to double (temp double)
+0:78          'f' (temp float)
+0:78        'f' (temp float)
+0:80      Function Call: foo3(f1;d1; (global void)
+0:80        Convert uint to float (temp float)
+0:80          'u' (temp uint)
+0:80        'd' (temp double)
+0:81      Function Call: foo3(d1;f1; (global void)
+0:81        Convert uint to double (temp double)
+0:81          'u' (temp uint)
+0:81        Convert uint to float (temp float)
+0:81          'u' (temp uint)
+0:82      Function Call: foo3(d1;f1; (global void)
+0:82        Convert uint to double (temp double)
+0:82          'u' (temp uint)
+0:82        Convert int to float (temp float)
+0:82          'i' (temp int)
+0:83      Function Call: foo3(d1;f1; (global void)
+0:83        Convert uint to double (temp double)
+0:83          'u' (temp uint)
+0:83        'f' (temp float)
+0:85      Function Call: foo3(f1;d1; (global void)
+0:85        Convert int to float (temp float)
+0:85          'i' (temp int)
+0:85        'd' (temp double)
+0:86      Function Call: foo3(d1;f1; (global void)
+0:86        Convert int to double (temp double)
+0:86          'i' (temp int)
+0:86        Convert uint to float (temp float)
+0:86          'u' (temp uint)
+0:87      Function Call: foo3(d1;f1; (global void)
+0:87        Convert int to double (temp double)
+0:87          'i' (temp int)
+0:87        Convert int to float (temp float)
+0:87          'i' (temp int)
+0:88      Function Call: foo3(d1;f1; (global void)
+0:88        Convert int to double (temp double)
+0:88          'i' (temp int)
+0:88        'f' (temp float)
+0:90      Function Call: ftd(i1;f1;d1; (global void)
+0:90        'i' (temp int)
+0:90        'f' (temp float)
+0:90        Convert float to double (temp double)
+0:90          'f' (temp float)
+0:91      Function Call: ftd(u1;f1;d1; (global void)
+0:91        'u' (temp uint)
+0:91        'f' (temp float)
+0:91        Convert float to double (temp double)
+0:91          'f' (temp float)
+0:97  Function Definition: tf( (global void)
+0:97    Function Parameters: 
+0:?     Sequence
+0:104      Function Call: itf(i1;f1;i1; (global void)
+0:104        'i' (temp int)
+0:104        Convert int to float (temp float)
+0:104          'i' (temp int)
+0:104        'i' (temp int)
+0:105      Function Call: itf(i1;f1;i1; (global void)
+0:105        'i' (temp int)
+0:105        Convert uint to float (temp float)
+0:105          'u' (temp uint)
+0:105        'i' (temp int)
 0:?   Linker Objects
 0:?     'd' (in double)
 0:?     'd3' (in 3-component vector of double)
diff --git a/Test/baseResults/420.geom.out b/Test/baseResults/420.geom.out
index 416df13..625feea 100644
--- a/Test/baseResults/420.geom.out
+++ b/Test/baseResults/420.geom.out
@@ -132,7 +132,7 @@
 
 Linked geometry stage:
 
-ERROR: Linking geometry stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking geometry stage: Missing entry point: Each stage requires one entry point
 ERROR: Linking geometry stage: At least one shader must specify an output layout primitive
 ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
 
diff --git a/Test/baseResults/420_size_gl_in.geom.out b/Test/baseResults/420_size_gl_in.geom.out
index 21d1944..28d09a6 100644
--- a/Test/baseResults/420_size_gl_in.geom.out
+++ b/Test/baseResults/420_size_gl_in.geom.out
@@ -39,7 +39,7 @@
 
 Linked geometry stage:
 
-ERROR: Linking geometry stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking geometry stage: Missing entry point: Each stage requires one entry point
 ERROR: Linking geometry stage: At least one shader must specify an output layout primitive
 ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
 
diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out
index 4b7825b..676fcd3 100644
--- a/Test/baseResults/430.vert.out
+++ b/Test/baseResults/430.vert.out
@@ -266,7 +266,7 @@
 
 Linked vertex stage:
 
-ERROR: Linking vertex stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
 ERROR: Linking vertex stage: xfb_stride is too small to hold all buffer entries:
 ERROR:     xfb_buffer 3, xfb_stride 64, minimum stride needed: 80
 
diff --git a/Test/baseResults/440.frag.out b/Test/baseResults/440.frag.out
index cafd85a..064fe19 100644
--- a/Test/baseResults/440.frag.out
+++ b/Test/baseResults/440.frag.out
@@ -122,7 +122,7 @@
 
 Linked fragment stage:
 
-ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
 
 Shader version: 440
 ERROR: node is still EOpNull!
diff --git a/Test/baseResults/440.vert.out b/Test/baseResults/440.vert.out
index d4cbb0b..022ddec 100644
--- a/Test/baseResults/440.vert.out
+++ b/Test/baseResults/440.vert.out
@@ -23,74 +23,75 @@
 ERROR: 0:67: 'component' : type overflows the available 4 components 
 ERROR: 0:71: 'location' : overlapping use of location 55
 ERROR: 0:75: 'location' : overlapping use of location 57
-ERROR: 0:92: 'xfb layout qualifier' : can only be used on an output 
-ERROR: 0:98: 'xfb_offset' : cannot declare a default, use a full declaration 
-ERROR: 0:108: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) 
-ERROR: 0:113: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) 
-ERROR: 0:113: 'xfb_offset' : overlapping offsets at offset 32 in buffer 3
-ERROR: 0:114: 'xfb_offset' : overlapping offsets at offset 0 in buffer 2
-ERROR: 0:116: 'xfb_offset' : overlapping offsets at offset 24 in buffer 2
-ERROR: 0:119: 'xfb_stride' : all stride settings must match for xfb buffer 15
-ERROR: 0:123: 'xfb_offset' : overlapping offsets at offset 4 in buffer 1
-ERROR: 0:125: 'xfb_stride' : all stride settings must match for xfb buffer 3
-ERROR: 0:126: 'xfb_stride' : all stride settings must match for xfb buffer 3
-ERROR: 0:130: 'xfb_stride' : all stride settings must match for xfb buffer 3
+ERROR: 0:78: 'location' : overlapping use of location 59
+ERROR: 0:95: 'xfb layout qualifier' : can only be used on an output 
+ERROR: 0:101: 'xfb_offset' : cannot declare a default, use a full declaration 
+ERROR: 0:111: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) 
+ERROR: 0:116: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) 
+ERROR: 0:116: 'xfb_offset' : overlapping offsets at offset 32 in buffer 3
+ERROR: 0:117: 'xfb_offset' : overlapping offsets at offset 0 in buffer 2
+ERROR: 0:119: 'xfb_offset' : overlapping offsets at offset 24 in buffer 2
+ERROR: 0:122: 'xfb_stride' : all stride settings must match for xfb buffer 15
+ERROR: 0:126: 'xfb_offset' : overlapping offsets at offset 4 in buffer 1
 ERROR: 0:128: 'xfb_stride' : all stride settings must match for xfb buffer 3
-ERROR: 0:149: 'xfb_offset' : overlapping offsets at offset 64 in buffer 0
-ERROR: 0:154: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
-ERROR: 0:155: 'xfb_offset' : must be a multiple of size of first component 
-ERROR: 0:156: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 
+ERROR: 0:129: 'xfb_stride' : all stride settings must match for xfb buffer 3
+ERROR: 0:133: 'xfb_stride' : all stride settings must match for xfb buffer 3
+ERROR: 0:131: 'xfb_stride' : all stride settings must match for xfb buffer 3
+ERROR: 0:152: 'xfb_offset' : overlapping offsets at offset 64 in buffer 0
+ERROR: 0:157: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
 ERROR: 0:158: 'xfb_offset' : must be a multiple of size of first component 
 ERROR: 0:159: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 
-ERROR: 0:163: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
+ERROR: 0:161: 'xfb_offset' : must be a multiple of size of first component 
+ERROR: 0:162: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 
 ERROR: 0:166: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
-ERROR: 0:166: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64
-ERROR: 0:168: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
-ERROR: 0:176: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters
-ERROR: 0:176: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters
-ERROR: 0:176: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters
-ERROR: 0:184: 'assign' :  l-value required "gl_BaseVertexARB" (can't modify shader input)
-ERROR: 0:185: 'assign' :  l-value required "gl_BaseInstanceARB" (can't modify shader input)
-ERROR: 0:186: 'assign' :  l-value required "gl_DrawIDARB" (can't modify shader input)
-ERROR: 0:187: 'glBaseInstanceARB' : undeclared identifier 
-ERROR: 53 compilation errors.  No code generated.
+ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
+ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64
+ERROR: 0:171: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
+ERROR: 0:179: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters
+ERROR: 0:179: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters
+ERROR: 0:179: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters
+ERROR: 0:187: 'assign' :  l-value required "gl_BaseVertexARB" (can't modify shader input)
+ERROR: 0:188: 'assign' :  l-value required "gl_BaseInstanceARB" (can't modify shader input)
+ERROR: 0:189: 'assign' :  l-value required "gl_DrawIDARB" (can't modify shader input)
+ERROR: 0:190: 'glBaseInstanceARB' : undeclared identifier 
+ERROR: 54 compilation errors.  No code generated.
 
 
 Shader version: 440
 Requested GL_ARB_shader_draw_parameters
 in xfb mode
 ERROR: node is still EOpNull!
-0:174  Function Definition: drawParamsBad( (global int)
-0:174    Function Parameters: 
-0:176    Sequence
-0:176      Branch: Return with expression
-0:176        add (temp int)
-0:176          add (temp int)
-0:176            'gl_BaseVertexARB' (in int BaseVertex)
-0:176            'gl_BaseInstanceARB' (in int BaseInstance)
-0:176          'gl_DrawIDARB' (in int DrawId)
-0:181  Function Definition: drawParams( (global int)
-0:181    Function Parameters: 
-0:183    Sequence
-0:183      Branch: Return with expression
-0:183        add (temp int)
-0:183          add (temp int)
-0:183            'gl_BaseVertexARB' (in int BaseVertex)
-0:183            'gl_BaseInstanceARB' (in int BaseInstance)
-0:183          'gl_DrawIDARB' (in int DrawId)
-0:184      move second child to first child (temp int)
-0:184        'gl_BaseVertexARB' (in int BaseVertex)
-0:184        Constant:
-0:184          3 (const int)
-0:185      move second child to first child (temp int)
-0:185        'gl_BaseInstanceARB' (in int BaseInstance)
-0:185        Constant:
-0:185          3 (const int)
-0:186      move second child to first child (temp int)
-0:186        'gl_DrawIDARB' (in int DrawId)
-0:186        Constant:
-0:186          3 (const int)
-0:187      'glBaseInstanceARB' (temp float)
+0:177  Function Definition: drawParamsBad( (global int)
+0:177    Function Parameters: 
+0:179    Sequence
+0:179      Branch: Return with expression
+0:179        add (temp int)
+0:179          add (temp int)
+0:179            'gl_BaseVertexARB' (in int BaseVertex)
+0:179            'gl_BaseInstanceARB' (in int BaseInstance)
+0:179          'gl_DrawIDARB' (in int DrawId)
+0:184  Function Definition: drawParams( (global int)
+0:184    Function Parameters: 
+0:186    Sequence
+0:186      Branch: Return with expression
+0:186        add (temp int)
+0:186          add (temp int)
+0:186            'gl_BaseVertexARB' (in int BaseVertex)
+0:186            'gl_BaseInstanceARB' (in int BaseInstance)
+0:186          'gl_DrawIDARB' (in int DrawId)
+0:187      move second child to first child (temp int)
+0:187        'gl_BaseVertexARB' (in int BaseVertex)
+0:187        Constant:
+0:187          3 (const int)
+0:188      move second child to first child (temp int)
+0:188        'gl_BaseInstanceARB' (in int BaseInstance)
+0:188        Constant:
+0:188          3 (const int)
+0:189      move second child to first child (temp int)
+0:189        'gl_DrawIDARB' (in int DrawId)
+0:189        Constant:
+0:189          3 (const int)
+0:190      'glBaseInstanceARB' (temp float)
 0:?   Linker Objects
 0:?     'a' (layout(location=2 component=2 ) in 2-component vector of float)
 0:?     'b' (layout(location=2 component=1 ) in float)
@@ -133,6 +134,9 @@
 0:?     'sf2o' (layout(location=56 component=3 ) smooth out float)
 0:?     'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
 0:?     'sf4o' (layout(location=57 component=3 ) smooth out float)
+0:?     'dv3o2' (layout(location=58 ) flat out 3-component vector of double)
+0:?     'dfo3' (layout(location=59 component=2 ) flat out double)
+0:?     'dfo4' (layout(location=59 component=0 ) flat out double)
 0:?     'bbinst1' (out block{out 4-component vector of float bbv})
 0:?     'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
 0:?     'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})
@@ -156,7 +160,7 @@
 
 Linked vertex stage:
 
-ERROR: Linking vertex stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
 ERROR: Linking vertex stage: xfb_stride is too small to hold all buffer entries:
 ERROR:     xfb_buffer 0, xfb_stride 92, minimum stride needed: 96
 ERROR: Linking vertex stage: xfb_stride must be multiple of 8 for buffer holding a double:
@@ -170,37 +174,37 @@
 Requested GL_ARB_shader_draw_parameters
 in xfb mode
 ERROR: node is still EOpNull!
-0:174  Function Definition: drawParamsBad( (global int)
-0:174    Function Parameters: 
-0:176    Sequence
-0:176      Branch: Return with expression
-0:176        add (temp int)
-0:176          add (temp int)
-0:176            'gl_BaseVertexARB' (in int BaseVertex)
-0:176            'gl_BaseInstanceARB' (in int BaseInstance)
-0:176          'gl_DrawIDARB' (in int DrawId)
-0:181  Function Definition: drawParams( (global int)
-0:181    Function Parameters: 
-0:183    Sequence
-0:183      Branch: Return with expression
-0:183        add (temp int)
-0:183          add (temp int)
-0:183            'gl_BaseVertexARB' (in int BaseVertex)
-0:183            'gl_BaseInstanceARB' (in int BaseInstance)
-0:183          'gl_DrawIDARB' (in int DrawId)
-0:184      move second child to first child (temp int)
-0:184        'gl_BaseVertexARB' (in int BaseVertex)
-0:184        Constant:
-0:184          3 (const int)
-0:185      move second child to first child (temp int)
-0:185        'gl_BaseInstanceARB' (in int BaseInstance)
-0:185        Constant:
-0:185          3 (const int)
-0:186      move second child to first child (temp int)
-0:186        'gl_DrawIDARB' (in int DrawId)
-0:186        Constant:
-0:186          3 (const int)
-0:187      'glBaseInstanceARB' (temp float)
+0:177  Function Definition: drawParamsBad( (global int)
+0:177    Function Parameters: 
+0:179    Sequence
+0:179      Branch: Return with expression
+0:179        add (temp int)
+0:179          add (temp int)
+0:179            'gl_BaseVertexARB' (in int BaseVertex)
+0:179            'gl_BaseInstanceARB' (in int BaseInstance)
+0:179          'gl_DrawIDARB' (in int DrawId)
+0:184  Function Definition: drawParams( (global int)
+0:184    Function Parameters: 
+0:186    Sequence
+0:186      Branch: Return with expression
+0:186        add (temp int)
+0:186          add (temp int)
+0:186            'gl_BaseVertexARB' (in int BaseVertex)
+0:186            'gl_BaseInstanceARB' (in int BaseInstance)
+0:186          'gl_DrawIDARB' (in int DrawId)
+0:187      move second child to first child (temp int)
+0:187        'gl_BaseVertexARB' (in int BaseVertex)
+0:187        Constant:
+0:187          3 (const int)
+0:188      move second child to first child (temp int)
+0:188        'gl_BaseInstanceARB' (in int BaseInstance)
+0:188        Constant:
+0:188          3 (const int)
+0:189      move second child to first child (temp int)
+0:189        'gl_DrawIDARB' (in int DrawId)
+0:189        Constant:
+0:189          3 (const int)
+0:190      'glBaseInstanceARB' (temp float)
 0:?   Linker Objects
 0:?     'a' (layout(location=2 component=2 ) in 2-component vector of float)
 0:?     'b' (layout(location=2 component=1 ) in float)
@@ -243,6 +247,9 @@
 0:?     'sf2o' (layout(location=56 component=3 ) smooth out float)
 0:?     'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
 0:?     'sf4o' (layout(location=57 component=3 ) smooth out float)
+0:?     'dv3o2' (layout(location=58 ) flat out 3-component vector of double)
+0:?     'dfo3' (layout(location=59 component=2 ) flat out double)
+0:?     'dfo4' (layout(location=59 component=0 ) flat out double)
 0:?     'bbinst1' (out block{out 4-component vector of float bbv})
 0:?     'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
 0:?     'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})
diff --git a/Test/baseResults/450.comp.out b/Test/baseResults/450.comp.out
index d5d1eca..203c4b2 100644
--- a/Test/baseResults/450.comp.out
+++ b/Test/baseResults/450.comp.out
@@ -9,7 +9,7 @@
 
 Linked compute stage:
 
-ERROR: Linking compute stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking compute stage: Missing entry point: Each stage requires one entry point
 
 Shader version: 450
 local_size = (1, 1, 1)
diff --git a/Test/baseResults/badChars.frag.out b/Test/baseResults/badChars.frag.out
index 37af287..a29b22f 100644
--- a/Test/baseResults/badChars.frag.out
+++ b/Test/baseResults/badChars.frag.out
@@ -17,7 +17,7 @@
 
 Linked fragment stage:
 
-ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
 
 Shader version: 100
 ERROR: node is still EOpNull!
diff --git a/Test/baseResults/badMacroArgs.frag.out b/Test/baseResults/badMacroArgs.frag.out
index 6a46a0f..95937ce 100644
--- a/Test/baseResults/badMacroArgs.frag.out
+++ b/Test/baseResults/badMacroArgs.frag.out
@@ -1,7 +1,7 @@
 badMacroArgs.frag
 Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:4: 'macro expansion' : Too few args in Macro m
-ERROR: 0:4: '' :  syntax error
+ERROR: 0:4: '' : compilation terminated 
 ERROR: 2 compilation errors.  No code generated.
 
 
diff --git a/Test/baseResults/cppBad.vert.out b/Test/baseResults/cppBad.vert.out
index 6938af6..1fb18ec 100755
--- a/Test/baseResults/cppBad.vert.out
+++ b/Test/baseResults/cppBad.vert.out
@@ -14,7 +14,7 @@
 
 Linked vertex stage:
 
-ERROR: Linking vertex stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
 
 Shader version: 100
 ERROR: node is still EOpNull!
diff --git a/Test/baseResults/cppNest.vert.out b/Test/baseResults/cppNest.vert.out
index 4f95f5a..df90557 100644
--- a/Test/baseResults/cppNest.vert.out
+++ b/Test/baseResults/cppNest.vert.out
@@ -4,7 +4,7 @@
 ERROR: 0:161: '#elif' : #elif after #else 
 ERROR: 0:169: '#else' : #else after #else 
 ERROR: 0:177: 'macro expansion' : End of input in macro FUNC
-ERROR: 0:178: '' :  syntax error
+ERROR: 0:178: '' : compilation terminated 
 ERROR: 6 compilation errors.  No code generated.
 
 
diff --git a/Test/baseResults/dce.frag.out b/Test/baseResults/dce.frag.out
index a19fe4e..2846abd 100644
--- a/Test/baseResults/dce.frag.out
+++ b/Test/baseResults/dce.frag.out
@@ -138,7 +138,7 @@
 
 Linked fragment stage:
 
-ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point
+ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
 
 Shader version: 400
 0:? Sequence
diff --git a/Test/baseResults/errors.frag.out b/Test/baseResults/errors.frag.out
index f1e06d2..23f6631 100644
--- a/Test/baseResults/errors.frag.out
+++ b/Test/baseResults/errors.frag.out
@@ -1,6 +1,6 @@
 errors.frag
 ERROR: 0:1: 'main' : function cannot take any parameter(s) 
-ERROR: 0:1: 'int' :  main function cannot return a value
+ERROR: 0:1: 'int' :  entry point cannot return a value
 ERROR: 2 compilation errors.  No code generated.
 
 
diff --git a/Test/baseResults/hlsl.array.frag.out b/Test/baseResults/hlsl.array.frag.out
index abc7ebb..359f62f 100755
--- a/Test/baseResults/hlsl.array.frag.out
+++ b/Test/baseResults/hlsl.array.frag.out
@@ -2,50 +2,56 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:11  Function Definition: PixelShaderFunction(i1;vf4[3]; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(i1;vf4[3]; (global 4-component vector of float)
 0:8    Function Parameters: 
-0:8      'i' (in int)
-0:8      'input' (in 3-element array of 4-component vector of float)
+0:8      'i' (layout(location=0 ) in int)
+0:8      'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 0:?     Sequence
-0:10      Branch: Return with expression
-0:10        add (temp 4-component vector of float)
+0:10      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          add (temp 4-component vector of float)
 0:10            add (temp 4-component vector of float)
 0:10              add (temp 4-component vector of float)
 0:10                add (temp 4-component vector of float)
 0:10                  add (temp 4-component vector of float)
-0:10                    direct index (temp 4-component vector of float)
-0:10                      'a' (global 4-element array of 4-component vector of float)
+0:10                    add (temp 4-component vector of float)
+0:10                      direct index (temp 4-component vector of float)
+0:10                        'a' (global 4-element array of 4-component vector of float)
+0:10                        Constant:
+0:10                          1 (const int)
+0:10                      indirect index (temp 4-component vector of float)
+0:10                        'a' (global 4-element array of 4-component vector of float)
+0:10                        'i' (layout(location=0 ) in int)
+0:10                    direct index (layout(location=1 ) temp 4-component vector of float)
+0:10                      'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 0:10                      Constant:
-0:10                        1 (const int)
-0:10                    indirect index (temp 4-component vector of float)
-0:10                      'a' (global 4-element array of 4-component vector of float)
-0:10                      'i' (in int)
-0:10                  direct index (temp 4-component vector of float)
-0:10                    'input' (in 3-element array of 4-component vector of float)
-0:10                    Constant:
-0:10                      2 (const int)
-0:10                indirect index (temp 4-component vector of float)
-0:10                  'input' (in 3-element array of 4-component vector of float)
-0:10                  'i' (in int)
-0:10              direct index (temp 4-component vector of float)
+0:10                        2 (const int)
+0:10                  indirect index (layout(location=1 ) temp 4-component vector of float)
+0:10                    'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
+0:10                    'i' (layout(location=0 ) in int)
+0:10                direct index (temp 4-component vector of float)
+0:10                  'b' (temp 10-element array of 4-component vector of float)
+0:10                  Constant:
+0:10                    5 (const int)
+0:10              indirect index (temp 4-component vector of float)
 0:10                'b' (temp 10-element array of 4-component vector of float)
-0:10                Constant:
-0:10                  5 (const int)
+0:10                'i' (layout(location=0 ) in int)
 0:10            indirect index (temp 4-component vector of float)
-0:10              'b' (temp 10-element array of 4-component vector of float)
-0:10              'i' (in int)
-0:10          indirect index (temp 4-component vector of float)
-0:10            m: direct index for structure (temp 7-element array of 4-component vector of float)
-0:10              indirect index (temp structure{temp 7-element array of 4-component vector of float m})
-0:10                's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
-0:10                'i' (in int)
-0:10              Constant:
-0:10                0 (const int)
-0:10            'i' (in int)
+0:10              m: direct index for structure (temp 7-element array of 4-component vector of float)
+0:10                indirect index (temp structure{temp 7-element array of 4-component vector of float m})
+0:10                  's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
+0:10                  'i' (layout(location=0 ) in int)
+0:10                Constant:
+0:10                  0 (const int)
+0:10              'i' (layout(location=0 ) in int)
+0:10        Branch: Return
 0:?   Linker Objects
 0:?     'a' (global 4-element array of 4-component vector of float)
 0:?     's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'i' (layout(location=0 ) in int)
+0:?     'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 
 
 Linked fragment stage:
@@ -54,129 +60,141 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:11  Function Definition: PixelShaderFunction(i1;vf4[3]; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(i1;vf4[3]; (global 4-component vector of float)
 0:8    Function Parameters: 
-0:8      'i' (in int)
-0:8      'input' (in 3-element array of 4-component vector of float)
+0:8      'i' (layout(location=0 ) in int)
+0:8      'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 0:?     Sequence
-0:10      Branch: Return with expression
-0:10        add (temp 4-component vector of float)
+0:10      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          add (temp 4-component vector of float)
 0:10            add (temp 4-component vector of float)
 0:10              add (temp 4-component vector of float)
 0:10                add (temp 4-component vector of float)
 0:10                  add (temp 4-component vector of float)
-0:10                    direct index (temp 4-component vector of float)
-0:10                      'a' (global 4-element array of 4-component vector of float)
+0:10                    add (temp 4-component vector of float)
+0:10                      direct index (temp 4-component vector of float)
+0:10                        'a' (global 4-element array of 4-component vector of float)
+0:10                        Constant:
+0:10                          1 (const int)
+0:10                      indirect index (temp 4-component vector of float)
+0:10                        'a' (global 4-element array of 4-component vector of float)
+0:10                        'i' (layout(location=0 ) in int)
+0:10                    direct index (layout(location=1 ) temp 4-component vector of float)
+0:10                      'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 0:10                      Constant:
-0:10                        1 (const int)
-0:10                    indirect index (temp 4-component vector of float)
-0:10                      'a' (global 4-element array of 4-component vector of float)
-0:10                      'i' (in int)
-0:10                  direct index (temp 4-component vector of float)
-0:10                    'input' (in 3-element array of 4-component vector of float)
-0:10                    Constant:
-0:10                      2 (const int)
-0:10                indirect index (temp 4-component vector of float)
-0:10                  'input' (in 3-element array of 4-component vector of float)
-0:10                  'i' (in int)
-0:10              direct index (temp 4-component vector of float)
+0:10                        2 (const int)
+0:10                  indirect index (layout(location=1 ) temp 4-component vector of float)
+0:10                    'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
+0:10                    'i' (layout(location=0 ) in int)
+0:10                direct index (temp 4-component vector of float)
+0:10                  'b' (temp 10-element array of 4-component vector of float)
+0:10                  Constant:
+0:10                    5 (const int)
+0:10              indirect index (temp 4-component vector of float)
 0:10                'b' (temp 10-element array of 4-component vector of float)
-0:10                Constant:
-0:10                  5 (const int)
+0:10                'i' (layout(location=0 ) in int)
 0:10            indirect index (temp 4-component vector of float)
-0:10              'b' (temp 10-element array of 4-component vector of float)
-0:10              'i' (in int)
-0:10          indirect index (temp 4-component vector of float)
-0:10            m: direct index for structure (temp 7-element array of 4-component vector of float)
-0:10              indirect index (temp structure{temp 7-element array of 4-component vector of float m})
-0:10                's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
-0:10                'i' (in int)
-0:10              Constant:
-0:10                0 (const int)
-0:10            'i' (in int)
+0:10              m: direct index for structure (temp 7-element array of 4-component vector of float)
+0:10                indirect index (temp structure{temp 7-element array of 4-component vector of float m})
+0:10                  's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
+0:10                  'i' (layout(location=0 ) in int)
+0:10                Constant:
+0:10                  0 (const int)
+0:10              'i' (layout(location=0 ) in int)
+0:10        Branch: Return
 0:?   Linker Objects
 0:?     'a' (global 4-element array of 4-component vector of float)
 0:?     's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'i' (layout(location=0 ) in int)
+0:?     'input' (layout(location=1 ) in 3-element array of 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 64
+// Id's are bound by 66
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 19 27
+                              EntryPoint Fragment 4  "PixelShaderFunction" 9 21 29
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
-                              Name 12  "a"
-                              Name 19  "i"
-                              Name 27  "input"
-                              Name 40  "b"
-                              Name 52  ""
-                              MemberName 52 0  "m"
-                              Name 56  "s"
+                              Name 9  "@entryPointOutput"
+                              Name 14  "a"
+                              Name 21  "i"
+                              Name 29  "input"
+                              Name 42  "b"
+                              Name 54  ""
+                              MemberName 54 0  "m"
+                              Name 58  "s"
+                              Decorate 9(@entryPointOutput) Location 0
+                              Decorate 21(i) Location 0
+                              Decorate 29(input) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
-               8:             TypeInt 32 0
-               9:      8(int) Constant 4
-              10:             TypeArray 7(fvec4) 9
-              11:             TypePointer Private 10
-           12(a):     11(ptr) Variable Private
-              13:             TypeInt 32 1
-              14:     13(int) Constant 1
-              15:             TypePointer Private 7(fvec4)
-              18:             TypePointer Input 13(int)
-           19(i):     18(ptr) Variable Input
-              24:      8(int) Constant 3
-              25:             TypeArray 7(fvec4) 24
-              26:             TypePointer Input 25
-       27(input):     26(ptr) Variable Input
-              28:     13(int) Constant 2
-              29:             TypePointer Input 7(fvec4)
-              37:      8(int) Constant 10
-              38:             TypeArray 7(fvec4) 37
-              39:             TypePointer Function 38
-              41:     13(int) Constant 5
-              42:             TypePointer Function 7(fvec4)
-              50:      8(int) Constant 7
-              51:             TypeArray 7(fvec4) 50
-              52:             TypeStruct 51
-              53:      8(int) Constant 11
-              54:             TypeArray 52(struct) 53
-              55:             TypePointer Private 54
-           56(s):     55(ptr) Variable Private
-              58:     13(int) Constant 0
+               8:             TypePointer Output 7(fvec4)
+9(@entryPointOutput):      8(ptr) Variable Output
+              10:             TypeInt 32 0
+              11:     10(int) Constant 4
+              12:             TypeArray 7(fvec4) 11
+              13:             TypePointer Private 12
+           14(a):     13(ptr) Variable Private
+              15:             TypeInt 32 1
+              16:     15(int) Constant 1
+              17:             TypePointer Private 7(fvec4)
+              20:             TypePointer Input 15(int)
+           21(i):     20(ptr) Variable Input
+              26:     10(int) Constant 3
+              27:             TypeArray 7(fvec4) 26
+              28:             TypePointer Input 27
+       29(input):     28(ptr) Variable Input
+              30:     15(int) Constant 2
+              31:             TypePointer Input 7(fvec4)
+              39:     10(int) Constant 10
+              40:             TypeArray 7(fvec4) 39
+              41:             TypePointer Function 40
+              43:     15(int) Constant 5
+              44:             TypePointer Function 7(fvec4)
+              52:     10(int) Constant 7
+              53:             TypeArray 7(fvec4) 52
+              54:             TypeStruct 53
+              55:     10(int) Constant 11
+              56:             TypeArray 54(struct) 55
+              57:             TypePointer Private 56
+           58(s):     57(ptr) Variable Private
+              60:     15(int) Constant 0
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-           40(b):     39(ptr) Variable Function
-              16:     15(ptr) AccessChain 12(a) 14
-              17:    7(fvec4) Load 16
-              20:     13(int) Load 19(i)
-              21:     15(ptr) AccessChain 12(a) 20
-              22:    7(fvec4) Load 21
-              23:    7(fvec4) FAdd 17 22
-              30:     29(ptr) AccessChain 27(input) 28
-              31:    7(fvec4) Load 30
-              32:    7(fvec4) FAdd 23 31
-              33:     13(int) Load 19(i)
-              34:     29(ptr) AccessChain 27(input) 33
-              35:    7(fvec4) Load 34
-              36:    7(fvec4) FAdd 32 35
-              43:     42(ptr) AccessChain 40(b) 41
-              44:    7(fvec4) Load 43
-              45:    7(fvec4) FAdd 36 44
-              46:     13(int) Load 19(i)
-              47:     42(ptr) AccessChain 40(b) 46
-              48:    7(fvec4) Load 47
-              49:    7(fvec4) FAdd 45 48
-              57:     13(int) Load 19(i)
-              59:     13(int) Load 19(i)
-              60:     15(ptr) AccessChain 56(s) 57 58 59
-              61:    7(fvec4) Load 60
-              62:    7(fvec4) FAdd 49 61
-                              ReturnValue 62
+           42(b):     41(ptr) Variable Function
+              18:     17(ptr) AccessChain 14(a) 16
+              19:    7(fvec4) Load 18
+              22:     15(int) Load 21(i)
+              23:     17(ptr) AccessChain 14(a) 22
+              24:    7(fvec4) Load 23
+              25:    7(fvec4) FAdd 19 24
+              32:     31(ptr) AccessChain 29(input) 30
+              33:    7(fvec4) Load 32
+              34:    7(fvec4) FAdd 25 33
+              35:     15(int) Load 21(i)
+              36:     31(ptr) AccessChain 29(input) 35
+              37:    7(fvec4) Load 36
+              38:    7(fvec4) FAdd 34 37
+              45:     44(ptr) AccessChain 42(b) 43
+              46:    7(fvec4) Load 45
+              47:    7(fvec4) FAdd 38 46
+              48:     15(int) Load 21(i)
+              49:     44(ptr) AccessChain 42(b) 48
+              50:    7(fvec4) Load 49
+              51:    7(fvec4) FAdd 47 50
+              59:     15(int) Load 21(i)
+              61:     15(int) Load 21(i)
+              62:     17(ptr) AccessChain 58(s) 59 60 61
+              63:    7(fvec4) Load 62
+              64:    7(fvec4) FAdd 51 63
+                              Store 9(@entryPointOutput) 64
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.assoc.frag.out b/Test/baseResults/hlsl.assoc.frag.out
index 89eea72..d54d467 100755
--- a/Test/baseResults/hlsl.assoc.frag.out
+++ b/Test/baseResults/hlsl.assoc.frag.out
@@ -2,34 +2,43 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (global 4-component vector of float)
 0:8    Function Parameters: 
-0:8      'a1' (in 4-component vector of float)
-0:8      'a2' (in 4-component vector of float)
-0:8      'a3' (in 4-component vector of float)
-0:8      'a4' (in 4-component vector of float)
-0:8      'a5' (in 4-component vector of float)
+0:8      'a1' (layout(location=0 ) in 4-component vector of float)
+0:8      'a2' (layout(location=1 ) in 4-component vector of float)
+0:8      'a3' (layout(location=2 ) in 4-component vector of float)
+0:8      'a4' (layout(location=3 ) in 4-component vector of float)
+0:8      'a5' (layout(location=4 ) in 4-component vector of float)
 0:?     Sequence
 0:9      move second child to first child (temp 4-component vector of float)
-0:9        'a1' (in 4-component vector of float)
+0:9        'a1' (layout(location=0 ) in 4-component vector of float)
 0:9        move second child to first child (temp 4-component vector of float)
-0:9          'a2' (in 4-component vector of float)
+0:9          'a2' (layout(location=1 ) in 4-component vector of float)
 0:9          move second child to first child (temp 4-component vector of float)
-0:9            'a3' (in 4-component vector of float)
+0:9            'a3' (layout(location=2 ) in 4-component vector of float)
 0:9            move second child to first child (temp 4-component vector of float)
-0:9              'a4' (in 4-component vector of float)
-0:9              'a5' (in 4-component vector of float)
-0:10      Branch: Return with expression
-0:10        add (temp 4-component vector of float)
+0:9              'a4' (layout(location=3 ) in 4-component vector of float)
+0:9              'a5' (layout(location=4 ) in 4-component vector of float)
+0:10      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          add (temp 4-component vector of float)
 0:10            add (temp 4-component vector of float)
 0:10              add (temp 4-component vector of float)
-0:10                'a1' (in 4-component vector of float)
-0:10                'a2' (in 4-component vector of float)
-0:10              'a3' (in 4-component vector of float)
-0:10            'a4' (in 4-component vector of float)
-0:10          'a5' (in 4-component vector of float)
+0:10                add (temp 4-component vector of float)
+0:10                  'a1' (layout(location=0 ) in 4-component vector of float)
+0:10                  'a2' (layout(location=1 ) in 4-component vector of float)
+0:10                'a3' (layout(location=2 ) in 4-component vector of float)
+0:10              'a4' (layout(location=3 ) in 4-component vector of float)
+0:10            'a5' (layout(location=4 ) in 4-component vector of float)
+0:10        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'a1' (layout(location=0 ) in 4-component vector of float)
+0:?     'a2' (layout(location=1 ) in 4-component vector of float)
+0:?     'a3' (layout(location=2 ) in 4-component vector of float)
+0:?     'a4' (layout(location=3 ) in 4-component vector of float)
+0:?     'a5' (layout(location=4 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -38,51 +47,66 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (global 4-component vector of float)
 0:8    Function Parameters: 
-0:8      'a1' (in 4-component vector of float)
-0:8      'a2' (in 4-component vector of float)
-0:8      'a3' (in 4-component vector of float)
-0:8      'a4' (in 4-component vector of float)
-0:8      'a5' (in 4-component vector of float)
+0:8      'a1' (layout(location=0 ) in 4-component vector of float)
+0:8      'a2' (layout(location=1 ) in 4-component vector of float)
+0:8      'a3' (layout(location=2 ) in 4-component vector of float)
+0:8      'a4' (layout(location=3 ) in 4-component vector of float)
+0:8      'a5' (layout(location=4 ) in 4-component vector of float)
 0:?     Sequence
 0:9      move second child to first child (temp 4-component vector of float)
-0:9        'a1' (in 4-component vector of float)
+0:9        'a1' (layout(location=0 ) in 4-component vector of float)
 0:9        move second child to first child (temp 4-component vector of float)
-0:9          'a2' (in 4-component vector of float)
+0:9          'a2' (layout(location=1 ) in 4-component vector of float)
 0:9          move second child to first child (temp 4-component vector of float)
-0:9            'a3' (in 4-component vector of float)
+0:9            'a3' (layout(location=2 ) in 4-component vector of float)
 0:9            move second child to first child (temp 4-component vector of float)
-0:9              'a4' (in 4-component vector of float)
-0:9              'a5' (in 4-component vector of float)
-0:10      Branch: Return with expression
-0:10        add (temp 4-component vector of float)
+0:9              'a4' (layout(location=3 ) in 4-component vector of float)
+0:9              'a5' (layout(location=4 ) in 4-component vector of float)
+0:10      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          add (temp 4-component vector of float)
 0:10            add (temp 4-component vector of float)
 0:10              add (temp 4-component vector of float)
-0:10                'a1' (in 4-component vector of float)
-0:10                'a2' (in 4-component vector of float)
-0:10              'a3' (in 4-component vector of float)
-0:10            'a4' (in 4-component vector of float)
-0:10          'a5' (in 4-component vector of float)
+0:10                add (temp 4-component vector of float)
+0:10                  'a1' (layout(location=0 ) in 4-component vector of float)
+0:10                  'a2' (layout(location=1 ) in 4-component vector of float)
+0:10                'a3' (layout(location=2 ) in 4-component vector of float)
+0:10              'a4' (layout(location=3 ) in 4-component vector of float)
+0:10            'a5' (layout(location=4 ) in 4-component vector of float)
+0:10        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'a1' (layout(location=0 ) in 4-component vector of float)
+0:?     'a2' (layout(location=1 ) in 4-component vector of float)
+0:?     'a3' (layout(location=2 ) in 4-component vector of float)
+0:?     'a4' (layout(location=3 ) in 4-component vector of float)
+0:?     'a5' (layout(location=4 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 25
+// Id's are bound by 27
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 9 10 11 12 13
+                              EntryPoint Fragment 4  "PixelShaderFunction" 9 10 11 12 13 16
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 9  "a1"
                               Name 10  "a2"
                               Name 11  "a3"
                               Name 12  "a4"
                               Name 13  "a5"
+                              Name 16  "@entryPointOutput"
+                              Decorate 9(a1) Location 0
+                              Decorate 10(a2) Location 1
+                              Decorate 11(a3) Location 2
+                              Decorate 12(a4) Location 3
+                              Decorate 13(a5) Location 4
+                              Decorate 16(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -93,6 +117,8 @@
           11(a3):      8(ptr) Variable Input
           12(a4):      8(ptr) Variable Input
           13(a5):      8(ptr) Variable Input
+              15:             TypePointer Output 7(fvec4)
+16(@entryPointOutput):     15(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
               14:    7(fvec4) Load 13(a5)
@@ -100,14 +126,15 @@
                               Store 11(a3) 14
                               Store 10(a2) 14
                               Store 9(a1) 14
-              15:    7(fvec4) Load 9(a1)
-              16:    7(fvec4) Load 10(a2)
-              17:    7(fvec4) FAdd 15 16
-              18:    7(fvec4) Load 11(a3)
+              17:    7(fvec4) Load 9(a1)
+              18:    7(fvec4) Load 10(a2)
               19:    7(fvec4) FAdd 17 18
-              20:    7(fvec4) Load 12(a4)
+              20:    7(fvec4) Load 11(a3)
               21:    7(fvec4) FAdd 19 20
-              22:    7(fvec4) Load 13(a5)
+              22:    7(fvec4) Load 12(a4)
               23:    7(fvec4) FAdd 21 22
-                              ReturnValue 23
+              24:    7(fvec4) Load 13(a5)
+              25:    7(fvec4) FAdd 23 24
+                              Store 16(@entryPointOutput) 25
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.attribute.frag.out b/Test/baseResults/hlsl.attribute.frag.out
index 77e34fe..38421a8 100755
--- a/Test/baseResults/hlsl.attribute.frag.out
+++ b/Test/baseResults/hlsl.attribute.frag.out
@@ -2,9 +2,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global void)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:11      Test condition and select (temp void)
 0:11        Condition
@@ -12,6 +12,7 @@
 0:11          0 (const int)
 0:11        true case is null
 0:?   Linker Objects
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -20,9 +21,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global void)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:11      Test condition and select (temp void)
 0:11        Condition
@@ -30,22 +31,28 @@
 0:11          0 (const int)
 0:11        true case is null
 0:?   Linker Objects
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 10
+// Id's are bound by 14
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction"
+                              EntryPoint Fragment 4  "PixelShaderFunction" 13
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
+                              Name 13  "input"
+                              Decorate 13(input) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
                7:      6(int) Constant 0
+              10:             TypeFloat 32
+              11:             TypeVector 10(float) 4
+              12:             TypePointer Input 11(fvec4)
+       13(input):     12(ptr) Variable Input
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
                               SelectionMerge 9 None
diff --git a/Test/baseResults/hlsl.buffer.frag.out b/Test/baseResults/hlsl.buffer.frag.out
index a51be51..78a8e73 100755
--- a/Test/baseResults/hlsl.buffer.frag.out
+++ b/Test/baseResults/hlsl.buffer.frag.out
@@ -2,37 +2,42 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:29  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:26  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:26    Function Parameters: 
-0:26      'input' (in 4-component vector of float)
+0:26      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
-0:27      Branch: Return with expression
-0:27        add (temp 4-component vector of float)
+0:27      Sequence
+0:27        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
 0:27          add (temp 4-component vector of float)
 0:27            add (temp 4-component vector of float)
 0:27              add (temp 4-component vector of float)
-0:27                'input' (in 4-component vector of float)
-0:27                v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
-0:27                  'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
+0:27                add (temp 4-component vector of float)
+0:27                  'input' (layout(location=0 ) in 4-component vector of float)
+0:27                  v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
+0:27                    'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
+0:27                    Constant:
+0:27                      0 (const uint)
+0:27                v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
+0:27                  'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
 0:27                  Constant:
 0:27                    0 (const uint)
-0:27              v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
-0:27                'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
+0:27              v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
+0:27                'anon@2' (layout(set=10 binding=2 column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
 0:27                Constant:
 0:27                  0 (const uint)
-0:27            v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
-0:27              'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
+0:27            v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
+0:27              'anon@3' (layout(binding=8 column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
 0:27              Constant:
 0:27                0 (const uint)
-0:27          v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
-0:27            'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
-0:27            Constant:
-0:27              0 (const uint)
+0:27        Branch: Return
 0:?   Linker Objects
 0:?     'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
 0:?     'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
-0:?     'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
-0:?     'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
+0:?     'anon@2' (layout(set=10 binding=2 column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
+0:?     'anon@3' (layout(binding=8 column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -41,125 +46,137 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:29  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:26  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:26    Function Parameters: 
-0:26      'input' (in 4-component vector of float)
+0:26      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
-0:27      Branch: Return with expression
-0:27        add (temp 4-component vector of float)
+0:27      Sequence
+0:27        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
 0:27          add (temp 4-component vector of float)
 0:27            add (temp 4-component vector of float)
 0:27              add (temp 4-component vector of float)
-0:27                'input' (in 4-component vector of float)
-0:27                v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
-0:27                  'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
+0:27                add (temp 4-component vector of float)
+0:27                  'input' (layout(location=0 ) in 4-component vector of float)
+0:27                  v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
+0:27                    'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
+0:27                    Constant:
+0:27                      0 (const uint)
+0:27                v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
+0:27                  'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
 0:27                  Constant:
 0:27                    0 (const uint)
-0:27              v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
-0:27                'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
+0:27              v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
+0:27                'anon@2' (layout(set=10 binding=2 column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
 0:27                Constant:
 0:27                  0 (const uint)
-0:27            v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
-0:27              'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
+0:27            v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
+0:27              'anon@3' (layout(binding=8 column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
 0:27              Constant:
 0:27                0 (const uint)
-0:27          v4: direct index for structure (layout(column_major std430 offset=16 ) buffer 4-component vector of float)
-0:27            'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
-0:27            Constant:
-0:27              0 (const uint)
+0:27        Branch: Return
 0:?   Linker Objects
 0:?     'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
 0:?     'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
-0:?     'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
-0:?     'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
+0:?     'anon@2' (layout(set=10 binding=2 column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 offset=20 ) uniform int i3})
+0:?     'anon@3' (layout(binding=8 column_major std430 ) buffer block{layout(column_major std430 offset=16 ) buffer 4-component vector of float v4, layout(column_major std430 offset=48 ) buffer int i4, layout(column_major std430 offset=60 ) buffer float f1, layout(column_major std430 offset=64 ) buffer float f3, layout(column_major std430 offset=68 ) buffer float f4, layout(column_major std430 offset=72 ) buffer float f5, layout(column_major std430 ) buffer float f6, layout(column_major std430 ) buffer float f7})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 39
+// Id's are bound by 41
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 9
+                              EntryPoint Fragment 4  "PixelShaderFunction" 9 11
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
-                              Name 9  "input"
-                              Name 11  ""
-                              MemberName 11 0  "v1"
+                              Name 9  "@entryPointOutput"
+                              Name 11  "input"
                               Name 13  ""
-                              Name 20  ""
-                              MemberName 20 0  "v2"
+                              MemberName 13 0  "v1"
+                              Name 15  ""
                               Name 22  ""
-                              Name 26  ""
-                              MemberName 26 0  "v3"
-                              MemberName 26 1  "i3"
+                              MemberName 22 0  "v2"
+                              Name 24  ""
                               Name 28  ""
-                              Name 32  ""
-                              MemberName 32 0  "v4"
-                              MemberName 32 1  "i4"
-                              MemberName 32 2  "f1"
-                              MemberName 32 3  "f3"
-                              MemberName 32 4  "f4"
-                              MemberName 32 5  "f5"
-                              MemberName 32 6  "f6"
-                              MemberName 32 7  "f7"
+                              MemberName 28 0  "v3"
+                              MemberName 28 1  "i3"
+                              Name 30  ""
                               Name 34  ""
-                              MemberDecorate 11 0 Offset 0
-                              Decorate 11 Block
-                              Decorate 13 DescriptorSet 0
-                              MemberDecorate 20 0 Offset 0
-                              Decorate 20 BufferBlock
-                              Decorate 22 DescriptorSet 0
-                              MemberDecorate 26 0 Offset 0
-                              MemberDecorate 26 1 Offset 20
-                              Decorate 26 Block
-                              Decorate 28 DescriptorSet 0
-                              MemberDecorate 32 0 Offset 16
-                              MemberDecorate 32 1 Offset 48
-                              MemberDecorate 32 2 Offset 60
-                              MemberDecorate 32 3 Offset 64
-                              MemberDecorate 32 4 Offset 68
-                              MemberDecorate 32 5 Offset 72
-                              MemberDecorate 32 6 Offset 76
-                              MemberDecorate 32 7 Offset 80
-                              Decorate 32 BufferBlock
-                              Decorate 34 DescriptorSet 0
+                              MemberName 34 0  "v4"
+                              MemberName 34 1  "i4"
+                              MemberName 34 2  "f1"
+                              MemberName 34 3  "f3"
+                              MemberName 34 4  "f4"
+                              MemberName 34 5  "f5"
+                              MemberName 34 6  "f6"
+                              MemberName 34 7  "f7"
+                              Name 36  ""
+                              Decorate 9(@entryPointOutput) Location 0
+                              Decorate 11(input) Location 0
+                              MemberDecorate 13 0 Offset 0
+                              Decorate 13 Block
+                              Decorate 15 DescriptorSet 0
+                              MemberDecorate 22 0 Offset 0
+                              Decorate 22 BufferBlock
+                              Decorate 24 DescriptorSet 0
+                              MemberDecorate 28 0 Offset 0
+                              MemberDecorate 28 1 Offset 20
+                              Decorate 28 Block
+                              Decorate 30 DescriptorSet 10
+                              Decorate 30 Binding 2
+                              MemberDecorate 34 0 Offset 16
+                              MemberDecorate 34 1 Offset 48
+                              MemberDecorate 34 2 Offset 60
+                              MemberDecorate 34 3 Offset 64
+                              MemberDecorate 34 4 Offset 68
+                              MemberDecorate 34 5 Offset 72
+                              MemberDecorate 34 6 Offset 76
+                              MemberDecorate 34 7 Offset 80
+                              Decorate 34 BufferBlock
+                              Decorate 36 DescriptorSet 0
+                              Decorate 36 Binding 8
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
-               8:             TypePointer Input 7(fvec4)
-        9(input):      8(ptr) Variable Input
-              11:             TypeStruct 7(fvec4)
-              12:             TypePointer Uniform 11(struct)
-              13:     12(ptr) Variable Uniform
-              14:             TypeInt 32 1
-              15:     14(int) Constant 0
-              16:             TypePointer Uniform 7(fvec4)
-              20:             TypeStruct 7(fvec4)
-              21:             TypePointer Uniform 20(struct)
-              22:     21(ptr) Variable Uniform
-              26:             TypeStruct 7(fvec4) 14(int)
-              27:             TypePointer Uniform 26(struct)
-              28:     27(ptr) Variable Uniform
-              32:             TypeStruct 7(fvec4) 14(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float)
-              33:             TypePointer Uniform 32(struct)
-              34:     33(ptr) Variable Uniform
+               8:             TypePointer Output 7(fvec4)
+9(@entryPointOutput):      8(ptr) Variable Output
+              10:             TypePointer Input 7(fvec4)
+       11(input):     10(ptr) Variable Input
+              13:             TypeStruct 7(fvec4)
+              14:             TypePointer Uniform 13(struct)
+              15:     14(ptr) Variable Uniform
+              16:             TypeInt 32 1
+              17:     16(int) Constant 0
+              18:             TypePointer Uniform 7(fvec4)
+              22:             TypeStruct 7(fvec4)
+              23:             TypePointer Uniform 22(struct)
+              24:     23(ptr) Variable Uniform
+              28:             TypeStruct 7(fvec4) 16(int)
+              29:             TypePointer Uniform 28(struct)
+              30:     29(ptr) Variable Uniform
+              34:             TypeStruct 7(fvec4) 16(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float)
+              35:             TypePointer Uniform 34(struct)
+              36:     35(ptr) Variable Uniform
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-              10:    7(fvec4) Load 9(input)
-              17:     16(ptr) AccessChain 13 15
-              18:    7(fvec4) Load 17
-              19:    7(fvec4) FAdd 10 18
-              23:     16(ptr) AccessChain 22 15
-              24:    7(fvec4) Load 23
-              25:    7(fvec4) FAdd 19 24
-              29:     16(ptr) AccessChain 28 15
-              30:    7(fvec4) Load 29
-              31:    7(fvec4) FAdd 25 30
-              35:     16(ptr) AccessChain 34 15
-              36:    7(fvec4) Load 35
-              37:    7(fvec4) FAdd 31 36
-                              ReturnValue 37
+              12:    7(fvec4) Load 11(input)
+              19:     18(ptr) AccessChain 15 17
+              20:    7(fvec4) Load 19
+              21:    7(fvec4) FAdd 12 20
+              25:     18(ptr) AccessChain 24 17
+              26:    7(fvec4) Load 25
+              27:    7(fvec4) FAdd 21 26
+              31:     18(ptr) AccessChain 30 17
+              32:    7(fvec4) Load 31
+              33:    7(fvec4) FAdd 27 32
+              37:     18(ptr) AccessChain 36 17
+              38:    7(fvec4) Load 37
+              39:    7(fvec4) FAdd 33 38
+                              Store 9(@entryPointOutput) 39
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.calculatelod.dx10.frag.out b/Test/baseResults/hlsl.calculatelod.dx10.frag.out
index 43232fb..68eee1a 100644
--- a/Test/baseResults/hlsl.calculatelod.dx10.frag.out
+++ b/Test/baseResults/hlsl.calculatelod.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:28      Sequence
@@ -124,7 +124,7 @@
 0:38              0 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -133,14 +133,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -153,6 +166,8 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -161,7 +176,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:28      Sequence
@@ -283,7 +298,7 @@
 0:38              0 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -292,14 +307,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -312,10 +340,12 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 143
+// Id's are bound by 150
 
                               Capability Shader
                               Capability Sampled1D
@@ -323,9 +353,8 @@
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 141 145
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 8  "txval10"
                               Name 11  "g_tTex1df4a"
@@ -350,7 +379,9 @@
                               MemberName 131(PS_OUTPUT) 0  "Color"
                               MemberName 131(PS_OUTPUT) 1  "Depth"
                               Name 133  "psout"
-                              Name 142  "g_tTex1df4"
+                              Name 141  "Color"
+                              Name 145  "Depth"
+                              Name 149  "g_tTex1df4"
                               Decorate 11(g_tTex1df4a) DescriptorSet 0
                               Decorate 11(g_tTex1df4a) Binding 1
                               Decorate 15(g_sSamp) DescriptorSet 0
@@ -363,9 +394,10 @@
                               Decorate 93(g_tTexcdf4a) DescriptorSet 0
                               Decorate 106(g_tTexcdi4a) DescriptorSet 0
                               Decorate 118(g_tTexcdu4a) DescriptorSet 0
-                              MemberDecorate 131(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 142(g_tTex1df4) DescriptorSet 0
-                              Decorate 142(g_tTex1df4) Binding 0
+                              Decorate 141(Color) Location 0
+                              Decorate 145(Depth) BuiltIn FragDepth
+                              Decorate 149(g_tTex1df4) DescriptorSet 0
+                              Decorate 149(g_tTex1df4) Binding 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -436,7 +468,11 @@
              135:  130(fvec4) ConstantComposite 134 134 134 134
              136:             TypePointer Function 130(fvec4)
              138:     23(int) Constant 1
- 142(g_tTex1df4):     10(ptr) Variable UniformConstant
+             140:             TypePointer Output 130(fvec4)
+      141(Color):    140(ptr) Variable Output
+             144:             TypePointer Output 6(float)
+      145(Depth):    144(ptr) Variable Output
+ 149(g_tTex1df4):     10(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       8(txval10):      7(ptr) Variable Function
@@ -516,6 +552,11 @@
                               Store 137 135
              139:      7(ptr) AccessChain 133(psout) 138
                               Store 139 134
-             140:131(PS_OUTPUT) Load 133(psout)
-                              ReturnValue 140
+             142:    136(ptr) AccessChain 133(psout) 24
+             143:  130(fvec4) Load 142
+                              Store 141(Color) 143
+             146:      7(ptr) AccessChain 133(psout) 138
+             147:    6(float) Load 146
+                              Store 145(Depth) 147
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out b/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
index e2dc1db..9370e14 100644
--- a/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
+++ b/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
@@ -14,7 +14,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:28      Sequence
@@ -136,7 +136,7 @@
 0:38              0 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -145,14 +145,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -165,6 +178,8 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -173,7 +188,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:28      Sequence
@@ -295,7 +310,7 @@
 0:38              0 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -304,14 +319,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -324,5 +352,7 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/hlsl.cast.frag.out b/Test/baseResults/hlsl.cast.frag.out
index 24b18cd..3bef95f 100755
--- a/Test/baseResults/hlsl.cast.frag.out
+++ b/Test/baseResults/hlsl.cast.frag.out
@@ -2,24 +2,29 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:5  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
-0:3      Branch: Return with expression
-0:3        add (temp 4-component vector of float)
+0:3      Sequence
+0:3        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
 0:3          add (temp 4-component vector of float)
-0:3            Construct vec4 (temp 4-component vector of float)
-0:3              'input' (in 4-component vector of float)
-0:3            Convert int to float (temp 4-component vector of float)
-0:3              Convert float to int (temp 4-component vector of int)
-0:3                'input' (in 4-component vector of float)
-0:3          Constant:
-0:3            1.198000
-0:3            1.198000
-0:3            1.198000
-0:3            1.198000
+0:3            add (temp 4-component vector of float)
+0:3              Construct vec4 (temp 4-component vector of float)
+0:3                'input' (layout(location=0 ) in 4-component vector of float)
+0:3              Convert int to float (temp 4-component vector of float)
+0:3                Convert float to int (temp 4-component vector of int)
+0:3                  'input' (layout(location=0 ) in 4-component vector of float)
+0:3            Constant:
+0:3              1.198000
+0:3              1.198000
+0:3              1.198000
+0:3              1.198000
+0:3        Branch: Return
 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)
 
 
 Linked fragment stage:
@@ -28,59 +33,69 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:5  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
-0:3      Branch: Return with expression
-0:3        add (temp 4-component vector of float)
+0:3      Sequence
+0:3        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
 0:3          add (temp 4-component vector of float)
-0:3            Construct vec4 (temp 4-component vector of float)
-0:3              'input' (in 4-component vector of float)
-0:3            Convert int to float (temp 4-component vector of float)
-0:3              Convert float to int (temp 4-component vector of int)
-0:3                'input' (in 4-component vector of float)
-0:3          Constant:
-0:3            1.198000
-0:3            1.198000
-0:3            1.198000
-0:3            1.198000
+0:3            add (temp 4-component vector of float)
+0:3              Construct vec4 (temp 4-component vector of float)
+0:3                'input' (layout(location=0 ) in 4-component vector of float)
+0:3              Convert int to float (temp 4-component vector of float)
+0:3                Convert float to int (temp 4-component vector of int)
+0:3                  'input' (layout(location=0 ) in 4-component vector of float)
+0:3            Constant:
+0:3              1.198000
+0:3              1.198000
+0:3              1.198000
+0:3              1.198000
+0:3        Branch: Return
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 26
+// Id's are bound by 28
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 9
+                              EntryPoint Fragment 4  "PixelShaderFunction" 9 11
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
-                              Name 9  "input"
+                              Name 9  "@entryPointOutput"
+                              Name 11  "input"
+                              Decorate 9(@entryPointOutput) Location 0
+                              Decorate 11(input) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
-               8:             TypePointer Input 7(fvec4)
-        9(input):      8(ptr) Variable Input
-              17:             TypeInt 32 1
-              18:             TypeVector 17(int) 4
-              22:    6(float) Constant 1067014160
-              23:    7(fvec4) ConstantComposite 22 22 22 22
+               8:             TypePointer Output 7(fvec4)
+9(@entryPointOutput):      8(ptr) Variable Output
+              10:             TypePointer Input 7(fvec4)
+       11(input):     10(ptr) Variable Input
+              19:             TypeInt 32 1
+              20:             TypeVector 19(int) 4
+              24:    6(float) Constant 1067014160
+              25:    7(fvec4) ConstantComposite 24 24 24 24
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-              10:    7(fvec4) Load 9(input)
-              11:    6(float) CompositeExtract 10 0
-              12:    6(float) CompositeExtract 10 1
-              13:    6(float) CompositeExtract 10 2
-              14:    6(float) CompositeExtract 10 3
-              15:    7(fvec4) CompositeConstruct 11 12 13 14
-              16:    7(fvec4) Load 9(input)
-              19:   18(ivec4) ConvertFToS 16
-              20:    7(fvec4) ConvertSToF 19
-              21:    7(fvec4) FAdd 15 20
-              24:    7(fvec4) FAdd 21 23
-                              ReturnValue 24
+              12:    7(fvec4) Load 11(input)
+              13:    6(float) CompositeExtract 12 0
+              14:    6(float) CompositeExtract 12 1
+              15:    6(float) CompositeExtract 12 2
+              16:    6(float) CompositeExtract 12 3
+              17:    7(fvec4) CompositeConstruct 13 14 15 16
+              18:    7(fvec4) Load 11(input)
+              21:   20(ivec4) ConvertFToS 18
+              22:    7(fvec4) ConvertSToF 21
+              23:    7(fvec4) FAdd 17 22
+              26:    7(fvec4) FAdd 23 25
+                              Store 9(@entryPointOutput) 26
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.conditional.frag.out b/Test/baseResults/hlsl.conditional.frag.out
index 1e62e9c..f6c00fe 100755
--- a/Test/baseResults/hlsl.conditional.frag.out
+++ b/Test/baseResults/hlsl.conditional.frag.out
@@ -2,9 +2,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:17  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Sequence
 0:3        move second child to first child (temp int)
@@ -35,19 +35,19 @@
 0:7                vector-scale (temp 4-component vector of float)
 0:7                  Convert int to float (temp float)
 0:7                    'a' (temp int)
-0:7                  'input' (in 4-component vector of float)
+0:7                  'input' (layout(location=0 ) in 4-component vector of float)
 0:8                vector-scale (temp 4-component vector of float)
 0:8                  Convert int to float (temp float)
 0:8                    'b' (temp int)
-0:8                  'input' (in 4-component vector of float)
+0:8                  'input' (layout(location=0 ) in 4-component vector of float)
 0:9              vector-scale (temp 4-component vector of float)
 0:9                Convert int to float (temp float)
 0:9                  'c' (temp int)
-0:9                'input' (in 4-component vector of float)
+0:9                'input' (layout(location=0 ) in 4-component vector of float)
 0:10            vector-scale (temp 4-component vector of float)
 0:10              Convert int to float (temp float)
 0:10                'd' (temp int)
-0:10              'input' (in 4-component vector of float)
+0:10              'input' (layout(location=0 ) in 4-component vector of float)
 0:12      Comma (temp int)
 0:12        move second child to first child (temp int)
 0:12          'e' (temp int)
@@ -85,27 +85,32 @@
 0:14              Constant:
 0:14                0 (const int)
 0:14            direct index (temp float)
-0:14              'input' (in 4-component vector of float)
+0:14              'input' (layout(location=0 ) in 4-component vector of float)
 0:14              Constant:
 0:14                1 (const int)
 0:14          true case
 0:14          vector-scale (temp 4-component vector of float)
 0:14            Convert int to float (temp float)
 0:14              'c' (temp int)
-0:14            'input' (in 4-component vector of float)
+0:14            'input' (layout(location=0 ) in 4-component vector of float)
 0:14          false case
 0:14          vector-scale (temp 4-component vector of float)
 0:14            Convert int to float (temp float)
 0:14              'd' (temp int)
-0:14            'input' (in 4-component vector of float)
-0:15      Branch: Return with expression
-0:15        add (temp 4-component vector of float)
-0:15          vector-scale (temp 4-component vector of float)
-0:15            Convert int to float (temp float)
-0:15              'e' (temp int)
-0:15            'ret' (temp 4-component vector of float)
-0:15          'f' (temp 4-component vector of float)
+0:14            'input' (layout(location=0 ) in 4-component vector of float)
+0:15      Sequence
+0:15        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:15          add (temp 4-component vector of float)
+0:15            vector-scale (temp 4-component vector of float)
+0:15              Convert int to float (temp float)
+0:15                'e' (temp int)
+0:15              'ret' (temp 4-component vector of float)
+0:15            'f' (temp 4-component vector of float)
+0:15        Branch: Return
 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)
 
 
 Linked fragment stage:
@@ -114,9 +119,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:17  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Sequence
 0:3        move second child to first child (temp int)
@@ -147,19 +152,19 @@
 0:7                vector-scale (temp 4-component vector of float)
 0:7                  Convert int to float (temp float)
 0:7                    'a' (temp int)
-0:7                  'input' (in 4-component vector of float)
+0:7                  'input' (layout(location=0 ) in 4-component vector of float)
 0:8                vector-scale (temp 4-component vector of float)
 0:8                  Convert int to float (temp float)
 0:8                    'b' (temp int)
-0:8                  'input' (in 4-component vector of float)
+0:8                  'input' (layout(location=0 ) in 4-component vector of float)
 0:9              vector-scale (temp 4-component vector of float)
 0:9                Convert int to float (temp float)
 0:9                  'c' (temp int)
-0:9                'input' (in 4-component vector of float)
+0:9                'input' (layout(location=0 ) in 4-component vector of float)
 0:10            vector-scale (temp 4-component vector of float)
 0:10              Convert int to float (temp float)
 0:10                'd' (temp int)
-0:10              'input' (in 4-component vector of float)
+0:10              'input' (layout(location=0 ) in 4-component vector of float)
 0:12      Comma (temp int)
 0:12        move second child to first child (temp int)
 0:12          'e' (temp int)
@@ -197,38 +202,42 @@
 0:14              Constant:
 0:14                0 (const int)
 0:14            direct index (temp float)
-0:14              'input' (in 4-component vector of float)
+0:14              'input' (layout(location=0 ) in 4-component vector of float)
 0:14              Constant:
 0:14                1 (const int)
 0:14          true case
 0:14          vector-scale (temp 4-component vector of float)
 0:14            Convert int to float (temp float)
 0:14              'c' (temp int)
-0:14            'input' (in 4-component vector of float)
+0:14            'input' (layout(location=0 ) in 4-component vector of float)
 0:14          false case
 0:14          vector-scale (temp 4-component vector of float)
 0:14            Convert int to float (temp float)
 0:14              'd' (temp int)
-0:14            'input' (in 4-component vector of float)
-0:15      Branch: Return with expression
-0:15        add (temp 4-component vector of float)
-0:15          vector-scale (temp 4-component vector of float)
-0:15            Convert int to float (temp float)
-0:15              'e' (temp int)
-0:15            'ret' (temp 4-component vector of float)
-0:15          'f' (temp 4-component vector of float)
+0:14            'input' (layout(location=0 ) in 4-component vector of float)
+0:15      Sequence
+0:15        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:15          add (temp 4-component vector of float)
+0:15            vector-scale (temp 4-component vector of float)
+0:15              Convert int to float (temp float)
+0:15                'e' (temp int)
+0:15              'ret' (temp 4-component vector of float)
+0:15            'f' (temp 4-component vector of float)
+0:15        Branch: Return
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 89
+// Id's are bound by 91
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 22
+                              EntryPoint Fragment 4  "PixelShaderFunction" 22 83
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 8  "a"
                               Name 10  "b"
@@ -238,6 +247,9 @@
                               Name 22  "input"
                               Name 40  "e"
                               Name 57  "f"
+                              Name 83  "@entryPointOutput"
+                              Decorate 22(input) Location 0
+                              Decorate 83(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
@@ -258,6 +270,8 @@
               64:     59(int) Constant 1
               65:             TypePointer Input 15(float)
               68:             TypeBool
+              82:             TypePointer Output 16(fvec4)
+83(@entryPointOutput):     82(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
             8(a):      7(ptr) Variable Function
@@ -347,11 +361,12 @@
               71:             Label
               81:   16(fvec4) Load 58
                               Store 57(f) 81
-              82:      6(int) Load 40(e)
-              83:   15(float) ConvertSToF 82
-              84:   16(fvec4) Load 18(ret)
-              85:   16(fvec4) VectorTimesScalar 84 83
-              86:   16(fvec4) Load 57(f)
-              87:   16(fvec4) FAdd 85 86
-                              ReturnValue 87
+              84:      6(int) Load 40(e)
+              85:   15(float) ConvertSToF 84
+              86:   16(fvec4) Load 18(ret)
+              87:   16(fvec4) VectorTimesScalar 86 85
+              88:   16(fvec4) Load 57(f)
+              89:   16(fvec4) FAdd 87 88
+                              Store 83(@entryPointOutput) 89
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.constructexpr.frag.out b/Test/baseResults/hlsl.constructexpr.frag.out
index 2eef7c0..956e1bb 100644
--- a/Test/baseResults/hlsl.constructexpr.frag.out
+++ b/Test/baseResults/hlsl.constructexpr.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:18  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:4  Function Definition: main( (global structure{temp 4-component vector of float color})
 0:4    Function Parameters: 
 0:?     Sequence
 0:6      Constant:
@@ -34,9 +34,17 @@
 0:15          1.000000
 0:15          1.000000
 0:15          1.000000
-0:16      Branch: Return with expression
-0:16        'ps_output' (temp structure{temp 4-component vector of float color})
+0:?       Sequence
+0:?         Sequence
+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:16            color: direct index for structure (temp 4-component vector of float)
+0:16              'ps_output' (temp structure{temp 4-component vector of float color})
+0:16              Constant:
+0:16                0 (const int)
+0:16        Branch: Return
 0:?   Linker Objects
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 
 Linked fragment stage:
@@ -45,7 +53,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:18  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:4  Function Definition: main( (global structure{temp 4-component vector of float color})
 0:4    Function Parameters: 
 0:?     Sequence
 0:6      Constant:
@@ -77,24 +85,33 @@
 0:15          1.000000
 0:15          1.000000
 0:15          1.000000
-0:16      Branch: Return with expression
-0:16        'ps_output' (temp structure{temp 4-component vector of float color})
+0:?       Sequence
+0:?         Sequence
+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:16            color: direct index for structure (temp 4-component vector of float)
+0:16              'ps_output' (temp structure{temp 4-component vector of float color})
+0:16              Constant:
+0:16                0 (const int)
+0:16        Branch: Return
 0:?   Linker Objects
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 32
+// Id's are bound by 35
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 31
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 22  "PS_OUTPUT"
                               MemberName 22(PS_OUTPUT) 0  "color"
                               Name 24  "ps_output"
+                              Name 31  "color"
+                              Decorate 31(color) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
@@ -119,11 +136,15 @@
               26:   13(float) Constant 1065353216
               27:   21(fvec4) ConstantComposite 26 26 26 26
               28:             TypePointer Function 21(fvec4)
+              30:             TypePointer Output 21(fvec4)
+       31(color):     30(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
    24(ps_output):     23(ptr) Variable Function
               29:     28(ptr) AccessChain 24(ps_output) 25
                               Store 29 27
-              30:22(PS_OUTPUT) Load 24(ps_output)
-                              ReturnValue 30
+              32:     28(ptr) AccessChain 24(ps_output) 25
+              33:   21(fvec4) Load 32
+                              Store 31(color) 33
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.depthGreater.frag.out b/Test/baseResults/hlsl.depthGreater.frag.out
new file mode 100755
index 0000000..6a44a2f
--- /dev/null
+++ b/Test/baseResults/hlsl.depthGreater.frag.out
@@ -0,0 +1,59 @@
+hlsl.depthGreater.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+using depth_greater
+0:? Sequence
+0:2  Function Definition: PixelShaderFunction(f1; (global void)
+0:2    Function Parameters: 
+0:2      'depth' (out float FragDepth)
+0:?     Sequence
+0:3      move second child to first child (temp float)
+0:3        'depth' (out float FragDepth)
+0:3        Constant:
+0:3          0.200000
+0:?   Linker Objects
+0:?     'depth' (out float FragDepth)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+using depth_greater
+0:? Sequence
+0:2  Function Definition: PixelShaderFunction(f1; (global void)
+0:2    Function Parameters: 
+0:2      'depth' (out float FragDepth)
+0:?     Sequence
+0:3      move second child to first child (temp float)
+0:3        'depth' (out float FragDepth)
+0:3        Constant:
+0:3          0.200000
+0:?   Linker Objects
+0:?     'depth' (out float FragDepth)
+
+// 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  "PixelShaderFunction" 8
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 DepthGreater
+                              Name 4  "PixelShaderFunction"
+                              Name 8  "depth"
+                              Decorate 8(depth) BuiltIn FragDepth
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypePointer Output 6(float)
+        8(depth):      7(ptr) Variable Output
+               9:    6(float) Constant 1045220557
+4(PixelShaderFunction):           2 Function None 3
+               5:             Label
+                              Store 8(depth) 9
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.depthLess.frag.out b/Test/baseResults/hlsl.depthLess.frag.out
new file mode 100755
index 0000000..b1307ce
--- /dev/null
+++ b/Test/baseResults/hlsl.depthLess.frag.out
@@ -0,0 +1,60 @@
+hlsl.depthLess.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+using depth_less
+0:? Sequence
+0:2  Function Definition: PixelShaderFunction( (global float FragDepth)
+0:2    Function Parameters: 
+0:?     Sequence
+0:3      Sequence
+0:3        move second child to first child (temp float)
+0:?           '@entryPointOutput' (out float unknown built-in variable)
+0:3          Constant:
+0:3            0.200000
+0:3        Branch: Return
+0:?   Linker Objects
+0:?     '@entryPointOutput' (out float unknown built-in variable)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+using depth_less
+0:? Sequence
+0:2  Function Definition: PixelShaderFunction( (global float FragDepth)
+0:2    Function Parameters: 
+0:?     Sequence
+0:3      Sequence
+0:3        move second child to first child (temp float)
+0:?           '@entryPointOutput' (out float unknown built-in variable)
+0:3          Constant:
+0:3            0.200000
+0:3        Branch: Return
+0:?   Linker Objects
+0:?     '@entryPointOutput' (out float unknown built-in variable)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 11
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "PixelShaderFunction" 8
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 DepthLess
+                              Name 4  "PixelShaderFunction"
+                              Name 8  "@entryPointOutput"
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypePointer Output 6(float)
+8(@entryPointOutput):      7(ptr) Variable Output
+               9:    6(float) Constant 1045220557
+4(PixelShaderFunction):           2 Function None 3
+               5:             Label
+                              Store 8(@entryPointOutput) 9
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.discard.frag.out b/Test/baseResults/hlsl.discard.frag.out
index 324029a..9601c7d 100755
--- a/Test/baseResults/hlsl.discard.frag.out
+++ b/Test/baseResults/hlsl.discard.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:7  Function Definition: foo(f1; (global void)
+0:2  Function Definition: foo(f1; (global void)
 0:2    Function Parameters: 
 0:2      'f' (in float)
 0:?     Sequence
@@ -14,19 +14,19 @@
 0:3            1.000000
 0:3        true case
 0:4        Branch: Kill
-0:15  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(vf4; (global void)
 0:8    Function Parameters: 
-0:8      'input' (in 4-component vector of float)
+0:8      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:9      Function Call: foo(f1; (global void)
 0:9        direct index (temp float)
-0:9          'input' (in 4-component vector of float)
+0:9          'input' (layout(location=0 ) in 4-component vector of float)
 0:9          Constant:
 0:9            2 (const int)
 0:10      Test condition and select (temp void)
 0:10        Condition
 0:10        direct index (temp float)
-0:10          'input' (in 4-component vector of float)
+0:10          'input' (layout(location=0 ) in 4-component vector of float)
 0:10          Constant:
 0:10            0 (const int)
 0:10        true case
@@ -35,11 +35,12 @@
 0:12        move second child to first child (temp float)
 0:12          'f' (temp float)
 0:12          direct index (temp float)
-0:12            'input' (in 4-component vector of float)
+0:12            'input' (layout(location=0 ) in 4-component vector of float)
 0:12            Constant:
 0:12              0 (const int)
 0:13      Branch: Kill
 0:?   Linker Objects
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -48,7 +49,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:7  Function Definition: foo(f1; (global void)
+0:2  Function Definition: foo(f1; (global void)
 0:2    Function Parameters: 
 0:2      'f' (in float)
 0:?     Sequence
@@ -60,19 +61,19 @@
 0:3            1.000000
 0:3        true case
 0:4        Branch: Kill
-0:15  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:8  Function Definition: PixelShaderFunction(vf4; (global void)
 0:8    Function Parameters: 
-0:8      'input' (in 4-component vector of float)
+0:8      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:9      Function Call: foo(f1; (global void)
 0:9        direct index (temp float)
-0:9          'input' (in 4-component vector of float)
+0:9          'input' (layout(location=0 ) in 4-component vector of float)
 0:9          Constant:
 0:9            2 (const int)
 0:10      Test condition and select (temp void)
 0:10        Condition
 0:10        direct index (temp float)
-0:10          'input' (in 4-component vector of float)
+0:10          'input' (layout(location=0 ) in 4-component vector of float)
 0:10          Constant:
 0:10            0 (const int)
 0:10        true case
@@ -81,11 +82,12 @@
 0:12        move second child to first child (temp float)
 0:12          'f' (temp float)
 0:12          direct index (temp float)
-0:12            'input' (in 4-component vector of float)
+0:12            'input' (layout(location=0 ) in 4-component vector of float)
 0:12            Constant:
 0:12              0 (const int)
 0:13      Branch: Kill
 0:?   Linker Objects
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -96,13 +98,13 @@
                               MemoryModel Logical GLSL450
                               EntryPoint Fragment 4  "PixelShaderFunction" 21
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 10  "foo(f1;"
                               Name 9  "f"
                               Name 21  "input"
                               Name 22  "param"
                               Name 35  "f"
+                              Decorate 21(input) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
diff --git a/Test/baseResults/hlsl.doLoop.frag.out b/Test/baseResults/hlsl.doLoop.frag.out
index c14a3a5..019f43d 100755
--- a/Test/baseResults/hlsl.doLoop.frag.out
+++ b/Test/baseResults/hlsl.doLoop.frag.out
@@ -2,9 +2,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:7  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Loop with condition not tested first
 0:3        Loop Condition
@@ -19,12 +19,17 @@
 0:5      Loop with condition not tested first
 0:5        Loop Condition
 0:5        Compare Equal (temp bool)
-0:5          'input' (in 4-component vector of float)
-0:5          'input' (in 4-component vector of float)
+0:5          'input' (layout(location=0 ) in 4-component vector of float)
+0:5          'input' (layout(location=0 ) in 4-component vector of float)
 0:5        Loop Body
-0:5        Branch: Return with expression
-0:5          'input' (in 4-component vector of float)
+0:5        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            'input' (layout(location=0 ) in 4-component vector of float)
+0:5          Branch: Return
 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)
 
 
 Linked fragment stage:
@@ -33,9 +38,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:7  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Loop with condition not tested first
 0:3        Loop Condition
@@ -50,34 +55,43 @@
 0:5      Loop with condition not tested first
 0:5        Loop Condition
 0:5        Compare Equal (temp bool)
-0:5          'input' (in 4-component vector of float)
-0:5          'input' (in 4-component vector of float)
+0:5          'input' (layout(location=0 ) in 4-component vector of float)
+0:5          'input' (layout(location=0 ) in 4-component vector of float)
 0:5        Loop Body
-0:5        Branch: Return with expression
-0:5          'input' (in 4-component vector of float)
+0:5        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            'input' (layout(location=0 ) in 4-component vector of float)
+0:5          Branch: Return
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 31
+// Id's are bound by 33
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 23
+                              EntryPoint Fragment 4  "PixelShaderFunction" 23 25
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
-                              Name 23  "input"
+                              Name 23  "@entryPointOutput"
+                              Name 25  "input"
+                              Decorate 23(@entryPointOutput) Location 0
+                              Decorate 25(input) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
               10:             TypeBool
               11:    10(bool) ConstantFalse
               20:             TypeFloat 32
               21:             TypeVector 20(float) 4
-              22:             TypePointer Input 21(fvec4)
-       23(input):     22(ptr) Variable Input
-              28:             TypeVector 10(bool) 4
+              22:             TypePointer Output 21(fvec4)
+23(@entryPointOutput):     22(ptr) Variable Output
+              24:             TypePointer Input 21(fvec4)
+       25(input):     24(ptr) Variable Input
+              30:             TypeVector 10(bool) 4
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
                               Branch 6
@@ -103,14 +117,15 @@
                               LoopMerge 18 19 None
                               Branch 17
               17:             Label
-              24:   21(fvec4) Load 23(input)
-                              ReturnValue 24
+              26:   21(fvec4) Load 25(input)
+                              Store 23(@entryPointOutput) 26
+                              Return
               19:             Label
-              26:   21(fvec4) Load 23(input)
-              27:   21(fvec4) Load 23(input)
-              29:   28(bvec4) FOrdEqual 26 27
-              30:    10(bool) All 29
-                              BranchConditional 30 16 18
+              28:   21(fvec4) Load 25(input)
+              29:   21(fvec4) Load 25(input)
+              31:   30(bvec4) FOrdEqual 28 29
+              32:    10(bool) All 31
+                              BranchConditional 32 16 18
               18:             Label
                               Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.entry-in.frag.out b/Test/baseResults/hlsl.entry-in.frag.out
new file mode 100755
index 0000000..5baea64
--- /dev/null
+++ b/Test/baseResults/hlsl.entry-in.frag.out
@@ -0,0 +1,304 @@
+hlsl.entry-in.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:8  Function Definition: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:8    Function Parameters: 
+0:8      'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?     Sequence
+0:9      Branch: Return with expression
+0:9        add (temp float)
+0:9          direct index (temp float)
+0:9            v: direct index for structure (temp 2-component vector of float)
+0:9              'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:9              Constant:
+0:9                0 (const int)
+0:9            Constant:
+0:9              1 (const int)
+0:9          direct index (temp float)
+0:9            fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
+0:9              'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:9              Constant:
+0:9                1 (const int)
+0:9            Constant:
+0:9              0 (const int)
+0:13  Function Definition: PixelShaderFunction(struct-InParam-vf2-vf4-vi21; (global 4-component vector of float)
+0:13    Function Parameters: 
+0:13      'i' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?     Sequence
+0:?       Sequence
+0:15        move second child to first child (temp 2-component vector of float)
+0:15          v: direct index for structure (temp 2-component vector of float)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              0 (const int)
+0:?           'v' (layout(location=0 ) in 2-component vector of float)
+0:15        move second child to first child (temp 4-component vector of float)
+0:15          fragCoord: direct index for structure (temp 4-component vector of float)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              1 (const int)
+0:?           'fragCoord' (in 4-component vector of float FragCoord)
+0:15        move second child to first child (temp 2-component vector of int)
+0:15          i2: direct index for structure (temp 2-component vector of int)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              2 (const int)
+0:?           'i2' (layout(location=1 ) in 2-component vector of int)
+0:16      Sequence
+0:16        move second child to first child (temp float)
+0:16          'ret1' (temp float)
+0:16          Function Call: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:16            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:17      Sequence
+0:17        move second child to first child (temp float)
+0:17          'ret2' (temp float)
+0:17          Function Call: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:?             Comma (temp float)
+0:?               Sequence
+0:?                 move second child to first child (temp 2-component vector of float)
+0:?                   v: direct index for structure (temp 2-component vector of float)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       0 (const int)
+0:?                   'v' (layout(location=0 ) in 2-component vector of float)
+0:?                 move second child to first child (temp 4-component vector of float)
+0:?                   fragCoord: direct index for structure (temp 4-component vector of float)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       1 (const int)
+0:?                   'fragCoord' (in 4-component vector of float FragCoord)
+0:?                 move second child to first child (temp 2-component vector of int)
+0:?                   i2: direct index for structure (temp 2-component vector of int)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       2 (const int)
+0:?                   'i2' (layout(location=1 ) in 2-component vector of int)
+0:?               'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:19      Sequence
+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          vector-scale (temp 4-component vector of float)
+0:19            vector-scale (temp 4-component vector of float)
+0:19              fragCoord: direct index for structure (temp 4-component vector of float)
+0:19                'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:19                Constant:
+0:19                  1 (const int)
+0:19              'ret1' (temp float)
+0:19            'ret2' (temp float)
+0:19        Branch: Return
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'v' (layout(location=0 ) in 2-component vector of float)
+0:?     'fragCoord' (in 4-component vector of float FragCoord)
+0:?     'i2' (layout(location=1 ) in 2-component vector of int)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:8  Function Definition: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:8    Function Parameters: 
+0:8      'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?     Sequence
+0:9      Branch: Return with expression
+0:9        add (temp float)
+0:9          direct index (temp float)
+0:9            v: direct index for structure (temp 2-component vector of float)
+0:9              'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:9              Constant:
+0:9                0 (const int)
+0:9            Constant:
+0:9              1 (const int)
+0:9          direct index (temp float)
+0:9            fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
+0:9              'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:9              Constant:
+0:9                1 (const int)
+0:9            Constant:
+0:9              0 (const int)
+0:13  Function Definition: PixelShaderFunction(struct-InParam-vf2-vf4-vi21; (global 4-component vector of float)
+0:13    Function Parameters: 
+0:13      'i' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?     Sequence
+0:?       Sequence
+0:15        move second child to first child (temp 2-component vector of float)
+0:15          v: direct index for structure (temp 2-component vector of float)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              0 (const int)
+0:?           'v' (layout(location=0 ) in 2-component vector of float)
+0:15        move second child to first child (temp 4-component vector of float)
+0:15          fragCoord: direct index for structure (temp 4-component vector of float)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              1 (const int)
+0:?           'fragCoord' (in 4-component vector of float FragCoord)
+0:15        move second child to first child (temp 2-component vector of int)
+0:15          i2: direct index for structure (temp 2-component vector of int)
+0:15            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:15            Constant:
+0:15              2 (const int)
+0:?           'i2' (layout(location=1 ) in 2-component vector of int)
+0:16      Sequence
+0:16        move second child to first child (temp float)
+0:16          'ret1' (temp float)
+0:16          Function Call: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:16            'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:17      Sequence
+0:17        move second child to first child (temp float)
+0:17          'ret2' (temp float)
+0:17          Function Call: fun(struct-InParam-vf2-vf4-vi21; (global float)
+0:?             Comma (temp float)
+0:?               Sequence
+0:?                 move second child to first child (temp 2-component vector of float)
+0:?                   v: direct index for structure (temp 2-component vector of float)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       0 (const int)
+0:?                   'v' (layout(location=0 ) in 2-component vector of float)
+0:?                 move second child to first child (temp 4-component vector of float)
+0:?                   fragCoord: direct index for structure (temp 4-component vector of float)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       1 (const int)
+0:?                   'fragCoord' (in 4-component vector of float FragCoord)
+0:?                 move second child to first child (temp 2-component vector of int)
+0:?                   i2: direct index for structure (temp 2-component vector of int)
+0:?                     'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:?                     Constant:
+0:?                       2 (const int)
+0:?                   'i2' (layout(location=1 ) in 2-component vector of int)
+0:?               'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:19      Sequence
+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          vector-scale (temp 4-component vector of float)
+0:19            vector-scale (temp 4-component vector of float)
+0:19              fragCoord: direct index for structure (temp 4-component vector of float)
+0:19                'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
+0:19                Constant:
+0:19                  1 (const int)
+0:19              'ret1' (temp float)
+0:19            'ret2' (temp float)
+0:19        Branch: Return
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'v' (layout(location=0 ) in 2-component vector of float)
+0:?     'fragCoord' (in 4-component vector of float FragCoord)
+0:?     'i2' (layout(location=1 ) in 2-component vector of int)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 71
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "PixelShaderFunction" 32 37 43 63
+                              ExecutionMode 4 OriginUpperLeft
+                              Name 4  "PixelShaderFunction"
+                              Name 11  "InParam"
+                              MemberName 11(InParam) 0  "v"
+                              MemberName 11(InParam) 1  "fragCoord"
+                              MemberName 11(InParam) 2  "i2"
+                              Name 15  "fun(struct-InParam-vf2-vf4-vi21;"
+                              Name 14  "p"
+                              Name 30  "local"
+                              Name 32  "v"
+                              Name 37  "fragCoord"
+                              Name 43  "i2"
+                              Name 47  "ret1"
+                              Name 48  "param"
+                              Name 51  "ret2"
+                              Name 52  "aggShadow"
+                              Name 59  "param"
+                              Name 63  "@entryPointOutput"
+                              Decorate 32(v) Location 0
+                              Decorate 37(fragCoord) BuiltIn FragCoord
+                              Decorate 43(i2) Location 1
+                              Decorate 63(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 2
+               8:             TypeVector 6(float) 4
+               9:             TypeInt 32 1
+              10:             TypeVector 9(int) 2
+     11(InParam):             TypeStruct 7(fvec2) 8(fvec4) 10(ivec2)
+              12:             TypePointer Function 11(InParam)
+              13:             TypeFunction 6(float) 12(ptr)
+              17:      9(int) Constant 0
+              18:             TypeInt 32 0
+              19:     18(int) Constant 1
+              20:             TypePointer Function 6(float)
+              23:      9(int) Constant 1
+              24:     18(int) Constant 0
+              31:             TypePointer Input 7(fvec2)
+           32(v):     31(ptr) Variable Input
+              34:             TypePointer Function 7(fvec2)
+              36:             TypePointer Input 8(fvec4)
+   37(fragCoord):     36(ptr) Variable Input
+              39:             TypePointer Function 8(fvec4)
+              41:      9(int) Constant 2
+              42:             TypePointer Input 10(ivec2)
+          43(i2):     42(ptr) Variable Input
+              45:             TypePointer Function 10(ivec2)
+              62:             TypePointer Output 8(fvec4)
+63(@entryPointOutput):     62(ptr) Variable Output
+4(PixelShaderFunction):           2 Function None 3
+               5:             Label
+       30(local):     12(ptr) Variable Function
+        47(ret1):     20(ptr) Variable Function
+       48(param):     12(ptr) Variable Function
+        51(ret2):     20(ptr) Variable Function
+   52(aggShadow):     12(ptr) Variable Function
+       59(param):     20(ptr) Variable Function
+              33:    7(fvec2) Load 32(v)
+              35:     34(ptr) AccessChain 30(local) 17
+                              Store 35 33
+              38:    8(fvec4) Load 37(fragCoord)
+              40:     39(ptr) AccessChain 30(local) 23
+                              Store 40 38
+              44:   10(ivec2) Load 43(i2)
+              46:     45(ptr) AccessChain 30(local) 41
+                              Store 46 44
+              49: 11(InParam) Load 30(local)
+                              Store 48(param) 49
+              50:    6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 48(param)
+                              Store 47(ret1) 50
+              53:    7(fvec2) Load 32(v)
+              54:     34(ptr) AccessChain 52(aggShadow) 17
+                              Store 54 53
+              55:    8(fvec4) Load 37(fragCoord)
+              56:     39(ptr) AccessChain 52(aggShadow) 23
+                              Store 56 55
+              57:   10(ivec2) Load 43(i2)
+              58:     45(ptr) AccessChain 52(aggShadow) 41
+                              Store 58 57
+              60: 11(InParam) Load 52(aggShadow)
+                              Store 59(param) 60
+              61:    6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 59(param)
+                              Store 51(ret2) 61
+              64:     39(ptr) AccessChain 30(local) 23
+              65:    8(fvec4) Load 64
+              66:    6(float) Load 47(ret1)
+              67:    8(fvec4) VectorTimesScalar 65 66
+              68:    6(float) Load 51(ret2)
+              69:    8(fvec4) VectorTimesScalar 67 68
+                              Store 63(@entryPointOutput) 69
+                              Return
+                              FunctionEnd
+15(fun(struct-InParam-vf2-vf4-vi21;):    6(float) Function None 13
+           14(p):     12(ptr) FunctionParameter
+              16:             Label
+              21:     20(ptr) AccessChain 14(p) 17 19
+              22:    6(float) Load 21
+              25:     20(ptr) AccessChain 14(p) 23 24
+              26:    6(float) Load 25
+              27:    6(float) FAdd 22 26
+                              ReturnValue 27
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.entry-out.frag.out b/Test/baseResults/hlsl.entry-out.frag.out
new file mode 100755
index 0000000..81926dd
--- /dev/null
+++ b/Test/baseResults/hlsl.entry-out.frag.out
@@ -0,0 +1,218 @@
+hlsl.entry-out.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; (global 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'input' (layout(location=0 ) in 4-component vector of float)
+0:7      'out1' (layout(location=1 ) out 4-component vector of float)
+0:7      'out2' (out structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:7      'out3' (out structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:?     Sequence
+0:8      move second child to first child (temp 4-component vector of float)
+0:8        'out1' (layout(location=1 ) out 4-component vector of float)
+0:8        'input' (layout(location=0 ) in 4-component vector of float)
+0:9      move second child to first child (temp 2-component vector of float)
+0:?         'v' (layout(location=2 ) out 2-component vector of float)
+0:9        Constant:
+0:9          2.000000
+0:9          2.000000
+0:10      move second child to first child (temp 2-component vector of int)
+0:?         'i' (layout(location=3 ) out 2-component vector of int)
+0:10        Constant:
+0:10          3 (const int)
+0:10          3 (const int)
+0:12      move second child to first child (temp 2-component vector of float)
+0:12        v: direct index for structure (temp 2-component vector of float)
+0:12          'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          12.000000
+0:12          12.000000
+0:13      move second child to first child (temp 2-component vector of int)
+0:13        i: direct index for structure (temp 2-component vector of int)
+0:13          'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          13 (const int)
+0:13          13 (const int)
+0:?       Sequence
+0:14        move second child to first child (temp 2-component vector of float)
+0:?           'v' (layout(location=4 ) out 2-component vector of float)
+0:14          v: direct index for structure (temp 2-component vector of float)
+0:14            'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:14            Constant:
+0:14              0 (const int)
+0:14        move second child to first child (temp 2-component vector of int)
+0:?           'i' (layout(location=5 ) out 2-component vector of int)
+0:14          i: direct index for structure (temp 2-component vector of int)
+0:14            'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:14            Constant:
+0:14              1 (const int)
+0:16      Sequence
+0:16        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:16          'out1' (layout(location=1 ) out 4-component vector of float)
+0:16        Branch: Return
+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:?     'out1' (layout(location=1 ) out 4-component vector of float)
+0:?     'v' (layout(location=2 ) out 2-component vector of float)
+0:?     'i' (layout(location=3 ) out 2-component vector of int)
+0:?     'v' (layout(location=4 ) out 2-component vector of float)
+0:?     'i' (layout(location=5 ) out 2-component vector of int)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; (global 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'input' (layout(location=0 ) in 4-component vector of float)
+0:7      'out1' (layout(location=1 ) out 4-component vector of float)
+0:7      'out2' (out structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:7      'out3' (out structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:?     Sequence
+0:8      move second child to first child (temp 4-component vector of float)
+0:8        'out1' (layout(location=1 ) out 4-component vector of float)
+0:8        'input' (layout(location=0 ) in 4-component vector of float)
+0:9      move second child to first child (temp 2-component vector of float)
+0:?         'v' (layout(location=2 ) out 2-component vector of float)
+0:9        Constant:
+0:9          2.000000
+0:9          2.000000
+0:10      move second child to first child (temp 2-component vector of int)
+0:?         'i' (layout(location=3 ) out 2-component vector of int)
+0:10        Constant:
+0:10          3 (const int)
+0:10          3 (const int)
+0:12      move second child to first child (temp 2-component vector of float)
+0:12        v: direct index for structure (temp 2-component vector of float)
+0:12          'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:12          Constant:
+0:12            0 (const int)
+0:12        Constant:
+0:12          12.000000
+0:12          12.000000
+0:13      move second child to first child (temp 2-component vector of int)
+0:13        i: direct index for structure (temp 2-component vector of int)
+0:13          'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:13          Constant:
+0:13            1 (const int)
+0:13        Constant:
+0:13          13 (const int)
+0:13          13 (const int)
+0:?       Sequence
+0:14        move second child to first child (temp 2-component vector of float)
+0:?           'v' (layout(location=4 ) out 2-component vector of float)
+0:14          v: direct index for structure (temp 2-component vector of float)
+0:14            'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:14            Constant:
+0:14              0 (const int)
+0:14        move second child to first child (temp 2-component vector of int)
+0:?           'i' (layout(location=5 ) out 2-component vector of int)
+0:14          i: direct index for structure (temp 2-component vector of int)
+0:14            'local' (temp structure{temp 2-component vector of float v, temp 2-component vector of int i})
+0:14            Constant:
+0:14              1 (const int)
+0:16      Sequence
+0:16        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:16          'out1' (layout(location=1 ) out 4-component vector of float)
+0:16        Branch: Return
+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:?     'out1' (layout(location=1 ) out 4-component vector of float)
+0:?     'v' (layout(location=2 ) out 2-component vector of float)
+0:?     'i' (layout(location=3 ) out 2-component vector of int)
+0:?     'v' (layout(location=4 ) out 2-component vector of float)
+0:?     'i' (layout(location=5 ) out 2-component vector of int)
+
+// 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 Fragment 4  "PixelShaderFunction" 9 11 15 21 37 40 43
+                              ExecutionMode 4 OriginUpperLeft
+                              Name 4  "PixelShaderFunction"
+                              Name 9  "out1"
+                              Name 11  "input"
+                              Name 15  "v"
+                              Name 21  "i"
+                              Name 24  "OutParam"
+                              MemberName 24(OutParam) 0  "v"
+                              MemberName 24(OutParam) 1  "i"
+                              Name 26  "local"
+                              Name 37  "v"
+                              Name 40  "i"
+                              Name 43  "@entryPointOutput"
+                              Decorate 9(out1) Location 1
+                              Decorate 11(input) Location 0
+                              Decorate 15(v) Location 2
+                              Decorate 21(i) Location 3
+                              Decorate 37(v) Location 4
+                              Decorate 40(i) Location 5
+                              Decorate 43(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+         9(out1):      8(ptr) Variable Output
+              10:             TypePointer Input 7(fvec4)
+       11(input):     10(ptr) Variable Input
+              13:             TypeVector 6(float) 2
+              14:             TypePointer Output 13(fvec2)
+           15(v):     14(ptr) Variable Output
+              16:    6(float) Constant 1073741824
+              17:   13(fvec2) ConstantComposite 16 16
+              18:             TypeInt 32 1
+              19:             TypeVector 18(int) 2
+              20:             TypePointer Output 19(ivec2)
+           21(i):     20(ptr) Variable Output
+              22:     18(int) Constant 3
+              23:   19(ivec2) ConstantComposite 22 22
+    24(OutParam):             TypeStruct 13(fvec2) 19(ivec2)
+              25:             TypePointer Function 24(OutParam)
+              27:     18(int) Constant 0
+              28:    6(float) Constant 1094713344
+              29:   13(fvec2) ConstantComposite 28 28
+              30:             TypePointer Function 13(fvec2)
+              32:     18(int) Constant 1
+              33:     18(int) Constant 13
+              34:   19(ivec2) ConstantComposite 33 33
+              35:             TypePointer Function 19(ivec2)
+           37(v):     14(ptr) Variable Output
+           40(i):     20(ptr) Variable Output
+43(@entryPointOutput):      8(ptr) Variable Output
+4(PixelShaderFunction):           2 Function None 3
+               5:             Label
+       26(local):     25(ptr) Variable Function
+              12:    7(fvec4) Load 11(input)
+                              Store 9(out1) 12
+                              Store 15(v) 17
+                              Store 21(i) 23
+              31:     30(ptr) AccessChain 26(local) 27
+                              Store 31 29
+              36:     35(ptr) AccessChain 26(local) 32
+                              Store 36 34
+              38:     30(ptr) AccessChain 26(local) 27
+              39:   13(fvec2) Load 38
+                              Store 37(v) 39
+              41:     35(ptr) AccessChain 26(local) 32
+              42:   19(ivec2) Load 41
+                              Store 40(i) 42
+              44:    7(fvec4) Load 9(out1)
+                              Store 43(@entryPointOutput) 44
+                              Return
+                              FunctionEnd
diff --git a/Test/baseResults/hlsl.float1.frag.out b/Test/baseResults/hlsl.float1.frag.out
index 07de03e..313be0b 100755
--- a/Test/baseResults/hlsl.float1.frag.out
+++ b/Test/baseResults/hlsl.float1.frag.out
@@ -12,7 +12,7 @@
 0:2      'scalar' (global float)
 0:2      Constant:
 0:2        2.000000
-0:8  Function Definition: ShaderFunction(vf1;f1; (global 1-component vector of float)
+0:5  Function Definition: ShaderFunction(vf1;f1; (global 1-component vector of float)
 0:5    Function Parameters: 
 0:5      'inFloat1' (in 1-component vector of float)
 0:5      'inScalar' (in float)
@@ -46,7 +46,7 @@
 0:2      'scalar' (global float)
 0:2      Constant:
 0:2        2.000000
-0:8  Function Definition: ShaderFunction(vf1;f1; (global 1-component vector of float)
+0:5  Function Definition: ShaderFunction(vf1;f1; (global 1-component vector of float)
 0:5    Function Parameters: 
 0:5      'inFloat1' (in 1-component vector of float)
 0:5      'inScalar' (in float)
@@ -72,7 +72,6 @@
                               MemoryModel Logical GLSL450
                               EntryPoint Fragment 4  "PixelShaderFunction"
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 11  "ShaderFunction(vf1;f1;"
                               Name 9  "inFloat1"
diff --git a/Test/baseResults/hlsl.float4.frag.out b/Test/baseResults/hlsl.float4.frag.out
index 370a506..85b3c9b 100755
--- a/Test/baseResults/hlsl.float4.frag.out
+++ b/Test/baseResults/hlsl.float4.frag.out
@@ -13,7 +13,7 @@
 0:?         0.500000
 0:?         0.000000
 0:?         1.000000
-0:12  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
+0:9  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
 0:9    Function Parameters: 
 0:9      'input' (in 4-component vector of float)
 0:?     Sequence
@@ -26,7 +26,7 @@
 0:?     'ff1' (global bool Face)
 0:?     'ff2' (layout(offset=4 ) global 4-component vector of float)
 0:?     'ff3' (layout(binding=0 offset=4 ) global 4-component vector of float)
-0:?     'ff4' (layout(binding=1 offset=4 ) global 4-component vector of float FragCoord)
+0:?     'ff4' (layout(binding=1 offset=4 ) global 4-component vector of float)
 
 
 Linked fragment stage:
@@ -43,7 +43,7 @@
 0:?         0.500000
 0:?         0.000000
 0:?         1.000000
-0:12  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
+0:9  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
 0:9    Function Parameters: 
 0:9      'input' (in 4-component vector of float)
 0:?     Sequence
@@ -56,7 +56,7 @@
 0:?     'ff1' (global bool Face)
 0:?     'ff2' (layout(offset=4 ) global 4-component vector of float)
 0:?     'ff3' (layout(binding=0 offset=4 ) global 4-component vector of float)
-0:?     'ff4' (layout(binding=1 offset=4 ) global 4-component vector of float FragCoord)
+0:?     'ff4' (layout(binding=1 offset=4 ) global 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -67,7 +67,6 @@
                               MemoryModel Logical GLSL450
                               EntryPoint Fragment 4  "PixelShaderFunction"
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 11  "ShaderFunction(vf4;"
                               Name 10  "input"
@@ -82,7 +81,6 @@
                               Decorate 28(ff3) Binding 0
                               Decorate 29(ff4) Offset 4
                               Decorate 29(ff4) Binding 1
-                              Decorate 29(ff4) BuiltIn FragCoord
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
diff --git a/Test/baseResults/hlsl.forLoop.frag.out b/Test/baseResults/hlsl.forLoop.frag.out
index 9764e26..ba8e32e 100755
--- a/Test/baseResults/hlsl.forLoop.frag.out
+++ b/Test/baseResults/hlsl.forLoop.frag.out
@@ -2,9 +2,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:?       Sequence
 0:3        Loop with condition tested first
@@ -12,7 +12,7 @@
 0:3          No loop body
 0:4      Sequence
 0:4        Pre-Increment (temp 4-component vector of float)
-0:4          'input' (in 4-component vector of float)
+0:4          'input' (layout(location=0 ) in 4-component vector of float)
 0:4        Loop with condition tested first
 0:4          No loop condition
 0:4          No loop body
@@ -20,36 +20,42 @@
 0:5        Loop with condition tested first
 0:5          Loop Condition
 0:5          Compare Not Equal (temp bool)
-0:5            'input' (in 4-component vector of float)
-0:5            'input' (in 4-component vector of float)
+0:5            'input' (layout(location=0 ) in 4-component vector of float)
+0:5            'input' (layout(location=0 ) in 4-component vector of float)
 0:5          No loop body
 0:?       Sequence
 0:6        Loop with condition tested first
 0:6          Loop Condition
 0:6          Compare Not Equal (temp bool)
-0:6            'input' (in 4-component vector of float)
-0:6            'input' (in 4-component vector of float)
+0:6            'input' (layout(location=0 ) in 4-component vector of float)
+0:6            'input' (layout(location=0 ) in 4-component vector of float)
 0:6          Loop Body
 0:?           Sequence
-0:6            Branch: Return with expression
-0:6              Negate value (temp 4-component vector of float)
-0:6                'input' (in 4-component vector of float)
+0:6            Sequence
+0:6              move second child to first child (temp 4-component vector of float)
+0:?                 '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:6                Negate value (temp 4-component vector of float)
+0:6                  'input' (layout(location=0 ) in 4-component vector of float)
+0:6              Branch: Return
 0:7      Sequence
 0:7        Pre-Decrement (temp 4-component vector of float)
-0:7          'input' (in 4-component vector of float)
+0:7          'input' (layout(location=0 ) in 4-component vector of float)
 0:7        Loop with condition tested first
 0:7          Loop Condition
 0:7          Compare Not Equal (temp bool)
-0:7            'input' (in 4-component vector of float)
-0:7            'input' (in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
 0:7          Loop Body
 0:?           Sequence
-0:7            Branch: Return with expression
-0:7              Negate value (temp 4-component vector of float)
-0:7                'input' (in 4-component vector of float)
+0:7            Sequence
+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                Negate value (temp 4-component vector of float)
+0:7                  'input' (layout(location=0 ) in 4-component vector of float)
+0:7              Branch: Return
 0:7          Loop Terminal Expression
 0:7          add second child into first child (temp 4-component vector of float)
-0:7            'input' (in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
 0:7            Constant:
 0:7              2.000000
 0:?       Sequence
@@ -60,7 +66,7 @@
 0:8            Condition
 0:8            Compare Greater Than (temp bool)
 0:8              direct index (temp float)
-0:8                'input' (in 4-component vector of float)
+0:8                'input' (layout(location=0 ) in 4-component vector of float)
 0:8                Constant:
 0:8                  0 (const int)
 0:8              Constant:
@@ -75,7 +81,7 @@
 0:9            Condition
 0:9            Compare Greater Than (temp bool)
 0:9              direct index (temp float)
-0:9                'input' (in 4-component vector of float)
+0:9                'input' (layout(location=0 ) in 4-component vector of float)
 0:9                Constant:
 0:9                  0 (const int)
 0:9              Constant:
@@ -108,6 +114,8 @@
 0:12      Pre-Decrement (temp float)
 0:12        'ii' (temp float)
 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)
 
 
 Linked fragment stage:
@@ -116,9 +124,9 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:?       Sequence
 0:3        Loop with condition tested first
@@ -126,7 +134,7 @@
 0:3          No loop body
 0:4      Sequence
 0:4        Pre-Increment (temp 4-component vector of float)
-0:4          'input' (in 4-component vector of float)
+0:4          'input' (layout(location=0 ) in 4-component vector of float)
 0:4        Loop with condition tested first
 0:4          No loop condition
 0:4          No loop body
@@ -134,36 +142,42 @@
 0:5        Loop with condition tested first
 0:5          Loop Condition
 0:5          Compare Not Equal (temp bool)
-0:5            'input' (in 4-component vector of float)
-0:5            'input' (in 4-component vector of float)
+0:5            'input' (layout(location=0 ) in 4-component vector of float)
+0:5            'input' (layout(location=0 ) in 4-component vector of float)
 0:5          No loop body
 0:?       Sequence
 0:6        Loop with condition tested first
 0:6          Loop Condition
 0:6          Compare Not Equal (temp bool)
-0:6            'input' (in 4-component vector of float)
-0:6            'input' (in 4-component vector of float)
+0:6            'input' (layout(location=0 ) in 4-component vector of float)
+0:6            'input' (layout(location=0 ) in 4-component vector of float)
 0:6          Loop Body
 0:?           Sequence
-0:6            Branch: Return with expression
-0:6              Negate value (temp 4-component vector of float)
-0:6                'input' (in 4-component vector of float)
+0:6            Sequence
+0:6              move second child to first child (temp 4-component vector of float)
+0:?                 '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:6                Negate value (temp 4-component vector of float)
+0:6                  'input' (layout(location=0 ) in 4-component vector of float)
+0:6              Branch: Return
 0:7      Sequence
 0:7        Pre-Decrement (temp 4-component vector of float)
-0:7          'input' (in 4-component vector of float)
+0:7          'input' (layout(location=0 ) in 4-component vector of float)
 0:7        Loop with condition tested first
 0:7          Loop Condition
 0:7          Compare Not Equal (temp bool)
-0:7            'input' (in 4-component vector of float)
-0:7            'input' (in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
 0:7          Loop Body
 0:?           Sequence
-0:7            Branch: Return with expression
-0:7              Negate value (temp 4-component vector of float)
-0:7                'input' (in 4-component vector of float)
+0:7            Sequence
+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                Negate value (temp 4-component vector of float)
+0:7                  'input' (layout(location=0 ) in 4-component vector of float)
+0:7              Branch: Return
 0:7          Loop Terminal Expression
 0:7          add second child into first child (temp 4-component vector of float)
-0:7            'input' (in 4-component vector of float)
+0:7            'input' (layout(location=0 ) in 4-component vector of float)
 0:7            Constant:
 0:7              2.000000
 0:?       Sequence
@@ -174,7 +188,7 @@
 0:8            Condition
 0:8            Compare Greater Than (temp bool)
 0:8              direct index (temp float)
-0:8                'input' (in 4-component vector of float)
+0:8                'input' (layout(location=0 ) in 4-component vector of float)
 0:8                Constant:
 0:8                  0 (const int)
 0:8              Constant:
@@ -189,7 +203,7 @@
 0:9            Condition
 0:9            Compare Greater Than (temp bool)
 0:9              direct index (temp float)
-0:9                'input' (in 4-component vector of float)
+0:9                'input' (layout(location=0 ) in 4-component vector of float)
 0:9                Constant:
 0:9                  0 (const int)
 0:9              Constant:
@@ -222,21 +236,25 @@
 0:12      Pre-Decrement (temp float)
 0:12        'ii' (temp float)
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 112
+// Id's are bound by 114
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 13
+                              EntryPoint Fragment 4  "PixelShaderFunction" 13 43
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 13  "input"
-                              Name 89  "ii"
-                              Name 109  "ii"
+                              Name 43  "@entryPointOutput"
+                              Name 91  "ii"
+                              Name 111  "ii"
+                              Decorate 13(input) Location 0
+                              Decorate 43(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
               10:             TypeFloat 32
@@ -246,21 +264,23 @@
               15:   10(float) Constant 1065353216
               29:             TypeBool
               30:             TypeVector 29(bool) 4
-              60:   10(float) Constant 1073741824
-              68:             TypeInt 32 0
-              69:     68(int) Constant 0
-              70:             TypePointer Input 10(float)
-              87:             TypeInt 32 1
-              88:             TypePointer Function 87(int)
-              90:     87(int) Constant 4294967295
-              97:     87(int) Constant 3
-             100:     87(int) Constant 2
-             106:     87(int) Constant 1
-             108:             TypePointer Function 10(float)
+              42:             TypePointer Output 11(fvec4)
+43(@entryPointOutput):     42(ptr) Variable Output
+              62:   10(float) Constant 1073741824
+              70:             TypeInt 32 0
+              71:     70(int) Constant 0
+              72:             TypePointer Input 10(float)
+              89:             TypeInt 32 1
+              90:             TypePointer Function 89(int)
+              92:     89(int) Constant 4294967295
+              99:     89(int) Constant 3
+             102:     89(int) Constant 2
+             108:     89(int) Constant 1
+             110:             TypePointer Function 10(float)
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-          89(ii):     88(ptr) Variable Function
-         109(ii):    108(ptr) Variable Function
+          91(ii):     90(ptr) Variable Function
+         111(ii):    110(ptr) Variable Function
                               Branch 6
                6:             Label
                               LoopMerge 8 9 None
@@ -309,97 +329,99 @@
               41:    29(bool) Any 40
                               BranchConditional 41 34 35
               34:               Label
-              42:   11(fvec4)   Load 13(input)
-              43:   11(fvec4)   FNegate 42
-                                ReturnValue 43
+              44:   11(fvec4)   Load 13(input)
+              45:   11(fvec4)   FNegate 44
+                                Store 43(@entryPointOutput) 45
+                                Return
               36:               Label
                                 Branch 33
               35:             Label
-              45:   11(fvec4) Load 13(input)
-              46:   11(fvec4) CompositeConstruct 15 15 15 15
-              47:   11(fvec4) FSub 45 46
-                              Store 13(input) 47
-                              Branch 48
-              48:             Label
-                              LoopMerge 50 51 None
-                              Branch 52
-              52:             Label
-              53:   11(fvec4) Load 13(input)
-              54:   11(fvec4) Load 13(input)
-              55:   30(bvec4) FOrdNotEqual 53 54
-              56:    29(bool) Any 55
-                              BranchConditional 56 49 50
-              49:               Label
-              57:   11(fvec4)   Load 13(input)
-              58:   11(fvec4)   FNegate 57
-                                ReturnValue 58
-              51:               Label
-              61:   11(fvec4)   Load 13(input)
-              62:   11(fvec4)   CompositeConstruct 60 60 60 60
-              63:   11(fvec4)   FAdd 61 62
-                                Store 13(input) 63
-                                Branch 48
+              47:   11(fvec4) Load 13(input)
+              48:   11(fvec4) CompositeConstruct 15 15 15 15
+              49:   11(fvec4) FSub 47 48
+                              Store 13(input) 49
+                              Branch 50
               50:             Label
-                              Branch 64
-              64:             Label
-                              LoopMerge 66 67 None
-                              Branch 65
-              65:             Label
-              71:     70(ptr) AccessChain 13(input) 69
-              72:   10(float) Load 71
-              73:    29(bool) FOrdGreaterThan 72 60
-                              SelectionMerge 75 None
-                              BranchConditional 73 74 75
-              74:               Label
-                                Branch 66
-              75:             Label
+                              LoopMerge 52 53 None
+                              Branch 54
+              54:             Label
+              55:   11(fvec4) Load 13(input)
+              56:   11(fvec4) Load 13(input)
+              57:   30(bvec4) FOrdNotEqual 55 56
+              58:    29(bool) Any 57
+                              BranchConditional 58 51 52
+              51:               Label
+              59:   11(fvec4)   Load 13(input)
+              60:   11(fvec4)   FNegate 59
+                                Store 43(@entryPointOutput) 60
+                                Return
+              53:               Label
+              63:   11(fvec4)   Load 13(input)
+              64:   11(fvec4)   CompositeConstruct 62 62 62 62
+              65:   11(fvec4)   FAdd 63 64
+                                Store 13(input) 65
+                                Branch 50
+              52:             Label
+                              Branch 66
+              66:             Label
+                              LoopMerge 68 69 None
                               Branch 67
               67:             Label
-                              Branch 64
-              66:             Label
-                              Branch 77
+              73:     72(ptr) AccessChain 13(input) 71
+              74:   10(float) Load 73
+              75:    29(bool) FOrdGreaterThan 74 62
+                              SelectionMerge 77 None
+                              BranchConditional 75 76 77
+              76:               Label
+                                Branch 68
               77:             Label
-                              LoopMerge 79 80 None
-                              Branch 78
-              78:             Label
-              81:     70(ptr) AccessChain 13(input) 69
-              82:   10(float) Load 81
-              83:    29(bool) FOrdGreaterThan 82 60
-                              SelectionMerge 85 None
-                              BranchConditional 83 84 85
-              84:               Label
-                                Branch 80
-              85:             Label
+                              Branch 69
+              69:             Label
+                              Branch 66
+              68:             Label
+                              Branch 79
+              79:             Label
+                              LoopMerge 81 82 None
                               Branch 80
               80:             Label
-                              Branch 77
-              79:             Label
-                              Store 89(ii) 90
-                              Branch 91
-              91:             Label
-                              LoopMerge 93 94 None
-                              Branch 95
-              95:             Label
-              96:     87(int) Load 89(ii)
-              98:    29(bool) SLessThan 96 97
-                              BranchConditional 98 92 93
-              92:               Label
-              99:     87(int)   Load 89(ii)
-             101:    29(bool)   IEqual 99 100
-                                SelectionMerge 103 None
-                                BranchConditional 101 102 103
-             102:                 Label
-                                  Branch 94
-             103:               Label
-                                Branch 94
-              94:               Label
-             105:     87(int)   Load 89(ii)
-             107:     87(int)   IAdd 105 106
-                                Store 89(ii) 107
-                                Branch 91
+              83:     72(ptr) AccessChain 13(input) 71
+              84:   10(float) Load 83
+              85:    29(bool) FOrdGreaterThan 84 62
+                              SelectionMerge 87 None
+                              BranchConditional 85 86 87
+              86:               Label
+                                Branch 82
+              87:             Label
+                              Branch 82
+              82:             Label
+                              Branch 79
+              81:             Label
+                              Store 91(ii) 92
+                              Branch 93
               93:             Label
-             110:   10(float) Load 109(ii)
-             111:   10(float) FSub 110 15
-                              Store 109(ii) 111
+                              LoopMerge 95 96 None
+                              Branch 97
+              97:             Label
+              98:     89(int) Load 91(ii)
+             100:    29(bool) SLessThan 98 99
+                              BranchConditional 100 94 95
+              94:               Label
+             101:     89(int)   Load 91(ii)
+             103:    29(bool)   IEqual 101 102
+                                SelectionMerge 105 None
+                                BranchConditional 103 104 105
+             104:                 Label
+                                  Branch 96
+             105:               Label
+                                Branch 96
+              96:               Label
+             107:     89(int)   Load 91(ii)
+             109:     89(int)   IAdd 107 108
+                                Store 91(ii) 109
+                                Branch 93
+              95:             Label
+             112:   10(float) Load 111(ii)
+             113:   10(float) FSub 112 15
+                              Store 111(ii) 113
                               Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gather.array.dx10.frag.out b/Test/baseResults/hlsl.gather.array.dx10.frag.out
index 70d1bf1..d2545cc 100644
--- a/Test/baseResults/hlsl.gather.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.gather.array.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:44  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:29      Sequence
@@ -76,7 +76,7 @@
 0:?               1.000000
 0:39      move second child to first child (temp 4-component vector of float)
 0:39        Color: direct index for structure (temp 4-component vector of float)
-0:39          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:39          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:39          Constant:
 0:39            0 (const int)
 0:39        Constant:
@@ -85,14 +85,27 @@
 0:39          1.000000
 0:39          1.000000
 0:40      move second child to first child (temp float)
-0:40        Depth: direct index for structure (temp float FragDepth)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40        Depth: direct index for structure (temp float)
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            1 (const int)
 0:40        Constant:
 0:40          1.000000
-0:42      Branch: Return with expression
-0:42        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:42          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:42            Color: direct index for structure (temp 4-component vector of float)
+0:42              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:42              Constant:
+0:42                0 (const int)
+0:42          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:42            Depth: direct index for structure (temp float)
+0:42              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:42              Constant:
+0:42                1 (const int)
+0:42        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -105,6 +118,8 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -113,7 +128,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:44  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:24    Function Parameters: 
 0:?     Sequence
 0:29      Sequence
@@ -187,7 +202,7 @@
 0:?               1.000000
 0:39      move second child to first child (temp 4-component vector of float)
 0:39        Color: direct index for structure (temp 4-component vector of float)
-0:39          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:39          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:39          Constant:
 0:39            0 (const int)
 0:39        Constant:
@@ -196,14 +211,27 @@
 0:39          1.000000
 0:39          1.000000
 0:40      move second child to first child (temp float)
-0:40        Depth: direct index for structure (temp float FragDepth)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40        Depth: direct index for structure (temp float)
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            1 (const int)
 0:40        Constant:
 0:40          1.000000
-0:42      Branch: Return with expression
-0:42        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:42          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:42            Color: direct index for structure (temp 4-component vector of float)
+0:42              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:42              Constant:
+0:42                0 (const int)
+0:42          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:42            Depth: direct index for structure (temp float)
+0:42              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:42              Constant:
+0:42                1 (const int)
+0:42        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -216,19 +244,20 @@
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 110
+// Id's are bound by 117
 
                               Capability Shader
                               Capability Sampled1D
                               Capability SampledCubeArray
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 99 103
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval20"
                               Name 12  "g_tTex2df4a"
@@ -247,10 +276,12 @@
                               MemberName 90(PS_OUTPUT) 0  "Color"
                               MemberName 90(PS_OUTPUT) 1  "Depth"
                               Name 92  "psout"
-                              Name 102  "g_tTex1df4a"
-                              Name 103  "g_tTex1df4"
-                              Name 106  "g_tTex1di4a"
-                              Name 109  "g_tTex1du4a"
+                              Name 99  "Color"
+                              Name 103  "Depth"
+                              Name 109  "g_tTex1df4a"
+                              Name 110  "g_tTex1df4"
+                              Name 113  "g_tTex1di4a"
+                              Name 116  "g_tTex1du4a"
                               Decorate 12(g_tTex2df4a) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
@@ -259,13 +290,14 @@
                               Decorate 60(g_tTexcdf4a) DescriptorSet 0
                               Decorate 70(g_tTexcdi4a) DescriptorSet 0
                               Decorate 80(g_tTexcdu4a) DescriptorSet 0
-                              MemberDecorate 90(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 102(g_tTex1df4a) DescriptorSet 0
-                              Decorate 102(g_tTex1df4a) Binding 1
-                              Decorate 103(g_tTex1df4) DescriptorSet 0
-                              Decorate 103(g_tTex1df4) Binding 0
-                              Decorate 106(g_tTex1di4a) DescriptorSet 0
-                              Decorate 109(g_tTex1du4a) DescriptorSet 0
+                              Decorate 99(Color) Location 0
+                              Decorate 103(Depth) BuiltIn FragDepth
+                              Decorate 109(g_tTex1df4a) DescriptorSet 0
+                              Decorate 109(g_tTex1df4a) Binding 1
+                              Decorate 110(g_tTex1df4) DescriptorSet 0
+                              Decorate 110(g_tTex1df4) Binding 0
+                              Decorate 113(g_tTex1di4a) DescriptorSet 0
+                              Decorate 116(g_tTex1du4a) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -327,16 +359,20 @@
               93:    7(fvec4) ConstantComposite 87 87 87 87
               95:     25(int) Constant 1
               96:             TypePointer Function 6(float)
-             100:             TypeImage 6(float) 1D array sampled format:Unknown
-             101:             TypePointer UniformConstant 100
-102(g_tTex1df4a):    101(ptr) Variable UniformConstant
- 103(g_tTex1df4):    101(ptr) Variable UniformConstant
-             104:             TypeImage 25(int) 1D array sampled format:Unknown
-             105:             TypePointer UniformConstant 104
-106(g_tTex1di4a):    105(ptr) Variable UniformConstant
-             107:             TypeImage 42(int) 1D array sampled format:Unknown
+              98:             TypePointer Output 7(fvec4)
+       99(Color):     98(ptr) Variable Output
+             102:             TypePointer Output 6(float)
+      103(Depth):    102(ptr) Variable Output
+             107:             TypeImage 6(float) 1D array sampled format:Unknown
              108:             TypePointer UniformConstant 107
-109(g_tTex1du4a):    108(ptr) Variable UniformConstant
+109(g_tTex1df4a):    108(ptr) Variable UniformConstant
+ 110(g_tTex1df4):    108(ptr) Variable UniformConstant
+             111:             TypeImage 25(int) 1D array sampled format:Unknown
+             112:             TypePointer UniformConstant 111
+113(g_tTex1di4a):    112(ptr) Variable UniformConstant
+             114:             TypeImage 42(int) 1D array sampled format:Unknown
+             115:             TypePointer UniformConstant 114
+116(g_tTex1du4a):    115(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval20):      8(ptr) Variable Function
@@ -380,6 +416,11 @@
                               Store 94 93
               97:     96(ptr) AccessChain 92(psout) 95
                               Store 97 87
-              98:90(PS_OUTPUT) Load 92(psout)
-                              ReturnValue 98
+             100:      8(ptr) AccessChain 92(psout) 26
+             101:    7(fvec4) Load 100
+                              Store 99(Color) 101
+             104:     96(ptr) AccessChain 92(psout) 95
+             105:    6(float) Load 104
+                              Store 103(Depth) 105
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gather.basic.dx10.frag.out b/Test/baseResults/hlsl.gather.basic.dx10.frag.out
index c52d7cd..52648f7 100644
--- a/Test/baseResults/hlsl.gather.basic.dx10.frag.out
+++ b/Test/baseResults/hlsl.gather.basic.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:49  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:29  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:29    Function Parameters: 
 0:?     Sequence
 0:34      Sequence
@@ -70,7 +70,7 @@
 0:?               0.900000
 0:44      move second child to first child (temp 4-component vector of float)
 0:44        Color: direct index for structure (temp 4-component vector of float)
-0:44          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:44          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:44          Constant:
 0:44            0 (const int)
 0:44        Constant:
@@ -79,14 +79,27 @@
 0:44          1.000000
 0:44          1.000000
 0:45      move second child to first child (temp float)
-0:45        Depth: direct index for structure (temp float FragDepth)
-0:45          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:45        Depth: direct index for structure (temp float)
+0:45          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:45          Constant:
 0:45            1 (const int)
 0:45        Constant:
 0:45          1.000000
-0:47      Branch: Return with expression
-0:47        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:47          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:47            Color: direct index for structure (temp 4-component vector of float)
+0:47              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:47              Constant:
+0:47                0 (const int)
+0:47          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:47            Depth: direct index for structure (temp float)
+0:47              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:47              Constant:
+0:47                1 (const int)
+0:47        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -103,6 +116,8 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -111,7 +126,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:49  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:29  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:29    Function Parameters: 
 0:?     Sequence
 0:34      Sequence
@@ -179,7 +194,7 @@
 0:?               0.900000
 0:44      move second child to first child (temp 4-component vector of float)
 0:44        Color: direct index for structure (temp 4-component vector of float)
-0:44          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:44          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:44          Constant:
 0:44            0 (const int)
 0:44        Constant:
@@ -188,14 +203,27 @@
 0:44          1.000000
 0:44          1.000000
 0:45      move second child to first child (temp float)
-0:45        Depth: direct index for structure (temp float FragDepth)
-0:45          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:45        Depth: direct index for structure (temp float)
+0:45          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:45          Constant:
 0:45            1 (const int)
 0:45        Constant:
 0:45          1.000000
-0:47      Branch: Return with expression
-0:47        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:47          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:47            Color: direct index for structure (temp 4-component vector of float)
+0:47              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:47              Constant:
+0:47                0 (const int)
+0:47          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:47            Depth: direct index for structure (temp float)
+0:47              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:47              Constant:
+0:47                1 (const int)
+0:47        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -212,18 +240,19 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 121
+// Id's are bound by 128
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 100 104
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval20"
                               Name 12  "g_tTex2df4"
@@ -242,14 +271,16 @@
                               MemberName 90(PS_OUTPUT) 0  "Color"
                               MemberName 90(PS_OUTPUT) 1  "Depth"
                               Name 92  "psout"
-                              Name 101  "g_sSamp2d"
-                              Name 104  "g_tTex1df4a"
-                              Name 105  "g_tTex1df4"
-                              Name 108  "g_tTex1di4"
-                              Name 111  "g_tTex1du4"
-                              Name 114  "g_tTex3df4"
-                              Name 117  "g_tTex3di4"
-                              Name 120  "g_tTex3du4"
+                              Name 100  "Color"
+                              Name 104  "Depth"
+                              Name 108  "g_sSamp2d"
+                              Name 111  "g_tTex1df4a"
+                              Name 112  "g_tTex1df4"
+                              Name 115  "g_tTex1di4"
+                              Name 118  "g_tTex1du4"
+                              Name 121  "g_tTex3df4"
+                              Name 124  "g_tTex3di4"
+                              Name 127  "g_tTex3du4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
@@ -258,17 +289,18 @@
                               Decorate 59(g_tTexcdf4) DescriptorSet 0
                               Decorate 70(g_tTexcdi4) DescriptorSet 0
                               Decorate 80(g_tTexcdu4) DescriptorSet 0
-                              MemberDecorate 90(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 101(g_sSamp2d) DescriptorSet 0
-                              Decorate 104(g_tTex1df4a) DescriptorSet 0
-                              Decorate 104(g_tTex1df4a) Binding 1
-                              Decorate 105(g_tTex1df4) DescriptorSet 0
-                              Decorate 105(g_tTex1df4) Binding 0
-                              Decorate 108(g_tTex1di4) DescriptorSet 0
-                              Decorate 111(g_tTex1du4) DescriptorSet 0
-                              Decorate 114(g_tTex3df4) DescriptorSet 0
-                              Decorate 117(g_tTex3di4) DescriptorSet 0
-                              Decorate 120(g_tTex3du4) DescriptorSet 0
+                              Decorate 100(Color) Location 0
+                              Decorate 104(Depth) BuiltIn FragDepth
+                              Decorate 108(g_sSamp2d) DescriptorSet 0
+                              Decorate 111(g_tTex1df4a) DescriptorSet 0
+                              Decorate 111(g_tTex1df4a) Binding 1
+                              Decorate 112(g_tTex1df4) DescriptorSet 0
+                              Decorate 112(g_tTex1df4) Binding 0
+                              Decorate 115(g_tTex1di4) DescriptorSet 0
+                              Decorate 118(g_tTex1du4) DescriptorSet 0
+                              Decorate 121(g_tTex3df4) DescriptorSet 0
+                              Decorate 124(g_tTex3di4) DescriptorSet 0
+                              Decorate 127(g_tTex3du4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -331,26 +363,30 @@
               94:    7(fvec4) ConstantComposite 93 93 93 93
               96:     24(int) Constant 1
               97:             TypePointer Function 6(float)
-  101(g_sSamp2d):     15(ptr) Variable UniformConstant
-             102:             TypeImage 6(float) 1D sampled format:Unknown
-             103:             TypePointer UniformConstant 102
-104(g_tTex1df4a):    103(ptr) Variable UniformConstant
- 105(g_tTex1df4):    103(ptr) Variable UniformConstant
-             106:             TypeImage 24(int) 1D sampled format:Unknown
-             107:             TypePointer UniformConstant 106
- 108(g_tTex1di4):    107(ptr) Variable UniformConstant
-             109:             TypeImage 41(int) 1D sampled format:Unknown
+              99:             TypePointer Output 7(fvec4)
+      100(Color):     99(ptr) Variable Output
+             103:             TypePointer Output 6(float)
+      104(Depth):    103(ptr) Variable Output
+  108(g_sSamp2d):     15(ptr) Variable UniformConstant
+             109:             TypeImage 6(float) 1D sampled format:Unknown
              110:             TypePointer UniformConstant 109
- 111(g_tTex1du4):    110(ptr) Variable UniformConstant
-             112:             TypeImage 6(float) 3D sampled format:Unknown
-             113:             TypePointer UniformConstant 112
- 114(g_tTex3df4):    113(ptr) Variable UniformConstant
-             115:             TypeImage 24(int) 3D sampled format:Unknown
-             116:             TypePointer UniformConstant 115
- 117(g_tTex3di4):    116(ptr) Variable UniformConstant
-             118:             TypeImage 41(int) 3D sampled format:Unknown
-             119:             TypePointer UniformConstant 118
- 120(g_tTex3du4):    119(ptr) Variable UniformConstant
+111(g_tTex1df4a):    110(ptr) Variable UniformConstant
+ 112(g_tTex1df4):    110(ptr) Variable UniformConstant
+             113:             TypeImage 24(int) 1D sampled format:Unknown
+             114:             TypePointer UniformConstant 113
+ 115(g_tTex1di4):    114(ptr) Variable UniformConstant
+             116:             TypeImage 41(int) 1D sampled format:Unknown
+             117:             TypePointer UniformConstant 116
+ 118(g_tTex1du4):    117(ptr) Variable UniformConstant
+             119:             TypeImage 6(float) 3D sampled format:Unknown
+             120:             TypePointer UniformConstant 119
+ 121(g_tTex3df4):    120(ptr) Variable UniformConstant
+             122:             TypeImage 24(int) 3D sampled format:Unknown
+             123:             TypePointer UniformConstant 122
+ 124(g_tTex3di4):    123(ptr) Variable UniformConstant
+             125:             TypeImage 41(int) 3D sampled format:Unknown
+             126:             TypePointer UniformConstant 125
+ 127(g_tTex3du4):    126(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval20):      8(ptr) Variable Function
@@ -394,6 +430,11 @@
                               Store 95 94
               98:     97(ptr) AccessChain 92(psout) 96
                               Store 98 93
-              99:90(PS_OUTPUT) Load 92(psout)
-                              ReturnValue 99
+             101:      8(ptr) AccessChain 92(psout) 25
+             102:    7(fvec4) Load 101
+                              Store 100(Color) 102
+             105:     97(ptr) AccessChain 92(psout) 96
+             106:    6(float) Load 105
+                              Store 104(Depth) 106
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/Test/baseResults/hlsl.gather.basic.dx10.vert.out
index 667c39f..1f01fc3 100644
--- a/Test/baseResults/hlsl.gather.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.gather.basic.dx10.vert.out
@@ -1,7 +1,7 @@
 hlsl.gather.basic.dx10.vert
 Shader version: 450
 0:? Sequence
-0:47  Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Pos})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -68,8 +68,8 @@
 0:?               0.800000
 0:?               0.900000
 0:43      move second child to first child (temp 4-component vector of float)
-0:43        Pos: direct index for structure (temp 4-component vector of float FragCoord)
-0:43          'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:43        Pos: direct index for structure (temp 4-component vector of float)
+0:43          'vsout' (temp structure{temp 4-component vector of float Pos})
 0:43          Constant:
 0:43            0 (const int)
 0:?         Constant:
@@ -77,8 +77,15 @@
 0:?           0.000000
 0:?           0.000000
 0:?           0.000000
-0:45      Branch: Return with expression
-0:45        'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:?       Sequence
+0:?         Sequence
+0:45          move second child to first child (temp 4-component vector of float)
+0:?             'Pos' (out 4-component vector of float Position)
+0:45            Pos: direct index for structure (temp 4-component vector of float)
+0:45              'vsout' (temp structure{temp 4-component vector of float Pos})
+0:45              Constant:
+0:45                0 (const int)
+0:45        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -95,6 +102,7 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Pos' (out 4-component vector of float Position)
 
 
 Linked vertex stage:
@@ -102,7 +110,7 @@
 
 Shader version: 450
 0:? Sequence
-0:47  Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Pos})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -169,8 +177,8 @@
 0:?               0.800000
 0:?               0.900000
 0:43      move second child to first child (temp 4-component vector of float)
-0:43        Pos: direct index for structure (temp 4-component vector of float FragCoord)
-0:43          'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:43        Pos: direct index for structure (temp 4-component vector of float)
+0:43          'vsout' (temp structure{temp 4-component vector of float Pos})
 0:43          Constant:
 0:43            0 (const int)
 0:?         Constant:
@@ -178,8 +186,15 @@
 0:?           0.000000
 0:?           0.000000
 0:?           0.000000
-0:45      Branch: Return with expression
-0:45        'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:?       Sequence
+0:?         Sequence
+0:45          move second child to first child (temp 4-component vector of float)
+0:?             'Pos' (out 4-component vector of float Position)
+0:45            Pos: direct index for structure (temp 4-component vector of float)
+0:45              'vsout' (temp structure{temp 4-component vector of float Pos})
+0:45              Constant:
+0:45                0 (const int)
+0:45        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -196,17 +211,17 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Pos' (out 4-component vector of float Position)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 118
+// Id's are bound by 121
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main"
-                              Source HLSL 450
+                              EntryPoint Vertex 4  "main" 97
                               Name 4  "main"
                               Name 9  "txval20"
                               Name 12  "g_tTex2df4"
@@ -224,14 +239,15 @@
                               Name 90  "VS_OUTPUT"
                               MemberName 90(VS_OUTPUT) 0  "Pos"
                               Name 92  "vsout"
-                              Name 98  "g_sSamp2d"
-                              Name 101  "g_tTex1df4a"
-                              Name 102  "g_tTex1df4"
-                              Name 105  "g_tTex1di4"
-                              Name 108  "g_tTex1du4"
-                              Name 111  "g_tTex3df4"
-                              Name 114  "g_tTex3di4"
-                              Name 117  "g_tTex3du4"
+                              Name 97  "Pos"
+                              Name 101  "g_sSamp2d"
+                              Name 104  "g_tTex1df4a"
+                              Name 105  "g_tTex1df4"
+                              Name 108  "g_tTex1di4"
+                              Name 111  "g_tTex1du4"
+                              Name 114  "g_tTex3df4"
+                              Name 117  "g_tTex3di4"
+                              Name 120  "g_tTex3du4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
@@ -240,17 +256,17 @@
                               Decorate 59(g_tTexcdf4) DescriptorSet 0
                               Decorate 70(g_tTexcdi4) DescriptorSet 0
                               Decorate 80(g_tTexcdu4) DescriptorSet 0
-                              MemberDecorate 90(VS_OUTPUT) 0 BuiltIn FragCoord
-                              Decorate 98(g_sSamp2d) DescriptorSet 0
-                              Decorate 101(g_tTex1df4a) DescriptorSet 0
-                              Decorate 101(g_tTex1df4a) Binding 1
-                              Decorate 102(g_tTex1df4) DescriptorSet 0
-                              Decorate 102(g_tTex1df4) Binding 0
-                              Decorate 105(g_tTex1di4) DescriptorSet 0
-                              Decorate 108(g_tTex1du4) DescriptorSet 0
-                              Decorate 111(g_tTex3df4) DescriptorSet 0
-                              Decorate 114(g_tTex3di4) DescriptorSet 0
-                              Decorate 117(g_tTex3du4) DescriptorSet 0
+                              Decorate 97(Pos) BuiltIn Position
+                              Decorate 101(g_sSamp2d) DescriptorSet 0
+                              Decorate 104(g_tTex1df4a) DescriptorSet 0
+                              Decorate 104(g_tTex1df4a) Binding 1
+                              Decorate 105(g_tTex1df4) DescriptorSet 0
+                              Decorate 105(g_tTex1df4) Binding 0
+                              Decorate 108(g_tTex1di4) DescriptorSet 0
+                              Decorate 111(g_tTex1du4) DescriptorSet 0
+                              Decorate 114(g_tTex3df4) DescriptorSet 0
+                              Decorate 117(g_tTex3di4) DescriptorSet 0
+                              Decorate 120(g_tTex3du4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -311,26 +327,28 @@
               91:             TypePointer Function 90(VS_OUTPUT)
               93:    6(float) Constant 0
               94:    7(fvec4) ConstantComposite 93 93 93 93
-   98(g_sSamp2d):     15(ptr) Variable UniformConstant
-              99:             TypeImage 6(float) 1D sampled format:Unknown
-             100:             TypePointer UniformConstant 99
-101(g_tTex1df4a):    100(ptr) Variable UniformConstant
- 102(g_tTex1df4):    100(ptr) Variable UniformConstant
-             103:             TypeImage 24(int) 1D sampled format:Unknown
-             104:             TypePointer UniformConstant 103
- 105(g_tTex1di4):    104(ptr) Variable UniformConstant
-             106:             TypeImage 41(int) 1D sampled format:Unknown
+              96:             TypePointer Output 7(fvec4)
+         97(Pos):     96(ptr) Variable Output
+  101(g_sSamp2d):     15(ptr) Variable UniformConstant
+             102:             TypeImage 6(float) 1D sampled format:Unknown
+             103:             TypePointer UniformConstant 102
+104(g_tTex1df4a):    103(ptr) Variable UniformConstant
+ 105(g_tTex1df4):    103(ptr) Variable UniformConstant
+             106:             TypeImage 24(int) 1D sampled format:Unknown
              107:             TypePointer UniformConstant 106
- 108(g_tTex1du4):    107(ptr) Variable UniformConstant
-             109:             TypeImage 6(float) 3D sampled format:Unknown
+ 108(g_tTex1di4):    107(ptr) Variable UniformConstant
+             109:             TypeImage 41(int) 1D sampled format:Unknown
              110:             TypePointer UniformConstant 109
- 111(g_tTex3df4):    110(ptr) Variable UniformConstant
-             112:             TypeImage 24(int) 3D sampled format:Unknown
+ 111(g_tTex1du4):    110(ptr) Variable UniformConstant
+             112:             TypeImage 6(float) 3D sampled format:Unknown
              113:             TypePointer UniformConstant 112
- 114(g_tTex3di4):    113(ptr) Variable UniformConstant
-             115:             TypeImage 41(int) 3D sampled format:Unknown
+ 114(g_tTex3df4):    113(ptr) Variable UniformConstant
+             115:             TypeImage 24(int) 3D sampled format:Unknown
              116:             TypePointer UniformConstant 115
- 117(g_tTex3du4):    116(ptr) Variable UniformConstant
+ 117(g_tTex3di4):    116(ptr) Variable UniformConstant
+             118:             TypeImage 41(int) 3D sampled format:Unknown
+             119:             TypePointer UniformConstant 118
+ 120(g_tTex3du4):    119(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval20):      8(ptr) Variable Function
@@ -372,6 +390,8 @@
                               Store 77(txval42) 89
               95:      8(ptr) AccessChain 92(vsout) 25
                               Store 95 94
-              96:90(VS_OUTPUT) Load 92(vsout)
-                              ReturnValue 96
+              98:      8(ptr) AccessChain 92(vsout) 25
+              99:    7(fvec4) Load 98
+                              Store 97(Pos) 99
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gather.offset.dx10.frag.out b/Test/baseResults/hlsl.gather.offset.dx10.frag.out
index d5a3921..ac31791 100644
--- a/Test/baseResults/hlsl.gather.offset.dx10.frag.out
+++ b/Test/baseResults/hlsl.gather.offset.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -46,7 +46,7 @@
 0:?               -1 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -55,14 +55,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -78,6 +91,8 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -86,7 +101,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:45  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -130,7 +145,7 @@
 0:?               -1 (const int)
 0:40      move second child to first child (temp 4-component vector of float)
 0:40        Color: direct index for structure (temp 4-component vector of float)
-0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:40          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:40          Constant:
 0:40            0 (const int)
 0:40        Constant:
@@ -139,14 +154,27 @@
 0:40          1.000000
 0:40          1.000000
 0:41      move second child to first child (temp float)
-0:41        Depth: direct index for structure (temp float FragDepth)
-0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:41        Depth: direct index for structure (temp float)
+0:41          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:41          Constant:
 0:41            1 (const int)
 0:41        Constant:
 0:41          1.000000
-0:43      Branch: Return with expression
-0:43        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:43          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:43            Color: direct index for structure (temp 4-component vector of float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                0 (const int)
+0:43          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:43            Depth: direct index for structure (temp float)
+0:43              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:43              Constant:
+0:43                1 (const int)
+0:43        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -162,18 +190,19 @@
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 100
+// Id's are bound by 107
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 71 75
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval20"
                               Name 12  "g_tTex2df4"
@@ -186,34 +215,37 @@
                               MemberName 62(PS_OUTPUT) 0  "Color"
                               MemberName 62(PS_OUTPUT) 1  "Depth"
                               Name 64  "psout"
-                              Name 74  "g_tTex1df4a"
-                              Name 75  "g_tTex1df4"
-                              Name 78  "g_tTex1di4"
-                              Name 81  "g_tTex1du4"
-                              Name 84  "g_tTex3df4"
-                              Name 87  "g_tTex3di4"
-                              Name 90  "g_tTex3du4"
-                              Name 93  "g_tTexcdf4"
-                              Name 96  "g_tTexcdi4"
-                              Name 99  "g_tTexcdu4"
+                              Name 71  "Color"
+                              Name 75  "Depth"
+                              Name 81  "g_tTex1df4a"
+                              Name 82  "g_tTex1df4"
+                              Name 85  "g_tTex1di4"
+                              Name 88  "g_tTex1du4"
+                              Name 91  "g_tTex3df4"
+                              Name 94  "g_tTex3di4"
+                              Name 97  "g_tTex3du4"
+                              Name 100  "g_tTexcdf4"
+                              Name 103  "g_tTexcdi4"
+                              Name 106  "g_tTexcdu4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
                               Decorate 35(g_tTex2di4) DescriptorSet 0
                               Decorate 51(g_tTex2du4) DescriptorSet 0
-                              MemberDecorate 62(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 74(g_tTex1df4a) DescriptorSet 0
-                              Decorate 74(g_tTex1df4a) Binding 1
-                              Decorate 75(g_tTex1df4) DescriptorSet 0
-                              Decorate 75(g_tTex1df4) Binding 0
-                              Decorate 78(g_tTex1di4) DescriptorSet 0
-                              Decorate 81(g_tTex1du4) DescriptorSet 0
-                              Decorate 84(g_tTex3df4) DescriptorSet 0
-                              Decorate 87(g_tTex3di4) DescriptorSet 0
-                              Decorate 90(g_tTex3du4) DescriptorSet 0
-                              Decorate 93(g_tTexcdf4) DescriptorSet 0
-                              Decorate 96(g_tTexcdi4) DescriptorSet 0
-                              Decorate 99(g_tTexcdu4) DescriptorSet 0
+                              Decorate 71(Color) Location 0
+                              Decorate 75(Depth) BuiltIn FragDepth
+                              Decorate 81(g_tTex1df4a) DescriptorSet 0
+                              Decorate 81(g_tTex1df4a) Binding 1
+                              Decorate 82(g_tTex1df4) DescriptorSet 0
+                              Decorate 82(g_tTex1df4) Binding 0
+                              Decorate 85(g_tTex1di4) DescriptorSet 0
+                              Decorate 88(g_tTex1du4) DescriptorSet 0
+                              Decorate 91(g_tTex3df4) DescriptorSet 0
+                              Decorate 94(g_tTex3di4) DescriptorSet 0
+                              Decorate 97(g_tTex3du4) DescriptorSet 0
+                              Decorate 100(g_tTexcdf4) DescriptorSet 0
+                              Decorate 103(g_tTexcdi4) DescriptorSet 0
+                              Decorate 106(g_tTexcdu4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -262,34 +294,38 @@
               65:    6(float) Constant 1065353216
               66:    7(fvec4) ConstantComposite 65 65 65 65
               68:             TypePointer Function 6(float)
-              72:             TypeImage 6(float) 1D sampled format:Unknown
-              73:             TypePointer UniformConstant 72
- 74(g_tTex1df4a):     73(ptr) Variable UniformConstant
-  75(g_tTex1df4):     73(ptr) Variable UniformConstant
-              76:             TypeImage 24(int) 1D sampled format:Unknown
-              77:             TypePointer UniformConstant 76
-  78(g_tTex1di4):     77(ptr) Variable UniformConstant
-              79:             TypeImage 45(int) 1D sampled format:Unknown
+              70:             TypePointer Output 7(fvec4)
+       71(Color):     70(ptr) Variable Output
+              74:             TypePointer Output 6(float)
+       75(Depth):     74(ptr) Variable Output
+              79:             TypeImage 6(float) 1D sampled format:Unknown
               80:             TypePointer UniformConstant 79
-  81(g_tTex1du4):     80(ptr) Variable UniformConstant
-              82:             TypeImage 6(float) 3D sampled format:Unknown
-              83:             TypePointer UniformConstant 82
-  84(g_tTex3df4):     83(ptr) Variable UniformConstant
-              85:             TypeImage 24(int) 3D sampled format:Unknown
-              86:             TypePointer UniformConstant 85
-  87(g_tTex3di4):     86(ptr) Variable UniformConstant
-              88:             TypeImage 45(int) 3D sampled format:Unknown
-              89:             TypePointer UniformConstant 88
-  90(g_tTex3du4):     89(ptr) Variable UniformConstant
-              91:             TypeImage 6(float) Cube sampled format:Unknown
-              92:             TypePointer UniformConstant 91
-  93(g_tTexcdf4):     92(ptr) Variable UniformConstant
-              94:             TypeImage 24(int) Cube sampled format:Unknown
-              95:             TypePointer UniformConstant 94
-  96(g_tTexcdi4):     95(ptr) Variable UniformConstant
-              97:             TypeImage 45(int) Cube sampled format:Unknown
-              98:             TypePointer UniformConstant 97
-  99(g_tTexcdu4):     98(ptr) Variable UniformConstant
+ 81(g_tTex1df4a):     80(ptr) Variable UniformConstant
+  82(g_tTex1df4):     80(ptr) Variable UniformConstant
+              83:             TypeImage 24(int) 1D sampled format:Unknown
+              84:             TypePointer UniformConstant 83
+  85(g_tTex1di4):     84(ptr) Variable UniformConstant
+              86:             TypeImage 45(int) 1D sampled format:Unknown
+              87:             TypePointer UniformConstant 86
+  88(g_tTex1du4):     87(ptr) Variable UniformConstant
+              89:             TypeImage 6(float) 3D sampled format:Unknown
+              90:             TypePointer UniformConstant 89
+  91(g_tTex3df4):     90(ptr) Variable UniformConstant
+              92:             TypeImage 24(int) 3D sampled format:Unknown
+              93:             TypePointer UniformConstant 92
+  94(g_tTex3di4):     93(ptr) Variable UniformConstant
+              95:             TypeImage 45(int) 3D sampled format:Unknown
+              96:             TypePointer UniformConstant 95
+  97(g_tTex3du4):     96(ptr) Variable UniformConstant
+              98:             TypeImage 6(float) Cube sampled format:Unknown
+              99:             TypePointer UniformConstant 98
+ 100(g_tTexcdf4):     99(ptr) Variable UniformConstant
+             101:             TypeImage 24(int) Cube sampled format:Unknown
+             102:             TypePointer UniformConstant 101
+ 103(g_tTexcdi4):    102(ptr) Variable UniformConstant
+             104:             TypeImage 45(int) Cube sampled format:Unknown
+             105:             TypePointer UniformConstant 104
+ 106(g_tTexcdu4):    105(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval20):      8(ptr) Variable Function
@@ -315,6 +351,11 @@
                               Store 67 66
               69:     68(ptr) AccessChain 64(psout) 26
                               Store 69 65
-              70:62(PS_OUTPUT) Load 64(psout)
-                              ReturnValue 70
+              72:      8(ptr) AccessChain 64(psout) 27
+              73:    7(fvec4) Load 72
+                              Store 71(Color) 73
+              76:     68(ptr) AccessChain 64(psout) 26
+              77:    6(float) Load 76
+                              Store 75(Depth) 77
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out b/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
index a1f628a..bf8f382 100644
--- a/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
+++ b/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:37  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:20  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:20    Function Parameters: 
 0:?     Sequence
 0:25      Sequence
@@ -49,7 +49,7 @@
 0:?               -1 (const int)
 0:32      move second child to first child (temp 4-component vector of float)
 0:32        Color: direct index for structure (temp 4-component vector of float)
-0:32          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:32          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:32          Constant:
 0:32            0 (const int)
 0:32        Constant:
@@ -58,14 +58,27 @@
 0:32          1.000000
 0:32          1.000000
 0:33      move second child to first child (temp float)
-0:33        Depth: direct index for structure (temp float FragDepth)
-0:33          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:33        Depth: direct index for structure (temp float)
+0:33          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:33          Constant:
 0:33            1 (const int)
 0:33        Constant:
 0:33          1.000000
-0:35      Branch: Return with expression
-0:35        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:35          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:35            Color: direct index for structure (temp 4-component vector of float)
+0:35              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:35              Constant:
+0:35                0 (const int)
+0:35          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:35            Depth: direct index for structure (temp float)
+0:35              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:35              Constant:
+0:35                1 (const int)
+0:35        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -75,6 +88,8 @@
 0:?     'g_tTex2df4' (uniform texture2DArray)
 0:?     'g_tTex2di4' (uniform itexture2DArray)
 0:?     'g_tTex2du4' (uniform utexture2DArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -83,7 +98,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:37  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:20  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:20    Function Parameters: 
 0:?     Sequence
 0:25      Sequence
@@ -130,7 +145,7 @@
 0:?               -1 (const int)
 0:32      move second child to first child (temp 4-component vector of float)
 0:32        Color: direct index for structure (temp 4-component vector of float)
-0:32          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:32          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:32          Constant:
 0:32            0 (const int)
 0:32        Constant:
@@ -139,14 +154,27 @@
 0:32          1.000000
 0:32          1.000000
 0:33      move second child to first child (temp float)
-0:33        Depth: direct index for structure (temp float FragDepth)
-0:33          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:33        Depth: direct index for structure (temp float)
+0:33          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:33          Constant:
 0:33            1 (const int)
 0:33        Constant:
 0:33          1.000000
-0:35      Branch: Return with expression
-0:35        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:35          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:35            Color: direct index for structure (temp 4-component vector of float)
+0:35              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:35              Constant:
+0:35                0 (const int)
+0:35          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:35            Depth: direct index for structure (temp float)
+0:35              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:35              Constant:
+0:35                1 (const int)
+0:35        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -156,18 +184,19 @@
 0:?     'g_tTex2df4' (uniform texture2DArray)
 0:?     'g_tTex2di4' (uniform itexture2DArray)
 0:?     'g_tTex2du4' (uniform utexture2DArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 83
+// Id's are bound by 90
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 72 76
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval20"
                               Name 12  "g_tTex2df4"
@@ -180,22 +209,25 @@
                               MemberName 63(PS_OUTPUT) 0  "Color"
                               MemberName 63(PS_OUTPUT) 1  "Depth"
                               Name 65  "psout"
-                              Name 75  "g_tTex1df4a"
-                              Name 76  "g_tTex1df4"
-                              Name 79  "g_tTex1di4"
-                              Name 82  "g_tTex1du4"
+                              Name 72  "Color"
+                              Name 76  "Depth"
+                              Name 82  "g_tTex1df4a"
+                              Name 83  "g_tTex1df4"
+                              Name 86  "g_tTex1di4"
+                              Name 89  "g_tTex1du4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
                               Decorate 36(g_tTex2di4) DescriptorSet 0
                               Decorate 51(g_tTex2du4) DescriptorSet 0
-                              MemberDecorate 63(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 75(g_tTex1df4a) DescriptorSet 0
-                              Decorate 75(g_tTex1df4a) Binding 1
-                              Decorate 76(g_tTex1df4) DescriptorSet 0
-                              Decorate 76(g_tTex1df4) Binding 0
-                              Decorate 79(g_tTex1di4) DescriptorSet 0
-                              Decorate 82(g_tTex1du4) DescriptorSet 0
+                              Decorate 72(Color) Location 0
+                              Decorate 76(Depth) BuiltIn FragDepth
+                              Decorate 82(g_tTex1df4a) DescriptorSet 0
+                              Decorate 82(g_tTex1df4a) Binding 1
+                              Decorate 83(g_tTex1df4) DescriptorSet 0
+                              Decorate 83(g_tTex1df4) Binding 0
+                              Decorate 86(g_tTex1di4) DescriptorSet 0
+                              Decorate 89(g_tTex1du4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -245,16 +277,20 @@
               66:    6(float) Constant 1065353216
               67:    7(fvec4) ConstantComposite 66 66 66 66
               69:             TypePointer Function 6(float)
-              73:             TypeImage 6(float) 1D array sampled format:Unknown
-              74:             TypePointer UniformConstant 73
- 75(g_tTex1df4a):     74(ptr) Variable UniformConstant
-  76(g_tTex1df4):     74(ptr) Variable UniformConstant
-              77:             TypeImage 25(int) 1D array sampled format:Unknown
-              78:             TypePointer UniformConstant 77
-  79(g_tTex1di4):     78(ptr) Variable UniformConstant
-              80:             TypeImage 45(int) 1D array sampled format:Unknown
+              71:             TypePointer Output 7(fvec4)
+       72(Color):     71(ptr) Variable Output
+              75:             TypePointer Output 6(float)
+       76(Depth):     75(ptr) Variable Output
+              80:             TypeImage 6(float) 1D array sampled format:Unknown
               81:             TypePointer UniformConstant 80
-  82(g_tTex1du4):     81(ptr) Variable UniformConstant
+ 82(g_tTex1df4a):     81(ptr) Variable UniformConstant
+  83(g_tTex1df4):     81(ptr) Variable UniformConstant
+              84:             TypeImage 25(int) 1D array sampled format:Unknown
+              85:             TypePointer UniformConstant 84
+  86(g_tTex1di4):     85(ptr) Variable UniformConstant
+              87:             TypeImage 45(int) 1D array sampled format:Unknown
+              88:             TypePointer UniformConstant 87
+  89(g_tTex1du4):     88(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval20):      8(ptr) Variable Function
@@ -280,6 +316,11 @@
                               Store 68 67
               70:     69(ptr) AccessChain 65(psout) 27
                               Store 70 66
-              71:63(PS_OUTPUT) Load 65(psout)
-                              ReturnValue 71
+              73:      8(ptr) AccessChain 65(psout) 28
+              74:    7(fvec4) Load 73
+                              Store 72(Color) 74
+              77:     69(ptr) AccessChain 65(psout) 27
+              78:    6(float) Load 77
+                              Store 76(Depth) 78
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
index cad56b6..026fd1b 100644
--- a/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:72  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -247,7 +247,7 @@
 0:65              3 (const int)
 0:67      move second child to first child (temp 4-component vector of float)
 0:67        Color: direct index for structure (temp 4-component vector of float)
-0:67          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:67          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:67          Constant:
 0:67            0 (const int)
 0:67        Constant:
@@ -256,14 +256,27 @@
 0:67          1.000000
 0:67          1.000000
 0:68      move second child to first child (temp float)
-0:68        Depth: direct index for structure (temp float FragDepth)
-0:68          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:68        Depth: direct index for structure (temp float)
+0:68          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:68          Constant:
 0:68            1 (const int)
 0:68        Constant:
 0:68          1.000000
-0:70      Branch: Return with expression
-0:70        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:70          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:70            Color: direct index for structure (temp 4-component vector of float)
+0:70              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:70              Constant:
+0:70                0 (const int)
+0:70          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:70            Depth: direct index for structure (temp float)
+0:70              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:70              Constant:
+0:70                1 (const int)
+0:70        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -280,6 +293,8 @@
 0:?     'c2' (uniform 2-component vector of float)
 0:?     'c3' (uniform 3-component vector of float)
 0:?     'c4' (uniform 4-component vector of float)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -288,7 +303,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:72  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:28  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:28    Function Parameters: 
 0:?     Sequence
 0:33      Sequence
@@ -533,7 +548,7 @@
 0:65              3 (const int)
 0:67      move second child to first child (temp 4-component vector of float)
 0:67        Color: direct index for structure (temp 4-component vector of float)
-0:67          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:67          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:67          Constant:
 0:67            0 (const int)
 0:67        Constant:
@@ -542,14 +557,27 @@
 0:67          1.000000
 0:67          1.000000
 0:68      move second child to first child (temp float)
-0:68        Depth: direct index for structure (temp float FragDepth)
-0:68          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:68        Depth: direct index for structure (temp float)
+0:68          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:68          Constant:
 0:68            1 (const int)
 0:68        Constant:
 0:68          1.000000
-0:70      Branch: Return with expression
-0:70        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:70          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:70            Color: direct index for structure (temp 4-component vector of float)
+0:70              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:70              Constant:
+0:70                0 (const int)
+0:70          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:70            Depth: direct index for structure (temp float)
+0:70              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:70              Constant:
+0:70                1 (const int)
+0:70        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -566,19 +594,20 @@
 0:?     'c2' (uniform 2-component vector of float)
 0:?     'c3' (uniform 3-component vector of float)
 0:?     'c4' (uniform 4-component vector of float)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 220
+// Id's are bound by 227
 
                               Capability Shader
                               Capability Sampled1D
                               Capability SampledCubeArray
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 204 208
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval00"
                               Name 12  "g_tTex2df4a"
@@ -617,12 +646,14 @@
                               MemberName 195(PS_OUTPUT) 0  "Color"
                               MemberName 195(PS_OUTPUT) 1  "Depth"
                               Name 197  "psout"
-                              Name 205  "g_sSamp2d"
-                              Name 208  "g_tTex1df4a"
-                              Name 211  "g_tTex1di4a"
-                              Name 214  "g_tTex1du4a"
-                              Name 216  "c1"
-                              Name 219  "c2"
+                              Name 204  "Color"
+                              Name 208  "Depth"
+                              Name 212  "g_sSamp2d"
+                              Name 215  "g_tTex1df4a"
+                              Name 218  "g_tTex1di4a"
+                              Name 221  "g_tTex1du4a"
+                              Name 223  "c1"
+                              Name 226  "c2"
                               Decorate 12(g_tTex2df4a) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
@@ -631,12 +662,13 @@
                               Decorate 112(g_tTexcdf4a) DescriptorSet 0
                               Decorate 124(g_tTexcdi4a) DescriptorSet 0
                               Decorate 134(g_tTexcdu4a) DescriptorSet 0
-                              MemberDecorate 195(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 205(g_sSamp2d) DescriptorSet 0
-                              Decorate 208(g_tTex1df4a) DescriptorSet 0
-                              Decorate 208(g_tTex1df4a) Binding 0
-                              Decorate 211(g_tTex1di4a) DescriptorSet 0
-                              Decorate 214(g_tTex1du4a) DescriptorSet 0
+                              Decorate 204(Color) Location 0
+                              Decorate 208(Depth) BuiltIn FragDepth
+                              Decorate 212(g_sSamp2d) DescriptorSet 0
+                              Decorate 215(g_tTex1df4a) DescriptorSet 0
+                              Decorate 215(g_tTex1df4a) Binding 0
+                              Decorate 218(g_tTex1di4a) DescriptorSet 0
+                              Decorate 221(g_tTex1du4a) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -689,21 +721,25 @@
              198:    6(float) Constant 1065353216
              199:    7(fvec4) ConstantComposite 198 198 198 198
              201:             TypePointer Function 6(float)
-  205(g_sSamp2d):     15(ptr) Variable UniformConstant
-             206:             TypeImage 6(float) 1D array sampled format:Unknown
-             207:             TypePointer UniformConstant 206
-208(g_tTex1df4a):    207(ptr) Variable UniformConstant
-             209:             TypeImage 24(int) 1D array sampled format:Unknown
-             210:             TypePointer UniformConstant 209
-211(g_tTex1di4a):    210(ptr) Variable UniformConstant
-             212:             TypeImage 39(int) 1D array sampled format:Unknown
-             213:             TypePointer UniformConstant 212
-214(g_tTex1du4a):    213(ptr) Variable UniformConstant
-             215:             TypePointer UniformConstant 6(float)
-         216(c1):    215(ptr) Variable UniformConstant
-             217:             TypeVector 6(float) 2
-             218:             TypePointer UniformConstant 217(fvec2)
-         219(c2):    218(ptr) Variable UniformConstant
+             203:             TypePointer Output 7(fvec4)
+      204(Color):    203(ptr) Variable Output
+             207:             TypePointer Output 6(float)
+      208(Depth):    207(ptr) Variable Output
+  212(g_sSamp2d):     15(ptr) Variable UniformConstant
+             213:             TypeImage 6(float) 1D array sampled format:Unknown
+             214:             TypePointer UniformConstant 213
+215(g_tTex1df4a):    214(ptr) Variable UniformConstant
+             216:             TypeImage 24(int) 1D array sampled format:Unknown
+             217:             TypePointer UniformConstant 216
+218(g_tTex1di4a):    217(ptr) Variable UniformConstant
+             219:             TypeImage 39(int) 1D array sampled format:Unknown
+             220:             TypePointer UniformConstant 219
+221(g_tTex1du4a):    220(ptr) Variable UniformConstant
+             222:             TypePointer UniformConstant 6(float)
+         223(c1):    222(ptr) Variable UniformConstant
+             224:             TypeVector 6(float) 2
+             225:             TypePointer UniformConstant 224(fvec2)
+         226(c2):    225(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval00):      8(ptr) Variable Function
@@ -879,6 +915,11 @@
                               Store 200 199
              202:    201(ptr) AccessChain 197(psout) 57
                               Store 202 198
-             203:195(PS_OUTPUT) Load 197(psout)
-                              ReturnValue 203
+             205:      8(ptr) AccessChain 197(psout) 25
+             206:    7(fvec4) Load 205
+                              Store 204(Color) 206
+             209:    201(ptr) AccessChain 197(psout) 57
+             210:    6(float) Load 209
+                              Store 208(Depth) 210
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
index 8fd9691..2ec5343 100644
--- a/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:78  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:34  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:34    Function Parameters: 
 0:?     Sequence
 0:39      Sequence
@@ -247,7 +247,7 @@
 0:71              3 (const int)
 0:73      move second child to first child (temp 4-component vector of float)
 0:73        Color: direct index for structure (temp 4-component vector of float)
-0:73          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:73          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:73          Constant:
 0:73            0 (const int)
 0:73        Constant:
@@ -256,14 +256,27 @@
 0:73          1.000000
 0:73          1.000000
 0:74      move second child to first child (temp float)
-0:74        Depth: direct index for structure (temp float FragDepth)
-0:74          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:74        Depth: direct index for structure (temp float)
+0:74          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:74          Constant:
 0:74            1 (const int)
 0:74        Constant:
 0:74          1.000000
-0:76      Branch: Return with expression
-0:76        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:76          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:76            Color: direct index for structure (temp 4-component vector of float)
+0:76              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:76              Constant:
+0:76                0 (const int)
+0:76          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:76            Depth: direct index for structure (temp float)
+0:76              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:76              Constant:
+0:76                1 (const int)
+0:76        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -284,6 +297,8 @@
 0:?     'c2' (uniform 2-component vector of float)
 0:?     'c3' (uniform 3-component vector of float)
 0:?     'c4' (uniform 4-component vector of float)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -292,7 +307,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:78  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:34  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:34    Function Parameters: 
 0:?     Sequence
 0:39      Sequence
@@ -537,7 +552,7 @@
 0:71              3 (const int)
 0:73      move second child to first child (temp 4-component vector of float)
 0:73        Color: direct index for structure (temp 4-component vector of float)
-0:73          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:73          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:73          Constant:
 0:73            0 (const int)
 0:73        Constant:
@@ -546,14 +561,27 @@
 0:73          1.000000
 0:73          1.000000
 0:74      move second child to first child (temp float)
-0:74        Depth: direct index for structure (temp float FragDepth)
-0:74          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:74        Depth: direct index for structure (temp float)
+0:74          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:74          Constant:
 0:74            1 (const int)
 0:74        Constant:
 0:74          1.000000
-0:76      Branch: Return with expression
-0:76        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:76          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:76            Color: direct index for structure (temp 4-component vector of float)
+0:76              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:76              Constant:
+0:76                0 (const int)
+0:76          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:76            Depth: direct index for structure (temp float)
+0:76              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:76              Constant:
+0:76                1 (const int)
+0:76        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -574,18 +602,19 @@
 0:?     'c2' (uniform 2-component vector of float)
 0:?     'c3' (uniform 3-component vector of float)
 0:?     'c4' (uniform 4-component vector of float)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 230
+// Id's are bound by 237
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 205 209
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval00"
                               Name 12  "g_tTex2df4"
@@ -624,16 +653,18 @@
                               MemberName 196(PS_OUTPUT) 0  "Color"
                               MemberName 196(PS_OUTPUT) 1  "Depth"
                               Name 198  "psout"
-                              Name 206  "g_sSamp2d"
-                              Name 209  "g_tTex1df4a"
-                              Name 210  "g_tTex1df4"
-                              Name 213  "g_tTex1di4"
-                              Name 216  "g_tTex1du4"
-                              Name 219  "g_tTex3df4"
-                              Name 222  "g_tTex3di4"
-                              Name 225  "g_tTex3du4"
-                              Name 227  "c1"
-                              Name 229  "c4"
+                              Name 205  "Color"
+                              Name 209  "Depth"
+                              Name 213  "g_sSamp2d"
+                              Name 216  "g_tTex1df4a"
+                              Name 217  "g_tTex1df4"
+                              Name 220  "g_tTex1di4"
+                              Name 223  "g_tTex1du4"
+                              Name 226  "g_tTex3df4"
+                              Name 229  "g_tTex3di4"
+                              Name 232  "g_tTex3du4"
+                              Name 234  "c1"
+                              Name 236  "c4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
@@ -642,17 +673,18 @@
                               Decorate 112(g_tTexcdf4) DescriptorSet 0
                               Decorate 125(g_tTexcdi4) DescriptorSet 0
                               Decorate 135(g_tTexcdu4) DescriptorSet 0
-                              MemberDecorate 196(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 206(g_sSamp2d) DescriptorSet 0
-                              Decorate 209(g_tTex1df4a) DescriptorSet 0
-                              Decorate 209(g_tTex1df4a) Binding 1
-                              Decorate 210(g_tTex1df4) DescriptorSet 0
-                              Decorate 210(g_tTex1df4) Binding 0
-                              Decorate 213(g_tTex1di4) DescriptorSet 0
-                              Decorate 216(g_tTex1du4) DescriptorSet 0
-                              Decorate 219(g_tTex3df4) DescriptorSet 0
-                              Decorate 222(g_tTex3di4) DescriptorSet 0
-                              Decorate 225(g_tTex3du4) DescriptorSet 0
+                              Decorate 205(Color) Location 0
+                              Decorate 209(Depth) BuiltIn FragDepth
+                              Decorate 213(g_sSamp2d) DescriptorSet 0
+                              Decorate 216(g_tTex1df4a) DescriptorSet 0
+                              Decorate 216(g_tTex1df4a) Binding 1
+                              Decorate 217(g_tTex1df4) DescriptorSet 0
+                              Decorate 217(g_tTex1df4) Binding 0
+                              Decorate 220(g_tTex1di4) DescriptorSet 0
+                              Decorate 223(g_tTex1du4) DescriptorSet 0
+                              Decorate 226(g_tTex3df4) DescriptorSet 0
+                              Decorate 229(g_tTex3di4) DescriptorSet 0
+                              Decorate 232(g_tTex3du4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -706,30 +738,34 @@
              199:    6(float) Constant 1065353216
              200:    7(fvec4) ConstantComposite 199 199 199 199
              202:             TypePointer Function 6(float)
-  206(g_sSamp2d):     15(ptr) Variable UniformConstant
-             207:             TypeImage 6(float) 1D sampled format:Unknown
-             208:             TypePointer UniformConstant 207
-209(g_tTex1df4a):    208(ptr) Variable UniformConstant
- 210(g_tTex1df4):    208(ptr) Variable UniformConstant
-             211:             TypeImage 24(int) 1D sampled format:Unknown
-             212:             TypePointer UniformConstant 211
- 213(g_tTex1di4):    212(ptr) Variable UniformConstant
-             214:             TypeImage 39(int) 1D sampled format:Unknown
+             204:             TypePointer Output 7(fvec4)
+      205(Color):    204(ptr) Variable Output
+             208:             TypePointer Output 6(float)
+      209(Depth):    208(ptr) Variable Output
+  213(g_sSamp2d):     15(ptr) Variable UniformConstant
+             214:             TypeImage 6(float) 1D sampled format:Unknown
              215:             TypePointer UniformConstant 214
- 216(g_tTex1du4):    215(ptr) Variable UniformConstant
-             217:             TypeImage 6(float) 3D sampled format:Unknown
-             218:             TypePointer UniformConstant 217
- 219(g_tTex3df4):    218(ptr) Variable UniformConstant
-             220:             TypeImage 24(int) 3D sampled format:Unknown
-             221:             TypePointer UniformConstant 220
- 222(g_tTex3di4):    221(ptr) Variable UniformConstant
-             223:             TypeImage 39(int) 3D sampled format:Unknown
-             224:             TypePointer UniformConstant 223
- 225(g_tTex3du4):    224(ptr) Variable UniformConstant
-             226:             TypePointer UniformConstant 6(float)
-         227(c1):    226(ptr) Variable UniformConstant
-             228:             TypePointer UniformConstant 7(fvec4)
-         229(c4):    228(ptr) Variable UniformConstant
+216(g_tTex1df4a):    215(ptr) Variable UniformConstant
+ 217(g_tTex1df4):    215(ptr) Variable UniformConstant
+             218:             TypeImage 24(int) 1D sampled format:Unknown
+             219:             TypePointer UniformConstant 218
+ 220(g_tTex1di4):    219(ptr) Variable UniformConstant
+             221:             TypeImage 39(int) 1D sampled format:Unknown
+             222:             TypePointer UniformConstant 221
+ 223(g_tTex1du4):    222(ptr) Variable UniformConstant
+             224:             TypeImage 6(float) 3D sampled format:Unknown
+             225:             TypePointer UniformConstant 224
+ 226(g_tTex3df4):    225(ptr) Variable UniformConstant
+             227:             TypeImage 24(int) 3D sampled format:Unknown
+             228:             TypePointer UniformConstant 227
+ 229(g_tTex3di4):    228(ptr) Variable UniformConstant
+             230:             TypeImage 39(int) 3D sampled format:Unknown
+             231:             TypePointer UniformConstant 230
+ 232(g_tTex3du4):    231(ptr) Variable UniformConstant
+             233:             TypePointer UniformConstant 6(float)
+         234(c1):    233(ptr) Variable UniformConstant
+             235:             TypePointer UniformConstant 7(fvec4)
+         236(c4):    235(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
       9(txval00):      8(ptr) Variable Function
@@ -905,6 +941,11 @@
                               Store 201 200
              203:    202(ptr) AccessChain 198(psout) 57
                               Store 203 199
-             204:196(PS_OUTPUT) Load 198(psout)
-                              ReturnValue 204
+             206:      8(ptr) AccessChain 198(psout) 25
+             207:    7(fvec4) Load 206
+                              Store 205(Color) 207
+             210:    202(ptr) AccessChain 198(psout) 57
+             211:    6(float) Load 210
+                              Store 209(Depth) 211
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
index ea0d94a..a869ba7 100644
--- a/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:117  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:39  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:39    Function Parameters: 
 0:?     Sequence
 0:46      Sequence
@@ -319,7 +319,7 @@
 0:100              3 (const int)
 0:112      move second child to first child (temp 4-component vector of float)
 0:112        Color: direct index for structure (temp 4-component vector of float)
-0:112          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:112          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:112          Constant:
 0:112            0 (const int)
 0:112        Constant:
@@ -328,14 +328,27 @@
 0:112          1.000000
 0:112          1.000000
 0:113      move second child to first child (temp float)
-0:113        Depth: direct index for structure (temp float FragDepth)
-0:113          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:113        Depth: direct index for structure (temp float)
+0:113          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:113          Constant:
 0:113            1 (const int)
 0:113        Constant:
 0:113          1.000000
-0:115      Branch: Return with expression
-0:115        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:115          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:115            Color: direct index for structure (temp 4-component vector of float)
+0:115              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115              Constant:
+0:115                0 (const int)
+0:115          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:115            Depth: direct index for structure (temp float)
+0:115              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115              Constant:
+0:115                1 (const int)
+0:115        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -360,6 +373,8 @@
 0:?     'o2' (uniform 2-component vector of int)
 0:?     'o3' (uniform 3-component vector of int)
 0:?     'o4' (uniform 4-component vector of int)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -368,7 +383,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:117  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:39  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:39    Function Parameters: 
 0:?     Sequence
 0:46      Sequence
@@ -685,7 +700,7 @@
 0:100              3 (const int)
 0:112      move second child to first child (temp 4-component vector of float)
 0:112        Color: direct index for structure (temp 4-component vector of float)
-0:112          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:112          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:112          Constant:
 0:112            0 (const int)
 0:112        Constant:
@@ -694,14 +709,27 @@
 0:112          1.000000
 0:112          1.000000
 0:113      move second child to first child (temp float)
-0:113        Depth: direct index for structure (temp float FragDepth)
-0:113          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:113        Depth: direct index for structure (temp float)
+0:113          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:113          Constant:
 0:113            1 (const int)
 0:113        Constant:
 0:113          1.000000
-0:115      Branch: Return with expression
-0:115        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:115          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:115            Color: direct index for structure (temp 4-component vector of float)
+0:115              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115              Constant:
+0:115                0 (const int)
+0:115          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:115            Depth: direct index for structure (temp float)
+0:115              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115              Constant:
+0:115                1 (const int)
+0:115        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -726,19 +754,20 @@
 0:?     'o2' (uniform 2-component vector of int)
 0:?     'o3' (uniform 3-component vector of int)
 0:?     'o4' (uniform 4-component vector of int)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 311
+// Id's are bound by 318
 
                               Capability Shader
                               Capability ImageGatherExtended
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 267 271
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval001"
                               Name 12  "g_tTex2df4"
@@ -774,42 +803,45 @@
                               MemberName 258(PS_OUTPUT) 0  "Color"
                               MemberName 258(PS_OUTPUT) 1  "Depth"
                               Name 260  "psout"
-                              Name 268  "g_sSamp2d"
-                              Name 271  "g_tTex1df4a"
-                              Name 272  "g_tTex1df4"
-                              Name 275  "g_tTex1di4"
-                              Name 278  "g_tTex1du4"
-                              Name 281  "g_tTex3df4"
-                              Name 284  "g_tTex3di4"
-                              Name 287  "g_tTex3du4"
-                              Name 290  "g_tTexcdf4"
-                              Name 293  "g_tTexcdi4"
-                              Name 296  "g_tTexcdu4"
-                              Name 298  "c1"
-                              Name 301  "c3"
-                              Name 303  "c4"
-                              Name 305  "o1"
-                              Name 308  "o3"
-                              Name 310  "o4"
+                              Name 267  "Color"
+                              Name 271  "Depth"
+                              Name 275  "g_sSamp2d"
+                              Name 278  "g_tTex1df4a"
+                              Name 279  "g_tTex1df4"
+                              Name 282  "g_tTex1di4"
+                              Name 285  "g_tTex1du4"
+                              Name 288  "g_tTex3df4"
+                              Name 291  "g_tTex3di4"
+                              Name 294  "g_tTex3du4"
+                              Name 297  "g_tTexcdf4"
+                              Name 300  "g_tTexcdi4"
+                              Name 303  "g_tTexcdu4"
+                              Name 305  "c1"
+                              Name 308  "c3"
+                              Name 310  "c4"
+                              Name 312  "o1"
+                              Name 315  "o3"
+                              Name 317  "o4"
                               Decorate 12(g_tTex2df4) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
                               Decorate 36(g_tTex2di4) DescriptorSet 0
                               Decorate 50(g_tTex2du4) DescriptorSet 0
-                              MemberDecorate 258(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 268(g_sSamp2d) DescriptorSet 0
-                              Decorate 271(g_tTex1df4a) DescriptorSet 0
-                              Decorate 271(g_tTex1df4a) Binding 1
-                              Decorate 272(g_tTex1df4) DescriptorSet 0
-                              Decorate 272(g_tTex1df4) Binding 0
-                              Decorate 275(g_tTex1di4) DescriptorSet 0
-                              Decorate 278(g_tTex1du4) DescriptorSet 0
-                              Decorate 281(g_tTex3df4) DescriptorSet 0
-                              Decorate 284(g_tTex3di4) DescriptorSet 0
-                              Decorate 287(g_tTex3du4) DescriptorSet 0
-                              Decorate 290(g_tTexcdf4) DescriptorSet 0
-                              Decorate 293(g_tTexcdi4) DescriptorSet 0
-                              Decorate 296(g_tTexcdu4) DescriptorSet 0
+                              Decorate 267(Color) Location 0
+                              Decorate 271(Depth) BuiltIn FragDepth
+                              Decorate 275(g_sSamp2d) DescriptorSet 0
+                              Decorate 278(g_tTex1df4a) DescriptorSet 0
+                              Decorate 278(g_tTex1df4a) Binding 1
+                              Decorate 279(g_tTex1df4) DescriptorSet 0
+                              Decorate 279(g_tTex1df4) Binding 0
+                              Decorate 282(g_tTex1di4) DescriptorSet 0
+                              Decorate 285(g_tTex1du4) DescriptorSet 0
+                              Decorate 288(g_tTex3df4) DescriptorSet 0
+                              Decorate 291(g_tTex3di4) DescriptorSet 0
+                              Decorate 294(g_tTex3du4) DescriptorSet 0
+                              Decorate 297(g_tTexcdf4) DescriptorSet 0
+                              Decorate 300(g_tTexcdi4) DescriptorSet 0
+                              Decorate 303(g_tTexcdu4) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -853,49 +885,53 @@
              261:    6(float) Constant 1065353216
              262:    7(fvec4) ConstantComposite 261 261 261 261
              264:             TypePointer Function 6(float)
-  268(g_sSamp2d):     15(ptr) Variable UniformConstant
-             269:             TypeImage 6(float) 1D sampled format:Unknown
-             270:             TypePointer UniformConstant 269
-271(g_tTex1df4a):    270(ptr) Variable UniformConstant
- 272(g_tTex1df4):    270(ptr) Variable UniformConstant
-             273:             TypeImage 24(int) 1D sampled format:Unknown
-             274:             TypePointer UniformConstant 273
- 275(g_tTex1di4):    274(ptr) Variable UniformConstant
-             276:             TypeImage 44(int) 1D sampled format:Unknown
+             266:             TypePointer Output 7(fvec4)
+      267(Color):    266(ptr) Variable Output
+             270:             TypePointer Output 6(float)
+      271(Depth):    270(ptr) Variable Output
+  275(g_sSamp2d):     15(ptr) Variable UniformConstant
+             276:             TypeImage 6(float) 1D sampled format:Unknown
              277:             TypePointer UniformConstant 276
- 278(g_tTex1du4):    277(ptr) Variable UniformConstant
-             279:             TypeImage 6(float) 3D sampled format:Unknown
-             280:             TypePointer UniformConstant 279
- 281(g_tTex3df4):    280(ptr) Variable UniformConstant
-             282:             TypeImage 24(int) 3D sampled format:Unknown
-             283:             TypePointer UniformConstant 282
- 284(g_tTex3di4):    283(ptr) Variable UniformConstant
-             285:             TypeImage 44(int) 3D sampled format:Unknown
-             286:             TypePointer UniformConstant 285
- 287(g_tTex3du4):    286(ptr) Variable UniformConstant
-             288:             TypeImage 6(float) Cube sampled format:Unknown
-             289:             TypePointer UniformConstant 288
- 290(g_tTexcdf4):    289(ptr) Variable UniformConstant
-             291:             TypeImage 24(int) Cube sampled format:Unknown
-             292:             TypePointer UniformConstant 291
- 293(g_tTexcdi4):    292(ptr) Variable UniformConstant
-             294:             TypeImage 44(int) Cube sampled format:Unknown
-             295:             TypePointer UniformConstant 294
- 296(g_tTexcdu4):    295(ptr) Variable UniformConstant
-             297:             TypePointer UniformConstant 6(float)
-         298(c1):    297(ptr) Variable UniformConstant
-             299:             TypeVector 6(float) 3
-             300:             TypePointer UniformConstant 299(fvec3)
-         301(c3):    300(ptr) Variable UniformConstant
-             302:             TypePointer UniformConstant 7(fvec4)
-         303(c4):    302(ptr) Variable UniformConstant
-             304:             TypePointer UniformConstant 24(int)
-         305(o1):    304(ptr) Variable UniformConstant
-             306:             TypeVector 24(int) 3
-             307:             TypePointer UniformConstant 306(ivec3)
-         308(o3):    307(ptr) Variable UniformConstant
-             309:             TypePointer UniformConstant 31(ivec4)
-         310(o4):    309(ptr) Variable UniformConstant
+278(g_tTex1df4a):    277(ptr) Variable UniformConstant
+ 279(g_tTex1df4):    277(ptr) Variable UniformConstant
+             280:             TypeImage 24(int) 1D sampled format:Unknown
+             281:             TypePointer UniformConstant 280
+ 282(g_tTex1di4):    281(ptr) Variable UniformConstant
+             283:             TypeImage 44(int) 1D sampled format:Unknown
+             284:             TypePointer UniformConstant 283
+ 285(g_tTex1du4):    284(ptr) Variable UniformConstant
+             286:             TypeImage 6(float) 3D sampled format:Unknown
+             287:             TypePointer UniformConstant 286
+ 288(g_tTex3df4):    287(ptr) Variable UniformConstant
+             289:             TypeImage 24(int) 3D sampled format:Unknown
+             290:             TypePointer UniformConstant 289
+ 291(g_tTex3di4):    290(ptr) Variable UniformConstant
+             292:             TypeImage 44(int) 3D sampled format:Unknown
+             293:             TypePointer UniformConstant 292
+ 294(g_tTex3du4):    293(ptr) Variable UniformConstant
+             295:             TypeImage 6(float) Cube sampled format:Unknown
+             296:             TypePointer UniformConstant 295
+ 297(g_tTexcdf4):    296(ptr) Variable UniformConstant
+             298:             TypeImage 24(int) Cube sampled format:Unknown
+             299:             TypePointer UniformConstant 298
+ 300(g_tTexcdi4):    299(ptr) Variable UniformConstant
+             301:             TypeImage 44(int) Cube sampled format:Unknown
+             302:             TypePointer UniformConstant 301
+ 303(g_tTexcdu4):    302(ptr) Variable UniformConstant
+             304:             TypePointer UniformConstant 6(float)
+         305(c1):    304(ptr) Variable UniformConstant
+             306:             TypeVector 6(float) 3
+             307:             TypePointer UniformConstant 306(fvec3)
+         308(c3):    307(ptr) Variable UniformConstant
+             309:             TypePointer UniformConstant 7(fvec4)
+         310(c4):    309(ptr) Variable UniformConstant
+             311:             TypePointer UniformConstant 24(int)
+         312(o1):    311(ptr) Variable UniformConstant
+             313:             TypeVector 24(int) 3
+             314:             TypePointer UniformConstant 313(ivec3)
+         315(o3):    314(ptr) Variable UniformConstant
+             316:             TypePointer UniformConstant 31(ivec4)
+         317(o4):    316(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
      9(txval001):      8(ptr) Variable Function
@@ -1143,6 +1179,11 @@
                               Store 263 262
              265:    264(ptr) AccessChain 260(psout) 99
                               Store 265 261
-             266:258(PS_OUTPUT) Load 260(psout)
-                              ReturnValue 266
+             268:      8(ptr) AccessChain 260(psout) 29
+             269:    7(fvec4) Load 268
+                              Store 267(Color) 269
+             272:    264(ptr) AccessChain 260(psout) 99
+             273:    6(float) Load 272
+                              Store 271(Depth) 273
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out b/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
index f9c28d0..022f63e 100644
--- a/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
+++ b/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:111  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:33  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:33    Function Parameters: 
 0:?     Sequence
 0:40      Sequence
@@ -319,7 +319,7 @@
 0:94              3 (const int)
 0:106      move second child to first child (temp 4-component vector of float)
 0:106        Color: direct index for structure (temp 4-component vector of float)
-0:106          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:106          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:106          Constant:
 0:106            0 (const int)
 0:106        Constant:
@@ -328,14 +328,27 @@
 0:106          1.000000
 0:106          1.000000
 0:107      move second child to first child (temp float)
-0:107        Depth: direct index for structure (temp float FragDepth)
-0:107          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:107        Depth: direct index for structure (temp float)
+0:107          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:107          Constant:
 0:107            1 (const int)
 0:107        Constant:
 0:107          1.000000
-0:109      Branch: Return with expression
-0:109        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:109          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:109            Color: direct index for structure (temp 4-component vector of float)
+0:109              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:109              Constant:
+0:109                0 (const int)
+0:109          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:109            Depth: direct index for structure (temp float)
+0:109              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:109              Constant:
+0:109                1 (const int)
+0:109        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -356,6 +369,8 @@
 0:?     'o2' (uniform 2-component vector of int)
 0:?     'o3' (uniform 3-component vector of int)
 0:?     'o4' (uniform 4-component vector of int)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -364,7 +379,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:111  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:33  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:33    Function Parameters: 
 0:?     Sequence
 0:40      Sequence
@@ -681,7 +696,7 @@
 0:94              3 (const int)
 0:106      move second child to first child (temp 4-component vector of float)
 0:106        Color: direct index for structure (temp 4-component vector of float)
-0:106          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:106          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:106          Constant:
 0:106            0 (const int)
 0:106        Constant:
@@ -690,14 +705,27 @@
 0:106          1.000000
 0:106          1.000000
 0:107      move second child to first child (temp float)
-0:107        Depth: direct index for structure (temp float FragDepth)
-0:107          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:107        Depth: direct index for structure (temp float)
+0:107          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:107          Constant:
 0:107            1 (const int)
 0:107        Constant:
 0:107          1.000000
-0:109      Branch: Return with expression
-0:109        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:109          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:109            Color: direct index for structure (temp 4-component vector of float)
+0:109              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:109              Constant:
+0:109                0 (const int)
+0:109          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:109            Depth: direct index for structure (temp float)
+0:109              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:109              Constant:
+0:109                1 (const int)
+0:109        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_sSamp2d' (uniform sampler)
@@ -718,10 +746,12 @@
 0:?     'o2' (uniform 2-component vector of int)
 0:?     'o3' (uniform 3-component vector of int)
 0:?     'o4' (uniform 4-component vector of int)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 301
+// Id's are bound by 308
 
                               Capability Shader
                               Capability ImageGatherExtended
@@ -729,9 +759,8 @@
                               Capability SampledCubeArray
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 267 271
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 9  "txval001"
                               Name 12  "g_tTex2df4a"
@@ -767,33 +796,36 @@
                               MemberName 258(PS_OUTPUT) 0  "Color"
                               MemberName 258(PS_OUTPUT) 1  "Depth"
                               Name 260  "psout"
-                              Name 268  "g_sSamp2d"
-                              Name 271  "g_tTex1df4a"
-                              Name 274  "g_tTex1di4a"
-                              Name 277  "g_tTex1du4a"
-                              Name 280  "g_tTexcdf4a"
-                              Name 283  "g_tTexcdi4a"
-                              Name 286  "g_tTexcdu4a"
-                              Name 288  "c1"
-                              Name 291  "c2"
-                              Name 293  "c4"
-                              Name 295  "o1"
-                              Name 298  "o3"
-                              Name 300  "o4"
+                              Name 267  "Color"
+                              Name 271  "Depth"
+                              Name 275  "g_sSamp2d"
+                              Name 278  "g_tTex1df4a"
+                              Name 281  "g_tTex1di4a"
+                              Name 284  "g_tTex1du4a"
+                              Name 287  "g_tTexcdf4a"
+                              Name 290  "g_tTexcdi4a"
+                              Name 293  "g_tTexcdu4a"
+                              Name 295  "c1"
+                              Name 298  "c2"
+                              Name 300  "c4"
+                              Name 302  "o1"
+                              Name 305  "o3"
+                              Name 307  "o4"
                               Decorate 12(g_tTex2df4a) DescriptorSet 0
                               Decorate 16(g_sSamp) DescriptorSet 0
                               Decorate 16(g_sSamp) Binding 0
                               Decorate 36(g_tTex2di4a) DescriptorSet 0
                               Decorate 50(g_tTex2du4a) DescriptorSet 0
-                              MemberDecorate 258(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 268(g_sSamp2d) DescriptorSet 0
-                              Decorate 271(g_tTex1df4a) DescriptorSet 0
-                              Decorate 271(g_tTex1df4a) Binding 0
-                              Decorate 274(g_tTex1di4a) DescriptorSet 0
-                              Decorate 277(g_tTex1du4a) DescriptorSet 0
-                              Decorate 280(g_tTexcdf4a) DescriptorSet 0
-                              Decorate 283(g_tTexcdi4a) DescriptorSet 0
-                              Decorate 286(g_tTexcdu4a) DescriptorSet 0
+                              Decorate 267(Color) Location 0
+                              Decorate 271(Depth) BuiltIn FragDepth
+                              Decorate 275(g_sSamp2d) DescriptorSet 0
+                              Decorate 278(g_tTex1df4a) DescriptorSet 0
+                              Decorate 278(g_tTex1df4a) Binding 0
+                              Decorate 281(g_tTex1di4a) DescriptorSet 0
+                              Decorate 284(g_tTex1du4a) DescriptorSet 0
+                              Decorate 287(g_tTexcdf4a) DescriptorSet 0
+                              Decorate 290(g_tTexcdi4a) DescriptorSet 0
+                              Decorate 293(g_tTexcdu4a) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -837,39 +869,43 @@
              261:    6(float) Constant 1065353216
              262:    7(fvec4) ConstantComposite 261 261 261 261
              264:             TypePointer Function 6(float)
-  268(g_sSamp2d):     15(ptr) Variable UniformConstant
-             269:             TypeImage 6(float) 1D array sampled format:Unknown
-             270:             TypePointer UniformConstant 269
-271(g_tTex1df4a):    270(ptr) Variable UniformConstant
-             272:             TypeImage 24(int) 1D array sampled format:Unknown
-             273:             TypePointer UniformConstant 272
-274(g_tTex1di4a):    273(ptr) Variable UniformConstant
-             275:             TypeImage 44(int) 1D array sampled format:Unknown
-             276:             TypePointer UniformConstant 275
-277(g_tTex1du4a):    276(ptr) Variable UniformConstant
-             278:             TypeImage 6(float) Cube array sampled format:Unknown
-             279:             TypePointer UniformConstant 278
-280(g_tTexcdf4a):    279(ptr) Variable UniformConstant
-             281:             TypeImage 24(int) Cube array sampled format:Unknown
-             282:             TypePointer UniformConstant 281
-283(g_tTexcdi4a):    282(ptr) Variable UniformConstant
-             284:             TypeImage 44(int) Cube array sampled format:Unknown
-             285:             TypePointer UniformConstant 284
-286(g_tTexcdu4a):    285(ptr) Variable UniformConstant
-             287:             TypePointer UniformConstant 6(float)
-         288(c1):    287(ptr) Variable UniformConstant
-             289:             TypeVector 6(float) 2
-             290:             TypePointer UniformConstant 289(fvec2)
-         291(c2):    290(ptr) Variable UniformConstant
-             292:             TypePointer UniformConstant 7(fvec4)
-         293(c4):    292(ptr) Variable UniformConstant
-             294:             TypePointer UniformConstant 24(int)
-         295(o1):    294(ptr) Variable UniformConstant
-             296:             TypeVector 24(int) 3
-             297:             TypePointer UniformConstant 296(ivec3)
-         298(o3):    297(ptr) Variable UniformConstant
-             299:             TypePointer UniformConstant 31(ivec4)
-         300(o4):    299(ptr) Variable UniformConstant
+             266:             TypePointer Output 7(fvec4)
+      267(Color):    266(ptr) Variable Output
+             270:             TypePointer Output 6(float)
+      271(Depth):    270(ptr) Variable Output
+  275(g_sSamp2d):     15(ptr) Variable UniformConstant
+             276:             TypeImage 6(float) 1D array sampled format:Unknown
+             277:             TypePointer UniformConstant 276
+278(g_tTex1df4a):    277(ptr) Variable UniformConstant
+             279:             TypeImage 24(int) 1D array sampled format:Unknown
+             280:             TypePointer UniformConstant 279
+281(g_tTex1di4a):    280(ptr) Variable UniformConstant
+             282:             TypeImage 44(int) 1D array sampled format:Unknown
+             283:             TypePointer UniformConstant 282
+284(g_tTex1du4a):    283(ptr) Variable UniformConstant
+             285:             TypeImage 6(float) Cube array sampled format:Unknown
+             286:             TypePointer UniformConstant 285
+287(g_tTexcdf4a):    286(ptr) Variable UniformConstant
+             288:             TypeImage 24(int) Cube array sampled format:Unknown
+             289:             TypePointer UniformConstant 288
+290(g_tTexcdi4a):    289(ptr) Variable UniformConstant
+             291:             TypeImage 44(int) Cube array sampled format:Unknown
+             292:             TypePointer UniformConstant 291
+293(g_tTexcdu4a):    292(ptr) Variable UniformConstant
+             294:             TypePointer UniformConstant 6(float)
+         295(c1):    294(ptr) Variable UniformConstant
+             296:             TypeVector 6(float) 2
+             297:             TypePointer UniformConstant 296(fvec2)
+         298(c2):    297(ptr) Variable UniformConstant
+             299:             TypePointer UniformConstant 7(fvec4)
+         300(c4):    299(ptr) Variable UniformConstant
+             301:             TypePointer UniformConstant 24(int)
+         302(o1):    301(ptr) Variable UniformConstant
+             303:             TypeVector 24(int) 3
+             304:             TypePointer UniformConstant 303(ivec3)
+         305(o3):    304(ptr) Variable UniformConstant
+             306:             TypePointer UniformConstant 31(ivec4)
+         307(o4):    306(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
      9(txval001):      8(ptr) Variable Function
@@ -1117,6 +1153,11 @@
                               Store 263 262
              265:    264(ptr) AccessChain 260(psout) 99
                               Store 265 261
-             266:258(PS_OUTPUT) Load 260(psout)
-                              ReturnValue 266
+             268:      8(ptr) AccessChain 260(psout) 29
+             269:    7(fvec4) Load 268
+                              Store 267(Color) 269
+             272:    264(ptr) AccessChain 260(psout) 99
+             273:    6(float) Load 272
+                              Store 271(Depth) 273
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.getdimensions.dx10.frag.out b/Test/baseResults/hlsl.getdimensions.dx10.frag.out
index dd47567..18b35e4 100644
--- a/Test/baseResults/hlsl.getdimensions.dx10.frag.out
+++ b/Test/baseResults/hlsl.getdimensions.dx10.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:281  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:46  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:46    Function Parameters: 
 0:?     Sequence
 0:65      Sequence
@@ -1045,7 +1045,7 @@
 0:164            'g_tTex2dmsu4a' (uniform utexture2DMSArray)
 0:276      move second child to first child (temp 4-component vector of float)
 0:276        Color: direct index for structure (temp 4-component vector of float)
-0:276          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:276          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:276          Constant:
 0:276            0 (const int)
 0:276        Constant:
@@ -1054,14 +1054,27 @@
 0:276          1.000000
 0:276          1.000000
 0:277      move second child to first child (temp float)
-0:277        Depth: direct index for structure (temp float FragDepth)
-0:277          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:277        Depth: direct index for structure (temp float)
+0:277          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:277          Constant:
 0:277            1 (const int)
 0:277        Constant:
 0:277          1.000000
-0:279      Branch: Return with expression
-0:279        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:279          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:279            Color: direct index for structure (temp 4-component vector of float)
+0:279              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:279              Constant:
+0:279                0 (const int)
+0:279          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:279            Depth: direct index for structure (temp float)
+0:279              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:279              Constant:
+0:279                1 (const int)
+0:279        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -1091,6 +1104,8 @@
 0:?     'g_tTex2dmsf4a' (uniform texture2DMSArray)
 0:?     'g_tTex2dmsi4a' (uniform itexture2DMSArray)
 0:?     'g_tTex2dmsu4a' (uniform utexture2DMSArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -1099,7 +1114,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:281  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:46  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:46    Function Parameters: 
 0:?     Sequence
 0:65      Sequence
@@ -2142,7 +2157,7 @@
 0:164            'g_tTex2dmsu4a' (uniform utexture2DMSArray)
 0:276      move second child to first child (temp 4-component vector of float)
 0:276        Color: direct index for structure (temp 4-component vector of float)
-0:276          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:276          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:276          Constant:
 0:276            0 (const int)
 0:276        Constant:
@@ -2151,14 +2166,27 @@
 0:276          1.000000
 0:276          1.000000
 0:277      move second child to first child (temp float)
-0:277        Depth: direct index for structure (temp float FragDepth)
-0:277          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:277        Depth: direct index for structure (temp float)
+0:277          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:277          Constant:
 0:277            1 (const int)
 0:277        Constant:
 0:277          1.000000
-0:279      Branch: Return with expression
-0:279        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:279          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:279            Color: direct index for structure (temp 4-component vector of float)
+0:279              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:279              Constant:
+0:279                0 (const int)
+0:279          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:279            Depth: direct index for structure (temp float)
+0:279              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:279              Constant:
+0:279                1 (const int)
+0:279        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -2188,10 +2216,12 @@
 0:?     'g_tTex2dmsf4a' (uniform texture2DMSArray)
 0:?     'g_tTex2dmsi4a' (uniform itexture2DMSArray)
 0:?     'g_tTex2dmsu4a' (uniform utexture2DMSArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 538
+// Id's are bound by 545
 
                               Capability Shader
                               Capability Sampled1D
@@ -2200,9 +2230,8 @@
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 534 538
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 8  "sizeQueryTemp"
                               Name 12  "g_tTex1df4"
@@ -2289,7 +2318,9 @@
                               MemberName 522(PS_OUTPUT) 0  "Color"
                               MemberName 522(PS_OUTPUT) 1  "Depth"
                               Name 524  "psout"
-                              Name 537  "g_sSamp"
+                              Name 534  "Color"
+                              Name 538  "Depth"
+                              Name 544  "g_sSamp"
                               Decorate 12(g_tTex1df4) DescriptorSet 0
                               Decorate 12(g_tTex1df4) Binding 0
                               Decorate 29(g_tTex1di4) DescriptorSet 0
@@ -2318,9 +2349,10 @@
                               Decorate 482(g_tTex2dmsf4a) DescriptorSet 0
                               Decorate 496(g_tTex2dmsi4a) DescriptorSet 0
                               Decorate 510(g_tTex2dmsu4a) DescriptorSet 0
-                              MemberDecorate 522(PS_OUTPUT) 1 BuiltIn FragDepth
-                              Decorate 537(g_sSamp) DescriptorSet 0
-                              Decorate 537(g_sSamp) Binding 0
+                              Decorate 534(Color) Location 0
+                              Decorate 538(Depth) BuiltIn FragDepth
+                              Decorate 544(g_sSamp) DescriptorSet 0
+                              Decorate 544(g_sSamp) Binding 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -2427,9 +2459,13 @@
              528:             TypePointer Function 521(fvec4)
              530:     14(int) Constant 1
              531:             TypePointer Function 9(float)
-             535:             TypeSampler
-             536:             TypePointer UniformConstant 535
-    537(g_sSamp):    536(ptr) Variable UniformConstant
+             533:             TypePointer Output 521(fvec4)
+      534(Color):    533(ptr) Variable Output
+             537:             TypePointer Output 9(float)
+      538(Depth):    537(ptr) Variable Output
+             542:             TypeSampler
+             543:             TypePointer UniformConstant 542
+    544(g_sSamp):    543(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
 8(sizeQueryTemp):      7(ptr) Variable Function
@@ -3043,6 +3079,11 @@
                               Store 529 527
              532:    531(ptr) AccessChain 524(psout) 530
                               Store 532 526
-             533:522(PS_OUTPUT) Load 524(psout)
-                              ReturnValue 533
+             535:    528(ptr) AccessChain 524(psout) 525
+             536:  521(fvec4) Load 535
+                              Store 534(Color) 536
+             539:    531(ptr) AccessChain 524(psout) 530
+             540:    9(float) Load 539
+                              Store 538(Depth) 540
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.getdimensions.dx10.vert.out b/Test/baseResults/hlsl.getdimensions.dx10.vert.out
index 9170402..3c063c1 100644
--- a/Test/baseResults/hlsl.getdimensions.dx10.vert.out
+++ b/Test/baseResults/hlsl.getdimensions.dx10.vert.out
@@ -1,7 +1,7 @@
 hlsl.getdimensions.dx10.vert
 Shader version: 450
 0:? Sequence
-0:28  Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
+0:11  Function Definition: main( (global structure{temp 4-component vector of float Pos})
 0:11    Function Parameters: 
 0:?     Sequence
 0:21      Sequence
@@ -27,8 +27,8 @@
 0:22          textureQueryLevels (temp uint)
 0:22            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
 0:24      move second child to first child (temp 4-component vector of float)
-0:24        Pos: direct index for structure (temp 4-component vector of float FragCoord)
-0:24          'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:24        Pos: direct index for structure (temp 4-component vector of float)
+0:24          'vsout' (temp structure{temp 4-component vector of float Pos})
 0:24          Constant:
 0:24            0 (const int)
 0:?         Constant:
@@ -36,11 +36,19 @@
 0:?           0.000000
 0:?           0.000000
 0:?           0.000000
-0:26      Branch: Return with expression
-0:26        'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:?       Sequence
+0:?         Sequence
+0:26          move second child to first child (temp 4-component vector of float)
+0:?             'Pos' (out 4-component vector of float Position)
+0:26            Pos: direct index for structure (temp 4-component vector of float)
+0:26              'vsout' (temp structure{temp 4-component vector of float Pos})
+0:26              Constant:
+0:26                0 (const int)
+0:26        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     'Pos' (out 4-component vector of float Position)
 
 
 Linked vertex stage:
@@ -48,7 +56,7 @@
 
 Shader version: 450
 0:? Sequence
-0:28  Function Definition: main( (global structure{temp 4-component vector of float FragCoord Pos})
+0:11  Function Definition: main( (global structure{temp 4-component vector of float Pos})
 0:11    Function Parameters: 
 0:?     Sequence
 0:21      Sequence
@@ -74,8 +82,8 @@
 0:22          textureQueryLevels (temp uint)
 0:22            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
 0:24      move second child to first child (temp 4-component vector of float)
-0:24        Pos: direct index for structure (temp 4-component vector of float FragCoord)
-0:24          'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:24        Pos: direct index for structure (temp 4-component vector of float)
+0:24          'vsout' (temp structure{temp 4-component vector of float Pos})
 0:24          Constant:
 0:24            0 (const int)
 0:?         Constant:
@@ -83,23 +91,30 @@
 0:?           0.000000
 0:?           0.000000
 0:?           0.000000
-0:26      Branch: Return with expression
-0:26        'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
+0:?       Sequence
+0:?         Sequence
+0:26          move second child to first child (temp 4-component vector of float)
+0:?             'Pos' (out 4-component vector of float Position)
+0:26            Pos: direct index for structure (temp 4-component vector of float)
+0:26              'vsout' (temp structure{temp 4-component vector of float Pos})
+0:26              Constant:
+0:26                0 (const int)
+0:26        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     'Pos' (out 4-component vector of float Position)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 40
+// Id's are bound by 43
 
                               Capability Shader
                               Capability Sampled1D
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main"
-                              Source HLSL 450
+                              EntryPoint Vertex 4  "main" 36
                               Name 4  "main"
                               Name 8  "sizeQueryTemp"
                               Name 12  "g_tTex1df4"
@@ -109,12 +124,13 @@
                               Name 27  "VS_OUTPUT"
                               MemberName 27(VS_OUTPUT) 0  "Pos"
                               Name 29  "vsout"
-                              Name 39  "g_sSamp"
+                              Name 36  "Pos"
+                              Name 42  "g_sSamp"
                               Decorate 12(g_tTex1df4) DescriptorSet 0
                               Decorate 12(g_tTex1df4) Binding 0
-                              MemberDecorate 27(VS_OUTPUT) 0 BuiltIn FragCoord
-                              Decorate 39(g_sSamp) DescriptorSet 0
-                              Decorate 39(g_sSamp) Binding 0
+                              Decorate 36(Pos) BuiltIn Position
+                              Decorate 42(g_sSamp) DescriptorSet 0
+                              Decorate 42(g_sSamp) Binding 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -132,9 +148,11 @@
               31:    9(float) Constant 0
               32:   26(fvec4) ConstantComposite 31 31 31 31
               33:             TypePointer Function 26(fvec4)
-              37:             TypeSampler
-              38:             TypePointer UniformConstant 37
-     39(g_sSamp):     38(ptr) Variable UniformConstant
+              35:             TypePointer Output 26(fvec4)
+         36(Pos):     35(ptr) Variable Output
+              40:             TypeSampler
+              41:             TypePointer UniformConstant 40
+     42(g_sSamp):     41(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
 8(sizeQueryTemp):      7(ptr) Variable Function
@@ -157,6 +175,8 @@
                               Store 23(NumberOfLevelsU) 25
               34:     33(ptr) AccessChain 29(vsout) 30
                               Store 34 32
-              35:27(VS_OUTPUT) Load 29(vsout)
-                              ReturnValue 35
+              37:     33(ptr) AccessChain 29(vsout) 30
+              38:   26(fvec4) Load 37
+                              Store 36(Pos) 38
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
index e2cf6fe..a44e944 100644
--- a/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
+++ b/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
@@ -7,7 +7,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:13  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:13    Function Parameters: 
 0:?     Sequence
 0:16      Sequence
@@ -28,7 +28,7 @@
 0:17              2 (const int)
 0:19      move second child to first child (temp 4-component vector of float)
 0:19        Color: direct index for structure (temp 4-component vector of float)
-0:19          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:19          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:19          Constant:
 0:19            0 (const int)
 0:19        Constant:
@@ -37,18 +37,33 @@
 0:19          1.000000
 0:19          1.000000
 0:20      move second child to first child (temp float)
-0:20        Depth: direct index for structure (temp float FragDepth)
-0:20          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:20        Depth: direct index for structure (temp float)
+0:20          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:20          Constant:
 0:20            1 (const int)
 0:20        Constant:
 0:20          1.000000
-0:22      Branch: Return with expression
-0:22        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:22          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 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                0 (const int)
+0:22          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:22            Depth: direct index for structure (temp 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        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex2dmsf4' (uniform texture2DMS)
 0:?     'g_tTex2dmsf4a' (uniform texture2DMSArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 
 Linked fragment stage:
@@ -57,7 +72,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:24  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:13  Function Definition: main( (global structure{temp 4-component vector of float Color, temp float Depth})
 0:13    Function Parameters: 
 0:?     Sequence
 0:16      Sequence
@@ -78,7 +93,7 @@
 0:17              2 (const int)
 0:19      move second child to first child (temp 4-component vector of float)
 0:19        Color: direct index for structure (temp 4-component vector of float)
-0:19          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:19          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:19          Constant:
 0:19            0 (const int)
 0:19        Constant:
@@ -87,17 +102,32 @@
 0:19          1.000000
 0:19          1.000000
 0:20      move second child to first child (temp float)
-0:20        Depth: direct index for structure (temp float FragDepth)
-0:20          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:20        Depth: direct index for structure (temp float)
+0:20          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
 0:20          Constant:
 0:20            1 (const int)
 0:20        Constant:
 0:20          1.000000
-0:22      Branch: Return with expression
-0:22        'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:22          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 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                0 (const int)
+0:22          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:22            Depth: direct index for structure (temp 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        Branch: Return
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex2dmsf4' (uniform texture2DMS)
 0:?     'g_tTex2dmsf4a' (uniform texture2DMSArray)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
 
 SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/hlsl.if.frag.out b/Test/baseResults/hlsl.if.frag.out
index 4554ec6..499015a 100755
--- a/Test/baseResults/hlsl.if.frag.out
+++ b/Test/baseResults/hlsl.if.frag.out
@@ -2,71 +2,89 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:34  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Test condition and select (temp void)
 0:3        Condition
 0:3        Compare Equal (temp bool)
-0:3          'input' (in 4-component vector of float)
-0:3          'input' (in 4-component vector of float)
+0:3          'input' (layout(location=0 ) in 4-component vector of float)
+0:3          'input' (layout(location=0 ) in 4-component vector of float)
 0:3        true case
-0:4        Branch: Return with expression
-0:4          'input' (in 4-component vector of float)
+0:4        Sequence
+0:4          move second child to first child (temp 4-component vector of float)
+0:?             '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:4            'input' (layout(location=0 ) in 4-component vector of float)
+0:4          Branch: Return
 0:6      Test condition and select (temp void)
 0:6        Condition
 0:6        Compare Equal (temp bool)
-0:6          'input' (in 4-component vector of float)
-0:6          'input' (in 4-component vector of float)
+0:6          'input' (layout(location=0 ) in 4-component vector of float)
+0:6          'input' (layout(location=0 ) in 4-component vector of float)
 0:6        true case
-0:7        Branch: Return with expression
-0:7          'input' (in 4-component vector of float)
+0:7        Sequence
+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            'input' (layout(location=0 ) in 4-component vector of float)
+0:7          Branch: Return
 0:6        false case
-0:9        Branch: Return with expression
-0:9          Negate value (temp 4-component vector of float)
-0:9            'input' (in 4-component vector of float)
+0:9        Sequence
+0:9          move second child to first child (temp 4-component vector of float)
+0:?             '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:9            Negate value (temp 4-component vector of float)
+0:9              'input' (layout(location=0 ) in 4-component vector of float)
+0:9          Branch: Return
 0:11      Test condition and select (temp void)
 0:11        Condition
 0:11        Compare Equal (temp bool)
-0:11          'input' (in 4-component vector of float)
-0:11          'input' (in 4-component vector of float)
+0:11          'input' (layout(location=0 ) in 4-component vector of float)
+0:11          'input' (layout(location=0 ) in 4-component vector of float)
 0:11        true case is null
 0:14      Test condition and select (temp void)
 0:14        Condition
 0:14        Compare Equal (temp bool)
-0:14          'input' (in 4-component vector of float)
-0:14          'input' (in 4-component vector of float)
+0:14          'input' (layout(location=0 ) in 4-component vector of float)
+0:14          'input' (layout(location=0 ) in 4-component vector of float)
 0:14        true case is null
 0:19      Test condition and select (temp void)
 0:19        Condition
 0:19        Compare Equal (temp bool)
-0:19          'input' (in 4-component vector of float)
-0:19          'input' (in 4-component vector of float)
+0:19          'input' (layout(location=0 ) in 4-component vector of float)
+0:19          'input' (layout(location=0 ) in 4-component vector of float)
 0:19        true case
 0:?         Sequence
-0:20          Branch: Return with expression
-0:20            'input' (in 4-component vector of float)
+0:20          Sequence
+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              'input' (layout(location=0 ) in 4-component vector of float)
+0:20            Branch: Return
 0:23      Test condition and select (temp void)
 0:23        Condition
 0:23        Compare Equal (temp bool)
-0:23          'input' (in 4-component vector of float)
-0:23          'input' (in 4-component vector of float)
+0:23          'input' (layout(location=0 ) in 4-component vector of float)
+0:23          'input' (layout(location=0 ) in 4-component vector of float)
 0:23        true case
 0:?         Sequence
-0:24          Branch: Return with expression
-0:24            'input' (in 4-component vector of float)
+0:24          Sequence
+0:24            move second child to first child (temp 4-component vector of float)
+0:?               '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:24              'input' (layout(location=0 ) in 4-component vector of float)
+0:24            Branch: Return
 0:23        false case
 0:?         Sequence
-0:26          Branch: Return with expression
-0:26            Negate value (temp 4-component vector of float)
-0:26              'input' (in 4-component vector of float)
+0:26          Sequence
+0:26            move second child to first child (temp 4-component vector of float)
+0:?               '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:26              Negate value (temp 4-component vector of float)
+0:26                'input' (layout(location=0 ) in 4-component vector of float)
+0:26            Branch: Return
 0:30      Test condition and select (temp void)
 0:30        Condition
 0:30        move second child to first child (temp float)
 0:30          'ii' (temp float)
 0:30          direct index (temp float)
-0:30            'input' (in 4-component vector of float)
+0:30            'input' (layout(location=0 ) in 4-component vector of float)
 0:30            Constant:
 0:30              2 (const int)
 0:30        true case
@@ -75,6 +93,8 @@
 0:32      Pre-Increment (temp int)
 0:32        'ii' (temp int)
 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)
 
 
 Linked fragment stage:
@@ -83,71 +103,89 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:34  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:2  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' (in 4-component vector of float)
+0:2      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:3      Test condition and select (temp void)
 0:3        Condition
 0:3        Compare Equal (temp bool)
-0:3          'input' (in 4-component vector of float)
-0:3          'input' (in 4-component vector of float)
+0:3          'input' (layout(location=0 ) in 4-component vector of float)
+0:3          'input' (layout(location=0 ) in 4-component vector of float)
 0:3        true case
-0:4        Branch: Return with expression
-0:4          'input' (in 4-component vector of float)
+0:4        Sequence
+0:4          move second child to first child (temp 4-component vector of float)
+0:?             '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:4            'input' (layout(location=0 ) in 4-component vector of float)
+0:4          Branch: Return
 0:6      Test condition and select (temp void)
 0:6        Condition
 0:6        Compare Equal (temp bool)
-0:6          'input' (in 4-component vector of float)
-0:6          'input' (in 4-component vector of float)
+0:6          'input' (layout(location=0 ) in 4-component vector of float)
+0:6          'input' (layout(location=0 ) in 4-component vector of float)
 0:6        true case
-0:7        Branch: Return with expression
-0:7          'input' (in 4-component vector of float)
+0:7        Sequence
+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            'input' (layout(location=0 ) in 4-component vector of float)
+0:7          Branch: Return
 0:6        false case
-0:9        Branch: Return with expression
-0:9          Negate value (temp 4-component vector of float)
-0:9            'input' (in 4-component vector of float)
+0:9        Sequence
+0:9          move second child to first child (temp 4-component vector of float)
+0:?             '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:9            Negate value (temp 4-component vector of float)
+0:9              'input' (layout(location=0 ) in 4-component vector of float)
+0:9          Branch: Return
 0:11      Test condition and select (temp void)
 0:11        Condition
 0:11        Compare Equal (temp bool)
-0:11          'input' (in 4-component vector of float)
-0:11          'input' (in 4-component vector of float)
+0:11          'input' (layout(location=0 ) in 4-component vector of float)
+0:11          'input' (layout(location=0 ) in 4-component vector of float)
 0:11        true case is null
 0:14      Test condition and select (temp void)
 0:14        Condition
 0:14        Compare Equal (temp bool)
-0:14          'input' (in 4-component vector of float)
-0:14          'input' (in 4-component vector of float)
+0:14          'input' (layout(location=0 ) in 4-component vector of float)
+0:14          'input' (layout(location=0 ) in 4-component vector of float)
 0:14        true case is null
 0:19      Test condition and select (temp void)
 0:19        Condition
 0:19        Compare Equal (temp bool)
-0:19          'input' (in 4-component vector of float)
-0:19          'input' (in 4-component vector of float)
+0:19          'input' (layout(location=0 ) in 4-component vector of float)
+0:19          'input' (layout(location=0 ) in 4-component vector of float)
 0:19        true case
 0:?         Sequence
-0:20          Branch: Return with expression
-0:20            'input' (in 4-component vector of float)
+0:20          Sequence
+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              'input' (layout(location=0 ) in 4-component vector of float)
+0:20            Branch: Return
 0:23      Test condition and select (temp void)
 0:23        Condition
 0:23        Compare Equal (temp bool)
-0:23          'input' (in 4-component vector of float)
-0:23          'input' (in 4-component vector of float)
+0:23          'input' (layout(location=0 ) in 4-component vector of float)
+0:23          'input' (layout(location=0 ) in 4-component vector of float)
 0:23        true case
 0:?         Sequence
-0:24          Branch: Return with expression
-0:24            'input' (in 4-component vector of float)
+0:24          Sequence
+0:24            move second child to first child (temp 4-component vector of float)
+0:?               '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:24              'input' (layout(location=0 ) in 4-component vector of float)
+0:24            Branch: Return
 0:23        false case
 0:?         Sequence
-0:26          Branch: Return with expression
-0:26            Negate value (temp 4-component vector of float)
-0:26              'input' (in 4-component vector of float)
+0:26          Sequence
+0:26            move second child to first child (temp 4-component vector of float)
+0:?               '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:26              Negate value (temp 4-component vector of float)
+0:26                'input' (layout(location=0 ) in 4-component vector of float)
+0:26            Branch: Return
 0:30      Test condition and select (temp void)
 0:30        Condition
 0:30        move second child to first child (temp float)
 0:30          'ii' (temp float)
 0:30          direct index (temp float)
-0:30            'input' (in 4-component vector of float)
+0:30            'input' (layout(location=0 ) in 4-component vector of float)
 0:30            Constant:
 0:30              2 (const int)
 0:30        true case
@@ -156,21 +194,25 @@
 0:32      Pre-Increment (temp int)
 0:32        'ii' (temp int)
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 82
+// Id's are bound by 84
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 9
+                              EntryPoint Fragment 4  "PixelShaderFunction" 9 19
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 9  "input"
-                              Name 65  "ii"
-                              Name 78  "ii"
+                              Name 19  "@entryPointOutput"
+                              Name 67  "ii"
+                              Name 80  "ii"
+                              Decorate 9(input) Location 0
+                              Decorate 19(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -179,18 +221,20 @@
         9(input):      8(ptr) Variable Input
               12:             TypeBool
               13:             TypeVector 12(bool) 4
-              64:             TypePointer Function 6(float)
-              66:             TypeInt 32 0
-              67:     66(int) Constant 2
-              68:             TypePointer Input 6(float)
-              74:    6(float) Constant 1065353216
-              76:             TypeInt 32 1
-              77:             TypePointer Function 76(int)
-              80:     76(int) Constant 1
+              18:             TypePointer Output 7(fvec4)
+19(@entryPointOutput):     18(ptr) Variable Output
+              66:             TypePointer Function 6(float)
+              68:             TypeInt 32 0
+              69:     68(int) Constant 2
+              70:             TypePointer Input 6(float)
+              76:    6(float) Constant 1065353216
+              78:             TypeInt 32 1
+              79:             TypePointer Function 78(int)
+              82:     78(int) Constant 1
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-          65(ii):     64(ptr) Variable Function
-          78(ii):     77(ptr) Variable Function
+          67(ii):     66(ptr) Variable Function
+          80(ii):     79(ptr) Variable Function
               10:    7(fvec4) Load 9(input)
               11:    7(fvec4) Load 9(input)
               14:   13(bvec4) FOrdEqual 10 11
@@ -198,78 +242,84 @@
                               SelectionMerge 17 None
                               BranchConditional 15 16 17
               16:               Label
-              18:    7(fvec4)   Load 9(input)
-                                ReturnValue 18
+              20:    7(fvec4)   Load 9(input)
+                                Store 19(@entryPointOutput) 20
+                                Return
               17:             Label
-              20:    7(fvec4) Load 9(input)
-              21:    7(fvec4) Load 9(input)
-              22:   13(bvec4) FOrdEqual 20 21
-              23:    12(bool) All 22
-                              SelectionMerge 25 None
-                              BranchConditional 23 24 28
-              24:               Label
-              26:    7(fvec4)   Load 9(input)
-                                ReturnValue 26
-              28:               Label
-              29:    7(fvec4)   Load 9(input)
-              30:    7(fvec4)   FNegate 29
-                                ReturnValue 30
-              25:             Label
-              32:    7(fvec4) Load 9(input)
-              33:    7(fvec4) Load 9(input)
-              34:   13(bvec4) FOrdEqual 32 33
-              35:    12(bool) All 34
-                              SelectionMerge 37 None
-                              BranchConditional 35 36 37
-              36:               Label
-                                Branch 37
-              37:             Label
-              38:    7(fvec4) Load 9(input)
-              39:    7(fvec4) Load 9(input)
-              40:   13(bvec4) FOrdEqual 38 39
-              41:    12(bool) All 40
-                              SelectionMerge 43 None
-                              BranchConditional 41 42 43
-              42:               Label
-                                Branch 43
-              43:             Label
-              44:    7(fvec4) Load 9(input)
-              45:    7(fvec4) Load 9(input)
-              46:   13(bvec4) FOrdEqual 44 45
-              47:    12(bool) All 46
-                              SelectionMerge 49 None
-                              BranchConditional 47 48 49
-              48:               Label
-              50:    7(fvec4)   Load 9(input)
-                                ReturnValue 50
-              49:             Label
-              52:    7(fvec4) Load 9(input)
-              53:    7(fvec4) Load 9(input)
-              54:   13(bvec4) FOrdEqual 52 53
-              55:    12(bool) All 54
-                              SelectionMerge 57 None
-                              BranchConditional 55 56 60
-              56:               Label
-              58:    7(fvec4)   Load 9(input)
-                                ReturnValue 58
-              60:               Label
-              61:    7(fvec4)   Load 9(input)
-              62:    7(fvec4)   FNegate 61
-                                ReturnValue 62
-              57:             Label
-              69:     68(ptr) AccessChain 9(input) 67
-              70:    6(float) Load 69
-                              Store 65(ii) 70
-                              SelectionMerge 72 None
-                              BranchConditional 70 71 72
-              71:               Label
-              73:    6(float)   Load 65(ii)
-              75:    6(float)   FAdd 73 74
-                                Store 65(ii) 75
-                                Branch 72
-              72:             Label
-              79:     76(int) Load 78(ii)
-              81:     76(int) IAdd 79 80
-                              Store 78(ii) 81
+              22:    7(fvec4) Load 9(input)
+              23:    7(fvec4) Load 9(input)
+              24:   13(bvec4) FOrdEqual 22 23
+              25:    12(bool) All 24
+                              SelectionMerge 27 None
+                              BranchConditional 25 26 30
+              26:               Label
+              28:    7(fvec4)   Load 9(input)
+                                Store 19(@entryPointOutput) 28
+                                Return
+              30:               Label
+              31:    7(fvec4)   Load 9(input)
+              32:    7(fvec4)   FNegate 31
+                                Store 19(@entryPointOutput) 32
+                                Return
+              27:             Label
+              34:    7(fvec4) Load 9(input)
+              35:    7(fvec4) Load 9(input)
+              36:   13(bvec4) FOrdEqual 34 35
+              37:    12(bool) All 36
+                              SelectionMerge 39 None
+                              BranchConditional 37 38 39
+              38:               Label
+                                Branch 39
+              39:             Label
+              40:    7(fvec4) Load 9(input)
+              41:    7(fvec4) Load 9(input)
+              42:   13(bvec4) FOrdEqual 40 41
+              43:    12(bool) All 42
+                              SelectionMerge 45 None
+                              BranchConditional 43 44 45
+              44:               Label
+                                Branch 45
+              45:             Label
+              46:    7(fvec4) Load 9(input)
+              47:    7(fvec4) Load 9(input)
+              48:   13(bvec4) FOrdEqual 46 47
+              49:    12(bool) All 48
+                              SelectionMerge 51 None
+                              BranchConditional 49 50 51
+              50:               Label
+              52:    7(fvec4)   Load 9(input)
+                                Store 19(@entryPointOutput) 52
+                                Return
+              51:             Label
+              54:    7(fvec4) Load 9(input)
+              55:    7(fvec4) Load 9(input)
+              56:   13(bvec4) FOrdEqual 54 55
+              57:    12(bool) All 56
+                              SelectionMerge 59 None
+                              BranchConditional 57 58 62
+              58:               Label
+              60:    7(fvec4)   Load 9(input)
+                                Store 19(@entryPointOutput) 60
+                                Return
+              62:               Label
+              63:    7(fvec4)   Load 9(input)
+              64:    7(fvec4)   FNegate 63
+                                Store 19(@entryPointOutput) 64
+                                Return
+              59:             Label
+              71:     70(ptr) AccessChain 9(input) 69
+              72:    6(float) Load 71
+                              Store 67(ii) 72
+                              SelectionMerge 74 None
+                              BranchConditional 72 73 74
+              73:               Label
+              75:    6(float)   Load 67(ii)
+              77:    6(float)   FAdd 75 76
+                                Store 67(ii) 77
+                                Branch 74
+              74:             Label
+              81:     78(int) Load 80(ii)
+              83:     78(int) IAdd 81 82
+                              Store 80(ii) 83
                               Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.init.frag.out b/Test/baseResults/hlsl.init.frag.out
index bc7c21b..99acc23 100755
--- a/Test/baseResults/hlsl.init.frag.out
+++ b/Test/baseResults/hlsl.init.frag.out
@@ -78,9 +78,9 @@
 0:18      Constant:
 0:18        4 (const uint)
 0:18        5 (const uint)
-0:37  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
+0:21  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
 0:21    Function Parameters: 
-0:21      'input' (in 4-component vector of float)
+0:21      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:22      Sequence
 0:22        move second child to first child (temp 4-component vector of float)
@@ -124,10 +124,13 @@
 0:33        move second child to first child (temp float)
 0:33          'a9' (temp float)
 0:33          'a5' (global float)
-0:35      Branch: Return with expression
-0:35        component-wise multiply (temp 4-component vector of float)
-0:35          'input' (in 4-component vector of float)
-0:35          'a1' (global 4-component vector of float)
+0:35      Sequence
+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:35          component-wise multiply (temp 4-component vector of float)
+0:35            'input' (layout(location=0 ) in 4-component vector of float)
+0:35            'a1' (global 4-component vector of float)
+0:35        Branch: Return
 0:?   Linker Objects
 0:?     'a1' (global 4-component vector of float)
 0:?     'b1' (global 4-component vector of float)
@@ -147,6 +150,8 @@
 0:?     'single2' (global structure{temp 2-component vector of uint v})
 0:?     'single3' (global structure{temp structure{temp int f} s1})
 0:?     'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -231,9 +236,9 @@
 0:18      Constant:
 0:18        4 (const uint)
 0:18        5 (const uint)
-0:37  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
+0:21  Function Definition: ShaderFunction(vf4; (global 4-component vector of float)
 0:21    Function Parameters: 
-0:21      'input' (in 4-component vector of float)
+0:21      'input' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:22      Sequence
 0:22        move second child to first child (temp 4-component vector of float)
@@ -277,10 +282,13 @@
 0:33        move second child to first child (temp float)
 0:33          'a9' (temp float)
 0:33          'a5' (global float)
-0:35      Branch: Return with expression
-0:35        component-wise multiply (temp 4-component vector of float)
-0:35          'input' (in 4-component vector of float)
-0:35          'a1' (global 4-component vector of float)
+0:35      Sequence
+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:35          component-wise multiply (temp 4-component vector of float)
+0:35            'input' (layout(location=0 ) in 4-component vector of float)
+0:35            'a1' (global 4-component vector of float)
+0:35        Branch: Return
 0:?   Linker Objects
 0:?     'a1' (global 4-component vector of float)
 0:?     'b1' (global 4-component vector of float)
@@ -300,17 +308,18 @@
 0:?     'single2' (global structure{temp 2-component vector of uint v})
 0:?     'single3' (global structure{temp structure{temp int f} s1})
 0:?     'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'input' (layout(location=0 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 95
+// Id's are bound by 97
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "ShaderFunction" 88
+                              EntryPoint Fragment 4  "ShaderFunction" 88 90
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "ShaderFunction"
                               Name 9  "a1"
                               Name 14  "b1"
@@ -348,9 +357,12 @@
                               Name 82  "a8"
                               Name 83  "b2"
                               Name 85  "a9"
-                              Name 88  "input"
-                              Name 93  "c4"
-                              Name 94  "b5"
+                              Name 88  "@entryPointOutput"
+                              Name 90  "input"
+                              Name 95  "c4"
+                              Name 96  "b5"
+                              Decorate 88(@entryPointOutput) Location 0
+                              Decorate 90(input) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -419,10 +431,12 @@
               73:     32(int) Constant 12
               81:             TypePointer Function 6(float)
           83(b2):     22(ptr) Variable Private
-              87:             TypePointer Input 7(fvec4)
-       88(input):     87(ptr) Variable Input
-          93(c4):     22(ptr) Variable Private
-          94(b5):     22(ptr) Variable Private
+              87:             TypePointer Output 7(fvec4)
+88(@entryPointOutput):     87(ptr) Variable Output
+              89:             TypePointer Input 7(fvec4)
+       90(input):     89(ptr) Variable Input
+          95(c4):     22(ptr) Variable Private
+          96(b5):     22(ptr) Variable Private
 4(ShaderFunction):           2 Function None 3
                5:             Label
           62(a2):     61(ptr) Variable Function
@@ -458,8 +472,9 @@
                               Store 82(a8) 84
               86:    6(float) Load 29(a5)
                               Store 85(a9) 86
-              89:    7(fvec4) Load 88(input)
-              90:    7(fvec4) Load 9(a1)
-              91:    7(fvec4) FMul 89 90
-                              ReturnValue 91
+              91:    7(fvec4) Load 90(input)
+              92:    7(fvec4) Load 9(a1)
+              93:    7(fvec4) FMul 91 92
+                              Store 88(@entryPointOutput) 93
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.init2.frag.out b/Test/baseResults/hlsl.init2.frag.out
index 439fd37..3657cb2 100644
--- a/Test/baseResults/hlsl.init2.frag.out
+++ b/Test/baseResults/hlsl.init2.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:23  Function Definition: Test1( (global void)
+0:3  Function Definition: Test1( (global void)
 0:3    Function Parameters: 
 0:?     Sequence
 0:5      Sequence
@@ -29,7 +29,7 @@
 0:20            8.000000
 0:20            9.000000
 0:20            10.000000
-0:33  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:26  Function Definition: main( (global structure{temp 4-component vector of float color})
 0:26    Function Parameters: 
 0:?     Sequence
 0:27      Function Call: Test1( (global void)
@@ -43,9 +43,17 @@
 0:30          1.000000
 0:30          1.000000
 0:30          1.000000
-0:31      Branch: Return with expression
-0:31        'ps_output' (temp structure{temp 4-component vector of float color})
+0:?       Sequence
+0:?         Sequence
+0:31          move second child to first child (temp 4-component vector of float)
+0:?             'color' (layout(location=0 ) out 4-component vector of float)
+0:31            color: direct index for structure (temp 4-component vector of float)
+0:31              'ps_output' (temp structure{temp 4-component vector of float color})
+0:31              Constant:
+0:31                0 (const int)
+0:31        Branch: Return
 0:?   Linker Objects
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 
 Linked fragment stage:
@@ -54,7 +62,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:23  Function Definition: Test1( (global void)
+0:3  Function Definition: Test1( (global void)
 0:3    Function Parameters: 
 0:?     Sequence
 0:5      Sequence
@@ -81,7 +89,7 @@
 0:20            8.000000
 0:20            9.000000
 0:20            10.000000
-0:33  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:26  Function Definition: main( (global structure{temp 4-component vector of float color})
 0:26    Function Parameters: 
 0:?     Sequence
 0:27      Function Call: Test1( (global void)
@@ -95,20 +103,27 @@
 0:30          1.000000
 0:30          1.000000
 0:30          1.000000
-0:31      Branch: Return with expression
-0:31        'ps_output' (temp structure{temp 4-component vector of float color})
+0:?       Sequence
+0:?         Sequence
+0:31          move second child to first child (temp 4-component vector of float)
+0:?             'color' (layout(location=0 ) out 4-component vector of float)
+0:31            color: direct index for structure (temp 4-component vector of float)
+0:31              'ps_output' (temp structure{temp 4-component vector of float color})
+0:31              Constant:
+0:31                0 (const int)
+0:31        Branch: Return
 0:?   Linker Objects
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 44
+// Id's are bound by 47
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main"
+                              EntryPoint Fragment 4  "main" 43
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 6  "Test1("
                               Name 10  "mystruct"
@@ -124,6 +139,8 @@
                               Name 34  "PS_OUTPUT"
                               MemberName 34(PS_OUTPUT) 0  "color"
                               Name 36  "ps_output"
+                              Name 43  "color"
+                              Decorate 43(color) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                8:             TypeFloat 32
@@ -153,14 +170,18 @@
               38:     37(int) Constant 0
               39:   33(fvec4) ConstantComposite 13 13 13 13
               40:             TypePointer Function 33(fvec4)
+              42:             TypePointer Output 33(fvec4)
+       43(color):     42(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
    36(ps_output):     35(ptr) Variable Function
               32:           2 FunctionCall 6(Test1()
               41:     40(ptr) AccessChain 36(ps_output) 38
                               Store 41 39
-              42:34(PS_OUTPUT) Load 36(ps_output)
-                              ReturnValue 42
+              44:     40(ptr) AccessChain 36(ps_output) 38
+              45:   33(fvec4) Load 44
+                              Store 43(color) 45
+                              Return
                               FunctionEnd
        6(Test1():           2 Function None 3
                7:             Label
diff --git a/Test/baseResults/hlsl.inoutquals.frag.out b/Test/baseResults/hlsl.inoutquals.frag.out
index 3fb207b..2fcb722 100644
--- a/Test/baseResults/hlsl.inoutquals.frag.out
+++ b/Test/baseResults/hlsl.inoutquals.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: MyFunc(f1;f1;f1; (global void)
+0:8  Function Definition: MyFunc(f1;f1;f1; (global void)
 0:8    Function Parameters: 
 0:8      'x' (in float)
 0:8      'y' (out float)
@@ -18,7 +18,7 @@
 0:11        'x' (in float)
 0:11        Constant:
 0:11          -1.000000
-0:26  Function Definition: main(vf4; (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:15  Function Definition: main(vf4; (global structure{temp 4-component vector of float Color, temp float Depth})
 0:15    Function Parameters: 
 0:15      'inpos' (noperspective in 4-component vector of float FragCoord)
 0:?     Sequence
@@ -37,7 +37,7 @@
 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 FragDepth Depth})
+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)
@@ -47,17 +47,33 @@
 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 FragDepth)
-0:22          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:22        Depth: direct index for structure (temp 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' (noperspective in 4-component vector of float FragCoord)
 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 FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:24          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:24            Color: direct index for structure (temp 4-component vector of float)
+0:24              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:24              Constant:
+0:24                0 (const int)
+0:24          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:24            Depth: direct index for structure (temp float)
+0:24              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:24              Constant:
+0:24                1 (const int)
+0:24        Branch: Return
 0:?   Linker Objects
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
+0:?     'inpos' (noperspective in 4-component vector of float FragCoord)
 
 
 Linked fragment stage:
@@ -66,7 +82,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:14  Function Definition: MyFunc(f1;f1;f1; (global void)
+0:8  Function Definition: MyFunc(f1;f1;f1; (global void)
 0:8    Function Parameters: 
 0:8      'x' (in float)
 0:8      'y' (out float)
@@ -82,7 +98,7 @@
 0:11        'x' (in float)
 0:11        Constant:
 0:11          -1.000000
-0:26  Function Definition: main(vf4; (global structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:15  Function Definition: main(vf4; (global structure{temp 4-component vector of float Color, temp float Depth})
 0:15    Function Parameters: 
 0:15      'inpos' (noperspective in 4-component vector of float FragCoord)
 0:?     Sequence
@@ -101,7 +117,7 @@
 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 FragDepth Depth})
+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)
@@ -111,28 +127,43 @@
 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 FragDepth)
-0:22          'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
+0:22        Depth: direct index for structure (temp 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' (noperspective in 4-component vector of float FragCoord)
 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 FragDepth Depth})
+0:?       Sequence
+0:?         Sequence
+0:24          move second child to first child (temp 4-component vector of float)
+0:?             'Color' (layout(location=0 ) out 4-component vector of float)
+0:24            Color: direct index for structure (temp 4-component vector of float)
+0:24              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:24              Constant:
+0:24                0 (const int)
+0:24          move second child to first child (temp float)
+0:?             'Depth' (out float FragDepth)
+0:24            Depth: direct index for structure (temp float)
+0:24              'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:24              Constant:
+0:24                1 (const int)
+0:24        Branch: Return
 0:?   Linker Objects
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
+0:?     'inpos' (noperspective in 4-component vector of float FragCoord)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 54
+// Id's are bound by 61
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 45
+                              EntryPoint Fragment 4  "main" 45 53 57
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 12  "MyFunc(f1;f1;f1;"
                               Name 9  "x"
@@ -149,9 +180,12 @@
                               MemberName 31(PS_OUTPUT) 1  "Depth"
                               Name 33  "psout"
                               Name 45  "inpos"
-                              MemberDecorate 31(PS_OUTPUT) 1 BuiltIn FragDepth
+                              Name 53  "Color"
+                              Name 57  "Depth"
                               Decorate 45(inpos) NoPerspective
                               Decorate 45(inpos) BuiltIn FragCoord
+                              Decorate 53(Color) Location 0
+                              Decorate 57(Depth) BuiltIn FragDepth
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -173,6 +207,10 @@
               46:             TypeInt 32 0
               47:     46(int) Constant 3
               48:             TypePointer Input 6(float)
+              52:             TypePointer Output 30(fvec4)
+       53(Color):     52(ptr) Variable Output
+              56:             TypePointer Output 6(float)
+       57(Depth):     56(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            17(x):      7(ptr) Variable Function
@@ -203,8 +241,13 @@
               50:    6(float) Load 49
               51:      7(ptr) AccessChain 33(psout) 43
                               Store 51 50
-              52:31(PS_OUTPUT) Load 33(psout)
-                              ReturnValue 52
+              54:     41(ptr) AccessChain 33(psout) 35
+              55:   30(fvec4) Load 54
+                              Store 53(Color) 55
+              58:      7(ptr) AccessChain 33(psout) 43
+              59:    6(float) Load 58
+                              Store 57(Depth) 59
+                              Return
                               FunctionEnd
 12(MyFunc(f1;f1;f1;):           2 Function None 8
             9(x):      7(ptr) FunctionParameter
diff --git a/Test/baseResults/hlsl.intrinsics.barriers.comp.out b/Test/baseResults/hlsl.intrinsics.barriers.comp.out
index c400fea..95e1725 100644
--- a/Test/baseResults/hlsl.intrinsics.barriers.comp.out
+++ b/Test/baseResults/hlsl.intrinsics.barriers.comp.out
@@ -2,7 +2,7 @@
 Shader version: 450
 local_size = (1, 1, 1)
 0:? Sequence
-0:14  Function Definition: ComputeShaderFunction( (global float)
+0:3  Function Definition: ComputeShaderFunction( (global float)
 0:3    Function Parameters: 
 0:?     Sequence
 0:4      MemoryBarrier (global void)
@@ -11,10 +11,14 @@
 0:7      GroupMemoryBarrierWithGroupSync (global void)
 0:8      WorkgroupMemoryBarrier (global void)
 0:9      WorkgroupMemoryBarrierWithGroupSync (global void)
-0:11      Branch: Return with expression
-0:11        Constant:
-0:11          0.000000
+0:11      Sequence
+0:11        move second child to first child (temp float)
+0:?           '@entryPointOutput' (layout(location=0 ) out float)
+0:11          Constant:
+0:11            0.000000
+0:11        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out float)
 
 
 Linked compute stage:
@@ -23,7 +27,7 @@
 Shader version: 450
 local_size = (1, 1, 1)
 0:? Sequence
-0:14  Function Definition: ComputeShaderFunction( (global float)
+0:3  Function Definition: ComputeShaderFunction( (global float)
 0:3    Function Parameters: 
 0:?     Sequence
 0:4      MemoryBarrier (global void)
@@ -32,22 +36,27 @@
 0:7      GroupMemoryBarrierWithGroupSync (global void)
 0:8      WorkgroupMemoryBarrier (global void)
 0:9      WorkgroupMemoryBarrierWithGroupSync (global void)
-0:11      Branch: Return with expression
-0:11        Constant:
-0:11          0.000000
+0:11      Sequence
+0:11        move second child to first child (temp float)
+0:?           '@entryPointOutput' (layout(location=0 ) out float)
+0:11          Constant:
+0:11            0.000000
+0:11        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 15
+// Id's are bound by 17
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint GLCompute 4  "ComputeShaderFunction"
+                              EntryPoint GLCompute 4  "ComputeShaderFunction" 14
                               ExecutionMode 4 LocalSize 1 1 1
-                              Source HLSL 450
                               Name 4  "ComputeShaderFunction"
+                              Name 14  "@entryPointOutput"
+                              Decorate 14(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -57,7 +66,9 @@
               10:      6(int) Constant 2
               11:      6(int) Constant 256
               12:             TypeFloat 32
-              13:   12(float) Constant 0
+              13:             TypePointer Output 12(float)
+14(@entryPointOutput):     13(ptr) Variable Output
+              15:   12(float) Constant 0
 4(ComputeShaderFunction):           2 Function None 3
                5:             Label
                               MemoryBarrier 7 8
@@ -66,5 +77,6 @@
                               ControlBarrier 7 7 9
                               MemoryBarrier 10 11
                               ControlBarrier 10 10 11
-                              ReturnValue 13
+                              Store 14(@entryPointOutput) 15
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.intrinsics.comp.out b/Test/baseResults/hlsl.intrinsics.comp.out
index 4c7eabb..b760c65 100644
--- a/Test/baseResults/hlsl.intrinsics.comp.out
+++ b/Test/baseResults/hlsl.intrinsics.comp.out
@@ -2,7 +2,7 @@
 Shader version: 450
 local_size = (1, 1, 1)
 0:? Sequence
-0:44  Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; (global float)
+0:17  Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; (global float)
 0:17    Function Parameters: 
 0:17      'inF0' (in float)
 0:17      'inF1' (in float)
@@ -74,7 +74,7 @@
 0:41      Branch: Return with expression
 0:41        Constant:
 0:41          0.000000
-0:50  Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
+0:45  Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
 0:45    Function Parameters: 
 0:45      'inF0' (in 1-component vector of float)
 0:45      'inF1' (in 1-component vector of float)
@@ -83,7 +83,7 @@
 0:47      Branch: Return with expression
 0:47        Constant:
 0:47          0.000000
-0:77  Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
+0:51  Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
 0:51    Function Parameters: 
 0:51      'inF0' (in 2-component vector of float)
 0:51      'inF1' (in 2-component vector of float)
@@ -156,7 +156,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:104  Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
+0:78  Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
 0:78    Function Parameters: 
 0:78      'inF0' (in 3-component vector of float)
 0:78      'inF1' (in 3-component vector of float)
@@ -230,16 +230,16 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:130  Function Definition: ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
+0:105  Function Definition: ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
 0:105    Function Parameters: 
-0:105      'inF0' (in 4-component vector of float)
-0:105      'inF1' (in 4-component vector of float)
-0:105      'inF2' (in 4-component vector of float)
-0:105      'inU0' (in 4-component vector of uint)
-0:105      'inU1' (in 4-component vector of uint)
+0:105      'inF0' (layout(location=0 ) in 4-component vector of float)
+0:105      'inF1' (layout(location=1 ) in 4-component vector of float)
+0:105      'inF2' (layout(location=2 ) in 4-component vector of float)
+0:105      'inU0' (layout(location=3 ) in 4-component vector of uint)
+0:105      'inU1' (layout(location=4 ) in 4-component vector of uint)
 0:?     Sequence
 0:109      all (global bool)
-0:109        'inF0' (in 4-component vector of float)
+0:109        'inF0' (layout(location=0 ) in 4-component vector of float)
 0:112      AtomicAdd (global void)
 0:112        'gs_ua4' (global 4-component vector of uint)
 0:112        'gs_ub4' (global 4-component vector of uint)
@@ -299,12 +299,15 @@
 0:125        AtomicXor (temp 4-component vector of uint)
 0:125          'gs_ua4' (global 4-component vector of uint)
 0:125          'gs_ub4' (global 4-component vector of uint)
-0:128      Branch: Return with expression
-0:?         Constant:
-0:?           1.000000
-0:?           2.000000
-0:?           3.000000
-0:?           4.000000
+0:128      Sequence
+0:128        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             2.000000
+0:?             3.000000
+0:?             4.000000
+0:128        Branch: Return
 0:?   Linker Objects
 0:?     'gs_ua' (global uint)
 0:?     'gs_ub' (global uint)
@@ -318,6 +321,12 @@
 0:?     'gs_ua4' (global 4-component vector of uint)
 0:?     'gs_ub4' (global 4-component vector of uint)
 0:?     'gs_uc4' (global 4-component vector of uint)
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+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:?     'inU0' (layout(location=3 ) in 4-component vector of uint)
+0:?     'inU1' (layout(location=4 ) in 4-component vector of uint)
 
 
 Linked compute stage:
@@ -326,7 +335,7 @@
 Shader version: 450
 local_size = (1, 1, 1)
 0:? Sequence
-0:44  Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; (global float)
+0:17  Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; (global float)
 0:17    Function Parameters: 
 0:17      'inF0' (in float)
 0:17      'inF1' (in float)
@@ -398,7 +407,7 @@
 0:41      Branch: Return with expression
 0:41        Constant:
 0:41          0.000000
-0:50  Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
+0:45  Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
 0:45    Function Parameters: 
 0:45      'inF0' (in 1-component vector of float)
 0:45      'inF1' (in 1-component vector of float)
@@ -407,7 +416,7 @@
 0:47      Branch: Return with expression
 0:47        Constant:
 0:47          0.000000
-0:77  Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
+0:51  Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
 0:51    Function Parameters: 
 0:51      'inF0' (in 2-component vector of float)
 0:51      'inF1' (in 2-component vector of float)
@@ -480,7 +489,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:104  Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
+0:78  Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
 0:78    Function Parameters: 
 0:78      'inF0' (in 3-component vector of float)
 0:78      'inF1' (in 3-component vector of float)
@@ -554,16 +563,16 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:130  Function Definition: ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
+0:105  Function Definition: ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
 0:105    Function Parameters: 
-0:105      'inF0' (in 4-component vector of float)
-0:105      'inF1' (in 4-component vector of float)
-0:105      'inF2' (in 4-component vector of float)
-0:105      'inU0' (in 4-component vector of uint)
-0:105      'inU1' (in 4-component vector of uint)
+0:105      'inF0' (layout(location=0 ) in 4-component vector of float)
+0:105      'inF1' (layout(location=1 ) in 4-component vector of float)
+0:105      'inF2' (layout(location=2 ) in 4-component vector of float)
+0:105      'inU0' (layout(location=3 ) in 4-component vector of uint)
+0:105      'inU1' (layout(location=4 ) in 4-component vector of uint)
 0:?     Sequence
 0:109      all (global bool)
-0:109        'inF0' (in 4-component vector of float)
+0:109        'inF0' (layout(location=0 ) in 4-component vector of float)
 0:112      AtomicAdd (global void)
 0:112        'gs_ua4' (global 4-component vector of uint)
 0:112        'gs_ub4' (global 4-component vector of uint)
@@ -623,12 +632,15 @@
 0:125        AtomicXor (temp 4-component vector of uint)
 0:125          'gs_ua4' (global 4-component vector of uint)
 0:125          'gs_ub4' (global 4-component vector of uint)
-0:128      Branch: Return with expression
-0:?         Constant:
-0:?           1.000000
-0:?           2.000000
-0:?           3.000000
-0:?           4.000000
+0:128      Sequence
+0:128        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             2.000000
+0:?             3.000000
+0:?             4.000000
+0:128        Branch: Return
 0:?   Linker Objects
 0:?     'gs_ua' (global uint)
 0:?     'gs_ub' (global uint)
@@ -642,17 +654,22 @@
 0:?     'gs_ua4' (global 4-component vector of uint)
 0:?     'gs_ub4' (global 4-component vector of uint)
 0:?     'gs_uc4' (global 4-component vector of uint)
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+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:?     'inU0' (layout(location=3 ) in 4-component vector of uint)
+0:?     'inU1' (layout(location=4 ) in 4-component vector of uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 217
+// Id's are bound by 224
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint GLCompute 4  "ComputeShaderFunction" 175
+                              EntryPoint GLCompute 4  "ComputeShaderFunction" 175 215 219 220 222 223
                               ExecutionMode 4 LocalSize 1 1 1
-                              Source HLSL 450
                               Name 4  "ComputeShaderFunction"
                               Name 16  "ComputeShaderFunctionS(f1;f1;f1;u1;u1;"
                               Name 11  "inF0"
@@ -693,6 +710,17 @@
                               Name 181  "gs_ub4"
                               Name 185  "out_u4"
                               Name 193  "gs_uc4"
+                              Name 215  "@entryPointOutput"
+                              Name 219  "inF1"
+                              Name 220  "inF2"
+                              Name 222  "inU0"
+                              Name 223  "inU1"
+                              Decorate 175(inF0) Location 0
+                              Decorate 215(@entryPointOutput) Location 0
+                              Decorate 219(inF1) Location 1
+                              Decorate 220(inF2) Location 2
+                              Decorate 222(inU0) Location 3
+                              Decorate 223(inU1) Location 4
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -741,8 +769,15 @@
      181(gs_ub4):    179(ptr) Variable Private
              184:             TypePointer Function 178(ivec4)
      193(gs_uc4):    179(ptr) Variable Private
-             214:    6(float) Constant 1082130432
-             215:  173(fvec4) ConstantComposite 128 129 169 214
+             214:             TypePointer Output 173(fvec4)
+215(@entryPointOutput):    214(ptr) Variable Output
+             216:    6(float) Constant 1082130432
+             217:  173(fvec4) ConstantComposite 128 129 169 216
+       219(inF1):    174(ptr) Variable Input
+       220(inF2):    174(ptr) Variable Input
+             221:             TypePointer Input 178(ivec4)
+       222(inU0):    221(ptr) Variable Input
+       223(inU1):    221(ptr) Variable Input
 4(ComputeShaderFunction):           2 Function None 3
                5:             Label
      185(out_u4):    184(ptr) Variable Function
@@ -785,7 +820,8 @@
              212:  178(ivec4) Load 181(gs_ub4)
              213:  178(ivec4) AtomicXor 180(gs_ua4) 55 56 212
                               Store 185(out_u4) 213
-                              ReturnValue 215
+                              Store 215(@entryPointOutput) 217
+                              Return
                               FunctionEnd
 16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;):    6(float) Function None 10
         11(inF0):      7(ptr) FunctionParameter
diff --git a/Test/baseResults/hlsl.intrinsics.double.frag.out b/Test/baseResults/hlsl.intrinsics.double.frag.out
index 8bfc072..0dba032 100644
--- a/Test/baseResults/hlsl.intrinsics.double.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.double.frag.out
@@ -2,35 +2,47 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:12  Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (global float)
+0:5  Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (global float)
 0:5    Function Parameters: 
-0:5      'inDV1a' (in double)
-0:5      'inDV1b' (in double)
-0:5      'inDV1c' (in double)
-0:5      'inDV2' (in 2-component vector of double)
-0:5      'inDV3' (in 3-component vector of double)
-0:5      'inDV4' (in 4-component vector of double)
-0:5      'inU1a' (in uint)
-0:5      'inU1b' (in uint)
+0:5      'inDV1a' (layout(location=0 ) in double)
+0:5      'inDV1b' (layout(location=1 ) in double)
+0:5      'inDV1c' (layout(location=2 ) in double)
+0:5      'inDV2' (layout(location=3 ) in 2-component vector of double)
+0:5      'inDV3' (layout(location=4 ) in 3-component vector of double)
+0:5      'inDV4' (layout(location=6 ) in 4-component vector of double)
+0:5      'inU1a' (layout(location=8 ) in uint)
+0:5      'inU1b' (layout(location=9 ) in uint)
 0:?     Sequence
 0:6      Sequence
 0:6        move second child to first child (temp double)
 0:6          'r00' (temp double)
 0:6          fma (global double)
-0:6            'inDV1a' (in double)
-0:6            'inDV1b' (in double)
-0:6            'inDV1c' (in double)
+0:6            'inDV1a' (layout(location=0 ) in double)
+0:6            'inDV1b' (layout(location=1 ) in double)
+0:6            'inDV1c' (layout(location=2 ) in double)
 0:7      Sequence
 0:7        move second child to first child (temp double)
 0:7          'r01' (temp double)
 0:7          uint64BitsToDouble (temp double)
 0:7            Construct uvec2 (temp 2-component vector of uint)
-0:7              'inU1a' (in uint)
-0:7              'inU1b' (in uint)
-0:9      Branch: Return with expression
-0:9        Constant:
-0:9          0.000000
+0:7              'inU1a' (layout(location=8 ) in uint)
+0:7              'inU1b' (layout(location=9 ) in uint)
+0:9      Sequence
+0:9        move second child to first child (temp float)
+0:?           '@entryPointOutput' (layout(location=0 ) out float)
+0:9          Constant:
+0:9            0.000000
+0:9        Branch: Return
 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)
 
 
 Linked fragment stage:
@@ -39,47 +51,58 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:12  Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (global float)
+0:5  Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (global float)
 0:5    Function Parameters: 
-0:5      'inDV1a' (in double)
-0:5      'inDV1b' (in double)
-0:5      'inDV1c' (in double)
-0:5      'inDV2' (in 2-component vector of double)
-0:5      'inDV3' (in 3-component vector of double)
-0:5      'inDV4' (in 4-component vector of double)
-0:5      'inU1a' (in uint)
-0:5      'inU1b' (in uint)
+0:5      'inDV1a' (layout(location=0 ) in double)
+0:5      'inDV1b' (layout(location=1 ) in double)
+0:5      'inDV1c' (layout(location=2 ) in double)
+0:5      'inDV2' (layout(location=3 ) in 2-component vector of double)
+0:5      'inDV3' (layout(location=4 ) in 3-component vector of double)
+0:5      'inDV4' (layout(location=6 ) in 4-component vector of double)
+0:5      'inU1a' (layout(location=8 ) in uint)
+0:5      'inU1b' (layout(location=9 ) in uint)
 0:?     Sequence
 0:6      Sequence
 0:6        move second child to first child (temp double)
 0:6          'r00' (temp double)
 0:6          fma (global double)
-0:6            'inDV1a' (in double)
-0:6            'inDV1b' (in double)
-0:6            'inDV1c' (in double)
+0:6            'inDV1a' (layout(location=0 ) in double)
+0:6            'inDV1b' (layout(location=1 ) in double)
+0:6            'inDV1c' (layout(location=2 ) in double)
 0:7      Sequence
 0:7        move second child to first child (temp double)
 0:7          'r01' (temp double)
 0:7          uint64BitsToDouble (temp double)
 0:7            Construct uvec2 (temp 2-component vector of uint)
-0:7              'inU1a' (in uint)
-0:7              'inU1b' (in uint)
-0:9      Branch: Return with expression
-0:9        Constant:
-0:9          0.000000
+0:7              'inU1a' (layout(location=8 ) in uint)
+0:7              'inU1b' (layout(location=9 ) in uint)
+0:9      Sequence
+0:9        move second child to first child (temp float)
+0:?           '@entryPointOutput' (layout(location=0 ) out float)
+0:9          Constant:
+0:9            0.000000
+0:9        Branch: Return
 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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 30
+// Id's are bound by 41
 
                               Capability Shader
                               Capability Float64
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 10 12 14 20 22
+                              EntryPoint Fragment 4  "PixelShaderFunction" 10 12 14 20 22 29 34 37 40
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "PixelShaderFunction"
                               Name 8  "r00"
                               Name 10  "inDV1a"
@@ -88,6 +111,19 @@
                               Name 17  "r01"
                               Name 20  "inU1a"
                               Name 22  "inU1b"
+                              Name 29  "@entryPointOutput"
+                              Name 34  "inDV2"
+                              Name 37  "inDV3"
+                              Name 40  "inDV4"
+                              Decorate 10(inDV1a) Location 0
+                              Decorate 12(inDV1b) Location 1
+                              Decorate 14(inDV1c) Location 2
+                              Decorate 20(inU1a) Location 8
+                              Decorate 22(inU1b) Location 9
+                              Decorate 29(@entryPointOutput) Location 0
+                              Decorate 34(inDV2) Location 3
+                              Decorate 37(inDV3) Location 4
+                              Decorate 40(inDV4) Location 6
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 64
@@ -102,7 +138,18 @@
        22(inU1b):     19(ptr) Variable Input
               24:             TypeVector 18(int) 2
               27:             TypeFloat 32
-              28:   27(float) Constant 0
+              28:             TypePointer Output 27(float)
+29(@entryPointOutput):     28(ptr) Variable Output
+              30:   27(float) Constant 0
+              32:             TypeVector 6(float) 2
+              33:             TypePointer Input 32(fvec2)
+       34(inDV2):     33(ptr) Variable Input
+              35:             TypeVector 6(float) 3
+              36:             TypePointer Input 35(fvec3)
+       37(inDV3):     36(ptr) Variable Input
+              38:             TypeVector 6(float) 4
+              39:             TypePointer Input 38(fvec4)
+       40(inDV4):     39(ptr) Variable Input
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
           8(r00):      7(ptr) Variable Function
@@ -117,5 +164,6 @@
               25:   24(ivec2) CompositeConstruct 21 23
               26:    6(float) Bitcast 25
                               Store 17(r01) 26
-                              ReturnValue 28
+                              Store 29(@entryPointOutput) 30
+                              Return
                               FunctionEnd
diff --git a/Test/baseResults/hlsl.intrinsics.evalfns.frag.out b/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
index f1b6411..a23a883 100644
--- a/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
@@ -2,41 +2,41 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:11  Function Definition: main(f1;vf2;vf3;vf4;vi2; (global void)
+0:3  Function Definition: main(f1;vf2;vf3;vf4;vi2; (global void)
 0:3    Function Parameters: 
-0:3      'inF1' (in float)
-0:3      'inF2' (in 2-component vector of float)
-0:3      'inF3' (in 3-component vector of float)
-0:3      'inF4' (in 4-component vector of float)
-0:3      'inI2' (in 2-component vector of int)
+0:3      'inF1' (layout(location=0 ) in float)
+0:3      'inF2' (layout(location=1 ) in 2-component vector of float)
+0:3      'inF3' (layout(location=2 ) in 3-component vector of float)
+0:3      'inF4' (layout(location=3 ) in 4-component vector of float)
+0:3      'inI2' (layout(location=4 ) in 2-component vector of int)
 0:?     Sequence
 0:4      interpolateAtOffset (temp float)
-0:4        'inF1' (in float)
+0:4        'inF1' (layout(location=0 ) in float)
 0:?         Constant:
 0:?           -0.500000
 0:?           -0.062500
 0:5      interpolateAtOffset (temp 2-component vector of float)
-0:5        'inF2' (in 2-component vector of float)
+0:5        'inF2' (layout(location=1 ) in 2-component vector of float)
 0:?         Constant:
 0:?           0.000000
 0:?           0.062500
 0:6      interpolateAtOffset (temp 3-component vector of float)
-0:6        'inF3' (in 3-component vector of float)
+0:6        'inF3' (layout(location=2 ) in 3-component vector of float)
 0:?         Constant:
 0:?           0.187500
 0:?           -0.375000
 0:7      interpolateAtOffset (temp 4-component vector of float)
-0:7        'inF4' (in 4-component vector of float)
+0:7        'inF4' (layout(location=3 ) in 4-component vector of float)
 0:?         Constant:
 0:?           0.437500
 0:?           -0.500000
 0:9      interpolateAtOffset (temp float)
-0:9        'inF1' (in float)
+0:9        'inF1' (layout(location=0 ) in float)
 0:9        vector-scale (temp 2-component vector of float)
 0:9          Convert int to float (temp 2-component vector of float)
 0:9            right-shift (temp 2-component vector of int)
 0:9              left-shift (temp 2-component vector of int)
-0:9                'inI2' (in 2-component vector of int)
+0:9                'inI2' (layout(location=4 ) in 2-component vector of int)
 0:9                Constant:
 0:9                  28 (const int)
 0:9              Constant:
@@ -44,6 +44,11 @@
 0:9          Constant:
 0:9            0.062500
 0:?   Linker Objects
+0:?     'inF1' (layout(location=0 ) in float)
+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)
 
 
 Linked fragment stage:
@@ -52,41 +57,41 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:11  Function Definition: main(f1;vf2;vf3;vf4;vi2; (global void)
+0:3  Function Definition: main(f1;vf2;vf3;vf4;vi2; (global void)
 0:3    Function Parameters: 
-0:3      'inF1' (in float)
-0:3      'inF2' (in 2-component vector of float)
-0:3      'inF3' (in 3-component vector of float)
-0:3      'inF4' (in 4-component vector of float)
-0:3      'inI2' (in 2-component vector of int)
+0:3      'inF1' (layout(location=0 ) in float)
+0:3      'inF2' (layout(location=1 ) in 2-component vector of float)
+0:3      'inF3' (layout(location=2 ) in 3-component vector of float)
+0:3      'inF4' (layout(location=3 ) in 4-component vector of float)
+0:3      'inI2' (layout(location=4 ) in 2-component vector of int)
 0:?     Sequence
 0:4      interpolateAtOffset (temp float)
-0:4        'inF1' (in float)
+0:4        'inF1' (layout(location=0 ) in float)
 0:?         Constant:
 0:?           -0.500000
 0:?           -0.062500
 0:5      interpolateAtOffset (temp 2-component vector of float)
-0:5        'inF2' (in 2-component vector of float)
+0:5        'inF2' (layout(location=1 ) in 2-component vector of float)
 0:?         Constant:
 0:?           0.000000
 0:?           0.062500
 0:6      interpolateAtOffset (temp 3-component vector of float)
-0:6        'inF3' (in 3-component vector of float)
+0:6        'inF3' (layout(location=2 ) in 3-component vector of float)
 0:?         Constant:
 0:?           0.187500
 0:?           -0.375000
 0:7      interpolateAtOffset (temp 4-component vector of float)
-0:7        'inF4' (in 4-component vector of float)
+0:7        'inF4' (layout(location=3 ) in 4-component vector of float)
 0:?         Constant:
 0:?           0.437500
 0:?           -0.500000
 0:9      interpolateAtOffset (temp float)
-0:9        'inF1' (in float)
+0:9        'inF1' (layout(location=0 ) in float)
 0:9        vector-scale (temp 2-component vector of float)
 0:9          Convert int to float (temp 2-component vector of float)
 0:9            right-shift (temp 2-component vector of int)
 0:9              left-shift (temp 2-component vector of int)
-0:9                'inI2' (in 2-component vector of int)
+0:9                'inI2' (layout(location=4 ) in 2-component vector of int)
 0:9                Constant:
 0:9                  28 (const int)
 0:9              Constant:
@@ -94,6 +99,11 @@
 0:9          Constant:
 0:9            0.062500
 0:?   Linker Objects
+0:?     'inF1' (layout(location=0 ) in float)
+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)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -105,13 +115,17 @@
                               MemoryModel Logical GLSL450
                               EntryPoint Fragment 4  "main" 8 15 22 29 36
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
                               Name 4  "main"
                               Name 8  "inF1"
                               Name 15  "inF2"
                               Name 22  "inF3"
                               Name 29  "inF4"
                               Name 36  "inI2"
+                              Decorate 8(inF1) Location 0
+                              Decorate 15(inF2) Location 1
+                              Decorate 22(inF3) Location 2
+                              Decorate 29(inF4) Location 3
+                              Decorate 36(inI2) Location 4
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
diff --git a/Test/baseResults/hlsl.intrinsics.f1632.frag.out b/Test/baseResults/hlsl.intrinsics.f1632.frag.out
index 7340531..21daced 100644
--- a/Test/baseResults/hlsl.intrinsics.f1632.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.f1632.frag.out
@@ -9,7 +9,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:8  Function Definition: PixelShaderFunctionS(f1; (global float)
+0:2  Function Definition: PixelShaderFunctionS(f1; (global float)
 0:2    Function Parameters: 
 0:2      'inF0' (in float)
 0:?     Sequence
@@ -19,14 +19,14 @@
 0:5      Branch: Return with expression
 0:5        Constant:
 0:5          0.000000
-0:14  Function Definition: PixelShaderFunction1(vf1; (global 1-component vector of float)
+0:9  Function Definition: PixelShaderFunction1(vf1; (global 1-component vector of float)
 0:9    Function Parameters: 
 0:9      'inF0' (in 1-component vector of float)
 0:?     Sequence
 0:11      Branch: Return with expression
 0:11        Constant:
 0:11          0.000000
-0:21  Function Definition: PixelShaderFunction2(vf2; (global 2-component vector of float)
+0:15  Function Definition: PixelShaderFunction2(vf2; (global 2-component vector of float)
 0:15    Function Parameters: 
 0:15      'inF0' (in 2-component vector of float)
 0:?     Sequence
@@ -37,7 +37,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:28  Function Definition: PixelShaderFunction3(vf3; (global 3-component vector of float)
+0:22  Function Definition: PixelShaderFunction3(vf3; (global 3-component vector of float)
 0:22    Function Parameters: 
 0:22      'inF0' (in 3-component vector of float)
 0:?     Sequence
@@ -49,20 +49,25 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:35  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:29  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:29    Function Parameters: 
-0:29      'inF0' (in 4-component vector of float)
+0:29      'inF0' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:30      ERROR: Bad unary op
  (global 4-component vector of uint)
-0:30        'inF0' (in 4-component vector of float)
-0:32      Branch: Return with expression
-0:?         Constant:
-0:?           1.000000
-0:?           2.000000
-0:?           3.000000
-0:?           4.000000
+0:30        'inF0' (layout(location=0 ) in 4-component vector of float)
+0:32      Sequence
+0:32        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             2.000000
+0:?             3.000000
+0:?             4.000000
+0:32        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'inF0' (layout(location=0 ) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -71,7 +76,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 ERROR: node is still EOpNull!
-0:8  Function Definition: PixelShaderFunctionS(f1; (global float)
+0:2  Function Definition: PixelShaderFunctionS(f1; (global float)
 0:2    Function Parameters: 
 0:2      'inF0' (in float)
 0:?     Sequence
@@ -81,14 +86,14 @@
 0:5      Branch: Return with expression
 0:5        Constant:
 0:5          0.000000
-0:14  Function Definition: PixelShaderFunction1(vf1; (global 1-component vector of float)
+0:9  Function Definition: PixelShaderFunction1(vf1; (global 1-component vector of float)
 0:9    Function Parameters: 
 0:9      'inF0' (in 1-component vector of float)
 0:?     Sequence
 0:11      Branch: Return with expression
 0:11        Constant:
 0:11          0.000000
-0:21  Function Definition: PixelShaderFunction2(vf2; (global 2-component vector of float)
+0:15  Function Definition: PixelShaderFunction2(vf2; (global 2-component vector of float)
 0:15    Function Parameters: 
 0:15      'inF0' (in 2-component vector of float)
 0:?     Sequence
@@ -99,7 +104,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:28  Function Definition: PixelShaderFunction3(vf3; (global 3-component vector of float)
+0:22  Function Definition: PixelShaderFunction3(vf3; (global 3-component vector of float)
 0:22    Function Parameters: 
 0:22      'inF0' (in 3-component vector of float)
 0:?     Sequence
@@ -111,19 +116,24 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:35  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
+0:29  Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
 0:29    Function Parameters: 
-0:29      'inF0' (in 4-component vector of float)
+0:29      'inF0' (layout(location=0 ) in 4-component vector of float)
 0:?     Sequence
 0:30      ERROR: Bad unary op
  (global 4-component vector of uint)
-0:30        'inF0' (in 4-component vector of float)
-0:32      Branch: Return with expression
-0:?         Constant:
-0:?           1.000000
-0:?           2.000000
-0:?           3.000000
-0:?           4.000000
+0:30        'inF0' (layout(location=0 ) in 4-component vector of float)
+0:32      Sequence
+0:32        move second child to first child (temp 4-component vector of float)
+0:?           '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             2.000000
+0:?             3.000000
+0:?             4.000000
+0:32        Branch: Return
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:?     'inF0' (layout(location=0 ) in 4-component vector of float)
 
 SPIR-V is not generated for failed compile or link
diff --git a/Test/baseResults/hlsl.intrinsics.frag.out b/Test/baseResults/hlsl.intrinsics.frag.out
index f4e2434..151bdb4 100644
--- a/Test/baseResults/hlsl.intrinsics.frag.out
+++ b/Test/baseResults/hlsl.intrinsics.frag.out
@@ -2,7 +2,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:88  Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; (global float)
+0:17  Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; (global float)
 0:17    Function Parameters: 
 0:17      'inF0' (in float)
 0:17      'inF1' (in float)
@@ -339,7 +339,7 @@
 0:85      Branch: Return with expression
 0:85        Constant:
 0:85          0.000000
-0:94  Function Definition: PixelShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
+0:89  Function Definition: PixelShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
 0:89    Function Parameters: 
 0:89      'inF0' (in 1-component vector of float)
 0:89      'inF1' (in 1-component vector of float)
@@ -348,7 +348,7 @@
 0:91      Branch: Return with expression
 0:91        Constant:
 0:91          0.000000
-0:177  Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
+0:95  Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
 0:95    Function Parameters: 
 0:95      'inF0' (in 2-component vector of float)
 0:95      'inF1' (in 2-component vector of float)
@@ -733,7 +733,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:259  Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
+0:178  Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
 0:178    Function Parameters: 
 0:178      'inF0' (in 3-component vector of float)
 0:178      'inF1' (in 3-component vector of float)
@@ -1138,7 +1138,7 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:400  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
+0:260  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
 0:260    Function Parameters: 
 0:260      'inF0' (in 4-component vector of float)
 0:260      'inF1' (in 4-component vector of float)
@@ -1558,7 +1558,7 @@
 0:?           2.000000
 0:?           3.000000
 0:?           4.000000
-0:409  Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; (global 2X2 matrix of float)
+0:401  Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; (global 2X2 matrix of float)
 0:401    Function Parameters: 
 0:401      'inF0' (in 2X2 matrix of float)
 0:401      'inF1' (in 2X2 matrix of float)
@@ -1846,7 +1846,7 @@
 0:?           2.000000
 0:?           2.000000
 0:?           2.000000
-0:418  Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; (global 3X3 matrix of float)
+0:410  Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; (global 3X3 matrix of float)
 0:410    Function Parameters: 
 0:410      'inF0' (in 3X3 matrix of float)
 0:410      'inF1' (in 3X3 matrix of float)
@@ -2144,7 +2144,7 @@
 0:?           3.000000
 0:?           3.000000
 0:?           3.000000
-0:439  Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; (global 4X4 matrix of float)
+0:419  Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; (global 4X4 matrix of float)
 0:419    Function Parameters: 
 0:419      'inF0' (in 4X4 matrix of float)
 0:419      'inF1' (in 4X4 matrix of float)
@@ -2456,7 +2456,7 @@
 0:?           4.000000
 0:?           4.000000
 0:?           4.000000
-0:446  Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; (global void)
+0:442  Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; (global void)
 0:442    Function Parameters: 
 0:442      'inF0' (in float)
 0:442      'inF1' (in float)
@@ -2469,20 +2469,20 @@
 0:443        move second child to first child (temp float)
 0:443          'r0' (temp float)
 0:443          component-wise multiply (temp float)
-0:443            'inF0' (in float)
 0:443            'inF1' (in float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r1' (temp 2-component vector of float)
 0:443          vector-scale (temp 2-component vector of float)
-0:443            'inFV0' (in 2-component vector of float)
 0:443            'inF0' (in float)
+0:443            'inFV0' (in 2-component vector of float)
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r2' (temp 2-component vector of float)
 0:443          vector-scale (temp 2-component vector of float)
-0:443            'inF0' (in float)
 0:443            'inFV0' (in 2-component vector of float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp float)
 0:443          'r3' (temp float)
@@ -2492,34 +2492,34 @@
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r4' (temp 2-component vector of float)
-0:443          matrix-times-vector (temp 2-component vector of float)
-0:443            'inFM0' (in 2X2 matrix of float)
-0:443            'inFV0' (in 2-component vector of float)
-0:443      Sequence
-0:443        move second child to first child (temp 2-component vector of float)
-0:443          'r5' (temp 2-component vector of float)
 0:443          vector-times-matrix (temp 2-component vector of float)
 0:443            'inFV0' (in 2-component vector of float)
 0:443            'inFM0' (in 2X2 matrix of float)
 0:443      Sequence
+0:443        move second child to first child (temp 2-component vector of float)
+0:443          'r5' (temp 2-component vector of float)
+0:443          matrix-times-vector (temp 2-component vector of float)
+0:443            'inFM0' (in 2X2 matrix of float)
+0:443            'inFV0' (in 2-component vector of float)
+0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r6' (temp 2X2 matrix of float)
 0:443          matrix-scale (temp 2X2 matrix of float)
-0:443            'inFM0' (in 2X2 matrix of float)
 0:443            'inF0' (in float)
+0:443            'inFM0' (in 2X2 matrix of float)
 0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r7' (temp 2X2 matrix of float)
 0:443          matrix-scale (temp 2X2 matrix of float)
-0:443            'inF0' (in float)
 0:443            'inFM0' (in 2X2 matrix of float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r8' (temp 2X2 matrix of float)
 0:443          matrix-multiply (temp 2X2 matrix of float)
-0:443            'inFM0' (in 2X2 matrix of float)
 0:443            'inFM1' (in 2X2 matrix of float)
-0:453  Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; (global void)
+0:443            'inFM0' (in 2X2 matrix of float)
+0:449  Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; (global void)
 0:449    Function Parameters: 
 0:449      'inF0' (in float)
 0:449      'inF1' (in float)
@@ -2532,20 +2532,20 @@
 0:450        move second child to first child (temp float)
 0:450          'r0' (temp float)
 0:450          component-wise multiply (temp float)
-0:450            'inF0' (in float)
 0:450            'inF1' (in float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r1' (temp 3-component vector of float)
 0:450          vector-scale (temp 3-component vector of float)
-0:450            'inFV0' (in 3-component vector of float)
 0:450            'inF0' (in float)
+0:450            'inFV0' (in 3-component vector of float)
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r2' (temp 3-component vector of float)
 0:450          vector-scale (temp 3-component vector of float)
-0:450            'inF0' (in float)
 0:450            'inFV0' (in 3-component vector of float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp float)
 0:450          'r3' (temp float)
@@ -2555,34 +2555,34 @@
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r4' (temp 3-component vector of float)
-0:450          matrix-times-vector (temp 3-component vector of float)
-0:450            'inFM0' (in 3X3 matrix of float)
-0:450            'inFV0' (in 3-component vector of float)
-0:450      Sequence
-0:450        move second child to first child (temp 3-component vector of float)
-0:450          'r5' (temp 3-component vector of float)
 0:450          vector-times-matrix (temp 3-component vector of float)
 0:450            'inFV0' (in 3-component vector of float)
 0:450            'inFM0' (in 3X3 matrix of float)
 0:450      Sequence
+0:450        move second child to first child (temp 3-component vector of float)
+0:450          'r5' (temp 3-component vector of float)
+0:450          matrix-times-vector (temp 3-component vector of float)
+0:450            'inFM0' (in 3X3 matrix of float)
+0:450            'inFV0' (in 3-component vector of float)
+0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r6' (temp 3X3 matrix of float)
 0:450          matrix-scale (temp 3X3 matrix of float)
-0:450            'inFM0' (in 3X3 matrix of float)
 0:450            'inF0' (in float)
+0:450            'inFM0' (in 3X3 matrix of float)
 0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r7' (temp 3X3 matrix of float)
 0:450          matrix-scale (temp 3X3 matrix of float)
-0:450            'inF0' (in float)
 0:450            'inFM0' (in 3X3 matrix of float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r8' (temp 3X3 matrix of float)
 0:450          matrix-multiply (temp 3X3 matrix of float)
-0:450            'inFM0' (in 3X3 matrix of float)
 0:450            'inFM1' (in 3X3 matrix of float)
-0:461  Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; (global void)
+0:450            'inFM0' (in 3X3 matrix of float)
+0:456  Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; (global void)
 0:456    Function Parameters: 
 0:456      'inF0' (in float)
 0:456      'inF1' (in float)
@@ -2595,20 +2595,20 @@
 0:457        move second child to first child (temp float)
 0:457          'r0' (temp float)
 0:457          component-wise multiply (temp float)
-0:457            'inF0' (in float)
 0:457            'inF1' (in float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r1' (temp 4-component vector of float)
 0:457          vector-scale (temp 4-component vector of float)
-0:457            'inFV0' (in 4-component vector of float)
 0:457            'inF0' (in float)
+0:457            'inFV0' (in 4-component vector of float)
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r2' (temp 4-component vector of float)
 0:457          vector-scale (temp 4-component vector of float)
-0:457            'inF0' (in float)
 0:457            'inFV0' (in 4-component vector of float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp float)
 0:457          'r3' (temp float)
@@ -2618,75 +2618,75 @@
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r4' (temp 4-component vector of float)
-0:457          matrix-times-vector (temp 4-component vector of float)
-0:457            'inFM0' (in 4X4 matrix of float)
-0:457            'inFV0' (in 4-component vector of float)
-0:457      Sequence
-0:457        move second child to first child (temp 4-component vector of float)
-0:457          'r5' (temp 4-component vector of float)
 0:457          vector-times-matrix (temp 4-component vector of float)
 0:457            'inFV0' (in 4-component vector of float)
 0:457            'inFM0' (in 4X4 matrix of float)
 0:457      Sequence
+0:457        move second child to first child (temp 4-component vector of float)
+0:457          'r5' (temp 4-component vector of float)
+0:457          matrix-times-vector (temp 4-component vector of float)
+0:457            'inFM0' (in 4X4 matrix of float)
+0:457            'inFV0' (in 4-component vector of float)
+0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r6' (temp 4X4 matrix of float)
 0:457          matrix-scale (temp 4X4 matrix of float)
-0:457            'inFM0' (in 4X4 matrix of float)
 0:457            'inF0' (in float)
+0:457            'inFM0' (in 4X4 matrix of float)
 0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r7' (temp 4X4 matrix of float)
 0:457          matrix-scale (temp 4X4 matrix of float)
-0:457            'inF0' (in float)
 0:457            'inFM0' (in 4X4 matrix of float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r8' (temp 4X4 matrix of float)
 0:457          matrix-multiply (temp 4X4 matrix of float)
-0:457            'inFM0' (in 4X4 matrix of float)
 0:457            'inFM1' (in 4X4 matrix of float)
-0:485  Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf32;mf23;mf33;mf43;mf42; (global void)
+0:457            'inFM0' (in 4X4 matrix of float)
+0:466  Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; (global void)
 0:466    Function Parameters: 
 0:466      'inF0' (in float)
 0:466      'inF1' (in float)
 0:466      'inFV2' (in 2-component vector of float)
 0:466      'inFV3' (in 3-component vector of float)
-0:466      'inFM2x3' (in 3X2 matrix of float)
-0:466      'inFM3x2' (in 2X3 matrix of float)
+0:466      'inFM2x3' (in 2X3 matrix of float)
+0:466      'inFM3x2' (in 3X2 matrix of float)
 0:466      'inFM3x3' (in 3X3 matrix of float)
-0:466      'inFM3x4' (in 4X3 matrix of float)
-0:466      'inFM2x4' (in 4X2 matrix of float)
+0:466      'inFM3x4' (in 3X4 matrix of float)
+0:466      'inFM2x4' (in 2X4 matrix of float)
 0:?     Sequence
 0:467      Sequence
 0:467        move second child to first child (temp float)
 0:467          'r00' (temp float)
 0:467          component-wise multiply (temp float)
-0:467            'inF0' (in float)
 0:467            'inF1' (in float)
+0:467            'inF0' (in float)
 0:468      Sequence
 0:468        move second child to first child (temp 2-component vector of float)
 0:468          'r01' (temp 2-component vector of float)
 0:468          vector-scale (temp 2-component vector of float)
-0:468            'inFV2' (in 2-component vector of float)
 0:468            'inF0' (in float)
+0:468            'inFV2' (in 2-component vector of float)
 0:469      Sequence
 0:469        move second child to first child (temp 3-component vector of float)
 0:469          'r02' (temp 3-component vector of float)
 0:469          vector-scale (temp 3-component vector of float)
-0:469            'inFV3' (in 3-component vector of float)
 0:469            'inF0' (in float)
+0:469            'inFV3' (in 3-component vector of float)
 0:470      Sequence
 0:470        move second child to first child (temp 2-component vector of float)
 0:470          'r03' (temp 2-component vector of float)
 0:470          vector-scale (temp 2-component vector of float)
-0:470            'inF0' (in float)
 0:470            'inFV2' (in 2-component vector of float)
+0:470            'inF0' (in float)
 0:471      Sequence
 0:471        move second child to first child (temp 3-component vector of float)
 0:471          'r04' (temp 3-component vector of float)
 0:471          vector-scale (temp 3-component vector of float)
-0:471            'inF0' (in float)
 0:471            'inFV3' (in 3-component vector of float)
+0:471            'inF0' (in float)
 0:472      Sequence
 0:472        move second child to first child (temp float)
 0:472          'r05' (temp float)
@@ -2702,63 +2702,85 @@
 0:474      Sequence
 0:474        move second child to first child (temp 3-component vector of float)
 0:474          'r07' (temp 3-component vector of float)
-0:474          vector-times-matrix (temp 3-component vector of float)
+0:474          matrix-times-vector (temp 3-component vector of float)
+0:474            'inFM2x3' (in 2X3 matrix of float)
 0:474            'inFV2' (in 2-component vector of float)
-0:474            'inFM2x3' (in 3X2 matrix of float)
 0:475      Sequence
 0:475        move second child to first child (temp 2-component vector of float)
 0:475          'r08' (temp 2-component vector of float)
-0:475          vector-times-matrix (temp 2-component vector of float)
+0:475          matrix-times-vector (temp 2-component vector of float)
+0:475            'inFM3x2' (in 3X2 matrix of float)
 0:475            'inFV3' (in 3-component vector of float)
-0:475            'inFM3x2' (in 2X3 matrix of float)
 0:476      Sequence
 0:476        move second child to first child (temp 2-component vector of float)
 0:476          'r09' (temp 2-component vector of float)
-0:476          matrix-times-vector (temp 2-component vector of float)
-0:476            'inFM2x3' (in 3X2 matrix of float)
+0:476          vector-times-matrix (temp 2-component vector of float)
 0:476            'inFV3' (in 3-component vector of float)
+0:476            'inFM2x3' (in 2X3 matrix of float)
 0:477      Sequence
 0:477        move second child to first child (temp 3-component vector of float)
 0:477          'r10' (temp 3-component vector of float)
-0:477          matrix-times-vector (temp 3-component vector of float)
-0:477            'inFM3x2' (in 2X3 matrix of float)
+0:477          vector-times-matrix (temp 3-component vector of float)
 0:477            'inFV2' (in 2-component vector of float)
+0:477            'inFM3x2' (in 3X2 matrix of float)
 0:478      Sequence
-0:478        move second child to first child (temp 3X2 matrix of float)
-0:478          'r11' (temp 3X2 matrix of float)
-0:478          matrix-scale (temp 3X2 matrix of float)
-0:478            'inFM2x3' (in 3X2 matrix of float)
+0:478        move second child to first child (temp 2X3 matrix of float)
+0:478          'r11' (temp 2X3 matrix of float)
+0:478          matrix-scale (temp 2X3 matrix of float)
 0:478            'inF0' (in float)
+0:478            'inFM2x3' (in 2X3 matrix of float)
 0:479      Sequence
-0:479        move second child to first child (temp 2X3 matrix of float)
-0:479          'r12' (temp 2X3 matrix of float)
-0:479          matrix-scale (temp 2X3 matrix of float)
-0:479            'inFM3x2' (in 2X3 matrix of float)
+0:479        move second child to first child (temp 3X2 matrix of float)
+0:479          'r12' (temp 3X2 matrix of float)
+0:479          matrix-scale (temp 3X2 matrix of float)
 0:479            'inF0' (in float)
+0:479            'inFM3x2' (in 3X2 matrix of float)
 0:480      Sequence
 0:480        move second child to first child (temp 2X2 matrix of float)
 0:480          'r13' (temp 2X2 matrix of float)
 0:480          matrix-multiply (temp 2X2 matrix of float)
-0:480            'inFM2x3' (in 3X2 matrix of float)
-0:480            'inFM3x2' (in 2X3 matrix of float)
+0:480            'inFM3x2' (in 3X2 matrix of float)
+0:480            'inFM2x3' (in 2X3 matrix of float)
 0:481      Sequence
-0:481        move second child to first child (temp 3X2 matrix of float)
-0:481          'r14' (temp 3X2 matrix of float)
-0:481          matrix-multiply (temp 3X2 matrix of float)
-0:481            'inFM2x3' (in 3X2 matrix of float)
+0:481        move second child to first child (temp 2X3 matrix of float)
+0:481          'r14' (temp 2X3 matrix of float)
+0:481          matrix-multiply (temp 2X3 matrix of float)
 0:481            'inFM3x3' (in 3X3 matrix of float)
+0:481            'inFM2x3' (in 2X3 matrix of float)
 0:482      Sequence
-0:482        move second child to first child (temp 4X2 matrix of float)
-0:482          'r15' (temp 4X2 matrix of float)
-0:482          matrix-multiply (temp 4X2 matrix of float)
-0:482            'inFM2x3' (in 3X2 matrix of float)
-0:482            'inFM3x4' (in 4X3 matrix of float)
+0:482        move second child to first child (temp 2X4 matrix of float)
+0:482          'r15' (temp 2X4 matrix of float)
+0:482          matrix-multiply (temp 2X4 matrix of float)
+0:482            'inFM3x4' (in 3X4 matrix of float)
+0:482            'inFM2x3' (in 2X3 matrix of float)
 0:483      Sequence
-0:483        move second child to first child (temp 4X3 matrix of float)
-0:483          'r16' (temp 4X3 matrix of float)
-0:483          matrix-multiply (temp 4X3 matrix of float)
-0:483            'inFM3x2' (in 2X3 matrix of float)
-0:483            'inFM2x4' (in 4X2 matrix of float)
+0:483        move second child to first child (temp 3X4 matrix of float)
+0:483          'r16' (temp 3X4 matrix of float)
+0:483          matrix-multiply (temp 3X4 matrix of float)
+0:483            'inFM2x4' (in 2X4 matrix of float)
+0:483            'inFM3x2' (in 3X2 matrix of float)
+0:489  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:489    Function Parameters: 
+0:?     Sequence
+0:491      move second child to first child (temp 4-component vector of float)
+0:491        color: direct index for structure (temp 4-component vector of float)
+0:491          'ps_output' (temp structure{temp 4-component vector of float color})
+0:491          Constant:
+0:491            0 (const int)
+0:491        Constant:
+0:491          1.000000
+0:491          1.000000
+0:491          1.000000
+0:491          1.000000
+0:?       Sequence
+0:?         Sequence
+0:492          move second child to first child (temp 4-component vector of float)
+0:?             'color' (layout(location=0 ) out 4-component vector of float)
+0:492            color: direct index for structure (temp 4-component vector of float)
+0:492              'ps_output' (temp structure{temp 4-component vector of float color})
+0:492              Constant:
+0:492                0 (const int)
+0:492        Branch: Return
 0:?   Linker Objects
 0:?     'gs_ua' (global uint)
 0:?     'gs_ub' (global uint)
@@ -2772,6 +2794,7 @@
 0:?     'gs_ua4' (global 4-component vector of uint)
 0:?     'gs_ub4' (global 4-component vector of uint)
 0:?     'gs_uc4' (global 4-component vector of uint)
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 
 Linked fragment stage:
@@ -2780,7 +2803,7 @@
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:88  Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; (global float)
+0:17  Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;u1; (global float)
 0:17    Function Parameters: 
 0:17      'inF0' (in float)
 0:17      'inF1' (in float)
@@ -3117,7 +3140,7 @@
 0:85      Branch: Return with expression
 0:85        Constant:
 0:85          0.000000
-0:94  Function Definition: PixelShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
+0:89  Function Definition: PixelShaderFunction1(vf1;vf1;vf1; (global 1-component vector of float)
 0:89    Function Parameters: 
 0:89      'inF0' (in 1-component vector of float)
 0:89      'inF1' (in 1-component vector of float)
@@ -3126,7 +3149,7 @@
 0:91      Branch: Return with expression
 0:91        Constant:
 0:91          0.000000
-0:177  Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
+0:95  Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; (global 2-component vector of float)
 0:95    Function Parameters: 
 0:95      'inF0' (in 2-component vector of float)
 0:95      'inF1' (in 2-component vector of float)
@@ -3511,7 +3534,7 @@
 0:?         Constant:
 0:?           1.000000
 0:?           2.000000
-0:259  Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
+0:178  Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; (global 3-component vector of float)
 0:178    Function Parameters: 
 0:178      'inF0' (in 3-component vector of float)
 0:178      'inF1' (in 3-component vector of float)
@@ -3916,7 +3939,7 @@
 0:?           1.000000
 0:?           2.000000
 0:?           3.000000
-0:400  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
+0:260  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; (global 4-component vector of float)
 0:260    Function Parameters: 
 0:260      'inF0' (in 4-component vector of float)
 0:260      'inF1' (in 4-component vector of float)
@@ -4336,7 +4359,7 @@
 0:?           2.000000
 0:?           3.000000
 0:?           4.000000
-0:409  Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; (global 2X2 matrix of float)
+0:401  Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; (global 2X2 matrix of float)
 0:401    Function Parameters: 
 0:401      'inF0' (in 2X2 matrix of float)
 0:401      'inF1' (in 2X2 matrix of float)
@@ -4624,7 +4647,7 @@
 0:?           2.000000
 0:?           2.000000
 0:?           2.000000
-0:418  Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; (global 3X3 matrix of float)
+0:410  Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; (global 3X3 matrix of float)
 0:410    Function Parameters: 
 0:410      'inF0' (in 3X3 matrix of float)
 0:410      'inF1' (in 3X3 matrix of float)
@@ -4922,7 +4945,7 @@
 0:?           3.000000
 0:?           3.000000
 0:?           3.000000
-0:439  Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; (global 4X4 matrix of float)
+0:419  Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; (global 4X4 matrix of float)
 0:419    Function Parameters: 
 0:419      'inF0' (in 4X4 matrix of float)
 0:419      'inF1' (in 4X4 matrix of float)
@@ -5234,7 +5257,7 @@
 0:?           4.000000
 0:?           4.000000
 0:?           4.000000
-0:446  Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; (global void)
+0:442  Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; (global void)
 0:442    Function Parameters: 
 0:442      'inF0' (in float)
 0:442      'inF1' (in float)
@@ -5247,20 +5270,20 @@
 0:443        move second child to first child (temp float)
 0:443          'r0' (temp float)
 0:443          component-wise multiply (temp float)
-0:443            'inF0' (in float)
 0:443            'inF1' (in float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r1' (temp 2-component vector of float)
 0:443          vector-scale (temp 2-component vector of float)
-0:443            'inFV0' (in 2-component vector of float)
 0:443            'inF0' (in float)
+0:443            'inFV0' (in 2-component vector of float)
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r2' (temp 2-component vector of float)
 0:443          vector-scale (temp 2-component vector of float)
-0:443            'inF0' (in float)
 0:443            'inFV0' (in 2-component vector of float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp float)
 0:443          'r3' (temp float)
@@ -5270,34 +5293,34 @@
 0:443      Sequence
 0:443        move second child to first child (temp 2-component vector of float)
 0:443          'r4' (temp 2-component vector of float)
-0:443          matrix-times-vector (temp 2-component vector of float)
-0:443            'inFM0' (in 2X2 matrix of float)
-0:443            'inFV0' (in 2-component vector of float)
-0:443      Sequence
-0:443        move second child to first child (temp 2-component vector of float)
-0:443          'r5' (temp 2-component vector of float)
 0:443          vector-times-matrix (temp 2-component vector of float)
 0:443            'inFV0' (in 2-component vector of float)
 0:443            'inFM0' (in 2X2 matrix of float)
 0:443      Sequence
+0:443        move second child to first child (temp 2-component vector of float)
+0:443          'r5' (temp 2-component vector of float)
+0:443          matrix-times-vector (temp 2-component vector of float)
+0:443            'inFM0' (in 2X2 matrix of float)
+0:443            'inFV0' (in 2-component vector of float)
+0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r6' (temp 2X2 matrix of float)
 0:443          matrix-scale (temp 2X2 matrix of float)
-0:443            'inFM0' (in 2X2 matrix of float)
 0:443            'inF0' (in float)
+0:443            'inFM0' (in 2X2 matrix of float)
 0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r7' (temp 2X2 matrix of float)
 0:443          matrix-scale (temp 2X2 matrix of float)
-0:443            'inF0' (in float)
 0:443            'inFM0' (in 2X2 matrix of float)
+0:443            'inF0' (in float)
 0:443      Sequence
 0:443        move second child to first child (temp 2X2 matrix of float)
 0:443          'r8' (temp 2X2 matrix of float)
 0:443          matrix-multiply (temp 2X2 matrix of float)
-0:443            'inFM0' (in 2X2 matrix of float)
 0:443            'inFM1' (in 2X2 matrix of float)
-0:453  Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; (global void)
+0:443            'inFM0' (in 2X2 matrix of float)
+0:449  Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; (global void)
 0:449    Function Parameters: 
 0:449      'inF0' (in float)
 0:449      'inF1' (in float)
@@ -5310,20 +5333,20 @@
 0:450        move second child to first child (temp float)
 0:450          'r0' (temp float)
 0:450          component-wise multiply (temp float)
-0:450            'inF0' (in float)
 0:450            'inF1' (in float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r1' (temp 3-component vector of float)
 0:450          vector-scale (temp 3-component vector of float)
-0:450            'inFV0' (in 3-component vector of float)
 0:450            'inF0' (in float)
+0:450            'inFV0' (in 3-component vector of float)
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r2' (temp 3-component vector of float)
 0:450          vector-scale (temp 3-component vector of float)
-0:450            'inF0' (in float)
 0:450            'inFV0' (in 3-component vector of float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp float)
 0:450          'r3' (temp float)
@@ -5333,34 +5356,34 @@
 0:450      Sequence
 0:450        move second child to first child (temp 3-component vector of float)
 0:450          'r4' (temp 3-component vector of float)
-0:450          matrix-times-vector (temp 3-component vector of float)
-0:450            'inFM0' (in 3X3 matrix of float)
-0:450            'inFV0' (in 3-component vector of float)
-0:450      Sequence
-0:450        move second child to first child (temp 3-component vector of float)
-0:450          'r5' (temp 3-component vector of float)
 0:450          vector-times-matrix (temp 3-component vector of float)
 0:450            'inFV0' (in 3-component vector of float)
 0:450            'inFM0' (in 3X3 matrix of float)
 0:450      Sequence
+0:450        move second child to first child (temp 3-component vector of float)
+0:450          'r5' (temp 3-component vector of float)
+0:450          matrix-times-vector (temp 3-component vector of float)
+0:450            'inFM0' (in 3X3 matrix of float)
+0:450            'inFV0' (in 3-component vector of float)
+0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r6' (temp 3X3 matrix of float)
 0:450          matrix-scale (temp 3X3 matrix of float)
-0:450            'inFM0' (in 3X3 matrix of float)
 0:450            'inF0' (in float)
+0:450            'inFM0' (in 3X3 matrix of float)
 0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r7' (temp 3X3 matrix of float)
 0:450          matrix-scale (temp 3X3 matrix of float)
-0:450            'inF0' (in float)
 0:450            'inFM0' (in 3X3 matrix of float)
+0:450            'inF0' (in float)
 0:450      Sequence
 0:450        move second child to first child (temp 3X3 matrix of float)
 0:450          'r8' (temp 3X3 matrix of float)
 0:450          matrix-multiply (temp 3X3 matrix of float)
-0:450            'inFM0' (in 3X3 matrix of float)
 0:450            'inFM1' (in 3X3 matrix of float)
-0:461  Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; (global void)
+0:450            'inFM0' (in 3X3 matrix of float)
+0:456  Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; (global void)
 0:456    Function Parameters: 
 0:456      'inF0' (in float)
 0:456      'inF1' (in float)
@@ -5373,20 +5396,20 @@
 0:457        move second child to first child (temp float)
 0:457          'r0' (temp float)
 0:457          component-wise multiply (temp float)
-0:457            'inF0' (in float)
 0:457            'inF1' (in float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r1' (temp 4-component vector of float)
 0:457          vector-scale (temp 4-component vector of float)
-0:457            'inFV0' (in 4-component vector of float)
 0:457            'inF0' (in float)
+0:457            'inFV0' (in 4-component vector of float)
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r2' (temp 4-component vector of float)
 0:457          vector-scale (temp 4-component vector of float)
-0:457            'inF0' (in float)
 0:457            'inFV0' (in 4-component vector of float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp float)
 0:457          'r3' (temp float)
@@ -5396,75 +5419,75 @@
 0:457      Sequence
 0:457        move second child to first child (temp 4-component vector of float)
 0:457          'r4' (temp 4-component vector of float)
-0:457          matrix-times-vector (temp 4-component vector of float)
-0:457            'inFM0' (in 4X4 matrix of float)
-0:457            'inFV0' (in 4-component vector of float)
-0:457      Sequence
-0:457        move second child to first child (temp 4-component vector of float)
-0:457          'r5' (temp 4-component vector of float)
 0:457          vector-times-matrix (temp 4-component vector of float)
 0:457            'inFV0' (in 4-component vector of float)
 0:457            'inFM0' (in 4X4 matrix of float)
 0:457      Sequence
+0:457        move second child to first child (temp 4-component vector of float)
+0:457          'r5' (temp 4-component vector of float)
+0:457          matrix-times-vector (temp 4-component vector of float)
+0:457            'inFM0' (in 4X4 matrix of float)
+0:457            'inFV0' (in 4-component vector of float)
+0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r6' (temp 4X4 matrix of float)
 0:457          matrix-scale (temp 4X4 matrix of float)
-0:457            'inFM0' (in 4X4 matrix of float)
 0:457            'inF0' (in float)
+0:457            'inFM0' (in 4X4 matrix of float)
 0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r7' (temp 4X4 matrix of float)
 0:457          matrix-scale (temp 4X4 matrix of float)
-0:457            'inF0' (in float)
 0:457            'inFM0' (in 4X4 matrix of float)
+0:457            'inF0' (in float)
 0:457      Sequence
 0:457        move second child to first child (temp 4X4 matrix of float)
 0:457          'r8' (temp 4X4 matrix of float)
 0:457          matrix-multiply (temp 4X4 matrix of float)
-0:457            'inFM0' (in 4X4 matrix of float)
 0:457            'inFM1' (in 4X4 matrix of float)
-0:485  Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf32;mf23;mf33;mf43;mf42; (global void)
+0:457            'inFM0' (in 4X4 matrix of float)
+0:466  Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; (global void)
 0:466    Function Parameters: 
 0:466      'inF0' (in float)
 0:466      'inF1' (in float)
 0:466      'inFV2' (in 2-component vector of float)
 0:466      'inFV3' (in 3-component vector of float)
-0:466      'inFM2x3' (in 3X2 matrix of float)
-0:466      'inFM3x2' (in 2X3 matrix of float)
+0:466      'inFM2x3' (in 2X3 matrix of float)
+0:466      'inFM3x2' (in 3X2 matrix of float)
 0:466      'inFM3x3' (in 3X3 matrix of float)
-0:466      'inFM3x4' (in 4X3 matrix of float)
-0:466      'inFM2x4' (in 4X2 matrix of float)
+0:466      'inFM3x4' (in 3X4 matrix of float)
+0:466      'inFM2x4' (in 2X4 matrix of float)
 0:?     Sequence
 0:467      Sequence
 0:467        move second child to first child (temp float)
 0:467          'r00' (temp float)
 0:467          component-wise multiply (temp float)
-0:467            'inF0' (in float)
 0:467            'inF1' (in float)
+0:467            'inF0' (in float)
 0:468      Sequence
 0:468        move second child to first child (temp 2-component vector of float)
 0:468          'r01' (temp 2-component vector of float)
 0:468          vector-scale (temp 2-component vector of float)
-0:468            'inFV2' (in 2-component vector of float)
 0:468            'inF0' (in float)
+0:468            'inFV2' (in 2-component vector of float)
 0:469      Sequence
 0:469        move second child to first child (temp 3-component vector of float)
 0:469          'r02' (temp 3-component vector of float)
 0:469          vector-scale (temp 3-component vector of float)
-0:469            'inFV3' (in 3-component vector of float)
 0:469            'inF0' (in float)
+0:469            'inFV3' (in 3-component vector of float)
 0:470      Sequence
 0:470        move second child to first child (temp 2-component vector of float)
 0:470          'r03' (temp 2-component vector of float)
 0:470          vector-scale (temp 2-component vector of float)
-0:470            'inF0' (in float)
 0:470            'inFV2' (in 2-component vector of float)
+0:470            'inF0' (in float)
 0:471      Sequence
 0:471        move second child to first child (temp 3-component vector of float)
 0:471          'r04' (temp 3-component vector of float)
 0:471          vector-scale (temp 3-component vector of float)
-0:471            'inF0' (in float)
 0:471            'inFV3' (in 3-component vector of float)
+0:471            'inF0' (in float)
 0:472      Sequence
 0:472        move second child to first child (temp float)
 0:472          'r05' (temp float)
@@ -5480,63 +5503,85 @@
 0:474      Sequence
 0:474        move second child to first child (temp 3-component vector of float)
 0:474          'r07' (temp 3-component vector of float)
-0:474          vector-times-matrix (temp 3-component vector of float)
+0:474          matrix-times-vector (temp 3-component vector of float)
+0:474            'inFM2x3' (in 2X3 matrix of float)
 0:474            'inFV2' (in 2-component vector of float)
-0:474            'inFM2x3' (in 3X2 matrix of float)
 0:475      Sequence
 0:475        move second child to first child (temp 2-component vector of float)
 0:475          'r08' (temp 2-component vector of float)
-0:475          vector-times-matrix (temp 2-component vector of float)
+0:475          matrix-times-vector (temp 2-component vector of float)
+0:475            'inFM3x2' (in 3X2 matrix of float)
 0:475            'inFV3' (in 3-component vector of float)
-0:475            'inFM3x2' (in 2X3 matrix of float)
 0:476      Sequence
 0:476        move second child to first child (temp 2-component vector of float)
 0:476          'r09' (temp 2-component vector of float)
-0:476          matrix-times-vector (temp 2-component vector of float)
-0:476            'inFM2x3' (in 3X2 matrix of float)
+0:476          vector-times-matrix (temp 2-component vector of float)
 0:476            'inFV3' (in 3-component vector of float)
+0:476            'inFM2x3' (in 2X3 matrix of float)
 0:477      Sequence
 0:477        move second child to first child (temp 3-component vector of float)
 0:477          'r10' (temp 3-component vector of float)
-0:477          matrix-times-vector (temp 3-component vector of float)
-0:477            'inFM3x2' (in 2X3 matrix of float)
+0:477          vector-times-matrix (temp 3-component vector of float)
 0:477            'inFV2' (in 2-component vector of float)
+0:477            'inFM3x2' (in 3X2 matrix of float)
 0:478      Sequence
-0:478        move second child to first child (temp 3X2 matrix of float)
-0:478          'r11' (temp 3X2 matrix of float)
-0:478          matrix-scale (temp 3X2 matrix of float)
-0:478            'inFM2x3' (in 3X2 matrix of float)
+0:478        move second child to first child (temp 2X3 matrix of float)
+0:478          'r11' (temp 2X3 matrix of float)
+0:478          matrix-scale (temp 2X3 matrix of float)
 0:478            'inF0' (in float)
+0:478            'inFM2x3' (in 2X3 matrix of float)
 0:479      Sequence
-0:479        move second child to first child (temp 2X3 matrix of float)
-0:479          'r12' (temp 2X3 matrix of float)
-0:479          matrix-scale (temp 2X3 matrix of float)
-0:479            'inFM3x2' (in 2X3 matrix of float)
+0:479        move second child to first child (temp 3X2 matrix of float)
+0:479          'r12' (temp 3X2 matrix of float)
+0:479          matrix-scale (temp 3X2 matrix of float)
 0:479            'inF0' (in float)
+0:479            'inFM3x2' (in 3X2 matrix of float)
 0:480      Sequence
 0:480        move second child to first child (temp 2X2 matrix of float)
 0:480          'r13' (temp 2X2 matrix of float)
 0:480          matrix-multiply (temp 2X2 matrix of float)
-0:480            'inFM2x3' (in 3X2 matrix of float)
-0:480            'inFM3x2' (in 2X3 matrix of float)
+0:480            'inFM3x2' (in 3X2 matrix of float)
+0:480            'inFM2x3' (in 2X3 matrix of float)
 0:481      Sequence
-0:481        move second child to first child (temp 3X2 matrix of float)
-0:481          'r14' (temp 3X2 matrix of float)
-0:481          matrix-multiply (temp 3X2 matrix of float)
-0:481            'inFM2x3' (in 3X2 matrix of float)
+0:481        move second child to first child (temp 2X3 matrix of float)
+0:481          'r14' (temp 2X3 matrix of float)
+0:481          matrix-multiply (temp 2X3 matrix of float)
 0:481            'inFM3x3' (in 3X3 matrix of float)
+0:481            'inFM2x3' (in 2X3 matrix of float)
 0:482      Sequence
-0:482        move second child to first child (temp 4X2 matrix of float)
-0:482          'r15' (temp 4X2 matrix of float)
-0:482          matrix-multiply (temp 4X2 matrix of float)
-0:482            'inFM2x3' (in 3X2 matrix of float)
-0:482            'inFM3x4' (in 4X3 matrix of float)
+0:482        move second child to first child (temp 2X4 matrix of float)
+0:482          'r15' (temp 2X4 matrix of float)
+0:482          matrix-multiply (temp 2X4 matrix of float)
+0:482            'inFM3x4' (in 3X4 matrix of float)
+0:482            'inFM2x3' (in 2X3 matrix of float)
 0:483      Sequence
-0:483        move second child to first child (temp 4X3 matrix of float)
-0:483          'r16' (temp 4X3 matrix of float)
-0:483          matrix-multiply (temp 4X3 matrix of float)
-0:483            'inFM3x2' (in 2X3 matrix of float)
-0:483            'inFM2x4' (in 4X2 matrix of float)
+0:483        move second child to first child (temp 3X4 matrix of float)
+0:483          'r16' (temp 3X4 matrix of float)
+0:483          matrix-multiply (temp 3X4 matrix of float)
+0:483            'inFM2x4' (in 2X4 matrix of float)
+0:483            'inFM3x2' (in 3X2 matrix of float)
+0:489  Function Definition: main( (global structure{temp 4-component vector of float color})
+0:489    Function Parameters: 
+0:?     Sequence
+0:491      move second child to first child (temp 4-component vector of float)
+0:491        color: direct index for structure (temp 4-component vector of float)
+0:491          'ps_output' (temp structure{temp 4-component vector of float color})
+0:491          Constant:
+0:491            0 (const int)
+0:491        Constant:
+0:491          1.000000
+0:491          1.000000
+0:491          1.000000
+0:491          1.000000
+0:?       Sequence
+0:?         Sequence
+0:492          move second child to first child (temp 4-component vector of float)
+0:?             'color' (layout(location=0 ) out 4-component vector of float)
+0:492            color: direct index for structure (temp 4-component vector of float)
+0:492              'ps_output' (temp structure{temp 4-component vector of float color})
+0:492              Constant:
+0:492                0 (const int)
+0:492        Branch: Return
 0:?   Linker Objects
 0:?     'gs_ua' (global uint)
 0:?     'gs_ub' (global uint)
@@ -5550,19 +5595,19 @@
 0:?     'gs_ua4' (global 4-component vector of uint)
 0:?     'gs_ub4' (global 4-component vector of uint)
 0:?     'gs_uc4' (global 4-component vector of uint)
+0:?     'color' (layout(location=0 ) out 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 1812
+// Id's are bound by 1825
 
                               Capability Shader
                               Capability DerivativeControl
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 810 837 845 854
+                              EntryPoint Fragment 4  "main" 1805
                               ExecutionMode 4 OriginUpperLeft
-                              Source HLSL 450
-                              Name 4  "PixelShaderFunction"
+                              Name 4  "main"
                               Name 16  "PixelShaderFunctionS(f1;f1;f1;u1;u1;"
                               Name 11  "inF0"
                               Name 12  "inF1"
@@ -5585,502 +5630,509 @@
                               Name 43  "inF2"
                               Name 44  "inU0"
                               Name 45  "inU1"
-                              Name 54  "PixelShaderFunction2x2(mf22;mf22;mf22;"
-                              Name 51  "inF0"
-                              Name 52  "inF1"
-                              Name 53  "inF2"
-                              Name 62  "PixelShaderFunction3x3(mf33;mf33;mf33;"
-                              Name 59  "inF0"
-                              Name 60  "inF1"
-                              Name 61  "inF2"
-                              Name 71  "PixelShaderFunction4x4(mf44;mf44;mf44;"
-                              Name 68  "inF0"
-                              Name 69  "inF1"
-                              Name 70  "inF2"
-                              Name 80  "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;"
-                              Name 74  "inF0"
-                              Name 75  "inF1"
-                              Name 76  "inFV0"
-                              Name 77  "inFV1"
-                              Name 78  "inFM0"
-                              Name 79  "inFM1"
-                              Name 89  "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;"
-                              Name 83  "inF0"
-                              Name 84  "inF1"
-                              Name 85  "inFV0"
-                              Name 86  "inFV1"
-                              Name 87  "inFM0"
-                              Name 88  "inFM1"
-                              Name 99  "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;"
-                              Name 93  "inF0"
-                              Name 94  "inF1"
-                              Name 95  "inFV0"
-                              Name 96  "inFV1"
-                              Name 97  "inFM0"
-                              Name 98  "inFM1"
-                              Name 119  "TestGenMulNxM(f1;f1;vf2;vf3;mf32;mf23;mf33;mf43;mf42;"
-                              Name 110  "inF0"
-                              Name 111  "inF1"
-                              Name 112  "inFV2"
-                              Name 113  "inFV3"
-                              Name 114  "inFM2x3"
-                              Name 115  "inFM3x2"
-                              Name 116  "inFM3x3"
-                              Name 117  "inFM3x4"
-                              Name 118  "inFM2x4"
-                              Name 123  "r000"
-                              Name 126  "r001"
-                              Name 129  "r002"
-                              Name 132  "r003"
-                              Name 135  "r004"
-                              Name 140  "r005"
-                              Name 143  "r006"
-                              Name 146  "r007"
-                              Name 149  "r009"
-                              Name 152  "r010"
-                              Name 156  "r011"
-                              Name 159  "r012"
-                              Name 170  "r014"
-                              Name 173  "r015"
-                              Name 176  "r016"
-                              Name 179  "r017"
-                              Name 182  "r018"
-                              Name 185  "r019"
-                              Name 188  "r020"
-                              Name 191  "r021"
-                              Name 194  "r022"
-                              Name 197  "r023"
-                              Name 200  "r027"
-                              Name 203  "r028"
-                              Name 206  "r029"
-                              Name 210  "r030"
-                              Name 213  "r031"
-                              Name 216  "r033"
-                              Name 220  "r034"
-                              Name 223  "r035"
-                              Name 225  "ResType"
-                              Name 229  "r036"
-                              Name 232  "r037"
-                              Name 235  "r038"
-                              Name 238  "r039"
-                              Name 242  "r039a"
-                              Name 247  "r040"
-                              Name 250  "r041"
-                              Name 255  "r042"
-                              Name 258  "r043"
-                              Name 262  "r044"
-                              Name 266  "r045"
-                              Name 270  "r046"
-                              Name 273  "r047"
-                              Name 277  "r048"
-                              Name 280  "r049"
-                              Name 283  "r050"
-                              Name 286  "r051"
-                              Name 289  "r052"
-                              Name 292  "r053"
-                              Name 299  "r055"
-                              Name 302  "r056"
-                              Name 307  "r057"
-                              Name 310  "r058"
-                              Name 314  "r059"
-                              Name 317  "r060"
-                              Name 320  "r061"
-                              Name 327  "r000"
-                              Name 330  "r001"
-                              Name 333  "r002"
-                              Name 336  "r003"
-                              Name 339  "r004"
-                              Name 344  "r005"
-                              Name 347  "r006"
-                              Name 350  "r007"
-                              Name 353  "r009"
-                              Name 356  "r010"
-                              Name 360  "r011"
-                              Name 363  "r012"
-                              Name 376  "r013"
-                              Name 379  "r015"
-                              Name 382  "r016"
-                              Name 386  "r017"
-                              Name 389  "r018"
-                              Name 392  "r019"
-                              Name 395  "r020"
-                              Name 398  "r021"
-                              Name 401  "r022"
-                              Name 404  "r023"
-                              Name 407  "r026"
-                              Name 411  "r027"
-                              Name 415  "r028"
-                              Name 418  "r029"
-                              Name 421  "r030"
-                              Name 426  "r031"
-                              Name 430  "r032"
-                              Name 432  "r033"
-                              Name 435  "r035"
-                              Name 439  "r036"
-                              Name 442  "r037"
-                              Name 444  "ResType"
-                              Name 448  "r038"
-                              Name 452  "r039"
-                              Name 455  "r040"
-                              Name 458  "r041"
-                              Name 462  "r039a"
-                              Name 467  "r042"
-                              Name 470  "r043"
-                              Name 473  "r044"
-                              Name 477  "r045"
-                              Name 480  "r046"
-                              Name 484  "r047"
-                              Name 488  "r048"
-                              Name 491  "r049"
-                              Name 495  "r050"
-                              Name 498  "r051"
-                              Name 502  "r052"
-                              Name 506  "r053"
-                              Name 511  "r054"
-                              Name 515  "r055"
-                              Name 518  "r056"
-                              Name 521  "r057"
-                              Name 526  "r058"
-                              Name 529  "r059"
-                              Name 536  "r060"
-                              Name 539  "r061"
-                              Name 544  "r062"
-                              Name 547  "r063"
-                              Name 551  "r064"
-                              Name 554  "r065"
-                              Name 557  "r066"
-                              Name 563  "r000"
-                              Name 566  "r001"
-                              Name 569  "r002"
-                              Name 572  "r003"
-                              Name 575  "r004"
-                              Name 580  "r005"
-                              Name 583  "r006"
-                              Name 586  "r007"
-                              Name 589  "r009"
-                              Name 592  "r010"
-                              Name 596  "r011"
-                              Name 599  "r012"
-                              Name 612  "r013"
-                              Name 615  "r014"
-                              Name 618  "r015"
-                              Name 622  "r016"
-                              Name 626  "r017"
-                              Name 629  "r018"
-                              Name 632  "r019"
-                              Name 635  "r020"
-                              Name 638  "r021"
-                              Name 641  "r022"
-                              Name 644  "r023"
-                              Name 647  "r024"
-                              Name 651  "r025"
-                              Name 655  "r029"
-                              Name 658  "r030"
-                              Name 661  "r031"
-                              Name 666  "r032"
-                              Name 670  "r033"
-                              Name 672  "r034"
-                              Name 675  "r036"
-                              Name 679  "r037"
-                              Name 682  "r038"
-                              Name 684  "ResType"
-                              Name 688  "r039"
-                              Name 692  "r040"
-                              Name 695  "r041"
-                              Name 698  "r042"
-                              Name 702  "r039a"
-                              Name 707  "r039b"
-                              Name 713  "r043"
-                              Name 716  "r044"
-                              Name 719  "r045"
-                              Name 723  "r046"
-                              Name 726  "r047"
-                              Name 730  "r048"
-                              Name 734  "r049"
-                              Name 737  "r050"
-                              Name 741  "r051"
-                              Name 744  "r052"
-                              Name 748  "r053"
-                              Name 752  "r054"
-                              Name 756  "r055"
-                              Name 759  "r056"
-                              Name 762  "r057"
-                              Name 765  "r058"
-                              Name 770  "r059"
-                              Name 773  "r060"
-                              Name 780  "r061"
-                              Name 783  "r062"
-                              Name 788  "r063"
-                              Name 791  "r064"
-                              Name 795  "r065"
-                              Name 798  "r066"
-                              Name 801  "r067"
-                              Name 808  "r000"
-                              Name 810  "inF0"
-                              Name 813  "r001"
-                              Name 816  "r002"
-                              Name 819  "r003"
-                              Name 822  "r004"
-                              Name 827  "r005"
-                              Name 832  "r006"
-                              Name 835  "r007"
-                              Name 837  "inU0"
-                              Name 840  "r009"
-                              Name 843  "r010"
-                              Name 845  "inF1"
-                              Name 848  "r011"
-                              Name 851  "r012"
-                              Name 854  "inF2"
-                              Name 865  "r013"
-                              Name 868  "r014"
-                              Name 871  "r015"
-                              Name 874  "r016"
-                              Name 877  "r017"
-                              Name 880  "r018"
-                              Name 883  "r019"
-                              Name 886  "r020"
-                              Name 889  "r021"
-                              Name 892  "r022"
-                              Name 895  "r023"
-                              Name 899  "r024"
-                              Name 903  "r025"
-                              Name 915  "r029"
-                              Name 918  "r030"
-                              Name 921  "r031"
-                              Name 926  "r032"
-                              Name 931  "r033"
-                              Name 933  "r034"
-                              Name 936  "r036"
-                              Name 940  "r037"
-                              Name 943  "r038"
-                              Name 945  "ResType"
-                              Name 949  "r039"
-                              Name 953  "r040"
-                              Name 956  "r041"
-                              Name 959  "r042"
-                              Name 963  "r039a"
-                              Name 968  "r043"
-                              Name 971  "r044"
-                              Name 974  "r045"
-                              Name 978  "r046"
-                              Name 981  "r047"
-                              Name 985  "r048"
-                              Name 989  "r049"
-                              Name 992  "r050"
-                              Name 996  "r051"
-                              Name 999  "r052"
-                              Name 1003  "r053"
-                              Name 1007  "r054"
-                              Name 1011  "r055"
-                              Name 1014  "r056"
-                              Name 1017  "r057"
-                              Name 1020  "r058"
-                              Name 1025  "r059"
-                              Name 1028  "r060"
-                              Name 1035  "r061"
-                              Name 1038  "r062"
-                              Name 1043  "r063"
-                              Name 1046  "r064"
-                              Name 1050  "r065"
-                              Name 1053  "r066"
-                              Name 1056  "r067"
-                              Name 1062  "r000"
-                              Name 1065  "r001"
-                              Name 1070  "r003"
-                              Name 1073  "r004"
-                              Name 1076  "r005"
-                              Name 1079  "r006"
-                              Name 1083  "r007"
-                              Name 1094  "r008"
-                              Name 1099  "r009"
-                              Name 1102  "r010"
-                              Name 1105  "r011"
-                              Name 1108  "r012"
-                              Name 1111  "r013"
-                              Name 1114  "r014"
-                              Name 1117  "r015"
-                              Name 1120  "r016"
-                              Name 1123  "r017"
-                              Name 1126  "r018"
-                              Name 1129  "r019"
-                              Name 1132  "R020"
-                              Name 1135  "r021"
-                              Name 1138  "r022"
-                              Name 1148  "r023"
-                              Name 1151  "r024"
-                              Name 1153  "ResType"
-                              Name 1157  "r025"
-                              Name 1160  "r026"
-                              Name 1164  "r026a"
-                              Name 1169  "r027"
-                              Name 1172  "r028"
-                              Name 1176  "r029"
-                              Name 1179  "r030"
-                              Name 1183  "r031"
-                              Name 1187  "r032"
-                              Name 1191  "r033"
-                              Name 1194  "r034"
-                              Name 1197  "r035"
-                              Name 1200  "r036"
-                              Name 1205  "r037"
-                              Name 1208  "r038"
-                              Name 1215  "r039"
-                              Name 1218  "r049"
-                              Name 1223  "r041"
-                              Name 1226  "r042"
-                              Name 1230  "r043"
-                              Name 1233  "r044"
-                              Name 1238  "r046"
-                              Name 1245  "r000"
-                              Name 1248  "r001"
-                              Name 1253  "r003"
-                              Name 1256  "r004"
-                              Name 1259  "r005"
-                              Name 1262  "r006"
-                              Name 1266  "r007"
-                              Name 1277  "r008"
-                              Name 1282  "r009"
-                              Name 1285  "r010"
-                              Name 1288  "r011"
-                              Name 1291  "r012"
-                              Name 1294  "r013"
-                              Name 1297  "r014"
-                              Name 1300  "r015"
-                              Name 1303  "r016"
-                              Name 1306  "r017"
-                              Name 1309  "r018"
-                              Name 1312  "r019"
-                              Name 1315  "R020"
-                              Name 1318  "r021"
-                              Name 1321  "r022"
-                              Name 1334  "r023"
-                              Name 1337  "r024"
-                              Name 1339  "ResType"
-                              Name 1343  "r025"
-                              Name 1346  "r026"
-                              Name 1350  "r026a"
-                              Name 1355  "r027"
-                              Name 1358  "r028"
-                              Name 1362  "r029"
-                              Name 1365  "r030"
-                              Name 1369  "r031"
-                              Name 1373  "r032"
-                              Name 1377  "r033"
-                              Name 1380  "r034"
-                              Name 1383  "r035"
-                              Name 1386  "r036"
-                              Name 1391  "r037"
-                              Name 1394  "r038"
-                              Name 1401  "r039"
-                              Name 1404  "r049"
-                              Name 1409  "r041"
-                              Name 1412  "r042"
-                              Name 1416  "r043"
-                              Name 1419  "r044"
-                              Name 1424  "r046"
-                              Name 1431  "r000"
-                              Name 1434  "r001"
-                              Name 1439  "r003"
-                              Name 1442  "r004"
-                              Name 1445  "r005"
-                              Name 1448  "r006"
-                              Name 1452  "r007"
-                              Name 1463  "r008"
-                              Name 1468  "r009"
-                              Name 1471  "r010"
-                              Name 1474  "r011"
-                              Name 1477  "r012"
-                              Name 1480  "r013"
-                              Name 1483  "r014"
-                              Name 1486  "r015"
-                              Name 1489  "r016"
-                              Name 1492  "r017"
-                              Name 1495  "r018"
-                              Name 1498  "r019"
-                              Name 1501  "R020"
-                              Name 1504  "r021"
-                              Name 1507  "r022"
-                              Name 1523  "r023"
-                              Name 1526  "r024"
-                              Name 1528  "ResType"
-                              Name 1532  "r025"
-                              Name 1535  "r026"
-                              Name 1539  "r026a"
-                              Name 1544  "r027"
-                              Name 1547  "r028"
-                              Name 1551  "r029"
-                              Name 1554  "r030"
-                              Name 1558  "r031"
-                              Name 1562  "r032"
-                              Name 1566  "r033"
-                              Name 1569  "r034"
-                              Name 1572  "r035"
-                              Name 1575  "r036"
-                              Name 1580  "r037"
-                              Name 1583  "r038"
-                              Name 1590  "r039"
-                              Name 1593  "r049"
-                              Name 1598  "r041"
-                              Name 1601  "r042"
-                              Name 1605  "r043"
-                              Name 1608  "r044"
-                              Name 1613  "r046"
-                              Name 1620  "r0"
-                              Name 1624  "r1"
-                              Name 1628  "r2"
-                              Name 1632  "r3"
-                              Name 1636  "r4"
-                              Name 1640  "r5"
-                              Name 1644  "r6"
-                              Name 1648  "r7"
-                              Name 1652  "r8"
-                              Name 1656  "r0"
-                              Name 1660  "r1"
-                              Name 1664  "r2"
-                              Name 1668  "r3"
-                              Name 1672  "r4"
-                              Name 1676  "r5"
-                              Name 1680  "r6"
-                              Name 1684  "r7"
-                              Name 1688  "r8"
-                              Name 1692  "r0"
-                              Name 1696  "r1"
-                              Name 1700  "r2"
-                              Name 1704  "r3"
-                              Name 1708  "r4"
-                              Name 1712  "r5"
-                              Name 1716  "r6"
-                              Name 1720  "r7"
-                              Name 1724  "r8"
-                              Name 1728  "r00"
-                              Name 1732  "r01"
-                              Name 1736  "r02"
-                              Name 1740  "r03"
-                              Name 1744  "r04"
-                              Name 1748  "r05"
-                              Name 1752  "r06"
-                              Name 1756  "r07"
-                              Name 1760  "r08"
-                              Name 1764  "r09"
-                              Name 1768  "r10"
-                              Name 1772  "r11"
-                              Name 1776  "r12"
-                              Name 1780  "r13"
-                              Name 1784  "r14"
-                              Name 1788  "r15"
-                              Name 1792  "r16"
-                              Name 1797  "gs_ua"
-                              Name 1798  "gs_ub"
-                              Name 1799  "gs_uc"
-                              Name 1801  "gs_ua2"
-                              Name 1802  "gs_ub2"
-                              Name 1803  "gs_uc2"
-                              Name 1805  "gs_ua3"
-                              Name 1806  "gs_ub3"
-                              Name 1807  "gs_uc3"
-                              Name 1809  "gs_ua4"
-                              Name 1810  "gs_ub4"
-                              Name 1811  "gs_uc4"
+                              Name 58  "PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;"
+                              Name 53  "inF0"
+                              Name 54  "inF1"
+                              Name 55  "inF2"
+                              Name 56  "inU0"
+                              Name 57  "inU1"
+                              Name 66  "PixelShaderFunction2x2(mf22;mf22;mf22;"
+                              Name 63  "inF0"
+                              Name 64  "inF1"
+                              Name 65  "inF2"
+                              Name 74  "PixelShaderFunction3x3(mf33;mf33;mf33;"
+                              Name 71  "inF0"
+                              Name 72  "inF1"
+                              Name 73  "inF2"
+                              Name 82  "PixelShaderFunction4x4(mf44;mf44;mf44;"
+                              Name 79  "inF0"
+                              Name 80  "inF1"
+                              Name 81  "inF2"
+                              Name 91  "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;"
+                              Name 85  "inF0"
+                              Name 86  "inF1"
+                              Name 87  "inFV0"
+                              Name 88  "inFV1"
+                              Name 89  "inFM0"
+                              Name 90  "inFM1"
+                              Name 100  "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;"
+                              Name 94  "inF0"
+                              Name 95  "inF1"
+                              Name 96  "inFV0"
+                              Name 97  "inFV1"
+                              Name 98  "inFM0"
+                              Name 99  "inFM1"
+                              Name 109  "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;"
+                              Name 103  "inF0"
+                              Name 104  "inF1"
+                              Name 105  "inFV0"
+                              Name 106  "inFV1"
+                              Name 107  "inFM0"
+                              Name 108  "inFM1"
+                              Name 129  "TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;"
+                              Name 120  "inF0"
+                              Name 121  "inF1"
+                              Name 122  "inFV2"
+                              Name 123  "inFV3"
+                              Name 124  "inFM2x3"
+                              Name 125  "inFM3x2"
+                              Name 126  "inFM3x3"
+                              Name 127  "inFM3x4"
+                              Name 128  "inFM2x4"
+                              Name 133  "r000"
+                              Name 136  "r001"
+                              Name 139  "r002"
+                              Name 142  "r003"
+                              Name 145  "r004"
+                              Name 150  "r005"
+                              Name 153  "r006"
+                              Name 156  "r007"
+                              Name 159  "r009"
+                              Name 162  "r010"
+                              Name 166  "r011"
+                              Name 169  "r012"
+                              Name 180  "r014"
+                              Name 183  "r015"
+                              Name 186  "r016"
+                              Name 189  "r017"
+                              Name 192  "r018"
+                              Name 195  "r019"
+                              Name 198  "r020"
+                              Name 201  "r021"
+                              Name 204  "r022"
+                              Name 207  "r023"
+                              Name 210  "r027"
+                              Name 213  "r028"
+                              Name 216  "r029"
+                              Name 220  "r030"
+                              Name 223  "r031"
+                              Name 226  "r033"
+                              Name 230  "r034"
+                              Name 233  "r035"
+                              Name 235  "ResType"
+                              Name 239  "r036"
+                              Name 242  "r037"
+                              Name 245  "r038"
+                              Name 248  "r039"
+                              Name 252  "r039a"
+                              Name 257  "r040"
+                              Name 260  "r041"
+                              Name 265  "r042"
+                              Name 268  "r043"
+                              Name 272  "r044"
+                              Name 276  "r045"
+                              Name 280  "r046"
+                              Name 283  "r047"
+                              Name 287  "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 340  "r001"
+                              Name 343  "r002"
+                              Name 346  "r003"
+                              Name 349  "r004"
+                              Name 354  "r005"
+                              Name 357  "r006"
+                              Name 360  "r007"
+                              Name 363  "r009"
+                              Name 366  "r010"
+                              Name 370  "r011"
+                              Name 373  "r012"
+                              Name 386  "r013"
+                              Name 389  "r015"
+                              Name 392  "r016"
+                              Name 396  "r017"
+                              Name 399  "r018"
+                              Name 402  "r019"
+                              Name 405  "r020"
+                              Name 408  "r021"
+                              Name 411  "r022"
+                              Name 414  "r023"
+                              Name 417  "r026"
+                              Name 421  "r027"
+                              Name 425  "r028"
+                              Name 428  "r029"
+                              Name 431  "r030"
+                              Name 436  "r031"
+                              Name 440  "r032"
+                              Name 442  "r033"
+                              Name 445  "r035"
+                              Name 449  "r036"
+                              Name 452  "r037"
+                              Name 454  "ResType"
+                              Name 458  "r038"
+                              Name 462  "r039"
+                              Name 465  "r040"
+                              Name 468  "r041"
+                              Name 472  "r039a"
+                              Name 477  "r042"
+                              Name 480  "r043"
+                              Name 483  "r044"
+                              Name 487  "r045"
+                              Name 490  "r046"
+                              Name 494  "r047"
+                              Name 498  "r048"
+                              Name 501  "r049"
+                              Name 505  "r050"
+                              Name 508  "r051"
+                              Name 512  "r052"
+                              Name 516  "r053"
+                              Name 521  "r054"
+                              Name 525  "r055"
+                              Name 528  "r056"
+                              Name 531  "r057"
+                              Name 536  "r058"
+                              Name 539  "r059"
+                              Name 546  "r060"
+                              Name 549  "r061"
+                              Name 554  "r062"
+                              Name 557  "r063"
+                              Name 561  "r064"
+                              Name 564  "r065"
+                              Name 567  "r066"
+                              Name 573  "r000"
+                              Name 576  "r001"
+                              Name 579  "r002"
+                              Name 582  "r003"
+                              Name 585  "r004"
+                              Name 590  "r005"
+                              Name 593  "r006"
+                              Name 596  "r007"
+                              Name 599  "r009"
+                              Name 602  "r010"
+                              Name 606  "r011"
+                              Name 609  "r012"
+                              Name 622  "r013"
+                              Name 625  "r014"
+                              Name 628  "r015"
+                              Name 632  "r016"
+                              Name 636  "r017"
+                              Name 639  "r018"
+                              Name 642  "r019"
+                              Name 645  "r020"
+                              Name 648  "r021"
+                              Name 651  "r022"
+                              Name 654  "r023"
+                              Name 657  "r024"
+                              Name 661  "r025"
+                              Name 665  "r029"
+                              Name 668  "r030"
+                              Name 671  "r031"
+                              Name 676  "r032"
+                              Name 680  "r033"
+                              Name 682  "r034"
+                              Name 685  "r036"
+                              Name 689  "r037"
+                              Name 692  "r038"
+                              Name 694  "ResType"
+                              Name 698  "r039"
+                              Name 702  "r040"
+                              Name 705  "r041"
+                              Name 708  "r042"
+                              Name 712  "r039a"
+                              Name 717  "r039b"
+                              Name 723  "r043"
+                              Name 726  "r044"
+                              Name 729  "r045"
+                              Name 733  "r046"
+                              Name 736  "r047"
+                              Name 740  "r048"
+                              Name 744  "r049"
+                              Name 747  "r050"
+                              Name 751  "r051"
+                              Name 754  "r052"
+                              Name 758  "r053"
+                              Name 762  "r054"
+                              Name 766  "r055"
+                              Name 769  "r056"
+                              Name 772  "r057"
+                              Name 775  "r058"
+                              Name 780  "r059"
+                              Name 783  "r060"
+                              Name 790  "r061"
+                              Name 793  "r062"
+                              Name 798  "r063"
+                              Name 801  "r064"
+                              Name 805  "r065"
+                              Name 808  "r066"
+                              Name 811  "r067"
+                              Name 818  "r000"
+                              Name 821  "r001"
+                              Name 824  "r002"
+                              Name 827  "r003"
+                              Name 830  "r004"
+                              Name 835  "r005"
+                              Name 838  "r006"
+                              Name 841  "r007"
+                              Name 844  "r009"
+                              Name 847  "r010"
+                              Name 851  "r011"
+                              Name 854  "r012"
+                              Name 867  "r013"
+                              Name 870  "r014"
+                              Name 873  "r015"
+                              Name 876  "r016"
+                              Name 879  "r017"
+                              Name 882  "r018"
+                              Name 885  "r019"
+                              Name 888  "r020"
+                              Name 891  "r021"
+                              Name 894  "r022"
+                              Name 897  "r023"
+                              Name 901  "r024"
+                              Name 905  "r025"
+                              Name 916  "r029"
+                              Name 919  "r030"
+                              Name 922  "r031"
+                              Name 927  "r032"
+                              Name 932  "r033"
+                              Name 934  "r034"
+                              Name 937  "r036"
+                              Name 941  "r037"
+                              Name 944  "r038"
+                              Name 946  "ResType"
+                              Name 950  "r039"
+                              Name 954  "r040"
+                              Name 957  "r041"
+                              Name 960  "r042"
+                              Name 964  "r039a"
+                              Name 969  "r043"
+                              Name 972  "r044"
+                              Name 975  "r045"
+                              Name 979  "r046"
+                              Name 982  "r047"
+                              Name 986  "r048"
+                              Name 990  "r049"
+                              Name 993  "r050"
+                              Name 997  "r051"
+                              Name 1000  "r052"
+                              Name 1004  "r053"
+                              Name 1008  "r054"
+                              Name 1012  "r055"
+                              Name 1015  "r056"
+                              Name 1018  "r057"
+                              Name 1021  "r058"
+                              Name 1026  "r059"
+                              Name 1029  "r060"
+                              Name 1036  "r061"
+                              Name 1039  "r062"
+                              Name 1044  "r063"
+                              Name 1047  "r064"
+                              Name 1051  "r065"
+                              Name 1054  "r066"
+                              Name 1057  "r067"
+                              Name 1064  "r000"
+                              Name 1067  "r001"
+                              Name 1072  "r003"
+                              Name 1075  "r004"
+                              Name 1078  "r005"
+                              Name 1081  "r006"
+                              Name 1085  "r007"
+                              Name 1096  "r008"
+                              Name 1101  "r009"
+                              Name 1104  "r010"
+                              Name 1107  "r011"
+                              Name 1110  "r012"
+                              Name 1113  "r013"
+                              Name 1116  "r014"
+                              Name 1119  "r015"
+                              Name 1122  "r016"
+                              Name 1125  "r017"
+                              Name 1128  "r018"
+                              Name 1131  "r019"
+                              Name 1134  "R020"
+                              Name 1137  "r021"
+                              Name 1140  "r022"
+                              Name 1150  "r023"
+                              Name 1153  "r024"
+                              Name 1155  "ResType"
+                              Name 1159  "r025"
+                              Name 1162  "r026"
+                              Name 1166  "r026a"
+                              Name 1171  "r027"
+                              Name 1174  "r028"
+                              Name 1178  "r029"
+                              Name 1181  "r030"
+                              Name 1185  "r031"
+                              Name 1189  "r032"
+                              Name 1193  "r033"
+                              Name 1196  "r034"
+                              Name 1199  "r035"
+                              Name 1202  "r036"
+                              Name 1207  "r037"
+                              Name 1210  "r038"
+                              Name 1217  "r039"
+                              Name 1220  "r049"
+                              Name 1225  "r041"
+                              Name 1228  "r042"
+                              Name 1232  "r043"
+                              Name 1235  "r044"
+                              Name 1240  "r046"
+                              Name 1247  "r000"
+                              Name 1250  "r001"
+                              Name 1255  "r003"
+                              Name 1258  "r004"
+                              Name 1261  "r005"
+                              Name 1264  "r006"
+                              Name 1268  "r007"
+                              Name 1279  "r008"
+                              Name 1284  "r009"
+                              Name 1287  "r010"
+                              Name 1290  "r011"
+                              Name 1293  "r012"
+                              Name 1296  "r013"
+                              Name 1299  "r014"
+                              Name 1302  "r015"
+                              Name 1305  "r016"
+                              Name 1308  "r017"
+                              Name 1311  "r018"
+                              Name 1314  "r019"
+                              Name 1317  "R020"
+                              Name 1320  "r021"
+                              Name 1323  "r022"
+                              Name 1336  "r023"
+                              Name 1339  "r024"
+                              Name 1341  "ResType"
+                              Name 1345  "r025"
+                              Name 1348  "r026"
+                              Name 1352  "r026a"
+                              Name 1357  "r027"
+                              Name 1360  "r028"
+                              Name 1364  "r029"
+                              Name 1367  "r030"
+                              Name 1371  "r031"
+                              Name 1375  "r032"
+                              Name 1379  "r033"
+                              Name 1382  "r034"
+                              Name 1385  "r035"
+                              Name 1388  "r036"
+                              Name 1393  "r037"
+                              Name 1396  "r038"
+                              Name 1403  "r039"
+                              Name 1406  "r049"
+                              Name 1411  "r041"
+                              Name 1414  "r042"
+                              Name 1418  "r043"
+                              Name 1421  "r044"
+                              Name 1426  "r046"
+                              Name 1433  "r000"
+                              Name 1436  "r001"
+                              Name 1441  "r003"
+                              Name 1444  "r004"
+                              Name 1447  "r005"
+                              Name 1450  "r006"
+                              Name 1454  "r007"
+                              Name 1465  "r008"
+                              Name 1470  "r009"
+                              Name 1473  "r010"
+                              Name 1476  "r011"
+                              Name 1479  "r012"
+                              Name 1482  "r013"
+                              Name 1485  "r014"
+                              Name 1488  "r015"
+                              Name 1491  "r016"
+                              Name 1494  "r017"
+                              Name 1497  "r018"
+                              Name 1500  "r019"
+                              Name 1503  "R020"
+                              Name 1506  "r021"
+                              Name 1509  "r022"
+                              Name 1525  "r023"
+                              Name 1528  "r024"
+                              Name 1530  "ResType"
+                              Name 1534  "r025"
+                              Name 1537  "r026"
+                              Name 1541  "r026a"
+                              Name 1546  "r027"
+                              Name 1549  "r028"
+                              Name 1553  "r029"
+                              Name 1556  "r030"
+                              Name 1560  "r031"
+                              Name 1564  "r032"
+                              Name 1568  "r033"
+                              Name 1571  "r034"
+                              Name 1574  "r035"
+                              Name 1577  "r036"
+                              Name 1582  "r037"
+                              Name 1585  "r038"
+                              Name 1592  "r039"
+                              Name 1595  "r049"
+                              Name 1600  "r041"
+                              Name 1603  "r042"
+                              Name 1607  "r043"
+                              Name 1610  "r044"
+                              Name 1615  "r046"
+                              Name 1622  "r0"
+                              Name 1626  "r1"
+                              Name 1630  "r2"
+                              Name 1634  "r3"
+                              Name 1638  "r4"
+                              Name 1642  "r5"
+                              Name 1646  "r6"
+                              Name 1650  "r7"
+                              Name 1654  "r8"
+                              Name 1658  "r0"
+                              Name 1662  "r1"
+                              Name 1666  "r2"
+                              Name 1670  "r3"
+                              Name 1674  "r4"
+                              Name 1678  "r5"
+                              Name 1682  "r6"
+                              Name 1686  "r7"
+                              Name 1690  "r8"
+                              Name 1694  "r0"
+                              Name 1698  "r1"
+                              Name 1702  "r2"
+                              Name 1706  "r3"
+                              Name 1710  "r4"
+                              Name 1714  "r5"
+                              Name 1718  "r6"
+                              Name 1722  "r7"
+                              Name 1726  "r8"
+                              Name 1730  "r00"
+                              Name 1734  "r01"
+                              Name 1738  "r02"
+                              Name 1742  "r03"
+                              Name 1746  "r04"
+                              Name 1750  "r05"
+                              Name 1754  "r06"
+                              Name 1758  "r07"
+                              Name 1762  "r08"
+                              Name 1766  "r09"
+                              Name 1770  "r10"
+                              Name 1774  "r11"
+                              Name 1778  "r12"
+                              Name 1782  "r13"
+                              Name 1786  "r14"
+                              Name 1790  "r15"
+                              Name 1794  "r16"
+                              Name 1798  "PS_OUTPUT"
+                              MemberName 1798(PS_OUTPUT) 0  "color"
+                              Name 1800  "ps_output"
+                              Name 1805  "color"
+                              Name 1810  "gs_ua"
+                              Name 1811  "gs_ub"
+                              Name 1812  "gs_uc"
+                              Name 1814  "gs_ua2"
+                              Name 1815  "gs_ub2"
+                              Name 1816  "gs_uc2"
+                              Name 1818  "gs_ua3"
+                              Name 1819  "gs_ub3"
+                              Name 1820  "gs_uc3"
+                              Name 1822  "gs_ua4"
+                              Name 1823  "gs_ub4"
+                              Name 1824  "gs_uc4"
+                              Decorate 1805(color) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -6099,424 +6151,130 @@
               38:             TypeVector 8(int) 3
               39:             TypePointer Function 38(ivec3)
               40:             TypeFunction 36(fvec3) 37(ptr) 37(ptr) 37(ptr) 39(ptr) 39(ptr)
-              48:             TypeMatrix 24(fvec2) 2
-              49:             TypePointer Function 48
-              50:             TypeFunction 48 49(ptr) 49(ptr) 49(ptr)
-              56:             TypeMatrix 36(fvec3) 3
-              57:             TypePointer Function 56
-              58:             TypeFunction 56 57(ptr) 57(ptr) 57(ptr)
-              64:             TypeVector 6(float) 4
-              65:             TypeMatrix 64(fvec4) 4
-              66:             TypePointer Function 65
-              67:             TypeFunction 65 66(ptr) 66(ptr) 66(ptr)
-              73:             TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 25(ptr) 49(ptr) 49(ptr)
-              82:             TypeFunction 2 7(ptr) 7(ptr) 37(ptr) 37(ptr) 57(ptr) 57(ptr)
-              91:             TypePointer Function 64(fvec4)
-              92:             TypeFunction 2 7(ptr) 7(ptr) 91(ptr) 91(ptr) 66(ptr) 66(ptr)
-             101:             TypeMatrix 24(fvec2) 3
-             102:             TypePointer Function 101
-             103:             TypeMatrix 36(fvec3) 2
-             104:             TypePointer Function 103
-             105:             TypeMatrix 36(fvec3) 4
-             106:             TypePointer Function 105
-             107:             TypeMatrix 24(fvec2) 4
-             108:             TypePointer Function 107
-             109:             TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 37(ptr) 102(ptr) 104(ptr) 57(ptr) 106(ptr) 108(ptr)
-             121:             TypeBool
-             122:             TypePointer Function 121(bool)
-             138:             TypeInt 32 1
-             139:             TypePointer Function 138(int)
-             165:    6(float) Constant 0
-             177:      8(int) Constant 7
-             207:    138(int) Constant 7
-    225(ResType):             TypeStruct 6(float) 138(int)
-             253:    6(float) Constant 1050288283
-             274:    6(float) Constant 1065353216
-             278:      8(int) Constant 2
-             342:             TypeVector 138(int) 2
-             343:             TypePointer Function 342(ivec2)
-             369:   24(fvec2) ConstantComposite 165 165
-             370:             TypeVector 121(bool) 2
-             383:      8(int) Constant 3
-             384:   26(ivec2) ConstantComposite 177 383
-             427:      8(int) Constant 8
-             428:   26(ivec2) ConstantComposite 177 427
-    444(ResType):             TypeStruct 24(fvec2) 342(ivec2)
-             451:             TypePointer Function 370(bvec2)
-             509:    6(float) Constant 1073741824
-             512:      8(int) Constant 1
-             513:   26(ivec2) ConstantComposite 512 278
-             560:   24(fvec2) ConstantComposite 274 509
-             578:             TypeVector 138(int) 3
-             579:             TypePointer Function 578(ivec3)
-             605:   36(fvec3) ConstantComposite 165 165 165
-             606:             TypeVector 121(bool) 3
-             619:      8(int) Constant 5
-             620:   38(ivec3) ConstantComposite 177 383 619
-             667:      8(int) Constant 4
-             668:   38(ivec3) ConstantComposite 278 383 667
-    684(ResType):             TypeStruct 36(fvec3) 578(ivec3)
-             691:             TypePointer Function 606(bvec3)
-             710:    6(float) Constant 1050253722
-             757:   38(ivec3) ConstantComposite 512 278 383
-             804:    6(float) Constant 1077936128
-             805:   36(fvec3) ConstantComposite 274 509 804
-             809:             TypePointer Input 64(fvec4)
-       810(inF0):    809(ptr) Variable Input
-             825:             TypeVector 138(int) 4
-             826:             TypePointer Function 825(ivec4)
-             830:             TypeVector 8(int) 4
-             831:             TypePointer Function 830(ivec4)
-             836:             TypePointer Input 830(ivec4)
-       837(inU0):    836(ptr) Variable Input
-       845(inF1):    809(ptr) Variable Input
-       854(inF2):    809(ptr) Variable Input
-             858:   64(fvec4) ConstantComposite 165 165 165 165
-             859:             TypeVector 121(bool) 4
-             872:  830(ivec4) ConstantComposite 177 383 619 278
-             904:             TypePointer Input 6(float)
-             927:      8(int) Constant 9
-             928:      8(int) Constant 10
-             929:  830(ivec4) ConstantComposite 177 427 927 928
-    945(ResType):             TypeStruct 64(fvec4) 825(ivec4)
-             952:             TypePointer Function 859(bvec4)
-            1012:  830(ivec4) ConstantComposite 512 278 383 667
-            1059:    6(float) Constant 1082130432
-            1060:   64(fvec4) ConstantComposite 274 509 804 1059
-            1087:          48 ConstantComposite 369 369
-            1088:             TypeMatrix 370(bvec2) 2
-   1153(ResType):             TypeStruct 48 342(ivec2)
-            1241:   24(fvec2) ConstantComposite 509 509
-            1242:          48 ConstantComposite 1241 1241
-            1270:          56 ConstantComposite 605 605 605
-            1271:             TypeMatrix 606(bvec3) 3
-   1339(ResType):             TypeStruct 56 578(ivec3)
-            1427:   36(fvec3) ConstantComposite 804 804 804
-            1428:          56 ConstantComposite 1427 1427 1427
-            1456:          65 ConstantComposite 858 858 858 858
-            1457:             TypeMatrix 859(bvec4) 4
-   1528(ResType):             TypeStruct 65 825(ivec4)
-            1616:   64(fvec4) ConstantComposite 1059 1059 1059 1059
-            1617:          65 ConstantComposite 1616 1616 1616 1616
-            1796:             TypePointer Private 8(int)
-     1797(gs_ua):   1796(ptr) Variable Private
-     1798(gs_ub):   1796(ptr) Variable Private
-     1799(gs_uc):   1796(ptr) Variable Private
-            1800:             TypePointer Private 26(ivec2)
-    1801(gs_ua2):   1800(ptr) Variable Private
-    1802(gs_ub2):   1800(ptr) Variable Private
-    1803(gs_uc2):   1800(ptr) Variable Private
-            1804:             TypePointer Private 38(ivec3)
-    1805(gs_ua3):   1804(ptr) Variable Private
-    1806(gs_ub3):   1804(ptr) Variable Private
-    1807(gs_uc3):   1804(ptr) Variable Private
-            1808:             TypePointer Private 830(ivec4)
-    1809(gs_ua4):   1808(ptr) Variable Private
-    1810(gs_ub4):   1808(ptr) Variable Private
-    1811(gs_uc4):   1808(ptr) Variable Private
-4(PixelShaderFunction):           2 Function None 3
+              48:             TypeVector 6(float) 4
+              49:             TypePointer Function 48(fvec4)
+              50:             TypeVector 8(int) 4
+              51:             TypePointer Function 50(ivec4)
+              52:             TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr)
+              60:             TypeMatrix 24(fvec2) 2
+              61:             TypePointer Function 60
+              62:             TypeFunction 60 61(ptr) 61(ptr) 61(ptr)
+              68:             TypeMatrix 36(fvec3) 3
+              69:             TypePointer Function 68
+              70:             TypeFunction 68 69(ptr) 69(ptr) 69(ptr)
+              76:             TypeMatrix 48(fvec4) 4
+              77:             TypePointer Function 76
+              78:             TypeFunction 76 77(ptr) 77(ptr) 77(ptr)
+              84:             TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 25(ptr) 61(ptr) 61(ptr)
+              93:             TypeFunction 2 7(ptr) 7(ptr) 37(ptr) 37(ptr) 69(ptr) 69(ptr)
+             102:             TypeFunction 2 7(ptr) 7(ptr) 49(ptr) 49(ptr) 77(ptr) 77(ptr)
+             111:             TypeMatrix 36(fvec3) 2
+             112:             TypePointer Function 111
+             113:             TypeMatrix 24(fvec2) 3
+             114:             TypePointer Function 113
+             115:             TypeMatrix 48(fvec4) 3
+             116:             TypePointer Function 115
+             117:             TypeMatrix 48(fvec4) 2
+             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)
+             131:             TypeBool
+             132:             TypePointer Function 131(bool)
+             148:             TypeInt 32 1
+             149:             TypePointer Function 148(int)
+             175:    6(float) Constant 0
+             187:      8(int) Constant 7
+             217:    148(int) Constant 7
+    235(ResType):             TypeStruct 6(float) 148(int)
+             263:    6(float) Constant 1050288283
+             284:    6(float) Constant 1065353216
+             288:      8(int) Constant 2
+             352:             TypeVector 148(int) 2
+             353:             TypePointer Function 352(ivec2)
+             379:   24(fvec2) ConstantComposite 175 175
+             380:             TypeVector 131(bool) 2
+             393:      8(int) Constant 3
+             394:   26(ivec2) ConstantComposite 187 393
+             437:      8(int) Constant 8
+             438:   26(ivec2) ConstantComposite 187 437
+    454(ResType):             TypeStruct 24(fvec2) 352(ivec2)
+             461:             TypePointer Function 380(bvec2)
+             519:    6(float) Constant 1073741824
+             522:      8(int) Constant 1
+             523:   26(ivec2) ConstantComposite 522 288
+             570:   24(fvec2) ConstantComposite 284 519
+             588:             TypeVector 148(int) 3
+             589:             TypePointer Function 588(ivec3)
+             615:   36(fvec3) ConstantComposite 175 175 175
+             616:             TypeVector 131(bool) 3
+             629:      8(int) Constant 5
+             630:   38(ivec3) ConstantComposite 187 393 629
+             677:      8(int) Constant 4
+             678:   38(ivec3) ConstantComposite 288 393 677
+    694(ResType):             TypeStruct 36(fvec3) 588(ivec3)
+             701:             TypePointer Function 616(bvec3)
+             720:    6(float) Constant 1050253722
+             767:   38(ivec3) ConstantComposite 522 288 393
+             814:    6(float) Constant 1077936128
+             815:   36(fvec3) ConstantComposite 284 519 814
+             833:             TypeVector 148(int) 4
+             834:             TypePointer Function 833(ivec4)
+             860:   48(fvec4) ConstantComposite 175 175 175 175
+             861:             TypeVector 131(bool) 4
+             874:   50(ivec4) ConstantComposite 187 393 629 288
+             928:      8(int) Constant 9
+             929:      8(int) Constant 10
+             930:   50(ivec4) ConstantComposite 187 437 928 929
+    946(ResType):             TypeStruct 48(fvec4) 833(ivec4)
+             953:             TypePointer Function 861(bvec4)
+            1013:   50(ivec4) ConstantComposite 522 288 393 677
+            1060:    6(float) Constant 1082130432
+            1061:   48(fvec4) ConstantComposite 284 519 814 1060
+            1089:          60 ConstantComposite 379 379
+            1090:             TypeMatrix 380(bvec2) 2
+   1155(ResType):             TypeStruct 60 352(ivec2)
+            1243:   24(fvec2) ConstantComposite 519 519
+            1244:          60 ConstantComposite 1243 1243
+            1272:          68 ConstantComposite 615 615 615
+            1273:             TypeMatrix 616(bvec3) 3
+   1341(ResType):             TypeStruct 68 588(ivec3)
+            1429:   36(fvec3) ConstantComposite 814 814 814
+            1430:          68 ConstantComposite 1429 1429 1429
+            1458:          76 ConstantComposite 860 860 860 860
+            1459:             TypeMatrix 861(bvec4) 4
+   1530(ResType):             TypeStruct 76 833(ivec4)
+            1618:   48(fvec4) ConstantComposite 1060 1060 1060 1060
+            1619:          76 ConstantComposite 1618 1618 1618 1618
+ 1798(PS_OUTPUT):             TypeStruct 48(fvec4)
+            1799:             TypePointer Function 1798(PS_OUTPUT)
+            1801:    148(int) Constant 0
+            1802:   48(fvec4) ConstantComposite 284 284 284 284
+            1804:             TypePointer Output 48(fvec4)
+     1805(color):   1804(ptr) Variable Output
+            1809:             TypePointer Private 8(int)
+     1810(gs_ua):   1809(ptr) Variable Private
+     1811(gs_ub):   1809(ptr) Variable Private
+     1812(gs_uc):   1809(ptr) Variable Private
+            1813:             TypePointer Private 26(ivec2)
+    1814(gs_ua2):   1813(ptr) Variable Private
+    1815(gs_ub2):   1813(ptr) Variable Private
+    1816(gs_uc2):   1813(ptr) Variable Private
+            1817:             TypePointer Private 38(ivec3)
+    1818(gs_ua3):   1817(ptr) Variable Private
+    1819(gs_ub3):   1817(ptr) Variable Private
+    1820(gs_uc3):   1817(ptr) Variable Private
+            1821:             TypePointer Private 50(ivec4)
+    1822(gs_ua4):   1821(ptr) Variable Private
+    1823(gs_ub4):   1821(ptr) Variable Private
+    1824(gs_uc4):   1821(ptr) Variable Private
+         4(main):           2 Function None 3
                5:             Label
-       808(r000):    122(ptr) Variable Function
-       813(r001):     91(ptr) Variable Function
-       816(r002):     91(ptr) Variable Function
-       819(r003):    122(ptr) Variable Function
-       822(r004):     91(ptr) Variable Function
-       827(r005):    826(ptr) Variable Function
-       832(r006):    831(ptr) Variable Function
-       835(r007):     91(ptr) Variable Function
-       840(r009):     91(ptr) Variable Function
-       843(r010):     91(ptr) Variable Function
-       848(r011):     91(ptr) Variable Function
-       851(r012):     91(ptr) Variable Function
-       865(r013):     91(ptr) Variable Function
-       868(r014):     91(ptr) Variable Function
-       871(r015):    831(ptr) Variable Function
-       874(r016):     91(ptr) Variable Function
-       877(r017):     91(ptr) Variable Function
-       880(r018):     91(ptr) Variable Function
-       883(r019):     91(ptr) Variable Function
-       886(r020):     91(ptr) Variable Function
-       889(r021):     91(ptr) Variable Function
-       892(r022):     91(ptr) Variable Function
-       895(r023):      7(ptr) Variable Function
-       899(r024):      7(ptr) Variable Function
-       903(r025):     91(ptr) Variable Function
-       915(r029):     91(ptr) Variable Function
-       918(r030):     91(ptr) Variable Function
-       921(r031):     91(ptr) Variable Function
-       926(r032):    831(ptr) Variable Function
-       931(r033):    831(ptr) Variable Function
-       933(r034):     91(ptr) Variable Function
-       936(r036):     91(ptr) Variable Function
-       940(r037):     91(ptr) Variable Function
-       943(r038):     91(ptr) Variable Function
-       949(r039):     91(ptr) Variable Function
-       953(r040):    952(ptr) Variable Function
-       956(r041):    952(ptr) Variable Function
-       959(r042):     91(ptr) Variable Function
-      963(r039a):     91(ptr) Variable Function
-       968(r043):      7(ptr) Variable Function
-       971(r044):     91(ptr) Variable Function
-       974(r045):     91(ptr) Variable Function
-       978(r046):     91(ptr) Variable Function
-       981(r047):     91(ptr) Variable Function
-       985(r048):     91(ptr) Variable Function
-       989(r049):     91(ptr) Variable Function
-       992(r050):     91(ptr) Variable Function
-       996(r051):     91(ptr) Variable Function
-       999(r052):     91(ptr) Variable Function
-      1003(r053):     91(ptr) Variable Function
-      1007(r054):     91(ptr) Variable Function
-      1011(r055):    831(ptr) Variable Function
-      1014(r056):     91(ptr) Variable Function
-      1017(r057):     91(ptr) Variable Function
-      1020(r058):     91(ptr) Variable Function
-      1025(r059):     91(ptr) Variable Function
-      1028(r060):     91(ptr) Variable Function
-      1035(r061):     91(ptr) Variable Function
-      1038(r062):     91(ptr) Variable Function
-      1043(r063):     91(ptr) Variable Function
-      1046(r064):     91(ptr) Variable Function
-      1050(r065):     91(ptr) Variable Function
-      1053(r066):     91(ptr) Variable Function
-      1056(r067):     91(ptr) Variable Function
-             811:   64(fvec4) Load 810(inF0)
-             812:   121(bool) All 811
-                              Store 808(r000) 812
-             814:   64(fvec4) Load 810(inF0)
-             815:   64(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 814
-                              Store 813(r001) 815
-             817:   64(fvec4) Load 810(inF0)
-             818:   64(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 817
-                              Store 816(r002) 818
-             820:   64(fvec4) Load 810(inF0)
-             821:   121(bool) Any 820
-                              Store 819(r003) 821
-             823:   64(fvec4) Load 810(inF0)
-             824:   64(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 823
-                              Store 822(r004) 824
-             828:   64(fvec4) Load 810(inF0)
-             829:  825(ivec4) Bitcast 828
-                              Store 827(r005) 829
-             833:   64(fvec4) Load 810(inF0)
-             834:  830(ivec4) Bitcast 833
-                              Store 832(r006) 834
-             838:  830(ivec4) Load 837(inU0)
-             839:   64(fvec4) Bitcast 838
-                              Store 835(r007) 839
-             841:   64(fvec4) Load 810(inF0)
-             842:   64(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 841
-                              Store 840(r009) 842
-             844:   64(fvec4) Load 810(inF0)
-             846:   64(fvec4) Load 845(inF1)
-             847:   64(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 844 846
-                              Store 843(r010) 847
-             849:   64(fvec4) Load 810(inF0)
-             850:   64(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 849
-                              Store 848(r011) 850
-             852:   64(fvec4) Load 810(inF0)
-             853:   64(fvec4) Load 845(inF1)
-             855:   64(fvec4) Load 854(inF2)
-             856:   64(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 852 853 855
-                              Store 851(r012) 856
-             857:   64(fvec4) Load 810(inF0)
-             860:  859(bvec4) FOrdLessThan 857 858
-             861:   121(bool) Any 860
-                              SelectionMerge 863 None
-                              BranchConditional 861 862 863
-             862:               Label
-                                Kill
-             863:             Label
-             866:   64(fvec4) Load 810(inF0)
-             867:   64(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 866
-                              Store 865(r013) 867
-             869:   64(fvec4) Load 810(inF0)
-             870:   64(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 869
-                              Store 868(r014) 870
-             873:  830(ivec4) BitCount 872
-                              Store 871(r015) 873
-             875:   64(fvec4) Load 810(inF0)
-             876:   64(fvec4) DPdx 875
-                              Store 874(r016) 876
-             878:   64(fvec4) Load 810(inF0)
-             879:   64(fvec4) DPdxCoarse 878
-                              Store 877(r017) 879
-             881:   64(fvec4) Load 810(inF0)
-             882:   64(fvec4) DPdxFine 881
-                              Store 880(r018) 882
-             884:   64(fvec4) Load 810(inF0)
-             885:   64(fvec4) DPdy 884
-                              Store 883(r019) 885
-             887:   64(fvec4) Load 810(inF0)
-             888:   64(fvec4) DPdyCoarse 887
-                              Store 886(r020) 888
-             890:   64(fvec4) Load 810(inF0)
-             891:   64(fvec4) DPdyFine 890
-                              Store 889(r021) 891
-             893:   64(fvec4) Load 810(inF0)
-             894:   64(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 893
-                              Store 892(r022) 894
-             896:   64(fvec4) Load 810(inF0)
-             897:   64(fvec4) Load 845(inF1)
-             898:    6(float) ExtInst 1(GLSL.std.450) 67(Distance) 896 897
-                              Store 895(r023) 898
-             900:   64(fvec4) Load 810(inF0)
-             901:   64(fvec4) Load 845(inF1)
-             902:    6(float) Dot 900 901
-                              Store 899(r024) 902
-             905:    904(ptr) AccessChain 810(inF0) 512
-             906:    6(float) Load 905
-             907:    904(ptr) AccessChain 845(inF1) 512
-             908:    6(float) Load 907
-             909:    6(float) FMul 906 908
-             910:    904(ptr) AccessChain 810(inF0) 278
-             911:    6(float) Load 910
-             912:    904(ptr) AccessChain 845(inF1) 383
-             913:    6(float) Load 912
-             914:   64(fvec4) CompositeConstruct 274 909 911 913
-                              Store 903(r025) 914
-             916:   64(fvec4) Load 810(inF0)
-             917:   64(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 916
-                              Store 915(r029) 917
-             919:   64(fvec4) Load 810(inF0)
-             920:   64(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 919
-                              Store 918(r030) 920
-             922:   64(fvec4) Load 810(inF0)
-             923:   64(fvec4) Load 845(inF1)
-             924:   64(fvec4) Load 854(inF2)
-             925:   64(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 922 923 924
-                              Store 921(r031) 925
-             930:  830(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 929
-                              Store 926(r032) 930
-             932:  830(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 929
-                              Store 931(r033) 932
-             934:   64(fvec4) Load 810(inF0)
-             935:   64(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 934
-                              Store 933(r034) 935
-             937:   64(fvec4) Load 810(inF0)
-             938:   64(fvec4) Load 845(inF1)
-             939:   64(fvec4) FMod 937 938
-                              Store 936(r036) 939
-             941:   64(fvec4) Load 810(inF0)
-             942:   64(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 941
-                              Store 940(r037) 942
-             944:   64(fvec4) Load 810(inF0)
-             946:945(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 944
-             947:  825(ivec4) CompositeExtract 946 1
-                              Store 845(inF1) 947
-             948:   64(fvec4) CompositeExtract 946 0
-                              Store 943(r038) 948
-             950:   64(fvec4) Load 810(inF0)
-             951:   64(fvec4) Fwidth 950
-                              Store 949(r039) 951
-             954:   64(fvec4) Load 810(inF0)
-             955:  859(bvec4) IsInf 954
-                              Store 953(r040) 955
-             957:   64(fvec4) Load 810(inF0)
-             958:  859(bvec4) IsNan 957
-                              Store 956(r041) 958
-             960:   64(fvec4) Load 810(inF0)
-             961:   64(fvec4) Load 845(inF1)
-             962:   64(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 960 961
-                              Store 959(r042) 962
-             964:   64(fvec4) Load 810(inF0)
-             965:   64(fvec4) Load 845(inF1)
-             966:   64(fvec4) Load 854(inF2)
-             967:   64(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 964 965 966
-                              Store 963(r039a) 967
-             969:   64(fvec4) Load 810(inF0)
-             970:    6(float) ExtInst 1(GLSL.std.450) 66(Length) 969
-                              Store 968(r043) 970
-             972:   64(fvec4) Load 810(inF0)
-             973:   64(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 972
-                              Store 971(r044) 973
-             975:   64(fvec4) Load 810(inF0)
-             976:   64(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 975
-             977:   64(fvec4) VectorTimesScalar 976 253
-                              Store 974(r045) 977
-             979:   64(fvec4) Load 810(inF0)
-             980:   64(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 979
-                              Store 978(r046) 980
-             982:   64(fvec4) Load 810(inF0)