diff --git a/SPIRV/GLSL.std.450.h b/SPIRV/GLSL.std.450.h index 13bb8e3e..d1c9b5c1 100755 --- a/SPIRV/GLSL.std.450.h +++ b/SPIRV/GLSL.std.450.h @@ -28,7 +28,7 @@ #define GLSLstd450_H const int GLSLstd450Version = 99; -const int GLSLstd450Revision = 2; +const int GLSLstd450Revision = 3; enum GLSLstd450 { GLSLstd450Bad = 0, // Don't use @@ -82,47 +82,44 @@ enum GLSLstd450 { GLSLstd450FClamp = 43, GLSLstd450UClamp = 44, GLSLstd450SClamp = 45, - GLSLstd450Mix = 46, - GLSLstd450Step = 47, - GLSLstd450SmoothStep = 48, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, - GLSLstd450Fma = 49, - GLSLstd450Frexp = 50, // second operand needs an OpVariable to write to - GLSLstd450FrexpStruct = 51, // no OpVariable operand - GLSLstd450Ldexp = 52, + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, - GLSLstd450PackSnorm4x8 = 53, - GLSLstd450PackUnorm4x8 = 54, - GLSLstd450PackSnorm2x16 = 55, - GLSLstd450PackUnorm2x16 = 56, - GLSLstd450PackHalf2x16 = 57, - GLSLstd450PackDouble2x32 = 58, - GLSLstd450UnpackSnorm2x16 = 59, - GLSLstd450UnpackUnorm2x16 = 60, - GLSLstd450UnpackHalf2x16 = 61, - GLSLstd450UnpackSnorm4x8 = 62, - GLSLstd450UnpackUnorm4x8 = 63, - GLSLstd450UnpackDouble2x32 = 64, + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, - GLSLstd450Length = 65, - GLSLstd450Distance = 66, - GLSLstd450Cross = 67, - GLSLstd450Normalize = 68, - GLSLstd450FaceForward = 69, - GLSLstd450Reflect = 70, - GLSLstd450Refract = 71, + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, - GLSLstd450FindILSB = 72, - GLSLstd450FindSMSB = 73, - GLSLstd450FindUMSB = 74, + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, - GLSLstd450InterpolateAtCentroid = 75, - GLSLstd450InterpolateAtSample = 76, - GLSLstd450InterpolateAtOffset = 77, - - GLSLstd450AddCarry = 78, // These three should move to the core instruction set - GLSLstd450SubBorrow = 79, - GLSLstd450MulExtended = 80, + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, GLSLstd450Count }; diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index c005197f..c5342ac9 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -60,7 +60,10 @@ namespace spv { namespace { -const int GlslangMagic = 0x51a; +// For low-order part of the generator's magic number. Bump up +// when there is a change in the style (e.g., if SSA form changes, +// or a different instruction sequence to do something gets used). +const int GeneratorVersion = 1; // // The main holder of information for translating glslang to SPIR-V. @@ -113,13 +116,16 @@ protected: spv::Id createNoArgOperation(glslang::TOperator op); spv::Id getSymbolId(const glslang::TIntermSymbol* node); void addDecoration(spv::Id id, spv::Decoration dec); + void addDecoration(spv::Id id, spv::Decoration dec, unsigned value); void addMemberDecoration(spv::Id id, int member, spv::Decoration dec); - spv::Id createSpvConstant(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst); + spv::Id createSpvSpecConstant(const glslang::TIntermTyped&); + spv::Id createSpvConstant(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivial(const glslang::TIntermTyped* node); spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); spv::Function* shaderEntry; + spv::Instruction* entryPoint; int sequenceDepth; // There is a 1:1 mapping between a spv builder and a module; this is thread safe @@ -169,7 +175,7 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage) case EShLangFragment: return spv::ExecutionModelFragment; case EShLangCompute: return spv::ExecutionModelGLCompute; default: - spv::MissingFunctionality("GLSL stage"); + assert(0); return spv::ExecutionModelFragment; } } @@ -191,12 +197,12 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type) // TODO: how are we distuingishing between default and non-default non-writable uniforms? Do default uniforms even exist? } else { switch (type.getQualifier().storage) { - case glslang::EvqShared: return spv::StorageClassWorkgroupLocal; break; - case glslang::EvqGlobal: return spv::StorageClassPrivateGlobal; + case glslang::EvqShared: return spv::StorageClassWorkgroup; break; + case glslang::EvqGlobal: return spv::StorageClassPrivate; case glslang::EvqConstReadOnly: return spv::StorageClassFunction; case glslang::EvqTemporary: return spv::StorageClassFunction; default: - spv::MissingFunctionality("unknown glslang storage class"); + assert(0); return spv::StorageClassFunction; } } @@ -206,14 +212,14 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type) spv::Dim TranslateDimensionality(const glslang::TSampler& sampler) { switch (sampler.dim) { - case glslang::Esd1D: return spv::Dim1D; - case glslang::Esd2D: return spv::Dim2D; - case glslang::Esd3D: return spv::Dim3D; - case glslang::EsdCube: return spv::DimCube; - case glslang::EsdRect: return spv::DimRect; - case glslang::EsdBuffer: return spv::DimBuffer; + case glslang::Esd1D: return spv::Dim1D; + case glslang::Esd2D: return spv::Dim2D; + case glslang::Esd3D: return spv::Dim3D; + case glslang::EsdCube: return spv::DimCube; + case glslang::EsdRect: return spv::DimRect; + case glslang::EsdBuffer: return spv::DimBuffer; default: - spv::MissingFunctionality("unknown sampler dimension"); + assert(0); return spv::Dim2D; } } @@ -240,7 +246,7 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type) case glslang::EvqVaryingIn: return spv::DecorationBlock; case glslang::EvqVaryingOut: return spv::DecorationBlock; default: - spv::MissingFunctionality("kind of block"); + assert(0); break; } } @@ -275,11 +281,10 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type) } case glslang::EvqVaryingIn: case glslang::EvqVaryingOut: - if (type.getQualifier().layoutPacking != glslang::ElpNone) - spv::MissingFunctionality("in/out block layout"); + assert(type.getQualifier().layoutPacking == glslang::ElpNone); return (spv::Decoration)spv::BadValue; default: - spv::MissingFunctionality("block storage qualification"); + assert(0); return (spv::Decoration)spv::BadValue; } } @@ -287,12 +292,16 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type) } // Translate glslang type to SPIR-V interpolation decorations. +// Returns spv::Decoration(spv::BadValue) when no decoration +// should be applied. spv::Decoration TranslateInterpolationDecoration(const glslang::TType& type) { - if (type.getQualifier().smooth) - return spv::DecorationSmooth; + if (type.getQualifier().smooth) { + // Smooth decoration doesn't exist in SPIR-V 1.0 + return (spv::Decoration)spv::BadValue; + } if (type.getQualifier().nopersp) - return spv::DecorationNoperspective; + return spv::DecorationNoPerspective; else if (type.getQualifier().patch) return spv::DecorationPatch; else if (type.getQualifier().flat) @@ -344,8 +353,6 @@ spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) case glslang::EbvSampleId: return spv::BuiltInSampleId; case glslang::EbvSamplePosition: return spv::BuiltInSamplePosition; case glslang::EbvSampleMask: return spv::BuiltInSampleMask; - case glslang::EbvFragColor: return spv::BuiltInFragColor; - case glslang::EbvFragData: return spv::BuiltInFragColor; case glslang::EbvFragDepth: return spv::BuiltInFragDepth; case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation; case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups; @@ -414,7 +421,7 @@ spv::ImageFormat TranslateImageFormat(const glslang::TType& type) TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* glslangIntermediate) : TIntermTraverser(true, false, true), shaderEntry(0), sequenceDepth(0), - builder(GlslangMagic), + builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion), inMain(false), mainTerminated(false), linkageOnly(false), glslangIntermediate(glslangIntermediate) { @@ -425,7 +432,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls stdBuiltins = builder.import("GLSL.std.450"); builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); shaderEntry = builder.makeMain(); - builder.addEntryPoint(executionModel, shaderEntry, "main"); + entryPoint = builder.addEntryPoint(executionModel, shaderEntry, "main"); // Add the source extensions const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); @@ -451,9 +458,9 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls case EShLangTessEvaluation: builder.addCapability(spv::CapabilityTessellation); switch (glslangIntermediate->getInputPrimitive()) { - case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break; - case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break; - case glslang::ElgIsolines: mode = spv::ExecutionModeInputIsolines; break; + case glslang::ElgTriangles: mode = spv::ExecutionModeTriangles; break; + case glslang::ElgQuads: mode = spv::ExecutionModeQuads; break; + case glslang::ElgIsolines: mode = spv::ExecutionModeIsolines; break; default: mode = spv::BadValue; break; } if (mode != spv::BadValue) @@ -486,7 +493,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls case glslang::ElgPoints: mode = spv::ExecutionModeInputPoints; break; case glslang::ElgLines: mode = spv::ExecutionModeInputLines; break; case glslang::ElgLinesAdjacency: mode = spv::ExecutionModeInputLinesAdjacency; break; - case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break; + case glslang::ElgTriangles: mode = spv::ExecutionModeTriangles; break; case glslang::ElgTrianglesAdjacency: mode = spv::ExecutionModeInputTrianglesAdjacency; break; default: mode = spv::BadValue; break; } @@ -520,7 +527,6 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls builder.addExecutionMode(shaderEntry, spv::ExecutionModeEarlyFragmentTests); switch(glslangIntermediate->getDepth()) { - case glslang::EldAny: mode = spv::ExecutionModeDepthAny; break; case glslang::EldGreater: mode = spv::ExecutionModeDepthGreater; break; case glslang::EldLess: mode = spv::ExecutionModeDepthLess; break; default: mode = spv::BadValue; break; @@ -591,6 +597,11 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) builder.setAccessChainRValue(id); else builder.setAccessChainLValue(id); + } else { + // finish off the entry-point SPV instruction by adding the Input/Output + spv::StorageClass sc = builder.getStorageClass(id); + if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput) + entryPoint->addIdOperand(id); } } @@ -639,8 +650,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getType().getBasicType()); // these all need their counterparts in createBinaryOperation() - if (rValue == 0) - spv::MissingFunctionality("createBinaryOperation"); + assert(rValue != spv::NoResult); } // store the result @@ -660,20 +670,13 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // Add the next element in the chain - int index = 0; - if (node->getRight()->getAsConstantUnion() == 0) - spv::MissingFunctionality("direct index without a constant node"); - else - index = node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); - + int index = node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); if (node->getLeft()->getBasicType() == glslang::EbtBlock && node->getOp() == glslang::EOpIndexDirectStruct) { // This may be, e.g., an anonymous block-member selection, which generally need // index remapping due to hidden members in anonymous blocks. std::vector& remapper = memberRemapper[node->getLeft()->getType().getStruct()]; - if (remapper.size() == 0) - spv::MissingFunctionality("block without member remapping"); - else - index = remapper[index]; + assert(remapper.size() > 0); + index = remapper[index]; } if (! node->getLeft()->getType().isArray() && @@ -766,7 +769,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getLeft()->getType().getBasicType()); if (! result) { - spv::MissingFunctionality("glslang binary operation"); + spv::MissingFunctionality("unknown glslang binary operation"); } else { builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -832,7 +835,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // if not, then possibly an operation if (! result) - result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operand, node->getBasicType()); + result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operand, node->getOperand()->getBasicType()); if (result) { builder.clearAccessChain(); @@ -862,8 +865,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()), convertGlslangToSpvType(node->getType()), operand, one, node->getType().getBasicType()); - if (result == 0) - spv::MissingFunctionality("createBinaryOperation for unary"); + assert(result != spv::NoResult); // The result of operation is always stored, but conditionally the // consumed result. The consumed result is always an r-value. @@ -886,7 +888,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI return false; default: - spv::MissingFunctionality("glslang unary"); + spv::MissingFunctionality("unknown glslang unary"); break; } @@ -990,13 +992,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt { if (node->isUserDefined()) result = handleUserFunctionCall(node); - - if (! result) { - spv::MissingFunctionality("glslang function call"); - glslang::TConstUnionArray emptyConsts; - int nextConst = 0; - result = createSpvConstant(node->getType(), emptyConsts, nextConst); - } + assert(result); builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -1053,12 +1049,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt for (int c = 0; c < (int)arguments.size(); ++c) constituents.push_back(arguments[c]); constructed = builder.createCompositeConstruct(resultTypeId, constituents); - } else { - if (isMatrix) - constructed = builder.createMatrixConstructor(precision, arguments, resultTypeId); - else - constructed = builder.createConstructor(precision, arguments, resultTypeId); - } + } else if (isMatrix) + constructed = builder.createMatrixConstructor(precision, arguments, resultTypeId); + else + constructed = builder.createConstructor(precision, arguments, resultTypeId); builder.clearAccessChain(); builder.setAccessChainRValue(constructed); @@ -1131,21 +1125,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt atomic = true; break; - case glslang::EOpAddCarry: - case glslang::EOpSubBorrow: - case glslang::EOpUMulExtended: - case glslang::EOpIMulExtended: - case glslang::EOpBitfieldExtract: - case glslang::EOpBitfieldInsert: - spv::MissingFunctionality("integer aggregate"); - break; - - case glslang::EOpFma: - case glslang::EOpFrexp: - case glslang::EOpLdexp: - spv::MissingFunctionality("fma/frexp/ldexp aggregate"); - break; - default: break; } @@ -1171,9 +1150,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt left->getType().getBasicType(), reduceComparison); // code above should only make binOp that exists in createBinaryOperation - if (result == 0) - spv::MissingFunctionality("createBinaryOperation for aggregate"); - + assert(result != spv::NoResult); builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -1192,7 +1169,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // special case l-value operands; there are just a few bool lvalue = false; switch (node->getOp()) { - //case glslang::EOpFrexp: + case glslang::EOpFrexp: case glslang::EOpModf: if (arg == 1) lvalue = true; @@ -1208,9 +1185,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (arg == 0) lvalue = true; break; - //case glslang::EOpUAddCarry: - //case glslang::EOpUSubBorrow: - //case glslang::EOpUMulExtended: + case glslang::EOpAddCarry: + case glslang::EOpSubBorrow: + if (arg == 2) + lvalue = true; + break; + case glslang::EOpUMulExtended: + case glslang::EOpIMulExtended: + if (arg >= 2) + lvalue = true; + break; default: break; } @@ -1230,7 +1214,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt result = createNoArgOperation(node->getOp()); break; case 1: - result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands.front(), node->getType().getBasicType()); + result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands.front(), glslangOperands[0]->getAsTyped()->getBasicType()); break; default: result = createMiscOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands, node->getBasicType()); @@ -1242,7 +1226,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt return false; if (! result) { - spv::MissingFunctionality("glslang aggregate"); + spv::MissingFunctionality("unknown glslang aggregate"); return true; } else { builder.clearAccessChain(); @@ -1350,7 +1334,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* node) { int nextConst = 0; - spv::Id constant = createSpvConstant(node->getType(), node->getConstArray(), nextConst); + spv::Id constant = createSpvConstant(node->getType(), node->getConstArray(), nextConst, false); builder.clearAccessChain(); builder.setAccessChainRValue(constant); @@ -1418,7 +1402,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T break; default: - spv::MissingFunctionality("branch type"); + assert(0); break; } @@ -1429,9 +1413,9 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* { // First, steer off constants, which are not SPIR-V variables, but // can still have a mapping to a SPIR-V Id. + // This includes specialization constants. if (node->getQualifier().storage == glslang::EvqConst) { - int nextConst = 0; - return createSpvConstant(node->getType(), node->getConstArray(), nextConst); + return createSpvSpecConstant(*node); } // Now, handle actual variables @@ -1453,7 +1437,7 @@ spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler) case glslang::EbtInt: return builder.makeIntType(32); case glslang::EbtUint: return builder.makeUintType(32); default: - spv::MissingFunctionality("sampled type"); + assert(0); return builder.makeFloatType(32); } } @@ -1474,8 +1458,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty switch (type.getBasicType()) { case glslang::EbtVoid: spvType = builder.makeVoidType(); - if (type.isArray()) - spv::MissingFunctionality("array of void"); + assert (! type.isArray()); break; case glslang::EbtFloat: spvType = builder.makeFloatType(32); @@ -1499,12 +1482,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtSampler: { const glslang::TSampler& sampler = type.getSampler(); - spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.shadow, sampler.arrayed, sampler.ms, - sampler.image ? 2 : 1, TranslateImageFormat(type)); - // OpenGL "textures" need to be combined with a sampler - if (! sampler.image) - spvType = builder.makeSampledImageType(spvType); - } + // an image is present, make its type + spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.shadow, sampler.arrayed, sampler.ms, + sampler.image ? 2 : 1, TranslateImageFormat(type)); + if (! sampler.image) { + spvType = builder.makeSampledImageType(spvType); + } + } break; case glslang::EbtStruct: case glslang::EbtBlock: @@ -1593,7 +1577,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty } break; default: - spv::MissingFunctionality("basic type"); + assert(0); break; } @@ -1620,10 +1604,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeArrayType(spvType, type.getOuterArraySize()); } - // TODO: layout still needs to be done hierarchically for arrays of arrays, which + // TODO: explicit layout still needs to be done hierarchically for arrays of arrays, which // may still require additional "link time" support from the front-end // for arrays of arrays - if (explicitLayout) + + // We need to decorate array strides for types needing explicit layout, + // except for the very top if it is an array of blocks; that array is + // not laid out in memory in a way needing a stride. + if (explicitLayout && type.getBasicType() != glslang::EbtBlock) builder.addDecoration(spvType, spv::DecorationArrayStride, getArrayStride(type)); } @@ -1883,8 +1871,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO operands.push_back(*(opIt++)); if (node->getOp() == glslang::EOpImageStore) operands.push_back(*(opIt++)); - // TODO: add 'sample' operand if (node->getOp() == glslang::EOpImageLoad) { + if (sampler.ms) { + operands.push_back(spv::ImageOperandsSampleMask); + operands.push_back(*(opIt++)); + } return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands); } else if (node->getOp() == glslang::EOpImageStore) { builder.createNoResultOp(spv::OpImageWrite, operands); @@ -1909,8 +1900,6 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } // Check for texture functions other than queries - if (cracked.gather) - spv::MissingFunctionality("texture gather"); // check for bias argument bool bias = false; @@ -1925,14 +1914,18 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO bias = true; } - bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; - // set the rest of the arguments + params.coords = arguments[1]; int extraArgs = 0; - if (cubeCompare) + + // sort out where Dref is coming from + if (sampler.shadow && sampler.dim == glslang::EsdCube && sampler.arrayed) params.Dref = arguments[2]; - else if (sampler.shadow) { + else if (sampler.shadow && cracked.gather) { + params.Dref = arguments[2]; + ++extraArgs; + } else if (sampler.shadow) { std::vector indexes; int comp; if (cracked.proj) @@ -1954,20 +1947,28 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO params.gradY = arguments[3 + extraArgs]; extraArgs += 2; } - //if (gather && compare) { - // params.compare = arguments[2 + extraArgs]; - // ++extraArgs; - //} - if (cracked.offset || cracked.offsets) { + if (cracked.offset) { params.offset = arguments[2 + extraArgs]; ++extraArgs; + } else if (cracked.offsets) { + params.offsets = arguments[2 + extraArgs]; + ++extraArgs; } if (bias) { params.bias = arguments[2 + extraArgs]; ++extraArgs; } + if (cracked.gather && ! sampler.shadow) { + // default component is 0, if missing, otherwise an argument + if (2 + extraArgs < (int)arguments.size()) { + params.comp = arguments[2 + extraArgs]; + ++extraArgs; + } else { + params.comp = builder.makeIntConstant(0); + } + } - return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), cracked.fetch, cracked.proj, params); + return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), cracked.fetch, cracked.proj, cracked.gather, params); } spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) @@ -2308,6 +2309,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: { spv::Op unaryOp = spv::OpNop; int libCall = -1; + bool isUnsigned = typeProxy == glslang::EbtUint; bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; switch (op) { @@ -2538,11 +2540,13 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: unaryOp = spv::OpBitCount; break; case glslang::EOpFindLSB: - libCall = spv::GLSLstd450FindILSB; + libCall = spv::GLSLstd450FindILsb; break; case glslang::EOpFindMSB: - spv::MissingFunctionality("signed vs. unsigned FindMSB"); - libCall = spv::GLSLstd450FindSMSB; + if (isUnsigned) + libCall = spv::GLSLstd450FindUMsb; + else + libCall = spv::GLSLstd450FindSMsb; break; default: @@ -2717,7 +2721,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv opCode = spv::OpAtomicLoad; break; default: - spv::MissingFunctionality("missing nested atomic"); + assert(0); break; } @@ -2754,6 +2758,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: spv::Op opCode = spv::OpNop; int libCall = -1; + int consumedOperands = operands.size(); + spv::Id typeId0 = 0; + if (consumedOperands > 0) + typeId0 = builder.getTypeId(operands[0]); + spv::Id frexpIntType = 0; switch (op) { case glslang::EOpMin: @@ -2794,7 +2803,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450SClamp; break; case glslang::EOpMix: - libCall = spv::GLSLstd450Mix; + if (isFloat) + libCall = spv::GLSLstd450FMix; + else + libCall = spv::GLSLstd450IMix; break; case glslang::EOpStep: libCall = spv::GLSLstd450Step; @@ -2819,6 +2831,52 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450Refract; break; + case glslang::EOpAddCarry: + opCode = spv::OpIAddCarry; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpSubBorrow: + opCode = spv::OpISubBorrow; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpUMulExtended: + opCode = spv::OpUMulExtended; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpIMulExtended: + opCode = spv::OpSMulExtended; + typeId = builder.makeStructResultType(typeId0, typeId0); + consumedOperands = 2; + break; + case glslang::EOpBitfieldExtract: + if (isUnsigned) + opCode = spv::OpBitFieldUExtract; + else + opCode = spv::OpBitFieldSExtract; + break; + case glslang::EOpBitfieldInsert: + opCode = spv::OpBitFieldInsert; + break; + + case glslang::EOpFma: + libCall = spv::GLSLstd450Fma; + break; + case glslang::EOpFrexp: + libCall = spv::GLSLstd450FrexpStruct; + if (builder.getNumComponents(operands[0]) == 1) + frexpIntType = builder.makeIntegerType(32, true); + else + frexpIntType = builder.makeVectorType(builder.makeIntegerType(32, true), builder.getNumComponents(operands[0])); + typeId = builder.makeStructResultType(typeId0, frexpIntType); + consumedOperands = 1; + break; + case glslang::EOpLdexp: + libCall = spv::GLSLstd450Ldexp; + break; + default: return 0; } @@ -2827,7 +2885,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: if (libCall >= 0) id = builder.createBuiltinCall(precision, typeId, stdBuiltins, libCall, operands); else { - switch (operands.size()) { + switch (consumedOperands) { case 0: // should all be handled by visitAggregate and createNoArgOperation assert(0); @@ -2839,16 +2897,34 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case 2: id = builder.createBinOp(opCode, typeId, operands[0], operands[1]); break; - case 3: - id = builder.createTriOp(opCode, typeId, operands[0], operands[1], operands[2]); - break; default: - // These do not exist yet - assert(0 && "operation with more than 3 operands"); + // anything 3 or over doesn't have l-value operands, so all should be consumed + assert(consumedOperands == operands.size()); + id = builder.createOp(opCode, typeId, operands); break; } } + // Decode the return types that were structures + switch (op) { + case glslang::EOpAddCarry: + case glslang::EOpSubBorrow: + builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]); + id = builder.createCompositeExtract(id, typeId0, 0); + break; + case glslang::EOpUMulExtended: + case glslang::EOpIMulExtended: + builder.createStore(builder.createCompositeExtract(id, typeId0, 0), operands[3]); + builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]); + break; + case glslang::EOpFrexp: + builder.createStore(builder.createCompositeExtract(id, frexpIntType, 1), operands[1]); + id = builder.createCompositeExtract(id, typeId0, 0); + break; + default: + break; + } + builder.setPrecision(id, precision); return id; @@ -2883,13 +2959,13 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op) builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask); return 0; case glslang::EOpMemoryBarrierShared: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupLocalMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask); return 0; case glslang::EOpGroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupGlobalMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); return 0; default: - spv::MissingFunctionality("operation with no arguments"); + spv::MissingFunctionality("unknown operation with no arguments"); return 0; } } @@ -2945,31 +3021,57 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (builtIn != spv::BadValue) builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); - if (linkageOnly) - builder.addDecoration(id, spv::DecorationNoStaticUse); - return id; } +// If 'dec' is valid, add no-operand decoration to an object void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec) { if (dec != spv::BadValue) builder.addDecoration(id, dec); } +// If 'dec' is valid, add a one-operand decoration to an object +void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec, unsigned value) +{ + if (dec != spv::BadValue) + builder.addDecoration(id, dec, value); +} + +// If 'dec' is valid, add a no-operand decoration to a struct member void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec) { if (dec != spv::BadValue) builder.addMemberDecoration(id, (unsigned)member, dec); } +// Make a full tree of instructions to build a SPIR-V specialization constant, +// or regularly constant if possible. +// +// TBD: this is not yet done, nor verified to be the best design, it does do the leaf symbols though +// +// Recursively walk the nodes. The nodes form a tree whose leaves are +// regular constants, which themselves are trees that createSpvConstant() +// recursively walks. So, this function walks the "top" of the tree: +// - emit specialization constant-building instructions for specConstant +// - when running into a non-spec-constant, switch to createSpvConstant() +spv::Id TGlslangToSpvTraverser::createSpvSpecConstant(const glslang::TIntermTyped& node) +{ + assert(node.getQualifier().storage == glslang::EvqConst); + + // hand off to the non-spec-constant path + assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); + int nextConst = 0; + return createSpvConstant(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), nextConst, false); +} + // Use 'consts' as the flattened glslang source of scalar constants to recursively // build the aggregate SPIR-V constant. // // If there are not enough elements present in 'consts', 0 will be substituted; // an empty 'consts' can be used to create a fully zeroed SPIR-V constant. // -spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TType& glslangType, const glslang::TConstUnionArray& consts, int& nextConst) +spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TType& glslangType, const glslang::TConstUnionArray& consts, int& nextConst, bool specConstant) { // vector of constants for SPIR-V std::vector spvConsts; @@ -2980,15 +3082,15 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TType& glslangT if (glslangType.isArray()) { glslang::TType elementType(glslangType, 0); for (int i = 0; i < glslangType.getOuterArraySize(); ++i) - spvConsts.push_back(createSpvConstant(elementType, consts, nextConst)); + spvConsts.push_back(createSpvConstant(elementType, consts, nextConst, false)); } else if (glslangType.isMatrix()) { glslang::TType vectorType(glslangType, 0); for (int col = 0; col < glslangType.getMatrixCols(); ++col) - spvConsts.push_back(createSpvConstant(vectorType, consts, nextConst)); + spvConsts.push_back(createSpvConstant(vectorType, consts, nextConst, false)); } else if (glslangType.getStruct()) { glslang::TVector::const_iterator iter; for (iter = glslangType.getStruct()->begin(); iter != glslangType.getStruct()->end(); ++iter) - spvConsts.push_back(createSpvConstant(*iter->type, consts, nextConst)); + spvConsts.push_back(createSpvConstant(*iter->type, consts, nextConst, false)); } else if (glslangType.isVector()) { for (unsigned int i = 0; i < (unsigned int)glslangType.getVectorSize(); ++i) { bool zero = nextConst >= consts.size(); @@ -3009,7 +3111,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TType& glslangT spvConsts.push_back(builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst())); break; default: - spv::MissingFunctionality("constant vector type"); + assert(0); break; } ++nextConst; @@ -3020,22 +3122,22 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TType& glslangT spv::Id scalar = 0; switch (glslangType.getBasicType()) { case glslang::EbtInt: - scalar = builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst()); + scalar = builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst(), specConstant); break; case glslang::EbtUint: - scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst()); + scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant); break; case glslang::EbtFloat: - scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()); + scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; case glslang::EbtDouble: - scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst()); + scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant); break; case glslang::EbtBool: - scalar = builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst()); + scalar = builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst(), specConstant); break; default: - spv::MissingFunctionality("constant scalar type"); + assert(0); break; } ++nextConst; @@ -3180,7 +3282,7 @@ void GetSpirvVersion(std::string& version) { const int bufSize = 100; char buf[bufSize]; - snprintf(buf, bufSize, "%d, Revision %d", spv::Version, spv::Revision); + snprintf(buf, bufSize, "0x%08x, Revision %d", spv::Version, spv::Revision); version = buf; } diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index 0f303e3a..9beba211 100755 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -446,7 +446,6 @@ namespace spv { idFn(asId(word++)); break; - case spv::OperandOptionalId: case spv::OperandVariableIds: for (unsigned i = 0; i < numOperands; ++i) idFn(asId(word++)); diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index dba9c4c2..a46c924b 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -55,14 +55,12 @@ namespace spv { -const int SpvBuilderMagic = 0xBB; - -Builder::Builder(unsigned int userNumber) : +Builder::Builder(unsigned int magicNumber) : source(SourceLanguageUnknown), sourceVersion(0), addressModel(AddressingModelLogical), memoryModel(MemoryModelGLSL450), - builderNumber(userNumber << 16 | SpvBuilderMagic), + builderNumber(magicNumber), buildPoint(0), uniqueId(0), mainFunction(0) @@ -112,6 +110,20 @@ Id Builder::makeBoolType() return type->getResultId(); } +Id Builder::makeSamplerType() +{ + Instruction* type; + if (groupedTypes[OpTypeSampler].size() == 0) { + type = new Instruction(getUniqueId(), NoType, OpTypeSampler); + groupedTypes[OpTypeSampler].push_back(type); + constantsTypesGlobals.push_back(type); + module.mapInstruction(type); + } else + type = groupedTypes[OpTypeSampler].back(); + + return type->getResultId(); +} + Id Builder::makePointer(StorageClass storageClass, Id pointee) { // try to find it @@ -176,8 +188,15 @@ Id Builder::makeFloatType(int width) return type->getResultId(); } +// Make a struct without checking for duplication. +// See makeStructResultType() for non-decorated structs +// needed as the result of some instructions, which does +// check for duplicates. Id Builder::makeStructType(std::vector& members, const char* name) { + // Don't look for previous one, because in the general case, + // structs can be duplicated except for decorations. + // not found, make it Instruction* type = new Instruction(getUniqueId(), NoType, OpTypeStruct); for (int op = 0; op < (int)members.size(); ++op) @@ -190,6 +209,30 @@ Id Builder::makeStructType(std::vector& members, const char* name) return type->getResultId(); } +// Make a struct for the simple results of several instructions, +// checking for duplication. +Id Builder::makeStructResultType(Id type0, Id type1) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[OpTypeStruct].size(); ++t) { + type = groupedTypes[OpTypeStruct][t]; + if (type->getNumOperands() != 2) + continue; + if (type->getIdOperand(0) != type0 || + type->getIdOperand(1) != type1) + continue; + return type->getResultId(); + } + + // not found, make it + std::vector members; + members.push_back(type0); + members.push_back(type1); + + return makeStructType(members, "ResType"); +} + Id Builder::makeVectorType(Id component, int size) { // try to find it @@ -387,7 +430,7 @@ Op Builder::getMostBasicTypeClass(Id typeId) const case OpTypePointer: return getMostBasicTypeClass(instr->getIdOperand(1)); default: - MissingFunctionality("getMostBasicTypeClass"); + assert(0); return OpTypeFloat; } } @@ -406,7 +449,7 @@ int Builder::getNumTypeComponents(Id typeId) const case OpTypeMatrix: return instr->getImmediateOperand(1); default: - MissingFunctionality("getNumTypeComponents on non bool/int/float/vector/matrix"); + assert(0); return 1; } } @@ -434,7 +477,7 @@ Id Builder::getScalarTypeId(Id typeId) const case OpTypePointer: return getScalarTypeId(getContainedTypeId(typeId)); default: - MissingFunctionality("getScalarTypeId"); + assert(0); return NoResult; } } @@ -457,7 +500,7 @@ Id Builder::getContainedTypeId(Id typeId, int member) const case OpTypeStruct: return instr->getIdOperand(member); default: - MissingFunctionality("getContainedTypeId"); + assert(0); return NoResult; } } @@ -470,12 +513,12 @@ Id Builder::getContainedTypeId(Id typeId) const // See if a scalar constant of this type has already been created, so it // can be reused rather than duplicated. (Required by the specification). -Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned value) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { constant = groupedConstants[typeClass][i]; - if (constant->getNumOperands() == 1 && + if (constant->getOpCode() == opcode && constant->getTypeId() == typeId && constant->getImmediateOperand(0) == value) return constant->getResultId(); @@ -485,12 +528,12 @@ Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned value) const } // Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double'). -Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned v1, unsigned v2) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { constant = groupedConstants[typeClass][i]; - if (constant->getNumOperands() == 2 && + if (constant->getOpCode() == opcode && constant->getTypeId() == typeId && constant->getImmediateOperand(0) == v1 && constant->getImmediateOperand(1) == v2) @@ -524,18 +567,17 @@ bool Builder::isConstantOpCode(Op opcode) const } } -Id Builder::makeBoolConstant(bool b) +Id Builder::makeBoolConstant(bool b, bool specConstant) { Id typeId = makeBoolType(); Instruction* constant; + Op opcode = specConstant ? (b ? OpSpecConstantTrue : OpSpecConstantFalse) : (b ? OpConstantTrue : OpConstantFalse); // See if we already made it Id existing = 0; for (int i = 0; i < (int)groupedConstants[OpTypeBool].size(); ++i) { constant = groupedConstants[OpTypeBool][i]; - if (constant->getTypeId() == typeId && - (b ? (constant->getOpCode() == OpConstantTrue) : - (constant->getOpCode() == OpConstantFalse))) + if (constant->getTypeId() == typeId && constant->getOpCode() == opcode) existing = constant->getResultId(); } @@ -543,7 +585,7 @@ Id Builder::makeBoolConstant(bool b) return existing; // Make it - Instruction* c = new Instruction(getUniqueId(), typeId, b ? OpConstantTrue : OpConstantFalse); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); constantsTypesGlobals.push_back(c); groupedConstants[OpTypeBool].push_back(c); module.mapInstruction(c); @@ -551,13 +593,14 @@ Id Builder::makeBoolConstant(bool b) return c->getResultId(); } -Id Builder::makeIntConstant(Id typeId, unsigned value) +Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) { - Id existing = findScalarConstant(OpTypeInt, typeId, value); + Op opcode = specConstant ? OpSpecConstant : OpConstant; + Id existing = findScalarConstant(OpTypeInt, opcode, typeId, value); if (existing) return existing; - Instruction* c = new Instruction(getUniqueId(), typeId, OpConstant); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(c); groupedConstants[OpTypeInt].push_back(c); @@ -566,15 +609,16 @@ Id Builder::makeIntConstant(Id typeId, unsigned value) return c->getResultId(); } -Id Builder::makeFloatConstant(float f) +Id Builder::makeFloatConstant(float f, bool specConstant) { + Op opcode = specConstant ? OpSpecConstant : OpConstant; Id typeId = makeFloatType(32); unsigned value = *(unsigned int*)&f; - Id existing = findScalarConstant(OpTypeFloat, typeId, value); + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, value); if (existing) return existing; - Instruction* c = new Instruction(getUniqueId(), typeId, OpConstant); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(c); groupedConstants[OpTypeFloat].push_back(c); @@ -583,17 +627,18 @@ Id Builder::makeFloatConstant(float f) return c->getResultId(); } -Id Builder::makeDoubleConstant(double d) +Id Builder::makeDoubleConstant(double d, bool specConstant) { + Op opcode = specConstant ? OpSpecConstant : OpConstant; Id typeId = makeFloatType(64); unsigned long long value = *(unsigned long long*)&d; unsigned op1 = value & 0xFFFFFFFF; unsigned op2 = value >> 32; - Id existing = findScalarConstant(OpTypeFloat, typeId, op1, op2); + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, op1, op2); if (existing) return existing; - Instruction* c = new Instruction(getUniqueId(), typeId, OpConstant); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(op1); c->addImmediateOperand(op2); constantsTypesGlobals.push_back(c); @@ -644,7 +689,7 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector& members) case OpTypeMatrix: break; default: - MissingFunctionality("Constant composite type in Builder"); + assert(0); return makeFloatConstant(0.0); } @@ -662,7 +707,7 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector& members) return c->getResultId(); } -void Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name) +Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name) { Instruction* entryPoint = new Instruction(OpEntryPoint); entryPoint->addImmediateOperand(model); @@ -670,6 +715,8 @@ void Builder::addEntryPoint(ExecutionModel model, Function* function, const char entryPoint->addStringOperand(name); entryPoints.push_back(entryPoint); + + return entryPoint; } // Currently relying on the fact that all 'value' of interest are small non-negative values. @@ -720,6 +767,8 @@ void Builder::addLine(Id target, Id fileName, int lineNum, int column) void Builder::addDecoration(Id id, Decoration decoration, int num) { + if (decoration == (spv::Decoration)spv::BadValue) + return; Instruction* dec = new Instruction(OpDecorate); dec->addIdOperand(id); dec->addImmediateOperand(decoration); @@ -833,25 +882,14 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name) inst->addImmediateOperand(storageClass); switch (storageClass) { - case StorageClassUniformConstant: - case StorageClassUniform: - case StorageClassInput: - case StorageClassOutput: - case StorageClassWorkgroupLocal: - case StorageClassPrivateGlobal: - case StorageClassWorkgroupGlobal: - case StorageClassAtomicCounter: - constantsTypesGlobals.push_back(inst); - module.mapInstruction(inst); - break; - case StorageClassFunction: // Validation rules require the declaration in the entry block buildPoint->getParent().addLocalVariable(inst); break; default: - MissingFunctionality("storage class in createVariable"); + constantsTypesGlobals.push_back(inst); + module.mapInstruction(inst); break; } @@ -1175,7 +1213,7 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti // Accept all parameters needed to create a texture instruction. // Create the correct instruction based on the inputs, and make the call. -Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, const TextureParameters& parameters) +Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, bool gather, const TextureParameters& parameters) { static const int maxTextureArgs = 10; Id texArgs[maxTextureArgs] = {}; @@ -1189,6 +1227,8 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b texArgs[numArgs++] = parameters.coords; if (parameters.Dref) texArgs[numArgs++] = parameters.Dref; + if (parameters.comp) + texArgs[numArgs++] = parameters.comp; // // Set up the optional arguments @@ -1238,6 +1278,11 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b opCode = OpImageSampleImplicitLod; if (fetch) { opCode = OpImageFetch; + } else if (gather) { + if (parameters.Dref) + opCode = OpImageDrefGather; + else + opCode = OpImageGather; } else if (xplicit) { if (parameters.Dref) { if (proj) @@ -1281,6 +1326,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b } } + // Build the SPIR-V instruction Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); for (int op = 0; op < optArgNum; ++op) textureInst->addIdOperand(texArgs[op]); @@ -1324,8 +1370,12 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter case Dim3D: numComponents = 3; break; + case DimSubpassData: + MissingFunctionality("input-attachment dim"); + break; + default: - MissingFunctionality("texture query dimensionality"); + assert(0); break; } if (isArrayedImageType(getImageType(parameters.sampler))) @@ -1345,7 +1395,8 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter resultType = makeIntType(32); break; default: - MissingFunctionality("Texture query op code"); + assert(0); + break; } Instruction* query = new Instruction(getUniqueId(), resultType, opCode); @@ -1359,57 +1410,6 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter return query->getResultId(); } -// Comments in header -//Id Builder::createSamplePositionCall(Decoration precision, Id returnType, Id sampleIdx) -//{ -// // Return type is only flexible type -// Function* opCode = (fSamplePosition, returnType); -// -// Instruction* instr = (opCode, sampleIdx); -// setPrecision(instr, precision); -// -// return instr; -//} - -// Comments in header -//Id Builder::createBitFieldExtractCall(Decoration precision, Id id, Id offset, Id bits, bool isSigned) -//{ -// Op opCode = isSigned ? sBitFieldExtract -// : uBitFieldExtract; -// -// if (isScalar(offset) == false || isScalar(bits) == false) -// MissingFunctionality("bitFieldExtract operand types"); -// -// // Dest and value are matching flexible types -// Function* opCode = (opCode, id->getType(), id->getType()); -// -// assert(opCode); -// -// Instruction* instr = (opCode, id, offset, bits); -// setPrecision(instr, precision); -// -// return instr; -//} - -// Comments in header -//Id Builder::createBitFieldInsertCall(Decoration precision, Id base, Id insert, Id offset, Id bits) -//{ -// Op opCode = bitFieldInsert; -// -// if (isScalar(offset) == false || isScalar(bits) == false) -// MissingFunctionality("bitFieldInsert operand types"); -// -// // Dest, base, and insert are matching flexible types -// Function* opCode = (opCode, base->getType(), base->getType(), base->getType()); -// -// assert(opCode); -// -// Instruction* instr = (opCode, base, insert, offset, bits); -// setPrecision(instr, precision); -// -// return instr; -//} - // Comments in header Id Builder::createCompare(Decoration precision, Id value1, Id value2, bool equal) { @@ -1488,115 +1488,6 @@ Id Builder::createCompare(Decoration precision, Id value1, Id value2, bool equal //return result; } -// Comments in header -//Id Builder::createOperation(Decoration precision, Op opCode, Id operand) -//{ -// Op* opCode = 0; -// -// // Handle special return types here. Things that don't have same result type as parameter -// switch (opCode) { -// case fIsNan: -// case fIsInf: -// break; -// case fFloatBitsToInt: -// break; -// case fIntBitsTofloat: -// break; -// case fPackSnorm2x16: -// case fPackUnorm2x16: -// case fPackHalf2x16: -// break; -// case fUnpackUnorm2x16: -// case fUnpackSnorm2x16: -// case fUnpackHalf2x16: -// break; -// -// case fFrexp: -// case fLdexp: -// case fPackUnorm4x8: -// case fPackSnorm4x8: -// case fUnpackUnorm4x8: -// case fUnpackSnorm4x8: -// case fPackDouble2x32: -// case fUnpackDouble2x32: -// break; -// case fLength: -// // scalar result type -// break; -// case any: -// case all: -// // fixed result type -// break; -// case fModF: -// // modf() will return a struct that the caller must decode -// break; -// default: -// // Unary operations that have operand and dest with same flexible type -// break; -// } -// -// assert(opCode); -// -// Instruction* instr = (opCode, operand); -// setPrecision(instr, precision); -// -// return instr; -//} -// -//// Comments in header -//Id Builder::createOperation(Decoration precision, Op opCode, Id operand0, Id operand1) -//{ -// Function* opCode = 0; -// -// // Handle special return types here. Things that don't have same result type as parameter -// switch (opCode) { -// case fDistance: -// case fDot2: -// case fDot3: -// case fDot4: -// // scalar result type -// break; -// case fStep: -// // first argument can be scalar, return and second argument match -// break; -// case fSmoothStep: -// // first argument can be scalar, return and second argument match -// break; -// default: -// // Binary operations that have operand and dest with same flexible type -// break; -// } -// -// assert(opCode); -// -// Instruction* instr = (opCode, operand0, operand1); -// setPrecision(instr, precision); -// -// return instr; -//} -// -//Id Builder::createOperation(Decoration precision, Op opCode, Id operand0, Id operand1, Id operand2) -//{ -// Function* opCode; -// -// // Handle special return types here. Things that don't have same result type as parameter -// switch (opCode) { -// case fSmoothStep: -// // first argument can be scalar, return and second argument match -// break; -// default: -// // Use operand0 type as result type -// break; -// } -// -// assert(opCode); -// -// Instruction* instr = (opCode, operand0, operand1, operand2); -// setPrecision(instr, precision); -// -// return instr; -//} - // OpCompositeConstruct Id Builder::createCompositeConstruct(Id typeId, std::vector& constituents) { @@ -1625,11 +1516,8 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc Id scalarTypeId = getScalarTypeId(resultTypeId); std::vector constituents; // accumulate the arguments for OpCompositeConstruct for (unsigned int i = 0; i < sources.size(); ++i) { - if (isAggregate(sources[i])) - MissingFunctionality("aggregate in vector constructor"); - + assert(! isAggregate(sources[i])); unsigned int sourceSize = getNumComponents(sources[i]); - unsigned int sourcesToUse = sourceSize; if (sourcesToUse + targetComponent > numTargetComponents) sourcesToUse = numTargetComponents - targetComponent; @@ -1790,7 +1678,7 @@ void Builder::If::makeEndIf() // Go back to the headerBlock and make the flow control split builder.setBuildPoint(headerBlock); - builder.createMerge(OpSelectionMerge, mergeBlock, SelectionControlMaskNone); + builder.createSelectionMerge(mergeBlock, SelectionControlMaskNone); if (elseBlock) builder.createConditionalBranch(condition, thenBlock, elseBlock); else @@ -1814,7 +1702,7 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector& caseVal Block* mergeBlock = new Block(getUniqueId(), function); // make and insert the switch's selection-merge instruction - createMerge(OpSelectionMerge, mergeBlock, SelectionControlMaskNone); + createSelectionMerge(mergeBlock, SelectionControlMaskNone); // make the switch instruction Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch); @@ -1898,7 +1786,7 @@ void Builder::makeNewLoop(bool loopTestFirst) getBuildPoint()->addInstruction(loop.isFirstIteration); // Mark the end of the structured loop. This must exist in the loop header block. - createMerge(OpLoopMerge, loop.merge, LoopControlMaskNone); + createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); // Generate code to see if this is the first iteration of the loop. // It needs to be in its own block, since the loop merge and @@ -1912,7 +1800,7 @@ void Builder::makeNewLoop(bool loopTestFirst) // Control flow after this "if" normally reconverges at the loop body. // However, the loop test has a "break branch" out of this selection // construct because it can transfer control to the loop merge block. - createMerge(OpSelectionMerge, loop.body, SelectionControlMaskNone); + createSelectionMerge(loop.body, SelectionControlMaskNone); Block* loopTest = new Block(getUniqueId(), *loop.function); createConditionalBranch(loop.isFirstIteration->getResultId(), loop.body, loopTest); @@ -1930,7 +1818,7 @@ void Builder::createLoopTestBranch(Id condition) // the body, then this is a loop merge. Otherwise the loop merge // has already been generated and this is a conditional merge. if (loop.testFirst) { - createMerge(OpLoopMerge, loop.merge, LoopControlMaskNone); + createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); // Branching to the "body" block will keep control inside // the loop. createConditionalBranch(condition, loop.body, loop.merge); @@ -1943,7 +1831,7 @@ void Builder::createLoopTestBranch(Id condition) // of a merge instruction, and a block can't be the target of more // than one merge instruction, we need to make an intermediate block. Block* stayInLoopBlock = new Block(getUniqueId(), *loop.function); - createMerge(OpSelectionMerge, stayInLoopBlock, SelectionControlMaskNone); + createSelectionMerge(stayInLoopBlock, SelectionControlMaskNone); // This is the loop test. createConditionalBranch(condition, stayInLoopBlock, loop.merge); @@ -2047,12 +1935,13 @@ void Builder::accessChainStore(Id rvalue) { assert(accessChain.isRValue == false); + transferAccessChainSwizzle(true); Id base = collapseAccessChain(); if (accessChain.swizzle.size() && accessChain.component != NoResult) MissingFunctionality("simultaneous l-value swizzle and dynamic component selection"); - // If swizzle exists, it is out-of-order or not full, we must load the target vector, + // 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; if (accessChain.swizzle.size()) { @@ -2078,8 +1967,9 @@ Id Builder::accessChainLoad(Id resultType) Id id; if (accessChain.isRValue) { + // transfer access chain, but keep it static, so we can stay in registers + transferAccessChainSwizzle(false); if (accessChain.indexChain.size() > 0) { - mergeAccessChainSwizzle(); // TODO: optimization: look at applying this optimization more widely Id swizzleBase = accessChain.preSwizzleBaseType != NoType ? accessChain.preSwizzleBaseType : resultType; // if all the accesses are constants, we can use OpCompositeExtract @@ -2113,6 +2003,7 @@ Id Builder::accessChainLoad(Id resultType) } else id = accessChain.base; } else { + transferAccessChainSwizzle(true); // load through the access chain id = createLoad(collapseAccessChain()); } @@ -2142,6 +2033,7 @@ Id Builder::accessChainGetLValue() { assert(accessChain.isRValue == false); + transferAccessChainSwizzle(true); Id lvalue = collapseAccessChain(); // If swizzle exists, it is out-of-order or not full, we must load the target vector, @@ -2162,7 +2054,26 @@ void Builder::dump(std::vector& out) const out.push_back(uniqueId + 1); out.push_back(0); - // First instructions, some created on the spot here: + // Capabilities + for (auto cap : capabilities) { + Instruction capInst(0, 0, OpCapability); + capInst.addImmediateOperand(cap); + capInst.dump(out); + } + + // TBD: OpExtension ... + + dumpInstructions(out, imports); + Instruction memInst(0, 0, OpMemoryModel); + memInst.addImmediateOperand(addressModel); + memInst.addImmediateOperand(memoryModel); + memInst.dump(out); + + // Instructions saved up while building: + dumpInstructions(out, entryPoints); + dumpInstructions(out, executionModes); + + // Debug instructions if (source != SourceLanguageUnknown) { Instruction sourceInst(0, 0, OpSource); sourceInst.addImmediateOperand(source); @@ -2174,28 +2085,12 @@ void Builder::dump(std::vector& out) const extInst.addStringOperand(extensions[e]); extInst.dump(out); } - - // TBD: OpExtension ... - - // Capabilities - for (auto cap : capabilities) { - Instruction capInst(0, 0, OpCapability); - capInst.addImmediateOperand(cap); - capInst.dump(out); - } - - dumpInstructions(out, imports); - Instruction memInst(0, 0, OpMemoryModel); - memInst.addImmediateOperand(addressModel); - memInst.addImmediateOperand(memoryModel); - memInst.dump(out); - - // Instructions saved up while building: - dumpInstructions(out, entryPoints); - dumpInstructions(out, executionModes); dumpInstructions(out, names); dumpInstructions(out, lines); + + // Annotation instructions dumpInstructions(out, decorations); + dumpInstructions(out, constantsTypesGlobals); dumpInstructions(out, externals); @@ -2207,10 +2102,13 @@ void Builder::dump(std::vector& out) const // Protected methods. // +// Turn the described access chain in 'accessChain' into an instruction +// computing its address. This *cannot* include complex swizzles, which must +// be handled after this is called, but it does include swizzles that select +// an individual element, as a single address of a scalar type can be +// computed by an OpAccessChain instruction. Id Builder::collapseAccessChain() { - // TODO: bring in an individual component swizzle here, so that a pointer - // all the way to the component level can be created. assert(accessChain.isRValue == false); if (accessChain.indexChain.size() > 0) { @@ -2222,9 +2120,12 @@ Id Builder::collapseAccessChain() return accessChain.instr; } else return accessChain.base; + + // note that non-trivial swizzling is left pending... } -// clear out swizzle if it is redundant +// clear out swizzle if it is redundant, that is reselecting the same components +// that would be present without the swizzle. void Builder::simplifyAccessChainSwizzle() { // If the swizzle has fewer components than the vector, it is subsetting, and must stay @@ -2244,29 +2145,45 @@ void Builder::simplifyAccessChainSwizzle() accessChain.preSwizzleBaseType = NoType; } -// clear out swizzle if it can become part of the indexes -void Builder::mergeAccessChainSwizzle() +// To the extent any swizzling can become part of the chain +// of accesses instead of a post operation, make it so. +// If 'dynamic' is true, include transfering a non-static component index, +// otherwise, only transfer static indexes. +// +// Also, Boolean vectors are likely to be special. While +// for external storage, they should only be integer types, +// function-local bool vectors could use sub-word indexing, +// so keep that as a separate Insert/Extract on a loaded vector. +void Builder::transferAccessChainSwizzle(bool dynamic) { - // is there even a chance of doing something? Need a single-component swizzle - if ((accessChain.swizzle.size() > 1) || - (accessChain.swizzle.size() == 0 && accessChain.component == NoResult)) + // too complex? + if (accessChain.swizzle.size() > 1) return; - // TODO: optimization: remove this, but for now confine this to non-dynamic accesses - // (the above test is correct when this is removed.) - if (accessChain.component != NoResult) + // non existent? + if (accessChain.swizzle.size() == 0 && accessChain.component == NoResult) return; - // move the swizzle over to the indexes - if (accessChain.swizzle.size() == 1) + // single component... + + // skip doing it for Boolean vectors + if (isBoolType(getContainedTypeId(accessChain.preSwizzleBaseType))) + return; + + if (accessChain.swizzle.size() == 1) { + // handle static component accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle.front())); - else + accessChain.swizzle.clear(); + // note, the only valid remaining dynamic access would be to this one + // component, so don't bother even looking at accessChain.component + accessChain.preSwizzleBaseType = NoType; + accessChain.component = NoResult; + } else if (dynamic && accessChain.component != NoResult) { + // handle dynamic component accessChain.indexChain.push_back(accessChain.component); - - // now there is no need to track this swizzle - accessChain.component = NoResult; - accessChain.preSwizzleBaseType = NoType; - accessChain.swizzle.clear(); + accessChain.preSwizzleBaseType = NoType; + accessChain.component = NoResult; + } } // Utility method for creating a new block and setting the insert point to @@ -2292,14 +2209,23 @@ void Builder::createBranch(Block* block) block->addPredecessor(buildPoint); } -void Builder::createMerge(Op mergeCode, Block* mergeBlock, unsigned int control) +void Builder::createSelectionMerge(Block* mergeBlock, unsigned int control) { - Instruction* merge = new Instruction(mergeCode); + Instruction* merge = new Instruction(OpSelectionMerge); merge->addIdOperand(mergeBlock->getId()); merge->addImmediateOperand(control); buildPoint->addInstruction(merge); } +void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control) +{ + Instruction* merge = new Instruction(OpLoopMerge); + merge->addIdOperand(mergeBlock->getId()); + merge->addIdOperand(continueBlock->getId()); + merge->addImmediateOperand(control); + buildPoint->addInstruction(merge); +} + void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock) { Instruction* branch = new Instruction(OpBranchConditional); diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 3bc8db2c..5750b00f 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -99,12 +99,14 @@ public: Id makeUintType(int width) { return makeIntegerType(width, false); } Id makeFloatType(int width); Id makeStructType(std::vector& members, const char*); + Id makeStructResultType(Id type0, Id type1); Id makeVectorType(Id component, int size); Id makeMatrixType(Id component, int cols, int rows); Id makeArrayType(Id element, unsigned size); Id makeRuntimeArray(Id element); Id makeFunctionType(Id returnType, std::vector& paramTypes); Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format); + Id makeSamplerType(); Id makeSampledImageType(Id imageType); // For querying about types. @@ -118,12 +120,14 @@ public: Id getScalarTypeId(Id typeId) const; Id getContainedTypeId(Id typeId) const; Id getContainedTypeId(Id typeId, int) const; + StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); } bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); } bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); } bool isVector(Id resultId) const { return isVectorType(getTypeId(resultId)); } bool isMatrix(Id resultId) const { return isMatrixType(getTypeId(resultId)); } bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); } + bool isBoolType(Id typeId) const { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } bool isPointerType(Id typeId) const { return getTypeClass(typeId) == OpTypePointer; } bool isScalarType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat || getTypeClass(typeId) == OpTypeInt || getTypeClass(typeId) == OpTypeBool; } @@ -140,6 +144,7 @@ public: bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); } bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; } unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); } + StorageClass getStorageClass(Id resultId) const { return getTypeStorageClass(getTypeId(resultId)); } int getTypeNumColumns(Id typeId) const { @@ -172,18 +177,17 @@ public: } // For making new constants (will return old constant if the requested one was already made). - Id makeBoolConstant(bool b); - Id makeIntConstant(Id typeId, unsigned value); - Id makeIntConstant(int i) { return makeIntConstant(makeIntType(32), (unsigned)i); } - Id makeUintConstant(unsigned u) { return makeIntConstant(makeUintType(32), u); } - Id makeFloatConstant(float f); - Id makeDoubleConstant(double d); + Id makeBoolConstant(bool b, bool specConstant = false); + Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } + Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); } + Id makeFloatConstant(float f, bool specConstant = false); + Id makeDoubleConstant(double d, bool specConstant = false); // Turn the array of constants into a proper spv constant of the requested type. Id makeCompositeConstant(Id type, std::vector& comps); // Methods for adding information outside the CFG. - void addEntryPoint(ExecutionModel, Function*, const char* name); + Instruction* addEntryPoint(ExecutionModel, Function*, const char* name); void addExecutionMode(Function*, ExecutionMode mode, int value1 = -1, int value2 = -1, int value3 = -1); void addName(Id, const char* name); void addMemberName(Id, int member, const char* name); @@ -296,10 +300,11 @@ public: Id gradX; Id gradY; Id sample; + Id comp; }; // Select the correct texture operation based on all inputs, and emit the correct instruction - Id createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, const TextureParameters&); + Id createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, bool gather, const TextureParameters&); // Emit the OpTextureQuery* instruction that was passed in. // Figure out the right return value and type, and return it. @@ -426,13 +431,13 @@ public: // struct AccessChain { - Id base; // for l-values, pointer to the base object, for r-values, the base object + Id base; // for l-values, pointer to the base object, for r-values, the base object std::vector indexChain; - Id instr; // the instruction that generates this access chain - std::vector swizzle; - Id component; // a dynamic component index, can coexist with a swizzle, done after the swizzle - Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; NoType unless a swizzle or component is present - bool isRValue; + Id instr; // cache the instruction that generates this access chain + std::vector swizzle; // each std::vector element selects the next GLSL component number + Id component; // a dynamic component index, can coexist with a swizzle, done after the swizzle, NoResult if not present + Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; NoType unless a swizzle or component is present + bool isRValue; // true if 'base' is an r-value, otherwise, base is an l-value }; // @@ -490,15 +495,17 @@ public: void dump(std::vector&) const; protected: - Id findScalarConstant(Op typeClass, Id typeId, unsigned value) const; - Id findScalarConstant(Op typeClass, Id typeId, unsigned v1, unsigned v2) const; + Id makeIntConstant(Id typeId, unsigned value, bool specConstant); + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; Id findCompositeConstant(Op typeClass, std::vector& comps) const; Id collapseAccessChain(); + void transferAccessChainSwizzle(bool dynamic); void simplifyAccessChainSwizzle(); - void mergeAccessChainSwizzle(); void createAndSetNoPredecessorBlock(const char*); void createBranch(Block* block); - void createMerge(Op, Block*, unsigned int control); + void createSelectionMerge(Block* mergeBlock, unsigned int control); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); void dumpInstructions(std::vector&, const std::vector&) const; diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp index 9df69e96..8662f036 100755 --- a/SPIRV/disassemble.cpp +++ b/SPIRV/disassemble.cpp @@ -48,15 +48,17 @@ #include #include +namespace spv { + // Include C-based headers that don't have a namespace + #include "SPIRV/GLSL.std.450.h" +} +const char* GlslStd450DebugNames[spv::GLSLstd450Count]; + #include "disassemble.h" #include "doc.h" namespace spv { -#include "GLSL.std.450.h" - -const char* GlslStd450DebugNames[spv::GLSLstd450Count]; - void Kill(std::ostream& out, const char* message) { out << std::endl << "Disassembly failed: " << message << std::endl; @@ -92,7 +94,7 @@ protected: void outputMask(OperandClass operandClass, unsigned mask); void disassembleImmediates(int numOperands); void disassembleIds(int numOperands); - void disassembleString(); + int disassembleString(); void disassembleInstruction(Id resultId, Id typeId, Op opCode, int numOperands); // Data @@ -128,10 +130,10 @@ void SpirvStream::validate() } // Version - out << "// Module Version " << stream[word++] << std::endl; + out << "// Module Version " << std::hex << stream[word++] << std::endl; // Generator's magic number - out << "// Generated by (magic number): " << std::setbase(16) << stream[word++] << std::setbase(10) << std::endl; + out << "// Generated by (magic number): " << std::hex << stream[word++] << std::dec << std::endl; // Result bound bound = stream[word++]; @@ -280,15 +282,18 @@ void SpirvStream::disassembleIds(int numOperands) } } -void SpirvStream::disassembleString() +// return the number of operands consumed by the string +int SpirvStream::disassembleString() { + int startWord = word; + out << " \""; - char* wordString; + const char* wordString; bool done = false; do { unsigned int content = stream[word]; - wordString = (char*)&content; + wordString = (const char*)&content; for (int charCount = 0; charCount < 4; ++charCount) { if (*wordString == 0) { done = true; @@ -300,6 +305,8 @@ void SpirvStream::disassembleString() } while (! done); out << "\""; + + return word - startWord; } void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, int numOperands) @@ -389,15 +396,15 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, case OperandScope: case OperandMemorySemantics: disassembleIds(1); + --numOperands; // Get names for printing "(XXX)" for readability, *after* this id if (opCode == OpName) idDescriptor[stream[word - 1]] = (const char*)(&stream[word]); break; - case OperandOptionalId: case OperandVariableIds: disassembleIds(numOperands); return; - case OperandOptionalImage: + case OperandImageOperands: outputMask(OperandImageOperands, stream[word++]); --numOperands; disassembleIds(numOperands); @@ -440,6 +447,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, return; case OperandLiteralNumber: disassembleImmediates(1); + --numOperands; if (opCode == OpExtInst) { ExtInstSet extInstSet = GLSL450Inst; if (0 == memcmp("OpenCL", (const char*)(idDescriptor[stream[word-2]].c_str()), 6)) { @@ -447,15 +455,16 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, } unsigned entrypoint = stream[word - 1]; if (extInstSet == GLSL450Inst) { - if (entrypoint < spv::GLSLstd450Count) { + if (entrypoint < GLSLstd450Count) { out << "(" << GlslStd450DebugNames[entrypoint] << ")"; } } } break; + case OperandOptionalLiteralString: case OperandLiteralString: - disassembleString(); - return; + numOperands -= disassembleString(); + break; default: assert(operandClass >= OperandSource && operandClass < OperandOpcode); @@ -463,10 +472,9 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, outputMask(operandClass, stream[word++]); else out << OperandClassParams[operandClass].getName(stream[word++]); - + --numOperands; break; } - --numOperands; } return; @@ -508,9 +516,9 @@ void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450Exp2] = "Exp2"; names[GLSLstd450Log2] = "Log2"; names[GLSLstd450Sqrt] = "Sqrt"; - names[GLSLstd450InverseSqrt] = "Inversesqrt"; + names[GLSLstd450InverseSqrt] = "InverseSqrt"; names[GLSLstd450Determinant] = "Determinant"; - names[GLSLstd450MatrixInverse] = "Inverse"; + names[GLSLstd450MatrixInverse] = "MatrixInverse"; names[GLSLstd450Modf] = "Modf"; names[GLSLstd450ModfStruct] = "ModfStruct"; names[GLSLstd450FMin] = "FMin"; @@ -522,9 +530,10 @@ void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450FClamp] = "FClamp"; names[GLSLstd450SClamp] = "SClamp"; names[GLSLstd450UClamp] = "UClamp"; - names[GLSLstd450Mix] = "Mix"; + names[GLSLstd450FMix] = "FMix"; + names[GLSLstd450IMix] = "IMix"; names[GLSLstd450Step] = "Step"; - names[GLSLstd450SmoothStep] = "Smoothstep"; + names[GLSLstd450SmoothStep] = "SmoothStep"; names[GLSLstd450Fma] = "Fma"; names[GLSLstd450Frexp] = "Frexp"; names[GLSLstd450FrexpStruct] = "FrexpStruct"; @@ -545,15 +554,12 @@ void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450Distance] = "Distance"; names[GLSLstd450Cross] = "Cross"; names[GLSLstd450Normalize] = "Normalize"; - names[GLSLstd450FaceForward] = "Faceforward"; + names[GLSLstd450FaceForward] = "FaceForward"; names[GLSLstd450Reflect] = "Reflect"; names[GLSLstd450Refract] = "Refract"; - names[GLSLstd450AddCarry] = "UaddCarry"; - names[GLSLstd450SubBorrow] = "UsubBorrow"; - names[GLSLstd450MulExtended] = "UmulExtended"; - names[GLSLstd450FindILSB] = "FindILsb"; - names[GLSLstd450FindSMSB] = "FindSMsb"; - names[GLSLstd450FindUMSB] = "FindUMsb"; + names[GLSLstd450FindILsb] = "FindILsb"; + names[GLSLstd450FindSMsb] = "FindSMsb"; + names[GLSLstd450FindUMsb] = "FindUMsb"; names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid"; names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample"; names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset"; diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index ff0d7805..64a55f99 100755 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -64,7 +64,7 @@ namespace spv { // (for non-sparse mask enums, this is the number of enumurants) // -const int SourceLanguageCeiling = 4; +const int SourceLanguageCeiling = 5; const char* SourceString(int source) { @@ -72,7 +72,8 @@ const char* SourceString(int source) case 0: return "Unknown"; case 1: return "ESSL"; case 2: return "GLSL"; - case 3: return "OpenCL"; + case 3: return "OpenCL_C"; + case 4: return "OpenCL_CPP"; case SourceLanguageCeiling: default: return "Bad"; @@ -125,7 +126,7 @@ const char* MemoryString(int mem) } } -const int ExecutionModeCeiling = 32; +const int ExecutionModeCeiling = 33; const char* ExecutionModeString(int mode) { @@ -143,7 +144,7 @@ const char* ExecutionModeString(int mode) case 10: return "PointMode"; case 11: return "Xfb"; case 12: return "DepthReplacing"; - case 13: return "DepthAny"; + case 13: return "Bad"; case 14: return "DepthGreater"; case 15: return "DepthLess"; case 16: return "DepthUnchanged"; @@ -152,16 +153,17 @@ const char* ExecutionModeString(int mode) case 19: return "InputPoints"; case 20: return "InputLines"; case 21: return "InputLinesAdjacency"; - case 22: return "InputTriangles"; + case 22: return "Triangles"; case 23: return "InputTrianglesAdjacency"; - case 24: return "InputQuads"; - case 25: return "InputIsolines"; + case 24: return "Quads"; + case 25: return "Isolines"; case 26: return "OutputVertices"; case 27: return "OutputPoints"; case 28: return "OutputLineStrip"; case 29: return "OutputTriangleStrip"; case 30: return "VecTypeHint"; case 31: return "ContractionOff"; + case 32: return "Bad"; case ExecutionModeCeiling: default: return "Bad"; @@ -177,12 +179,12 @@ const char* StorageClassString(int StorageClass) case 1: return "Input"; case 2: return "Uniform"; case 3: return "Output"; - case 4: return "WorkgroupLocal"; - case 5: return "WorkgroupGlobal"; - case 6: return "PrivateGlobal"; + case 4: return "Workgroup"; + case 5: return "CrossWorkgroup"; + case 6: return "Private"; case 7: return "Function"; case 8: return "Generic"; - case 9: return "Bad"; + case 9: return "PushConstant"; case 10: return "AtomicCounter"; case 11: return "Image"; @@ -191,7 +193,7 @@ const char* StorageClassString(int StorageClass) } } -const int DecorationCeiling = 42; +const int DecorationCeiling = 45; const char* DecorationString(int decoration) { @@ -208,8 +210,8 @@ const char* DecorationString(int decoration) case 9: return "GLSLPacked"; case 10: return "CPacked"; case 11: return "BuiltIn"; - case 12: return "Smooth"; - case 13: return "Noperspective"; + case 12: return "Bad"; + case 13: return "NoPerspective"; case 14: return "Flat"; case 15: return "Patch"; case 16: return "Centroid"; @@ -220,10 +222,10 @@ const char* DecorationString(int decoration) case 21: return "Volatile"; case 22: return "Constant"; case 23: return "Coherent"; - case 24: return "Nonwritable"; - case 25: return "Nonreadable"; + case 24: return "NonWritable"; + case 25: return "NonReadable"; case 26: return "Uniform"; - case 27: return "NoStaticUse"; + case 27: return "Bad"; case 28: return "SaturatedConversion"; case 29: return "Stream"; case 30: return "Location"; @@ -238,13 +240,16 @@ const char* DecorationString(int decoration) case 39: return "FP Rounding Mode"; case 40: return "FP Fast Math Mode"; case 41: return "Linkage Attributes"; + case 42: return "NoContraction"; + case 43: return "InputAttachmentIndex"; + case 44: return "Alignment"; case DecorationCeiling: default: return "Bad"; } } -const int BuiltInCeiling = 42; +const int BuiltInCeiling = 44; const char* BuiltInString(int builtIn) { @@ -270,7 +275,7 @@ const char* BuiltInString(int builtIn) case 18: return "SampleId"; case 19: return "SamplePosition"; case 20: return "SampleMask"; - case 21: return "FragColor"; + case 21: return "Bad"; case 22: return "FragDepth"; case 23: return "HelperInvocation"; case 24: return "NumWorkgroups"; @@ -284,20 +289,22 @@ const char* BuiltInString(int builtIn) case 32: return "EnqueuedWorkgroupSize"; case 33: return "GlobalOffset"; case 34: return "GlobalLinearId"; - case 35: return "WorkgroupLinearId"; + case 35: return "Bad"; case 36: return "SubgroupSize"; case 37: return "SubgroupMaxSize"; case 38: return "NumSubgroups"; case 39: return "NumEnqueuedSubgroups"; case 40: return "SubgroupId"; case 41: return "SubgroupLocalInvocationId"; + case 42: return "VertexIndex"; // TBD: put next to VertexId? + case 43: return "InstanceIndex"; // TBD: put next to InstanceId? case BuiltInCeiling: default: return "Bad"; } } -const int DimensionCeiling = 6; +const int DimensionCeiling = 7; const char* DimensionString(int dim) { @@ -308,6 +315,7 @@ const char* DimensionString(int dim) case 3: return "Cube"; case 4: return "Rect"; case 5: return "Buffer"; + case 6: return "SubpassData"; case DimensionCeiling: default: return "Bad"; @@ -438,7 +446,7 @@ const char* ImageChannelOrderString(int format) } } -const int ImageChannelDataTypeCeiling = 16; +const int ImageChannelDataTypeCeiling = 17; const char* ImageChannelDataTypeString(int type) { @@ -460,6 +468,7 @@ const char* ImageChannelDataTypeString(int type) case 13: return "HalfFloat"; case 14: return "Float"; case 15: return "UnormInt24"; + case 16: return "UnormInt101010_2"; case ImageChannelDataTypeCeiling: default: @@ -467,7 +476,7 @@ const char* ImageChannelDataTypeString(int type) } } -const int ImageOperandsCeiling = 7; +const int ImageOperandsCeiling = 8; const char* ImageOperandsString(int format) { @@ -479,6 +488,7 @@ const char* ImageOperandsString(int format) case 4: return "Offset"; case 5: return "ConstOffsets"; case 6: return "Sample"; + case 7: return "MinLod"; case ImageOperandsCeiling: default: @@ -604,35 +614,38 @@ const char* FunctionControlString(int cont) } } -const int MemorySemanticsCeiling = 10; +const int MemorySemanticsCeiling = 12; const char* MemorySemanticsString(int mem) { + // Note: No bits set (None) means "Relaxed" switch (mem) { - case 0: return "Relaxed"; - case 1: return "SequentiallyConsistent"; - case 2: return "Acquire"; - case 3: return "Release"; - - case 4: return "UniformMemory"; - case 5: return "SubgroupMemory"; - case 6: return "WorkgroupLocalMemory"; - case 7: return "WorkgroupGlobalMemory"; - case 8: return "AtomicCounterMemory"; - case 9: return "ImageMemory"; + case 0: return "Bad"; // Note: this is a placeholder for 'Consume' + case 1: return "Acquire"; + case 2: return "Release"; + case 3: return "AcquireRelease"; + case 4: return "SequentiallyConsistent"; + case 5: return "Bad"; // Note: reserved for future expansion + case 6: return "UniformMemory"; + case 7: return "SubgroupMemory"; + case 8: return "WorkgroupMemory"; + case 9: return "CrossWorkgroupMemory"; + case 10: return "AtomicCounterMemory"; + case 11: return "ImageMemory"; case MemorySemanticsCeiling: default: return "Bad"; } } -const int MemoryAccessCeiling = 2; +const int MemoryAccessCeiling = 3; const char* MemoryAccessString(int mem) { switch (mem) { case 0: return "Volatile"; case 1: return "Aligned"; + case 2: return "Nontemporal"; case MemoryAccessCeiling: default: return "Bad"; @@ -699,7 +712,7 @@ const char* KernelProfilingInfoString(int info) } } -const int CapabilityCeiling = 36; +const int CapabilityCeiling = 57; const char* CapabilityString(int info) { @@ -721,7 +734,7 @@ const char* CapabilityString(int info) case 13: return "ImageBasic"; case 14: return "ImageReadWrite"; case 15: return "ImageMipmap"; - case 16: return "ImageSRGBWrite"; + case 16: return "Bad"; case 17: return "Pipes"; case 18: return "Groups"; case 19: return "DeviceEnqueue"; @@ -731,7 +744,7 @@ const char* CapabilityString(int info) case 23: return "TessellationPointSize"; case 24: return "GeometryPointSize"; case 25: return "ImageGatherExtended"; - case 26: return "StorageImageExtendedFormats"; + case 26: return "Bad"; case 27: return "StorageImageMultisample"; case 28: return "UniformBufferArrayDynamicIndexing"; case 29: return "SampledImageArrayDynamicIndexing"; @@ -741,6 +754,27 @@ const char* CapabilityString(int info) case 33: return "CullDistance"; case 34: return "ImageCubeArray"; case 35: return "SampleRateShading"; + case 36: return "ImageRect"; + case 37: return "SampledRect"; + case 38: return "GenericPointer"; + case 39: return "Int8"; + case 40: return "InputAttachment"; + case 41: return "SparseResidency"; + case 42: return "MinLod"; + case 43: return "Sampled1D"; + case 44: return "Image1D"; + case 45: return "SampledCubeArray"; + case 46: return "SampledBuffer"; + case 47: return "ImageBuffer"; + case 48: return "ImageMSArray"; + case 49: return "StorageImageExtendedFormats"; + case 50: return "ImageQuery"; + case 51: return "DerivativeControl"; + case 52: return "InterpolationFunction"; + case 53: return "TransformFeedback"; + case 54: return "GeometryStreams"; + case 55: return "StorageImageReadWithoutFormat"; + case 56: return "StorageImageWriteWithoutFormat"; case CapabilityCeiling: default: return "Bad"; @@ -752,7 +786,7 @@ const char* OpcodeString(int op) switch (op) { case 0: return "OpNop"; case 1: return "OpUndef"; - case 2: return "Bad"; + case 2: return "OpSourceContinued"; case 3: return "OpSource"; case 4: return "OpSourceExtension"; case 5: return "OpName"; @@ -789,7 +823,7 @@ const char* OpcodeString(int op) case 36: return "OpTypeReserveId"; case 37: return "OpTypeQueue"; case 38: return "OpTypePipe"; - case 39: return "Bad"; + case 39: return "OpTypeForwardPointer"; case 40: return "Bad"; case 41: return "OpConstantTrue"; case 42: return "OpConstantFalse"; @@ -820,7 +854,7 @@ const char* OpcodeString(int op) case 67: return "OpPtrAccessChain"; case 68: return "OpArrayLength"; case 69: return "OpGenericPtrMemSemantics"; - case 70: return "Bad"; + case 70: return "OpInBoundsPtrAccessChain"; case 71: return "OpDecorate"; case 72: return "OpMemberDecorate"; case 73: return "OpDecorationGroup"; @@ -850,7 +884,7 @@ const char* OpcodeString(int op) case 97: return "OpImageDrefGather"; case 98: return "OpImageRead"; case 99: return "OpImageWrite"; - case 100: return "OpImageQueryDim"; + case 100: return "OpImage"; case 101: return "OpImageQueryFormat"; case 102: return "OpImageQueryOrder"; case 103: return "OpImageQuerySizeLod"; @@ -901,8 +935,8 @@ const char* OpcodeString(int op) case 148: return "OpDot"; case 149: return "OpIAddCarry"; case 150: return "OpISubBorrow"; - case 151: return "OpIMulExtended"; - case 152: return "Bad"; + case 151: return "OpUMulExtended"; + case 152: return "OpSMulExtended"; case 153: return "Bad"; case 154: return "OpAny"; case 155: return "OpAll"; @@ -1009,8 +1043,8 @@ const char* OpcodeString(int op) case 256: return "OpLifetimeStart"; case 257: return "OpLifetimeStop"; case 258: return "Bad"; - case 259: return "OpAsyncGroupCopy"; - case 260: return "OpWaitGroupEvents"; + case 259: return "OpGroupAsyncCopy"; + case 260: return "OpGroupWaitEvents"; case 261: return "OpGroupAll"; case 262: return "OpGroupAny"; case 263: return "OpGroupBroadcast"; @@ -1055,6 +1089,21 @@ const char* OpcodeString(int op) case 302: return "OpCaptureEventProfilingInfo"; case 303: return "OpGetDefaultQueue"; case 304: return "OpBuildNDRange"; + case 305: return "OpImageSparseSampleImplicitLod"; + case 306: return "OpImageSparseSampleExplicitLod"; + case 307: return "OpImageSparseSampleDrefImplicitLod"; + case 308: return "OpImageSparseSampleDrefExplicitLod"; + case 309: return "OpImageSparseSampleProjImplicitLod"; + case 310: return "OpImageSparseSampleProjExplicitLod"; + case 311: return "OpImageSparseSampleProjDrefImplicitLod"; + case 312: return "OpImageSparseSampleProjDrefExplicitLod"; + case 313: return "OpImageSparseFetch"; + case 314: return "OpImageSparseGather"; + case 315: return "OpImageSparseDrefGather"; + case 316: return "OpImageSparseTexelsResident"; + case 317: return "OpNoLine"; + case 318: return "OpAtomicFlagTestAndSet"; + case 319: return "OpAtomicFlagClear"; case OpcodeCeiling: default: @@ -1113,6 +1162,7 @@ void Parameterize() InstructionDesc[OpNop].setResultAndType(false, false); InstructionDesc[OpSource].setResultAndType(false, false); + InstructionDesc[OpSourceContinued].setResultAndType(false, false); InstructionDesc[OpSourceExtension].setResultAndType(false, false); InstructionDesc[OpExtension].setResultAndType(false, false); InstructionDesc[OpExtInstImport].setResultAndType(true, false); @@ -1134,6 +1184,7 @@ void Parameterize() InstructionDesc[OpTypeStruct].setResultAndType(true, false); InstructionDesc[OpTypeOpaque].setResultAndType(true, false); InstructionDesc[OpTypePointer].setResultAndType(true, false); + InstructionDesc[OpTypeForwardPointer].setResultAndType(false, false); InstructionDesc[OpTypeFunction].setResultAndType(true, false); InstructionDesc[OpTypeEvent].setResultAndType(true, false); InstructionDesc[OpTypeDeviceEvent].setResultAndType(true, false); @@ -1152,6 +1203,7 @@ void Parameterize() InstructionDesc[OpMemberName].setResultAndType(false, false); InstructionDesc[OpString].setResultAndType(true, false); InstructionDesc[OpLine].setResultAndType(false, false); + InstructionDesc[OpNoLine].setResultAndType(false, false); InstructionDesc[OpCopyMemory].setResultAndType(false, false); InstructionDesc[OpCopyMemorySized].setResultAndType(false, false); InstructionDesc[OpEmitVertex].setResultAndType(false, false); @@ -1181,11 +1233,12 @@ void Parameterize() InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false); InstructionDesc[OpRetainEvent].setResultAndType(false, false); InstructionDesc[OpReleaseEvent].setResultAndType(false, false); - InstructionDesc[OpWaitGroupEvents].setResultAndType(false, false); + InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false); + InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false); // Specific additional context-dependent operands - ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "Number of <>"); + ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "'Number of <>'"); ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'x size'"); ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'y size'"); @@ -1198,24 +1251,26 @@ void Parameterize() ExecutionModeOperands[ExecutionModeOutputVertices].push(OperandLiteralNumber, "'Vertex count'"); ExecutionModeOperands[ExecutionModeVecTypeHint].push(OperandLiteralNumber, "'Vector type'"); - DecorationOperands[DecorationStream].push(OperandLiteralNumber, "Stream number"); - DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "Location"); - DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "Component within a vector"); - DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "Index"); - DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "Binding point"); - DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "Descriptor set"); - DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "Byte offset"); - DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "XFB buffer number"); - DecorationOperands[DecorationXfbStride].push(OperandLiteralNumber, "XFB stride"); - DecorationOperands[DecorationArrayStride].push(OperandLiteralNumber, "Array stride"); - DecorationOperands[DecorationMatrixStride].push(OperandLiteralNumber, "Matrix stride"); + DecorationOperands[DecorationStream].push(OperandLiteralNumber, "'Stream Number'"); + DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "'Location'"); + DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "'Component'"); + DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "'Index'"); + DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "'Binding Point'"); + DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "'Descriptor Set'"); + DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "'Byte Offset'"); + DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "'XFB Buffer Number'"); + DecorationOperands[DecorationXfbStride].push(OperandLiteralNumber, "'XFB Stride'"); + DecorationOperands[DecorationArrayStride].push(OperandLiteralNumber, "'Array Stride'"); + DecorationOperands[DecorationMatrixStride].push(OperandLiteralNumber, "'Matrix Stride'"); DecorationOperands[DecorationBuiltIn].push(OperandLiteralNumber, "See <>"); - DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "floating-point rounding mode"); - DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "fast-math mode"); - DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "name"); - DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "linkage type"); - DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "function parameter attribute"); - DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "Specialization Constant ID"); + DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "'Floating-Point Rounding Mode'"); + DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "'Fast-Math Mode'"); + DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "'Name'"); + DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "'Linkage Type'"); + DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "'Function Parameter Attribute'"); + DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "'Specialization Constant ID'"); + DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'"); + DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'"); OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0); OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams); @@ -1251,6 +1306,54 @@ void Parameterize() OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams); OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0); + CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix); + CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityFloat16].caps.push_back(CapabilityFloat16Buffer); + CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64); + CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic); + CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic); + CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation); + CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry); + CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses); + CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel); + CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader); + CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D); + CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect); + CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer); + CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray); + CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry); + CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader); + AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses); AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses); @@ -1258,6 +1361,9 @@ void Parameterize() MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader); MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel); + MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader); + MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityShader); + ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader); ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation); ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation); @@ -1270,10 +1376,10 @@ void Parameterize() StorageParams[StorageClassInput].caps.push_back(CapabilityShader); StorageParams[StorageClassUniform].caps.push_back(CapabilityShader); StorageParams[StorageClassOutput].caps.push_back(CapabilityShader); - StorageParams[StorageClassPrivateGlobal].caps.push_back(CapabilityShader); + StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader); StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel); StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage); - + StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader); // Sampler Filter & Addressing mode capabilities SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel); @@ -1286,9 +1392,57 @@ void Parameterize() SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel); // image format capabilities - for (int i = 0; i < ImageFormatCeiling; ++i) { - ImageFormatParams[i].caps.push_back(CapabilityShader); - } + + // ES/Desktop float + ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader); + + // Desktop float + ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); + + // ES/Desktop int + ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader); + + // Desktop int + ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats); + + // ES/Desktop uint + ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader); + ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader); + + // Desktop uint + ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats); + ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats); // image channel order capabilities for (int i = 0; i < ImageChannelOrderCeiling; ++i) { @@ -1303,6 +1457,7 @@ void Parameterize() // image lookup operands ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader); ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended); + ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod); // fast math flags capabilities for (int i = 0; i < FPFastMathCeiling; ++i) { @@ -1340,9 +1495,8 @@ void Parameterize() ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader); ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader); ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityShader); + ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback); ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthAny].caps.push_back(CapabilityShader); ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader); ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader); ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader); @@ -1350,11 +1504,11 @@ void Parameterize() ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry); ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry); ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputTriangles].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputTriangles].caps.push_back(CapabilityTessellation); + ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry); + ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation); ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputQuads].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeInputIsolines].caps.push_back(CapabilityTessellation); + ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation); + ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation); ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry); ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation); ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry); @@ -1370,8 +1524,7 @@ void Parameterize() DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix); DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader); DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader); - DecorationParams[DecorationSmooth].caps.push_back(CapabilityShader); - DecorationParams[DecorationNoperspective].caps.push_back(CapabilityShader); + DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader); DecorationParams[DecorationFlat].caps.push_back(CapabilityShader); DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation); DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader); @@ -1381,14 +1534,14 @@ void Parameterize() DecorationParams[DecorationUniform].caps.push_back(CapabilityShader); DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel); DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel); - DecorationParams[DecorationStream].caps.push_back(CapabilityGeometry); + DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams); DecorationParams[DecorationLocation].caps.push_back(CapabilityShader); DecorationParams[DecorationComponent].caps.push_back(CapabilityShader); DecorationParams[DecorationIndex].caps.push_back(CapabilityShader); DecorationParams[DecorationBinding].caps.push_back(CapabilityShader); DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader); - DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityShader); - DecorationParams[DecorationXfbStride].caps.push_back(CapabilityShader); + DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback); + DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback); DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader); DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityShader); DecorationParams[DecorationBuiltIn].caps.push_back(CapabilityShader); @@ -1397,13 +1550,27 @@ void Parameterize() DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel); DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage); DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader); + DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader); + DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment); + DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader); BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader); BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityShader); BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . ."; + BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . ."; + + BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . ."; + + BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . ."; + BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry); BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry); @@ -1420,16 +1587,13 @@ void Parameterize() BuiltInParams[BuiltInSampleId].caps.push_back(CapabilityShader); BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilityShader); BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInFragColor].caps.push_back(CapabilityShader); BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader); BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInLocalInvocationIndex].caps.push_back(CapabilityShader); BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInWorkgroupLinearId].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel); @@ -1438,8 +1602,11 @@ void Parameterize() BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel); BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel); + DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D); DimensionalityParams[DimCube].caps.push_back(CapabilityShader); - DimensionalityParams[DimRect].caps.push_back(CapabilityShader); + DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect); + DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer); + DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment); // Group Operations for (int i = 0; i < GroupOperationCeiling; ++i) { @@ -1458,6 +1625,10 @@ void Parameterize() InstructionDesc[OpSource].operands.push(OperandSource, ""); InstructionDesc[OpSource].operands.push(OperandLiteralNumber, "'Version'"); + InstructionDesc[OpSource].operands.push(OperandId, "'File'", true); + InstructionDesc[OpSource].operands.push(OperandLiteralString, "'Source'", true); + + InstructionDesc[OpSourceContinued].operands.push(OperandLiteralString, "'Continued Source'"); InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString, "'Extension'"); @@ -1470,7 +1641,6 @@ void Parameterize() InstructionDesc[OpString].operands.push(OperandLiteralString, "'String'"); - InstructionDesc[OpLine].operands.push(OperandId, "'Target'"); InstructionDesc[OpLine].operands.push(OperandId, "'File'"); InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Line'"); InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Column'"); @@ -1487,10 +1657,11 @@ void Parameterize() InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel, ""); InstructionDesc[OpEntryPoint].operands.push(OperandId, "'Entry Point'"); InstructionDesc[OpEntryPoint].operands.push(OperandLiteralString, "'Name'"); + InstructionDesc[OpEntryPoint].operands.push(OperandVariableIds, "'Interface'"); InstructionDesc[OpExecutionMode].operands.push(OperandId, "'Entry Point'"); InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode, "'Mode'"); - InstructionDesc[OpExecutionMode].operands.push(OperandOptionalLiteral, "See <>"); + InstructionDesc[OpExecutionMode].operands.push(OperandOptionalLiteral, "See <>"); InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Width'"); InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Signedness'"); @@ -1511,7 +1682,7 @@ void Parameterize() InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'MS'"); InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Sampled'"); InstructionDesc[OpTypeImage].operands.push(OperandSamplerImageFormat, ""); - InstructionDesc[OpTypeImage].operands.push(OperandOptionalLiteral, "'Access Qualifier'"); + InstructionDesc[OpTypeImage].operands.push(OperandAccessQualifier, "", true); InstructionDesc[OpTypeSampledImage].operands.push(OperandId, "'Image Type'"); @@ -1529,15 +1700,18 @@ void Parameterize() InstructionDesc[OpTypePointer].operands.push(OperandStorage, ""); InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'"); + InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses); + InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'"); + InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, ""); + InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes); - InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpTypePipe].operands.push(OperandId, "'Type'"); InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'"); InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes); @@ -1561,7 +1735,7 @@ void Parameterize() InstructionDesc[OpSpecConstantOp].operands.push(OperandVariableIds, "'Operands'"); InstructionDesc[OpVariable].operands.push(OperandStorage, ""); - InstructionDesc[OpVariable].operands.push(OperandOptionalId, "'Initializer'"); + InstructionDesc[OpVariable].operands.push(OperandId, "'Initializer'", true); InstructionDesc[OpFunction].operands.push(OperandFunction, ""); InstructionDesc[OpFunction].operands.push(OperandId, "'Function Type'"); @@ -1574,11 +1748,11 @@ void Parameterize() InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpLoad].operands.push(OperandOptionalLiteral, "'Memory Access'"); + InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true); InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpStore].operands.push(OperandId, "'Object'"); - InstructionDesc[OpStore].operands.push(OperandOptionalLiteral, "'Memory Access'"); + InstructionDesc[OpStore].operands.push(OperandMemoryAccess, "", true); InstructionDesc[OpPhi].operands.push(OperandVariableIds, "'Variable, Parent, ...'"); @@ -1621,101 +1795,196 @@ void Parameterize() InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Target'"); InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Source'"); - InstructionDesc[OpCopyMemory].operands.push(OperandOptionalLiteral, "'Memory Access'"); + InstructionDesc[OpCopyMemory].operands.push(OperandMemoryAccess, "", true); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Target'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Source'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'"); - InstructionDesc[OpCopyMemorySized].operands.push(OperandOptionalLiteral, "'Memory Access'"); + InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true); InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'"); InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'"); + InstructionDesc[OpImage].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageRead].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageRead].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageRead].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageRead].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageWrite].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageWrite].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageWrite].operands.push(OperandId, "'Texel'"); + InstructionDesc[OpImageWrite].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageWrite].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); - InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); - InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); - InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); - InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader); - InstructionDesc[OpImageFetch].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageFetch].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageFetch].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageFetch].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'"); - InstructionDesc[OpImageGather].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'"); - InstructionDesc[OpImageDrefGather].operands.push(OperandOptionalImage, ""); + InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader); + InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'"); + InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'"); + InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'"); + InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency); + + InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'"); + InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency); + InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'"); + InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'"); + InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityShader); + InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityShader); + InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityShader); - - InstructionDesc[OpImageQueryDim].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryDim].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel); @@ -1734,6 +2003,11 @@ void Parameterize() InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses); + InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'"); + InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'"); + InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); + InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses); + InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'"); InstructionDesc[OpFNegate].operands.push(OperandId, "'Operand'"); @@ -1887,6 +2161,18 @@ void Parameterize() InstructionDesc[OpDot].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpDot].operands.push(OperandId, "'Vector 2'"); + InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 2'"); + + InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 1'"); + InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 2'"); + InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Base'"); InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Shift'"); @@ -2019,22 +2305,22 @@ void Parameterize() InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader); InstructionDesc[OpFwidth].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityShader); + InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityShader); + InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityShader); + InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityShader); + InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityShader); + InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityShader); + InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'"); InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry); @@ -2042,10 +2328,10 @@ void Parameterize() InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry); InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometry); + InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometry); + InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'"); @@ -2140,7 +2426,18 @@ void Parameterize() InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Value'"); + InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'"); + InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel); + + InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'"); + InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'"); + InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'"); + InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'"); InstructionDesc[OpLoopMerge].operands.push(OperandLoop, ""); InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'"); @@ -2163,22 +2460,24 @@ void Parameterize() InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'"); + InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'"); + InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpAsyncGroupCopy].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandScope, "'Execution'"); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Destination'"); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Source'"); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Num Elements'"); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Stride'"); - InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Event'"); + InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'"); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'"); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Num Elements'"); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'"); + InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'"); - InstructionDesc[OpWaitGroupEvents].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpWaitGroupEvents].operands.push(OperandScope, "'Execution'"); - InstructionDesc[OpWaitGroupEvents].operands.push(OperandId, "'Num Events'"); - InstructionDesc[OpWaitGroupEvents].operands.push(OperandId, "'Events List'"); + InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel); + InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'"); + InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'"); InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'"); @@ -2236,67 +2535,95 @@ void Parameterize() InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pointer'"); + InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes); InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'"); + InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'"); + InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); + InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); + InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'"); + InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'"); diff --git a/SPIRV/doc.h b/SPIRV/doc.h index c97ca850..accdd65d 100755 --- a/SPIRV/doc.h +++ b/SPIRV/doc.h @@ -116,10 +116,9 @@ enum OpcodeClass { enum OperandClass { OperandNone, OperandId, - OperandOptionalId, - OperandOptionalImage, OperandVariableIds, OperandOptionalLiteral, + OperandOptionalLiteralString, OperandVariableLiterals, OperandVariableIdLiteral, OperandVariableLiteralId, @@ -168,18 +167,22 @@ typedef std::vector EnumCaps; class OperandParameters { public: OperandParameters() { } - void push(OperandClass oc, const char* d) + void push(OperandClass oc, const char* d, bool opt = false) { opClass.push_back(oc); desc.push_back(d); + optional.push_back(opt); } + void setOptional(); OperandClass getClass(int op) const { return opClass[op]; } const char* getDesc(int op) const { return desc[op]; } + bool isOptional(int op) const { return optional[op]; } int getNum() const { return (int)opClass.size(); } protected: std::vector opClass; std::vector desc; + std::vector optional; }; // Parameterize an enumerant @@ -240,7 +243,7 @@ protected: int resultPresent : 1; }; -const int OpcodeCeiling = 305; +const int OpcodeCeiling = 320; // The set of objects that hold all the instruction/operand // parameterization information. diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index 829722e9..f3d42a93 100755 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -25,7 +25,6 @@ // This header is automatically generated by the same tool that creates // the Binary Section of the SPIR-V specification. -// Specification revision 31. // Enumeration tokens for SPIR-V, in various styles: // C, C++, C++11, JSON, Lua, Python // @@ -47,9 +46,12 @@ namespace spv { typedef unsigned int Id; +#define SPV_VERSION 10000 +#define SPV_REVISION 2 + static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 99; -static const unsigned int Revision = 31; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 2; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -57,7 +59,8 @@ enum SourceLanguage { SourceLanguageUnknown = 0, SourceLanguageESSL = 1, SourceLanguageGLSL = 2, - SourceLanguageOpenCL = 3, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, }; enum ExecutionModel { @@ -96,7 +99,6 @@ enum ExecutionMode { ExecutionModePointMode = 10, ExecutionModeXfb = 11, ExecutionModeDepthReplacing = 12, - ExecutionModeDepthAny = 13, ExecutionModeDepthGreater = 14, ExecutionModeDepthLess = 15, ExecutionModeDepthUnchanged = 16, @@ -105,10 +107,10 @@ enum ExecutionMode { ExecutionModeInputPoints = 19, ExecutionModeInputLines = 20, ExecutionModeInputLinesAdjacency = 21, - ExecutionModeInputTriangles = 22, + ExecutionModeTriangles = 22, ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeInputQuads = 24, - ExecutionModeInputIsolines = 25, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, ExecutionModeOutputVertices = 26, ExecutionModeOutputPoints = 27, ExecutionModeOutputLineStrip = 28, @@ -122,11 +124,12 @@ enum StorageClass { StorageClassInput = 1, StorageClassUniform = 2, StorageClassOutput = 3, - StorageClassWorkgroupLocal = 4, - StorageClassWorkgroupGlobal = 5, - StorageClassPrivateGlobal = 6, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, StorageClassFunction = 7, StorageClassGeneric = 8, + StorageClassPushConstant = 9, StorageClassAtomicCounter = 10, StorageClassImage = 11, }; @@ -138,6 +141,7 @@ enum Dim { DimCube = 3, DimRect = 4, DimBuffer = 5, + DimSubpassData = 6, }; enum SamplerAddressingMode { @@ -235,6 +239,7 @@ enum ImageChannelDataType { ImageChannelDataTypeHalfFloat = 13, ImageChannelDataTypeFloat = 14, ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, }; enum ImageOperandsShift { @@ -245,6 +250,7 @@ enum ImageOperandsShift { ImageOperandsOffsetShift = 4, ImageOperandsConstOffsetsShift = 5, ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, }; enum ImageOperandsMask { @@ -256,6 +262,7 @@ enum ImageOperandsMask { ImageOperandsOffsetMask = 0x00000010, ImageOperandsConstOffsetsMask = 0x00000020, ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, }; enum FPFastMathModeShift { @@ -317,8 +324,7 @@ enum Decoration { DecorationGLSLPacked = 9, DecorationCPacked = 10, DecorationBuiltIn = 11, - DecorationSmooth = 12, - DecorationNoperspective = 13, + DecorationNoPerspective = 13, DecorationFlat = 14, DecorationPatch = 15, DecorationCentroid = 16, @@ -329,10 +335,9 @@ enum Decoration { DecorationVolatile = 21, DecorationConstant = 22, DecorationCoherent = 23, - DecorationNonwritable = 24, - DecorationNonreadable = 25, + DecorationNonWritable = 24, + DecorationNonReadable = 25, DecorationUniform = 26, - DecorationNoStaticUse = 27, DecorationSaturatedConversion = 28, DecorationStream = 29, DecorationLocation = 30, @@ -347,6 +352,9 @@ enum Decoration { DecorationFPRoundingMode = 39, DecorationFPFastMathMode = 40, DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, }; enum BuiltIn { @@ -370,7 +378,6 @@ enum BuiltIn { BuiltInSampleId = 18, BuiltInSamplePosition = 19, BuiltInSampleMask = 20, - BuiltInFragColor = 21, BuiltInFragDepth = 22, BuiltInHelperInvocation = 23, BuiltInNumWorkgroups = 24, @@ -384,13 +391,14 @@ enum BuiltIn { BuiltInEnqueuedWorkgroupSize = 32, BuiltInGlobalOffset = 33, BuiltInGlobalLinearId = 34, - BuiltInWorkgroupLinearId = 35, BuiltInSubgroupSize = 36, BuiltInSubgroupMaxSize = 37, BuiltInNumSubgroups = 38, BuiltInNumEnqueuedSubgroups = 39, BuiltInSubgroupId = 40, BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, }; enum SelectionControlShift { @@ -431,41 +439,43 @@ enum FunctionControlMask { }; enum MemorySemanticsShift { - MemorySemanticsRelaxedShift = 0, - MemorySemanticsSequentiallyConsistentShift = 1, - MemorySemanticsAcquireShift = 2, - MemorySemanticsReleaseShift = 3, - MemorySemanticsUniformMemoryShift = 4, - MemorySemanticsSubgroupMemoryShift = 5, - MemorySemanticsWorkgroupLocalMemoryShift = 6, - MemorySemanticsWorkgroupGlobalMemoryShift = 7, - MemorySemanticsAtomicCounterMemoryShift = 8, - MemorySemanticsImageMemoryShift = 9, + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, }; enum MemorySemanticsMask { MemorySemanticsMaskNone = 0, - MemorySemanticsRelaxedMask = 0x00000001, - MemorySemanticsSequentiallyConsistentMask = 0x00000002, - MemorySemanticsAcquireMask = 0x00000004, - MemorySemanticsReleaseMask = 0x00000008, - MemorySemanticsUniformMemoryMask = 0x00000010, - MemorySemanticsSubgroupMemoryMask = 0x00000020, - MemorySemanticsWorkgroupLocalMemoryMask = 0x00000040, - MemorySemanticsWorkgroupGlobalMemoryMask = 0x00000080, - MemorySemanticsAtomicCounterMemoryMask = 0x00000100, - MemorySemanticsImageMemoryMask = 0x00000200, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, }; enum MemoryAccessShift { MemoryAccessVolatileShift = 0, MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, }; enum MemoryAccessMask { MemoryAccessMaskNone = 0, MemoryAccessVolatileMask = 0x00000001, MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, }; enum Scope { @@ -514,7 +524,6 @@ enum Capability { CapabilityImageBasic = 13, CapabilityImageReadWrite = 14, CapabilityImageMipmap = 15, - CapabilityImageSRGBWrite = 16, CapabilityPipes = 17, CapabilityGroups = 18, CapabilityDeviceEnqueue = 19, @@ -524,7 +533,6 @@ enum Capability { CapabilityTessellationPointSize = 23, CapabilityGeometryPointSize = 24, CapabilityImageGatherExtended = 25, - CapabilityStorageImageExtendedFormats = 26, CapabilityStorageImageMultisample = 27, CapabilityUniformBufferArrayDynamicIndexing = 28, CapabilitySampledImageArrayDynamicIndexing = 29, @@ -534,11 +542,33 @@ enum Capability { CapabilityCullDistance = 33, CapabilityImageCubeArray = 34, CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, }; enum Op { OpNop = 0, OpUndef = 1, + OpSourceContinued = 2, OpSource = 3, OpSourceExtension = 4, OpName = 5, @@ -572,6 +602,7 @@ enum Op { OpTypeReserveId = 36, OpTypeQueue = 37, OpTypePipe = 38, + OpTypeForwardPointer = 39, OpConstantTrue = 41, OpConstantFalse = 42, OpConstant = 43, @@ -598,6 +629,7 @@ enum Op { OpPtrAccessChain = 67, OpArrayLength = 68, OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, OpDecorate = 71, OpMemberDecorate = 72, OpDecorationGroup = 73, @@ -625,7 +657,7 @@ enum Op { OpImageDrefGather = 97, OpImageRead = 98, OpImageWrite = 99, - OpImageQueryDim = 100, + OpImage = 100, OpImageQueryFormat = 101, OpImageQueryOrder = 102, OpImageQuerySizeLod = 103, @@ -674,7 +706,8 @@ enum Op { OpDot = 148, OpIAddCarry = 149, OpISubBorrow = 150, - OpIMulExtended = 151, + OpUMulExtended = 151, + OpSMulExtended = 152, OpAny = 154, OpAll = 155, OpIsNan = 156, @@ -769,8 +802,8 @@ enum Op { OpUnreachable = 255, OpLifetimeStart = 256, OpLifetimeStop = 257, - OpAsyncGroupCopy = 259, - OpWaitGroupEvents = 260, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, OpGroupAll = 261, OpGroupAny = 262, OpGroupBroadcast = 263, @@ -811,6 +844,21 @@ enum Op { OpCaptureEventProfilingInfo = 302, OpGetDefaultQueue = 303, OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, }; // Overload operator| for mask bit combining diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 8bf369c7..6736a13c 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -74,18 +74,14 @@ const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF; class Instruction { public: - Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), string(0) { } - explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), string(0) { } - virtual ~Instruction() - { - delete string; - } + Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode) { } + explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode) { } + virtual ~Instruction() {} void addIdOperand(Id id) { operands.push_back(id); } void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } void addStringOperand(const char* str) { originalString = str; - string = new std::vector; unsigned int word; char* wordString = (char*)&word; char* wordPtr = wordString; @@ -96,7 +92,7 @@ public: *(wordPtr++) = c; ++charCount; if (charCount == 4) { - string->push_back(word); + addImmediateOperand(word); wordPtr = wordString; charCount = 0; } @@ -107,7 +103,7 @@ public: // pad with 0s for (; charCount < 4; ++charCount) *(wordPtr++) = 0; - string->push_back(word); + addImmediateOperand(word); } } Op getOpCode() const { return opCode; } @@ -128,8 +124,6 @@ public: if (resultId) ++wordCount; wordCount += (unsigned int)operands.size(); - if (string) - wordCount += (unsigned int)string->size(); // Write out the beginning of the instruction out.push_back(((wordCount) << WordCountShift) | opCode); @@ -141,9 +135,6 @@ public: // Write out the operands for (int op = 0; op < (int)operands.size(); ++op) out.push_back(operands[op]); - if (string) - for (int op = 0; op < (int)string->size(); ++op) - out.push_back((*string)[op]); } protected: @@ -152,7 +143,6 @@ protected: Id typeId; Op opCode; std::vector operands; - std::vector* string; // usually non-existent std::string originalString; // could be optimized away; convenience for getting string operand }; diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index f5646c04..59bcb238 100755 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -788,6 +788,7 @@ int C_DECL main(int argc, char* argv[]) glslang::GetSpirvVersion(spirvVersion); printf("SPIR-V Version %s\n", spirvVersion.c_str()); printf("GLSL.std.450 Version %d, Revision %d\n", GLSLstd450Version, GLSLstd450Revision); + printf("Khronos Tool ID %d\n", glslang::GetKhronosToolId()); if (Worklist.empty()) return ESuccess; } diff --git a/Test/baseResults/spv.100ops.frag.out b/Test/baseResults/spv.100ops.frag.out index 241c6ce3..3534299d 100755 --- a/Test/baseResults/spv.100ops.frag.out +++ b/Test/baseResults/spv.100ops.frag.out @@ -3,16 +3,16 @@ spv.100ops.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 47 - Source ESSL 100 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source ESSL 100 Name 4 "main" Name 8 "foo(" Name 11 "face1" @@ -27,15 +27,14 @@ Linked fragment stage: Decorate 21(low) RelaxedPrecision Decorate 26(high) RelaxedPrecision Decorate 36(gl_FragColor) RelaxedPrecision - Decorate 36(gl_FragColor) BuiltIn FragColor 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeFunction 6(float) - 10: TypePointer PrivateGlobal 6(float) - 11(face1): 10(ptr) Variable PrivateGlobal + 10: TypePointer Private 6(float) + 11(face1): 10(ptr) Variable Private 12: 6(float) Constant 1093664768 - 13(face2): 10(ptr) Variable PrivateGlobal + 13(face2): 10(ptr) Variable Private 14: 6(float) Constant 3221225472 15: TypeInt 32 1 16: TypePointer Function 15(int) diff --git a/Test/baseResults/spv.130.frag.out b/Test/baseResults/spv.130.frag.out index 99ca6f17..22387517 100644 --- a/Test/baseResults/spv.130.frag.out +++ b/Test/baseResults/spv.130.frag.out @@ -5,4 +5,301 @@ WARNING: 0:34: '#extension' : extension is only partially supported: GL_ARB_gpu_ Linked fragment stage: -Missing functionality: texture gather +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 212 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 78 17 68 98 182 183 184 185 185 171 + ExecutionMode 4 OriginLowerLeft + Source GLSL 130 + SourceExtension "GL_ARB_gpu_shader5" + SourceExtension "GL_ARB_shader_texture_lod" + SourceExtension "GL_ARB_shading_language_420pack" + SourceExtension "GL_ARB_texture_cube_map_array" + SourceExtension "GL_ARB_texture_gather" + SourceExtension "GL_ARB_texture_rectangle" + Name 4 "main" + Name 6 "bar3(" + Name 8 "bar4(" + Name 10 "bar5(" + Name 12 "bar6(" + Name 17 "o" + Name 21 "samp2D" + Name 37 "samp2DA" + Name 47 "samp2DR" + Name 55 "samp2DS" + Name 68 "io" + Name 72 "Sca" + Name 78 "i" + Name 86 "Isca" + Name 98 "uo" + Name 102 "Usca" + Name 113 "a" + Name 117 "Scas" + Name 122 "f" + Name 131 "c" + Name 152 "a1" + Name 155 "m43" + Name 158 "b" + Name 165 "sampC" + Name 171 "gl_ClipDistance" + Name 181 "b" + Name 182 "fflat" + Name 183 "fsmooth" + Name 184 "fnop" + Name 185 "gl_Color" + Name 192 "bounds" + Name 193 "s2D" + Name 194 "s2DR" + Name 198 "s2DRS" + Name 202 "s1D" + Name 203 "s2DS" + Name 205 "f" + Name 207 "v2" + Name 209 "v3" + Name 211 "v4" + Decorate 171(gl_ClipDistance) BuiltIn ClipDistance + Decorate 182(fflat) Flat + Decorate 184(fnop) NoPerspective + Decorate 192(bounds) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeFloat 32 + 15: TypeVector 14(float) 4 + 16: TypePointer Output 15(fvec4) + 17(o): 16(ptr) Variable Output + 18: TypeImage 14(float) 2D sampled format:Unknown + 19: TypeSampledImage 18 + 20: TypePointer UniformConstant 19 + 21(samp2D): 20(ptr) Variable UniformConstant + 23: TypeVector 14(float) 2 + 24: 14(float) Constant 1050253722 + 25: 23(fvec2) ConstantComposite 24 24 + 26: TypeInt 32 1 + 27: TypeVector 26(int) 2 + 28: 26(int) Constant 1 + 29: 27(ivec2) ConstantComposite 28 28 + 30: 26(int) Constant 0 + 34: TypeImage 14(float) 2D array sampled format:Unknown + 35: TypeSampledImage 34 + 36: TypePointer UniformConstant 35 + 37(samp2DA): 36(ptr) Variable UniformConstant + 39: TypeVector 14(float) 3 + 40: 39(fvec3) ConstantComposite 24 24 24 + 44: TypeImage 14(float) Rect sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(samp2DR): 46(ptr) Variable UniformConstant + 52: TypeImage 14(float) 2D depth sampled format:Unknown + 53: TypeSampledImage 52 + 54: TypePointer UniformConstant 53 + 55(samp2DS): 54(ptr) Variable UniformConstant + 57: 14(float) Constant 1067869798 + 62: 26(int) Constant 2 + 66: TypeVector 26(int) 3 + 67: TypePointer Output 66(ivec3) + 68(io): 67(ptr) Variable Output + 69: TypeImage 14(float) Cube array sampled format:Unknown + 70: TypeSampledImage 69 + 71: TypePointer UniformConstant 70 + 72(Sca): 71(ptr) Variable UniformConstant + 74: 26(int) Constant 3 + 77: TypePointer Input 15(fvec4) + 78(i): 77(ptr) Variable Input + 83: TypeImage 26(int) Cube array sampled format:Unknown + 84: TypeSampledImage 83 + 85: TypePointer UniformConstant 84 + 86(Isca): 85(ptr) Variable UniformConstant + 89: 14(float) Constant 1060320051 + 90: TypeVector 26(int) 4 + 95: TypeInt 32 0 + 96: TypeVector 95(int) 4 + 97: TypePointer Output 96(ivec4) + 98(uo): 97(ptr) Variable Output + 99: TypeImage 95(int) Cube array sampled format:Unknown + 100: TypeSampledImage 99 + 101: TypePointer UniformConstant 100 + 102(Usca): 101(ptr) Variable UniformConstant + 108: 14(float) Constant 1071225242 + 112: TypePointer Private 39(fvec3) + 113(a): 112(ptr) Variable Private + 114: TypeImage 14(float) Cube depth array sampled format:Unknown + 115: TypeSampledImage 114 + 116: TypePointer UniformConstant 115 + 117(Scas): 116(ptr) Variable UniformConstant + 121: TypePointer Function 14(float) + 125: 95(int) Constant 1 + 126: TypePointer Input 14(float) + 130: TypePointer Function 90(ivec4) + 134: 14(float) Constant 1036831949 + 135: 39(fvec3) ConstantComposite 134 134 134 + 136: 14(float) Constant 1045220557 + 137: 39(fvec3) ConstantComposite 136 136 136 + 153: TypeMatrix 39(fvec3) 4 + 154: TypePointer Function 153 + 159: 14(float) Constant 1073741824 + 162: TypeImage 14(float) Cube sampled format:Unknown + 163: TypeSampledImage 162 + 164: TypePointer UniformConstant 163 + 165(sampC): 164(ptr) Variable UniformConstant + 168: 95(int) Constant 4 + 169: TypeArray 14(float) 168 + 170: TypePointer Input 169 +171(gl_ClipDistance): 170(ptr) Variable Input + 174: TypePointer Output 14(float) + 180: TypePointer Private 14(float) + 181(b): 180(ptr) Variable Private + 182(fflat): 126(ptr) Variable Input + 183(fsmooth): 126(ptr) Variable Input + 184(fnop): 126(ptr) Variable Input + 185(gl_Color): 77(ptr) Variable Input + 186: 95(int) Constant 3 + 187: TypeArray 26(int) 186 + 188: 26(int) Constant 10 + 189: 26(int) Constant 23 + 190: 26(int) Constant 32 + 191: 187 ConstantComposite 188 189 190 + 192(bounds): 20(ptr) Variable UniformConstant + 193(s2D): 20(ptr) Variable UniformConstant + 194(s2DR): 46(ptr) Variable UniformConstant + 195: TypeImage 14(float) Rect depth sampled format:Unknown + 196: TypeSampledImage 195 + 197: TypePointer UniformConstant 196 + 198(s2DRS): 197(ptr) Variable UniformConstant + 199: TypeImage 14(float) 1D sampled format:Unknown + 200: TypeSampledImage 199 + 201: TypePointer UniformConstant 200 + 202(s1D): 201(ptr) Variable UniformConstant + 203(s2DS): 54(ptr) Variable UniformConstant + 204: TypePointer UniformConstant 14(float) + 205(f): 204(ptr) Variable UniformConstant + 206: TypePointer UniformConstant 23(fvec2) + 207(v2): 206(ptr) Variable UniformConstant + 208: TypePointer UniformConstant 39(fvec3) + 209(v3): 208(ptr) Variable UniformConstant + 210: TypePointer UniformConstant 15(fvec4) + 211(v4): 210(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 166: 163 Load 165(sampC) + 167: 15(fvec4) ImageGather 166 137 30 + Store 17(o) 167 + 172: 126(ptr) AccessChain 171(gl_ClipDistance) 74 + 173: 14(float) Load 172 + 175: 174(ptr) AccessChain 17(o) 125 + Store 175 173 + 176: 2 FunctionCall 6(bar3() + 177: 2 FunctionCall 8(bar4() + 178: 2 FunctionCall 10(bar5() + 179: 2 FunctionCall 12(bar6() + Return + FunctionEnd + 6(bar3(): 2 Function None 3 + 7: Label + 22: 19 Load 21(samp2D) + 31: 15(fvec4) ImageGather 22 25 30 ConstOffset 29 + 32: 15(fvec4) Load 17(o) + 33: 15(fvec4) FAdd 32 31 + Store 17(o) 33 + 38: 35 Load 37(samp2DA) + 41: 15(fvec4) ImageGather 38 40 30 ConstOffset 29 + 42: 15(fvec4) Load 17(o) + 43: 15(fvec4) FAdd 42 41 + Store 17(o) 43 + Return + FunctionEnd + 8(bar4(): 2 Function None 3 + 9: Label + 48: 45 Load 47(samp2DR) + 49: 15(fvec4) ImageGather 48 25 30 ConstOffset 29 + 50: 15(fvec4) Load 17(o) + 51: 15(fvec4) FAdd 50 49 + Store 17(o) 51 + 56: 53 Load 55(samp2DS) + 58: 15(fvec4) ImageDrefGather 56 25 57 ConstOffset 29 + 59: 15(fvec4) Load 17(o) + 60: 15(fvec4) FAdd 59 58 + Store 17(o) 60 + 61: 19 Load 21(samp2D) + 63: 15(fvec4) ImageGather 61 25 62 ConstOffset 29 + 64: 15(fvec4) Load 17(o) + 65: 15(fvec4) FAdd 64 63 + Store 17(o) 65 + Return + FunctionEnd + 10(bar5(): 2 Function None 3 + 11: Label + 122(f): 121(ptr) Variable Function + 131(c): 130(ptr) Variable Function + 73: 70 Load 72(Sca) + 75: 66(ivec3) ImageQuerySizeLod 73 74 + Store 68(io) 75 + 76: 70 Load 72(Sca) + 79: 15(fvec4) Load 78(i) + 80: 15(fvec4) ImageSampleImplicitLod 76 79 + 81: 15(fvec4) Load 17(o) + 82: 15(fvec4) FAdd 81 80 + Store 17(o) 82 + 87: 84 Load 86(Isca) + 88: 15(fvec4) Load 78(i) + 91: 90(ivec4) ImageSampleImplicitLod 87 88 Bias 89 + 92: 66(ivec3) VectorShuffle 91 91 0 1 2 + 93: 66(ivec3) Load 68(io) + 94: 66(ivec3) IAdd 93 92 + Store 68(io) 94 + 103: 100 Load 102(Usca) + 104: 15(fvec4) Load 78(i) + 105: 96(ivec4) ImageSampleImplicitLod 103 104 + Store 98(uo) 105 + 106: 70 Load 72(Sca) + 107: 15(fvec4) Load 78(i) + 109: 15(fvec4) ImageSampleExplicitLod 106 107 Lod 108 + 110: 15(fvec4) Load 17(o) + 111: 15(fvec4) FAdd 110 109 + Store 17(o) 111 + 118: 115 Load 117(Scas) + 119: 66(ivec3) ImageQuerySizeLod 118 74 + 120: 39(fvec3) ConvertSToF 119 + Store 113(a) 120 + 123: 115 Load 117(Scas) + 124: 15(fvec4) Load 78(i) + 127: 126(ptr) AccessChain 78(i) 125 + 128: 14(float) Load 127 + 129: 14(float) ImageSampleDrefImplicitLod 123 124 128 Bias 128 + Store 122(f) 129 + 132: 84 Load 86(Isca) + 133: 15(fvec4) Load 78(i) + 138: 90(ivec4) ImageSampleExplicitLod 132 133 Grad 135 137 + Store 131(c) 138 + 139: 39(fvec3) Load 113(a) + 140: 14(float) Load 122(f) + 141: 90(ivec4) Load 131(c) + 142: 15(fvec4) ConvertSToF 141 + 143: 15(fvec4) CompositeConstruct 140 140 140 140 + 144: 15(fvec4) FAdd 143 142 + 145: 14(float) CompositeExtract 139 0 + 146: 14(float) CompositeExtract 139 1 + 147: 14(float) CompositeExtract 139 2 + 148: 14(float) CompositeExtract 144 0 + 149: 15(fvec4) CompositeConstruct 145 146 147 148 + 150: 15(fvec4) Load 17(o) + 151: 15(fvec4) FAdd 150 149 + Store 17(o) 151 + Return + FunctionEnd + 12(bar6(): 2 Function None 3 + 13: Label + 152(a1): 121(ptr) Variable Function + 155(m43): 154(ptr) Variable Function + 158(b): 121(ptr) Variable Function + 156: 121(ptr) AccessChain 155(m43) 74 125 + 157: 14(float) Load 156 + Store 152(a1) 157 + 160: 14(float) Load 152(a1) + 161: 14(float) FMul 159 160 + Store 158(b) 161 + Return + FunctionEnd diff --git a/Test/baseResults/spv.140.frag.out b/Test/baseResults/spv.140.frag.out index 8b67908f..0477bc29 100755 --- a/Test/baseResults/spv.140.frag.out +++ b/Test/baseResults/spv.140.frag.out @@ -3,16 +3,16 @@ spv.140.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 92 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 97 - Source GLSL 140 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 43 28 33 33 ExecutionMode 4 OriginLowerLeft + Source GLSL 140 Name 4 "main" Name 8 "foo(" Name 11 "i1" @@ -20,54 +20,56 @@ Linked fragment stage: Name 24 "i2" Name 28 "o" Name 33 "gl_ClipDistance" - Name 42 "k" - Name 54 "sampR" - Name 61 "sampB" - Name 85 "samp2Da" - Name 89 "bn" - MemberName 89(bn) 0 "matra" - MemberName 89(bn) 1 "matca" - MemberName 89(bn) 2 "matr" - MemberName 89(bn) 3 "matc" - MemberName 89(bn) 4 "matrdef" - Name 91 "" + Name 43 "k" + Name 55 "sampR" + Name 62 "sampB" + Name 84 "samp2Da" + Name 88 "bn" + MemberName 88(bn) 0 "matra" + MemberName 88(bn) 1 "matca" + MemberName 88(bn) 2 "matr" + MemberName 88(bn) 3 "matc" + MemberName 88(bn) 4 "matrdef" + Name 90 "" + Name 93 "bi" + MemberName 93(bi) 0 "v" + Name 96 "bname" Decorate 16(gl_FrontFacing) BuiltIn FrontFacing - Decorate 33(gl_ClipDistance) Smooth Decorate 33(gl_ClipDistance) BuiltIn ClipDistance - Decorate 42(k) Smooth - Decorate 85(samp2Da) NoStaticUse - Decorate 88 ArrayStride 64 - Decorate 88 ArrayStride 64 - MemberDecorate 89(bn) 0 RowMajor - MemberDecorate 89(bn) 0 Offset 0 - MemberDecorate 89(bn) 0 MatrixStride 16 - MemberDecorate 89(bn) 1 ColMajor - MemberDecorate 89(bn) 1 Offset 256 - MemberDecorate 89(bn) 1 MatrixStride 16 - MemberDecorate 89(bn) 2 RowMajor - MemberDecorate 89(bn) 2 Offset 512 - MemberDecorate 89(bn) 2 MatrixStride 16 - MemberDecorate 89(bn) 3 ColMajor - MemberDecorate 89(bn) 3 Offset 576 - MemberDecorate 89(bn) 3 MatrixStride 16 - MemberDecorate 89(bn) 4 RowMajor - MemberDecorate 89(bn) 4 Offset 640 - MemberDecorate 89(bn) 4 MatrixStride 16 - Decorate 89(bn) Block - Decorate 91 NoStaticUse + Decorate 87 ArrayStride 64 + Decorate 87 ArrayStride 64 + MemberDecorate 88(bn) 0 RowMajor + MemberDecorate 88(bn) 0 Offset 0 + MemberDecorate 88(bn) 0 MatrixStride 16 + MemberDecorate 88(bn) 1 ColMajor + MemberDecorate 88(bn) 1 Offset 256 + MemberDecorate 88(bn) 1 MatrixStride 16 + MemberDecorate 88(bn) 2 RowMajor + MemberDecorate 88(bn) 2 Offset 512 + MemberDecorate 88(bn) 2 MatrixStride 16 + MemberDecorate 88(bn) 3 ColMajor + MemberDecorate 88(bn) 3 Offset 576 + MemberDecorate 88(bn) 3 MatrixStride 16 + MemberDecorate 88(bn) 4 RowMajor + MemberDecorate 88(bn) 4 Offset 640 + MemberDecorate 88(bn) 4 MatrixStride 16 + Decorate 88(bn) Block + Decorate 92 ArrayStride 12 + MemberDecorate 93(bi) 0 Offset 0 + Decorate 93(bi) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeFunction 6(float) - 10: TypePointer PrivateGlobal 6(float) - 11(i1): 10(ptr) Variable PrivateGlobal + 10: TypePointer Private 6(float) + 11(i1): 10(ptr) Variable Private 12: TypePointer Function 6(float) 14: TypeBool 15: TypePointer Input 14(bool) 16(gl_FrontFacing): 15(ptr) Variable Input 20: 6(float) Constant 3221225472 22: 6(float) Constant 1073741824 - 24(i2): 10(ptr) Variable PrivateGlobal + 24(i2): 10(ptr) Variable Private 25: 6(float) Constant 1120665600 26: TypeVector 6(float) 4 27: TypePointer Output 26(fvec4) @@ -80,32 +82,41 @@ Linked fragment stage: 34: TypeInt 32 1 35: 34(int) Constant 2 36: TypePointer Input 6(float) - 41: TypePointer Input 26(fvec4) - 42(k): 41(ptr) Variable Input - 44: TypeVector 34(int) 4 - 51: TypeImage 6(float) Rect sampled format:Unknown - 52: TypeSampledImage 51 - 53: TypePointer UniformConstant 52 - 54(sampR): 53(ptr) Variable UniformConstant - 56: TypeVector 34(int) 2 - 58: TypeImage 34(int) Buffer sampled format:Unknown - 59: TypeSampledImage 58 - 60: TypePointer UniformConstant 59 - 61(sampB): 60(ptr) Variable UniformConstant - 66: TypeVector 6(float) 2 - 69: 6(float) Constant 1120403456 + 39: 29(int) Constant 1 + 40: TypePointer Output 6(float) + 42: TypePointer Input 26(fvec4) + 43(k): 42(ptr) Variable Input + 45: TypeVector 34(int) 4 + 50: 29(int) Constant 2 + 52: TypeImage 6(float) Rect sampled format:Unknown + 53: TypeSampledImage 52 + 54: TypePointer UniformConstant 53 + 55(sampR): 54(ptr) Variable UniformConstant + 57: TypeVector 34(int) 2 + 59: TypeImage 34(int) Buffer sampled format:Unknown + 60: TypeSampledImage 59 + 61: TypePointer UniformConstant 60 + 62(sampB): 61(ptr) Variable UniformConstant + 67: TypeVector 6(float) 2 + 70: 6(float) Constant 1120403456 + 72: 29(int) Constant 3 80: TypeImage 6(float) 2D sampled format:Unknown 81: TypeSampledImage 80 - 82: 29(int) Constant 3 - 83: TypeArray 81 82 - 84: TypePointer UniformConstant 83 - 85(samp2Da): 84(ptr) Variable UniformConstant - 86: TypeMatrix 26(fvec4) 4 - 87: 29(int) Constant 4 - 88: TypeArray 86 87 - 89(bn): TypeStruct 88 88 86 86 86 - 90: TypePointer Uniform 89(bn) - 91: 90(ptr) Variable Uniform + 82: TypeArray 81 72 + 83: TypePointer UniformConstant 82 + 84(samp2Da): 83(ptr) Variable UniformConstant + 85: TypeMatrix 26(fvec4) 4 + 86: 29(int) Constant 4 + 87: TypeArray 85 86 + 88(bn): TypeStruct 87 87 85 85 85 + 89: TypePointer Uniform 88(bn) + 90: 89(ptr) Variable Uniform + 91: TypeVector 6(float) 3 + 92: TypeArray 91(fvec3) 50 + 93(bi): TypeStruct 92 + 94: TypeArray 93(bi) 86 + 95: TypePointer Uniform 94 + 96(bname): 95(ptr) Variable Uniform 4(main): 2 Function None 3 5: Label 13: 12(ptr) Variable Function @@ -124,33 +135,29 @@ Linked fragment stage: Store 24(i2) 25 37: 36(ptr) AccessChain 33(gl_ClipDistance) 35 38: 6(float) Load 37 - 39: 26(fvec4) Load 28(o) - 40: 26(fvec4) CompositeInsert 38 39 1 - Store 28(o) 40 - 43: 26(fvec4) Load 42(k) - 45: 44(ivec4) ConvertFToS 43 - 46: 34(int) CompositeExtract 45 0 - 47: 36(ptr) AccessChain 33(gl_ClipDistance) 46 - 48: 6(float) Load 47 - 49: 26(fvec4) Load 28(o) - 50: 26(fvec4) CompositeInsert 48 49 2 - Store 28(o) 50 - 55: 52 Load 54(sampR) - 57: 56(ivec2) ImageQuerySize 55 - 62: 59 Load 61(sampB) - 63: 34(int) ImageQuerySize 62 - 64: 56(ivec2) CompositeConstruct 63 63 - 65: 56(ivec2) IAdd 57 64 - 67: 66(fvec2) ConvertSToF 65 - 68: 6(float) CompositeExtract 67 0 - 70: 6(float) FDiv 68 69 - 71: 26(fvec4) Load 28(o) - 72: 26(fvec4) CompositeInsert 70 71 3 - Store 28(o) 72 - 73: 6(float) FunctionCall 8(foo() - 74: 26(fvec4) Load 28(o) - 75: 26(fvec4) CompositeInsert 73 74 2 - Store 28(o) 75 + 41: 40(ptr) AccessChain 28(o) 39 + Store 41 38 + 44: 26(fvec4) Load 43(k) + 46: 45(ivec4) ConvertFToS 44 + 47: 34(int) CompositeExtract 46 0 + 48: 36(ptr) AccessChain 33(gl_ClipDistance) 47 + 49: 6(float) Load 48 + 51: 40(ptr) AccessChain 28(o) 50 + Store 51 49 + 56: 53 Load 55(sampR) + 58: 57(ivec2) ImageQuerySize 56 + 63: 60 Load 62(sampB) + 64: 34(int) ImageQuerySize 63 + 65: 57(ivec2) CompositeConstruct 64 64 + 66: 57(ivec2) IAdd 58 65 + 68: 67(fvec2) ConvertSToF 66 + 69: 6(float) CompositeExtract 68 0 + 71: 6(float) FDiv 69 70 + 73: 40(ptr) AccessChain 28(o) 72 + Store 73 71 + 74: 6(float) FunctionCall 8(foo() + 75: 40(ptr) AccessChain 28(o) 50 + Store 75 74 Return FunctionEnd 8(foo(): 6(float) Function None 7 diff --git a/Test/baseResults/spv.150.geom.out b/Test/baseResults/spv.150.geom.out index 7133df96..ea2b0cfc 100755 --- a/Test/baseResults/spv.150.geom.out +++ b/Test/baseResults/spv.150.geom.out @@ -3,19 +3,19 @@ spv.150.geom Linked geometry stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 71 - Source GLSL 150 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" + EntryPoint Geometry 4 "main" 18 70 10 29 33 ExecutionMode 4 InputTrianglesAdjacency ExecutionMode 4 Invocations 0 ExecutionMode 4 OutputTriangleStrip ExecutionMode 4 OutputVertices 30 + Source GLSL 150 Name 4 "main" Name 8 "fromVertex" MemberName 8(fromVertex) 0 "color" @@ -61,7 +61,6 @@ Linked geometry stage: Decorate 68(toFragment) Block Decorate 68(toFragment) Stream 3 Decorate 70(toF) Stream 3 - Decorate 70(toF) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.150.vert.out b/Test/baseResults/spv.150.vert.out index f0291a8c..b9604664 100755 --- a/Test/baseResults/spv.150.vert.out +++ b/Test/baseResults/spv.150.vert.out @@ -3,30 +3,23 @@ spv.150.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 52 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 50 - Source GLSL 150 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 17 39 48 49 + Source GLSL 150 Name 4 "main" - Name 13 "gl_PerVertex" - MemberName 13(gl_PerVertex) 0 "gl_Position" - MemberName 13(gl_PerVertex) 1 "gl_PointSize" - MemberName 13(gl_PerVertex) 2 "gl_ClipDistance" - MemberName 13(gl_PerVertex) 3 "gl_ClipVertex" - MemberName 13(gl_PerVertex) 4 "gl_FrontColor" - MemberName 13(gl_PerVertex) 5 "gl_BackColor" - MemberName 13(gl_PerVertex) 6 "gl_FrontSecondaryColor" - MemberName 13(gl_PerVertex) 7 "gl_BackSecondaryColor" - MemberName 13(gl_PerVertex) 8 "gl_TexCoord" - MemberName 13(gl_PerVertex) 9 "gl_FogFragCoord" - Name 15 "" - Name 19 "iv4" - Name 25 "ps" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + Name 13 "" + Name 17 "iv4" + Name 23 "ps" Name 35 "s1" MemberName 35(s1) 0 "a" MemberName 35(s1) 1 "a2" @@ -36,19 +29,16 @@ Linked vertex stage: MemberName 37(s2) 1 "d" Name 39 "s2out" Name 41 "i" - Name 48 "ui" - Name 50 "gl_VertexID" - Name 51 "gl_InstanceID" - MemberDecorate 13(gl_PerVertex) 0 Invariant - MemberDecorate 13(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 13(gl_PerVertex) 1 BuiltIn PointSize - MemberDecorate 13(gl_PerVertex) 2 BuiltIn ClipDistance - Decorate 13(gl_PerVertex) Block - Decorate 48(ui) NoStaticUse - Decorate 50(gl_VertexID) BuiltIn VertexId - Decorate 50(gl_VertexID) NoStaticUse - Decorate 51(gl_InstanceID) BuiltIn InstanceId - Decorate 51(gl_InstanceID) NoStaticUse + Name 46 "ui" + Name 48 "gl_VertexID" + Name 49 "gl_InstanceID" + MemberDecorate 11(gl_PerVertex) 0 Invariant + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 11(gl_PerVertex) Block + Decorate 48(gl_VertexID) BuiltIn VertexId + Decorate 49(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -56,52 +46,50 @@ Linked vertex stage: 8: TypeInt 32 0 9: 8(int) Constant 4 10: TypeArray 6(float) 9 - 11: 8(int) Constant 1 - 12: TypeArray 7(fvec4) 11 -13(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) 12 6(float) - 14: TypePointer Output 13(gl_PerVertex) - 15: 14(ptr) Variable Output - 16: TypeInt 32 1 - 17: 16(int) Constant 0 - 18: TypePointer Input 7(fvec4) - 19(iv4): 18(ptr) Variable Input - 21: TypePointer Output 7(fvec4) - 23: 16(int) Constant 1 - 24: TypePointer UniformConstant 6(float) - 25(ps): 24(ptr) Variable UniformConstant - 27: TypePointer Output 6(float) - 29: 16(int) Constant 2 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Input 7(fvec4) + 17(iv4): 16(ptr) Variable Input + 19: TypePointer Output 7(fvec4) + 21: 14(int) Constant 1 + 22: TypePointer UniformConstant 6(float) + 23(ps): 22(ptr) Variable UniformConstant + 25: TypePointer Output 6(float) + 27: 14(int) Constant 2 + 28: 8(int) Constant 0 + 29: TypePointer Input 6(float) 33: 8(int) Constant 3 34: TypeArray 7(fvec4) 33 - 35(s1): TypeStruct 16(int) 16(int) 34 + 35(s1): TypeStruct 14(int) 14(int) 34 36: TypeArray 35(s1) 9 - 37(s2): TypeStruct 16(int) 36 + 37(s2): TypeStruct 14(int) 36 38: TypePointer Output 37(s2) 39(s2out): 38(ptr) Variable Output - 40: TypePointer Function 16(int) - 47: TypePointer UniformConstant 16(int) - 48(ui): 47(ptr) Variable UniformConstant - 49: TypePointer Input 16(int) - 50(gl_VertexID): 49(ptr) Variable Input -51(gl_InstanceID): 49(ptr) Variable Input + 40: TypePointer Function 14(int) + 45: TypePointer UniformConstant 14(int) + 46(ui): 45(ptr) Variable UniformConstant + 47: TypePointer Input 14(int) + 48(gl_VertexID): 47(ptr) Variable Input +49(gl_InstanceID): 47(ptr) Variable Input 4(main): 2 Function None 3 5: Label 41(i): 40(ptr) Variable Function - 20: 7(fvec4) Load 19(iv4) - 22: 21(ptr) AccessChain 15 17 - Store 22 20 - 26: 6(float) Load 25(ps) - 28: 27(ptr) AccessChain 15 23 - Store 28 26 - 30: 7(fvec4) Load 19(iv4) - 31: 6(float) CompositeExtract 30 0 - 32: 27(ptr) AccessChain 15 29 29 + 18: 7(fvec4) Load 17(iv4) + 20: 19(ptr) AccessChain 13 15 + Store 20 18 + 24: 6(float) Load 23(ps) + 26: 25(ptr) AccessChain 13 21 + Store 26 24 + 30: 29(ptr) AccessChain 17(iv4) 28 + 31: 6(float) Load 30 + 32: 25(ptr) AccessChain 13 27 27 Store 32 31 - 42: 16(int) Load 41(i) - 43: 6(float) Load 25(ps) - 44: 21(ptr) AccessChain 39(s2out) 23 42 29 29 - 45: 7(fvec4) Load 44 - 46: 7(fvec4) CompositeInsert 43 45 3 - Store 44 46 + 42: 14(int) Load 41(i) + 43: 6(float) Load 23(ps) + 44: 25(ptr) AccessChain 39(s2out) 21 42 27 27 33 + Store 44 43 Return FunctionEnd diff --git a/Test/baseResults/spv.300BuiltIns.vert.out b/Test/baseResults/spv.300BuiltIns.vert.out index c867e1cf..40cccb5f 100755 --- a/Test/baseResults/spv.300BuiltIns.vert.out +++ b/Test/baseResults/spv.300BuiltIns.vert.out @@ -3,15 +3,15 @@ spv.300BuiltIns.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 40 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 25 11 39 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 11 "gl_VertexID" @@ -28,7 +28,6 @@ Linked vertex stage: Decorate 25(ps) RelaxedPrecision Decorate 33(gl_PointSize) BuiltIn PointSize Decorate 39(gl_InstanceID) BuiltIn InstanceId - Decorate 39(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/Test/baseResults/spv.300layout.frag.out b/Test/baseResults/spv.300layout.frag.out index 3700efe1..b263e5a8 100755 --- a/Test/baseResults/spv.300layout.frag.out +++ b/Test/baseResults/spv.300layout.frag.out @@ -3,16 +3,16 @@ spv.300layout.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 37 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 29 11 9 26 15 ExecutionMode 4 OriginLowerLeft + Source ESSL 300 Name 4 "main" Name 9 "c" Name 11 "color" @@ -25,13 +25,11 @@ Linked fragment stage: Decorate 9(c) RelaxedPrecision Decorate 9(c) Location 7 Decorate 11(color) RelaxedPrecision - Decorate 11(color) Smooth MemberDecorate 13(S) 0 RelaxedPrecision MemberDecorate 13(S) 1 RelaxedPrecision Decorate 26(p) RelaxedPrecision Decorate 26(p) Location 3 Decorate 29(pos) RelaxedPrecision - Decorate 29(pos) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.300layoutp.vert.out b/Test/baseResults/spv.300layoutp.vert.out index 50d37a69..26714cb8 100755 --- a/Test/baseResults/spv.300layoutp.vert.out +++ b/Test/baseResults/spv.300layoutp.vert.out @@ -3,15 +3,15 @@ spv.300layoutp.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 114 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 117 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 53 11 73 9 51 61 81 115 116 + Source ESSL 300 Name 4 "main" Name 9 "pos" Name 11 "p" @@ -36,13 +36,12 @@ Linked vertex stage: Name 61 "iout" Name 67 "uiuin" Name 73 "aiv2" - Name 77 "S" - MemberName 77(S) 0 "c" - MemberName 77(S) 1 "f" - Name 79 "s" - Name 112 "gl_VertexID" - Name 113 "gl_InstanceID" - Decorate 9(pos) Smooth + Name 79 "S" + MemberName 79(S) 0 "c" + MemberName 79(S) 1 "f" + Name 81 "s" + Name 115 "gl_VertexID" + Name 116 "gl_InstanceID" Decorate 11(p) Location 3 MemberDecorate 17(Transform) 0 RowMajor MemberDecorate 17(Transform) 0 Offset 0 @@ -63,14 +62,11 @@ Linked vertex stage: MemberDecorate 43(T2) 1 RowMajor Decorate 43(T2) GLSLShared Decorate 43(T2) Block - Decorate 51(color) Smooth Decorate 53(c) Location 7 Decorate 61(iout) Flat Decorate 73(aiv2) Location 9 - Decorate 112(gl_VertexID) BuiltIn VertexId - Decorate 112(gl_VertexID) NoStaticUse - Decorate 113(gl_InstanceID) BuiltIn InstanceId - Decorate 113(gl_InstanceID) NoStaticUse + Decorate 115(gl_VertexID) BuiltIn VertexId + Decorate 116(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -116,20 +112,23 @@ Linked vertex stage: 71: TypeVector 16(int) 2 72: TypePointer Input 71(ivec2) 73(aiv2): 72(ptr) Variable Input - 77(S): TypeStruct 14(fvec3) 6(float) - 78: TypePointer Output 77(S) - 79(s): 78(ptr) Variable Output - 84: TypePointer Output 6(float) - 86: TypePointer Uniform 14(fvec3) - 89: 6(float) Constant 1065353216 - 90: 14(fvec3) ConstantComposite 89 89 89 - 91: TypeVector 42(bool) 3 - 97: TypePointer Uniform 30(ivec3) - 100: 29(int) Constant 5 - 101: 30(ivec3) ConstantComposite 100 100 100 - 111: TypePointer Input 16(int) -112(gl_VertexID): 111(ptr) Variable Input -113(gl_InstanceID): 111(ptr) Variable Input + 74: 29(int) Constant 1 + 75: TypePointer Input 16(int) + 79(S): TypeStruct 14(fvec3) 6(float) + 80: TypePointer Output 79(S) + 81(s): 80(ptr) Variable Output + 84: 29(int) Constant 0 + 85: TypePointer Input 6(float) + 88: TypePointer Output 6(float) + 90: TypePointer Uniform 14(fvec3) + 93: 6(float) Constant 1065353216 + 94: 14(fvec3) ConstantComposite 93 93 93 + 95: TypeVector 42(bool) 3 + 101: TypePointer Uniform 30(ivec3) + 104: 29(int) Constant 5 + 105: 30(ivec3) ConstantComposite 104 104 104 +115(gl_VertexID): 75(ptr) Variable Input +116(gl_InstanceID): 75(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(p) @@ -159,41 +158,41 @@ Linked vertex stage: 68: 29(int) Load 67(uiuin) 69: 16(int) Bitcast 68 70: 16(int) IAdd 65 69 - 74: 71(ivec2) Load 73(aiv2) - 75: 16(int) CompositeExtract 74 1 - 76: 16(int) IAdd 70 75 - Store 61(iout) 76 - 80: 14(fvec3) Load 53(c) - 81: 50(ptr) AccessChain 79(s) 20 - Store 81 80 - 82: 7(fvec4) Load 11(p) - 83: 6(float) CompositeExtract 82 0 - 85: 84(ptr) AccessChain 79(s) 24 - Store 85 83 - 87: 86(ptr) AccessChain 35 55 24 - 88: 14(fvec3) Load 87 - 92: 91(bvec3) FOrdNotEqual 88 90 - 93: 42(bool) Any 92 - 94: 42(bool) LogicalNot 93 - SelectionMerge 96 None - BranchConditional 94 95 96 - 95: Label - 98: 97(ptr) AccessChain 35 62 55 - 99: 30(ivec3) Load 98 - 102: 91(bvec3) INotEqual 99 101 - 103: 42(bool) Any 102 - Branch 96 - 96: Label - 104: 42(bool) Phi 93 5 103 95 - SelectionMerge 106 None - BranchConditional 104 105 106 - 105: Label - 107: 50(ptr) AccessChain 79(s) 20 - 108: 14(fvec3) Load 107 - 109: 14(fvec3) CompositeConstruct 89 89 89 - 110: 14(fvec3) FAdd 108 109 - Store 107 110 - Branch 106 - 106: Label + 76: 75(ptr) AccessChain 73(aiv2) 74 + 77: 16(int) Load 76 + 78: 16(int) IAdd 70 77 + Store 61(iout) 78 + 82: 14(fvec3) Load 53(c) + 83: 50(ptr) AccessChain 81(s) 20 + Store 83 82 + 86: 85(ptr) AccessChain 11(p) 84 + 87: 6(float) Load 86 + 89: 88(ptr) AccessChain 81(s) 24 + Store 89 87 + 91: 90(ptr) AccessChain 35 55 24 + 92: 14(fvec3) Load 91 + 96: 95(bvec3) FOrdNotEqual 92 94 + 97: 42(bool) Any 96 + 98: 42(bool) LogicalNot 97 + SelectionMerge 100 None + BranchConditional 98 99 100 + 99: Label + 102: 101(ptr) AccessChain 35 62 55 + 103: 30(ivec3) Load 102 + 106: 95(bvec3) INotEqual 103 105 + 107: 42(bool) Any 106 + Branch 100 + 100: Label + 108: 42(bool) Phi 97 5 107 99 + SelectionMerge 110 None + BranchConditional 108 109 110 + 109: Label + 111: 50(ptr) AccessChain 81(s) 20 + 112: 14(fvec3) Load 111 + 113: 14(fvec3) CompositeConstruct 93 93 93 + 114: 14(fvec3) FAdd 112 113 + Store 111 114 + Branch 110 + 110: Label Return FunctionEnd diff --git a/Test/baseResults/spv.310.comp.out b/Test/baseResults/spv.310.comp.out old mode 100644 new mode 100755 index 93dba976..d95940bc --- a/Test/baseResults/spv.310.comp.out +++ b/Test/baseResults/spv.310.comp.out @@ -5,16 +5,16 @@ Warning, version 310 is not yet complete; most version-specific features are pre Linked compute stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 67 - Source ESSL 310 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint GLCompute 4 "main" ExecutionMode 4 LocalSize 16 32 4 + Source ESSL 310 Name 4 "main" Name 13 "outb" MemberName 13(outb) 0 "f" @@ -27,21 +27,20 @@ Linked compute stage: MemberName 24(outbna) 0 "k" MemberName 24(outbna) 1 "na" Name 26 "outbnamena" - Name 43 "i" - Name 49 "outs" - MemberName 49(outs) 0 "s" - MemberName 49(outs) 1 "va" - Name 51 "outnames" - Name 54 "gl_LocalInvocationID" + Name 42 "i" + Name 48 "outs" + MemberName 48(outs) 0 "s" + MemberName 48(outs) 1 "va" + Name 50 "outnames" + Name 53 "gl_LocalInvocationID" Decorate 13(outb) GLSLShared Decorate 13(outb) BufferBlock Decorate 24(outbna) GLSLShared Decorate 24(outbna) BufferBlock - Decorate 49(outs) GLSLShared - Decorate 49(outs) BufferBlock - Decorate 54(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 48(outs) GLSLShared + Decorate 48(outs) BufferBlock + Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 66 BuiltIn WorkgroupSize - Decorate 66 NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -56,8 +55,8 @@ Linked compute stage: 15(outbname): 14(ptr) Variable Uniform 16: TypeInt 32 1 17: 16(int) Constant 0 - 18: TypePointer WorkgroupLocal 10(float) - 19(s): 18(ptr) Variable WorkgroupLocal + 18: TypePointer Workgroup 10(float) + 19(s): 18(ptr) Variable Workgroup 21: TypePointer Uniform 10(float) 23: TypeVector 10(float) 4 24(outbna): TypeStruct 16(int) 23(fvec4) @@ -67,24 +66,25 @@ Linked compute stage: 30: TypePointer Uniform 23(fvec4) 32: 16(int) Constant 3 33: 16(int) Constant 18 - 34: TypePointer Uniform 11(fvec3) - 38: 16(int) Constant 17 - 39: 10(float) Constant 1077936128 - 40: 11(fvec3) ConstantComposite 39 39 39 - 42: TypePointer WorkgroupLocal 16(int) - 43(i): 42(ptr) Variable WorkgroupLocal - 48: TypeRuntimeArray 23(fvec4) - 49(outs): TypeStruct 16(int) 48 - 50: TypePointer Uniform 49(outs) - 51(outnames): 50(ptr) Variable Uniform - 52: TypeVector 6(int) 3 - 53: TypePointer Input 52(ivec3) -54(gl_LocalInvocationID): 53(ptr) Variable Input + 36: 16(int) Constant 17 + 37: 10(float) Constant 1077936128 + 38: 11(fvec3) ConstantComposite 37 37 37 + 39: TypePointer Uniform 11(fvec3) + 41: TypePointer Workgroup 16(int) + 42(i): 41(ptr) Variable Workgroup + 47: TypeRuntimeArray 23(fvec4) + 48(outs): TypeStruct 16(int) 47 + 49: TypePointer Uniform 48(outs) + 50(outnames): 49(ptr) Variable Uniform + 51: TypeVector 6(int) 3 + 52: TypePointer Input 51(ivec3) +53(gl_LocalInvocationID): 52(ptr) Variable Input + 54: TypePointer Input 6(int) 61: TypePointer Uniform 16(int) 63: 6(int) Constant 16 64: 6(int) Constant 32 65: 6(int) Constant 4 - 66: 52(ivec3) ConstantComposite 63 64 65 + 66: 51(ivec3) ConstantComposite 63 64 65 4(main): 2 Function None 3 5: Label MemoryBarrier 7 8 @@ -96,25 +96,24 @@ Linked compute stage: 29: 23(fvec4) CompositeConstruct 28 28 28 28 31: 30(ptr) AccessChain 26(outbnamena) 27 Store 31 29 - 35: 34(ptr) AccessChain 15(outbname) 32 33 - 36: 11(fvec3) Load 35 - 37: 10(float) CompositeExtract 36 0 - Store 19(s) 37 - 41: 34(ptr) AccessChain 15(outbname) 32 38 - Store 41 40 - 44: 16(int) Load 43(i) - 45: 10(float) Load 19(s) - 46: 11(fvec3) CompositeConstruct 45 45 45 - 47: 34(ptr) AccessChain 15(outbname) 32 44 - Store 47 46 - 55: 52(ivec3) Load 54(gl_LocalInvocationID) - 56: 6(int) CompositeExtract 55 0 + 34: 21(ptr) AccessChain 15(outbname) 32 33 9 + 35: 10(float) Load 34 + Store 19(s) 35 + 40: 39(ptr) AccessChain 15(outbname) 32 36 + Store 40 38 + 43: 16(int) Load 42(i) + 44: 10(float) Load 19(s) + 45: 11(fvec3) CompositeConstruct 44 44 44 + 46: 39(ptr) AccessChain 15(outbname) 32 43 + Store 46 45 + 55: 54(ptr) AccessChain 53(gl_LocalInvocationID) 9 + 56: 6(int) Load 55 57: 10(float) Load 19(s) 58: 23(fvec4) CompositeConstruct 57 57 57 57 - 59: 30(ptr) AccessChain 51(outnames) 27 56 + 59: 30(ptr) AccessChain 50(outnames) 27 56 Store 59 58 60: 16(int) ArrayLength 15(outbname) 3 - 62: 61(ptr) AccessChain 51(outnames) 17 + 62: 61(ptr) AccessChain 50(outnames) 17 Store 62 60 Return FunctionEnd diff --git a/Test/baseResults/spv.330.geom.out b/Test/baseResults/spv.330.geom.out index 1a779876..5625cb31 100755 --- a/Test/baseResults/spv.330.geom.out +++ b/Test/baseResults/spv.330.geom.out @@ -3,20 +3,20 @@ spv.330.geom Linked geometry stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 32 - Source GLSL 330 - SourceExtension "GL_ARB_separate_shader_objects" Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" - ExecutionMode 4 InputTriangles + EntryPoint Geometry 4 "main" 20 13 + ExecutionMode 4 Triangles ExecutionMode 4 Invocations 0 ExecutionMode 4 OutputTriangleStrip ExecutionMode 4 OutputVertices 3 + Source GLSL 330 + SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" Name 11 "gl_PerVertex" MemberName 11(gl_PerVertex) 0 "gl_Position" diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 2024d533..86f8ba3c 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -5,4 +5,170 @@ Warning, version 400 is not yet complete; most version-specific features are pre Linked fragment stage: -Missing functionality: texture gather +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 125 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 50 44 11 96 69 119 56 + ExecutionMode 4 OriginLowerLeft + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" + Name 4 "main" + Name 6 "foo23(" + Name 11 "outp" + Name 15 "u2drs" + Name 36 "v" + Name 42 "arrayedSampler" + Name 44 "i" + Name 50 "c2D" + Name 56 "gl_ClipDistance" + Name 69 "uoutp" + Name 73 "samp2dr" + Name 96 "ioutp" + Name 100 "isamp2DA" + Name 117 "gl_FragCoord" + Name 119 "vl2" + Decorate 44(i) Flat + Decorate 56(gl_ClipDistance) BuiltIn ClipDistance + Decorate 117(gl_FragCoord) BuiltIn FragCoord + Decorate 119(vl2) Location 6 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypePointer Output 9(fvec4) + 11(outp): 10(ptr) Variable Output + 12: TypeImage 8(float) Rect depth sampled format:Unknown + 13: TypeSampledImage 12 + 14: TypePointer UniformConstant 13 + 15(u2drs): 14(ptr) Variable UniformConstant + 18: TypeVector 8(float) 2 + 19: 8(float) Constant 0 + 20: 18(fvec2) ConstantComposite 19 19 + 21: TypeInt 32 1 + 22: TypeVector 21(int) 2 + 23: 21(int) Constant 3 + 24: 21(int) Constant 4 + 25: 22(ivec2) ConstantComposite 23 24 + 28: TypeInt 32 0 + 29: 28(int) Constant 0 + 30: TypePointer Output 8(float) + 35: TypePointer Function 9(fvec4) + 37: TypeImage 8(float) 2D sampled format:Unknown + 38: TypeSampledImage 37 + 39: 28(int) Constant 5 + 40: TypeArray 38 39 + 41: TypePointer UniformConstant 40 +42(arrayedSampler): 41(ptr) Variable UniformConstant + 43: TypePointer Input 21(int) + 44(i): 43(ptr) Variable Input + 46: TypePointer UniformConstant 38 + 49: TypePointer Input 18(fvec2) + 50(c2D): 49(ptr) Variable Input + 53: 28(int) Constant 2 + 54: TypeArray 8(float) 53 + 55: TypePointer Input 54 +56(gl_ClipDistance): 55(ptr) Variable Input + 57: 21(int) Constant 1 + 58: TypePointer Input 8(float) + 62: TypeVector 8(float) 3 + 67: TypeVector 28(int) 4 + 68: TypePointer Output 67(ivec4) + 69(uoutp): 68(ptr) Variable Output + 70: TypeImage 28(int) Rect sampled format:Unknown + 71: TypeSampledImage 70 + 72: TypePointer UniformConstant 71 + 73(samp2dr): 72(ptr) Variable UniformConstant + 76: 28(int) Constant 4 + 77: TypeArray 22(ivec2) 76 + 78: 21(int) Constant 2 + 79: 22(ivec2) ConstantComposite 57 78 + 80: 21(int) Constant 15 + 81: 21(int) Constant 16 + 82: 22(ivec2) ConstantComposite 80 81 + 83: 21(int) Constant 4294967294 + 84: 21(int) Constant 0 + 85: 22(ivec2) ConstantComposite 83 84 + 86: 77 ConstantComposite 79 25 82 85 + 94: TypeVector 21(int) 4 + 95: TypePointer Output 94(ivec4) + 96(ioutp): 95(ptr) Variable Output + 97: TypeImage 21(int) 2D array sampled format:Unknown + 98: TypeSampledImage 97 + 99: TypePointer UniformConstant 98 + 100(isamp2DA): 99(ptr) Variable UniformConstant + 102: 8(float) Constant 1036831949 + 103: 62(fvec3) ConstantComposite 102 102 102 + 104: 22(ivec2) ConstantComposite 57 57 + 116: TypePointer Input 9(fvec4) +117(gl_FragCoord): 116(ptr) Variable Input + 119(vl2): 116(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 36(v): 35(ptr) Variable Function + 45: 21(int) Load 44(i) + 47: 46(ptr) AccessChain 42(arrayedSampler) 45 + 48: 38 Load 47 + 51: 18(fvec2) Load 50(c2D) + 52: 9(fvec4) ImageSampleImplicitLod 48 51 + Store 36(v) 52 + 59: 58(ptr) AccessChain 56(gl_ClipDistance) 57 + 60: 8(float) Load 59 + 61: 30(ptr) AccessChain 11(outp) 29 + Store 61 60 + 63: 9(fvec4) Load 36(v) + 64: 62(fvec3) VectorShuffle 63 63 1 2 3 + 65: 9(fvec4) Load 11(outp) + 66: 9(fvec4) VectorShuffle 65 64 0 4 5 6 + Store 11(outp) 66 + 74: 71 Load 73(samp2dr) + 75: 18(fvec2) Load 50(c2D) + 87: 67(ivec4) ImageGather 74 75 78 ConstOffsets 86 + Store 69(uoutp) 87 + 88: 46(ptr) AccessChain 42(arrayedSampler) 84 + 89: 38 Load 88 + 90: 18(fvec2) Load 50(c2D) + 91: 9(fvec4) ImageGather 89 90 84 + 92: 9(fvec4) Load 11(outp) + 93: 9(fvec4) FAdd 92 91 + Store 11(outp) 93 + 101: 98 Load 100(isamp2DA) + 105: 94(ivec4) ImageGather 101 103 23 ConstOffset 104 + Store 96(ioutp) 105 + 106: 98 Load 100(isamp2DA) + 107: 94(ivec4) ImageGather 106 103 23 ConstOffset 104 + 108: 94(ivec4) Load 96(ioutp) + 109: 94(ivec4) IAdd 108 107 + Store 96(ioutp) 109 + 110: 98 Load 100(isamp2DA) + 111: 21(int) Load 44(i) + 112: 22(ivec2) CompositeConstruct 111 111 + 113: 94(ivec4) ImageGather 110 103 84 Offset 112 + 114: 94(ivec4) Load 96(ioutp) + 115: 94(ivec4) IAdd 114 113 + Store 96(ioutp) 115 + 118: 9(fvec4) Load 117(gl_FragCoord) + 120: 9(fvec4) Load 119(vl2) + 121: 9(fvec4) FAdd 118 120 + 122: 9(fvec4) Load 11(outp) + 123: 9(fvec4) FAdd 122 121 + Store 11(outp) 123 + 124: 2 FunctionCall 6(foo23() + Return + FunctionEnd + 6(foo23(): 2 Function None 3 + 7: Label + 16: 13 Load 15(u2drs) + 17: 9(fvec4) Load 11(outp) + 26: 8(float) CompositeExtract 17 3 + 27: 8(float) ImageSampleProjDrefExplicitLod 16 17 26 Grad ConstOffset 20 20 25 + 31: 30(ptr) AccessChain 11(outp) 29 + 32: 8(float) Load 31 + 33: 8(float) FAdd 32 27 + 34: 30(ptr) AccessChain 11(outp) 29 + Store 34 33 + Return + FunctionEnd diff --git a/Test/baseResults/spv.400.tesc.out b/Test/baseResults/spv.400.tesc.out index 96ca098a..c1bee837 100755 --- a/Test/baseResults/spv.400.tesc.out +++ b/Test/baseResults/spv.400.tesc.out @@ -5,17 +5,17 @@ Warning, version 400 is not yet complete; most version-specific features are pre Linked tessellation control stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 90 - Source GLSL 400 - SourceExtension "GL_ARB_separate_shader_objects" Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" + EntryPoint TessellationControl 4 "main" 52 76 80 81 84 85 88 89 ExecutionMode 4 OutputVertices 4 + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" Name 12 "a" Name 17 "p" @@ -62,19 +62,11 @@ Linked tessellation control stage: Decorate 63(gl_TessLevelOuter) BuiltIn TessLevelOuter Decorate 70(gl_TessLevelInner) Patch Decorate 70(gl_TessLevelInner) BuiltIn TessLevelInner - Decorate 75(outa) NoStaticUse Decorate 76(patchOut) Patch - Decorate 76(patchOut) NoStaticUse - Decorate 80(inb) NoStaticUse - Decorate 81(ind) NoStaticUse Decorate 84(ivla) Location 3 - Decorate 84(ivla) NoStaticUse Decorate 85(ivlb) Location 4 - Decorate 85(ivlb) NoStaticUse Decorate 88(ovla) Location 3 - Decorate 88(ovla) NoStaticUse Decorate 89(ovlb) Location 4 - Decorate 89(ovlb) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -121,8 +113,8 @@ Linked tessellation control stage: 70(gl_TessLevelInner): 69(ptr) Variable Output 71: 14(float) Constant 1067869798 73: TypeArray 10(int) 49 - 74: TypePointer PrivateGlobal 73 - 75(outa): 74(ptr) Variable PrivateGlobal + 74: TypePointer Private 73 + 75(outa): 74(ptr) Variable Private 76(patchOut): 54(ptr) Variable Output 77: TypeVector 14(float) 2 78: TypeArray 77(fvec2) 20 diff --git a/Test/baseResults/spv.400.tese.out b/Test/baseResults/spv.400.tese.out index ea24998d..00c5aba7 100755 --- a/Test/baseResults/spv.400.tese.out +++ b/Test/baseResults/spv.400.tese.out @@ -5,20 +5,20 @@ Warning, version 400 is not yet complete; most version-specific features are pre Linked tessellation evaluation stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 98 - Source GLSL 400 - SourceExtension "GL_ARB_separate_shader_objects" Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationEvaluation 4 "main" - ExecutionMode 4 InputTriangles + EntryPoint TessellationEvaluation 4 "main" 77 68 81 82 86 90 93 94 97 + ExecutionMode 4 Triangles ExecutionMode 4 SpacingFractionalOdd ExecutionMode 4 VertexOrderCcw ExecutionMode 4 PointMode + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" Name 8 "a" Name 13 "p" @@ -72,19 +72,11 @@ Linked tessellation evaluation stage: MemberDecorate 66(gl_PerVertex) 2 BuiltIn ClipDistance Decorate 66(gl_PerVertex) Block Decorate 77(patchIn) Patch - Decorate 77(patchIn) NoStaticUse - Decorate 81(inb) NoStaticUse - Decorate 82(ind) NoStaticUse Decorate 83(testblb) Block - Decorate 86(blb) NoStaticUse Decorate 87(testbld) Block - Decorate 90(bld) NoStaticUse Decorate 93(ivla) Location 23 - Decorate 93(ivla) NoStaticUse Decorate 94(ivlb) Location 24 - Decorate 94(ivlb) NoStaticUse Decorate 97(ovla) Location 23 - Decorate 97(ovla) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out index 8a0ecf32..a9922b78 100644 --- a/Test/baseResults/spv.420.geom.out +++ b/Test/baseResults/spv.420.geom.out @@ -5,4 +5,126 @@ Warning, version 420 is not yet complete; most version-specific features are pre Linked geometry stage: -Missing functionality: texture gather +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 74 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 14 23 46 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 4 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 127 + Source GLSL 420 + Name 4 "main" + Name 8 "p" + Name 9 "gl_PerVertex" + MemberName 9(gl_PerVertex) 0 "gl_PointSize" + Name 14 "gl_in" + Name 21 "gl_PerVertex" + MemberName 21(gl_PerVertex) 0 "gl_PointSize" + Name 23 "" + Name 28 "gl_ViewportIndex" + Name 31 "id" + Name 33 "gl_InvocationID" + Name 37 "v" + Name 41 "s2D" + Name 46 "coord" + Name 64 "i" + Name 67 "indexable" + Name 73 "v4" + MemberDecorate 9(gl_PerVertex) 0 BuiltIn PointSize + Decorate 9(gl_PerVertex) Block + MemberDecorate 21(gl_PerVertex) 0 BuiltIn PointSize + Decorate 21(gl_PerVertex) Block + Decorate 21(gl_PerVertex) Stream 0 + Decorate 23 Stream 0 + Decorate 28(gl_ViewportIndex) Stream 0 + Decorate 28(gl_ViewportIndex) BuiltIn ViewportIndex + Decorate 33(gl_InvocationID) BuiltIn InvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9(gl_PerVertex): TypeStruct 6(float) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(gl_PerVertex) 11 + 13: TypePointer Input 12 + 14(gl_in): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 1 + 17: 15(int) Constant 0 + 18: TypePointer Input 6(float) +21(gl_PerVertex): TypeStruct 6(float) + 22: TypePointer Output 21(gl_PerVertex) + 23: 22(ptr) Variable Output + 25: TypePointer Output 6(float) + 27: TypePointer Output 15(int) +28(gl_ViewportIndex): 27(ptr) Variable Output + 29: 15(int) Constant 7 + 30: TypePointer Function 15(int) + 32: TypePointer Input 15(int) +33(gl_InvocationID): 32(ptr) Variable Input + 35: TypeVector 6(float) 4 + 36: TypePointer Function 35(fvec4) + 38: TypeImage 6(float) 2D sampled format:Unknown + 39: TypeSampledImage 38 + 40: TypePointer UniformConstant 39 + 41(s2D): 40(ptr) Variable UniformConstant + 43: TypeVector 6(float) 2 + 44: TypeArray 43(fvec2) 11 + 45: TypePointer Input 44 + 46(coord): 45(ptr) Variable Input + 47: TypePointer Input 43(fvec2) + 50: TypeVector 15(int) 2 + 51: 10(int) Constant 5 + 52: TypeArray 50(ivec2) 51 + 53: 50(ivec2) ConstantComposite 17 16 + 54: 15(int) Constant 4294967294 + 55: 50(ivec2) ConstantComposite 16 54 + 56: 15(int) Constant 3 + 57: 50(ivec2) ConstantComposite 17 56 + 58: 15(int) Constant 4294967293 + 59: 50(ivec2) ConstantComposite 58 17 + 60: 15(int) Constant 2 + 61: 50(ivec2) ConstantComposite 60 16 + 62: 52 ConstantComposite 53 55 57 59 61 + 63: TypePointer UniformConstant 15(int) + 64(i): 63(ptr) Variable UniformConstant + 66: TypePointer Function 52 + 68: TypePointer Function 50(ivec2) + 72: TypePointer UniformConstant 35(fvec4) + 73(v4): 72(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 8(p): 7(ptr) Variable Function + 31(id): 30(ptr) Variable Function + 37(v): 36(ptr) Variable Function + 67(indexable): 66(ptr) Variable Function + 19: 18(ptr) AccessChain 14(gl_in) 16 17 + 20: 6(float) Load 19 + Store 8(p) 20 + 24: 6(float) Load 8(p) + 26: 25(ptr) AccessChain 23 17 + Store 26 24 + Store 28(gl_ViewportIndex) 29 + EmitStreamVertex 16 + EndStreamPrimitive 17 + EmitVertex + EndPrimitive + 34: 15(int) Load 33(gl_InvocationID) + Store 31(id) 34 + 42: 39 Load 41(s2D) + 48: 47(ptr) AccessChain 46(coord) 17 + 49: 43(fvec2) Load 48 + 65: 15(int) Load 64(i) + Store 67(indexable) 62 + 69: 68(ptr) AccessChain 67(indexable) 65 + 70: 50(ivec2) Load 69 + 71: 35(fvec4) ImageGather 42 49 17 Offset 70 + Store 37(v) 71 + Return + FunctionEnd diff --git a/Test/baseResults/spv.430.vert.out b/Test/baseResults/spv.430.vert.out index 15485c2e..5ea903e7 100755 --- a/Test/baseResults/spv.430.vert.out +++ b/Test/baseResults/spv.430.vert.out @@ -5,65 +5,52 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 62 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 63 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 12 23 44 45 34 61 62 + Source GLSL 430 Name 4 "main" Name 10 "gl_PerVertex" MemberName 10(gl_PerVertex) 0 "gl_ClipDistance" Name 12 "" Name 23 "bad" Name 34 "badorder3" - Name 38 "f" - Name 42 "uv4" - Name 43 "badorder" - Name 44 "badorder2" - Name 45 "boundblock" - MemberName 45(boundblock) 0 "aoeu" - Name 47 "boundInst" - Name 48 "anonblock" - MemberName 48(anonblock) 0 "aoeu" - Name 50 "" - Name 54 "sampb1" - Name 57 "sampb2" - Name 58 "sampb4" - Name 60 "gl_VertexID" - Name 61 "gl_InstanceID" + Name 39 "f" + Name 43 "uv4" + Name 44 "badorder" + Name 45 "badorder2" + Name 46 "boundblock" + MemberName 46(boundblock) 0 "aoeu" + Name 48 "boundInst" + Name 49 "anonblock" + MemberName 49(anonblock) 0 "aoeu" + Name 51 "" + Name 55 "sampb1" + Name 58 "sampb2" + Name 59 "sampb4" + Name 61 "gl_VertexID" + Name 62 "gl_InstanceID" MemberDecorate 10(gl_PerVertex) 0 BuiltIn ClipDistance Decorate 10(gl_PerVertex) Block Decorate 34(badorder3) Flat - Decorate 42(uv4) Location 4 - Decorate 42(uv4) NoStaticUse - Decorate 28 NoStaticUse - Decorate 28 NoStaticUse - Decorate 43(badorder) NoStaticUse - Decorate 44(badorder2) Smooth - Decorate 44(badorder2) Invariant - Decorate 44(badorder2) NoStaticUse - Decorate 45(boundblock) GLSLShared - Decorate 45(boundblock) Block - Decorate 47(boundInst) Binding 3 - Decorate 47(boundInst) NoStaticUse - Decorate 48(anonblock) GLSLShared - Decorate 48(anonblock) Block - Decorate 50 Binding 7 - Decorate 50 NoStaticUse - Decorate 54(sampb1) Binding 4 - Decorate 54(sampb1) NoStaticUse - Decorate 57(sampb2) Binding 5 - Decorate 57(sampb2) NoStaticUse - Decorate 58(sampb4) Binding 31 - Decorate 58(sampb4) NoStaticUse - Decorate 60(gl_VertexID) BuiltIn VertexId - Decorate 60(gl_VertexID) NoStaticUse - Decorate 61(gl_InstanceID) BuiltIn InstanceId - Decorate 61(gl_InstanceID) NoStaticUse + Decorate 43(uv4) Location 4 + Decorate 45(badorder2) Invariant + Decorate 46(boundblock) GLSLShared + Decorate 46(boundblock) Block + Decorate 48(boundInst) Binding 3 + Decorate 49(anonblock) GLSLShared + Decorate 49(anonblock) Block + Decorate 51 Binding 7 + Decorate 55(sampb1) Binding 4 + Decorate 58(sampb2) Binding 5 + Decorate 59(sampb4) Binding 31 + Decorate 61(gl_VertexID) BuiltIn VertexId + Decorate 62(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -83,52 +70,53 @@ Linked vertex stage: 21: TypeArray 19(fvec4) 20 22: TypePointer Input 21 23(bad): 22(ptr) Variable Input - 24: TypePointer Input 19(fvec4) + 24: 7(int) Constant 0 + 25: TypePointer Input 6(float) 28: 6(float) Constant 1082549862 29: TypeBool 33: TypePointer Output 19(fvec4) 34(badorder3): 33(ptr) Variable Output - 37: TypePointer UniformConstant 6(float) - 38(f): 37(ptr) Variable UniformConstant - 41: TypePointer UniformConstant 19(fvec4) - 42(uv4): 41(ptr) Variable UniformConstant - 43(badorder): 24(ptr) Variable Input - 44(badorder2): 33(ptr) Variable Output - 45(boundblock): TypeStruct 13(int) - 46: TypePointer Uniform 45(boundblock) - 47(boundInst): 46(ptr) Variable Uniform - 48(anonblock): TypeStruct 13(int) - 49: TypePointer Uniform 48(anonblock) - 50: 49(ptr) Variable Uniform - 51: TypeImage 6(float) 2D sampled format:Unknown - 52: TypeSampledImage 51 - 53: TypePointer UniformConstant 52 - 54(sampb1): 53(ptr) Variable UniformConstant - 55: TypeArray 52 20 - 56: TypePointer UniformConstant 55 - 57(sampb2): 56(ptr) Variable UniformConstant - 58(sampb4): 53(ptr) Variable UniformConstant - 59: TypePointer Input 13(int) - 60(gl_VertexID): 59(ptr) Variable Input -61(gl_InstanceID): 59(ptr) Variable Input + 35: TypePointer Input 19(fvec4) + 38: TypePointer UniformConstant 6(float) + 39(f): 38(ptr) Variable UniformConstant + 42: TypePointer UniformConstant 19(fvec4) + 43(uv4): 42(ptr) Variable UniformConstant + 44(badorder): 35(ptr) Variable Input + 45(badorder2): 33(ptr) Variable Output + 46(boundblock): TypeStruct 13(int) + 47: TypePointer Uniform 46(boundblock) + 48(boundInst): 47(ptr) Variable Uniform + 49(anonblock): TypeStruct 13(int) + 50: TypePointer Uniform 49(anonblock) + 51: 50(ptr) Variable Uniform + 52: TypeImage 6(float) 2D sampled format:Unknown + 53: TypeSampledImage 52 + 54: TypePointer UniformConstant 53 + 55(sampb1): 54(ptr) Variable UniformConstant + 56: TypeArray 53 20 + 57: TypePointer UniformConstant 56 + 58(sampb2): 57(ptr) Variable UniformConstant + 59(sampb4): 54(ptr) Variable UniformConstant + 60: TypePointer Input 13(int) + 61(gl_VertexID): 60(ptr) Variable Input +62(gl_InstanceID): 60(ptr) Variable Input 4(main): 2 Function None 3 5: Label 18: 17(ptr) AccessChain 12 14 15 Store 18 16 - 25: 24(ptr) AccessChain 23(bad) 14 - 26: 19(fvec4) Load 25 - 27: 6(float) CompositeExtract 26 0 + 26: 25(ptr) AccessChain 23(bad) 14 24 + 27: 6(float) Load 26 30: 29(bool) FOrdEqual 27 28 SelectionMerge 32 None BranchConditional 30 31 32 31: Label - 35: 24(ptr) AccessChain 23(bad) 14 - 36: 19(fvec4) Load 35 - Store 34(badorder3) 36 + 36: 35(ptr) AccessChain 23(bad) 14 + 37: 19(fvec4) Load 36 + Store 34(badorder3) 37 Branch 32 32: Label - 39: 6(float) Load 38(f) - 40: 17(ptr) AccessChain 12 14 14 - Store 40 39 + 40: 6(float) Load 39(f) + 41: 17(ptr) AccessChain 12 14 14 + Store 41 40 Return FunctionEnd diff --git a/Test/baseResults/spv.AofA.frag.out b/Test/baseResults/spv.AofA.frag.out index d24355f3..daa9f498 100644 --- a/Test/baseResults/spv.AofA.frag.out +++ b/Test/baseResults/spv.AofA.frag.out @@ -5,16 +5,16 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 103 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 77 38 43 ExecutionMode 4 OriginLowerLeft + Source GLSL 430 Name 4 "main" Name 17 "foo(f1[5][7];" Name 16 "a" @@ -33,8 +33,6 @@ Linked fragment stage: Name 93 "uAofA" MemberName 93(uAofA) 0 "f" Name 97 "nameAofA" - Decorate 43(g5) Smooth - Decorate 77(infloat) Smooth Decorate 93(uAofA) GLSLShared Decorate 93(uAofA) Block 2: TypeVoid @@ -58,8 +56,8 @@ Linked fragment stage: 37: TypePointer Output 6(float) 38(outfloat): 37(ptr) Variable Output 39: 6(float) Constant 0 - 40: TypePointer PrivateGlobal 14 - 41(g4): 40(ptr) Variable PrivateGlobal + 40: TypePointer Private 14 + 41(g4): 40(ptr) Variable Private 42: TypePointer Input 11 43(g5): 42(ptr) Variable Input 48: 6(float) Constant 1077936128 @@ -74,15 +72,15 @@ Linked fragment stage: 61: TypeArray 59 60 62: 7(int) Constant 1 63: TypeArray 61 62 - 64: TypePointer PrivateGlobal 63 - 65(many): 64(ptr) Variable PrivateGlobal + 64: TypePointer Private 63 + 65(many): 64(ptr) Variable Private 66: TypePointer UniformConstant 21(int) 67(i): 66(ptr) Variable UniformConstant 69(j): 66(ptr) Variable UniformConstant 71(k): 66(ptr) Variable UniformConstant 76: TypePointer Input 6(float) 77(infloat): 76(ptr) Variable Input - 79: TypePointer PrivateGlobal 6(float) + 79: TypePointer Private 6(float) 91: TypeArray 6(float) 13 92: TypeArray 91 60 93(uAofA): TypeStruct 92 diff --git a/Test/baseResults/spv.Operations.frag.out b/Test/baseResults/spv.Operations.frag.out index e9ea4cf4..e18564c0 100755 --- a/Test/baseResults/spv.Operations.frag.out +++ b/Test/baseResults/spv.Operations.frag.out @@ -3,32 +3,29 @@ spv.Operations.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 416 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 418 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "v" Name 11 "uv4" Name 20 "i" Name 22 "ui" - Name 169 "uf" - Name 216 "b" - Name 250 "ub41" - Name 252 "ub42" - Name 316 "f" - Name 395 "gl_FragColor" - Name 413 "uiv4" - Name 415 "ub" - Decorate 395(gl_FragColor) BuiltIn FragColor - Decorate 413(uiv4) NoStaticUse - Decorate 415(ub) NoStaticUse + Name 172 "uf" + Name 219 "b" + Name 253 "ub41" + Name 255 "ub42" + Name 318 "f" + Name 397 "gl_FragColor" + Name 415 "uiv4" + Name 417 "ub" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -40,36 +37,38 @@ Linked fragment stage: 19: TypePointer Function 18(int) 21: TypePointer UniformConstant 18(int) 22(ui): 21(ptr) Variable UniformConstant - 168: TypePointer UniformConstant 6(float) - 169(uf): 168(ptr) Variable UniformConstant - 214: TypeBool - 215: TypePointer Function 214(bool) - 219: TypeVector 214(bool) 4 - 249: TypePointer UniformConstant 219(bvec4) - 250(ub41): 249(ptr) Variable UniformConstant - 252(ub42): 249(ptr) Variable UniformConstant - 306: 18(int) Constant 2 - 313: 18(int) Constant 1 - 315: TypePointer Function 6(float) - 345: TypeVector 6(float) 3 - 364: 6(float) Constant 1073741824 - 371: 6(float) Constant 1065353216 - 376: 18(int) Constant 66 - 382: 18(int) Constant 17 - 394: TypePointer Output 7(fvec4) -395(gl_FragColor): 394(ptr) Variable Output - 411: TypeVector 18(int) 4 - 412: TypePointer UniformConstant 411(ivec4) - 413(uiv4): 412(ptr) Variable UniformConstant - 414: TypePointer UniformConstant 214(bool) - 415(ub): 414(ptr) Variable UniformConstant + 129: TypeInt 32 0 + 130: 129(int) Constant 0 + 131: TypePointer Function 6(float) + 171: TypePointer UniformConstant 6(float) + 172(uf): 171(ptr) Variable UniformConstant + 217: TypeBool + 218: TypePointer Function 217(bool) + 222: TypeVector 217(bool) 4 + 252: TypePointer UniformConstant 222(bvec4) + 253(ub41): 252(ptr) Variable UniformConstant + 255(ub42): 252(ptr) Variable UniformConstant + 309: 18(int) Constant 2 + 316: 18(int) Constant 1 + 347: TypeVector 6(float) 3 + 366: 6(float) Constant 1073741824 + 373: 6(float) Constant 1065353216 + 378: 18(int) Constant 66 + 384: 18(int) Constant 17 + 396: TypePointer Output 7(fvec4) +397(gl_FragColor): 396(ptr) Variable Output + 413: TypeVector 18(int) 4 + 414: TypePointer UniformConstant 413(ivec4) + 415(uiv4): 414(ptr) Variable UniformConstant + 416: TypePointer UniformConstant 217(bool) + 417(ub): 416(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function 20(i): 19(ptr) Variable Function - 216(b): 215(ptr) Variable Function - 316(f): 315(ptr) Variable Function - 396: 8(ptr) Variable Function + 219(b): 218(ptr) Variable Function + 318(f): 131(ptr) Variable Function + 398: 8(ptr) Variable Function 12: 7(fvec4) Load 11(uv4) 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 Store 9(v) 13 @@ -174,7 +173,7 @@ Linked fragment stage: 98: 7(fvec4) FAdd 97 96 Store 9(v) 98 99: 7(fvec4) Load 9(v) - 100: 7(fvec4) ExtInst 1(GLSL.std.450) 32(Inversesqrt) 99 + 100: 7(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 99 101: 7(fvec4) Load 9(v) 102: 7(fvec4) FAdd 101 100 Store 9(v) 102 @@ -210,346 +209,346 @@ Linked fragment stage: 127: 7(fvec4) FAdd 126 125 Store 9(v) 127 128: 7(fvec4) Load 9(v) - 129: 7(fvec4) Load 9(v) - 130: 6(float) CompositeExtract 129 0 - 131: 7(fvec4) CompositeConstruct 130 130 130 130 - 132: 7(fvec4) FMod 128 131 - 133: 7(fvec4) Load 9(v) - 134: 7(fvec4) FAdd 133 132 - Store 9(v) 134 - 135: 7(fvec4) Load 9(v) - 136: 7(fvec4) Load 11(uv4) - 137: 7(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 135 136 + 132: 131(ptr) AccessChain 9(v) 130 + 133: 6(float) Load 132 + 134: 7(fvec4) CompositeConstruct 133 133 133 133 + 135: 7(fvec4) FMod 128 134 + 136: 7(fvec4) Load 9(v) + 137: 7(fvec4) FAdd 136 135 + Store 9(v) 137 138: 7(fvec4) Load 9(v) - 139: 7(fvec4) FAdd 138 137 - Store 9(v) 139 - 140: 7(fvec4) Load 9(v) - 141: 7(fvec4) Load 11(uv4) - 142: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 140 141 + 139: 7(fvec4) Load 11(uv4) + 140: 7(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 138 139 + 141: 7(fvec4) Load 9(v) + 142: 7(fvec4) FAdd 141 140 + Store 9(v) 142 143: 7(fvec4) Load 9(v) - 144: 7(fvec4) FAdd 143 142 - Store 9(v) 144 - 145: 7(fvec4) Load 9(v) - 146: 7(fvec4) Load 11(uv4) - 147: 7(fvec4) Load 11(uv4) - 148: 7(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 145 146 147 - 149: 7(fvec4) Load 9(v) - 150: 7(fvec4) FAdd 149 148 - Store 9(v) 150 - 151: 7(fvec4) Load 9(v) + 144: 7(fvec4) Load 11(uv4) + 145: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 143 144 + 146: 7(fvec4) Load 9(v) + 147: 7(fvec4) FAdd 146 145 + Store 9(v) 147 + 148: 7(fvec4) Load 9(v) + 149: 7(fvec4) Load 11(uv4) + 150: 7(fvec4) Load 11(uv4) + 151: 7(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 148 149 150 152: 7(fvec4) Load 9(v) - 153: 7(fvec4) Load 9(v) - 154: 7(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 151 152 153 + 153: 7(fvec4) FAdd 152 151 + Store 9(v) 153 + 154: 7(fvec4) Load 9(v) 155: 7(fvec4) Load 9(v) - 156: 7(fvec4) FAdd 155 154 - Store 9(v) 156 - 157: 7(fvec4) Load 9(v) + 156: 7(fvec4) Load 9(v) + 157: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 154 155 156 158: 7(fvec4) Load 9(v) - 159: 7(fvec4) ExtInst 1(GLSL.std.450) 47(Step) 157 158 + 159: 7(fvec4) FAdd 158 157 + Store 9(v) 159 160: 7(fvec4) Load 9(v) - 161: 7(fvec4) FAdd 160 159 - Store 9(v) 161 - 162: 7(fvec4) Load 9(v) + 161: 7(fvec4) Load 9(v) + 162: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 160 161 163: 7(fvec4) Load 9(v) - 164: 7(fvec4) Load 9(v) - 165: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Smoothstep) 162 163 164 + 164: 7(fvec4) FAdd 163 162 + Store 9(v) 164 + 165: 7(fvec4) Load 9(v) 166: 7(fvec4) Load 9(v) - 167: 7(fvec4) FAdd 166 165 - Store 9(v) 167 - 170: 6(float) Load 169(uf) - 171: 7(fvec4) Load 9(v) - 172: 7(fvec4) ExtInst 1(GLSL.std.450) 47(Step) 170 171 - 173: 7(fvec4) Load 9(v) - 174: 7(fvec4) FAdd 173 172 - Store 9(v) 174 - 175: 6(float) Load 169(uf) - 176: 6(float) Load 169(uf) - 177: 7(fvec4) Load 9(v) - 178: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Smoothstep) 175 176 177 - 179: 7(fvec4) Load 9(v) - 180: 7(fvec4) FAdd 179 178 - Store 9(v) 180 - 181: 7(fvec4) Load 9(v) - 182: 7(fvec4) ExtInst 1(GLSL.std.450) 68(Normalize) 181 - 183: 7(fvec4) Load 9(v) - 184: 7(fvec4) FAdd 183 182 - Store 9(v) 184 - 185: 7(fvec4) Load 9(v) + 167: 7(fvec4) Load 9(v) + 168: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 165 166 167 + 169: 7(fvec4) Load 9(v) + 170: 7(fvec4) FAdd 169 168 + Store 9(v) 170 + 173: 6(float) Load 172(uf) + 174: 7(fvec4) Load 9(v) + 175: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 173 174 + 176: 7(fvec4) Load 9(v) + 177: 7(fvec4) FAdd 176 175 + Store 9(v) 177 + 178: 6(float) Load 172(uf) + 179: 6(float) Load 172(uf) + 180: 7(fvec4) Load 9(v) + 181: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 178 179 180 + 182: 7(fvec4) Load 9(v) + 183: 7(fvec4) FAdd 182 181 + Store 9(v) 183 + 184: 7(fvec4) Load 9(v) + 185: 7(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 184 186: 7(fvec4) Load 9(v) - 187: 7(fvec4) Load 9(v) - 188: 7(fvec4) ExtInst 1(GLSL.std.450) 69(Faceforward) 185 186 187 + 187: 7(fvec4) FAdd 186 185 + Store 9(v) 187 + 188: 7(fvec4) Load 9(v) 189: 7(fvec4) Load 9(v) - 190: 7(fvec4) FAdd 189 188 - Store 9(v) 190 - 191: 7(fvec4) Load 9(v) + 190: 7(fvec4) Load 9(v) + 191: 7(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 188 189 190 192: 7(fvec4) Load 9(v) - 193: 7(fvec4) ExtInst 1(GLSL.std.450) 70(Reflect) 191 192 + 193: 7(fvec4) FAdd 192 191 + Store 9(v) 193 194: 7(fvec4) Load 9(v) - 195: 7(fvec4) FAdd 194 193 - Store 9(v) 195 - 196: 7(fvec4) Load 9(v) + 195: 7(fvec4) Load 9(v) + 196: 7(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 194 195 197: 7(fvec4) Load 9(v) - 198: 6(float) Load 169(uf) - 199: 7(fvec4) ExtInst 1(GLSL.std.450) 71(Refract) 196 197 198 + 198: 7(fvec4) FAdd 197 196 + Store 9(v) 198 + 199: 7(fvec4) Load 9(v) 200: 7(fvec4) Load 9(v) - 201: 7(fvec4) FAdd 200 199 - Store 9(v) 201 - 202: 7(fvec4) Load 9(v) - 203: 7(fvec4) DPdx 202 - 204: 7(fvec4) Load 9(v) - 205: 7(fvec4) FAdd 204 203 - Store 9(v) 205 - 206: 7(fvec4) Load 9(v) - 207: 7(fvec4) DPdy 206 - 208: 7(fvec4) Load 9(v) - 209: 7(fvec4) FAdd 208 207 - Store 9(v) 209 - 210: 7(fvec4) Load 9(v) - 211: 7(fvec4) Fwidth 210 - 212: 7(fvec4) Load 9(v) - 213: 7(fvec4) FAdd 212 211 - Store 9(v) 213 - 217: 7(fvec4) Load 9(v) - 218: 7(fvec4) Load 11(uv4) - 220: 219(bvec4) FOrdLessThan 217 218 - 221: 214(bool) Any 220 - Store 216(b) 221 - 222: 214(bool) Load 216(b) - SelectionMerge 224 None - BranchConditional 222 223 224 - 223: Label - 225: 7(fvec4) Load 9(v) - 226: 7(fvec4) Load 11(uv4) - 227: 219(bvec4) FOrdLessThanEqual 225 226 - 228: 214(bool) Any 227 - Branch 224 - 224: Label - 229: 214(bool) Phi 222 5 228 223 - Store 216(b) 229 - 230: 214(bool) Load 216(b) - SelectionMerge 232 None - BranchConditional 230 231 232 - 231: Label - 233: 7(fvec4) Load 9(v) - 234: 7(fvec4) Load 11(uv4) - 235: 219(bvec4) FOrdGreaterThan 233 234 - 236: 214(bool) Any 235 - Branch 232 - 232: Label - 237: 214(bool) Phi 230 224 236 231 - Store 216(b) 237 - 238: 214(bool) Load 216(b) - SelectionMerge 240 None - BranchConditional 238 239 240 - 239: Label - 241: 7(fvec4) Load 9(v) - 242: 7(fvec4) Load 11(uv4) - 243: 219(bvec4) FOrdGreaterThanEqual 241 242 - 244: 214(bool) Any 243 - Branch 240 - 240: Label - 245: 214(bool) Phi 238 232 244 239 - Store 216(b) 245 - 246: 214(bool) Load 216(b) - SelectionMerge 248 None - BranchConditional 246 247 248 - 247: Label - 251: 219(bvec4) Load 250(ub41) - 253: 219(bvec4) Load 252(ub42) - 254: 219(bvec4) IEqual 251 253 - 255: 214(bool) Any 254 - Branch 248 - 248: Label - 256: 214(bool) Phi 246 240 255 247 - Store 216(b) 256 - 257: 214(bool) Load 216(b) - SelectionMerge 259 None - BranchConditional 257 258 259 - 258: Label - 260: 219(bvec4) Load 250(ub41) - 261: 219(bvec4) Load 252(ub42) - 262: 219(bvec4) INotEqual 260 261 - 263: 214(bool) Any 262 - Branch 259 - 259: Label - 264: 214(bool) Phi 257 248 263 258 - Store 216(b) 264 - 265: 214(bool) Load 216(b) - 266: 219(bvec4) Load 250(ub41) - 267: 214(bool) Any 266 - 268: 214(bool) LogicalAnd 265 267 - Store 216(b) 268 - 269: 214(bool) Load 216(b) - 270: 219(bvec4) Load 250(ub41) - 271: 214(bool) All 270 - 272: 214(bool) LogicalAnd 269 271 - Store 216(b) 272 - 273: 214(bool) Load 216(b) - SelectionMerge 275 None - BranchConditional 273 274 275 - 274: Label - 276: 219(bvec4) Load 250(ub41) - 277: 219(bvec4) LogicalNot 276 - 278: 214(bool) Any 277 - Branch 275 - 275: Label - 279: 214(bool) Phi 273 259 278 274 - Store 216(b) 279 - 280: 18(int) Load 20(i) - 281: 18(int) Load 22(ui) - 282: 18(int) IAdd 280 281 + 201: 6(float) Load 172(uf) + 202: 7(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 199 200 201 + 203: 7(fvec4) Load 9(v) + 204: 7(fvec4) FAdd 203 202 + Store 9(v) 204 + 205: 7(fvec4) Load 9(v) + 206: 7(fvec4) DPdx 205 + 207: 7(fvec4) Load 9(v) + 208: 7(fvec4) FAdd 207 206 + Store 9(v) 208 + 209: 7(fvec4) Load 9(v) + 210: 7(fvec4) DPdy 209 + 211: 7(fvec4) Load 9(v) + 212: 7(fvec4) FAdd 211 210 + Store 9(v) 212 + 213: 7(fvec4) Load 9(v) + 214: 7(fvec4) Fwidth 213 + 215: 7(fvec4) Load 9(v) + 216: 7(fvec4) FAdd 215 214 + Store 9(v) 216 + 220: 7(fvec4) Load 9(v) + 221: 7(fvec4) Load 11(uv4) + 223: 222(bvec4) FOrdLessThan 220 221 + 224: 217(bool) Any 223 + Store 219(b) 224 + 225: 217(bool) Load 219(b) + SelectionMerge 227 None + BranchConditional 225 226 227 + 226: Label + 228: 7(fvec4) Load 9(v) + 229: 7(fvec4) Load 11(uv4) + 230: 222(bvec4) FOrdLessThanEqual 228 229 + 231: 217(bool) Any 230 + Branch 227 + 227: Label + 232: 217(bool) Phi 225 5 231 226 + Store 219(b) 232 + 233: 217(bool) Load 219(b) + SelectionMerge 235 None + BranchConditional 233 234 235 + 234: Label + 236: 7(fvec4) Load 9(v) + 237: 7(fvec4) Load 11(uv4) + 238: 222(bvec4) FOrdGreaterThan 236 237 + 239: 217(bool) Any 238 + Branch 235 + 235: Label + 240: 217(bool) Phi 233 227 239 234 + Store 219(b) 240 + 241: 217(bool) Load 219(b) + SelectionMerge 243 None + BranchConditional 241 242 243 + 242: Label + 244: 7(fvec4) Load 9(v) + 245: 7(fvec4) Load 11(uv4) + 246: 222(bvec4) FOrdGreaterThanEqual 244 245 + 247: 217(bool) Any 246 + Branch 243 + 243: Label + 248: 217(bool) Phi 241 235 247 242 + Store 219(b) 248 + 249: 217(bool) Load 219(b) + SelectionMerge 251 None + BranchConditional 249 250 251 + 250: Label + 254: 222(bvec4) Load 253(ub41) + 256: 222(bvec4) Load 255(ub42) + 257: 222(bvec4) IEqual 254 256 + 258: 217(bool) Any 257 + Branch 251 + 251: Label + 259: 217(bool) Phi 249 243 258 250 + Store 219(b) 259 + 260: 217(bool) Load 219(b) + SelectionMerge 262 None + BranchConditional 260 261 262 + 261: Label + 263: 222(bvec4) Load 253(ub41) + 264: 222(bvec4) Load 255(ub42) + 265: 222(bvec4) INotEqual 263 264 + 266: 217(bool) Any 265 + Branch 262 + 262: Label + 267: 217(bool) Phi 260 251 266 261 + Store 219(b) 267 + 268: 217(bool) Load 219(b) + 269: 222(bvec4) Load 253(ub41) + 270: 217(bool) Any 269 + 271: 217(bool) LogicalAnd 268 270 + Store 219(b) 271 + 272: 217(bool) Load 219(b) + 273: 222(bvec4) Load 253(ub41) + 274: 217(bool) All 273 + 275: 217(bool) LogicalAnd 272 274 + Store 219(b) 275 + 276: 217(bool) Load 219(b) + SelectionMerge 278 None + BranchConditional 276 277 278 + 277: Label + 279: 222(bvec4) Load 253(ub41) + 280: 222(bvec4) LogicalNot 279 + 281: 217(bool) Any 280 + Branch 278 + 278: Label + 282: 217(bool) Phi 276 262 281 277 + Store 219(b) 282 283: 18(int) Load 20(i) - 284: 18(int) IMul 282 283 - 285: 18(int) Load 22(ui) - 286: 18(int) ISub 284 285 - 287: 18(int) Load 20(i) - 288: 18(int) SDiv 286 287 - Store 20(i) 288 - 289: 18(int) Load 20(i) - 290: 18(int) Load 22(ui) - 291: 18(int) SMod 289 290 + 284: 18(int) Load 22(ui) + 285: 18(int) IAdd 283 284 + 286: 18(int) Load 20(i) + 287: 18(int) IMul 285 286 + 288: 18(int) Load 22(ui) + 289: 18(int) ISub 287 288 + 290: 18(int) Load 20(i) + 291: 18(int) SDiv 289 290 Store 20(i) 291 292: 18(int) Load 20(i) 293: 18(int) Load 22(ui) - 294: 214(bool) IEqual 292 293 - 295: 214(bool) LogicalNot 294 - SelectionMerge 297 None - BranchConditional 295 296 297 - 296: Label - 298: 18(int) Load 20(i) - 299: 18(int) Load 22(ui) - 300: 214(bool) INotEqual 298 299 + 294: 18(int) SMod 292 293 + Store 20(i) 294 + 295: 18(int) Load 20(i) + 296: 18(int) Load 22(ui) + 297: 217(bool) IEqual 295 296 + 298: 217(bool) LogicalNot 297 + SelectionMerge 300 None + BranchConditional 298 299 300 + 299: Label 301: 18(int) Load 20(i) 302: 18(int) Load 22(ui) - 303: 214(bool) IEqual 301 302 - 304: 214(bool) LogicalAnd 300 303 - 305: 18(int) Load 20(i) - 307: 214(bool) INotEqual 305 306 - 308: 214(bool) LogicalNotEqual 304 307 - Branch 297 - 297: Label - 309: 214(bool) Phi 294 275 308 296 - SelectionMerge 311 None - BranchConditional 309 310 311 - 310: Label - 312: 18(int) Load 20(i) - 314: 18(int) IAdd 312 313 - Store 20(i) 314 - Branch 311 - 311: Label - 317: 6(float) Load 169(uf) - 318: 6(float) Load 169(uf) - 319: 6(float) FAdd 317 318 - 320: 6(float) Load 169(uf) - 321: 6(float) FMul 319 320 - 322: 6(float) Load 169(uf) - 323: 6(float) FSub 321 322 - 324: 6(float) Load 169(uf) - 325: 6(float) FDiv 323 324 - Store 316(f) 325 - 326: 7(fvec4) Load 9(v) - 327: 6(float) ExtInst 1(GLSL.std.450) 65(Length) 326 - 328: 6(float) Load 316(f) - 329: 6(float) FAdd 328 327 - Store 316(f) 329 - 330: 7(fvec4) Load 9(v) - 331: 7(fvec4) Load 9(v) - 332: 6(float) ExtInst 1(GLSL.std.450) 66(Distance) 330 331 - 333: 6(float) Load 316(f) - 334: 6(float) FAdd 333 332 - Store 316(f) 334 - 335: 7(fvec4) Load 9(v) - 336: 7(fvec4) Load 9(v) - 337: 6(float) Dot 335 336 - 338: 6(float) Load 316(f) - 339: 6(float) FAdd 338 337 - Store 316(f) 339 - 340: 6(float) Load 316(f) - 341: 6(float) Load 169(uf) - 342: 6(float) FMul 340 341 - 343: 6(float) Load 316(f) - 344: 6(float) FAdd 343 342 - Store 316(f) 344 - 346: 7(fvec4) Load 9(v) - 347: 345(fvec3) VectorShuffle 346 346 0 1 2 + 303: 217(bool) INotEqual 301 302 + 304: 18(int) Load 20(i) + 305: 18(int) Load 22(ui) + 306: 217(bool) IEqual 304 305 + 307: 217(bool) LogicalAnd 303 306 + 308: 18(int) Load 20(i) + 310: 217(bool) INotEqual 308 309 + 311: 217(bool) LogicalNotEqual 307 310 + Branch 300 + 300: Label + 312: 217(bool) Phi 297 278 311 299 + SelectionMerge 314 None + BranchConditional 312 313 314 + 313: Label + 315: 18(int) Load 20(i) + 317: 18(int) IAdd 315 316 + Store 20(i) 317 + Branch 314 + 314: Label + 319: 6(float) Load 172(uf) + 320: 6(float) Load 172(uf) + 321: 6(float) FAdd 319 320 + 322: 6(float) Load 172(uf) + 323: 6(float) FMul 321 322 + 324: 6(float) Load 172(uf) + 325: 6(float) FSub 323 324 + 326: 6(float) Load 172(uf) + 327: 6(float) FDiv 325 326 + Store 318(f) 327 + 328: 7(fvec4) Load 9(v) + 329: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 328 + 330: 6(float) Load 318(f) + 331: 6(float) FAdd 330 329 + Store 318(f) 331 + 332: 7(fvec4) Load 9(v) + 333: 7(fvec4) Load 9(v) + 334: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 332 333 + 335: 6(float) Load 318(f) + 336: 6(float) FAdd 335 334 + Store 318(f) 336 + 337: 7(fvec4) Load 9(v) + 338: 7(fvec4) Load 9(v) + 339: 6(float) Dot 337 338 + 340: 6(float) Load 318(f) + 341: 6(float) FAdd 340 339 + Store 318(f) 341 + 342: 6(float) Load 318(f) + 343: 6(float) Load 172(uf) + 344: 6(float) FMul 342 343 + 345: 6(float) Load 318(f) + 346: 6(float) FAdd 345 344 + Store 318(f) 346 348: 7(fvec4) Load 9(v) - 349: 345(fvec3) VectorShuffle 348 348 0 1 2 - 350: 345(fvec3) ExtInst 1(GLSL.std.450) 67(Cross) 347 349 - 351: 6(float) CompositeExtract 350 0 - 352: 6(float) Load 316(f) - 353: 6(float) FAdd 352 351 - Store 316(f) 353 - 354: 6(float) Load 316(f) - 355: 6(float) Load 169(uf) - 356: 214(bool) FOrdEqual 354 355 - 357: 214(bool) LogicalNot 356 - SelectionMerge 359 None - BranchConditional 357 358 359 - 358: Label - 360: 6(float) Load 316(f) - 361: 6(float) Load 169(uf) - 362: 214(bool) FOrdNotEqual 360 361 - 363: 6(float) Load 316(f) - 365: 214(bool) FOrdNotEqual 363 364 - 366: 214(bool) LogicalAnd 362 365 - Branch 359 - 359: Label - 367: 214(bool) Phi 356 311 366 358 - SelectionMerge 369 None - BranchConditional 367 368 369 - 368: Label - 370: 6(float) Load 316(f) - 372: 6(float) FAdd 370 371 - Store 316(f) 372 - Branch 369 - 369: Label - 373: 18(int) Load 22(ui) - 374: 18(int) Load 20(i) - 375: 18(int) BitwiseAnd 374 373 - Store 20(i) 375 - 377: 18(int) Load 20(i) - 378: 18(int) BitwiseOr 377 376 - Store 20(i) 378 - 379: 18(int) Load 22(ui) - 380: 18(int) Load 20(i) - 381: 18(int) BitwiseXor 380 379 - Store 20(i) 381 - 383: 18(int) Load 20(i) - 384: 18(int) SMod 383 382 - Store 20(i) 384 + 349: 347(fvec3) VectorShuffle 348 348 0 1 2 + 350: 7(fvec4) Load 9(v) + 351: 347(fvec3) VectorShuffle 350 350 0 1 2 + 352: 347(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 349 351 + 353: 6(float) CompositeExtract 352 0 + 354: 6(float) Load 318(f) + 355: 6(float) FAdd 354 353 + Store 318(f) 355 + 356: 6(float) Load 318(f) + 357: 6(float) Load 172(uf) + 358: 217(bool) FOrdEqual 356 357 + 359: 217(bool) LogicalNot 358 + SelectionMerge 361 None + BranchConditional 359 360 361 + 360: Label + 362: 6(float) Load 318(f) + 363: 6(float) Load 172(uf) + 364: 217(bool) FOrdNotEqual 362 363 + 365: 6(float) Load 318(f) + 367: 217(bool) FOrdNotEqual 365 366 + 368: 217(bool) LogicalAnd 364 367 + Branch 361 + 361: Label + 369: 217(bool) Phi 358 314 368 360 + SelectionMerge 371 None + BranchConditional 369 370 371 + 370: Label + 372: 6(float) Load 318(f) + 374: 6(float) FAdd 372 373 + Store 318(f) 374 + Branch 371 + 371: Label + 375: 18(int) Load 22(ui) + 376: 18(int) Load 20(i) + 377: 18(int) BitwiseAnd 376 375 + Store 20(i) 377 + 379: 18(int) Load 20(i) + 380: 18(int) BitwiseOr 379 378 + Store 20(i) 380 + 381: 18(int) Load 22(ui) + 382: 18(int) Load 20(i) + 383: 18(int) BitwiseXor 382 381 + Store 20(i) 383 385: 18(int) Load 20(i) - 386: 18(int) ShiftRightArithmetic 385 306 + 386: 18(int) SMod 385 384 Store 20(i) 386 - 387: 18(int) Load 22(ui) - 388: 18(int) Load 20(i) - 389: 18(int) ShiftLeftLogical 388 387 - Store 20(i) 389 + 387: 18(int) Load 20(i) + 388: 18(int) ShiftRightArithmetic 387 309 + Store 20(i) 388 + 389: 18(int) Load 22(ui) 390: 18(int) Load 20(i) - 391: 18(int) Not 390 + 391: 18(int) ShiftLeftLogical 390 389 Store 20(i) 391 - 392: 214(bool) Load 216(b) - 393: 214(bool) LogicalNot 392 - Store 216(b) 393 - 397: 214(bool) Load 216(b) - SelectionMerge 399 None - BranchConditional 397 398 408 - 398: Label - 400: 18(int) Load 20(i) - 401: 6(float) ConvertSToF 400 - 402: 7(fvec4) CompositeConstruct 401 401 401 401 - 403: 6(float) Load 316(f) + 392: 18(int) Load 20(i) + 393: 18(int) Not 392 + Store 20(i) 393 + 394: 217(bool) Load 219(b) + 395: 217(bool) LogicalNot 394 + Store 219(b) 395 + 399: 217(bool) Load 219(b) + SelectionMerge 401 None + BranchConditional 399 400 410 + 400: Label + 402: 18(int) Load 20(i) + 403: 6(float) ConvertSToF 402 404: 7(fvec4) CompositeConstruct 403 403 403 403 - 405: 7(fvec4) FAdd 402 404 - 406: 7(fvec4) Load 9(v) - 407: 7(fvec4) FAdd 405 406 - Store 396 407 - Branch 399 - 408: Label - 409: 7(fvec4) Load 9(v) - Store 396 409 - Branch 399 - 399: Label - 410: 7(fvec4) Load 396 - Store 395(gl_FragColor) 410 + 405: 6(float) Load 318(f) + 406: 7(fvec4) CompositeConstruct 405 405 405 405 + 407: 7(fvec4) FAdd 404 406 + 408: 7(fvec4) Load 9(v) + 409: 7(fvec4) FAdd 407 408 + Store 398 409 + Branch 401 + 410: Label + 411: 7(fvec4) Load 9(v) + Store 398 411 + Branch 401 + 401: Label + 412: 7(fvec4) Load 398 + Store 397(gl_FragColor) 412 Return FunctionEnd diff --git a/Test/baseResults/spv.accessChain.frag.out b/Test/baseResults/spv.accessChain.frag.out index e3392f2a..811f9671 100755 --- a/Test/baseResults/spv.accessChain.frag.out +++ b/Test/baseResults/spv.accessChain.frag.out @@ -5,16 +5,16 @@ Warning, version 420 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 197 - Source GLSL 420 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 65 ExecutionMode 4 OriginLowerLeft + Source GLSL 420 Name 4 "main" Name 8 "S" MemberName 8(S) 0 "color" @@ -88,6 +88,7 @@ Linked fragment stage: 68: 67(int) Constant 0 95: TypeVector 6(float) 2 109: 67(int) Constant 2 + 136: TypePointer Output 6(float) 141: 6(float) Constant 0 142: 7(fvec3) ConstantComposite 141 141 141 143: TypePointer Function 8(S) @@ -306,12 +307,11 @@ Linked fragment stage: 59: Label 134: 13(int) Load 57(comp) 135: 6(float) CompositeExtract 56(i) 0 0 - 136: 7(fvec3) Load 65(OutColor) - 137: 6(float) VectorExtractDynamic 136 134 - 138: 6(float) FAdd 137 135 - 139: 7(fvec3) Load 65(OutColor) - 140: 7(fvec3) VectorInsertDynamic 139 138 134 - Store 65(OutColor) 140 + 137: 136(ptr) AccessChain 65(OutColor) 134 + 138: 6(float) Load 137 + 139: 6(float) FAdd 138 135 + 140: 136(ptr) AccessChain 65(OutColor) 134 + Store 140 139 Return FunctionEnd 62(GetColor13(struct-S-vf31;i1;): 2 Function None 15 diff --git a/Test/baseResults/spv.always-discard.frag.out b/Test/baseResults/spv.always-discard.frag.out index 24b6ec5c..5a71c695 100755 --- a/Test/baseResults/spv.always-discard.frag.out +++ b/Test/baseResults/spv.always-discard.frag.out @@ -3,27 +3,25 @@ spv.always-discard.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 80 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 84 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 21 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "white" Name 12 "black" Name 15 "color" Name 18 "x" Name 21 "tex_coord" - Name 27 "y" - Name 32 "radius" - Name 55 "gl_FragColor" - Decorate 21(tex_coord) Smooth - Decorate 55(gl_FragColor) BuiltIn FragColor + Name 30 "y" + Name 36 "radius" + Name 59 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -37,94 +35,98 @@ Linked fragment stage: 19: TypeVector 6(float) 2 20: TypePointer Input 19(fvec2) 21(tex_coord): 20(ptr) Variable Input - 24: 6(float) Constant 1073741824 - 42: TypeBool - 47: 6(float) Constant 1066192077 - 54: TypePointer Output 7(fvec4) -55(gl_FragColor): 54(ptr) Variable Output - 58: 6(float) Constant 1067030938 - 67: 6(float) Constant 1061158912 - 72: 6(float) Constant 1098907648 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 46: TypeBool + 51: 6(float) Constant 1066192077 + 58: TypePointer Output 7(fvec4) +59(gl_FragColor): 58(ptr) Variable Output + 62: 6(float) Constant 1067030938 + 71: 6(float) Constant 1061158912 + 76: 6(float) Constant 1098907648 4(main): 2 Function None 3 5: Label 9(white): 8(ptr) Variable Function 12(black): 8(ptr) Variable Function 15(color): 8(ptr) Variable Function 18(x): 17(ptr) Variable Function - 27(y): 17(ptr) Variable Function - 32(radius): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function + 36(radius): 17(ptr) Variable Function Store 9(white) 11 Store 12(black) 14 16: 7(fvec4) Load 9(white) Store 15(color) 16 - 22: 19(fvec2) Load 21(tex_coord) - 23: 6(float) CompositeExtract 22 0 - 25: 6(float) FMul 23 24 - 26: 6(float) FSub 25 10 - Store 18(x) 26 - 28: 19(fvec2) Load 21(tex_coord) - 29: 6(float) CompositeExtract 28 1 - 30: 6(float) FMul 29 24 - 31: 6(float) FSub 30 10 - Store 27(y) 31 - 33: 6(float) Load 18(x) - 34: 6(float) Load 18(x) - 35: 6(float) FMul 33 34 - 36: 6(float) Load 27(y) - 37: 6(float) Load 27(y) - 38: 6(float) FMul 36 37 - 39: 6(float) FAdd 35 38 - 40: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 39 - Store 32(radius) 40 - 41: 6(float) Load 32(radius) - 43: 42(bool) FOrdGreaterThan 41 10 - SelectionMerge 45 None - BranchConditional 43 44 45 - 44: Label - 46: 6(float) Load 32(radius) - 48: 42(bool) FOrdGreaterThan 46 47 - SelectionMerge 50 None - BranchConditional 48 49 50 - 49: Label - 51: 7(fvec4) Load 15(color) - 52: 7(fvec4) CompositeConstruct 10 10 10 10 - 53: 7(fvec4) FAdd 51 52 - Store 15(color) 53 - Branch 50 - 50: Label - 56: 7(fvec4) Load 15(color) - Store 55(gl_FragColor) 56 - 57: 6(float) Load 32(radius) - 59: 42(bool) FOrdGreaterThan 57 58 - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 62: 7(fvec4) Load 15(color) - 63: 7(fvec4) CompositeConstruct 10 10 10 10 - 64: 7(fvec4) FAdd 62 63 - Store 15(color) 64 - Branch 61 - 61: Label - Branch 45 - 45: Label + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 + 37: 6(float) Load 18(x) + 38: 6(float) Load 18(x) + 39: 6(float) FMul 37 38 + 40: 6(float) Load 30(y) + 41: 6(float) Load 30(y) + 42: 6(float) FMul 40 41 + 43: 6(float) FAdd 39 42 + 44: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 43 + Store 36(radius) 44 + 45: 6(float) Load 36(radius) + 47: 46(bool) FOrdGreaterThan 45 10 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 6(float) Load 36(radius) + 52: 46(bool) FOrdGreaterThan 50 51 + SelectionMerge 54 None + BranchConditional 52 53 54 + 53: Label + 55: 7(fvec4) Load 15(color) + 56: 7(fvec4) CompositeConstruct 10 10 10 10 + 57: 7(fvec4) FAdd 55 56 + Store 15(color) 57 + Branch 54 + 54: Label + 60: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 60 + 61: 6(float) Load 36(radius) + 63: 46(bool) FOrdGreaterThan 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 66: 7(fvec4) Load 15(color) + 67: 7(fvec4) CompositeConstruct 10 10 10 10 + 68: 7(fvec4) FAdd 66 67 + Store 15(color) 68 + Branch 65 + 65: Label + Branch 49 + 49: Label Kill - 65: Label - 66: 6(float) Load 32(radius) - 68: 42(bool) FOrdGreaterThanEqual 66 67 - SelectionMerge 70 None - BranchConditional 68 69 70 - 69: Label - 71: 6(float) Load 32(radius) - 73: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 71 72 - 74: 6(float) FDiv 73 24 - 75: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 74 - 76: 7(fvec4) Load 15(color) - 77: 7(fvec4) CompositeConstruct 75 75 75 75 - 78: 7(fvec4) FSub 76 77 - Store 15(color) 78 - Branch 70 - 70: Label - 79: 7(fvec4) Load 15(color) - Store 55(gl_FragColor) 79 + 69: Label + 70: 6(float) Load 36(radius) + 72: 46(bool) FOrdGreaterThanEqual 70 71 + SelectionMerge 74 None + BranchConditional 72 73 74 + 73: Label + 75: 6(float) Load 36(radius) + 77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76 + 78: 6(float) FDiv 77 27 + 79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78 + 80: 7(fvec4) Load 15(color) + 81: 7(fvec4) CompositeConstruct 79 79 79 79 + 82: 7(fvec4) FSub 80 81 + Store 15(color) 82 + Branch 74 + 74: Label + 83: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 83 Return FunctionEnd diff --git a/Test/baseResults/spv.always-discard2.frag.out b/Test/baseResults/spv.always-discard2.frag.out index e2d03b4a..c085a062 100755 --- a/Test/baseResults/spv.always-discard2.frag.out +++ b/Test/baseResults/spv.always-discard2.frag.out @@ -3,26 +3,24 @@ spv.always-discard2.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 36 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 40 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 21 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "white" Name 12 "black" Name 15 "color" Name 18 "x" Name 21 "tex_coord" - Name 27 "y" - Name 34 "gl_FragColor" - Decorate 21(tex_coord) Smooth - Decorate 34(gl_FragColor) BuiltIn FragColor + Name 30 "y" + Name 38 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -36,29 +34,33 @@ Linked fragment stage: 19: TypeVector 6(float) 2 20: TypePointer Input 19(fvec2) 21(tex_coord): 20(ptr) Variable Input - 24: 6(float) Constant 1073741824 - 33: TypePointer Output 7(fvec4) -34(gl_FragColor): 33(ptr) Variable Output + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 37: TypePointer Output 7(fvec4) +38(gl_FragColor): 37(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(white): 8(ptr) Variable Function 12(black): 8(ptr) Variable Function 15(color): 8(ptr) Variable Function 18(x): 17(ptr) Variable Function - 27(y): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function Store 9(white) 11 Store 12(black) 14 16: 7(fvec4) Load 9(white) Store 15(color) 16 - 22: 19(fvec2) Load 21(tex_coord) - 23: 6(float) CompositeExtract 22 0 - 25: 6(float) FMul 23 24 - 26: 6(float) FSub 25 10 - Store 18(x) 26 - 28: 19(fvec2) Load 21(tex_coord) - 29: 6(float) CompositeExtract 28 1 - 30: 6(float) FMul 29 24 - 31: 6(float) FSub 30 10 - Store 27(y) 31 + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 Kill FunctionEnd diff --git a/Test/baseResults/spv.atomic.comp.out b/Test/baseResults/spv.atomic.comp.out index ddf48bd1..ae3ee49b 100755 --- a/Test/baseResults/spv.atomic.comp.out +++ b/Test/baseResults/spv.atomic.comp.out @@ -6,16 +6,16 @@ Linked compute stage: TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class? -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 64 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 74 - Source ESSL 310 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint GLCompute 4 "main" ExecutionMode 4 LocalSize 1 1 1 + Source ESSL 310 Name 4 "main" Name 10 "func(au1;" Name 9 "c" @@ -29,14 +29,19 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, Name 40 "origu" Name 42 "atomu" Name 44 "value" - Name 61 "arrX" - Name 62 "arrY" - Name 63 "arrZ" + Name 61 "dataSSB" + MemberName 61(dataSSB) 0 "f" + MemberName 61(dataSSB) 1 "n_frames_rendered" + Name 63 "result" + Name 71 "arrX" + Name 72 "arrY" + Name 73 "arrZ" Decorate 20(counter) Binding 0 Decorate 28(countArr) Binding 0 - Decorate 61(arrX) NoStaticUse - Decorate 62(arrY) NoStaticUse - Decorate 63(arrZ) NoStaticUse + MemberDecorate 61(dataSSB) 0 Offset 0 + MemberDecorate 61(dataSSB) 1 Offset 16 + Decorate 61(dataSSB) BufferBlock + Decorate 63(result) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -44,7 +49,7 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, 8: TypeFunction 6(int) 7(ptr) 14: 6(int) Constant 1 15: 6(int) Constant 0 - 18: 6(int) Constant 256 + 18: 6(int) Constant 1024 19: TypePointer AtomicCounter 6(int) 20(counter): 19(ptr) Variable AtomicCounter 25: 6(int) Constant 4 @@ -54,21 +59,29 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, 29: TypeInt 32 1 30: 29(int) Constant 2 34: TypePointer Function 29(int) - 36: TypePointer WorkgroupLocal 29(int) - 37(atomi): 36(ptr) Variable WorkgroupLocal + 36: TypePointer Workgroup 29(int) + 37(atomi): 36(ptr) Variable Workgroup 38: 29(int) Constant 3 - 41: TypePointer WorkgroupLocal 6(int) - 42(atomu): 41(ptr) Variable WorkgroupLocal + 41: TypePointer Workgroup 6(int) + 42(atomu): 41(ptr) Variable Workgroup 43: TypePointer UniformConstant 6(int) 44(value): 43(ptr) Variable UniformConstant 47: 6(int) Constant 7 52: 29(int) Constant 7 56: 6(int) Constant 10 - 59: TypeArray 29(int) 14 - 60: TypePointer PrivateGlobal 59 - 61(arrX): 60(ptr) Variable PrivateGlobal - 62(arrY): 60(ptr) Variable PrivateGlobal - 63(arrZ): 60(ptr) Variable PrivateGlobal + 59: TypeFloat 32 + 60: TypeVector 29(int) 4 + 61(dataSSB): TypeStruct 59(float) 60(ivec4) + 62: TypePointer Uniform 61(dataSSB) + 63(result): 62(ptr) Variable Uniform + 64: 29(int) Constant 1 + 65: 6(int) Constant 2 + 66: TypePointer Uniform 29(int) + 69: TypeArray 29(int) 14 + 70: TypePointer Private 69 + 71(arrX): 70(ptr) Variable Private + 72(arrY): 70(ptr) Variable Private + 73(arrZ): 70(ptr) Variable Private 4(main): 2 Function None 3 5: Label 21(param): 7(ptr) Variable Function @@ -113,5 +126,7 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, 57: 6(int) Load 44(value) 58: 6(int) AtomicCompareExchange 42(atomu) 14 15 15 57 56 Store 40(origu) 58 + 67: 66(ptr) AccessChain 63(result) 64 65 + 68: 29(int) AtomicIAdd 67 14 15 64 Return FunctionEnd diff --git a/Test/baseResults/spv.conditionalDiscard.frag.out b/Test/baseResults/spv.conditionalDiscard.frag.out index f727174a..64bf5215 100755 --- a/Test/baseResults/spv.conditionalDiscard.frag.out +++ b/Test/baseResults/spv.conditionalDiscard.frag.out @@ -1,25 +1,25 @@ spv.conditionalDiscard.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 36 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 17 ExecutionMode 4 OriginLowerLeft + Source GLSL 400 Name 4 "main" Name 9 "v" Name 13 "tex" Name 17 "coord" Name 34 "gl_FragColor" - Decorate 17(coord) Smooth - Decorate 34(gl_FragColor) BuiltIn FragColor 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.conversion.frag.out b/Test/baseResults/spv.conversion.frag.out index 31d49801..8ca8e7be 100755 --- a/Test/baseResults/spv.conversion.frag.out +++ b/Test/baseResults/spv.conversion.frag.out @@ -3,16 +3,16 @@ spv.conversion.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 452 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 455 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 39 446 448 157 53 450 452 454 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "b" Name 11 "u_i" @@ -34,50 +34,29 @@ Linked fragment stage: Name 114 "f3" Name 118 "f4" Name 157 "i_i4" - Name 321 "gl_FragColor" - Name 414 "cv2" - Name 415 "cv5" - Name 425 "u_b" - Name 427 "u_b2" - Name 429 "u_b3" - Name 431 "u_b4" - Name 433 "u_i2" - Name 435 "u_i3" - Name 437 "u_i4" - Name 438 "i_b" - Name 439 "i_b2" - Name 440 "i_b3" - Name 441 "i_b4" - Name 443 "i_i2" - Name 445 "i_i3" - Name 447 "i_f2" - Name 449 "i_f3" - Name 451 "i_f4" + Name 322 "gl_FragColor" + Name 417 "cv2" + Name 418 "cv5" + Name 428 "u_b" + Name 430 "u_b2" + Name 432 "u_b3" + Name 434 "u_b4" + Name 436 "u_i2" + Name 438 "u_i3" + Name 440 "u_i4" + Name 441 "i_b" + Name 442 "i_b2" + Name 443 "i_b3" + Name 444 "i_b4" + Name 446 "i_i2" + Name 448 "i_i3" + Name 450 "i_f2" + Name 452 "i_f3" + Name 454 "i_f4" Decorate 39(i_i) Flat - Decorate 53(i_f) Smooth Decorate 157(i_i4) Flat - Decorate 321(gl_FragColor) BuiltIn FragColor - Decorate 425(u_b) NoStaticUse - Decorate 427(u_b2) NoStaticUse - Decorate 429(u_b3) NoStaticUse - Decorate 431(u_b4) NoStaticUse - Decorate 433(u_i2) NoStaticUse - Decorate 435(u_i3) NoStaticUse - Decorate 437(u_i4) NoStaticUse - Decorate 438(i_b) NoStaticUse - Decorate 439(i_b2) NoStaticUse - Decorate 440(i_b3) NoStaticUse - Decorate 441(i_b4) NoStaticUse - Decorate 443(i_i2) Flat - Decorate 443(i_i2) NoStaticUse - Decorate 445(i_i3) Flat - Decorate 445(i_i3) NoStaticUse - Decorate 447(i_f2) Smooth - Decorate 447(i_f2) NoStaticUse - Decorate 449(i_f3) Smooth - Decorate 449(i_f3) NoStaticUse - Decorate 451(i_f4) Smooth - Decorate 451(i_f4) NoStaticUse + Decorate 446(i_i2) Flat + Decorate 448(i_i3) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -140,36 +119,39 @@ Linked fragment stage: 157(i_i4): 156(ptr) Variable Input 159: TypeVector 13(int) 4 160: 159(ivec4) ConstantComposite 14 14 14 14 - 320: TypePointer Output 95(fvec4) -321(gl_FragColor): 320(ptr) Variable Output - 424: TypePointer UniformConstant 6(bool) - 425(u_b): 424(ptr) Variable UniformConstant - 426: TypePointer UniformConstant 23(bvec2) - 427(u_b2): 426(ptr) Variable UniformConstant - 428: TypePointer UniformConstant 31(bvec3) - 429(u_b3): 428(ptr) Variable UniformConstant - 430: TypePointer UniformConstant 43(bvec4) - 431(u_b4): 430(ptr) Variable UniformConstant - 432: TypePointer UniformConstant 66(ivec2) - 433(u_i2): 432(ptr) Variable UniformConstant - 434: TypePointer UniformConstant 79(ivec3) - 435(u_i3): 434(ptr) Variable UniformConstant - 436: TypePointer UniformConstant 92(ivec4) - 437(u_i4): 436(ptr) Variable UniformConstant - 438(i_b): 424(ptr) Variable UniformConstant - 439(i_b2): 426(ptr) Variable UniformConstant - 440(i_b3): 428(ptr) Variable UniformConstant - 441(i_b4): 430(ptr) Variable UniformConstant - 442: TypePointer Input 66(ivec2) - 443(i_i2): 442(ptr) Variable Input - 444: TypePointer Input 79(ivec3) - 445(i_i3): 444(ptr) Variable Input - 446: TypePointer Input 69(fvec2) - 447(i_f2): 446(ptr) Variable Input - 448: TypePointer Input 82(fvec3) - 449(i_f3): 448(ptr) Variable Input - 450: TypePointer Input 95(fvec4) - 451(i_f4): 450(ptr) Variable Input + 315: 13(int) Constant 1 + 321: TypePointer Output 95(fvec4) +322(gl_FragColor): 321(ptr) Variable Output + 367: 13(int) Constant 2 + 380: 13(int) Constant 3 + 427: TypePointer UniformConstant 6(bool) + 428(u_b): 427(ptr) Variable UniformConstant + 429: TypePointer UniformConstant 23(bvec2) + 430(u_b2): 429(ptr) Variable UniformConstant + 431: TypePointer UniformConstant 31(bvec3) + 432(u_b3): 431(ptr) Variable UniformConstant + 433: TypePointer UniformConstant 43(bvec4) + 434(u_b4): 433(ptr) Variable UniformConstant + 435: TypePointer UniformConstant 66(ivec2) + 436(u_i2): 435(ptr) Variable UniformConstant + 437: TypePointer UniformConstant 79(ivec3) + 438(u_i3): 437(ptr) Variable UniformConstant + 439: TypePointer UniformConstant 92(ivec4) + 440(u_i4): 439(ptr) Variable UniformConstant + 441(i_b): 427(ptr) Variable UniformConstant + 442(i_b2): 429(ptr) Variable UniformConstant + 443(i_b3): 431(ptr) Variable UniformConstant + 444(i_b4): 433(ptr) Variable UniformConstant + 445: TypePointer Input 66(ivec2) + 446(i_i2): 445(ptr) Variable Input + 447: TypePointer Input 79(ivec3) + 448(i_i3): 447(ptr) Variable Input + 449: TypePointer Input 69(fvec2) + 450(i_f2): 449(ptr) Variable Input + 451: TypePointer Input 82(fvec3) + 452(i_f3): 451(ptr) Variable Input + 453: TypePointer Input 95(fvec4) + 454(i_f4): 453(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(b): 7(ptr) Variable Function @@ -186,9 +168,9 @@ Linked fragment stage: 118(f4): 117(ptr) Variable Function 297: 105(ptr) Variable Function 307: 105(ptr) Variable Function - 322: 117(ptr) Variable Function - 414(cv2): 93(ptr) Variable Function - 415(cv5): 44(ptr) Variable Function + 323: 117(ptr) Variable Function + 417(cv2): 93(ptr) Variable Function + 418(cv5): 44(ptr) Variable Function 12: 9(int) Load 11(u_i) 15: 6(bool) INotEqual 12 14 19: 16(float) Load 18(u_f) @@ -455,8 +437,8 @@ Linked fragment stage: Store 297 302 Branch 300 303: Label - 304: 69(fvec2) Load 110(f2) - 305: 16(float) CompositeExtract 304 0 + 304: 105(ptr) AccessChain 110(f2) 14 + 305: 16(float) Load 304 Store 297 305 Branch 300 300: Label @@ -466,130 +448,130 @@ Linked fragment stage: SelectionMerge 311 None BranchConditional 309 310 314 310: Label - 312: 82(fvec3) Load 114(f3) - 313: 16(float) CompositeExtract 312 0 + 312: 105(ptr) AccessChain 114(f3) 14 + 313: 16(float) Load 312 Store 307 313 Branch 311 314: Label - 315: 66(ivec2) Load 68(i2) - 316: 9(int) CompositeExtract 315 1 - 317: 16(float) ConvertSToF 316 - Store 307 317 + 316: 57(ptr) AccessChain 68(i2) 315 + 317: 9(int) Load 316 + 318: 16(float) ConvertSToF 317 + Store 307 318 Branch 311 311: Label - 318: 16(float) Load 307 - 319: 16(float) FAdd 306 318 - Store 106(f) 319 + 319: 16(float) Load 307 + 320: 16(float) FAdd 306 319 + Store 106(f) 320 Branch 296 296: Label - 323: 6(bool) Load 8(b) - 324: 23(bvec2) Load 25(b2) - 325: 6(bool) CompositeExtract 324 0 - 326: 6(bool) LogicalOr 323 325 - 327: 23(bvec2) Load 25(b2) - 328: 6(bool) CompositeExtract 327 1 - 329: 6(bool) LogicalOr 326 328 - 330: 31(bvec3) Load 33(b3) - 331: 6(bool) CompositeExtract 330 0 - 332: 6(bool) LogicalOr 329 331 - 333: 31(bvec3) Load 33(b3) - 334: 6(bool) CompositeExtract 333 1 - 335: 6(bool) LogicalOr 332 334 - 336: 31(bvec3) Load 33(b3) - 337: 6(bool) CompositeExtract 336 2 - 338: 6(bool) LogicalOr 335 337 - 339: 43(bvec4) Load 45(b4) - 340: 6(bool) CompositeExtract 339 0 - 341: 6(bool) LogicalOr 338 340 - 342: 43(bvec4) Load 45(b4) - 343: 6(bool) CompositeExtract 342 1 - 344: 6(bool) LogicalOr 341 343 - 345: 43(bvec4) Load 45(b4) - 346: 6(bool) CompositeExtract 345 2 - 347: 6(bool) LogicalOr 344 346 - 348: 43(bvec4) Load 45(b4) - 349: 6(bool) CompositeExtract 348 3 - 350: 6(bool) LogicalOr 347 349 - SelectionMerge 352 None - BranchConditional 350 351 412 - 351: Label - 353: 9(int) Load 58(i) - 354: 66(ivec2) Load 68(i2) - 355: 9(int) CompositeExtract 354 0 - 356: 9(int) IAdd 353 355 - 357: 66(ivec2) Load 68(i2) - 358: 9(int) CompositeExtract 357 1 - 359: 9(int) IAdd 356 358 - 360: 79(ivec3) Load 81(i3) - 361: 9(int) CompositeExtract 360 0 - 362: 9(int) IAdd 359 361 - 363: 79(ivec3) Load 81(i3) - 364: 9(int) CompositeExtract 363 1 - 365: 9(int) IAdd 362 364 - 366: 79(ivec3) Load 81(i3) - 367: 9(int) CompositeExtract 366 2 - 368: 9(int) IAdd 365 367 - 369: 92(ivec4) Load 94(i4) - 370: 9(int) CompositeExtract 369 0 - 371: 9(int) IAdd 368 370 - 372: 92(ivec4) Load 94(i4) - 373: 9(int) CompositeExtract 372 1 - 374: 9(int) IAdd 371 373 - 375: 92(ivec4) Load 94(i4) - 376: 9(int) CompositeExtract 375 2 - 377: 9(int) IAdd 374 376 - 378: 92(ivec4) Load 94(i4) - 379: 9(int) CompositeExtract 378 3 - 380: 9(int) IAdd 377 379 - 381: 16(float) ConvertSToF 380 - 382: 16(float) Load 106(f) - 383: 16(float) FAdd 381 382 - 384: 69(fvec2) Load 110(f2) - 385: 16(float) CompositeExtract 384 0 - 386: 16(float) FAdd 383 385 - 387: 69(fvec2) Load 110(f2) - 388: 16(float) CompositeExtract 387 1 + 324: 6(bool) Load 8(b) + 325: 23(bvec2) Load 25(b2) + 326: 6(bool) CompositeExtract 325 0 + 327: 6(bool) LogicalOr 324 326 + 328: 23(bvec2) Load 25(b2) + 329: 6(bool) CompositeExtract 328 1 + 330: 6(bool) LogicalOr 327 329 + 331: 31(bvec3) Load 33(b3) + 332: 6(bool) CompositeExtract 331 0 + 333: 6(bool) LogicalOr 330 332 + 334: 31(bvec3) Load 33(b3) + 335: 6(bool) CompositeExtract 334 1 + 336: 6(bool) LogicalOr 333 335 + 337: 31(bvec3) Load 33(b3) + 338: 6(bool) CompositeExtract 337 2 + 339: 6(bool) LogicalOr 336 338 + 340: 43(bvec4) Load 45(b4) + 341: 6(bool) CompositeExtract 340 0 + 342: 6(bool) LogicalOr 339 341 + 343: 43(bvec4) Load 45(b4) + 344: 6(bool) CompositeExtract 343 1 + 345: 6(bool) LogicalOr 342 344 + 346: 43(bvec4) Load 45(b4) + 347: 6(bool) CompositeExtract 346 2 + 348: 6(bool) LogicalOr 345 347 + 349: 43(bvec4) Load 45(b4) + 350: 6(bool) CompositeExtract 349 3 + 351: 6(bool) LogicalOr 348 350 + SelectionMerge 353 None + BranchConditional 351 352 415 + 352: Label + 354: 9(int) Load 58(i) + 355: 57(ptr) AccessChain 68(i2) 14 + 356: 9(int) Load 355 + 357: 9(int) IAdd 354 356 + 358: 57(ptr) AccessChain 68(i2) 315 + 359: 9(int) Load 358 + 360: 9(int) IAdd 357 359 + 361: 57(ptr) AccessChain 81(i3) 14 + 362: 9(int) Load 361 + 363: 9(int) IAdd 360 362 + 364: 57(ptr) AccessChain 81(i3) 315 + 365: 9(int) Load 364 + 366: 9(int) IAdd 363 365 + 368: 57(ptr) AccessChain 81(i3) 367 + 369: 9(int) Load 368 + 370: 9(int) IAdd 366 369 + 371: 57(ptr) AccessChain 94(i4) 14 + 372: 9(int) Load 371 + 373: 9(int) IAdd 370 372 + 374: 57(ptr) AccessChain 94(i4) 315 + 375: 9(int) Load 374 + 376: 9(int) IAdd 373 375 + 377: 57(ptr) AccessChain 94(i4) 367 + 378: 9(int) Load 377 + 379: 9(int) IAdd 376 378 + 381: 57(ptr) AccessChain 94(i4) 380 + 382: 9(int) Load 381 + 383: 9(int) IAdd 379 382 + 384: 16(float) ConvertSToF 383 + 385: 16(float) Load 106(f) + 386: 16(float) FAdd 384 385 + 387: 105(ptr) AccessChain 110(f2) 14 + 388: 16(float) Load 387 389: 16(float) FAdd 386 388 - 390: 82(fvec3) Load 114(f3) - 391: 16(float) CompositeExtract 390 0 + 390: 105(ptr) AccessChain 110(f2) 315 + 391: 16(float) Load 390 392: 16(float) FAdd 389 391 - 393: 82(fvec3) Load 114(f3) - 394: 16(float) CompositeExtract 393 1 + 393: 105(ptr) AccessChain 114(f3) 14 + 394: 16(float) Load 393 395: 16(float) FAdd 392 394 - 396: 82(fvec3) Load 114(f3) - 397: 16(float) CompositeExtract 396 2 + 396: 105(ptr) AccessChain 114(f3) 315 + 397: 16(float) Load 396 398: 16(float) FAdd 395 397 - 399: 95(fvec4) Load 118(f4) - 400: 16(float) CompositeExtract 399 0 + 399: 105(ptr) AccessChain 114(f3) 367 + 400: 16(float) Load 399 401: 16(float) FAdd 398 400 - 402: 95(fvec4) Load 118(f4) - 403: 16(float) CompositeExtract 402 1 + 402: 105(ptr) AccessChain 118(f4) 14 + 403: 16(float) Load 402 404: 16(float) FAdd 401 403 - 405: 95(fvec4) Load 118(f4) - 406: 16(float) CompositeExtract 405 2 + 405: 105(ptr) AccessChain 118(f4) 315 + 406: 16(float) Load 405 407: 16(float) FAdd 404 406 - 408: 95(fvec4) Load 118(f4) - 409: 16(float) CompositeExtract 408 3 + 408: 105(ptr) AccessChain 118(f4) 367 + 409: 16(float) Load 408 410: 16(float) FAdd 407 409 - 411: 95(fvec4) CompositeConstruct 410 410 410 410 - Store 322 411 - Branch 352 - 412: Label - Store 322 151 - Branch 352 - 352: Label - 413: 95(fvec4) Load 322 - Store 321(gl_FragColor) 413 - Store 414(cv2) 102 - 416: 92(ivec4) Load 414(cv2) - 417: 43(bvec4) INotEqual 416 160 - Store 415(cv5) 417 - 418: 43(bvec4) Load 415(cv5) - 419: 95(fvec4) Select 418 151 150 - 420: 16(float) CompositeExtract 419 0 - 421: 95(fvec4) Load 321(gl_FragColor) - 422: 95(fvec4) CompositeConstruct 420 420 420 420 - 423: 95(fvec4) FAdd 421 422 - Store 321(gl_FragColor) 423 + 411: 105(ptr) AccessChain 118(f4) 380 + 412: 16(float) Load 411 + 413: 16(float) FAdd 410 412 + 414: 95(fvec4) CompositeConstruct 413 413 413 413 + Store 323 414 + Branch 353 + 415: Label + Store 323 151 + Branch 353 + 353: Label + 416: 95(fvec4) Load 323 + Store 322(gl_FragColor) 416 + Store 417(cv2) 102 + 419: 92(ivec4) Load 417(cv2) + 420: 43(bvec4) INotEqual 419 160 + Store 418(cv5) 420 + 421: 43(bvec4) Load 418(cv5) + 422: 95(fvec4) Select 421 151 150 + 423: 16(float) CompositeExtract 422 0 + 424: 95(fvec4) Load 322(gl_FragColor) + 425: 95(fvec4) CompositeConstruct 423 423 423 423 + 426: 95(fvec4) FAdd 424 425 + Store 322(gl_FragColor) 426 Return FunctionEnd diff --git a/Test/baseResults/spv.dataOut.frag.out b/Test/baseResults/spv.dataOut.frag.out index ebbd60f4..ee3c691a 100755 --- a/Test/baseResults/spv.dataOut.frag.out +++ b/Test/baseResults/spv.dataOut.frag.out @@ -5,21 +5,19 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 20 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 16 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 12 "gl_FragData" Name 16 "Color" - Decorate 12(gl_FragData) BuiltIn FragColor - Decorate 16(Color) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.dataOutIndirect.frag.out b/Test/baseResults/spv.dataOutIndirect.frag.out index c88d21cf..6a2fd706 100755 --- a/Test/baseResults/spv.dataOutIndirect.frag.out +++ b/Test/baseResults/spv.dataOutIndirect.frag.out @@ -5,22 +5,20 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 22 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 18 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 12 "gl_FragData" Name 15 "i" Name 18 "Color" - Decorate 12(gl_FragData) BuiltIn FragColor - Decorate 18(Color) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.dataOutIndirect.vert.out b/Test/baseResults/spv.dataOutIndirect.vert.out index 705f7f4b..0b24b624 100755 --- a/Test/baseResults/spv.dataOutIndirect.vert.out +++ b/Test/baseResults/spv.dataOutIndirect.vert.out @@ -6,25 +6,23 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 38 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 26 23 37 + Source GLSL 130 Name 4 "main" Name 8 "i" Name 23 "colorOut" Name 26 "color" Name 32 "gl_Position" Name 37 "gl_VertexID" - Decorate 23(colorOut) Smooth Decorate 32(gl_Position) BuiltIn Position Decorate 37(gl_VertexID) BuiltIn VertexId - Decorate 37(gl_VertexID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -54,7 +52,7 @@ Linked vertex stage: 10: Label 13: 6(int) Load 8(i) 16: 15(bool) SLessThan 13 14 - LoopMerge 11 None + LoopMerge 11 10 None BranchConditional 16 12 11 12: Label 24: 6(int) Load 8(i) diff --git a/Test/baseResults/spv.depthOut.frag.out b/Test/baseResults/spv.depthOut.frag.out index a3baf4a4..07fb1717 100755 --- a/Test/baseResults/spv.depthOut.frag.out +++ b/Test/baseResults/spv.depthOut.frag.out @@ -5,27 +5,23 @@ Warning, version 450 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 18 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 15 - Source GLSL 450 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 14 10 8 8 ExecutionMode 4 OriginLowerLeft - ExecutionMode 4 DepthAny + ExecutionMode 4 DepthGreater ExecutionMode 4 DepthReplacing + Source GLSL 450 Name 4 "main" Name 8 "gl_FragDepth" Name 10 "Depth" - Name 14 "gl_FragColor" - Name 16 "Color" + Name 14 "Color" Decorate 8(gl_FragDepth) BuiltIn FragDepth - Decorate 10(Depth) Smooth - Decorate 14(gl_FragColor) BuiltIn FragColor - Decorate 16(Color) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -34,15 +30,11 @@ Linked fragment stage: 9: TypePointer Input 6(float) 10(Depth): 9(ptr) Variable Input 12: TypeVector 6(float) 4 - 13: TypePointer Output 12(fvec4) -14(gl_FragColor): 13(ptr) Variable Output - 15: TypePointer Input 12(fvec4) - 16(Color): 15(ptr) Variable Input + 13: TypePointer Input 12(fvec4) + 14(Color): 13(ptr) Variable Input 4(main): 2 Function None 3 5: Label 11: 6(float) Load 10(Depth) Store 8(gl_FragDepth) 11 - 17: 12(fvec4) Load 16(Color) - Store 14(gl_FragColor) 17 Return FunctionEnd diff --git a/Test/baseResults/spv.discard-dce.frag.out b/Test/baseResults/spv.discard-dce.frag.out index 087fe693..7f482503 100755 --- a/Test/baseResults/spv.discard-dce.frag.out +++ b/Test/baseResults/spv.discard-dce.frag.out @@ -3,27 +3,25 @@ spv.discard-dce.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 80 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 84 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 21 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "white" Name 12 "black" Name 15 "color" Name 18 "x" Name 21 "tex_coord" - Name 27 "y" - Name 32 "radius" - Name 55 "gl_FragColor" - Decorate 21(tex_coord) Smooth - Decorate 55(gl_FragColor) BuiltIn FragColor + Name 30 "y" + Name 36 "radius" + Name 59 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -37,92 +35,96 @@ Linked fragment stage: 19: TypeVector 6(float) 2 20: TypePointer Input 19(fvec2) 21(tex_coord): 20(ptr) Variable Input - 24: 6(float) Constant 1073741824 - 42: TypeBool - 47: 6(float) Constant 1066192077 - 54: TypePointer Output 7(fvec4) -55(gl_FragColor): 54(ptr) Variable Output - 58: 6(float) Constant 1067030938 - 67: 6(float) Constant 1061158912 - 72: 6(float) Constant 1098907648 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 46: TypeBool + 51: 6(float) Constant 1066192077 + 58: TypePointer Output 7(fvec4) +59(gl_FragColor): 58(ptr) Variable Output + 62: 6(float) Constant 1067030938 + 71: 6(float) Constant 1061158912 + 76: 6(float) Constant 1098907648 4(main): 2 Function None 3 5: Label 9(white): 8(ptr) Variable Function 12(black): 8(ptr) Variable Function 15(color): 8(ptr) Variable Function 18(x): 17(ptr) Variable Function - 27(y): 17(ptr) Variable Function - 32(radius): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function + 36(radius): 17(ptr) Variable Function Store 9(white) 11 Store 12(black) 14 16: 7(fvec4) Load 9(white) Store 15(color) 16 - 22: 19(fvec2) Load 21(tex_coord) - 23: 6(float) CompositeExtract 22 0 - 25: 6(float) FMul 23 24 - 26: 6(float) FSub 25 10 - Store 18(x) 26 - 28: 19(fvec2) Load 21(tex_coord) - 29: 6(float) CompositeExtract 28 1 - 30: 6(float) FMul 29 24 - 31: 6(float) FSub 30 10 - Store 27(y) 31 - 33: 6(float) Load 18(x) - 34: 6(float) Load 18(x) - 35: 6(float) FMul 33 34 - 36: 6(float) Load 27(y) - 37: 6(float) Load 27(y) - 38: 6(float) FMul 36 37 - 39: 6(float) FAdd 35 38 - 40: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 39 - Store 32(radius) 40 - 41: 6(float) Load 32(radius) - 43: 42(bool) FOrdGreaterThan 41 10 - SelectionMerge 45 None - BranchConditional 43 44 45 - 44: Label - 46: 6(float) Load 32(radius) - 48: 42(bool) FOrdGreaterThan 46 47 - SelectionMerge 50 None - BranchConditional 48 49 50 - 49: Label - 51: 7(fvec4) Load 15(color) - 52: 7(fvec4) CompositeConstruct 10 10 10 10 - 53: 7(fvec4) FAdd 51 52 - Store 15(color) 53 - Branch 50 - 50: Label - 56: 7(fvec4) Load 15(color) - Store 55(gl_FragColor) 56 - 57: 6(float) Load 32(radius) - 59: 42(bool) FOrdGreaterThan 57 58 - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 62: 7(fvec4) Load 15(color) - 63: 7(fvec4) CompositeConstruct 10 10 10 10 - 64: 7(fvec4) FAdd 62 63 - Store 15(color) 64 - Branch 61 - 61: Label + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 + 37: 6(float) Load 18(x) + 38: 6(float) Load 18(x) + 39: 6(float) FMul 37 38 + 40: 6(float) Load 30(y) + 41: 6(float) Load 30(y) + 42: 6(float) FMul 40 41 + 43: 6(float) FAdd 39 42 + 44: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 43 + Store 36(radius) 44 + 45: 6(float) Load 36(radius) + 47: 46(bool) FOrdGreaterThan 45 10 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 6(float) Load 36(radius) + 52: 46(bool) FOrdGreaterThan 50 51 + SelectionMerge 54 None + BranchConditional 52 53 54 + 53: Label + 55: 7(fvec4) Load 15(color) + 56: 7(fvec4) CompositeConstruct 10 10 10 10 + 57: 7(fvec4) FAdd 55 56 + Store 15(color) 57 + Branch 54 + 54: Label + 60: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 60 + 61: 6(float) Load 36(radius) + 63: 46(bool) FOrdGreaterThan 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 66: 7(fvec4) Load 15(color) + 67: 7(fvec4) CompositeConstruct 10 10 10 10 + 68: 7(fvec4) FAdd 66 67 + Store 15(color) 68 + Branch 65 + 65: Label Kill - 45: Label - 66: 6(float) Load 32(radius) - 68: 42(bool) FOrdGreaterThanEqual 66 67 - SelectionMerge 70 None - BranchConditional 68 69 70 - 69: Label - 71: 6(float) Load 32(radius) - 73: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 71 72 - 74: 6(float) FDiv 73 24 - 75: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 74 - 76: 7(fvec4) Load 15(color) - 77: 7(fvec4) CompositeConstruct 75 75 75 75 - 78: 7(fvec4) FSub 76 77 - Store 15(color) 78 - Branch 70 - 70: Label - 79: 7(fvec4) Load 15(color) - Store 55(gl_FragColor) 79 + 49: Label + 70: 6(float) Load 36(radius) + 72: 46(bool) FOrdGreaterThanEqual 70 71 + SelectionMerge 74 None + BranchConditional 72 73 74 + 73: Label + 75: 6(float) Load 36(radius) + 77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76 + 78: 6(float) FDiv 77 27 + 79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78 + 80: 7(fvec4) Load 15(color) + 81: 7(fvec4) CompositeConstruct 79 79 79 79 + 82: 7(fvec4) FSub 80 81 + Store 15(color) 82 + Branch 74 + 74: Label + 83: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 83 Return FunctionEnd diff --git a/Test/baseResults/spv.do-simple.vert.out b/Test/baseResults/spv.do-simple.vert.out index be111143..5da88276 100755 --- a/Test/baseResults/spv.do-simple.vert.out +++ b/Test/baseResults/spv.do-simple.vert.out @@ -3,23 +3,21 @@ spv.do-simple.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 29 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 27 28 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 27 "gl_VertexID" Name 28 "gl_InstanceID" Decorate 27(gl_VertexID) BuiltIn VertexId - Decorate 27(gl_VertexID) NoStaticUse Decorate 28(gl_InstanceID) BuiltIn InstanceId - Decorate 28(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -40,7 +38,7 @@ Linked vertex stage: Branch 10 10: Label 13: 14(bool) Phi 15 5 25 12 - LoopMerge 11 None + LoopMerge 11 10 None Branch 16 16: Label SelectionMerge 12 None diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out index 5687acdf..f148d51d 100755 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -3,15 +3,15 @@ spv.do-while-continue-break.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 51 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 49 50 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 24 "A" @@ -24,9 +24,7 @@ Linked vertex stage: Name 49 "gl_VertexID" Name 50 "gl_InstanceID" Decorate 49(gl_VertexID) BuiltIn VertexId - Decorate 49(gl_VertexID) NoStaticUse Decorate 50(gl_InstanceID) BuiltIn InstanceId - Decorate 50(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -60,7 +58,7 @@ Linked vertex stage: Branch 10 10: Label 13: 14(bool) Phi 15 5 31 28 31 38 - LoopMerge 11 None + LoopMerge 11 10 None Branch 16 16: Label SelectionMerge 12 None diff --git a/Test/baseResults/spv.doWhileLoop.frag.out b/Test/baseResults/spv.doWhileLoop.frag.out index 1a204b02..d33fb8b1 100755 --- a/Test/baseResults/spv.doWhileLoop.frag.out +++ b/Test/baseResults/spv.doWhileLoop.frag.out @@ -3,24 +3,22 @@ spv.doWhileLoop.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 37 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 40 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 24 "d" - Name 29 "bigColor" - Name 35 "gl_FragColor" - Decorate 11(BaseColor) Smooth - Decorate 35(gl_FragColor) BuiltIn FragColor + Name 27 "d" + Name 32 "bigColor" + Name 38 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -30,13 +28,16 @@ Linked fragment stage: 11(BaseColor): 10(ptr) Variable Input 17: TypeBool 18: 17(bool) ConstantTrue - 23: TypePointer UniformConstant 6(float) - 24(d): 23(ptr) Variable UniformConstant - 28: TypePointer UniformConstant 7(fvec4) - 29(bigColor): 28(ptr) Variable UniformConstant - 33: 17(bool) ConstantFalse - 34: TypePointer Output 7(fvec4) -35(gl_FragColor): 34(ptr) Variable Output + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer UniformConstant 6(float) + 27(d): 26(ptr) Variable UniformConstant + 31: TypePointer UniformConstant 7(fvec4) + 32(bigColor): 31(ptr) Variable UniformConstant + 36: 17(bool) ConstantFalse + 37: TypePointer Output 7(fvec4) +38(gl_FragColor): 37(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -44,29 +45,29 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 16: 17(bool) Phi 18 5 33 15 - LoopMerge 14 None + 16: 17(bool) Phi 18 5 36 15 + LoopMerge 14 13 None Branch 19 19: Label SelectionMerge 15 None BranchConditional 16 15 20 20: Label - 21: 7(fvec4) Load 9(color) - 22: 6(float) CompositeExtract 21 0 - 25: 6(float) Load 24(d) - 26: 17(bool) FOrdLessThan 22 25 - SelectionMerge 27 None - BranchConditional 26 27 14 - 27: Label + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d) + 29: 17(bool) FOrdLessThan 25 28 + SelectionMerge 30 None + BranchConditional 29 30 14 + 30: Label Branch 15 15: Label - 30: 7(fvec4) Load 29(bigColor) - 31: 7(fvec4) Load 9(color) - 32: 7(fvec4) FAdd 31 30 - Store 9(color) 32 + 33: 7(fvec4) Load 32(bigColor) + 34: 7(fvec4) Load 9(color) + 35: 7(fvec4) FAdd 34 33 + Store 9(color) 35 Branch 13 14: Label - 36: 7(fvec4) Load 9(color) - Store 35(gl_FragColor) 36 + 39: 7(fvec4) Load 9(color) + Store 38(gl_FragColor) 39 Return FunctionEnd diff --git a/Test/baseResults/spv.double.comp.out b/Test/baseResults/spv.double.comp.out index 60183efb..1a63bbb7 100755 --- a/Test/baseResults/spv.double.comp.out +++ b/Test/baseResults/spv.double.comp.out @@ -5,16 +5,16 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked compute stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 62 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint GLCompute 4 "main" ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 430 Name 4 "main" Name 8 "bufName" MemberName 8(bufName) 0 "f" @@ -32,12 +32,6 @@ Linked compute stage: Decorate 8(bufName) BufferBlock Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId - Decorate 13 NoStaticUse - Decorate 56 NoStaticUse - Decorate 13 NoStaticUse - Decorate 13 NoStaticUse - Decorate 58(roll) NoStaticUse - Decorate 61(destTex) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -99,7 +93,7 @@ Linked compute stage: 41: 40(fvec2) ConvertSToF 39 43: 40(fvec2) CompositeConstruct 42 42 44: 40(fvec2) FDiv 41 43 - 45: 6(float) ExtInst 1(GLSL.std.450) 65(Length) 44 + 45: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 44 46: 7(float) FConvert 45 Store 32(localCoef) 46 Store 49(aa) 53 diff --git a/Test/baseResults/spv.earlyReturnDiscard.frag.out b/Test/baseResults/spv.earlyReturnDiscard.frag.out index 1ed86278..ab5f9227 100755 --- a/Test/baseResults/spv.earlyReturnDiscard.frag.out +++ b/Test/baseResults/spv.earlyReturnDiscard.frag.out @@ -3,16 +3,16 @@ spv.earlyReturnDiscard.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 111 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 112 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 18 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "color" Name 11 "BaseColor" @@ -22,16 +22,12 @@ Linked fragment stage: Name 21 "d" Name 27 "bigColor" Name 32 "smallColor" - Name 38 "minimum" - Name 52 "threshhold" - Name 63 "threshhold2" - Name 77 "b" - Name 106 "gl_FragColor" - Name 110 "threshhold3" - Decorate 11(BaseColor) Smooth - Decorate 18(c) Smooth - Decorate 106(gl_FragColor) BuiltIn FragColor - Decorate 110(threshhold3) NoStaticUse + Name 41 "minimum" + Name 53 "threshhold" + Name 65 "threshhold2" + Name 79 "b" + Name 107 "gl_FragColor" + Name 111 "threshhold3" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -48,15 +44,20 @@ Linked fragment stage: 23: TypeBool 27(bigColor): 14(ptr) Variable UniformConstant 32(smallColor): 14(ptr) Variable UniformConstant - 38(minimum): 20(ptr) Variable UniformConstant - 46: 6(float) Constant 1065353216 - 52(threshhold): 20(ptr) Variable UniformConstant - 63(threshhold2): 20(ptr) Variable UniformConstant - 76: TypePointer UniformConstant 23(bool) - 77(b): 76(ptr) Variable UniformConstant - 105: TypePointer Output 7(fvec4) -106(gl_FragColor): 105(ptr) Variable Output -110(threshhold3): 20(ptr) Variable UniformConstant + 36: TypeInt 32 0 + 37: 36(int) Constant 2 + 38: TypePointer Function 6(float) + 41(minimum): 20(ptr) Variable UniformConstant + 49: 6(float) Constant 1065353216 + 53(threshhold): 20(ptr) Variable UniformConstant + 62: 36(int) Constant 3 + 65(threshhold2): 20(ptr) Variable UniformConstant + 78: TypePointer UniformConstant 23(bool) + 79(b): 78(ptr) Variable UniformConstant + 87: 36(int) Constant 0 + 106: TypePointer Output 7(fvec4) +107(gl_FragColor): 106(ptr) Variable Output +111(threshhold3): 20(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -83,96 +84,92 @@ Linked fragment stage: Store 9(color) 35 Branch 26 26: Label - 36: 7(fvec4) Load 9(color) - 37: 6(float) CompositeExtract 36 2 - 39: 6(float) Load 38(minimum) - 40: 23(bool) FOrdLessThan 37 39 - SelectionMerge 42 None - BranchConditional 40 41 42 - 41: Label + 39: 38(ptr) AccessChain 9(color) 37 + 40: 6(float) Load 39 + 42: 6(float) Load 41(minimum) + 43: 23(bool) FOrdLessThan 40 42 + SelectionMerge 45 None + BranchConditional 43 44 45 + 44: Label Return - 42: Label - 44: 7(fvec4) Load 9(color) - 45: 6(float) CompositeExtract 44 2 - 47: 6(float) FAdd 45 46 - 48: 7(fvec4) Load 9(color) - 49: 7(fvec4) CompositeInsert 47 48 2 - Store 9(color) 49 - 50: 7(fvec4) Load 9(color) - 51: 6(float) CompositeExtract 50 2 - 53: 6(float) Load 52(threshhold) - 54: 23(bool) FOrdGreaterThan 51 53 - SelectionMerge 56 None - BranchConditional 54 55 56 - 55: Label + 45: Label + 47: 38(ptr) AccessChain 9(color) 37 + 48: 6(float) Load 47 + 50: 6(float) FAdd 48 49 + Store 47 50 + 51: 38(ptr) AccessChain 9(color) 37 + 52: 6(float) Load 51 + 54: 6(float) Load 53(threshhold) + 55: 23(bool) FOrdGreaterThan 52 54 + SelectionMerge 57 None + BranchConditional 55 56 57 + 56: Label Kill - 56: Label - 58: 7(fvec4) Load 9(color) - 59: 7(fvec4) CompositeConstruct 46 46 46 46 - 60: 7(fvec4) FAdd 58 59 - Store 9(color) 60 - 61: 7(fvec4) Load 9(color) - 62: 6(float) CompositeExtract 61 3 - 64: 6(float) Load 63(threshhold2) - 65: 23(bool) FOrdGreaterThan 62 64 - SelectionMerge 67 None - BranchConditional 65 66 98 - 66: Label - 68: 7(fvec4) Load 9(color) - 69: 6(float) CompositeExtract 68 2 - 70: 6(float) Load 63(threshhold2) - 71: 23(bool) FOrdGreaterThan 69 70 - SelectionMerge 73 None - BranchConditional 71 72 75 - 72: Label + 57: Label + 59: 7(fvec4) Load 9(color) + 60: 7(fvec4) CompositeConstruct 49 49 49 49 + 61: 7(fvec4) FAdd 59 60 + Store 9(color) 61 + 63: 38(ptr) AccessChain 9(color) 62 + 64: 6(float) Load 63 + 66: 6(float) Load 65(threshhold2) + 67: 23(bool) FOrdGreaterThan 64 66 + SelectionMerge 69 None + BranchConditional 67 68 99 + 68: Label + 70: 38(ptr) AccessChain 9(color) 37 + 71: 6(float) Load 70 + 72: 6(float) Load 65(threshhold2) + 73: 23(bool) FOrdGreaterThan 71 72 + SelectionMerge 75 None + BranchConditional 73 74 77 + 74: Label Return - 75: Label - 78: 23(bool) Load 77(b) - SelectionMerge 80 None - BranchConditional 78 79 86 - 79: Label - 81: 7(fvec4) Load 9(color) - 82: 6(float) CompositeExtract 81 2 - 83: 6(float) FAdd 82 46 - 84: 7(fvec4) Load 9(color) - 85: 7(fvec4) CompositeInsert 83 84 2 - Store 9(color) 85 - Branch 80 + 77: Label + 80: 23(bool) Load 79(b) + SelectionMerge 82 None + BranchConditional 80 81 86 + 81: Label + 83: 38(ptr) AccessChain 9(color) 37 + 84: 6(float) Load 83 + 85: 6(float) FAdd 84 49 + Store 83 85 + Branch 82 86: Label - 87: 7(fvec4) Load 9(color) - 88: 6(float) CompositeExtract 87 0 - 89: 6(float) Load 38(minimum) - 90: 23(bool) FOrdLessThan 88 89 - SelectionMerge 92 None - BranchConditional 90 91 94 - 91: Label + 88: 38(ptr) AccessChain 9(color) 87 + 89: 6(float) Load 88 + 90: 6(float) Load 41(minimum) + 91: 23(bool) FOrdLessThan 89 90 + SelectionMerge 93 None + BranchConditional 91 92 95 + 92: Label Kill - 94: Label - 95: 7(fvec4) Load 9(color) - 96: 7(fvec4) CompositeConstruct 46 46 46 46 - 97: 7(fvec4) FAdd 95 96 - Store 9(color) 97 - Branch 92 - 92: Label - Branch 80 - 80: Label - Branch 73 - 73: Label - Branch 67 - 98: Label - 99: 23(bool) Load 77(b) - SelectionMerge 101 None - BranchConditional 99 100 103 - 100: Label + 95: Label + 96: 7(fvec4) Load 9(color) + 97: 7(fvec4) CompositeConstruct 49 49 49 49 + 98: 7(fvec4) FAdd 96 97 + Store 9(color) 98 + Branch 93 + 93: Label + Branch 82 + 82: Label + Branch 75 + 75: Label + Branch 69 + 99: Label + 100: 23(bool) Load 79(b) + SelectionMerge 102 None + BranchConditional 100 101 104 + 101: Label Kill - 103: Label + 104: Label Return - 101: Label - Branch 67 - 67: Label - 107: 7(fvec4) Load 9(color) - 108: 7(fvec4) Load 13(color2) - 109: 7(fvec4) FMul 107 108 - Store 106(gl_FragColor) 109 + 102: Label + Branch 69 + 69: Label + 108: 7(fvec4) Load 9(color) + 109: 7(fvec4) Load 13(color2) + 110: 7(fvec4) FMul 108 109 + Store 107(gl_FragColor) 110 Return FunctionEnd diff --git a/Test/baseResults/spv.flowControl.frag.out b/Test/baseResults/spv.flowControl.frag.out index eb6ced42..fa1b5c08 100755 --- a/Test/baseResults/spv.flowControl.frag.out +++ b/Test/baseResults/spv.flowControl.frag.out @@ -3,16 +3,16 @@ spv.flowControl.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 41 - Source GLSL 120 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 18 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 120 Name 4 "main" Name 9 "color" Name 11 "BaseColor" @@ -23,9 +23,6 @@ Linked fragment stage: Name 27 "bigColor" Name 32 "smallColor" Name 37 "gl_FragColor" - Decorate 11(BaseColor) Smooth - Decorate 18(c) Smooth - Decorate 37(gl_FragColor) BuiltIn FragColor 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out index 633a6b44..eac3ddb8 100755 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -3,15 +3,15 @@ spv.for-continue-break.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 48 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 46 47 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 17 "A" @@ -24,9 +24,7 @@ Linked vertex stage: Name 46 "gl_VertexID" Name 47 "gl_InstanceID" Decorate 46(gl_VertexID) BuiltIn VertexId - Decorate 46(gl_VertexID) NoStaticUse Decorate 47(gl_InstanceID) BuiltIn InstanceId - Decorate 47(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -57,7 +55,7 @@ Linked vertex stage: 10: Label 13: 6(int) Load 8(i) 16: 15(bool) SLessThan 13 14 - LoopMerge 11 None + LoopMerge 11 10 None BranchConditional 16 12 11 12: Label Store 17(A) 18 diff --git a/Test/baseResults/spv.for-simple.vert.out b/Test/baseResults/spv.for-simple.vert.out index 9e4a7a7b..95ca758d 100755 --- a/Test/baseResults/spv.for-simple.vert.out +++ b/Test/baseResults/spv.for-simple.vert.out @@ -3,24 +3,22 @@ spv.for-simple.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 25 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 23 24 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 17 "j" Name 23 "gl_VertexID" Name 24 "gl_InstanceID" Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 23(gl_VertexID) NoStaticUse Decorate 24(gl_InstanceID) BuiltIn InstanceId - Decorate 24(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -42,7 +40,7 @@ Linked vertex stage: 10: Label 13: 6(int) Load 8(i) 16: 15(bool) SLessThan 13 14 - LoopMerge 11 None + LoopMerge 11 10 None BranchConditional 16 12 11 12: Label Store 17(j) 18 diff --git a/Test/baseResults/spv.forLoop.frag.out b/Test/baseResults/spv.forLoop.frag.out index 086f884a..1be209b4 100755 --- a/Test/baseResults/spv.forLoop.frag.out +++ b/Test/baseResults/spv.forLoop.frag.out @@ -3,16 +3,16 @@ spv.forLoop.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 122 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 11 97 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "color" Name 11 "BaseColor" @@ -23,15 +23,12 @@ Linked fragment stage: Name 38 "sum" Name 40 "i" Name 50 "v4" - Name 59 "i" - Name 65 "tv4" + Name 60 "i" + Name 66 "tv4" Name 83 "r" Name 89 "i" Name 97 "f" Name 110 "i" - Decorate 11(BaseColor) Smooth - Decorate 35(gl_FragColor) BuiltIn FragColor - Decorate 97(f) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -57,10 +54,12 @@ Linked fragment stage: 48: TypeVector 47(int) 4 49: TypePointer UniformConstant 48(ivec4) 50(v4): 49(ptr) Variable UniformConstant - 70: 47(int) Constant 4 + 52: TypePointer UniformConstant 47(int) + 71: 47(int) Constant 4 84: TypeVector 6(float) 3 96: TypePointer Input 6(float) 97(f): 96(ptr) Variable Input + 99: 47(int) Constant 3 115: 13(int) Constant 16 4(main): 2 Function None 3 5: Label @@ -68,8 +67,8 @@ Linked fragment stage: 15(i): 14(ptr) Variable Function 38(sum): 37(ptr) Variable Function 40(i): 14(ptr) Variable Function - 59(i): 14(ptr) Variable Function - 65(tv4): 8(ptr) Variable Function + 60(i): 14(ptr) Variable Function + 66(tv4): 8(ptr) Variable Function 83(r): 8(ptr) Variable Function 89(i): 14(ptr) Variable Function 110(i): 14(ptr) Variable Function @@ -81,7 +80,7 @@ Linked fragment stage: 20: 13(int) Load 15(i) 23: 13(int) Load 22(Count) 25: 24(bool) SLessThan 20 23 - LoopMerge 18 None + LoopMerge 18 17 None BranchConditional 25 19 18 19: Label 28: 7(fvec4) Load 27(bigColor) @@ -101,46 +100,45 @@ Linked fragment stage: 41: Label 44: 13(int) Load 40(i) 46: 24(bool) SLessThan 44 45 - LoopMerge 42 None + LoopMerge 42 41 None BranchConditional 46 43 42 43: Label 51: 13(int) Load 40(i) - 52: 48(ivec4) Load 50(v4) - 53: 47(int) VectorExtractDynamic 52 51 - 54: 6(float) ConvertUToF 53 - 55: 6(float) Load 38(sum) - 56: 6(float) FAdd 55 54 - Store 38(sum) 56 - 57: 13(int) Load 40(i) - 58: 13(int) IAdd 57 32 - Store 40(i) 58 + 53: 52(ptr) AccessChain 50(v4) 51 + 54: 47(int) Load 53 + 55: 6(float) ConvertUToF 54 + 56: 6(float) Load 38(sum) + 57: 6(float) FAdd 56 55 + Store 38(sum) 57 + 58: 13(int) Load 40(i) + 59: 13(int) IAdd 58 32 + Store 40(i) 59 Branch 41 42: Label - Store 59(i) 16 - Branch 60 - 60: Label - 63: 13(int) Load 59(i) - 64: 24(bool) SLessThan 63 45 - LoopMerge 61 None - BranchConditional 64 62 61 - 62: Label - 66: 13(int) Load 59(i) - 67: 13(int) Load 59(i) - 68: 48(ivec4) Load 50(v4) - 69: 47(int) VectorExtractDynamic 68 67 - 71: 47(int) IMul 69 70 - 72: 6(float) ConvertUToF 71 - 73: 7(fvec4) Load 65(tv4) - 74: 7(fvec4) VectorInsertDynamic 73 72 66 - Store 65(tv4) 74 - 75: 13(int) Load 59(i) - 76: 13(int) IAdd 75 32 - Store 59(i) 76 - Branch 60 + Store 60(i) 16 + Branch 61 61: Label + 64: 13(int) Load 60(i) + 65: 24(bool) SLessThan 64 45 + LoopMerge 62 61 None + BranchConditional 65 63 62 + 63: Label + 67: 13(int) Load 60(i) + 68: 13(int) Load 60(i) + 69: 52(ptr) AccessChain 50(v4) 68 + 70: 47(int) Load 69 + 72: 47(int) IMul 70 71 + 73: 6(float) ConvertUToF 72 + 74: 37(ptr) AccessChain 66(tv4) 67 + Store 74 73 + 75: 13(int) Load 60(i) + 76: 13(int) IAdd 75 32 + Store 60(i) 76 + Branch 61 + 62: Label 77: 6(float) Load 38(sum) 78: 7(fvec4) CompositeConstruct 77 77 77 77 - 79: 7(fvec4) Load 65(tv4) + 79: 7(fvec4) Load 66(tv4) 80: 7(fvec4) FAdd 78 79 81: 7(fvec4) Load 35(gl_FragColor) 82: 7(fvec4) FAdd 81 80 @@ -156,13 +154,12 @@ Linked fragment stage: 93: 13(int) Load 89(i) 94: 13(int) Load 22(Count) 95: 24(bool) SLessThan 93 94 - LoopMerge 91 None + LoopMerge 91 90 None BranchConditional 95 92 91 92: Label 98: 6(float) Load 97(f) - 99: 7(fvec4) Load 83(r) - 100: 7(fvec4) CompositeInsert 98 99 3 - Store 83(r) 100 + 100: 37(ptr) AccessChain 83(r) 99 + Store 100 98 101: 13(int) Load 89(i) 102: 13(int) IAdd 101 32 Store 89(i) 102 @@ -181,7 +178,7 @@ Linked fragment stage: 111: Label 114: 13(int) Load 110(i) 116: 24(bool) SLessThan 114 115 - LoopMerge 112 None + LoopMerge 112 111 None BranchConditional 116 113 112 113: Label 117: 6(float) Load 97(f) diff --git a/Test/baseResults/spv.forwardFun.frag.out b/Test/baseResults/spv.forwardFun.frag.out old mode 100644 new mode 100755 index 0af086d2..ce0cdb89 --- a/Test/baseResults/spv.forwardFun.frag.out +++ b/Test/baseResults/spv.forwardFun.frag.out @@ -3,16 +3,16 @@ spv.forwardFun.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 57 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 60 - Source ESSL 100 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 20 ExecutionMode 4 OriginLowerLeft + Source ESSL 100 Name 4 "main" Name 6 "bar(" Name 10 "unreachableReturn(" @@ -24,16 +24,13 @@ Linked fragment stage: Name 27 "f" Name 30 "gl_FragColor" Name 36 "d" - Name 56 "bigColor" + Name 59 "bigColor" Decorate 18(color) RelaxedPrecision Decorate 20(BaseColor) RelaxedPrecision - Decorate 20(BaseColor) Smooth Decorate 27(f) RelaxedPrecision Decorate 30(gl_FragColor) RelaxedPrecision - Decorate 30(gl_FragColor) BuiltIn FragColor Decorate 36(d) RelaxedPrecision - Decorate 56(bigColor) RelaxedPrecision - Decorate 56(bigColor) NoStaticUse + Decorate 59(bigColor) RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 @@ -52,8 +49,11 @@ Linked fragment stage: 39: TypeBool 43: 8(float) Constant 1067030938 46: 8(float) Constant 1083179008 - 55: TypePointer UniformConstant 12(fvec4) - 56(bigColor): 55(ptr) Variable UniformConstant + 49: TypeInt 32 0 + 50: 49(int) Constant 0 + 53: 49(int) Constant 1 + 58: TypePointer UniformConstant 12(fvec4) + 59(bigColor): 58(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 18(color): 13(ptr) Variable Function @@ -95,10 +95,10 @@ Linked fragment stage: 16(foo(vf4;): 8(float) Function None 14 15(bar): 13(ptr) FunctionParameter 17: Label - 49: 12(fvec4) Load 15(bar) - 50: 8(float) CompositeExtract 49 0 - 51: 12(fvec4) Load 15(bar) - 52: 8(float) CompositeExtract 51 1 - 53: 8(float) FAdd 50 52 - ReturnValue 53 + 51: 26(ptr) AccessChain 15(bar) 50 + 52: 8(float) Load 51 + 54: 26(ptr) AccessChain 15(bar) 53 + 55: 8(float) Load 54 + 56: 8(float) FAdd 52 55 + ReturnValue 56 FunctionEnd diff --git a/Test/baseResults/spv.functionCall.frag.out b/Test/baseResults/spv.functionCall.frag.out old mode 100644 new mode 100755 index 42ec4c5f..0d8bed75 --- a/Test/baseResults/spv.functionCall.frag.out +++ b/Test/baseResults/spv.functionCall.frag.out @@ -5,16 +5,16 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 73 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 76 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 57 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 11 "foo(vf4;" Name 10 "bar" @@ -22,17 +22,14 @@ Linked fragment stage: Name 16 "unreachableReturn(" Name 18 "missingReturn(" Name 21 "h" - Name 30 "d" - Name 51 "color" - Name 53 "BaseColor" - Name 54 "param" - Name 60 "f" - Name 62 "g" - Name 65 "gl_FragColor" - Name 72 "bigColor" - Decorate 53(BaseColor) Smooth - Decorate 65(gl_FragColor) BuiltIn FragColor - Decorate 72(bigColor) NoStaticUse + Name 34 "d" + Name 55 "color" + Name 57 "BaseColor" + Name 58 "param" + Name 63 "f" + Name 65 "g" + Name 68 "gl_FragColor" + Name 75 "bigColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -40,57 +37,60 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 9: TypeFunction 6(float) 8(ptr) 15: TypeFunction 6(float) - 20: TypePointer PrivateGlobal 6(float) - 21(h): 20(ptr) Variable PrivateGlobal + 20: TypePointer Private 6(float) + 21(h): 20(ptr) Variable Private 22: 6(float) Constant 0 - 29: TypePointer UniformConstant 6(float) - 30(d): 29(ptr) Variable UniformConstant - 32: 6(float) Constant 1082549862 - 33: TypeBool - 37: 6(float) Constant 1067030938 - 40: 6(float) Constant 1083179008 - 48: 6(float) Constant 1081711002 - 52: TypePointer Input 7(fvec4) - 53(BaseColor): 52(ptr) Variable Input - 59: TypePointer Function 6(float) - 64: TypePointer Output 7(fvec4) -65(gl_FragColor): 64(ptr) Variable Output - 71: TypePointer UniformConstant 7(fvec4) - 72(bigColor): 71(ptr) Variable UniformConstant + 23: TypeInt 32 0 + 24: 23(int) Constant 0 + 25: TypePointer Function 6(float) + 28: 23(int) Constant 1 + 33: TypePointer UniformConstant 6(float) + 34(d): 33(ptr) Variable UniformConstant + 36: 6(float) Constant 1082549862 + 37: TypeBool + 41: 6(float) Constant 1067030938 + 44: 6(float) Constant 1083179008 + 52: 6(float) Constant 1081711002 + 56: TypePointer Input 7(fvec4) + 57(BaseColor): 56(ptr) Variable Input + 67: TypePointer Output 7(fvec4) +68(gl_FragColor): 67(ptr) Variable Output + 74: TypePointer UniformConstant 7(fvec4) + 75(bigColor): 74(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label - 51(color): 8(ptr) Variable Function - 54(param): 8(ptr) Variable Function - 60(f): 59(ptr) Variable Function - 62(g): 59(ptr) Variable Function + 55(color): 8(ptr) Variable Function + 58(param): 8(ptr) Variable Function + 63(f): 25(ptr) Variable Function + 65(g): 25(ptr) Variable Function Store 21(h) 22 - 55: 7(fvec4) Load 53(BaseColor) - Store 54(param) 55 - 56: 6(float) FunctionCall 11(foo(vf4;) 54(param) - 57: 7(fvec4) CompositeConstruct 56 56 56 56 - Store 51(color) 57 - 58: 2 FunctionCall 13(bar() - 61: 6(float) FunctionCall 16(unreachableReturn() - Store 60(f) 61 - 63: 6(float) FunctionCall 18(missingReturn() - Store 62(g) 63 - 66: 7(fvec4) Load 51(color) - 67: 6(float) Load 60(f) - 68: 7(fvec4) VectorTimesScalar 66 67 - 69: 6(float) Load 21(h) - 70: 7(fvec4) VectorTimesScalar 68 69 - Store 65(gl_FragColor) 70 + 59: 7(fvec4) Load 57(BaseColor) + Store 58(param) 59 + 60: 6(float) FunctionCall 11(foo(vf4;) 58(param) + 61: 7(fvec4) CompositeConstruct 60 60 60 60 + Store 55(color) 61 + 62: 2 FunctionCall 13(bar() + 64: 6(float) FunctionCall 16(unreachableReturn() + Store 63(f) 64 + 66: 6(float) FunctionCall 18(missingReturn() + Store 65(g) 66 + 69: 7(fvec4) Load 55(color) + 70: 6(float) Load 63(f) + 71: 7(fvec4) VectorTimesScalar 69 70 + 72: 6(float) Load 21(h) + 73: 7(fvec4) VectorTimesScalar 71 72 + Store 68(gl_FragColor) 73 Return FunctionEnd 11(foo(vf4;): 6(float) Function None 9 10(bar): 8(ptr) FunctionParameter 12: Label - 23: 7(fvec4) Load 10(bar) - 24: 6(float) CompositeExtract 23 0 - 25: 7(fvec4) Load 10(bar) - 26: 6(float) CompositeExtract 25 1 - 27: 6(float) FAdd 24 26 - ReturnValue 27 + 26: 25(ptr) AccessChain 10(bar) 24 + 27: 6(float) Load 26 + 29: 25(ptr) AccessChain 10(bar) 28 + 30: 6(float) Load 29 + 31: 6(float) FAdd 27 30 + ReturnValue 31 FunctionEnd 13(bar(): 2 Function None 3 14: Label @@ -98,29 +98,29 @@ Linked fragment stage: FunctionEnd 16(unreachableReturn(): 6(float) Function None 15 17: Label - 31: 6(float) Load 30(d) - 34: 33(bool) FOrdLessThan 31 32 - SelectionMerge 36 None - BranchConditional 34 35 39 - 35: Label - ReturnValue 37 + 35: 6(float) Load 34(d) + 38: 37(bool) FOrdLessThan 35 36 + SelectionMerge 40 None + BranchConditional 38 39 43 39: Label - ReturnValue 40 - 36: Label - 42: 6(float) Undef - ReturnValue 42 + ReturnValue 41 + 43: Label + ReturnValue 44 + 40: Label + 46: 6(float) Undef + ReturnValue 46 FunctionEnd 18(missingReturn(): 6(float) Function None 15 19: Label - 43: 6(float) Load 30(d) - 44: 33(bool) FOrdLessThan 43 40 - SelectionMerge 46 None - BranchConditional 44 45 46 - 45: Label - 47: 6(float) Load 30(d) - Store 21(h) 47 - ReturnValue 48 - 46: Label - 50: 6(float) Undef - ReturnValue 50 + 47: 6(float) Load 34(d) + 48: 37(bool) FOrdLessThan 47 44 + SelectionMerge 50 None + BranchConditional 48 49 50 + 49: Label + 51: 6(float) Load 34(d) + Store 21(h) 51 + ReturnValue 52 + 50: Label + 54: 6(float) Undef + ReturnValue 54 FunctionEnd diff --git a/Test/baseResults/spv.functionSemantics.frag.out b/Test/baseResults/spv.functionSemantics.frag.out index bc0b07c8..1200d284 100755 --- a/Test/baseResults/spv.functionSemantics.frag.out +++ b/Test/baseResults/spv.functionSemantics.frag.out @@ -5,16 +5,16 @@ Warning, version 400 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 158 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 153 - Source GLSL 400 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source GLSL 400 Name 4 "main" Name 15 "foo(i1;i1;i1;i1;i1;i1;" Name 9 "a" @@ -29,26 +29,25 @@ Linked fragment stage: Name 24 "r" Name 28 "foo3(" Name 30 "sum" - Name 72 "u" - Name 84 "t" - Name 87 "s" - MemberName 87(s) 0 "t" - Name 89 "f" - Name 96 "color" - Name 102 "e" + Name 74 "u" + Name 86 "t" + Name 89 "s" + MemberName 89(s) 0 "t" + Name 91 "f" + Name 95 "color" + Name 101 "e" + Name 102 "param" Name 103 "param" Name 104 "param" Name 105 "param" - Name 106 "param" - Name 125 "ret" - Name 127 "tempReturn" - Name 132 "tempArg" - Name 133 "param" - Name 134 "param" - Name 135 "param" - Name 138 "arg" - Name 154 "gl_FragColor" - Decorate 154(gl_FragColor) BuiltIn FragColor + Name 120 "ret" + Name 122 "tempReturn" + Name 127 "tempArg" + Name 128 "param" + Name 129 "param" + Name 130 "param" + Name 133 "arg" + Name 149 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -64,106 +63,101 @@ Linked fragment stage: 43: 6(int) Constant 1024 61: 17(float) Constant 1077936128 65: 17(float) Constant 1084227584 - 71: TypePointer UniformConstant 17(float) - 72(u): 71(ptr) Variable UniformConstant - 74: 17(float) Constant 1078774989 - 75: TypeBool - 80: 6(int) Constant 1000000 - 82: 6(int) Constant 2000000 - 85: 6(int) Constant 2 - 86: TypeVector 6(int) 4 - 87(s): TypeStruct 86(ivec4) - 88: TypePointer Function 87(s) - 90: 6(int) Constant 0 - 91: 6(int) Constant 32 - 92: TypePointer Function 86(ivec4) - 97: 6(int) Constant 1 - 101: 6(int) Constant 8 - 116: 6(int) Constant 128 - 126: TypePointer PrivateGlobal 6(int) - 127(tempReturn): 126(ptr) Variable PrivateGlobal - 128: 17(float) Constant 1082130432 - 129: 17(float) Constant 1065353216 - 130: 17(float) Constant 1073741824 - 131: 19(fvec3) ConstantComposite 129 130 61 - 152: TypeVector 17(float) 4 - 153: TypePointer Output 152(fvec4) -154(gl_FragColor): 153(ptr) Variable Output + 66: TypeInt 32 0 + 67: 66(int) Constant 1 + 73: TypePointer UniformConstant 17(float) + 74(u): 73(ptr) Variable UniformConstant + 76: 17(float) Constant 1078774989 + 77: TypeBool + 82: 6(int) Constant 1000000 + 84: 6(int) Constant 2000000 + 87: 6(int) Constant 2 + 88: TypeVector 6(int) 4 + 89(s): TypeStruct 88(ivec4) + 90: TypePointer Function 89(s) + 92: 6(int) Constant 0 + 93: 6(int) Constant 32 + 96: 6(int) Constant 1 + 100: 6(int) Constant 8 + 112: 6(int) Constant 128 + 121: TypePointer Private 6(int) + 122(tempReturn): 121(ptr) Variable Private + 123: 17(float) Constant 1082130432 + 124: 17(float) Constant 1065353216 + 125: 17(float) Constant 1073741824 + 126: 19(fvec3) ConstantComposite 124 125 61 + 147: TypeVector 17(float) 4 + 148: TypePointer Output 147(fvec4) +149(gl_FragColor): 148(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 84(t): 7(ptr) Variable Function - 89(f): 88(ptr) Variable Function - 96(color): 7(ptr) Variable Function - 102(e): 7(ptr) Variable Function + 86(t): 7(ptr) Variable Function + 91(f): 90(ptr) Variable Function + 95(color): 7(ptr) Variable Function + 101(e): 7(ptr) Variable Function + 102(param): 7(ptr) Variable Function 103(param): 7(ptr) Variable Function 104(param): 7(ptr) Variable Function 105(param): 7(ptr) Variable Function - 106(param): 7(ptr) Variable Function - 125(ret): 18(ptr) Variable Function - 132(tempArg): 7(ptr) Variable Function - 133(param): 18(ptr) Variable Function - 134(param): 20(ptr) Variable Function - 135(param): 7(ptr) Variable Function - 138(arg): 18(ptr) Variable Function - Store 84(t) 85 - 93: 92(ptr) AccessChain 89(f) 90 - 94: 86(ivec4) Load 93 - 95: 86(ivec4) CompositeInsert 91 94 1 - Store 93 95 - 98: 6(int) Load 84(t) - 99: 6(int) Load 84(t) - 100: 6(int) IAdd 98 99 - Store 103(param) 97 - Store 104(param) 100 - 107: 92(ptr) AccessChain 89(f) 90 - 108: 86(ivec4) Load 107 - 109: 6(int) CompositeExtract 108 1 - Store 106(param) 109 - 110: 6(int) FunctionCall 15(foo(i1;i1;i1;i1;i1;i1;) 103(param) 85 104(param) 101 105(param) 106(param) - 111: 6(int) Load 105(param) - Store 102(e) 111 - 112: 6(int) Load 106(param) - 113: 92(ptr) AccessChain 89(f) 90 - 114: 86(ivec4) Load 113 - 115: 86(ivec4) CompositeInsert 112 114 1 - Store 113 115 - Store 96(color) 110 - 117: 6(int) Load 102(e) - 118: 92(ptr) AccessChain 89(f) 90 - 119: 86(ivec4) Load 118 - 120: 6(int) CompositeExtract 119 1 - 121: 6(int) IAdd 117 120 - 122: 6(int) IMul 116 121 - 123: 6(int) Load 96(color) - 124: 6(int) IAdd 123 122 - Store 96(color) 124 - Store 133(param) 128 - Store 134(param) 131 - 136: 6(int) FunctionCall 25(foo2(f1;vf3;i1;) 133(param) 134(param) 135(param) - 137: 6(int) Load 135(param) - Store 132(tempArg) 137 - Store 127(tempReturn) 136 - 139: 6(int) Load 132(tempArg) - 140: 17(float) ConvertSToF 139 - Store 138(arg) 140 - 141: 6(int) Load 127(tempReturn) - 142: 17(float) ConvertSToF 141 - Store 125(ret) 142 - 143: 17(float) Load 125(ret) - 144: 17(float) Load 138(arg) - 145: 17(float) FAdd 143 144 - 146: 6(int) ConvertFToS 145 - 147: 6(int) Load 96(color) - 148: 6(int) IAdd 147 146 - Store 96(color) 148 - 149: 6(int) FunctionCall 28(foo3() - 150: 6(int) Load 96(color) - 151: 6(int) IAdd 150 149 - Store 96(color) 151 - 155: 6(int) Load 96(color) - 156: 17(float) ConvertSToF 155 - 157: 152(fvec4) CompositeConstruct 156 156 156 156 - Store 154(gl_FragColor) 157 + 120(ret): 18(ptr) Variable Function + 127(tempArg): 7(ptr) Variable Function + 128(param): 18(ptr) Variable Function + 129(param): 20(ptr) Variable Function + 130(param): 7(ptr) Variable Function + 133(arg): 18(ptr) Variable Function + Store 86(t) 87 + 94: 7(ptr) AccessChain 91(f) 92 67 + Store 94 93 + 97: 6(int) Load 86(t) + 98: 6(int) Load 86(t) + 99: 6(int) IAdd 97 98 + Store 102(param) 96 + Store 103(param) 99 + 106: 7(ptr) AccessChain 91(f) 92 67 + 107: 6(int) Load 106 + Store 105(param) 107 + 108: 6(int) FunctionCall 15(foo(i1;i1;i1;i1;i1;i1;) 102(param) 87 103(param) 100 104(param) 105(param) + 109: 6(int) Load 104(param) + Store 101(e) 109 + 110: 6(int) Load 105(param) + 111: 7(ptr) AccessChain 91(f) 92 67 + Store 111 110 + Store 95(color) 108 + 113: 6(int) Load 101(e) + 114: 7(ptr) AccessChain 91(f) 92 67 + 115: 6(int) Load 114 + 116: 6(int) IAdd 113 115 + 117: 6(int) IMul 112 116 + 118: 6(int) Load 95(color) + 119: 6(int) IAdd 118 117 + Store 95(color) 119 + Store 128(param) 123 + Store 129(param) 126 + 131: 6(int) FunctionCall 25(foo2(f1;vf3;i1;) 128(param) 129(param) 130(param) + 132: 6(int) Load 130(param) + Store 127(tempArg) 132 + Store 122(tempReturn) 131 + 134: 6(int) Load 127(tempArg) + 135: 17(float) ConvertSToF 134 + Store 133(arg) 135 + 136: 6(int) Load 122(tempReturn) + 137: 17(float) ConvertSToF 136 + Store 120(ret) 137 + 138: 17(float) Load 120(ret) + 139: 17(float) Load 133(arg) + 140: 17(float) FAdd 138 139 + 141: 6(int) ConvertFToS 140 + 142: 6(int) Load 95(color) + 143: 6(int) IAdd 142 141 + Store 95(color) 143 + 144: 6(int) FunctionCall 28(foo3() + 145: 6(int) Load 95(color) + 146: 6(int) IAdd 145 144 + Store 95(color) 146 + 150: 6(int) Load 95(color) + 151: 17(float) ConvertSToF 150 + 152: 147(fvec4) CompositeConstruct 151 151 151 151 + Store 149(gl_FragColor) 152 Return FunctionEnd 15(foo(i1;i1;i1;i1;i1;i1;): 6(int) Function None 8 @@ -219,20 +213,20 @@ Linked fragment stage: 63: 17(float) FMul 61 62 64: 6(int) ConvertFToS 63 Store 24(r) 64 - 66: 19(fvec3) Load 23(b) - 67: 17(float) CompositeExtract 66 1 - 68: 17(float) FMul 65 67 - 69: 6(int) ConvertFToS 68 - ReturnValue 69 + 68: 18(ptr) AccessChain 23(b) 67 + 69: 17(float) Load 68 + 70: 17(float) FMul 65 69 + 71: 6(int) ConvertFToS 70 + ReturnValue 71 FunctionEnd 28(foo3(): 6(int) Function None 27 29: Label - 73: 17(float) Load 72(u) - 76: 75(bool) FOrdGreaterThan 73 74 - SelectionMerge 78 None - BranchConditional 76 77 78 - 77: Label + 75: 17(float) Load 74(u) + 78: 77(bool) FOrdGreaterThan 75 76 + SelectionMerge 80 None + BranchConditional 78 79 80 + 79: Label Kill - 78: Label - ReturnValue 82 + 80: Label + ReturnValue 84 FunctionEnd diff --git a/Test/baseResults/spv.image.frag.out b/Test/baseResults/spv.image.frag.out index 40258ba4..1baad76d 100644 --- a/Test/baseResults/spv.image.frag.out +++ b/Test/baseResults/spv.image.frag.out @@ -5,53 +5,52 @@ Warning, version 450 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 383 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 372 - Source GLSL 450 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 356 ExecutionMode 4 OriginLowerLeft + Source GLSL 450 Name 4 "main" Name 9 "iv" Name 15 "i1D" - Name 25 "i2D" - Name 36 "i3D" - Name 43 "iCube" - Name 53 "iCubeArray" - Name 60 "i2DRect" - Name 70 "i1DArray" - Name 80 "i2DArray" - Name 87 "iBuffer" - Name 97 "i2DMS" - Name 107 "i2DMSArray" - Name 128 "v" - Name 133 "ic1D" - Name 143 "ic2D" - Name 153 "ic3D" - Name 231 "ui" - Name 235 "ii1D" - Name 249 "ui2D" - Name 252 "value" - Name 367 "fragData" - Name 382 "ic4D" + Name 27 "i2D" + Name 38 "i3D" + Name 45 "iCube" + Name 55 "iCubeArray" + Name 62 "i2DRect" + Name 72 "i1DArray" + Name 82 "i2DArray" + Name 89 "iBuffer" + Name 98 "i2DMS" + Name 108 "i2DMSArray" + Name 127 "v" + Name 132 "ic1D" + Name 142 "ic2D" + Name 152 "ic3D" + Name 229 "ui" + Name 232 "ii1D" + Name 245 "ui2D" + Name 248 "value" + Name 356 "fragData" + Name 371 "ic4D" Decorate 15(i1D) Binding 0 - Decorate 25(i2D) Binding 1 - Decorate 36(i3D) Binding 2 - Decorate 43(iCube) Binding 3 - Decorate 53(iCubeArray) Binding 4 - Decorate 60(i2DRect) Binding 5 - Decorate 70(i1DArray) Binding 6 - Decorate 80(i2DArray) Binding 7 - Decorate 87(iBuffer) Binding 8 - Decorate 97(i2DMS) Binding 9 - Decorate 107(i2DMSArray) Binding 10 - Decorate 235(ii1D) Binding 11 - Decorate 249(ui2D) Binding 12 - Decorate 382(ic4D) NoStaticUse + Decorate 27(i2D) Binding 1 + Decorate 38(i3D) Binding 2 + Decorate 45(iCube) Binding 3 + Decorate 55(iCubeArray) Binding 4 + Decorate 62(i2DRect) Binding 5 + Decorate 72(i1DArray) Binding 6 + Decorate 82(i2DArray) Binding 7 + Decorate 89(iBuffer) Binding 8 + Decorate 98(i2DMS) Binding 9 + Decorate 108(i2DMSArray) Binding 10 + Decorate 232(ii1D) Binding 11 + Decorate 245(ui2D) Binding 12 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -63,436 +62,425 @@ Linked fragment stage: 13: TypeImage 12(float) 1D nonsampled format:Rgba32f 14: TypePointer UniformConstant 13 15(i1D): 14(ptr) Variable UniformConstant - 23: TypeImage 12(float) 2D nonsampled format:Rgba32f - 24: TypePointer UniformConstant 23 - 25(i2D): 24(ptr) Variable UniformConstant - 27: TypeVector 6(int) 2 - 34: TypeImage 12(float) 3D nonsampled format:Rgba32f - 35: TypePointer UniformConstant 34 - 36(i3D): 35(ptr) Variable UniformConstant - 41: TypeImage 12(float) Cube nonsampled format:Rgba32f - 42: TypePointer UniformConstant 41 - 43(iCube): 42(ptr) Variable UniformConstant - 51: TypeImage 12(float) Cube array nonsampled format:Rgba32f - 52: TypePointer UniformConstant 51 - 53(iCubeArray): 52(ptr) Variable UniformConstant - 58: TypeImage 12(float) Rect nonsampled format:Rgba32f - 59: TypePointer UniformConstant 58 - 60(i2DRect): 59(ptr) Variable UniformConstant - 68: TypeImage 12(float) 1D array nonsampled format:Rgba32f - 69: TypePointer UniformConstant 68 - 70(i1DArray): 69(ptr) Variable UniformConstant - 78: TypeImage 12(float) 2D array nonsampled format:Rgba32f - 79: TypePointer UniformConstant 78 - 80(i2DArray): 79(ptr) Variable UniformConstant - 85: TypeImage 12(float) Buffer nonsampled format:Rgba32f - 86: TypePointer UniformConstant 85 - 87(iBuffer): 86(ptr) Variable UniformConstant - 95: TypeImage 12(float) 2D multi-sampled nonsampled format:Rgba32f - 96: TypePointer UniformConstant 95 - 97(i2DMS): 96(ptr) Variable UniformConstant - 105: TypeImage 12(float) 2D array multi-sampled nonsampled format:Rgba32f - 106: TypePointer UniformConstant 105 - 107(i2DMSArray): 106(ptr) Variable UniformConstant - 126: TypeVector 12(float) 4 - 127: TypePointer Function 126(fvec4) - 129: 12(float) Constant 0 - 130: 126(fvec4) ConstantComposite 129 129 129 129 - 132: TypePointer UniformConstant 6(int) - 133(ic1D): 132(ptr) Variable UniformConstant - 142: TypePointer UniformConstant 27(ivec2) - 143(ic2D): 142(ptr) Variable UniformConstant - 152: TypePointer UniformConstant 7(ivec3) - 153(ic3D): 152(ptr) Variable UniformConstant - 211: 6(int) Constant 1 - 217: 6(int) Constant 2 - 221: 6(int) Constant 3 - 227: 6(int) Constant 4 - 229: TypeInt 32 0 - 230: TypePointer Function 229(int) - 232: 229(int) Constant 0 - 233: TypeImage 6(int) 1D nonsampled format:R32i - 234: TypePointer UniformConstant 233 - 235(ii1D): 234(ptr) Variable UniformConstant - 237: 6(int) Constant 10 - 238: TypePointer Image 6(int) - 240: 229(int) Constant 1 - 247: TypeImage 229(int) 2D nonsampled format:R32ui - 248: TypePointer UniformConstant 247 - 249(ui2D): 248(ptr) Variable UniformConstant - 251: TypePointer UniformConstant 229(int) - 252(value): 251(ptr) Variable UniformConstant - 254: TypePointer Image 229(int) - 260: 6(int) Constant 11 - 275: 6(int) Constant 12 - 290: 6(int) Constant 13 - 305: 6(int) Constant 14 - 320: 6(int) Constant 15 - 335: 6(int) Constant 16 - 350: 6(int) Constant 18 - 351: 6(int) Constant 17 - 360: 229(int) Constant 19 - 366: TypePointer Output 126(fvec4) - 367(fragData): 366(ptr) Variable Output - 373: TypeBool - 380: TypeVector 6(int) 4 - 381: TypePointer UniformConstant 380(ivec4) - 382(ic4D): 381(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(int) + 25: TypeImage 12(float) 2D nonsampled format:Rgba32f + 26: TypePointer UniformConstant 25 + 27(i2D): 26(ptr) Variable UniformConstant + 29: TypeVector 6(int) 2 + 36: TypeImage 12(float) 3D nonsampled format:Rgba32f + 37: TypePointer UniformConstant 36 + 38(i3D): 37(ptr) Variable UniformConstant + 43: TypeImage 12(float) Cube nonsampled format:Rgba32f + 44: TypePointer UniformConstant 43 + 45(iCube): 44(ptr) Variable UniformConstant + 53: TypeImage 12(float) Cube array nonsampled format:Rgba32f + 54: TypePointer UniformConstant 53 + 55(iCubeArray): 54(ptr) Variable UniformConstant + 60: TypeImage 12(float) Rect nonsampled format:Rgba32f + 61: TypePointer UniformConstant 60 + 62(i2DRect): 61(ptr) Variable UniformConstant + 70: TypeImage 12(float) 1D array nonsampled format:Rgba32f + 71: TypePointer UniformConstant 70 + 72(i1DArray): 71(ptr) Variable UniformConstant + 80: TypeImage 12(float) 2D array nonsampled format:Rgba32f + 81: TypePointer UniformConstant 80 + 82(i2DArray): 81(ptr) Variable UniformConstant + 87: TypeImage 12(float) Buffer nonsampled format:Rgba32f + 88: TypePointer UniformConstant 87 + 89(iBuffer): 88(ptr) Variable UniformConstant + 96: TypeImage 12(float) 2D multi-sampled nonsampled format:Rgba32f + 97: TypePointer UniformConstant 96 + 98(i2DMS): 97(ptr) Variable UniformConstant + 106: TypeImage 12(float) 2D array multi-sampled nonsampled format:Rgba32f + 107: TypePointer UniformConstant 106 + 108(i2DMSArray): 107(ptr) Variable UniformConstant + 125: TypeVector 12(float) 4 + 126: TypePointer Function 125(fvec4) + 128: 12(float) Constant 0 + 129: 125(fvec4) ConstantComposite 128 128 128 128 + 131: TypePointer UniformConstant 6(int) + 132(ic1D): 131(ptr) Variable UniformConstant + 141: TypePointer UniformConstant 29(ivec2) + 142(ic2D): 141(ptr) Variable UniformConstant + 151: TypePointer UniformConstant 7(ivec3) + 152(ic3D): 151(ptr) Variable UniformConstant + 210: 6(int) Constant 1 + 216: 6(int) Constant 2 + 220: 6(int) Constant 3 + 226: 6(int) Constant 4 + 228: TypePointer Function 18(int) + 230: TypeImage 6(int) 1D nonsampled format:R32i + 231: TypePointer UniformConstant 230 + 232(ii1D): 231(ptr) Variable UniformConstant + 234: 6(int) Constant 10 + 235: TypePointer Image 6(int) + 237: 18(int) Constant 1 + 243: TypeImage 18(int) 2D nonsampled format:R32ui + 244: TypePointer UniformConstant 243 + 245(ui2D): 244(ptr) Variable UniformConstant + 247: TypePointer UniformConstant 18(int) + 248(value): 247(ptr) Variable UniformConstant + 250: TypePointer Image 18(int) + 256: 6(int) Constant 11 + 270: 6(int) Constant 12 + 284: 6(int) Constant 13 + 298: 6(int) Constant 14 + 312: 6(int) Constant 15 + 326: 6(int) Constant 16 + 340: 6(int) Constant 18 + 341: 6(int) Constant 17 + 349: 18(int) Constant 19 + 355: TypePointer Output 125(fvec4) + 356(fragData): 355(ptr) Variable Output + 362: TypeBool + 369: TypeVector 6(int) 4 + 370: TypePointer UniformConstant 369(ivec4) + 371(ic4D): 370(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(iv): 8(ptr) Variable Function - 128(v): 127(ptr) Variable Function - 231(ui): 230(ptr) Variable Function - 368: 127(ptr) Variable Function + 127(v): 126(ptr) Variable Function + 229(ui): 228(ptr) Variable Function + 357: 126(ptr) Variable Function Store 9(iv) 11 16: 13 Load 15(i1D) 17: 6(int) ImageQuerySize 16 - 18: 7(ivec3) Load 9(iv) - 19: 6(int) CompositeExtract 18 0 - 20: 6(int) IAdd 19 17 - 21: 7(ivec3) Load 9(iv) - 22: 7(ivec3) CompositeInsert 20 21 0 - Store 9(iv) 22 - 26: 23 Load 25(i2D) - 28: 27(ivec2) ImageQuerySize 26 - 29: 7(ivec3) Load 9(iv) - 30: 27(ivec2) VectorShuffle 29 29 0 1 - 31: 27(ivec2) IAdd 30 28 - 32: 7(ivec3) Load 9(iv) - 33: 7(ivec3) VectorShuffle 32 31 3 4 2 - Store 9(iv) 33 - 37: 34 Load 36(i3D) - 38: 7(ivec3) ImageQuerySize 37 - 39: 7(ivec3) Load 9(iv) - 40: 7(ivec3) IAdd 39 38 - Store 9(iv) 40 - 44: 41 Load 43(iCube) - 45: 27(ivec2) ImageQuerySize 44 - 46: 7(ivec3) Load 9(iv) - 47: 27(ivec2) VectorShuffle 46 46 0 1 - 48: 27(ivec2) IAdd 47 45 - 49: 7(ivec3) Load 9(iv) - 50: 7(ivec3) VectorShuffle 49 48 3 4 2 - Store 9(iv) 50 - 54: 51 Load 53(iCubeArray) - 55: 7(ivec3) ImageQuerySize 54 - 56: 7(ivec3) Load 9(iv) - 57: 7(ivec3) IAdd 56 55 - Store 9(iv) 57 - 61: 58 Load 60(i2DRect) - 62: 27(ivec2) ImageQuerySize 61 - 63: 7(ivec3) Load 9(iv) - 64: 27(ivec2) VectorShuffle 63 63 0 1 - 65: 27(ivec2) IAdd 64 62 - 66: 7(ivec3) Load 9(iv) - 67: 7(ivec3) VectorShuffle 66 65 3 4 2 - Store 9(iv) 67 - 71: 68 Load 70(i1DArray) - 72: 27(ivec2) ImageQuerySize 71 - 73: 7(ivec3) Load 9(iv) - 74: 27(ivec2) VectorShuffle 73 73 0 1 - 75: 27(ivec2) IAdd 74 72 - 76: 7(ivec3) Load 9(iv) - 77: 7(ivec3) VectorShuffle 76 75 3 4 2 - Store 9(iv) 77 - 81: 78 Load 80(i2DArray) - 82: 7(ivec3) ImageQuerySize 81 - 83: 7(ivec3) Load 9(iv) - 84: 7(ivec3) IAdd 83 82 - Store 9(iv) 84 - 88: 85 Load 87(iBuffer) - 89: 6(int) ImageQuerySize 88 - 90: 7(ivec3) Load 9(iv) - 91: 6(int) CompositeExtract 90 0 - 92: 6(int) IAdd 91 89 - 93: 7(ivec3) Load 9(iv) - 94: 7(ivec3) CompositeInsert 92 93 0 - Store 9(iv) 94 - 98: 95 Load 97(i2DMS) - 99: 27(ivec2) ImageQuerySize 98 - 100: 7(ivec3) Load 9(iv) - 101: 27(ivec2) VectorShuffle 100 100 0 1 - 102: 27(ivec2) IAdd 101 99 - 103: 7(ivec3) Load 9(iv) - 104: 7(ivec3) VectorShuffle 103 102 3 4 2 - Store 9(iv) 104 - 108: 105 Load 107(i2DMSArray) - 109: 7(ivec3) ImageQuerySize 108 - 110: 7(ivec3) Load 9(iv) - 111: 7(ivec3) IAdd 110 109 - Store 9(iv) 111 - 112: 95 Load 97(i2DMS) - 113: 6(int) ImageQuerySamples 112 - 114: 7(ivec3) Load 9(iv) - 115: 6(int) CompositeExtract 114 0 - 116: 6(int) IAdd 115 113 - 117: 7(ivec3) Load 9(iv) - 118: 7(ivec3) CompositeInsert 116 117 0 - Store 9(iv) 118 - 119: 105 Load 107(i2DMSArray) + 21: 20(ptr) AccessChain 9(iv) 19 + 22: 6(int) Load 21 + 23: 6(int) IAdd 22 17 + 24: 20(ptr) AccessChain 9(iv) 19 + Store 24 23 + 28: 25 Load 27(i2D) + 30: 29(ivec2) ImageQuerySize 28 + 31: 7(ivec3) Load 9(iv) + 32: 29(ivec2) VectorShuffle 31 31 0 1 + 33: 29(ivec2) IAdd 32 30 + 34: 7(ivec3) Load 9(iv) + 35: 7(ivec3) VectorShuffle 34 33 3 4 2 + Store 9(iv) 35 + 39: 36 Load 38(i3D) + 40: 7(ivec3) ImageQuerySize 39 + 41: 7(ivec3) Load 9(iv) + 42: 7(ivec3) IAdd 41 40 + Store 9(iv) 42 + 46: 43 Load 45(iCube) + 47: 29(ivec2) ImageQuerySize 46 + 48: 7(ivec3) Load 9(iv) + 49: 29(ivec2) VectorShuffle 48 48 0 1 + 50: 29(ivec2) IAdd 49 47 + 51: 7(ivec3) Load 9(iv) + 52: 7(ivec3) VectorShuffle 51 50 3 4 2 + Store 9(iv) 52 + 56: 53 Load 55(iCubeArray) + 57: 7(ivec3) ImageQuerySize 56 + 58: 7(ivec3) Load 9(iv) + 59: 7(ivec3) IAdd 58 57 + Store 9(iv) 59 + 63: 60 Load 62(i2DRect) + 64: 29(ivec2) ImageQuerySize 63 + 65: 7(ivec3) Load 9(iv) + 66: 29(ivec2) VectorShuffle 65 65 0 1 + 67: 29(ivec2) IAdd 66 64 + 68: 7(ivec3) Load 9(iv) + 69: 7(ivec3) VectorShuffle 68 67 3 4 2 + Store 9(iv) 69 + 73: 70 Load 72(i1DArray) + 74: 29(ivec2) ImageQuerySize 73 + 75: 7(ivec3) Load 9(iv) + 76: 29(ivec2) VectorShuffle 75 75 0 1 + 77: 29(ivec2) IAdd 76 74 + 78: 7(ivec3) Load 9(iv) + 79: 7(ivec3) VectorShuffle 78 77 3 4 2 + Store 9(iv) 79 + 83: 80 Load 82(i2DArray) + 84: 7(ivec3) ImageQuerySize 83 + 85: 7(ivec3) Load 9(iv) + 86: 7(ivec3) IAdd 85 84 + Store 9(iv) 86 + 90: 87 Load 89(iBuffer) + 91: 6(int) ImageQuerySize 90 + 92: 20(ptr) AccessChain 9(iv) 19 + 93: 6(int) Load 92 + 94: 6(int) IAdd 93 91 + 95: 20(ptr) AccessChain 9(iv) 19 + Store 95 94 + 99: 96 Load 98(i2DMS) + 100: 29(ivec2) ImageQuerySize 99 + 101: 7(ivec3) Load 9(iv) + 102: 29(ivec2) VectorShuffle 101 101 0 1 + 103: 29(ivec2) IAdd 102 100 + 104: 7(ivec3) Load 9(iv) + 105: 7(ivec3) VectorShuffle 104 103 3 4 2 + Store 9(iv) 105 + 109: 106 Load 108(i2DMSArray) + 110: 7(ivec3) ImageQuerySize 109 + 111: 7(ivec3) Load 9(iv) + 112: 7(ivec3) IAdd 111 110 + Store 9(iv) 112 + 113: 96 Load 98(i2DMS) + 114: 6(int) ImageQuerySamples 113 + 115: 20(ptr) AccessChain 9(iv) 19 + 116: 6(int) Load 115 + 117: 6(int) IAdd 116 114 + 118: 20(ptr) AccessChain 9(iv) 19 + Store 118 117 + 119: 106 Load 108(i2DMSArray) 120: 6(int) ImageQuerySamples 119 - 121: 7(ivec3) Load 9(iv) - 122: 6(int) CompositeExtract 121 0 + 121: 20(ptr) AccessChain 9(iv) 19 + 122: 6(int) Load 121 123: 6(int) IAdd 122 120 - 124: 7(ivec3) Load 9(iv) - 125: 7(ivec3) CompositeInsert 123 124 0 - Store 9(iv) 125 - Store 128(v) 130 - 131: 13 Load 15(i1D) - 134: 6(int) Load 133(ic1D) - 135: 126(fvec4) ImageRead 131 134 - 136: 126(fvec4) Load 128(v) - 137: 126(fvec4) FAdd 136 135 - Store 128(v) 137 - 138: 13 Load 15(i1D) - 139: 6(int) Load 133(ic1D) - 140: 126(fvec4) Load 128(v) - ImageWrite 138 139 140 - 141: 23 Load 25(i2D) - 144: 27(ivec2) Load 143(ic2D) - 145: 126(fvec4) ImageRead 141 144 - 146: 126(fvec4) Load 128(v) - 147: 126(fvec4) FAdd 146 145 - Store 128(v) 147 - 148: 23 Load 25(i2D) - 149: 27(ivec2) Load 143(ic2D) - 150: 126(fvec4) Load 128(v) - ImageWrite 148 149 150 - 151: 34 Load 36(i3D) - 154: 7(ivec3) Load 153(ic3D) - 155: 126(fvec4) ImageRead 151 154 - 156: 126(fvec4) Load 128(v) - 157: 126(fvec4) FAdd 156 155 - Store 128(v) 157 - 158: 34 Load 36(i3D) - 159: 7(ivec3) Load 153(ic3D) - 160: 126(fvec4) Load 128(v) - ImageWrite 158 159 160 - 161: 41 Load 43(iCube) - 162: 7(ivec3) Load 153(ic3D) - 163: 126(fvec4) ImageRead 161 162 - 164: 126(fvec4) Load 128(v) - 165: 126(fvec4) FAdd 164 163 - Store 128(v) 165 - 166: 41 Load 43(iCube) - 167: 7(ivec3) Load 153(ic3D) - 168: 126(fvec4) Load 128(v) - ImageWrite 166 167 168 - 169: 51 Load 53(iCubeArray) - 170: 7(ivec3) Load 153(ic3D) - 171: 126(fvec4) ImageRead 169 170 - 172: 126(fvec4) Load 128(v) - 173: 126(fvec4) FAdd 172 171 - Store 128(v) 173 - 174: 51 Load 53(iCubeArray) - 175: 7(ivec3) Load 153(ic3D) - 176: 126(fvec4) Load 128(v) - ImageWrite 174 175 176 - 177: 58 Load 60(i2DRect) - 178: 27(ivec2) Load 143(ic2D) - 179: 126(fvec4) ImageRead 177 178 - 180: 126(fvec4) Load 128(v) - 181: 126(fvec4) FAdd 180 179 - Store 128(v) 181 - 182: 58 Load 60(i2DRect) - 183: 27(ivec2) Load 143(ic2D) - 184: 126(fvec4) Load 128(v) - ImageWrite 182 183 184 - 185: 68 Load 70(i1DArray) - 186: 27(ivec2) Load 143(ic2D) - 187: 126(fvec4) ImageRead 185 186 - 188: 126(fvec4) Load 128(v) - 189: 126(fvec4) FAdd 188 187 - Store 128(v) 189 - 190: 68 Load 70(i1DArray) - 191: 27(ivec2) Load 143(ic2D) - 192: 126(fvec4) Load 128(v) - ImageWrite 190 191 192 - 193: 78 Load 80(i2DArray) - 194: 7(ivec3) Load 153(ic3D) - 195: 126(fvec4) ImageRead 193 194 - 196: 126(fvec4) Load 128(v) - 197: 126(fvec4) FAdd 196 195 - Store 128(v) 197 - 198: 78 Load 80(i2DArray) - 199: 7(ivec3) Load 153(ic3D) - 200: 126(fvec4) Load 128(v) - ImageWrite 198 199 200 - 201: 85 Load 87(iBuffer) - 202: 6(int) Load 133(ic1D) - 203: 126(fvec4) ImageRead 201 202 - 204: 126(fvec4) Load 128(v) - 205: 126(fvec4) FAdd 204 203 - Store 128(v) 205 - 206: 85 Load 87(iBuffer) - 207: 6(int) Load 133(ic1D) - 208: 126(fvec4) Load 128(v) - ImageWrite 206 207 208 - 209: 95 Load 97(i2DMS) - 210: 27(ivec2) Load 143(ic2D) - 212: 126(fvec4) ImageRead 209 210 - 213: 126(fvec4) Load 128(v) - 214: 126(fvec4) FAdd 213 212 - Store 128(v) 214 - 215: 95 Load 97(i2DMS) - 216: 27(ivec2) Load 143(ic2D) - 218: 126(fvec4) Load 128(v) - ImageWrite 215 216 217 - 219: 105 Load 107(i2DMSArray) - 220: 7(ivec3) Load 153(ic3D) - 222: 126(fvec4) ImageRead 219 220 - 223: 126(fvec4) Load 128(v) - 224: 126(fvec4) FAdd 223 222 - Store 128(v) 224 - 225: 105 Load 107(i2DMSArray) - 226: 7(ivec3) Load 153(ic3D) - 228: 126(fvec4) Load 128(v) - ImageWrite 225 226 227 - Store 231(ui) 232 - 236: 6(int) Load 133(ic1D) - 239: 238(ptr) ImageTexelPointer 235(ii1D) 236 0 - 241: 6(int) AtomicIAdd 239 240 232 237 - 242: 7(ivec3) Load 9(iv) - 243: 6(int) CompositeExtract 242 0 - 244: 6(int) IAdd 243 241 - 245: 7(ivec3) Load 9(iv) - 246: 7(ivec3) CompositeInsert 244 245 0 - Store 9(iv) 246 - 250: 27(ivec2) Load 143(ic2D) - 253: 229(int) Load 252(value) - 255: 254(ptr) ImageTexelPointer 249(ui2D) 250 0 - 256: 229(int) AtomicIAdd 255 240 232 253 - 257: 229(int) Load 231(ui) - 258: 229(int) IAdd 257 256 - Store 231(ui) 258 - 259: 6(int) Load 133(ic1D) - 261: 238(ptr) ImageTexelPointer 235(ii1D) 259 0 - 262: 6(int) AtomicSMin 261 240 232 260 - 263: 7(ivec3) Load 9(iv) - 264: 6(int) CompositeExtract 263 0 - 265: 6(int) IAdd 264 262 - 266: 7(ivec3) Load 9(iv) - 267: 7(ivec3) CompositeInsert 265 266 0 - Store 9(iv) 267 - 268: 27(ivec2) Load 143(ic2D) - 269: 229(int) Load 252(value) - 270: 254(ptr) ImageTexelPointer 249(ui2D) 268 0 - 271: 229(int) AtomicUMin 270 240 232 269 - 272: 229(int) Load 231(ui) - 273: 229(int) IAdd 272 271 - Store 231(ui) 273 - 274: 6(int) Load 133(ic1D) - 276: 238(ptr) ImageTexelPointer 235(ii1D) 274 0 - 277: 6(int) AtomicSMax 276 240 232 275 - 278: 7(ivec3) Load 9(iv) - 279: 6(int) CompositeExtract 278 0 - 280: 6(int) IAdd 279 277 - 281: 7(ivec3) Load 9(iv) - 282: 7(ivec3) CompositeInsert 280 281 0 - Store 9(iv) 282 - 283: 27(ivec2) Load 143(ic2D) - 284: 229(int) Load 252(value) - 285: 254(ptr) ImageTexelPointer 249(ui2D) 283 0 - 286: 229(int) AtomicUMax 285 240 232 284 - 287: 229(int) Load 231(ui) - 288: 229(int) IAdd 287 286 - Store 231(ui) 288 - 289: 6(int) Load 133(ic1D) - 291: 238(ptr) ImageTexelPointer 235(ii1D) 289 0 - 292: 6(int) AtomicAnd 291 240 232 290 - 293: 7(ivec3) Load 9(iv) - 294: 6(int) CompositeExtract 293 0 - 295: 6(int) IAdd 294 292 - 296: 7(ivec3) Load 9(iv) - 297: 7(ivec3) CompositeInsert 295 296 0 - Store 9(iv) 297 - 298: 27(ivec2) Load 143(ic2D) - 299: 229(int) Load 252(value) - 300: 254(ptr) ImageTexelPointer 249(ui2D) 298 0 - 301: 229(int) AtomicAnd 300 240 232 299 - 302: 229(int) Load 231(ui) - 303: 229(int) IAdd 302 301 - Store 231(ui) 303 - 304: 6(int) Load 133(ic1D) - 306: 238(ptr) ImageTexelPointer 235(ii1D) 304 0 - 307: 6(int) AtomicOr 306 240 232 305 - 308: 7(ivec3) Load 9(iv) - 309: 6(int) CompositeExtract 308 0 - 310: 6(int) IAdd 309 307 - 311: 7(ivec3) Load 9(iv) - 312: 7(ivec3) CompositeInsert 310 311 0 - Store 9(iv) 312 - 313: 27(ivec2) Load 143(ic2D) - 314: 229(int) Load 252(value) - 315: 254(ptr) ImageTexelPointer 249(ui2D) 313 0 - 316: 229(int) AtomicOr 315 240 232 314 - 317: 229(int) Load 231(ui) - 318: 229(int) IAdd 317 316 - Store 231(ui) 318 - 319: 6(int) Load 133(ic1D) - 321: 238(ptr) ImageTexelPointer 235(ii1D) 319 0 - 322: 6(int) AtomicXor 321 240 232 320 - 323: 7(ivec3) Load 9(iv) - 324: 6(int) CompositeExtract 323 0 - 325: 6(int) IAdd 324 322 - 326: 7(ivec3) Load 9(iv) - 327: 7(ivec3) CompositeInsert 325 326 0 - Store 9(iv) 327 - 328: 27(ivec2) Load 143(ic2D) - 329: 229(int) Load 252(value) - 330: 254(ptr) ImageTexelPointer 249(ui2D) 328 0 - 331: 229(int) AtomicXor 330 240 232 329 - 332: 229(int) Load 231(ui) - 333: 229(int) IAdd 332 331 - Store 231(ui) 333 - 334: 6(int) Load 133(ic1D) - 336: 238(ptr) ImageTexelPointer 235(ii1D) 334 0 - 337: 6(int) AtomicExchange 336 240 232 335 - 338: 7(ivec3) Load 9(iv) - 339: 6(int) CompositeExtract 338 0 - 340: 6(int) IAdd 339 337 - 341: 7(ivec3) Load 9(iv) - 342: 7(ivec3) CompositeInsert 340 341 0 - Store 9(iv) 342 - 343: 27(ivec2) Load 143(ic2D) - 344: 229(int) Load 252(value) - 345: 254(ptr) ImageTexelPointer 249(ui2D) 343 0 - 346: 229(int) AtomicExchange 345 240 232 344 - 347: 229(int) Load 231(ui) - 348: 229(int) IAdd 347 346 - Store 231(ui) 348 - 349: 6(int) Load 133(ic1D) - 352: 238(ptr) ImageTexelPointer 235(ii1D) 349 0 - 353: 6(int) AtomicCompareExchange 352 240 232 232 351 350 - 354: 7(ivec3) Load 9(iv) - 355: 6(int) CompositeExtract 354 0 - 356: 6(int) IAdd 355 353 - 357: 7(ivec3) Load 9(iv) - 358: 7(ivec3) CompositeInsert 356 357 0 - Store 9(iv) 358 - 359: 27(ivec2) Load 143(ic2D) - 361: 229(int) Load 252(value) - 362: 254(ptr) ImageTexelPointer 249(ui2D) 359 0 - 363: 229(int) AtomicCompareExchange 362 240 232 232 361 360 - 364: 229(int) Load 231(ui) - 365: 229(int) IAdd 364 363 - Store 231(ui) 365 - 369: 229(int) Load 231(ui) - 370: 7(ivec3) Load 9(iv) - 371: 6(int) CompositeExtract 370 1 - 372: 229(int) Bitcast 371 - 374: 373(bool) INotEqual 369 372 - SelectionMerge 376 None - BranchConditional 374 375 378 - 375: Label - 377: 126(fvec4) Load 128(v) - Store 368 377 - Branch 376 - 378: Label - Store 368 130 - Branch 376 - 376: Label - 379: 126(fvec4) Load 368 - Store 367(fragData) 379 + 124: 20(ptr) AccessChain 9(iv) 19 + Store 124 123 + Store 127(v) 129 + 130: 13 Load 15(i1D) + 133: 6(int) Load 132(ic1D) + 134: 125(fvec4) ImageRead 130 133 + 135: 125(fvec4) Load 127(v) + 136: 125(fvec4) FAdd 135 134 + Store 127(v) 136 + 137: 13 Load 15(i1D) + 138: 6(int) Load 132(ic1D) + 139: 125(fvec4) Load 127(v) + ImageWrite 137 138 139 + 140: 25 Load 27(i2D) + 143: 29(ivec2) Load 142(ic2D) + 144: 125(fvec4) ImageRead 140 143 + 145: 125(fvec4) Load 127(v) + 146: 125(fvec4) FAdd 145 144 + Store 127(v) 146 + 147: 25 Load 27(i2D) + 148: 29(ivec2) Load 142(ic2D) + 149: 125(fvec4) Load 127(v) + ImageWrite 147 148 149 + 150: 36 Load 38(i3D) + 153: 7(ivec3) Load 152(ic3D) + 154: 125(fvec4) ImageRead 150 153 + 155: 125(fvec4) Load 127(v) + 156: 125(fvec4) FAdd 155 154 + Store 127(v) 156 + 157: 36 Load 38(i3D) + 158: 7(ivec3) Load 152(ic3D) + 159: 125(fvec4) Load 127(v) + ImageWrite 157 158 159 + 160: 43 Load 45(iCube) + 161: 7(ivec3) Load 152(ic3D) + 162: 125(fvec4) ImageRead 160 161 + 163: 125(fvec4) Load 127(v) + 164: 125(fvec4) FAdd 163 162 + Store 127(v) 164 + 165: 43 Load 45(iCube) + 166: 7(ivec3) Load 152(ic3D) + 167: 125(fvec4) Load 127(v) + ImageWrite 165 166 167 + 168: 53 Load 55(iCubeArray) + 169: 7(ivec3) Load 152(ic3D) + 170: 125(fvec4) ImageRead 168 169 + 171: 125(fvec4) Load 127(v) + 172: 125(fvec4) FAdd 171 170 + Store 127(v) 172 + 173: 53 Load 55(iCubeArray) + 174: 7(ivec3) Load 152(ic3D) + 175: 125(fvec4) Load 127(v) + ImageWrite 173 174 175 + 176: 60 Load 62(i2DRect) + 177: 29(ivec2) Load 142(ic2D) + 178: 125(fvec4) ImageRead 176 177 + 179: 125(fvec4) Load 127(v) + 180: 125(fvec4) FAdd 179 178 + Store 127(v) 180 + 181: 60 Load 62(i2DRect) + 182: 29(ivec2) Load 142(ic2D) + 183: 125(fvec4) Load 127(v) + ImageWrite 181 182 183 + 184: 70 Load 72(i1DArray) + 185: 29(ivec2) Load 142(ic2D) + 186: 125(fvec4) ImageRead 184 185 + 187: 125(fvec4) Load 127(v) + 188: 125(fvec4) FAdd 187 186 + Store 127(v) 188 + 189: 70 Load 72(i1DArray) + 190: 29(ivec2) Load 142(ic2D) + 191: 125(fvec4) Load 127(v) + ImageWrite 189 190 191 + 192: 80 Load 82(i2DArray) + 193: 7(ivec3) Load 152(ic3D) + 194: 125(fvec4) ImageRead 192 193 + 195: 125(fvec4) Load 127(v) + 196: 125(fvec4) FAdd 195 194 + Store 127(v) 196 + 197: 80 Load 82(i2DArray) + 198: 7(ivec3) Load 152(ic3D) + 199: 125(fvec4) Load 127(v) + ImageWrite 197 198 199 + 200: 87 Load 89(iBuffer) + 201: 6(int) Load 132(ic1D) + 202: 125(fvec4) ImageRead 200 201 + 203: 125(fvec4) Load 127(v) + 204: 125(fvec4) FAdd 203 202 + Store 127(v) 204 + 205: 87 Load 89(iBuffer) + 206: 6(int) Load 132(ic1D) + 207: 125(fvec4) Load 127(v) + ImageWrite 205 206 207 + 208: 96 Load 98(i2DMS) + 209: 29(ivec2) Load 142(ic2D) + 211: 125(fvec4) ImageRead 208 209 Sample 210 + 212: 125(fvec4) Load 127(v) + 213: 125(fvec4) FAdd 212 211 + Store 127(v) 213 + 214: 96 Load 98(i2DMS) + 215: 29(ivec2) Load 142(ic2D) + 217: 125(fvec4) Load 127(v) + ImageWrite 214 215 216 + 218: 106 Load 108(i2DMSArray) + 219: 7(ivec3) Load 152(ic3D) + 221: 125(fvec4) ImageRead 218 219 Sample 220 + 222: 125(fvec4) Load 127(v) + 223: 125(fvec4) FAdd 222 221 + Store 127(v) 223 + 224: 106 Load 108(i2DMSArray) + 225: 7(ivec3) Load 152(ic3D) + 227: 125(fvec4) Load 127(v) + ImageWrite 224 225 226 + Store 229(ui) 19 + 233: 6(int) Load 132(ic1D) + 236: 235(ptr) ImageTexelPointer 232(ii1D) 233 0 + 238: 6(int) AtomicIAdd 236 237 19 234 + 239: 20(ptr) AccessChain 9(iv) 19 + 240: 6(int) Load 239 + 241: 6(int) IAdd 240 238 + 242: 20(ptr) AccessChain 9(iv) 19 + Store 242 241 + 246: 29(ivec2) Load 142(ic2D) + 249: 18(int) Load 248(value) + 251: 250(ptr) ImageTexelPointer 245(ui2D) 246 0 + 252: 18(int) AtomicIAdd 251 237 19 249 + 253: 18(int) Load 229(ui) + 254: 18(int) IAdd 253 252 + Store 229(ui) 254 + 255: 6(int) Load 132(ic1D) + 257: 235(ptr) ImageTexelPointer 232(ii1D) 255 0 + 258: 6(int) AtomicSMin 257 237 19 256 + 259: 20(ptr) AccessChain 9(iv) 19 + 260: 6(int) Load 259 + 261: 6(int) IAdd 260 258 + 262: 20(ptr) AccessChain 9(iv) 19 + Store 262 261 + 263: 29(ivec2) Load 142(ic2D) + 264: 18(int) Load 248(value) + 265: 250(ptr) ImageTexelPointer 245(ui2D) 263 0 + 266: 18(int) AtomicUMin 265 237 19 264 + 267: 18(int) Load 229(ui) + 268: 18(int) IAdd 267 266 + Store 229(ui) 268 + 269: 6(int) Load 132(ic1D) + 271: 235(ptr) ImageTexelPointer 232(ii1D) 269 0 + 272: 6(int) AtomicSMax 271 237 19 270 + 273: 20(ptr) AccessChain 9(iv) 19 + 274: 6(int) Load 273 + 275: 6(int) IAdd 274 272 + 276: 20(ptr) AccessChain 9(iv) 19 + Store 276 275 + 277: 29(ivec2) Load 142(ic2D) + 278: 18(int) Load 248(value) + 279: 250(ptr) ImageTexelPointer 245(ui2D) 277 0 + 280: 18(int) AtomicUMax 279 237 19 278 + 281: 18(int) Load 229(ui) + 282: 18(int) IAdd 281 280 + Store 229(ui) 282 + 283: 6(int) Load 132(ic1D) + 285: 235(ptr) ImageTexelPointer 232(ii1D) 283 0 + 286: 6(int) AtomicAnd 285 237 19 284 + 287: 20(ptr) AccessChain 9(iv) 19 + 288: 6(int) Load 287 + 289: 6(int) IAdd 288 286 + 290: 20(ptr) AccessChain 9(iv) 19 + Store 290 289 + 291: 29(ivec2) Load 142(ic2D) + 292: 18(int) Load 248(value) + 293: 250(ptr) ImageTexelPointer 245(ui2D) 291 0 + 294: 18(int) AtomicAnd 293 237 19 292 + 295: 18(int) Load 229(ui) + 296: 18(int) IAdd 295 294 + Store 229(ui) 296 + 297: 6(int) Load 132(ic1D) + 299: 235(ptr) ImageTexelPointer 232(ii1D) 297 0 + 300: 6(int) AtomicOr 299 237 19 298 + 301: 20(ptr) AccessChain 9(iv) 19 + 302: 6(int) Load 301 + 303: 6(int) IAdd 302 300 + 304: 20(ptr) AccessChain 9(iv) 19 + Store 304 303 + 305: 29(ivec2) Load 142(ic2D) + 306: 18(int) Load 248(value) + 307: 250(ptr) ImageTexelPointer 245(ui2D) 305 0 + 308: 18(int) AtomicOr 307 237 19 306 + 309: 18(int) Load 229(ui) + 310: 18(int) IAdd 309 308 + Store 229(ui) 310 + 311: 6(int) Load 132(ic1D) + 313: 235(ptr) ImageTexelPointer 232(ii1D) 311 0 + 314: 6(int) AtomicXor 313 237 19 312 + 315: 20(ptr) AccessChain 9(iv) 19 + 316: 6(int) Load 315 + 317: 6(int) IAdd 316 314 + 318: 20(ptr) AccessChain 9(iv) 19 + Store 318 317 + 319: 29(ivec2) Load 142(ic2D) + 320: 18(int) Load 248(value) + 321: 250(ptr) ImageTexelPointer 245(ui2D) 319 0 + 322: 18(int) AtomicXor 321 237 19 320 + 323: 18(int) Load 229(ui) + 324: 18(int) IAdd 323 322 + Store 229(ui) 324 + 325: 6(int) Load 132(ic1D) + 327: 235(ptr) ImageTexelPointer 232(ii1D) 325 0 + 328: 6(int) AtomicExchange 327 237 19 326 + 329: 20(ptr) AccessChain 9(iv) 19 + 330: 6(int) Load 329 + 331: 6(int) IAdd 330 328 + 332: 20(ptr) AccessChain 9(iv) 19 + Store 332 331 + 333: 29(ivec2) Load 142(ic2D) + 334: 18(int) Load 248(value) + 335: 250(ptr) ImageTexelPointer 245(ui2D) 333 0 + 336: 18(int) AtomicExchange 335 237 19 334 + 337: 18(int) Load 229(ui) + 338: 18(int) IAdd 337 336 + Store 229(ui) 338 + 339: 6(int) Load 132(ic1D) + 342: 235(ptr) ImageTexelPointer 232(ii1D) 339 0 + 343: 6(int) AtomicCompareExchange 342 237 19 19 341 340 + 344: 20(ptr) AccessChain 9(iv) 19 + 345: 6(int) Load 344 + 346: 6(int) IAdd 345 343 + 347: 20(ptr) AccessChain 9(iv) 19 + Store 347 346 + 348: 29(ivec2) Load 142(ic2D) + 350: 18(int) Load 248(value) + 351: 250(ptr) ImageTexelPointer 245(ui2D) 348 0 + 352: 18(int) AtomicCompareExchange 351 237 19 19 350 349 + 353: 18(int) Load 229(ui) + 354: 18(int) IAdd 353 352 + Store 229(ui) 354 + 358: 18(int) Load 229(ui) + 359: 20(ptr) AccessChain 9(iv) 237 + 360: 6(int) Load 359 + 361: 18(int) Bitcast 360 + 363: 362(bool) INotEqual 358 361 + SelectionMerge 365 None + BranchConditional 363 364 367 + 364: Label + 366: 125(fvec4) Load 127(v) + Store 357 366 + Branch 365 + 367: Label + Store 357 129 + Branch 365 + 365: Label + 368: 125(fvec4) Load 357 + Store 356(fragData) 368 Return FunctionEnd diff --git a/Test/baseResults/spv.length.frag.out b/Test/baseResults/spv.length.frag.out index 4db21728..af6d3fe7 100755 --- a/Test/baseResults/spv.length.frag.out +++ b/Test/baseResults/spv.length.frag.out @@ -3,24 +3,21 @@ spv.length.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 33 - Source GLSL 120 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 14 ExecutionMode 4 OriginLowerLeft + Source GLSL 120 Name 4 "main" Name 9 "t" Name 14 "v" Name 26 "gl_FragColor" Name 32 "u" - Decorate 14(v) Smooth - Decorate 26(gl_FragColor) BuiltIn FragColor - Decorate 32(u) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index 6be94571..721b5a8c 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -6,16 +6,16 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 134 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 136 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 40 96 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "s1" MemberName 8(s1) 0 "i" @@ -34,24 +34,18 @@ Linked fragment stage: Name 15 "foo3" Name 36 "localFArray" Name 40 "coord" - Name 47 "localIArray" - Name 66 "x" - Name 68 "localArray" - Name 73 "i" - Name 80 "a" - Name 86 "condition" - Name 94 "color" - Name 104 "gl_FragColor" - Name 124 "sampler" - Name 130 "foo" - Name 131 "foo2" - Name 133 "uFloatArray" - Decorate 40(coord) Smooth - Decorate 94(color) Smooth - Decorate 104(gl_FragColor) BuiltIn FragColor - Decorate 130(foo) NoStaticUse - Decorate 131(foo2) NoStaticUse - Decorate 133(uFloatArray) NoStaticUse + Name 49 "localIArray" + Name 68 "x" + Name 70 "localArray" + Name 75 "i" + Name 82 "a" + Name 88 "condition" + Name 96 "color" + Name 106 "gl_FragColor" + Name 126 "samp2D" + Name 132 "foo" + Name 133 "foo2" + Name 135 "uFloatArray" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -79,38 +73,42 @@ Linked fragment stage: 38: TypeVector 7(float) 2 39: TypePointer Input 38(fvec2) 40(coord): 39(ptr) Variable Input - 44: 32(int) Constant 8 - 45: TypeArray 6(int) 44 - 46: TypePointer Function 45 - 50: TypePointer Function 6(int) - 67: 6(int) Constant 5 - 78: 6(int) Constant 16 - 82: 7(float) Constant 0 - 86(condition): 20(ptr) Variable UniformConstant - 92: 6(int) Constant 3 - 93: TypePointer Input 9(fvec4) - 94(color): 93(ptr) Variable Input - 96: TypePointer Function 9(fvec4) - 103: TypePointer Output 9(fvec4) -104(gl_FragColor): 103(ptr) Variable Output - 121: TypeImage 7(float) 2D sampled format:Unknown - 122: TypeSampledImage 121 - 123: TypePointer UniformConstant 122 - 124(sampler): 123(ptr) Variable UniformConstant - 129: TypePointer UniformConstant 8(s1) - 130(foo): 129(ptr) Variable UniformConstant - 131(foo2): 17(ptr) Variable UniformConstant - 132: TypePointer UniformConstant 34 -133(uFloatArray): 132(ptr) Variable UniformConstant + 41: 32(int) Constant 0 + 42: TypePointer Input 7(float) + 46: 32(int) Constant 8 + 47: TypeArray 6(int) 46 + 48: TypePointer Function 47 + 52: TypePointer Function 6(int) + 69: 6(int) Constant 5 + 80: 6(int) Constant 16 + 84: 7(float) Constant 0 + 88(condition): 20(ptr) Variable UniformConstant + 94: 6(int) Constant 3 + 95: TypePointer Input 9(fvec4) + 96(color): 95(ptr) Variable Input + 98: TypePointer Function 9(fvec4) + 100: 32(int) Constant 1 + 103: 32(int) Constant 2 + 105: TypePointer Output 9(fvec4) +106(gl_FragColor): 105(ptr) Variable Output + 123: TypeImage 7(float) 2D sampled format:Unknown + 124: TypeSampledImage 123 + 125: TypePointer UniformConstant 124 + 126(samp2D): 125(ptr) Variable UniformConstant + 131: TypePointer UniformConstant 8(s1) + 132(foo): 131(ptr) Variable UniformConstant + 133(foo2): 17(ptr) Variable UniformConstant + 134: TypePointer UniformConstant 34 +135(uFloatArray): 134(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 12(locals2): 11(ptr) Variable Function 36(localFArray): 35(ptr) Variable Function - 47(localIArray): 46(ptr) Variable Function - 66(x): 50(ptr) Variable Function - 68(localArray): 35(ptr) Variable Function - 73(i): 50(ptr) Variable Function - 80(a): 35(ptr) Variable Function + 49(localIArray): 48(ptr) Variable Function + 68(x): 52(ptr) Variable Function + 70(localArray): 35(ptr) Variable Function + 75(i): 52(ptr) Variable Function + 82(a): 35(ptr) Variable Function 18: 17(ptr) AccessChain 15(foo3) 16 19: 10(s2) Load 18 Store 12(locals2) 19 @@ -118,102 +116,100 @@ Linked fragment stage: 22: 6(int) Load 21 24: 23(bool) SGreaterThan 22 16 SelectionMerge 26 None - BranchConditional 24 25 52 + BranchConditional 24 25 54 25: Label 31: 30(ptr) AccessChain 12(locals2) 27 28 Store 31 29 - 41: 38(fvec2) Load 40(coord) - 42: 7(float) CompositeExtract 41 0 - 43: 30(ptr) AccessChain 36(localFArray) 37 - Store 43 42 - 48: 20(ptr) AccessChain 15(foo3) 16 16 - 49: 6(int) Load 48 - 51: 50(ptr) AccessChain 47(localIArray) 27 - Store 51 49 + 43: 42(ptr) AccessChain 40(coord) 41 + 44: 7(float) Load 43 + 45: 30(ptr) AccessChain 36(localFArray) 37 + Store 45 44 + 50: 20(ptr) AccessChain 15(foo3) 16 16 + 51: 6(int) Load 50 + 53: 52(ptr) AccessChain 49(localIArray) 27 + Store 53 51 Branch 26 - 52: Label - 53: 38(fvec2) Load 40(coord) - 54: 7(float) CompositeExtract 53 0 - 55: 30(ptr) AccessChain 12(locals2) 27 28 - Store 55 54 - 56: 30(ptr) AccessChain 36(localFArray) 37 - Store 56 29 - 57: 50(ptr) AccessChain 47(localIArray) 27 - Store 57 16 + 54: Label + 55: 42(ptr) AccessChain 40(coord) 41 + 56: 7(float) Load 55 + 57: 30(ptr) AccessChain 12(locals2) 27 28 + Store 57 56 + 58: 30(ptr) AccessChain 36(localFArray) 37 + Store 58 29 + 59: 52(ptr) AccessChain 49(localIArray) 27 + Store 59 16 Branch 26 26: Label - 58: 50(ptr) AccessChain 47(localIArray) 27 - 59: 6(int) Load 58 - 60: 23(bool) IEqual 59 16 - SelectionMerge 62 None - BranchConditional 60 61 62 - 61: Label - 63: 30(ptr) AccessChain 36(localFArray) 37 - 64: 7(float) Load 63 - 65: 7(float) FAdd 64 29 - Store 63 65 - Branch 62 - 62: Label - Store 66(x) 67 - 69: 6(int) Load 66(x) - 70: 38(fvec2) Load 40(coord) - 71: 7(float) CompositeExtract 70 0 - 72: 30(ptr) AccessChain 68(localArray) 69 - Store 72 71 - Store 73(i) 16 - Branch 74 - 74: Label - 77: 6(int) Load 73(i) - 79: 23(bool) SLessThan 77 78 - LoopMerge 75 None - BranchConditional 79 76 75 - 76: Label - 81: 6(int) Load 73(i) - 83: 30(ptr) AccessChain 80(a) 81 - Store 83 82 - 84: 6(int) Load 73(i) - 85: 6(int) IAdd 84 28 - Store 73(i) 85 - Branch 74 - 75: Label - 87: 6(int) Load 86(condition) - 88: 23(bool) IEqual 87 28 - SelectionMerge 90 None - BranchConditional 88 89 90 - 89: Label - 91: 34 Load 68(localArray) - Store 80(a) 91 - Branch 90 - 90: Label - 95: 9(fvec4) Load 94(color) - 97: 96(ptr) AccessChain 12(locals2) 92 - Store 97 95 - 98: 38(fvec2) Load 40(coord) - 99: 7(float) CompositeExtract 98 1 - 100: 96(ptr) AccessChain 12(locals2) 92 - 101: 9(fvec4) Load 100 - 102: 9(fvec4) CompositeInsert 99 101 2 - Store 100 102 - 105: 96(ptr) AccessChain 12(locals2) 92 - 106: 9(fvec4) Load 105 - 107: 30(ptr) AccessChain 36(localFArray) 37 - 108: 7(float) Load 107 - 109: 30(ptr) AccessChain 12(locals2) 27 28 + 60: 52(ptr) AccessChain 49(localIArray) 27 + 61: 6(int) Load 60 + 62: 23(bool) IEqual 61 16 + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 65: 30(ptr) AccessChain 36(localFArray) 37 + 66: 7(float) Load 65 + 67: 7(float) FAdd 66 29 + Store 65 67 + Branch 64 + 64: Label + Store 68(x) 69 + 71: 6(int) Load 68(x) + 72: 42(ptr) AccessChain 40(coord) 41 + 73: 7(float) Load 72 + 74: 30(ptr) AccessChain 70(localArray) 71 + Store 74 73 + Store 75(i) 16 + Branch 76 + 76: Label + 79: 6(int) Load 75(i) + 81: 23(bool) SLessThan 79 80 + LoopMerge 77 76 None + BranchConditional 81 78 77 + 78: Label + 83: 6(int) Load 75(i) + 85: 30(ptr) AccessChain 82(a) 83 + Store 85 84 + 86: 6(int) Load 75(i) + 87: 6(int) IAdd 86 28 + Store 75(i) 87 + Branch 76 + 77: Label + 89: 6(int) Load 88(condition) + 90: 23(bool) IEqual 89 28 + SelectionMerge 92 None + BranchConditional 90 91 92 + 91: Label + 93: 34 Load 70(localArray) + Store 82(a) 93 + Branch 92 + 92: Label + 97: 9(fvec4) Load 96(color) + 99: 98(ptr) AccessChain 12(locals2) 94 + Store 99 97 + 101: 42(ptr) AccessChain 40(coord) 100 + 102: 7(float) Load 101 + 104: 30(ptr) AccessChain 12(locals2) 94 103 + Store 104 102 + 107: 98(ptr) AccessChain 12(locals2) 94 + 108: 9(fvec4) Load 107 + 109: 30(ptr) AccessChain 36(localFArray) 37 110: 7(float) Load 109 - 111: 7(float) FAdd 108 110 - 112: 6(int) Load 66(x) - 113: 30(ptr) AccessChain 68(localArray) 112 - 114: 7(float) Load 113 - 115: 7(float) FAdd 111 114 - 116: 6(int) Load 66(x) - 117: 30(ptr) AccessChain 80(a) 116 - 118: 7(float) Load 117 - 119: 7(float) FAdd 115 118 - 120: 9(fvec4) VectorTimesScalar 106 119 - 125: 122 Load 124(sampler) - 126: 38(fvec2) Load 40(coord) - 127: 9(fvec4) ImageSampleImplicitLod 125 126 - 128: 9(fvec4) FMul 120 127 - Store 104(gl_FragColor) 128 + 111: 30(ptr) AccessChain 12(locals2) 27 28 + 112: 7(float) Load 111 + 113: 7(float) FAdd 110 112 + 114: 6(int) Load 68(x) + 115: 30(ptr) AccessChain 70(localArray) 114 + 116: 7(float) Load 115 + 117: 7(float) FAdd 113 116 + 118: 6(int) Load 68(x) + 119: 30(ptr) AccessChain 82(a) 118 + 120: 7(float) Load 119 + 121: 7(float) FAdd 117 120 + 122: 9(fvec4) VectorTimesScalar 108 121 + 127: 124 Load 126(samp2D) + 128: 38(fvec2) Load 40(coord) + 129: 9(fvec4) ImageSampleImplicitLod 127 128 + 130: 9(fvec4) FMul 122 129 + Store 106(gl_FragColor) 130 Return FunctionEnd diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index f2d2fea5..5602e080 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -5,91 +5,72 @@ WARNING: 0:14: varying deprecated in version 130; may be removed in future relea Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 753 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 718 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 47 "d" - Name 51 "bigColor" - Name 62 "bigColor1_1" - Name 92 "d2" - Name 99 "d3" - Name 103 "bigColor1_2" - Name 114 "bigColor1_3" - Name 120 "d4" - Name 131 "i" - Name 138 "Count" - Name 141 "bigColor2" - Name 159 "bigColor3" - Name 164 "i" - Name 179 "i" - Name 217 "i" - Name 242 "i" - Name 270 "i" - Name 307 "bigColor4" - Name 345 "d5" - Name 349 "bigColor5" - Name 367 "d6" - Name 379 "bigColor6" - Name 414 "d7" - Name 448 "bigColor7" - Name 473 "d8" - Name 519 "d9" - Name 551 "d10" - Name 561 "d11" - Name 573 "d12" - Name 601 "bigColor8" - Name 629 "gl_FragColor" - Name 636 "d14" - Name 641 "d15" - Name 659 "d16" - Name 699 "d17" - Name 705 "d18" - Name 736 "d13" - Name 737 "d19" - Name 738 "d20" - Name 739 "d21" - Name 740 "d22" - Name 741 "d23" - Name 742 "d24" - Name 743 "d25" - Name 744 "d26" - Name 745 "d27" - Name 746 "d28" - Name 747 "d29" - Name 748 "d30" - Name 749 "d31" - Name 750 "d32" - Name 751 "d33" - Name 752 "d34" - Decorate 11(BaseColor) Smooth - Decorate 629(gl_FragColor) BuiltIn FragColor - Decorate 736(d13) NoStaticUse - Decorate 737(d19) NoStaticUse - Decorate 738(d20) NoStaticUse - Decorate 739(d21) NoStaticUse - Decorate 740(d22) NoStaticUse - Decorate 741(d23) NoStaticUse - Decorate 742(d24) NoStaticUse - Decorate 743(d25) NoStaticUse - Decorate 744(d26) NoStaticUse - Decorate 745(d27) NoStaticUse - Decorate 746(d28) NoStaticUse - Decorate 747(d29) NoStaticUse - Decorate 748(d30) NoStaticUse - Decorate 749(d31) NoStaticUse - Decorate 750(d32) NoStaticUse - Decorate 751(d33) NoStaticUse - Decorate 752(d34) NoStaticUse + Name 50 "d" + Name 54 "bigColor" + Name 66 "bigColor1_1" + Name 97 "d2" + Name 105 "d3" + Name 109 "bigColor1_2" + Name 120 "bigColor1_3" + Name 126 "d4" + Name 137 "i" + Name 144 "Count" + Name 147 "bigColor2" + Name 165 "bigColor3" + Name 170 "i" + Name 184 "i" + Name 218 "i" + Name 239 "i" + Name 264 "i" + Name 298 "bigColor4" + Name 334 "d5" + Name 338 "bigColor5" + Name 355 "d6" + Name 367 "bigColor6" + Name 401 "d7" + Name 434 "bigColor7" + Name 457 "d8" + Name 497 "d9" + Name 527 "d10" + Name 535 "d11" + Name 545 "d12" + Name 569 "bigColor8" + Name 596 "gl_FragColor" + Name 603 "d14" + Name 608 "d15" + Name 626 "d16" + Name 664 "d17" + Name 670 "d18" + Name 701 "d13" + Name 702 "d19" + Name 703 "d20" + Name 704 "d21" + Name 705 "d22" + Name 706 "d23" + Name 707 "d24" + Name 708 "d25" + Name 709 "d26" + Name 710 "d27" + Name 711 "d28" + Name 712 "d29" + Name 713 "d30" + Name 714 "d31" + Name 715 "d32" + Name 716 "d33" + Name 717 "d34" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -99,1054 +80,1019 @@ Linked fragment stage: 11(BaseColor): 10(ptr) Variable Input 16: TypeBool 17: 16(bool) ConstantTrue - 20: 6(float) Constant 1051260355 - 24: 7(fvec4) ConstantComposite 20 20 20 20 - 30: 6(float) Constant 1059648963 - 34: 7(fvec4) ConstantComposite 30 30 30 30 - 46: TypePointer UniformConstant 6(float) - 47(d): 46(ptr) Variable UniformConstant - 50: TypePointer UniformConstant 7(fvec4) - 51(bigColor): 50(ptr) Variable UniformConstant - 62(bigColor1_1): 50(ptr) Variable UniformConstant - 81: 6(float) Constant 1109917696 - 84: 6(float) Constant 1065353216 - 92(d2): 46(ptr) Variable UniformConstant - 99(d3): 46(ptr) Variable UniformConstant -103(bigColor1_2): 50(ptr) Variable UniformConstant -114(bigColor1_3): 50(ptr) Variable UniformConstant - 120(d4): 46(ptr) Variable UniformConstant - 129: TypeInt 32 1 - 130: TypePointer Function 129(int) - 132: 129(int) Constant 0 - 137: TypePointer UniformConstant 129(int) - 138(Count): 137(ptr) Variable UniformConstant - 141(bigColor2): 50(ptr) Variable UniformConstant - 146: 129(int) Constant 1 - 159(bigColor3): 50(ptr) Variable UniformConstant - 163: 16(bool) ConstantFalse - 169: 129(int) Constant 42 - 184: 129(int) Constant 100 - 188: 6(float) Constant 1101004800 - 222: 129(int) Constant 120 - 307(bigColor4): 50(ptr) Variable UniformConstant - 345(d5): 46(ptr) Variable UniformConstant - 349(bigColor5): 50(ptr) Variable UniformConstant - 367(d6): 46(ptr) Variable UniformConstant - 379(bigColor6): 50(ptr) Variable UniformConstant - 414(d7): 46(ptr) Variable UniformConstant - 443: 6(float) Constant 0 - 448(bigColor7): 50(ptr) Variable UniformConstant - 473(d8): 46(ptr) Variable UniformConstant - 495: 6(float) Constant 1073741824 - 519(d9): 46(ptr) Variable UniformConstant - 535: 6(float) Constant 1084227584 - 551(d10): 46(ptr) Variable UniformConstant - 561(d11): 46(ptr) Variable UniformConstant - 573(d12): 46(ptr) Variable UniformConstant - 599: 6(float) Constant 1092616192 - 601(bigColor8): 50(ptr) Variable UniformConstant - 628: TypePointer Output 7(fvec4) -629(gl_FragColor): 628(ptr) Variable Output - 636(d14): 46(ptr) Variable UniformConstant - 641(d15): 46(ptr) Variable UniformConstant - 659(d16): 46(ptr) Variable UniformConstant - 699(d17): 46(ptr) Variable UniformConstant - 705(d18): 46(ptr) Variable UniformConstant - 736(d13): 46(ptr) Variable UniformConstant - 737(d19): 46(ptr) Variable UniformConstant - 738(d20): 46(ptr) Variable UniformConstant - 739(d21): 46(ptr) Variable UniformConstant - 740(d22): 46(ptr) Variable UniformConstant - 741(d23): 46(ptr) Variable UniformConstant - 742(d24): 46(ptr) Variable UniformConstant - 743(d25): 46(ptr) Variable UniformConstant - 744(d26): 46(ptr) Variable UniformConstant - 745(d27): 46(ptr) Variable UniformConstant - 746(d28): 46(ptr) Variable UniformConstant - 747(d29): 46(ptr) Variable UniformConstant - 748(d30): 46(ptr) Variable UniformConstant - 749(d31): 46(ptr) Variable UniformConstant - 750(d32): 46(ptr) Variable UniformConstant - 751(d33): 46(ptr) Variable UniformConstant - 752(d34): 46(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(float) + 23: 6(float) Constant 1051260355 + 27: 7(fvec4) ConstantComposite 23 23 23 23 + 33: 6(float) Constant 1059648963 + 37: 7(fvec4) ConstantComposite 33 33 33 33 + 49: TypePointer UniformConstant 6(float) + 50(d): 49(ptr) Variable UniformConstant + 53: TypePointer UniformConstant 7(fvec4) + 54(bigColor): 53(ptr) Variable UniformConstant + 61: 18(int) Constant 2 + 66(bigColor1_1): 53(ptr) Variable UniformConstant + 70: 18(int) Constant 3 + 86: 6(float) Constant 1109917696 + 89: 6(float) Constant 1065353216 + 97(d2): 49(ptr) Variable UniformConstant + 102: 18(int) Constant 1 + 105(d3): 49(ptr) Variable UniformConstant +109(bigColor1_2): 53(ptr) Variable UniformConstant +120(bigColor1_3): 53(ptr) Variable UniformConstant + 126(d4): 49(ptr) Variable UniformConstant + 135: TypeInt 32 1 + 136: TypePointer Function 135(int) + 138: 135(int) Constant 0 + 143: TypePointer UniformConstant 135(int) + 144(Count): 143(ptr) Variable UniformConstant + 147(bigColor2): 53(ptr) Variable UniformConstant + 152: 135(int) Constant 1 + 165(bigColor3): 53(ptr) Variable UniformConstant + 169: 16(bool) ConstantFalse + 175: 135(int) Constant 42 + 189: 135(int) Constant 100 + 193: 6(float) Constant 1101004800 + 223: 135(int) Constant 120 + 298(bigColor4): 53(ptr) Variable UniformConstant + 334(d5): 49(ptr) Variable UniformConstant + 338(bigColor5): 53(ptr) Variable UniformConstant + 355(d6): 49(ptr) Variable UniformConstant + 367(bigColor6): 53(ptr) Variable UniformConstant + 401(d7): 49(ptr) Variable UniformConstant + 429: 6(float) Constant 0 + 434(bigColor7): 53(ptr) Variable UniformConstant + 457(d8): 49(ptr) Variable UniformConstant + 477: 6(float) Constant 1073741824 + 497(d9): 49(ptr) Variable UniformConstant + 513: 6(float) Constant 1084227584 + 527(d10): 49(ptr) Variable UniformConstant + 535(d11): 49(ptr) Variable UniformConstant + 545(d12): 49(ptr) Variable UniformConstant + 567: 6(float) Constant 1092616192 + 569(bigColor8): 53(ptr) Variable UniformConstant + 595: TypePointer Output 7(fvec4) +596(gl_FragColor): 595(ptr) Variable Output + 603(d14): 49(ptr) Variable UniformConstant + 608(d15): 49(ptr) Variable UniformConstant + 626(d16): 49(ptr) Variable UniformConstant + 664(d17): 49(ptr) Variable UniformConstant + 670(d18): 49(ptr) Variable UniformConstant + 701(d13): 49(ptr) Variable UniformConstant + 702(d19): 49(ptr) Variable UniformConstant + 703(d20): 49(ptr) Variable UniformConstant + 704(d21): 49(ptr) Variable UniformConstant + 705(d22): 49(ptr) Variable UniformConstant + 706(d23): 49(ptr) Variable UniformConstant + 707(d24): 49(ptr) Variable UniformConstant + 708(d25): 49(ptr) Variable UniformConstant + 709(d26): 49(ptr) Variable UniformConstant + 710(d27): 49(ptr) Variable UniformConstant + 711(d28): 49(ptr) Variable UniformConstant + 712(d29): 49(ptr) Variable UniformConstant + 713(d30): 49(ptr) Variable UniformConstant + 714(d31): 49(ptr) Variable UniformConstant + 715(d32): 49(ptr) Variable UniformConstant + 716(d33): 49(ptr) Variable UniformConstant + 717(d34): 49(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function - 131(i): 130(ptr) Variable Function - 164(i): 130(ptr) Variable Function - 179(i): 130(ptr) Variable Function - 217(i): 130(ptr) Variable Function - 242(i): 130(ptr) Variable Function - 270(i): 130(ptr) Variable Function + 137(i): 136(ptr) Variable Function + 170(i): 136(ptr) Variable Function + 184(i): 136(ptr) Variable Function + 218(i): 136(ptr) Variable Function + 239(i): 136(ptr) Variable Function + 264(i): 136(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Branch 13 13: Label - LoopMerge 14 None + LoopMerge 14 13 None BranchConditional 17 15 14 15: Label - 18: 7(fvec4) Load 9(color) - 19: 6(float) CompositeExtract 18 0 - 21: 16(bool) FOrdLessThan 19 20 - SelectionMerge 23 None - BranchConditional 21 22 23 - 22: Label - 25: 7(fvec4) Load 9(color) - 26: 7(fvec4) FAdd 25 24 - Store 9(color) 26 + 21: 20(ptr) AccessChain 9(color) 19 + 22: 6(float) Load 21 + 24: 16(bool) FOrdLessThan 22 23 + SelectionMerge 26 None + BranchConditional 24 25 26 + 25: Label + 28: 7(fvec4) Load 9(color) + 29: 7(fvec4) FAdd 28 27 + Store 9(color) 29 Branch 14 - 23: Label - 28: 7(fvec4) Load 9(color) - 29: 6(float) CompositeExtract 28 0 - 31: 16(bool) FOrdLessThan 29 30 - SelectionMerge 33 None - BranchConditional 31 32 33 - 32: Label - 35: 7(fvec4) Load 9(color) - 36: 7(fvec4) FAdd 35 34 - Store 9(color) 36 + 26: Label + 31: 20(ptr) AccessChain 9(color) 19 + 32: 6(float) Load 31 + 34: 16(bool) FOrdLessThan 32 33 + SelectionMerge 36 None + BranchConditional 34 35 36 + 35: Label + 38: 7(fvec4) Load 9(color) + 39: 7(fvec4) FAdd 38 37 + Store 9(color) 39 Branch 14 - 33: Label - 38: 7(fvec4) Load 9(color) - 39: 7(fvec4) FAdd 38 24 - Store 9(color) 39 + 36: Label + 41: 7(fvec4) Load 9(color) + 42: 7(fvec4) FAdd 41 27 + Store 9(color) 42 Branch 14 14: Label - Branch 41 - 41: Label - 44: 7(fvec4) Load 9(color) - 45: 6(float) CompositeExtract 44 0 - 48: 6(float) Load 47(d) - 49: 16(bool) FOrdLessThan 45 48 - LoopMerge 42 None - BranchConditional 49 43 42 - 43: Label - 52: 7(fvec4) Load 51(bigColor) - 53: 7(fvec4) Load 9(color) - 54: 7(fvec4) FAdd 53 52 - Store 9(color) 54 - Branch 41 - 42: Label - Branch 55 - 55: Label - 58: 7(fvec4) Load 9(color) - 59: 6(float) CompositeExtract 58 2 - 60: 6(float) Load 47(d) - 61: 16(bool) FOrdLessThan 59 60 - LoopMerge 56 None - BranchConditional 61 57 56 - 57: Label - 63: 7(fvec4) Load 62(bigColor1_1) - 64: 7(fvec4) Load 9(color) - 65: 7(fvec4) FAdd 64 63 - Store 9(color) 65 - 66: 7(fvec4) Load 9(color) - 67: 6(float) CompositeExtract 66 3 - 68: 6(float) Load 47(d) - 69: 16(bool) FOrdLessThan 67 68 - SelectionMerge 71 None - BranchConditional 69 70 71 - 70: Label - Branch 55 - 71: Label - 73: 7(fvec4) Load 62(bigColor1_1) - 74: 7(fvec4) Load 9(color) - 75: 7(fvec4) FAdd 74 73 - Store 9(color) 75 - Branch 55 - 56: Label - Branch 76 - 76: Label - 79: 7(fvec4) Load 9(color) - 80: 6(float) CompositeExtract 79 0 - 82: 16(bool) FOrdLessThan 80 81 - LoopMerge 77 None - BranchConditional 82 78 77 - 78: Label - 83: 7(fvec4) Load 9(color) - 85: 7(fvec4) CompositeConstruct 84 84 84 84 - 86: 7(fvec4) FAdd 83 85 - Store 9(color) 86 - Branch 76 - 77: Label - Branch 87 - 87: Label - 90: 7(fvec4) Load 9(color) - 91: 6(float) CompositeExtract 90 3 - 93: 6(float) Load 92(d2) - 94: 16(bool) FOrdLessThan 91 93 - SelectionMerge 96 None - BranchConditional 94 95 96 - 95: Label - 97: 7(fvec4) Load 9(color) - 98: 6(float) CompositeExtract 97 1 - 100: 6(float) Load 99(d3) - 101: 16(bool) FOrdLessThan 98 100 - Branch 96 - 96: Label - 102: 16(bool) Phi 94 87 101 95 - LoopMerge 88 None - BranchConditional 102 89 88 - 89: Label - 104: 7(fvec4) Load 103(bigColor1_2) - 105: 7(fvec4) Load 9(color) - 106: 7(fvec4) FAdd 105 104 - Store 9(color) 106 - Branch 87 - 88: Label - Branch 107 - 107: Label - 110: 7(fvec4) Load 9(color) - 111: 6(float) CompositeExtract 110 2 - 112: 6(float) Load 99(d3) - 113: 16(bool) FOrdLessThan 111 112 - LoopMerge 108 None - BranchConditional 113 109 108 - 109: Label - 115: 7(fvec4) Load 114(bigColor1_3) - 116: 7(fvec4) Load 9(color) - 117: 7(fvec4) FAdd 116 115 - Store 9(color) 117 - 118: 7(fvec4) Load 9(color) - 119: 6(float) CompositeExtract 118 1 - 121: 6(float) Load 120(d4) - 122: 16(bool) FOrdLessThan 119 121 - SelectionMerge 124 None - BranchConditional 122 123 124 - 123: Label - Branch 108 - 124: Label - 126: 7(fvec4) Load 114(bigColor1_3) - 127: 7(fvec4) Load 9(color) - 128: 7(fvec4) FAdd 127 126 - Store 9(color) 128 - Branch 107 - 108: Label - Store 131(i) 132 - Branch 133 - 133: Label - 136: 129(int) Load 131(i) - 139: 129(int) Load 138(Count) - 140: 16(bool) SLessThan 136 139 - LoopMerge 134 None - BranchConditional 140 135 134 - 135: Label - 142: 7(fvec4) Load 141(bigColor2) - 143: 7(fvec4) Load 9(color) - 144: 7(fvec4) FAdd 143 142 - Store 9(color) 144 - 145: 129(int) Load 131(i) - 147: 129(int) IAdd 145 146 - Store 131(i) 147 - Branch 133 - 134: Label - Branch 148 - 148: Label - 151: 16(bool) Phi 17 134 163 150 - LoopMerge 149 None - Branch 152 - 152: Label - SelectionMerge 150 None - BranchConditional 151 150 153 - 153: Label - 154: 7(fvec4) Load 9(color) - 155: 6(float) CompositeExtract 154 0 - 156: 6(float) Load 92(d2) - 157: 16(bool) FOrdLessThan 155 156 - SelectionMerge 158 None - BranchConditional 157 158 149 - 158: Label - Branch 150 - 150: Label - 160: 7(fvec4) Load 159(bigColor3) - 161: 7(fvec4) Load 9(color) - 162: 7(fvec4) FAdd 161 160 - Store 9(color) 162 - Branch 148 - 149: Label - Store 164(i) 132 - Branch 165 - 165: Label - 168: 129(int) Load 164(i) - 170: 16(bool) SLessThan 168 169 - LoopMerge 166 None - BranchConditional 170 167 166 - 167: Label - 171: 6(float) Load 99(d3) - 172: 7(fvec4) Load 9(color) - 173: 6(float) CompositeExtract 172 2 - 174: 6(float) FAdd 173 171 - 175: 7(fvec4) Load 9(color) - 176: 7(fvec4) CompositeInsert 174 175 2 - Store 9(color) 176 - 177: 129(int) Load 164(i) - 178: 129(int) IAdd 177 146 - Store 164(i) 178 - Branch 165 - 166: Label - Store 179(i) 132 - Branch 180 - 180: Label - 183: 129(int) Load 179(i) - 185: 16(bool) SLessThan 183 184 - LoopMerge 181 None - BranchConditional 185 182 181 - 182: Label - 186: 7(fvec4) Load 9(color) - 187: 6(float) CompositeExtract 186 2 - 189: 16(bool) FOrdLessThan 187 188 - SelectionMerge 191 None - BranchConditional 189 190 197 - 190: Label - 192: 7(fvec4) Load 9(color) - 193: 6(float) CompositeExtract 192 0 - 194: 6(float) FAdd 193 84 - 195: 7(fvec4) Load 9(color) - 196: 7(fvec4) CompositeInsert 194 195 0 - Store 9(color) 196 - Branch 191 - 197: Label - 198: 7(fvec4) Load 9(color) - 199: 6(float) CompositeExtract 198 1 - 200: 6(float) FAdd 199 84 - 201: 7(fvec4) Load 9(color) - 202: 7(fvec4) CompositeInsert 200 201 1 - Store 9(color) 202 - Branch 191 - 191: Label - 203: 7(fvec4) Load 9(color) - 204: 6(float) CompositeExtract 203 3 - 205: 16(bool) FOrdLessThan 204 188 - SelectionMerge 207 None - BranchConditional 205 206 207 - 206: Label - 208: 7(fvec4) Load 9(color) - 209: 6(float) CompositeExtract 208 2 - 210: 7(fvec4) Load 9(color) - 211: 6(float) CompositeExtract 210 1 - 212: 16(bool) FOrdGreaterThan 209 211 - SelectionMerge 214 None - BranchConditional 212 213 214 - 213: Label - Branch 214 - 214: Label - Branch 207 - 207: Label - 215: 129(int) Load 179(i) - 216: 129(int) IAdd 215 146 - Store 179(i) 216 - Branch 180 - 181: Label - Store 217(i) 132 - Branch 218 - 218: Label - 221: 129(int) Load 217(i) - 223: 16(bool) SLessThan 221 222 - LoopMerge 219 None - BranchConditional 223 220 219 - 220: Label - 224: 7(fvec4) Load 9(color) - 225: 6(float) CompositeExtract 224 2 - 226: 16(bool) FOrdLessThan 225 188 - SelectionMerge 228 None - BranchConditional 226 227 234 - 227: Label - 229: 7(fvec4) Load 9(color) - 230: 6(float) CompositeExtract 229 0 - 231: 6(float) FAdd 230 84 - 232: 7(fvec4) Load 9(color) - 233: 7(fvec4) CompositeInsert 231 232 0 - Store 9(color) 233 - Branch 228 - 234: Label - 235: 7(fvec4) Load 9(color) - 236: 6(float) CompositeExtract 235 1 - 237: 6(float) FAdd 236 84 - 238: 7(fvec4) Load 9(color) - 239: 7(fvec4) CompositeInsert 237 238 1 - Store 9(color) 239 - Branch 228 - 228: Label - 240: 129(int) Load 217(i) - 241: 129(int) IAdd 240 146 - Store 217(i) 241 - Branch 218 + Branch 44 + 44: Label + 47: 20(ptr) AccessChain 9(color) 19 + 48: 6(float) Load 47 + 51: 6(float) Load 50(d) + 52: 16(bool) FOrdLessThan 48 51 + LoopMerge 45 44 None + BranchConditional 52 46 45 + 46: Label + 55: 7(fvec4) Load 54(bigColor) + 56: 7(fvec4) Load 9(color) + 57: 7(fvec4) FAdd 56 55 + Store 9(color) 57 + Branch 44 + 45: Label + Branch 58 + 58: Label + 62: 20(ptr) AccessChain 9(color) 61 + 63: 6(float) Load 62 + 64: 6(float) Load 50(d) + 65: 16(bool) FOrdLessThan 63 64 + LoopMerge 59 58 None + BranchConditional 65 60 59 + 60: Label + 67: 7(fvec4) Load 66(bigColor1_1) + 68: 7(fvec4) Load 9(color) + 69: 7(fvec4) FAdd 68 67 + Store 9(color) 69 + 71: 20(ptr) AccessChain 9(color) 70 + 72: 6(float) Load 71 + 73: 6(float) Load 50(d) + 74: 16(bool) FOrdLessThan 72 73 + SelectionMerge 76 None + BranchConditional 74 75 76 + 75: Label + Branch 58 + 76: Label + 78: 7(fvec4) Load 66(bigColor1_1) + 79: 7(fvec4) Load 9(color) + 80: 7(fvec4) FAdd 79 78 + Store 9(color) 80 + Branch 58 + 59: Label + Branch 81 + 81: Label + 84: 20(ptr) AccessChain 9(color) 19 + 85: 6(float) Load 84 + 87: 16(bool) FOrdLessThan 85 86 + LoopMerge 82 81 None + BranchConditional 87 83 82 + 83: Label + 88: 7(fvec4) Load 9(color) + 90: 7(fvec4) CompositeConstruct 89 89 89 89 + 91: 7(fvec4) FAdd 88 90 + Store 9(color) 91 + Branch 81 + 82: Label + Branch 92 + 92: Label + 95: 20(ptr) AccessChain 9(color) 70 + 96: 6(float) Load 95 + 98: 6(float) Load 97(d2) + 99: 16(bool) FOrdLessThan 96 98 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 103: 20(ptr) AccessChain 9(color) 102 + 104: 6(float) Load 103 + 106: 6(float) Load 105(d3) + 107: 16(bool) FOrdLessThan 104 106 + Branch 101 + 101: Label + 108: 16(bool) Phi 99 92 107 100 + LoopMerge 93 92 None + BranchConditional 108 94 93 + 94: Label + 110: 7(fvec4) Load 109(bigColor1_2) + 111: 7(fvec4) Load 9(color) + 112: 7(fvec4) FAdd 111 110 + Store 9(color) 112 + Branch 92 + 93: Label + Branch 113 + 113: Label + 116: 20(ptr) AccessChain 9(color) 61 + 117: 6(float) Load 116 + 118: 6(float) Load 105(d3) + 119: 16(bool) FOrdLessThan 117 118 + LoopMerge 114 113 None + BranchConditional 119 115 114 + 115: Label + 121: 7(fvec4) Load 120(bigColor1_3) + 122: 7(fvec4) Load 9(color) + 123: 7(fvec4) FAdd 122 121 + Store 9(color) 123 + 124: 20(ptr) AccessChain 9(color) 102 + 125: 6(float) Load 124 + 127: 6(float) Load 126(d4) + 128: 16(bool) FOrdLessThan 125 127 + SelectionMerge 130 None + BranchConditional 128 129 130 + 129: Label + Branch 114 + 130: Label + 132: 7(fvec4) Load 120(bigColor1_3) + 133: 7(fvec4) Load 9(color) + 134: 7(fvec4) FAdd 133 132 + Store 9(color) 134 + Branch 113 + 114: Label + Store 137(i) 138 + Branch 139 + 139: Label + 142: 135(int) Load 137(i) + 145: 135(int) Load 144(Count) + 146: 16(bool) SLessThan 142 145 + LoopMerge 140 139 None + BranchConditional 146 141 140 + 141: Label + 148: 7(fvec4) Load 147(bigColor2) + 149: 7(fvec4) Load 9(color) + 150: 7(fvec4) FAdd 149 148 + Store 9(color) 150 + 151: 135(int) Load 137(i) + 153: 135(int) IAdd 151 152 + Store 137(i) 153 + Branch 139 + 140: Label + Branch 154 + 154: Label + 157: 16(bool) Phi 17 140 169 156 + LoopMerge 155 154 None + Branch 158 + 158: Label + SelectionMerge 156 None + BranchConditional 157 156 159 + 159: Label + 160: 20(ptr) AccessChain 9(color) 19 + 161: 6(float) Load 160 + 162: 6(float) Load 97(d2) + 163: 16(bool) FOrdLessThan 161 162 + SelectionMerge 164 None + BranchConditional 163 164 155 + 164: Label + Branch 156 + 156: Label + 166: 7(fvec4) Load 165(bigColor3) + 167: 7(fvec4) Load 9(color) + 168: 7(fvec4) FAdd 167 166 + Store 9(color) 168 + Branch 154 + 155: Label + Store 170(i) 138 + Branch 171 + 171: Label + 174: 135(int) Load 170(i) + 176: 16(bool) SLessThan 174 175 + LoopMerge 172 171 None + BranchConditional 176 173 172 + 173: Label + 177: 6(float) Load 105(d3) + 178: 20(ptr) AccessChain 9(color) 61 + 179: 6(float) Load 178 + 180: 6(float) FAdd 179 177 + 181: 20(ptr) AccessChain 9(color) 61 + Store 181 180 + 182: 135(int) Load 170(i) + 183: 135(int) IAdd 182 152 + Store 170(i) 183 + Branch 171 + 172: Label + Store 184(i) 138 + Branch 185 + 185: Label + 188: 135(int) Load 184(i) + 190: 16(bool) SLessThan 188 189 + LoopMerge 186 185 None + BranchConditional 190 187 186 + 187: Label + 191: 20(ptr) AccessChain 9(color) 61 + 192: 6(float) Load 191 + 194: 16(bool) FOrdLessThan 192 193 + SelectionMerge 196 None + BranchConditional 194 195 200 + 195: Label + 197: 20(ptr) AccessChain 9(color) 19 + 198: 6(float) Load 197 + 199: 6(float) FAdd 198 89 + Store 197 199 + Branch 196 + 200: Label + 201: 20(ptr) AccessChain 9(color) 102 + 202: 6(float) Load 201 + 203: 6(float) FAdd 202 89 + Store 201 203 + Branch 196 + 196: Label + 204: 20(ptr) AccessChain 9(color) 70 + 205: 6(float) Load 204 + 206: 16(bool) FOrdLessThan 205 193 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 209: 20(ptr) AccessChain 9(color) 61 + 210: 6(float) Load 209 + 211: 20(ptr) AccessChain 9(color) 102 + 212: 6(float) Load 211 + 213: 16(bool) FOrdGreaterThan 210 212 + SelectionMerge 215 None + BranchConditional 213 214 215 + 214: Label + Branch 215 + 215: Label + Branch 208 + 208: Label + 216: 135(int) Load 184(i) + 217: 135(int) IAdd 216 152 + Store 184(i) 217 + Branch 185 + 186: Label + Store 218(i) 138 + Branch 219 219: Label - Store 242(i) 132 - Branch 243 - 243: Label - 246: 129(int) Load 242(i) - 247: 16(bool) SLessThan 246 169 - LoopMerge 244 None - BranchConditional 247 245 244 - 245: Label - 248: 6(float) Load 99(d3) - 249: 7(fvec4) Load 9(color) - 250: 6(float) CompositeExtract 249 2 - 251: 6(float) FAdd 250 248 - 252: 7(fvec4) Load 9(color) - 253: 7(fvec4) CompositeInsert 251 252 2 - Store 9(color) 253 - 254: 7(fvec4) Load 9(color) - 255: 6(float) CompositeExtract 254 0 - 256: 6(float) Load 120(d4) - 257: 16(bool) FOrdLessThan 255 256 - SelectionMerge 259 None - BranchConditional 257 258 259 - 258: Label - 260: 129(int) Load 242(i) - 261: 129(int) IAdd 260 146 - Store 242(i) 261 - Branch 243 - 259: Label - 263: 7(fvec4) Load 9(color) - 264: 6(float) CompositeExtract 263 3 - 265: 6(float) FAdd 264 84 - 266: 7(fvec4) Load 9(color) - 267: 7(fvec4) CompositeInsert 265 266 3 - Store 9(color) 267 - 268: 129(int) Load 242(i) - 269: 129(int) IAdd 268 146 - Store 242(i) 269 - Branch 243 - 244: Label - Store 270(i) 132 - Branch 271 - 271: Label - 274: 129(int) Load 270(i) - 275: 16(bool) SLessThan 274 169 - LoopMerge 272 None - BranchConditional 275 273 272 - 273: Label - 276: 6(float) Load 99(d3) - 277: 7(fvec4) Load 9(color) - 278: 6(float) CompositeExtract 277 2 - 279: 6(float) FAdd 278 276 - 280: 7(fvec4) Load 9(color) - 281: 7(fvec4) CompositeInsert 279 280 2 - Store 9(color) 281 - 282: 7(fvec4) Load 9(color) - 283: 6(float) CompositeExtract 282 0 - 284: 6(float) Load 120(d4) - 285: 16(bool) FOrdLessThan 283 284 - SelectionMerge 287 None - BranchConditional 285 286 287 - 286: Label - Branch 272 - 287: Label - 289: 7(fvec4) Load 9(color) - 290: 6(float) CompositeExtract 289 3 - 291: 6(float) FAdd 290 84 - 292: 7(fvec4) Load 9(color) - 293: 7(fvec4) CompositeInsert 291 292 3 - Store 9(color) 293 - 294: 129(int) Load 270(i) - 295: 129(int) IAdd 294 146 - Store 270(i) 295 - Branch 271 - 272: Label - Branch 296 - 296: Label - 299: 16(bool) Phi 17 272 163 315 163 323 - LoopMerge 297 None - Branch 300 - 300: Label - SelectionMerge 298 None - BranchConditional 299 298 301 - 301: Label - 302: 7(fvec4) Load 9(color) - 303: 6(float) CompositeExtract 302 2 - 304: 6(float) Load 120(d4) - 305: 16(bool) FOrdLessThan 303 304 - SelectionMerge 306 None - BranchConditional 305 306 297 + 222: 135(int) Load 218(i) + 224: 16(bool) SLessThan 222 223 + LoopMerge 220 219 None + BranchConditional 224 221 220 + 221: Label + 225: 20(ptr) AccessChain 9(color) 61 + 226: 6(float) Load 225 + 227: 16(bool) FOrdLessThan 226 193 + SelectionMerge 229 None + BranchConditional 227 228 233 + 228: Label + 230: 20(ptr) AccessChain 9(color) 19 + 231: 6(float) Load 230 + 232: 6(float) FAdd 231 89 + Store 230 232 + Branch 229 + 233: Label + 234: 20(ptr) AccessChain 9(color) 102 + 235: 6(float) Load 234 + 236: 6(float) FAdd 235 89 + Store 234 236 + Branch 229 + 229: Label + 237: 135(int) Load 218(i) + 238: 135(int) IAdd 237 152 + Store 218(i) 238 + Branch 219 + 220: Label + Store 239(i) 138 + Branch 240 + 240: Label + 243: 135(int) Load 239(i) + 244: 16(bool) SLessThan 243 175 + LoopMerge 241 240 None + BranchConditional 244 242 241 + 242: Label + 245: 6(float) Load 105(d3) + 246: 20(ptr) AccessChain 9(color) 61 + 247: 6(float) Load 246 + 248: 6(float) FAdd 247 245 + 249: 20(ptr) AccessChain 9(color) 61 + Store 249 248 + 250: 20(ptr) AccessChain 9(color) 19 + 251: 6(float) Load 250 + 252: 6(float) Load 126(d4) + 253: 16(bool) FOrdLessThan 251 252 + SelectionMerge 255 None + BranchConditional 253 254 255 + 254: Label + 256: 135(int) Load 239(i) + 257: 135(int) IAdd 256 152 + Store 239(i) 257 + Branch 240 + 255: Label + 259: 20(ptr) AccessChain 9(color) 70 + 260: 6(float) Load 259 + 261: 6(float) FAdd 260 89 + Store 259 261 + 262: 135(int) Load 239(i) + 263: 135(int) IAdd 262 152 + Store 239(i) 263 + Branch 240 + 241: Label + Store 264(i) 138 + Branch 265 + 265: Label + 268: 135(int) Load 264(i) + 269: 16(bool) SLessThan 268 175 + LoopMerge 266 265 None + BranchConditional 269 267 266 + 267: Label + 270: 6(float) Load 105(d3) + 271: 20(ptr) AccessChain 9(color) 61 + 272: 6(float) Load 271 + 273: 6(float) FAdd 272 270 + 274: 20(ptr) AccessChain 9(color) 61 + Store 274 273 + 275: 20(ptr) AccessChain 9(color) 19 + 276: 6(float) Load 275 + 277: 6(float) Load 126(d4) + 278: 16(bool) FOrdLessThan 276 277 + SelectionMerge 280 None + BranchConditional 278 279 280 + 279: Label + Branch 266 + 280: Label + 282: 20(ptr) AccessChain 9(color) 70 + 283: 6(float) Load 282 + 284: 6(float) FAdd 283 89 + Store 282 284 + 285: 135(int) Load 264(i) + 286: 135(int) IAdd 285 152 + Store 264(i) 286 + Branch 265 + 266: Label + Branch 287 + 287: Label + 290: 16(bool) Phi 17 266 169 306 169 314 + LoopMerge 288 287 None + Branch 291 + 291: Label + SelectionMerge 289 None + BranchConditional 290 289 292 + 292: Label + 293: 20(ptr) AccessChain 9(color) 61 + 294: 6(float) Load 293 + 295: 6(float) Load 126(d4) + 296: 16(bool) FOrdLessThan 294 295 + SelectionMerge 297 None + BranchConditional 296 297 288 + 297: Label + Branch 289 + 289: Label + 299: 7(fvec4) Load 298(bigColor4) + 300: 7(fvec4) Load 9(color) + 301: 7(fvec4) FAdd 300 299 + Store 9(color) 301 + 302: 20(ptr) AccessChain 9(color) 19 + 303: 6(float) Load 302 + 304: 6(float) Load 126(d4) + 305: 16(bool) FOrdLessThan 303 304 + SelectionMerge 307 None + BranchConditional 305 306 307 306: Label - Branch 298 - 298: Label - 308: 7(fvec4) Load 307(bigColor4) - 309: 7(fvec4) Load 9(color) - 310: 7(fvec4) FAdd 309 308 - Store 9(color) 310 - 311: 7(fvec4) Load 9(color) - 312: 6(float) CompositeExtract 311 0 - 313: 6(float) Load 120(d4) - 314: 16(bool) FOrdLessThan 312 313 - SelectionMerge 316 None - BranchConditional 314 315 316 - 315: Label - Branch 296 - 316: Label - 318: 7(fvec4) Load 9(color) - 319: 6(float) CompositeExtract 318 1 - 320: 6(float) Load 120(d4) - 321: 16(bool) FOrdLessThan 319 320 - SelectionMerge 323 None - BranchConditional 321 322 330 - 322: Label - 324: 6(float) Load 120(d4) - 325: 7(fvec4) Load 9(color) - 326: 6(float) CompositeExtract 325 1 - 327: 6(float) FAdd 326 324 - 328: 7(fvec4) Load 9(color) - 329: 7(fvec4) CompositeInsert 327 328 1 - Store 9(color) 329 - Branch 323 - 330: Label - 331: 6(float) Load 120(d4) - 332: 7(fvec4) Load 9(color) - 333: 6(float) CompositeExtract 332 0 - 334: 6(float) FAdd 333 331 - 335: 7(fvec4) Load 9(color) - 336: 7(fvec4) CompositeInsert 334 335 0 - Store 9(color) 336 - Branch 323 - 323: Label - Branch 296 - 297: Label - Branch 337 - 337: Label - 340: 16(bool) Phi 17 297 163 358 - LoopMerge 338 None - Branch 341 - 341: Label - SelectionMerge 339 None - BranchConditional 340 339 342 - 342: Label - 343: 7(fvec4) Load 9(color) - 344: 6(float) CompositeExtract 343 0 - 346: 6(float) Load 345(d5) - 347: 16(bool) FOrdLessThan 344 346 - SelectionMerge 348 None - BranchConditional 347 348 338 - 348: Label - Branch 339 - 339: Label - 350: 7(fvec4) Load 349(bigColor5) - 351: 7(fvec4) Load 9(color) - 352: 7(fvec4) FAdd 351 350 - Store 9(color) 352 - 353: 7(fvec4) Load 9(color) - 354: 6(float) CompositeExtract 353 1 - 355: 6(float) Load 345(d5) - 356: 16(bool) FOrdLessThan 354 355 - SelectionMerge 358 None - BranchConditional 356 357 358 - 357: Label - 359: 6(float) Load 345(d5) - 360: 7(fvec4) Load 9(color) - 361: 6(float) CompositeExtract 360 1 - 362: 6(float) FAdd 361 359 - 363: 7(fvec4) Load 9(color) - 364: 7(fvec4) CompositeInsert 362 363 1 - Store 9(color) 364 - Branch 358 - 358: Label - Branch 337 - 338: Label - 365: 7(fvec4) Load 9(color) - 366: 6(float) CompositeExtract 365 0 - 368: 6(float) Load 367(d6) - 369: 16(bool) FOrdLessThan 366 368 - SelectionMerge 371 None - BranchConditional 369 370 383 - 370: Label + Branch 287 + 307: Label + 309: 20(ptr) AccessChain 9(color) 102 + 310: 6(float) Load 309 + 311: 6(float) Load 126(d4) + 312: 16(bool) FOrdLessThan 310 311 + SelectionMerge 314 None + BranchConditional 312 313 320 + 313: Label + 315: 6(float) Load 126(d4) + 316: 20(ptr) AccessChain 9(color) 102 + 317: 6(float) Load 316 + 318: 6(float) FAdd 317 315 + 319: 20(ptr) AccessChain 9(color) 102 + Store 319 318 + Branch 314 + 320: Label + 321: 6(float) Load 126(d4) + 322: 20(ptr) AccessChain 9(color) 19 + 323: 6(float) Load 322 + 324: 6(float) FAdd 323 321 + 325: 20(ptr) AccessChain 9(color) 19 + Store 325 324 + Branch 314 + 314: Label + Branch 287 + 288: Label + Branch 326 + 326: Label + 329: 16(bool) Phi 17 288 169 347 + LoopMerge 327 326 None + Branch 330 + 330: Label + SelectionMerge 328 None + BranchConditional 329 328 331 + 331: Label + 332: 20(ptr) AccessChain 9(color) 19 + 333: 6(float) Load 332 + 335: 6(float) Load 334(d5) + 336: 16(bool) FOrdLessThan 333 335 + SelectionMerge 337 None + BranchConditional 336 337 327 + 337: Label + Branch 328 + 328: Label + 339: 7(fvec4) Load 338(bigColor5) + 340: 7(fvec4) Load 9(color) + 341: 7(fvec4) FAdd 340 339 + Store 9(color) 341 + 342: 20(ptr) AccessChain 9(color) 102 + 343: 6(float) Load 342 + 344: 6(float) Load 334(d5) + 345: 16(bool) FOrdLessThan 343 344 + SelectionMerge 347 None + BranchConditional 345 346 347 + 346: Label + 348: 6(float) Load 334(d5) + 349: 20(ptr) AccessChain 9(color) 102 + 350: 6(float) Load 349 + 351: 6(float) FAdd 350 348 + 352: 20(ptr) AccessChain 9(color) 102 + Store 352 351 + Branch 347 + 347: Label + Branch 326 + 327: Label + 353: 20(ptr) AccessChain 9(color) 19 + 354: 6(float) Load 353 + 356: 6(float) Load 355(d6) + 357: 16(bool) FOrdLessThan 354 356 + SelectionMerge 359 None + BranchConditional 357 358 371 + 358: Label + Branch 360 + 360: Label + 363: 20(ptr) AccessChain 9(color) 102 + 364: 6(float) Load 363 + 365: 6(float) Load 355(d6) + 366: 16(bool) FOrdLessThan 364 365 + LoopMerge 361 360 None + BranchConditional 366 362 361 + 362: Label + 368: 7(fvec4) Load 367(bigColor6) + 369: 7(fvec4) Load 9(color) + 370: 7(fvec4) FAdd 369 368 + Store 9(color) 370 + Branch 360 + 361: Label + Branch 359 + 371: Label Branch 372 372: Label - 375: 7(fvec4) Load 9(color) - 376: 6(float) CompositeExtract 375 1 - 377: 6(float) Load 367(d6) + 375: 20(ptr) AccessChain 9(color) 61 + 376: 6(float) Load 375 + 377: 6(float) Load 355(d6) 378: 16(bool) FOrdLessThan 376 377 - LoopMerge 373 None + LoopMerge 373 372 None BranchConditional 378 374 373 374: Label - 380: 7(fvec4) Load 379(bigColor6) - 381: 7(fvec4) Load 9(color) - 382: 7(fvec4) FAdd 381 380 - Store 9(color) 382 + 379: 49(ptr) AccessChain 367(bigColor6) 61 + 380: 6(float) Load 379 + 381: 20(ptr) AccessChain 9(color) 61 + 382: 6(float) Load 381 + 383: 6(float) FAdd 382 380 + 384: 20(ptr) AccessChain 9(color) 61 + Store 384 383 Branch 372 373: Label - Branch 371 - 383: Label - Branch 384 - 384: Label - 387: 7(fvec4) Load 9(color) - 388: 6(float) CompositeExtract 387 2 - 389: 6(float) Load 367(d6) - 390: 16(bool) FOrdLessThan 388 389 - LoopMerge 385 None - BranchConditional 390 386 385 - 386: Label - 391: 7(fvec4) Load 379(bigColor6) - 392: 6(float) CompositeExtract 391 2 - 393: 7(fvec4) Load 9(color) - 394: 6(float) CompositeExtract 393 2 - 395: 6(float) FAdd 394 392 - 396: 7(fvec4) Load 9(color) - 397: 7(fvec4) CompositeInsert 395 396 2 - Store 9(color) 397 - Branch 384 - 385: Label - Branch 371 - 371: Label - 398: 7(fvec4) Load 9(color) - 399: 6(float) CompositeExtract 398 0 - 400: 6(float) Load 367(d6) - 401: 16(bool) FOrdLessThan 399 400 - SelectionMerge 403 None - BranchConditional 401 402 420 - 402: Label - Branch 404 - 404: Label - 407: 7(fvec4) Load 9(color) - 408: 6(float) CompositeExtract 407 1 - 409: 6(float) Load 367(d6) - 410: 16(bool) FOrdLessThan 408 409 - LoopMerge 405 None - BranchConditional 410 406 405 - 406: Label - 411: 7(fvec4) Load 379(bigColor6) - 412: 7(fvec4) Load 9(color) - 413: 7(fvec4) FAdd 412 411 - Store 9(color) 413 - 415: 6(float) Load 414(d7) - 416: 16(bool) FOrdLessThan 415 84 - SelectionMerge 418 None - BranchConditional 416 417 418 - 417: Label - Branch 405 - 418: Label - Branch 404 - 405: Label - Branch 403 - 420: Label - Branch 421 - 421: Label - 424: 7(fvec4) Load 9(color) - 425: 6(float) CompositeExtract 424 2 - 426: 6(float) Load 367(d6) - 427: 16(bool) FOrdLessThan 425 426 - LoopMerge 422 None - BranchConditional 427 423 422 - 423: Label - 428: 7(fvec4) Load 379(bigColor6) - 429: 6(float) CompositeExtract 428 2 - 430: 7(fvec4) Load 9(color) - 431: 6(float) CompositeExtract 430 2 - 432: 6(float) FAdd 431 429 - 433: 7(fvec4) Load 9(color) - 434: 7(fvec4) CompositeInsert 432 433 2 - Store 9(color) 434 - Branch 421 - 422: Label - Branch 403 - 403: Label - Branch 435 - 435: Label - 438: 16(bool) Phi 17 403 163 455 - LoopMerge 436 None - Branch 439 - 439: Label - SelectionMerge 437 None - BranchConditional 438 437 440 + Branch 359 + 359: Label + 385: 20(ptr) AccessChain 9(color) 19 + 386: 6(float) Load 385 + 387: 6(float) Load 355(d6) + 388: 16(bool) FOrdLessThan 386 387 + SelectionMerge 390 None + BranchConditional 388 389 407 + 389: Label + Branch 391 + 391: Label + 394: 20(ptr) AccessChain 9(color) 102 + 395: 6(float) Load 394 + 396: 6(float) Load 355(d6) + 397: 16(bool) FOrdLessThan 395 396 + LoopMerge 392 391 None + BranchConditional 397 393 392 + 393: Label + 398: 7(fvec4) Load 367(bigColor6) + 399: 7(fvec4) Load 9(color) + 400: 7(fvec4) FAdd 399 398 + Store 9(color) 400 + 402: 6(float) Load 401(d7) + 403: 16(bool) FOrdLessThan 402 89 + SelectionMerge 405 None + BranchConditional 403 404 405 + 404: Label + Branch 392 + 405: Label + Branch 391 + 392: Label + Branch 390 + 407: Label + Branch 408 + 408: Label + 411: 20(ptr) AccessChain 9(color) 61 + 412: 6(float) Load 411 + 413: 6(float) Load 355(d6) + 414: 16(bool) FOrdLessThan 412 413 + LoopMerge 409 408 None + BranchConditional 414 410 409 + 410: Label + 415: 49(ptr) AccessChain 367(bigColor6) 61 + 416: 6(float) Load 415 + 417: 20(ptr) AccessChain 9(color) 61 + 418: 6(float) Load 417 + 419: 6(float) FAdd 418 416 + 420: 20(ptr) AccessChain 9(color) 61 + Store 420 419 + Branch 408 + 409: Label + Branch 390 + 390: Label + Branch 421 + 421: Label + 424: 16(bool) Phi 17 390 169 441 + LoopMerge 422 421 None + Branch 425 + 425: Label + SelectionMerge 423 None + BranchConditional 424 423 426 + 426: Label + SelectionMerge 427 None + BranchConditional 17 427 422 + 427: Label + Branch 423 + 423: Label + 428: 6(float) Load 401(d7) + 430: 16(bool) FOrdLessThan 428 429 + SelectionMerge 432 None + BranchConditional 430 431 432 + 431: Label + Branch 422 + 432: Label + 435: 7(fvec4) Load 434(bigColor7) + 436: 7(fvec4) Load 9(color) + 437: 7(fvec4) FAdd 436 435 + Store 9(color) 437 + 438: 6(float) Load 401(d7) + 439: 16(bool) FOrdLessThan 438 89 + SelectionMerge 441 None + BranchConditional 439 440 441 440: Label - SelectionMerge 441 None - BranchConditional 17 441 436 - 441: Label - Branch 437 - 437: Label - 442: 6(float) Load 414(d7) - 444: 16(bool) FOrdLessThan 442 443 - SelectionMerge 446 None - BranchConditional 444 445 446 - 445: Label - Branch 436 - 446: Label - 449: 7(fvec4) Load 448(bigColor7) - 450: 7(fvec4) Load 9(color) - 451: 7(fvec4) FAdd 450 449 - Store 9(color) 451 - 452: 6(float) Load 414(d7) - 453: 16(bool) FOrdLessThan 452 84 - SelectionMerge 455 None - BranchConditional 453 454 455 + 442: 20(ptr) AccessChain 9(color) 61 + 443: 6(float) Load 442 + 444: 6(float) FAdd 443 89 + Store 442 444 + Branch 422 + 441: Label + 446: 7(fvec4) Load 11(BaseColor) + 447: 7(fvec4) Load 9(color) + 448: 7(fvec4) FAdd 447 446 + Store 9(color) 448 + Branch 421 + 422: Label + Branch 449 + 449: Label + 452: 16(bool) Phi 17 422 169 472 + LoopMerge 450 449 None + Branch 453 + 453: Label + SelectionMerge 451 None + BranchConditional 452 451 454 454: Label - 456: 7(fvec4) Load 9(color) - 457: 6(float) CompositeExtract 456 2 - 458: 6(float) FAdd 457 84 - 459: 7(fvec4) Load 9(color) - 460: 7(fvec4) CompositeInsert 458 459 2 - Store 9(color) 460 - Branch 436 - 455: Label - 462: 7(fvec4) Load 11(BaseColor) - 463: 7(fvec4) Load 9(color) - 464: 7(fvec4) FAdd 463 462 - Store 9(color) 464 - Branch 435 - 436: Label - Branch 465 - 465: Label - 468: 16(bool) Phi 17 436 163 488 - LoopMerge 466 None - Branch 469 - 469: Label - SelectionMerge 467 None - BranchConditional 468 467 470 - 470: Label - 471: 7(fvec4) Load 9(color) - 472: 6(float) CompositeExtract 471 2 - 474: 6(float) Load 473(d8) - 475: 16(bool) FOrdLessThan 472 474 - SelectionMerge 476 None - BranchConditional 475 476 466 - 476: Label - Branch 467 - 467: Label - 477: 6(float) Load 473(d8) - 478: 16(bool) FOrdLessThan 477 443 - SelectionMerge 480 None - BranchConditional 478 479 480 - 479: Label - Branch 466 - 480: Label - 482: 7(fvec4) Load 448(bigColor7) - 483: 7(fvec4) Load 9(color) - 484: 7(fvec4) FAdd 483 482 - Store 9(color) 484 - 485: 6(float) Load 473(d8) - 486: 16(bool) FOrdLessThan 485 84 - SelectionMerge 488 None - BranchConditional 486 487 488 - 487: Label - 489: 7(fvec4) Load 9(color) - 490: 6(float) CompositeExtract 489 2 - 491: 6(float) FAdd 490 84 - 492: 7(fvec4) Load 9(color) - 493: 7(fvec4) CompositeInsert 491 492 2 - Store 9(color) 493 - 494: 6(float) Load 473(d8) - 496: 16(bool) FOrdLessThan 494 495 - SelectionMerge 498 None - BranchConditional 496 497 504 - 497: Label - 499: 7(fvec4) Load 9(color) - 500: 6(float) CompositeExtract 499 1 - 501: 6(float) FAdd 500 84 - 502: 7(fvec4) Load 9(color) - 503: 7(fvec4) CompositeInsert 501 502 1 - Store 9(color) 503 - Branch 498 - 504: Label - 505: 7(fvec4) Load 9(color) - 506: 6(float) CompositeExtract 505 0 - 507: 6(float) FAdd 506 84 - 508: 7(fvec4) Load 9(color) - 509: 7(fvec4) CompositeInsert 507 508 0 - Store 9(color) 509 - Branch 498 - 498: Label - Branch 466 - 488: Label - 511: 7(fvec4) Load 11(BaseColor) - 512: 7(fvec4) Load 9(color) - 513: 7(fvec4) FAdd 512 511 - Store 9(color) 513 - Branch 465 - 466: Label - Branch 514 - 514: Label - 517: 7(fvec4) Load 9(color) - 518: 6(float) CompositeExtract 517 3 - 520: 6(float) Load 519(d9) - 521: 16(bool) FOrdLessThan 518 520 - LoopMerge 515 None - BranchConditional 521 516 515 - 516: Label - 522: 6(float) Load 519(d9) - 523: 6(float) Load 473(d8) - 524: 16(bool) FOrdGreaterThan 522 523 - SelectionMerge 526 None - BranchConditional 524 525 526 - 525: Label - 527: 7(fvec4) Load 9(color) - 528: 6(float) CompositeExtract 527 0 - 529: 6(float) Load 414(d7) - 530: 16(bool) FOrdLessThanEqual 528 529 - SelectionMerge 532 None - BranchConditional 530 531 532 - 531: Label - 533: 7(fvec4) Load 9(color) - 534: 6(float) CompositeExtract 533 2 - 536: 16(bool) FOrdEqual 534 535 - SelectionMerge 538 None - BranchConditional 536 537 544 - 537: Label - 539: 7(fvec4) Load 9(color) - 540: 6(float) CompositeExtract 539 3 - 541: 6(float) FAdd 540 84 - 542: 7(fvec4) Load 9(color) - 543: 7(fvec4) CompositeInsert 541 542 3 - Store 9(color) 543 - Branch 538 - 544: Label - Branch 515 - 538: Label - Branch 532 - 532: Label - Branch 526 - 526: Label - Branch 514 - 515: Label - Branch 546 - 546: Label - 549: 7(fvec4) Load 9(color) - 550: 6(float) CompositeExtract 549 2 - 552: 6(float) Load 551(d10) - 553: 16(bool) FOrdLessThan 550 552 - LoopMerge 547 None - BranchConditional 553 548 547 - 548: Label - 554: 7(fvec4) Load 9(color) - 555: 6(float) CompositeExtract 554 1 - 556: 6(float) FAdd 555 84 - 557: 7(fvec4) Load 9(color) - 558: 7(fvec4) CompositeInsert 556 557 1 - Store 9(color) 558 - 559: 7(fvec4) Load 9(color) - 560: 6(float) CompositeExtract 559 1 - 562: 6(float) Load 561(d11) - 563: 16(bool) FOrdLessThan 560 562 - SelectionMerge 565 None - BranchConditional 563 564 565 - 564: Label - 566: 7(fvec4) Load 9(color) - 567: 6(float) CompositeExtract 566 2 - 568: 6(float) FAdd 567 84 - 569: 7(fvec4) Load 9(color) - 570: 7(fvec4) CompositeInsert 568 569 2 - Store 9(color) 570 - 571: 7(fvec4) Load 9(color) - 572: 6(float) CompositeExtract 571 3 - 574: 6(float) Load 573(d12) - 575: 16(bool) FOrdLessThan 572 574 - SelectionMerge 577 None - BranchConditional 575 576 583 - 576: Label - 578: 7(fvec4) Load 9(color) - 579: 6(float) CompositeExtract 578 3 - 580: 6(float) FAdd 579 84 - 581: 7(fvec4) Load 9(color) - 582: 7(fvec4) CompositeInsert 580 581 3 - Store 9(color) 582 - Branch 577 - 583: Label - 584: 7(fvec4) Load 9(color) - 585: 6(float) CompositeExtract 584 0 - 586: 6(float) FAdd 585 84 - 587: 7(fvec4) Load 9(color) - 588: 7(fvec4) CompositeInsert 586 587 0 - Store 9(color) 588 - Branch 577 + 455: 20(ptr) AccessChain 9(color) 61 + 456: 6(float) Load 455 + 458: 6(float) Load 457(d8) + 459: 16(bool) FOrdLessThan 456 458 + SelectionMerge 460 None + BranchConditional 459 460 450 + 460: Label + Branch 451 + 451: Label + 461: 6(float) Load 457(d8) + 462: 16(bool) FOrdLessThan 461 429 + SelectionMerge 464 None + BranchConditional 462 463 464 + 463: Label + Branch 450 + 464: Label + 466: 7(fvec4) Load 434(bigColor7) + 467: 7(fvec4) Load 9(color) + 468: 7(fvec4) FAdd 467 466 + Store 9(color) 468 + 469: 6(float) Load 457(d8) + 470: 16(bool) FOrdLessThan 469 89 + SelectionMerge 472 None + BranchConditional 470 471 472 + 471: Label + 473: 20(ptr) AccessChain 9(color) 61 + 474: 6(float) Load 473 + 475: 6(float) FAdd 474 89 + Store 473 475 + 476: 6(float) Load 457(d8) + 478: 16(bool) FOrdLessThan 476 477 + SelectionMerge 480 None + BranchConditional 478 479 484 + 479: Label + 481: 20(ptr) AccessChain 9(color) 102 + 482: 6(float) Load 481 + 483: 6(float) FAdd 482 89 + Store 481 483 + Branch 480 + 484: Label + 485: 20(ptr) AccessChain 9(color) 19 + 486: 6(float) Load 485 + 487: 6(float) FAdd 486 89 + Store 485 487 + Branch 480 + 480: Label + Branch 450 + 472: Label + 489: 7(fvec4) Load 11(BaseColor) + 490: 7(fvec4) Load 9(color) + 491: 7(fvec4) FAdd 490 489 + Store 9(color) 491 + Branch 449 + 450: Label + Branch 492 + 492: Label + 495: 20(ptr) AccessChain 9(color) 70 + 496: 6(float) Load 495 + 498: 6(float) Load 497(d9) + 499: 16(bool) FOrdLessThan 496 498 + LoopMerge 493 492 None + BranchConditional 499 494 493 + 494: Label + 500: 6(float) Load 497(d9) + 501: 6(float) Load 457(d8) + 502: 16(bool) FOrdGreaterThan 500 501 + SelectionMerge 504 None + BranchConditional 502 503 504 + 503: Label + 505: 20(ptr) AccessChain 9(color) 19 + 506: 6(float) Load 505 + 507: 6(float) Load 401(d7) + 508: 16(bool) FOrdLessThanEqual 506 507 + SelectionMerge 510 None + BranchConditional 508 509 510 + 509: Label + 511: 20(ptr) AccessChain 9(color) 61 + 512: 6(float) Load 511 + 514: 16(bool) FOrdEqual 512 513 + SelectionMerge 516 None + BranchConditional 514 515 520 + 515: Label + 517: 20(ptr) AccessChain 9(color) 70 + 518: 6(float) Load 517 + 519: 6(float) FAdd 518 89 + Store 517 519 + Branch 516 + 520: Label + Branch 493 + 516: Label + Branch 510 + 510: Label + Branch 504 + 504: Label + Branch 492 + 493: Label + Branch 522 + 522: Label + 525: 20(ptr) AccessChain 9(color) 61 + 526: 6(float) Load 525 + 528: 6(float) Load 527(d10) + 529: 16(bool) FOrdLessThan 526 528 + LoopMerge 523 522 None + BranchConditional 529 524 523 + 524: Label + 530: 20(ptr) AccessChain 9(color) 102 + 531: 6(float) Load 530 + 532: 6(float) FAdd 531 89 + Store 530 532 + 533: 20(ptr) AccessChain 9(color) 102 + 534: 6(float) Load 533 + 536: 6(float) Load 535(d11) + 537: 16(bool) FOrdLessThan 534 536 + SelectionMerge 539 None + BranchConditional 537 538 539 + 538: Label + 540: 20(ptr) AccessChain 9(color) 61 + 541: 6(float) Load 540 + 542: 6(float) FAdd 541 89 + Store 540 542 + 543: 20(ptr) AccessChain 9(color) 70 + 544: 6(float) Load 543 + 546: 6(float) Load 545(d12) + 547: 16(bool) FOrdLessThan 544 546 + SelectionMerge 549 None + BranchConditional 547 548 553 + 548: Label + 550: 20(ptr) AccessChain 9(color) 70 + 551: 6(float) Load 550 + 552: 6(float) FAdd 551 89 + Store 550 552 + Branch 549 + 553: Label + 554: 20(ptr) AccessChain 9(color) 19 + 555: 6(float) Load 554 + 556: 6(float) FAdd 555 89 + Store 554 556 + Branch 549 + 549: Label + Branch 522 + 539: Label + 558: 7(fvec4) Load 9(color) + 559: 7(fvec4) CompositeConstruct 89 89 89 89 + 560: 7(fvec4) FAdd 558 559 + Store 9(color) 560 + Branch 523 + 523: Label + Branch 562 + 562: Label + 565: 20(ptr) AccessChain 9(color) 19 + 566: 6(float) Load 565 + 568: 16(bool) FOrdLessThan 566 567 + LoopMerge 563 562 None + BranchConditional 568 564 563 + 564: Label + 570: 7(fvec4) Load 569(bigColor8) + 571: 7(fvec4) Load 9(color) + 572: 7(fvec4) FAdd 571 570 + Store 9(color) 572 + 573: 20(ptr) AccessChain 9(color) 61 + 574: 6(float) Load 573 + 575: 6(float) Load 457(d8) + 576: 16(bool) FOrdLessThan 574 575 + SelectionMerge 578 None + BranchConditional 576 577 578 577: Label - Branch 546 - 565: Label - 590: 7(fvec4) Load 9(color) - 591: 7(fvec4) CompositeConstruct 84 84 84 84 - 592: 7(fvec4) FAdd 590 591 - Store 9(color) 592 - Branch 547 - 547: Label - Branch 594 - 594: Label + 579: 20(ptr) AccessChain 9(color) 70 + 580: 6(float) Load 579 + 581: 6(float) Load 355(d6) + 582: 16(bool) FOrdLessThan 580 581 + SelectionMerge 584 None + BranchConditional 582 583 584 + 583: Label + Branch 562 + 584: Label + Branch 578 + 578: Label + 586: 49(ptr) AccessChain 569(bigColor8) 19 + 587: 6(float) Load 586 + 588: 20(ptr) AccessChain 9(color) 102 + 589: 6(float) Load 588 + 590: 6(float) FAdd 589 587 + 591: 20(ptr) AccessChain 9(color) 102 + Store 591 590 + Branch 562 + 563: Label + 592: 7(fvec4) Load 9(color) + 593: 7(fvec4) CompositeConstruct 89 89 89 89 + 594: 7(fvec4) FAdd 592 593 + Store 9(color) 594 597: 7(fvec4) Load 9(color) - 598: 6(float) CompositeExtract 597 0 - 600: 16(bool) FOrdLessThan 598 599 - LoopMerge 595 None - BranchConditional 600 596 595 - 596: Label - 602: 7(fvec4) Load 601(bigColor8) - 603: 7(fvec4) Load 9(color) - 604: 7(fvec4) FAdd 603 602 - Store 9(color) 604 - 605: 7(fvec4) Load 9(color) - 606: 6(float) CompositeExtract 605 2 - 607: 6(float) Load 473(d8) - 608: 16(bool) FOrdLessThan 606 607 - SelectionMerge 610 None - BranchConditional 608 609 610 - 609: Label - 611: 7(fvec4) Load 9(color) - 612: 6(float) CompositeExtract 611 3 - 613: 6(float) Load 367(d6) - 614: 16(bool) FOrdLessThan 612 613 - SelectionMerge 616 None - BranchConditional 614 615 616 - 615: Label - Branch 594 - 616: Label - Branch 610 - 610: Label - 618: 7(fvec4) Load 601(bigColor8) - 619: 6(float) CompositeExtract 618 0 - 620: 7(fvec4) Load 9(color) - 621: 6(float) CompositeExtract 620 1 - 622: 6(float) FAdd 621 619 - 623: 7(fvec4) Load 9(color) - 624: 7(fvec4) CompositeInsert 622 623 1 - Store 9(color) 624 - Branch 594 - 595: Label - 625: 7(fvec4) Load 9(color) - 626: 7(fvec4) CompositeConstruct 84 84 84 84 - 627: 7(fvec4) FAdd 625 626 - Store 9(color) 627 - 630: 7(fvec4) Load 9(color) - Store 629(gl_FragColor) 630 - Branch 631 - 631: Label - 634: 7(fvec4) Load 9(color) - 635: 6(float) CompositeExtract 634 0 - 637: 6(float) Load 636(d14) - 638: 16(bool) FOrdLessThan 635 637 - LoopMerge 632 None - BranchConditional 638 633 632 - 633: Label - 639: 7(fvec4) Load 9(color) - 640: 6(float) CompositeExtract 639 1 - 642: 6(float) Load 641(d15) - 643: 16(bool) FOrdLessThan 640 642 - SelectionMerge 645 None - BranchConditional 643 644 647 - 644: Label + Store 596(gl_FragColor) 597 + Branch 598 + 598: Label + 601: 20(ptr) AccessChain 9(color) 19 + 602: 6(float) Load 601 + 604: 6(float) Load 603(d14) + 605: 16(bool) FOrdLessThan 602 604 + LoopMerge 599 598 None + BranchConditional 605 600 599 + 600: Label + 606: 20(ptr) AccessChain 9(color) 102 + 607: 6(float) Load 606 + 609: 6(float) Load 608(d15) + 610: 16(bool) FOrdLessThan 607 609 + SelectionMerge 612 None + BranchConditional 610 611 614 + 611: Label Return - 647: Label - 648: 7(fvec4) Load 9(color) - 649: 7(fvec4) CompositeConstruct 84 84 84 84 - 650: 7(fvec4) FAdd 648 649 - Store 9(color) 650 - Branch 645 - 645: Label - Branch 631 + 614: Label + 615: 7(fvec4) Load 9(color) + 616: 7(fvec4) CompositeConstruct 89 89 89 89 + 617: 7(fvec4) FAdd 615 616 + Store 9(color) 617 + Branch 612 + 612: Label + Branch 598 + 599: Label + 618: 7(fvec4) Load 9(color) + 619: 7(fvec4) CompositeConstruct 89 89 89 89 + 620: 7(fvec4) FAdd 618 619 + Store 9(color) 620 + Branch 621 + 621: Label + 624: 20(ptr) AccessChain 9(color) 70 + 625: 6(float) Load 624 + 627: 6(float) Load 626(d16) + 628: 16(bool) FOrdLessThan 625 627 + LoopMerge 622 621 None + BranchConditional 628 623 622 + 623: Label + 629: 20(ptr) AccessChain 9(color) 70 + 630: 6(float) Load 629 + 631: 6(float) FAdd 630 89 + Store 629 631 + Branch 621 + 622: Label + Branch 632 632: Label - 651: 7(fvec4) Load 9(color) - 652: 7(fvec4) CompositeConstruct 84 84 84 84 - 653: 7(fvec4) FAdd 651 652 - Store 9(color) 653 - Branch 654 - 654: Label - 657: 7(fvec4) Load 9(color) - 658: 6(float) CompositeExtract 657 3 - 660: 6(float) Load 659(d16) - 661: 16(bool) FOrdLessThan 658 660 - LoopMerge 655 None - BranchConditional 661 656 655 - 656: Label - 662: 7(fvec4) Load 9(color) - 663: 6(float) CompositeExtract 662 3 - 664: 6(float) FAdd 663 84 - 665: 7(fvec4) Load 9(color) - 666: 7(fvec4) CompositeInsert 664 665 3 - Store 9(color) 666 - Branch 654 - 655: Label - Branch 667 - 667: Label - 670: 7(fvec4) Load 9(color) - 671: 6(float) CompositeExtract 670 3 - 672: 6(float) Load 92(d2) - 673: 16(bool) FOrdLessThan 671 672 - SelectionMerge 675 None - BranchConditional 673 674 675 - 674: Label - 676: 7(fvec4) Load 9(color) - 677: 6(float) CompositeExtract 676 1 - 678: 6(float) Load 99(d3) - 679: 16(bool) FOrdLessThan 677 678 - Branch 675 - 675: Label - 680: 16(bool) Phi 673 667 679 674 - LoopMerge 668 None - BranchConditional 680 669 668 - 669: Label - 681: 7(fvec4) Load 103(bigColor1_2) - 682: 7(fvec4) Load 9(color) - 683: 7(fvec4) FAdd 682 681 - Store 9(color) 683 - 684: 7(fvec4) Load 9(color) - 685: 6(float) CompositeExtract 684 2 - 686: 6(float) Load 99(d3) - 687: 16(bool) FOrdLessThan 685 686 - SelectionMerge 689 None - BranchConditional 687 688 689 - 688: Label + 635: 20(ptr) AccessChain 9(color) 70 + 636: 6(float) Load 635 + 637: 6(float) Load 97(d2) + 638: 16(bool) FOrdLessThan 636 637 + SelectionMerge 640 None + BranchConditional 638 639 640 + 639: Label + 641: 20(ptr) AccessChain 9(color) 102 + 642: 6(float) Load 641 + 643: 6(float) Load 105(d3) + 644: 16(bool) FOrdLessThan 642 643 + Branch 640 + 640: Label + 645: 16(bool) Phi 638 632 644 639 + LoopMerge 633 632 None + BranchConditional 645 634 633 + 634: Label + 646: 7(fvec4) Load 109(bigColor1_2) + 647: 7(fvec4) Load 9(color) + 648: 7(fvec4) FAdd 647 646 + Store 9(color) 648 + 649: 20(ptr) AccessChain 9(color) 61 + 650: 6(float) Load 649 + 651: 6(float) Load 105(d3) + 652: 16(bool) FOrdLessThan 650 651 + SelectionMerge 654 None + BranchConditional 652 653 654 + 653: Label Return - 689: Label - Branch 667 - 668: Label - Branch 691 - 691: Label - 694: 16(bool) Phi 17 668 163 709 - LoopMerge 692 None - Branch 695 - 695: Label - SelectionMerge 693 None - BranchConditional 694 693 696 - 696: Label - 697: 7(fvec4) Load 9(color) - 698: 6(float) CompositeExtract 697 0 - 700: 6(float) Load 699(d17) - 701: 16(bool) FOrdLessThan 698 700 - SelectionMerge 702 None - BranchConditional 701 702 692 - 702: Label - Branch 693 - 693: Label - 703: 7(fvec4) Load 9(color) - 704: 6(float) CompositeExtract 703 1 - 706: 6(float) Load 705(d18) - 707: 16(bool) FOrdLessThan 704 706 - SelectionMerge 709 None - BranchConditional 707 708 709 - 708: Label + 654: Label + Branch 632 + 633: Label + Branch 656 + 656: Label + 659: 16(bool) Phi 17 633 169 674 + LoopMerge 657 656 None + Branch 660 + 660: Label + SelectionMerge 658 None + BranchConditional 659 658 661 + 661: Label + 662: 20(ptr) AccessChain 9(color) 19 + 663: 6(float) Load 662 + 665: 6(float) Load 664(d17) + 666: 16(bool) FOrdLessThan 663 665 + SelectionMerge 667 None + BranchConditional 666 667 657 + 667: Label + Branch 658 + 658: Label + 668: 20(ptr) AccessChain 9(color) 102 + 669: 6(float) Load 668 + 671: 6(float) Load 670(d18) + 672: 16(bool) FOrdLessThan 669 671 + SelectionMerge 674 None + BranchConditional 672 673 674 + 673: Label Return - 709: Label - 711: 7(fvec4) Load 9(color) - 712: 7(fvec4) CompositeConstruct 84 84 84 84 - 713: 7(fvec4) FAdd 711 712 - Store 9(color) 713 - Branch 691 - 692: Label - Branch 714 - 714: Label - 717: 7(fvec4) Load 9(color) - 718: 6(float) CompositeExtract 717 1 - 719: 6(float) Load 659(d16) - 720: 16(bool) FOrdLessThan 718 719 - LoopMerge 715 None - BranchConditional 720 716 715 - 716: Label - 721: 7(fvec4) Load 9(color) - 722: 6(float) CompositeExtract 721 3 - 723: 6(float) Load 659(d16) - 724: 16(bool) FOrdLessThan 722 723 - SelectionMerge 726 None - BranchConditional 724 725 728 - 725: Label + 674: Label + 676: 7(fvec4) Load 9(color) + 677: 7(fvec4) CompositeConstruct 89 89 89 89 + 678: 7(fvec4) FAdd 676 677 + Store 9(color) 678 + Branch 656 + 657: Label + Branch 679 + 679: Label + 682: 20(ptr) AccessChain 9(color) 102 + 683: 6(float) Load 682 + 684: 6(float) Load 626(d16) + 685: 16(bool) FOrdLessThan 683 684 + LoopMerge 680 679 None + BranchConditional 685 681 680 + 681: Label + 686: 20(ptr) AccessChain 9(color) 70 + 687: 6(float) Load 686 + 688: 6(float) Load 626(d16) + 689: 16(bool) FOrdLessThan 687 688 + SelectionMerge 691 None + BranchConditional 689 690 693 + 690: Label Kill - 728: Label - 729: 7(fvec4) Load 9(color) - 730: 7(fvec4) CompositeConstruct 84 84 84 84 - 731: 7(fvec4) FAdd 729 730 - Store 9(color) 731 - Branch 726 - 726: Label - Branch 714 - 715: Label - 732: 7(fvec4) Load 9(color) - 733: 7(fvec4) CompositeConstruct 84 84 84 84 - 734: 7(fvec4) FAdd 732 733 - Store 9(color) 734 - 735: 7(fvec4) Load 9(color) - Store 629(gl_FragColor) 735 + 693: Label + 694: 7(fvec4) Load 9(color) + 695: 7(fvec4) CompositeConstruct 89 89 89 89 + 696: 7(fvec4) FAdd 694 695 + Store 9(color) 696 + Branch 691 + 691: Label + Branch 679 + 680: Label + 697: 7(fvec4) Load 9(color) + 698: 7(fvec4) CompositeConstruct 89 89 89 89 + 699: 7(fvec4) FAdd 697 698 + Store 9(color) 699 + 700: 7(fvec4) Load 9(color) + Store 596(gl_FragColor) 700 Return FunctionEnd diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index 3871d858..314a9691 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -5,111 +5,66 @@ WARNING: 0:14: varying deprecated in version 130; may be removed in future relea Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 195 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 191 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 24 "d4" - Name 29 "bigColor4" - Name 83 "d13" - Name 148 "gl_FragColor" - Name 150 "bigColor" - Name 151 "bigColor1_1" - Name 152 "bigColor1_2" - Name 153 "bigColor1_3" - Name 154 "bigColor2" - Name 155 "bigColor3" - Name 156 "bigColor5" - Name 157 "bigColor6" - Name 158 "bigColor7" - Name 159 "bigColor8" - Name 160 "d" - Name 161 "d2" - Name 162 "d3" - Name 163 "d5" - Name 164 "d6" - Name 165 "d7" - Name 166 "d8" - Name 167 "d9" - Name 168 "d10" - Name 169 "d11" - Name 170 "d12" - Name 171 "d14" - Name 172 "d15" - Name 173 "d16" - Name 174 "d17" - Name 175 "d18" - Name 176 "d19" - Name 177 "d20" - Name 178 "d21" - Name 179 "d22" - Name 180 "d23" - Name 181 "d24" - Name 182 "d25" - Name 183 "d26" - Name 184 "d27" - Name 185 "d28" - Name 186 "d29" - Name 187 "d30" - Name 188 "d31" - Name 189 "d32" - Name 190 "d33" - Name 191 "d34" - Name 194 "Count" - Decorate 11(BaseColor) Smooth - Decorate 148(gl_FragColor) BuiltIn FragColor - Decorate 150(bigColor) NoStaticUse - Decorate 151(bigColor1_1) NoStaticUse - Decorate 152(bigColor1_2) NoStaticUse - Decorate 153(bigColor1_3) NoStaticUse - Decorate 154(bigColor2) NoStaticUse - Decorate 155(bigColor3) NoStaticUse - Decorate 156(bigColor5) NoStaticUse - Decorate 157(bigColor6) NoStaticUse - Decorate 158(bigColor7) NoStaticUse - Decorate 159(bigColor8) NoStaticUse - Decorate 160(d) NoStaticUse - Decorate 161(d2) NoStaticUse - Decorate 162(d3) NoStaticUse - Decorate 163(d5) NoStaticUse - Decorate 164(d6) NoStaticUse - Decorate 165(d7) NoStaticUse - Decorate 166(d8) NoStaticUse - Decorate 167(d9) NoStaticUse - Decorate 168(d10) NoStaticUse - Decorate 169(d11) NoStaticUse - Decorate 170(d12) NoStaticUse - Decorate 171(d14) NoStaticUse - Decorate 172(d15) NoStaticUse - Decorate 173(d16) NoStaticUse - Decorate 174(d17) NoStaticUse - Decorate 175(d18) NoStaticUse - Decorate 176(d19) NoStaticUse - Decorate 177(d20) NoStaticUse - Decorate 178(d21) NoStaticUse - Decorate 179(d22) NoStaticUse - Decorate 180(d23) NoStaticUse - Decorate 181(d24) NoStaticUse - Decorate 182(d25) NoStaticUse - Decorate 183(d26) NoStaticUse - Decorate 184(d27) NoStaticUse - Decorate 185(d28) NoStaticUse - Decorate 186(d29) NoStaticUse - Decorate 187(d30) NoStaticUse - Decorate 188(d31) NoStaticUse - Decorate 189(d32) NoStaticUse - Decorate 190(d33) NoStaticUse - Decorate 191(d34) NoStaticUse - Decorate 194(Count) NoStaticUse + Name 27 "d4" + Name 32 "bigColor4" + Name 84 "d13" + Name 144 "gl_FragColor" + Name 146 "bigColor" + Name 147 "bigColor1_1" + Name 148 "bigColor1_2" + Name 149 "bigColor1_3" + Name 150 "bigColor2" + Name 151 "bigColor3" + Name 152 "bigColor5" + Name 153 "bigColor6" + Name 154 "bigColor7" + Name 155 "bigColor8" + Name 156 "d" + Name 157 "d2" + Name 158 "d3" + Name 159 "d5" + Name 160 "d6" + Name 161 "d7" + Name 162 "d8" + Name 163 "d9" + Name 164 "d10" + Name 165 "d11" + Name 166 "d12" + Name 167 "d14" + Name 168 "d15" + Name 169 "d16" + Name 170 "d17" + Name 171 "d18" + Name 172 "d19" + Name 173 "d20" + Name 174 "d21" + Name 175 "d22" + Name 176 "d23" + Name 177 "d24" + Name 178 "d25" + Name 179 "d26" + Name 180 "d27" + Name 181 "d28" + Name 182 "d29" + Name 183 "d30" + Name 184 "d31" + Name 185 "d32" + Name 186 "d33" + Name 187 "d34" + Name 190 "Count" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -119,61 +74,67 @@ Linked fragment stage: 11(BaseColor): 10(ptr) Variable Input 17: TypeBool 18: 17(bool) ConstantTrue - 23: TypePointer UniformConstant 6(float) - 24(d4): 23(ptr) Variable UniformConstant - 28: TypePointer UniformConstant 7(fvec4) - 29(bigColor4): 28(ptr) Variable UniformConstant - 39: 6(float) Constant 1073741824 - 53: 6(float) Constant 1065353216 - 57: 17(bool) ConstantFalse - 83(d13): 23(ptr) Variable UniformConstant - 147: TypePointer Output 7(fvec4) -148(gl_FragColor): 147(ptr) Variable Output - 150(bigColor): 28(ptr) Variable UniformConstant -151(bigColor1_1): 28(ptr) Variable UniformConstant -152(bigColor1_2): 28(ptr) Variable UniformConstant -153(bigColor1_3): 28(ptr) Variable UniformConstant - 154(bigColor2): 28(ptr) Variable UniformConstant - 155(bigColor3): 28(ptr) Variable UniformConstant - 156(bigColor5): 28(ptr) Variable UniformConstant - 157(bigColor6): 28(ptr) Variable UniformConstant - 158(bigColor7): 28(ptr) Variable UniformConstant - 159(bigColor8): 28(ptr) Variable UniformConstant - 160(d): 23(ptr) Variable UniformConstant - 161(d2): 23(ptr) Variable UniformConstant - 162(d3): 23(ptr) Variable UniformConstant - 163(d5): 23(ptr) Variable UniformConstant - 164(d6): 23(ptr) Variable UniformConstant - 165(d7): 23(ptr) Variable UniformConstant - 166(d8): 23(ptr) Variable UniformConstant - 167(d9): 23(ptr) Variable UniformConstant - 168(d10): 23(ptr) Variable UniformConstant - 169(d11): 23(ptr) Variable UniformConstant - 170(d12): 23(ptr) Variable UniformConstant - 171(d14): 23(ptr) Variable UniformConstant - 172(d15): 23(ptr) Variable UniformConstant - 173(d16): 23(ptr) Variable UniformConstant - 174(d17): 23(ptr) Variable UniformConstant - 175(d18): 23(ptr) Variable UniformConstant - 176(d19): 23(ptr) Variable UniformConstant - 177(d20): 23(ptr) Variable UniformConstant - 178(d21): 23(ptr) Variable UniformConstant - 179(d22): 23(ptr) Variable UniformConstant - 180(d23): 23(ptr) Variable UniformConstant - 181(d24): 23(ptr) Variable UniformConstant - 182(d25): 23(ptr) Variable UniformConstant - 183(d26): 23(ptr) Variable UniformConstant - 184(d27): 23(ptr) Variable UniformConstant - 185(d28): 23(ptr) Variable UniformConstant - 186(d29): 23(ptr) Variable UniformConstant - 187(d30): 23(ptr) Variable UniformConstant - 188(d31): 23(ptr) Variable UniformConstant - 189(d32): 23(ptr) Variable UniformConstant - 190(d33): 23(ptr) Variable UniformConstant - 191(d34): 23(ptr) Variable UniformConstant - 192: TypeInt 32 1 - 193: TypePointer UniformConstant 192(int) - 194(Count): 193(ptr) Variable UniformConstant + 21: TypeInt 32 0 + 22: 21(int) Constant 2 + 23: TypePointer Function 6(float) + 26: TypePointer UniformConstant 6(float) + 27(d4): 26(ptr) Variable UniformConstant + 31: TypePointer UniformConstant 7(fvec4) + 32(bigColor4): 31(ptr) Variable UniformConstant + 36: 21(int) Constant 0 + 43: 6(float) Constant 1073741824 + 56: 6(float) Constant 1065353216 + 58: 17(bool) ConstantFalse + 60: 21(int) Constant 1 + 81: 21(int) Constant 3 + 84(d13): 26(ptr) Variable UniformConstant + 143: TypePointer Output 7(fvec4) +144(gl_FragColor): 143(ptr) Variable Output + 146(bigColor): 31(ptr) Variable UniformConstant +147(bigColor1_1): 31(ptr) Variable UniformConstant +148(bigColor1_2): 31(ptr) Variable UniformConstant +149(bigColor1_3): 31(ptr) Variable UniformConstant + 150(bigColor2): 31(ptr) Variable UniformConstant + 151(bigColor3): 31(ptr) Variable UniformConstant + 152(bigColor5): 31(ptr) Variable UniformConstant + 153(bigColor6): 31(ptr) Variable UniformConstant + 154(bigColor7): 31(ptr) Variable UniformConstant + 155(bigColor8): 31(ptr) Variable UniformConstant + 156(d): 26(ptr) Variable UniformConstant + 157(d2): 26(ptr) Variable UniformConstant + 158(d3): 26(ptr) Variable UniformConstant + 159(d5): 26(ptr) Variable UniformConstant + 160(d6): 26(ptr) Variable UniformConstant + 161(d7): 26(ptr) Variable UniformConstant + 162(d8): 26(ptr) Variable UniformConstant + 163(d9): 26(ptr) Variable UniformConstant + 164(d10): 26(ptr) Variable UniformConstant + 165(d11): 26(ptr) Variable UniformConstant + 166(d12): 26(ptr) Variable UniformConstant + 167(d14): 26(ptr) Variable UniformConstant + 168(d15): 26(ptr) Variable UniformConstant + 169(d16): 26(ptr) Variable UniformConstant + 170(d17): 26(ptr) Variable UniformConstant + 171(d18): 26(ptr) Variable UniformConstant + 172(d19): 26(ptr) Variable UniformConstant + 173(d20): 26(ptr) Variable UniformConstant + 174(d21): 26(ptr) Variable UniformConstant + 175(d22): 26(ptr) Variable UniformConstant + 176(d23): 26(ptr) Variable UniformConstant + 177(d24): 26(ptr) Variable UniformConstant + 178(d25): 26(ptr) Variable UniformConstant + 179(d26): 26(ptr) Variable UniformConstant + 180(d27): 26(ptr) Variable UniformConstant + 181(d28): 26(ptr) Variable UniformConstant + 182(d29): 26(ptr) Variable UniformConstant + 183(d30): 26(ptr) Variable UniformConstant + 184(d31): 26(ptr) Variable UniformConstant + 185(d32): 26(ptr) Variable UniformConstant + 186(d33): 26(ptr) Variable UniformConstant + 187(d34): 26(ptr) Variable UniformConstant + 188: TypeInt 32 1 + 189: TypePointer UniformConstant 188(int) + 190(Count): 189(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -181,177 +142,167 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 16: 17(bool) Phi 18 5 57 49 57 64 - LoopMerge 14 None + 16: 17(bool) Phi 18 5 58 52 58 66 + LoopMerge 14 13 None Branch 19 19: Label SelectionMerge 15 None BranchConditional 16 15 20 20: Label - 21: 7(fvec4) Load 9(color) - 22: 6(float) CompositeExtract 21 2 - 25: 6(float) Load 24(d4) - 26: 17(bool) FOrdLessThan 22 25 - SelectionMerge 27 None - BranchConditional 26 27 14 - 27: Label + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d4) + 29: 17(bool) FOrdLessThan 25 28 + SelectionMerge 30 None + BranchConditional 29 30 14 + 30: Label Branch 15 15: Label - 30: 7(fvec4) Load 29(bigColor4) - 31: 7(fvec4) Load 9(color) - 32: 7(fvec4) FAdd 31 30 - Store 9(color) 32 - 33: 7(fvec4) Load 9(color) - 34: 6(float) CompositeExtract 33 0 - 35: 6(float) Load 24(d4) - 36: 17(bool) FOrdLessThan 34 35 - SelectionMerge 38 None - BranchConditional 36 37 38 - 37: Label - 40: 7(fvec4) Load 9(color) - 41: 6(float) CompositeExtract 40 2 - 42: 6(float) FAdd 41 39 - 43: 7(fvec4) Load 9(color) - 44: 7(fvec4) CompositeInsert 42 43 2 - Store 9(color) 44 - 45: 7(fvec4) Load 9(color) - 46: 6(float) CompositeExtract 45 2 - 47: 6(float) Load 24(d4) - 48: 17(bool) FOrdLessThan 46 47 - SelectionMerge 50 None - BranchConditional 48 49 50 - 49: Label - 51: 7(fvec4) Load 9(color) - 52: 6(float) CompositeExtract 51 0 - 54: 6(float) FAdd 52 53 - 55: 7(fvec4) Load 9(color) - 56: 7(fvec4) CompositeInsert 54 55 0 - Store 9(color) 56 + 33: 7(fvec4) Load 32(bigColor4) + 34: 7(fvec4) Load 9(color) + 35: 7(fvec4) FAdd 34 33 + Store 9(color) 35 + 37: 23(ptr) AccessChain 9(color) 36 + 38: 6(float) Load 37 + 39: 6(float) Load 27(d4) + 40: 17(bool) FOrdLessThan 38 39 + SelectionMerge 42 None + BranchConditional 40 41 42 + 41: Label + 44: 23(ptr) AccessChain 9(color) 22 + 45: 6(float) Load 44 + 46: 6(float) FAdd 45 43 + 47: 23(ptr) AccessChain 9(color) 22 + Store 47 46 + 48: 23(ptr) AccessChain 9(color) 22 + 49: 6(float) Load 48 + 50: 6(float) Load 27(d4) + 51: 17(bool) FOrdLessThan 49 50 + SelectionMerge 53 None + BranchConditional 51 52 53 + 52: Label + 54: 23(ptr) AccessChain 9(color) 36 + 55: 6(float) Load 54 + 57: 6(float) FAdd 55 56 + Store 54 57 Branch 13 - 50: Label - Branch 38 - 38: Label - 59: 7(fvec4) Load 9(color) - 60: 6(float) CompositeExtract 59 1 - 61: 6(float) Load 24(d4) - 62: 17(bool) FOrdLessThan 60 61 - SelectionMerge 64 None - BranchConditional 62 63 71 - 63: Label - 65: 6(float) Load 24(d4) - 66: 7(fvec4) Load 9(color) - 67: 6(float) CompositeExtract 66 1 - 68: 6(float) FAdd 67 65 - 69: 7(fvec4) Load 9(color) - 70: 7(fvec4) CompositeInsert 68 69 1 - Store 9(color) 70 - Branch 64 - 71: Label - 72: 6(float) Load 24(d4) - 73: 7(fvec4) Load 9(color) - 74: 6(float) CompositeExtract 73 0 - 75: 6(float) FAdd 74 72 - 76: 7(fvec4) Load 9(color) - 77: 7(fvec4) CompositeInsert 75 76 0 - Store 9(color) 77 - Branch 64 - 64: Label + 53: Label + Branch 42 + 42: Label + 61: 23(ptr) AccessChain 9(color) 60 + 62: 6(float) Load 61 + 63: 6(float) Load 27(d4) + 64: 17(bool) FOrdLessThan 62 63 + SelectionMerge 66 None + BranchConditional 64 65 72 + 65: Label + 67: 6(float) Load 27(d4) + 68: 23(ptr) AccessChain 9(color) 60 + 69: 6(float) Load 68 + 70: 6(float) FAdd 69 67 + 71: 23(ptr) AccessChain 9(color) 60 + Store 71 70 + Branch 66 + 72: Label + 73: 6(float) Load 27(d4) + 74: 23(ptr) AccessChain 9(color) 36 + 75: 6(float) Load 74 + 76: 6(float) FAdd 75 73 + 77: 23(ptr) AccessChain 9(color) 36 + Store 77 76 + Branch 66 + 66: Label Branch 13 14: Label Branch 78 78: Label - 81: 7(fvec4) Load 9(color) - 82: 6(float) CompositeExtract 81 3 - 84: 6(float) Load 83(d13) - 85: 17(bool) FOrdLessThan 82 84 - LoopMerge 79 None - BranchConditional 85 80 79 + 82: 23(ptr) AccessChain 9(color) 81 + 83: 6(float) Load 82 + 85: 6(float) Load 84(d13) + 86: 17(bool) FOrdLessThan 83 85 + LoopMerge 79 78 None + BranchConditional 86 80 79 80: Label - 86: 7(fvec4) Load 9(color) - 87: 6(float) CompositeExtract 86 2 - 88: 6(float) Load 83(d13) - 89: 17(bool) FOrdLessThan 87 88 - SelectionMerge 91 None - BranchConditional 89 90 95 - 90: Label - 92: 7(fvec4) Load 9(color) - 93: 7(fvec4) CompositeConstruct 53 53 53 53 - 94: 7(fvec4) FAdd 92 93 - Store 9(color) 94 - Branch 91 - 95: Label - 96: 7(fvec4) Load 9(color) - 97: 7(fvec4) CompositeConstruct 53 53 53 53 - 98: 7(fvec4) FSub 96 97 - Store 9(color) 98 - Branch 91 - 91: Label - 99: 7(fvec4) Load 29(bigColor4) - 100: 7(fvec4) Load 9(color) - 101: 7(fvec4) FAdd 100 99 - Store 9(color) 101 - 102: 7(fvec4) Load 9(color) - 103: 6(float) CompositeExtract 102 0 - 104: 6(float) Load 24(d4) - 105: 17(bool) FOrdLessThan 103 104 - SelectionMerge 107 None - BranchConditional 105 106 107 - 106: Label - 108: 7(fvec4) Load 9(color) - 109: 6(float) CompositeExtract 108 2 - 110: 6(float) FAdd 109 39 - 111: 7(fvec4) Load 9(color) - 112: 7(fvec4) CompositeInsert 110 111 2 - Store 9(color) 112 - 113: 7(fvec4) Load 9(color) - 114: 6(float) CompositeExtract 113 2 - 115: 6(float) Load 24(d4) + 87: 23(ptr) AccessChain 9(color) 22 + 88: 6(float) Load 87 + 89: 6(float) Load 84(d13) + 90: 17(bool) FOrdLessThan 88 89 + SelectionMerge 92 None + BranchConditional 90 91 96 + 91: Label + 93: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 56 56 56 56 + 95: 7(fvec4) FAdd 93 94 + Store 9(color) 95 + Branch 92 + 96: Label + 97: 7(fvec4) Load 9(color) + 98: 7(fvec4) CompositeConstruct 56 56 56 56 + 99: 7(fvec4) FSub 97 98 + Store 9(color) 99 + Branch 92 + 92: Label + 100: 7(fvec4) Load 32(bigColor4) + 101: 7(fvec4) Load 9(color) + 102: 7(fvec4) FAdd 101 100 + Store 9(color) 102 + 103: 23(ptr) AccessChain 9(color) 36 + 104: 6(float) Load 103 + 105: 6(float) Load 27(d4) + 106: 17(bool) FOrdLessThan 104 105 + SelectionMerge 108 None + BranchConditional 106 107 108 + 107: Label + 109: 23(ptr) AccessChain 9(color) 22 + 110: 6(float) Load 109 + 111: 6(float) FAdd 110 43 + 112: 23(ptr) AccessChain 9(color) 22 + Store 112 111 + 113: 23(ptr) AccessChain 9(color) 22 + 114: 6(float) Load 113 + 115: 6(float) Load 27(d4) 116: 17(bool) FOrdLessThan 114 115 SelectionMerge 118 None BranchConditional 116 117 118 117: Label - 119: 7(fvec4) Load 9(color) - 120: 6(float) CompositeExtract 119 0 - 121: 6(float) FAdd 120 53 - 122: 7(fvec4) Load 9(color) - 123: 7(fvec4) CompositeInsert 121 122 0 - Store 9(color) 123 + 119: 23(ptr) AccessChain 9(color) 36 + 120: 6(float) Load 119 + 121: 6(float) FAdd 120 56 + Store 119 121 Branch 78 118: Label - Branch 107 - 107: Label - 125: 7(fvec4) Load 9(color) - 126: 6(float) CompositeExtract 125 1 - 127: 6(float) Load 24(d4) - 128: 17(bool) FOrdLessThan 126 127 - SelectionMerge 130 None - BranchConditional 128 129 137 - 129: Label - 131: 6(float) Load 24(d4) - 132: 7(fvec4) Load 9(color) - 133: 6(float) CompositeExtract 132 1 - 134: 6(float) FAdd 133 131 - 135: 7(fvec4) Load 9(color) - 136: 7(fvec4) CompositeInsert 134 135 1 - Store 9(color) 136 - Branch 130 - 137: Label - 138: 6(float) Load 24(d4) - 139: 7(fvec4) Load 9(color) - 140: 6(float) CompositeExtract 139 0 - 141: 6(float) FAdd 140 138 - 142: 7(fvec4) Load 9(color) - 143: 7(fvec4) CompositeInsert 141 142 0 - Store 9(color) 143 - Branch 130 - 130: Label + Branch 108 + 108: Label + 123: 23(ptr) AccessChain 9(color) 60 + 124: 6(float) Load 123 + 125: 6(float) Load 27(d4) + 126: 17(bool) FOrdLessThan 124 125 + SelectionMerge 128 None + BranchConditional 126 127 134 + 127: Label + 129: 6(float) Load 27(d4) + 130: 23(ptr) AccessChain 9(color) 60 + 131: 6(float) Load 130 + 132: 6(float) FAdd 131 129 + 133: 23(ptr) AccessChain 9(color) 60 + Store 133 132 + Branch 128 + 134: Label + 135: 6(float) Load 27(d4) + 136: 23(ptr) AccessChain 9(color) 36 + 137: 6(float) Load 136 + 138: 6(float) FAdd 137 135 + 139: 23(ptr) AccessChain 9(color) 36 + Store 139 138 + Branch 128 + 128: Label Branch 78 79: Label - 144: 7(fvec4) Load 9(color) - 145: 7(fvec4) CompositeConstruct 53 53 53 53 - 146: 7(fvec4) FAdd 144 145 - Store 9(color) 146 - 149: 7(fvec4) Load 9(color) - Store 148(gl_FragColor) 149 + 140: 7(fvec4) Load 9(color) + 141: 7(fvec4) CompositeConstruct 56 56 56 56 + 142: 7(fvec4) FAdd 140 141 + Store 9(color) 142 + 145: 7(fvec4) Load 9(color) + Store 144(gl_FragColor) 145 Return FunctionEnd diff --git a/Test/baseResults/spv.matFun.vert.out b/Test/baseResults/spv.matFun.vert.out index e46f7962..cc4a4221 100755 --- a/Test/baseResults/spv.matFun.vert.out +++ b/Test/baseResults/spv.matFun.vert.out @@ -3,15 +3,15 @@ spv.matFun.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 93 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 73 92 + Source GLSL 130 Name 4 "main" Name 14 "xf(mf33;vf3;" Name 12 "m" @@ -33,7 +33,6 @@ Linked vertex stage: Name 92 "gl_VertexID" Decorate 69(gl_Position) BuiltIn Position Decorate 92(gl_VertexID) BuiltIn VertexId - Decorate 92(gl_VertexID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.newTexture.frag.out b/Test/baseResults/spv.newTexture.frag.out old mode 100644 new mode 100755 index 60802a1d..96424453 --- a/Test/baseResults/spv.newTexture.frag.out +++ b/Test/baseResults/spv.newTexture.frag.out @@ -5,16 +5,16 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 265 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 55 17 38 26 72 79 69 264 234 ExecutionMode 4 OriginLowerLeft + Source GLSL 430 Name 4 "main" Name 9 "v" Name 13 "s2D" @@ -25,40 +25,30 @@ Linked fragment stage: Name 38 "c3D" Name 47 "s2DShadow" Name 55 "c1D" - Name 67 "ic3D" - Name 70 "ic1D" - Name 77 "ic2D" - Name 86 "sr" - Name 112 "sCube" - Name 123 "s2DArrayShadow" - Name 151 "iv" - Name 155 "is2D" - Name 190 "is3D" - Name 202 "isCube" - Name 214 "is2DArray" - Name 224 "iv2" - Name 228 "sCubeShadow" - Name 233 "FragData" - Name 245 "is2Dms" + Name 69 "ic3D" + Name 72 "ic1D" + Name 79 "ic2D" + Name 88 "sr" + Name 113 "sCube" + Name 124 "s2DArrayShadow" + Name 152 "iv" + Name 156 "is2D" + Name 191 "is3D" + Name 203 "isCube" + Name 215 "is2DArray" + Name 225 "iv2" + Name 229 "sCubeShadow" + Name 234 "FragData" + Name 246 "is2Dms" Name 250 "us2D" Name 254 "us3D" Name 258 "usCube" Name 262 "us2DArray" Name 264 "ic4D" - Decorate 17(c2D) Smooth - Decorate 26(c4D) Smooth - Decorate 38(c3D) Smooth - Decorate 55(c1D) Smooth - Decorate 67(ic3D) Flat - Decorate 70(ic1D) Flat - Decorate 77(ic2D) Flat - Decorate 245(is2Dms) NoStaticUse - Decorate 250(us2D) NoStaticUse - Decorate 254(us3D) NoStaticUse - Decorate 258(usCube) NoStaticUse - Decorate 262(us2DArray) NoStaticUse + Decorate 69(ic3D) Flat + Decorate 72(ic1D) Flat + Decorate 79(ic2D) Flat Decorate 264(ic4D) Flat - Decorate 264(ic4D) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -95,83 +85,86 @@ Linked fragment stage: 53: 51(ivec2) ConstantComposite 52 52 54: TypePointer Input 6(float) 55(c1D): 54(ptr) Variable Input - 65: TypeVector 50(int) 3 - 66: TypePointer Input 65(ivec3) - 67(ic3D): 66(ptr) Variable Input - 69: TypePointer Input 50(int) - 70(ic1D): 69(ptr) Variable Input - 76: TypePointer Input 51(ivec2) - 77(ic2D): 76(ptr) Variable Input - 79: 50(int) Constant 4 - 83: TypeImage 6(float) Rect sampled format:Unknown - 84: TypeSampledImage 83 - 85: TypePointer UniformConstant 84 - 86(sr): 85(ptr) Variable UniformConstant - 89: 51(ivec2) ConstantComposite 79 79 - 109: TypeImage 6(float) Cube sampled format:Unknown - 110: TypeSampledImage 109 - 111: TypePointer UniformConstant 110 - 112(sCube): 111(ptr) Variable UniformConstant - 120: TypeImage 6(float) 2D depth array sampled format:Unknown - 121: TypeSampledImage 120 - 122: TypePointer UniformConstant 121 -123(s2DArrayShadow): 122(ptr) Variable UniformConstant - 149: TypeVector 50(int) 4 - 150: TypePointer Function 149(ivec4) - 152: TypeImage 50(int) 2D sampled format:Unknown - 153: TypeSampledImage 152 - 154: TypePointer UniformConstant 153 - 155(is2D): 154(ptr) Variable UniformConstant - 187: TypeImage 50(int) 3D sampled format:Unknown - 188: TypeSampledImage 187 - 189: TypePointer UniformConstant 188 - 190(is3D): 189(ptr) Variable UniformConstant - 193: 6(float) Constant 1082549862 - 199: TypeImage 50(int) Cube sampled format:Unknown - 200: TypeSampledImage 199 - 201: TypePointer UniformConstant 200 - 202(isCube): 201(ptr) Variable UniformConstant - 211: TypeImage 50(int) 2D array sampled format:Unknown - 212: TypeSampledImage 211 - 213: TypePointer UniformConstant 212 - 214(is2DArray): 213(ptr) Variable UniformConstant - 223: TypePointer Function 51(ivec2) - 225: TypeImage 6(float) Cube depth sampled format:Unknown - 226: TypeSampledImage 225 - 227: TypePointer UniformConstant 226 -228(sCubeShadow): 227(ptr) Variable UniformConstant - 230: 50(int) Constant 2 - 232: TypePointer Output 7(fvec4) - 233(FragData): 232(ptr) Variable Output - 237: 6(float) Constant 0 - 242: TypeImage 50(int) 2D multi-sampled sampled format:Unknown - 243: TypeSampledImage 242 - 244: TypePointer UniformConstant 243 - 245(is2Dms): 244(ptr) Variable UniformConstant - 246: TypeInt 32 0 - 247: TypeImage 246(int) 2D sampled format:Unknown + 59: TypeInt 32 0 + 60: 59(int) Constant 1 + 61: TypePointer Function 6(float) + 67: TypeVector 50(int) 3 + 68: TypePointer Input 67(ivec3) + 69(ic3D): 68(ptr) Variable Input + 71: TypePointer Input 50(int) + 72(ic1D): 71(ptr) Variable Input + 78: TypePointer Input 51(ivec2) + 79(ic2D): 78(ptr) Variable Input + 81: 50(int) Constant 4 + 85: TypeImage 6(float) Rect sampled format:Unknown + 86: TypeSampledImage 85 + 87: TypePointer UniformConstant 86 + 88(sr): 87(ptr) Variable UniformConstant + 91: 51(ivec2) ConstantComposite 81 81 + 110: TypeImage 6(float) Cube sampled format:Unknown + 111: TypeSampledImage 110 + 112: TypePointer UniformConstant 111 + 113(sCube): 112(ptr) Variable UniformConstant + 121: TypeImage 6(float) 2D depth array sampled format:Unknown + 122: TypeSampledImage 121 + 123: TypePointer UniformConstant 122 +124(s2DArrayShadow): 123(ptr) Variable UniformConstant + 131: 59(int) Constant 0 + 150: TypeVector 50(int) 4 + 151: TypePointer Function 150(ivec4) + 153: TypeImage 50(int) 2D sampled format:Unknown + 154: TypeSampledImage 153 + 155: TypePointer UniformConstant 154 + 156(is2D): 155(ptr) Variable UniformConstant + 188: TypeImage 50(int) 3D sampled format:Unknown + 189: TypeSampledImage 188 + 190: TypePointer UniformConstant 189 + 191(is3D): 190(ptr) Variable UniformConstant + 194: 6(float) Constant 1082549862 + 200: TypeImage 50(int) Cube sampled format:Unknown + 201: TypeSampledImage 200 + 202: TypePointer UniformConstant 201 + 203(isCube): 202(ptr) Variable UniformConstant + 212: TypeImage 50(int) 2D array sampled format:Unknown + 213: TypeSampledImage 212 + 214: TypePointer UniformConstant 213 + 215(is2DArray): 214(ptr) Variable UniformConstant + 224: TypePointer Function 51(ivec2) + 226: TypeImage 6(float) Cube depth sampled format:Unknown + 227: TypeSampledImage 226 + 228: TypePointer UniformConstant 227 +229(sCubeShadow): 228(ptr) Variable UniformConstant + 231: 50(int) Constant 2 + 233: TypePointer Output 7(fvec4) + 234(FragData): 233(ptr) Variable Output + 238: 6(float) Constant 0 + 243: TypeImage 50(int) 2D multi-sampled sampled format:Unknown + 244: TypeSampledImage 243 + 245: TypePointer UniformConstant 244 + 246(is2Dms): 245(ptr) Variable UniformConstant + 247: TypeImage 59(int) 2D sampled format:Unknown 248: TypeSampledImage 247 249: TypePointer UniformConstant 248 250(us2D): 249(ptr) Variable UniformConstant - 251: TypeImage 246(int) 3D sampled format:Unknown + 251: TypeImage 59(int) 3D sampled format:Unknown 252: TypeSampledImage 251 253: TypePointer UniformConstant 252 254(us3D): 253(ptr) Variable UniformConstant - 255: TypeImage 246(int) Cube sampled format:Unknown + 255: TypeImage 59(int) Cube sampled format:Unknown 256: TypeSampledImage 255 257: TypePointer UniformConstant 256 258(usCube): 257(ptr) Variable UniformConstant - 259: TypeImage 246(int) 2D array sampled format:Unknown + 259: TypeImage 59(int) 2D array sampled format:Unknown 260: TypeSampledImage 259 261: TypePointer UniformConstant 260 262(us2DArray): 261(ptr) Variable UniformConstant - 263: TypePointer Input 149(ivec4) + 263: TypePointer Input 150(ivec4) 264(ic4D): 263(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function - 151(iv): 150(ptr) Variable Function - 224(iv2): 223(ptr) Variable Function + 152(iv): 151(ptr) Variable Function + 225(iv2): 224(ptr) Variable Function 14: 11 Load 13(s2D) 18: 15(fvec2) Load 17(c2D) 19: 7(fvec4) ImageSampleImplicitLod 14 18 @@ -193,163 +186,160 @@ Linked fragment stage: 56: 6(float) Load 55(c1D) 57: 6(float) CompositeExtract 49 2 58: 6(float) ImageSampleDrefImplicitLod 48 49 57 Bias ConstOffset 56 53 - 59: 7(fvec4) Load 9(v) - 60: 6(float) CompositeExtract 59 1 - 61: 6(float) FAdd 60 58 - 62: 7(fvec4) Load 9(v) - 63: 7(fvec4) CompositeInsert 61 62 1 - Store 9(v) 63 - 64: 21 Load 23(s3D) - 68: 65(ivec3) Load 67(ic3D) - 71: 50(int) Load 70(ic1D) - 72: 7(fvec4) ImageFetch 64 68 Lod 71 - 73: 7(fvec4) Load 9(v) - 74: 7(fvec4) FAdd 73 72 - Store 9(v) 74 - 75: 11 Load 13(s2D) - 78: 51(ivec2) Load 77(ic2D) - 80: 7(fvec4) ImageFetch 75 78 Lod ConstOffset 79 53 - 81: 7(fvec4) Load 9(v) - 82: 7(fvec4) FAdd 81 80 - Store 9(v) 82 - 87: 84 Load 86(sr) - 88: 51(ivec2) Load 77(ic2D) - 90: 7(fvec4) ImageFetch 87 88 ConstOffset 89 - 91: 7(fvec4) Load 9(v) - 92: 7(fvec4) FAdd 91 90 - Store 9(v) 92 - 93: 45 Load 47(s2DShadow) - 94: 36(fvec3) Load 38(c3D) - 95: 6(float) Load 55(c1D) - 96: 6(float) CompositeExtract 94 2 - 97: 6(float) ImageSampleDrefExplicitLod 93 94 96 Lod ConstOffset 95 53 - 98: 7(fvec4) Load 9(v) - 99: 6(float) CompositeExtract 98 1 - 100: 6(float) FAdd 99 97 - 101: 7(fvec4) Load 9(v) - 102: 7(fvec4) CompositeInsert 100 101 1 - Store 9(v) 102 - 103: 11 Load 13(s2D) - 104: 36(fvec3) Load 38(c3D) - 105: 6(float) Load 55(c1D) - 106: 7(fvec4) ImageSampleProjExplicitLod 103 104 Lod ConstOffset 105 53 - 107: 7(fvec4) Load 9(v) - 108: 7(fvec4) FAdd 107 106 - Store 9(v) 108 - 113: 110 Load 112(sCube) - 114: 36(fvec3) Load 38(c3D) + 62: 61(ptr) AccessChain 9(v) 60 + 63: 6(float) Load 62 + 64: 6(float) FAdd 63 58 + 65: 61(ptr) AccessChain 9(v) 60 + Store 65 64 + 66: 21 Load 23(s3D) + 70: 67(ivec3) Load 69(ic3D) + 73: 50(int) Load 72(ic1D) + 74: 7(fvec4) ImageFetch 66 70 Lod 73 + 75: 7(fvec4) Load 9(v) + 76: 7(fvec4) FAdd 75 74 + Store 9(v) 76 + 77: 11 Load 13(s2D) + 80: 51(ivec2) Load 79(ic2D) + 82: 7(fvec4) ImageFetch 77 80 Lod ConstOffset 81 53 + 83: 7(fvec4) Load 9(v) + 84: 7(fvec4) FAdd 83 82 + Store 9(v) 84 + 89: 86 Load 88(sr) + 90: 51(ivec2) Load 79(ic2D) + 92: 7(fvec4) ImageFetch 89 90 ConstOffset 91 + 93: 7(fvec4) Load 9(v) + 94: 7(fvec4) FAdd 93 92 + Store 9(v) 94 + 95: 45 Load 47(s2DShadow) + 96: 36(fvec3) Load 38(c3D) + 97: 6(float) Load 55(c1D) + 98: 6(float) CompositeExtract 96 2 + 99: 6(float) ImageSampleDrefExplicitLod 95 96 98 Lod ConstOffset 97 53 + 100: 61(ptr) AccessChain 9(v) 60 + 101: 6(float) Load 100 + 102: 6(float) FAdd 101 99 + 103: 61(ptr) AccessChain 9(v) 60 + Store 103 102 + 104: 11 Load 13(s2D) + 105: 36(fvec3) Load 38(c3D) + 106: 6(float) Load 55(c1D) + 107: 7(fvec4) ImageSampleProjExplicitLod 104 105 Lod ConstOffset 106 53 + 108: 7(fvec4) Load 9(v) + 109: 7(fvec4) FAdd 108 107 + Store 9(v) 109 + 114: 111 Load 113(sCube) 115: 36(fvec3) Load 38(c3D) 116: 36(fvec3) Load 38(c3D) - 117: 7(fvec4) ImageSampleExplicitLod 113 114 Grad 115 116 - 118: 7(fvec4) Load 9(v) - 119: 7(fvec4) FAdd 118 117 - Store 9(v) 119 - 124: 121 Load 123(s2DArrayShadow) - 125: 7(fvec4) Load 26(c4D) - 126: 15(fvec2) Load 17(c2D) + 117: 36(fvec3) Load 38(c3D) + 118: 7(fvec4) ImageSampleExplicitLod 114 115 Grad 116 117 + 119: 7(fvec4) Load 9(v) + 120: 7(fvec4) FAdd 119 118 + Store 9(v) 120 + 125: 122 Load 124(s2DArrayShadow) + 126: 7(fvec4) Load 26(c4D) 127: 15(fvec2) Load 17(c2D) - 128: 6(float) CompositeExtract 125 3 - 129: 6(float) ImageSampleDrefExplicitLod 124 125 128 Grad ConstOffset 126 127 53 - 130: 7(fvec4) Load 9(v) - 131: 6(float) CompositeExtract 130 0 - 132: 6(float) FAdd 131 129 - 133: 7(fvec4) Load 9(v) - 134: 7(fvec4) CompositeInsert 132 133 0 - Store 9(v) 134 - 135: 21 Load 23(s3D) - 136: 7(fvec4) Load 26(c4D) - 137: 36(fvec3) Load 38(c3D) + 128: 15(fvec2) Load 17(c2D) + 129: 6(float) CompositeExtract 126 3 + 130: 6(float) ImageSampleDrefExplicitLod 125 126 129 Grad ConstOffset 127 128 53 + 132: 61(ptr) AccessChain 9(v) 131 + 133: 6(float) Load 132 + 134: 6(float) FAdd 133 130 + 135: 61(ptr) AccessChain 9(v) 131 + Store 135 134 + 136: 21 Load 23(s3D) + 137: 7(fvec4) Load 26(c4D) 138: 36(fvec3) Load 38(c3D) - 139: 7(fvec4) ImageSampleProjExplicitLod 135 136 Grad 137 138 - 140: 7(fvec4) Load 9(v) - 141: 7(fvec4) FAdd 140 139 - Store 9(v) 141 - 142: 11 Load 13(s2D) - 143: 36(fvec3) Load 38(c3D) - 144: 15(fvec2) Load 17(c2D) + 139: 36(fvec3) Load 38(c3D) + 140: 7(fvec4) ImageSampleProjExplicitLod 136 137 Grad 138 139 + 141: 7(fvec4) Load 9(v) + 142: 7(fvec4) FAdd 141 140 + Store 9(v) 142 + 143: 11 Load 13(s2D) + 144: 36(fvec3) Load 38(c3D) 145: 15(fvec2) Load 17(c2D) - 146: 7(fvec4) ImageSampleProjExplicitLod 142 143 Grad ConstOffset 144 145 53 - 147: 7(fvec4) Load 9(v) - 148: 7(fvec4) FAdd 147 146 - Store 9(v) 148 - 156: 153 Load 155(is2D) - 157: 15(fvec2) Load 17(c2D) - 158: 149(ivec4) ImageSampleImplicitLod 156 157 - Store 151(iv) 158 - 159: 149(ivec4) Load 151(iv) - 160: 7(fvec4) ConvertSToF 159 - 161: 7(fvec4) Load 9(v) - 162: 7(fvec4) FAdd 161 160 - Store 9(v) 162 - 163: 153 Load 155(is2D) - 164: 7(fvec4) Load 26(c4D) - 165: 149(ivec4) ImageSampleProjImplicitLod 163 164 ConstOffset 53 - Store 151(iv) 165 - 166: 149(ivec4) Load 151(iv) - 167: 7(fvec4) ConvertSToF 166 - 168: 7(fvec4) Load 9(v) - 169: 7(fvec4) FAdd 168 167 - Store 9(v) 169 - 170: 153 Load 155(is2D) - 171: 36(fvec3) Load 38(c3D) - 172: 6(float) Load 55(c1D) - 173: 149(ivec4) ImageSampleProjExplicitLod 170 171 Lod 172 - Store 151(iv) 173 - 174: 149(ivec4) Load 151(iv) - 175: 7(fvec4) ConvertSToF 174 - 176: 7(fvec4) Load 9(v) - 177: 7(fvec4) FAdd 176 175 - Store 9(v) 177 - 178: 153 Load 155(is2D) - 179: 36(fvec3) Load 38(c3D) - 180: 15(fvec2) Load 17(c2D) + 146: 15(fvec2) Load 17(c2D) + 147: 7(fvec4) ImageSampleProjExplicitLod 143 144 Grad ConstOffset 145 146 53 + 148: 7(fvec4) Load 9(v) + 149: 7(fvec4) FAdd 148 147 + Store 9(v) 149 + 157: 154 Load 156(is2D) + 158: 15(fvec2) Load 17(c2D) + 159: 150(ivec4) ImageSampleImplicitLod 157 158 + Store 152(iv) 159 + 160: 150(ivec4) Load 152(iv) + 161: 7(fvec4) ConvertSToF 160 + 162: 7(fvec4) Load 9(v) + 163: 7(fvec4) FAdd 162 161 + Store 9(v) 163 + 164: 154 Load 156(is2D) + 165: 7(fvec4) Load 26(c4D) + 166: 150(ivec4) ImageSampleProjImplicitLod 164 165 ConstOffset 53 + Store 152(iv) 166 + 167: 150(ivec4) Load 152(iv) + 168: 7(fvec4) ConvertSToF 167 + 169: 7(fvec4) Load 9(v) + 170: 7(fvec4) FAdd 169 168 + Store 9(v) 170 + 171: 154 Load 156(is2D) + 172: 36(fvec3) Load 38(c3D) + 173: 6(float) Load 55(c1D) + 174: 150(ivec4) ImageSampleProjExplicitLod 171 172 Lod 173 + Store 152(iv) 174 + 175: 150(ivec4) Load 152(iv) + 176: 7(fvec4) ConvertSToF 175 + 177: 7(fvec4) Load 9(v) + 178: 7(fvec4) FAdd 177 176 + Store 9(v) 178 + 179: 154 Load 156(is2D) + 180: 36(fvec3) Load 38(c3D) 181: 15(fvec2) Load 17(c2D) - 182: 149(ivec4) ImageSampleProjExplicitLod 178 179 Grad 180 181 - Store 151(iv) 182 - 183: 149(ivec4) Load 151(iv) - 184: 7(fvec4) ConvertSToF 183 - 185: 7(fvec4) Load 9(v) - 186: 7(fvec4) FAdd 185 184 - Store 9(v) 186 - 191: 188 Load 190(is3D) - 192: 36(fvec3) Load 38(c3D) - 194: 149(ivec4) ImageSampleImplicitLod 191 192 Bias 193 - Store 151(iv) 194 - 195: 149(ivec4) Load 151(iv) - 196: 7(fvec4) ConvertSToF 195 - 197: 7(fvec4) Load 9(v) - 198: 7(fvec4) FAdd 197 196 - Store 9(v) 198 - 203: 200 Load 202(isCube) - 204: 36(fvec3) Load 38(c3D) - 205: 6(float) Load 55(c1D) - 206: 149(ivec4) ImageSampleExplicitLod 203 204 Lod 205 - Store 151(iv) 206 - 207: 149(ivec4) Load 151(iv) - 208: 7(fvec4) ConvertSToF 207 - 209: 7(fvec4) Load 9(v) - 210: 7(fvec4) FAdd 209 208 - Store 9(v) 210 - 215: 212 Load 214(is2DArray) - 216: 65(ivec3) Load 67(ic3D) - 217: 50(int) Load 70(ic1D) - 218: 149(ivec4) ImageFetch 215 216 Lod 217 - Store 151(iv) 218 - 219: 149(ivec4) Load 151(iv) - 220: 7(fvec4) ConvertSToF 219 - 221: 7(fvec4) Load 9(v) - 222: 7(fvec4) FAdd 221 220 - Store 9(v) 222 - 229: 226 Load 228(sCubeShadow) - 231: 51(ivec2) ImageQuerySizeLod 229 230 - Store 224(iv2) 231 - 234: 7(fvec4) Load 9(v) - 235: 51(ivec2) Load 224(iv2) - 236: 15(fvec2) ConvertSToF 235 - 238: 6(float) CompositeExtract 236 0 - 239: 6(float) CompositeExtract 236 1 - 240: 7(fvec4) CompositeConstruct 238 239 237 237 - 241: 7(fvec4) FAdd 234 240 - Store 233(FragData) 241 + 182: 15(fvec2) Load 17(c2D) + 183: 150(ivec4) ImageSampleProjExplicitLod 179 180 Grad 181 182 + Store 152(iv) 183 + 184: 150(ivec4) Load 152(iv) + 185: 7(fvec4) ConvertSToF 184 + 186: 7(fvec4) Load 9(v) + 187: 7(fvec4) FAdd 186 185 + Store 9(v) 187 + 192: 189 Load 191(is3D) + 193: 36(fvec3) Load 38(c3D) + 195: 150(ivec4) ImageSampleImplicitLod 192 193 Bias 194 + Store 152(iv) 195 + 196: 150(ivec4) Load 152(iv) + 197: 7(fvec4) ConvertSToF 196 + 198: 7(fvec4) Load 9(v) + 199: 7(fvec4) FAdd 198 197 + Store 9(v) 199 + 204: 201 Load 203(isCube) + 205: 36(fvec3) Load 38(c3D) + 206: 6(float) Load 55(c1D) + 207: 150(ivec4) ImageSampleExplicitLod 204 205 Lod 206 + Store 152(iv) 207 + 208: 150(ivec4) Load 152(iv) + 209: 7(fvec4) ConvertSToF 208 + 210: 7(fvec4) Load 9(v) + 211: 7(fvec4) FAdd 210 209 + Store 9(v) 211 + 216: 213 Load 215(is2DArray) + 217: 67(ivec3) Load 69(ic3D) + 218: 50(int) Load 72(ic1D) + 219: 150(ivec4) ImageFetch 216 217 Lod 218 + Store 152(iv) 219 + 220: 150(ivec4) Load 152(iv) + 221: 7(fvec4) ConvertSToF 220 + 222: 7(fvec4) Load 9(v) + 223: 7(fvec4) FAdd 222 221 + Store 9(v) 223 + 230: 227 Load 229(sCubeShadow) + 232: 51(ivec2) ImageQuerySizeLod 230 231 + Store 225(iv2) 232 + 235: 7(fvec4) Load 9(v) + 236: 51(ivec2) Load 225(iv2) + 237: 15(fvec2) ConvertSToF 236 + 239: 6(float) CompositeExtract 237 0 + 240: 6(float) CompositeExtract 237 1 + 241: 7(fvec4) CompositeConstruct 239 240 238 238 + 242: 7(fvec4) FAdd 235 241 + Store 234(FragData) 242 Return FunctionEnd diff --git a/Test/baseResults/spv.nonSquare.vert.out b/Test/baseResults/spv.nonSquare.vert.out index 69034909..1ee8262c 100755 --- a/Test/baseResults/spv.nonSquare.vert.out +++ b/Test/baseResults/spv.nonSquare.vert.out @@ -3,15 +3,15 @@ spv.nonSquare.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 90 - Source GLSL 120 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 12 55 + Source GLSL 120 Name 4 "main" Name 9 "a" Name 12 "v3" @@ -21,9 +21,6 @@ Linked vertex stage: Name 28 "gl_Position" Name 55 "v4" Decorate 28(gl_Position) BuiltIn Position - Decorate 74 NoStaticUse - Decorate 78 NoStaticUse - Decorate 89 NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.precision.frag.out b/Test/baseResults/spv.precision.frag.out index 042faa44..32bf094d 100755 --- a/Test/baseResults/spv.precision.frag.out +++ b/Test/baseResults/spv.precision.frag.out @@ -3,16 +3,16 @@ spv.precision.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 110 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 112 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 57 59 23 71 ExecutionMode 4 OriginLowerLeft + Source ESSL 300 Name 4 "main" Name 12 "foo(vf3;" Name 11 "mv3" @@ -31,9 +31,8 @@ Linked fragment stage: Name 63 "global_highp" Name 67 "local_highp" Name 71 "mediumfout" - Name 100 "ub2" - Name 101 "param" - Decorate 23(highfin) Smooth + Name 102 "ub2" + Name 103 "param" Decorate 36(sum) RelaxedPrecision Decorate 38(uniform_medium) RelaxedPrecision Decorate 46(uniform_low) RelaxedPrecision @@ -41,9 +40,7 @@ Linked fragment stage: Decorate 53(arg2) RelaxedPrecision Decorate 55(d) RelaxedPrecision Decorate 57(lowfin) RelaxedPrecision - Decorate 57(lowfin) Smooth Decorate 59(mediumfin) RelaxedPrecision - Decorate 59(mediumfin) Smooth Decorate 71(mediumfout) RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 @@ -74,16 +71,18 @@ Linked fragment stage: 56: TypePointer Input 6(float) 57(lowfin): 56(ptr) Variable Input 59(mediumfin): 56(ptr) Variable Input - 62: TypePointer PrivateGlobal 6(float) -63(global_highp): 62(ptr) Variable PrivateGlobal + 62: TypePointer Private 6(float) +63(global_highp): 62(ptr) Variable Private 66: TypePointer Function 21(fvec4) 70: TypePointer Output 21(fvec4) 71(mediumfout): 70(ptr) Variable Output 80: 34(int) Constant 4 82: TypeVector 34(int) 2 - 99: TypePointer UniformConstant 15(bvec2) - 100(ub2): 99(ptr) Variable UniformConstant - 107: 6(float) Constant 1065353216 + 90: TypeInt 32 0 + 91: 90(int) Constant 0 + 101: TypePointer UniformConstant 15(bvec2) + 102(ub2): 101(ptr) Variable UniformConstant + 109: 6(float) Constant 1065353216 4(main): 2 Function None 3 5: Label 36(sum): 35(ptr) Variable Function @@ -91,7 +90,7 @@ Linked fragment stage: 53(arg2): 50(ptr) Variable Function 55(d): 50(ptr) Variable Function 67(local_highp): 66(ptr) Variable Function - 101(param): 16(ptr) Variable Function + 103(param): 16(ptr) Variable Function 39: 34(int) Load 38(uniform_medium) 41: 34(int) Load 40(uniform_high) 42: 34(int) IAdd 39 41 @@ -108,10 +107,10 @@ Linked fragment stage: Store 53(arg2) 54 58: 6(float) Load 57(lowfin) 60: 6(float) Load 59(mediumfin) - 61: 6(float) ExtInst 1(GLSL.std.450) 66(Distance) 58 60 + 61: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 58 60 Store 55(d) 61 64: 21(fvec4) Load 23(highfin) - 65: 6(float) ExtInst 1(GLSL.std.450) 65(Length) 64 + 65: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 64 Store 63(global_highp) 65 68: 6(float) Load 63(global_highp) 69: 21(fvec4) CompositeConstruct 68 68 68 68 @@ -133,29 +132,29 @@ Linked fragment stage: 87: 34(int) Load 40(uniform_high) 88: 82(ivec2) CompositeConstruct 87 87 89: 82(ivec2) IAdd 86 88 - 90: 34(int) CompositeExtract 89 0 - 91: 34(int) IAdd 80 90 - 92: 34(int) Load 36(sum) - 93: 34(int) IAdd 92 91 - Store 36(sum) 93 + 92: 34(int) CompositeExtract 89 0 + 93: 34(int) IAdd 80 92 94: 34(int) Load 36(sum) - 95: 6(float) ConvertSToF 94 - 96: 21(fvec4) CompositeConstruct 95 95 95 95 - 97: 21(fvec4) Load 71(mediumfout) - 98: 21(fvec4) FAdd 97 96 - Store 71(mediumfout) 98 - 102: 15(bvec2) Load 100(ub2) - Store 101(param) 102 - 103: 14(bool) FunctionCall 19(boolfun(vb2;) 101(param) - SelectionMerge 105 None - BranchConditional 103 104 105 - 104: Label - 106: 21(fvec4) Load 71(mediumfout) - 108: 21(fvec4) CompositeConstruct 107 107 107 107 - 109: 21(fvec4) FAdd 106 108 - Store 71(mediumfout) 109 - Branch 105 - 105: Label + 95: 34(int) IAdd 94 93 + Store 36(sum) 95 + 96: 34(int) Load 36(sum) + 97: 6(float) ConvertSToF 96 + 98: 21(fvec4) CompositeConstruct 97 97 97 97 + 99: 21(fvec4) Load 71(mediumfout) + 100: 21(fvec4) FAdd 99 98 + Store 71(mediumfout) 100 + 104: 15(bvec2) Load 102(ub2) + Store 103(param) 104 + 105: 14(bool) FunctionCall 19(boolfun(vb2;) 103(param) + SelectionMerge 107 None + BranchConditional 105 106 107 + 106: Label + 108: 21(fvec4) Load 71(mediumfout) + 110: 21(fvec4) CompositeConstruct 109 109 109 109 + 111: 21(fvec4) FAdd 108 110 + Store 71(mediumfout) 111 + Branch 107 + 107: Label Return FunctionEnd 12(foo(vf3;): 9(fvec2) Function None 10 diff --git a/Test/baseResults/spv.prepost.frag.out b/Test/baseResults/spv.prepost.frag.out index 22f41a68..f579125e 100755 --- a/Test/baseResults/spv.prepost.frag.out +++ b/Test/baseResults/spv.prepost.frag.out @@ -3,16 +3,16 @@ spv.prepost.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 96 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 94 - Source GLSL 140 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source GLSL 140 Name 4 "main" Name 8 "index" Name 14 "s" @@ -23,8 +23,7 @@ Linked fragment stage: Name 61 "y" Name 66 "z" Name 73 "v" - Name 92 "gl_FragColor" - Decorate 92(gl_FragColor) BuiltIn FragColor + Name 90 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -47,8 +46,12 @@ Linked fragment stage: 74: 10(float) Constant 1077936128 75: 10(float) Constant 1082130432 76: 71(fvec4) ConstantComposite 28 19 74 75 - 91: TypePointer Output 71(fvec4) -92(gl_FragColor): 91(ptr) Variable Output + 77: 11(int) Constant 2 + 81: 11(int) Constant 1 + 83: 11(int) Constant 3 + 87: 11(int) Constant 0 + 89: TypePointer Output 71(fvec4) +90(gl_FragColor): 89(ptr) Variable Output 4(main): 2 Function None 3 5: Label 8(index): 7(ptr) Variable Function @@ -124,27 +127,21 @@ Linked fragment stage: 70: 10(float) FMul 67 68 Store 66(z) 70 Store 73(v) 76 - 77: 71(fvec4) Load 73(v) - 78: 10(float) CompositeExtract 77 2 - 79: 10(float) FSub 78 28 - 80: 71(fvec4) Load 73(v) - 81: 71(fvec4) CompositeInsert 79 80 2 - Store 73(v) 81 - 82: 71(fvec4) Load 73(v) - 83: 71(fvec4) CompositeInsert 78 82 1 - Store 73(v) 83 - 84: 71(fvec4) Load 73(v) - 85: 10(float) CompositeExtract 84 3 + 78: 20(ptr) AccessChain 73(v) 77 + 79: 10(float) Load 78 + 80: 10(float) FSub 79 28 + Store 78 80 + 82: 20(ptr) AccessChain 73(v) 81 + Store 82 79 + 84: 20(ptr) AccessChain 73(v) 83 + 85: 10(float) Load 84 86: 10(float) FSub 85 28 - 87: 71(fvec4) Load 73(v) - 88: 71(fvec4) CompositeInsert 86 87 3 - Store 73(v) 88 - 89: 71(fvec4) Load 73(v) - 90: 71(fvec4) CompositeInsert 86 89 0 - Store 73(v) 90 - 93: 10(float) Load 66(z) - 94: 71(fvec4) Load 73(v) - 95: 71(fvec4) VectorTimesScalar 94 93 - Store 92(gl_FragColor) 95 + Store 84 86 + 88: 20(ptr) AccessChain 73(v) 87 + Store 88 86 + 91: 10(float) Load 66(z) + 92: 71(fvec4) Load 73(v) + 93: 71(fvec4) VectorTimesScalar 92 91 + Store 90(gl_FragColor) 93 Return FunctionEnd diff --git a/Test/baseResults/spv.qualifiers.vert.out b/Test/baseResults/spv.qualifiers.vert.out index 90b7f728..0e5aa43a 100755 --- a/Test/baseResults/spv.qualifiers.vert.out +++ b/Test/baseResults/spv.qualifiers.vert.out @@ -5,15 +5,15 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 25 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 11 9 13 15 17 19 23 24 + Source GLSL 430 Name 4 "main" Name 9 "outVc" Name 11 "inV" @@ -23,15 +23,11 @@ Linked vertex stage: Name 19 "outVcn" Name 23 "gl_VertexID" Name 24 "gl_InstanceID" - Decorate 9(outVc) Smooth - Decorate 13(outVs) Smooth Decorate 15(outVf) Flat - Decorate 17(outVn) Noperspective - Decorate 19(outVcn) Noperspective + Decorate 17(outVn) NoPerspective + Decorate 19(outVcn) NoPerspective Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 23(gl_VertexID) NoStaticUse Decorate 24(gl_InstanceID) BuiltIn InstanceId - Decorate 24(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.queryL.frag.out b/Test/baseResults/spv.queryL.frag.out old mode 100644 new mode 100755 index 2b2b57f8..e9a18e19 --- a/Test/baseResults/spv.queryL.frag.out +++ b/Test/baseResults/spv.queryL.frag.out @@ -5,16 +5,16 @@ Warning, version 430 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 211 - Source GLSL 430 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source GLSL 430 Name 4 "main" Name 9 "lod" Name 13 "samp1D" @@ -41,8 +41,6 @@ Linked fragment stage: Name 176 "usampCubeA" Name 206 "sampBuf" Name 210 "sampRect" - Decorate 206(sampBuf) NoStaticUse - Decorate 210(sampRect) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.set.vert.out b/Test/baseResults/spv.set.vert.out index 77868faf..caff57d1 100755 --- a/Test/baseResults/spv.set.vert.out +++ b/Test/baseResults/spv.set.vert.out @@ -5,35 +5,31 @@ Warning, version 450 is not yet complete; most version-specific features are pre Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 25 - Source GLSL 450 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 9 23 24 + Source GLSL 450 Name 4 "main" Name 9 "color" Name 10 "setBuf" MemberName 10(setBuf) 0 "color" Name 12 "setBufInst" - Name 21 "sampler" + Name 21 "samp2D" Name 23 "gl_VertexID" Name 24 "gl_InstanceID" - Decorate 9(color) Smooth Decorate 10(setBuf) GLSLShared Decorate 10(setBuf) BufferBlock Decorate 12(setBufInst) DescriptorSet 0 Decorate 12(setBufInst) Binding 8 - Decorate 21(sampler) DescriptorSet 4 - Decorate 21(sampler) Binding 7 - Decorate 21(sampler) NoStaticUse + Decorate 21(samp2D) DescriptorSet 4 + Decorate 21(samp2D) Binding 7 Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 23(gl_VertexID) NoStaticUse Decorate 24(gl_InstanceID) BuiltIn InstanceId - Decorate 24(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -49,7 +45,7 @@ Linked vertex stage: 18: TypeImage 6(float) 2D sampled format:Unknown 19: TypeSampledImage 18 20: TypePointer UniformConstant 19 - 21(sampler): 20(ptr) Variable UniformConstant + 21(samp2D): 20(ptr) Variable UniformConstant 22: TypePointer Input 13(int) 23(gl_VertexID): 22(ptr) Variable Input 24(gl_InstanceID): 22(ptr) Variable Input diff --git a/Test/baseResults/spv.shortCircuit.frag.out b/Test/baseResults/spv.shortCircuit.frag.out index 7f152f77..d812be94 100644 --- a/Test/baseResults/spv.shortCircuit.frag.out +++ b/Test/baseResults/spv.shortCircuit.frag.out @@ -5,16 +5,16 @@ Warning, version 400 is not yet complete; most version-specific features are pre Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 143 - Source GLSL 400 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 12 23 ExecutionMode 4 OriginLowerLeft + Source GLSL 400 Name 4 "main" Name 8 "foo(" Name 12 "of1" @@ -27,10 +27,6 @@ Linked fragment stage: Name 138 "uv4" Name 141 "ub41" Name 142 "ub42" - Decorate 136(uiv4) NoStaticUse - Decorate 138(uv4) NoStaticUse - Decorate 141(ub41) NoStaticUse - Decorate 142(ub42) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeBool diff --git a/Test/baseResults/spv.simpleFunctionCall.frag.out b/Test/baseResults/spv.simpleFunctionCall.frag.out index 3c04142d..a8b194b6 100755 --- a/Test/baseResults/spv.simpleFunctionCall.frag.out +++ b/Test/baseResults/spv.simpleFunctionCall.frag.out @@ -5,26 +5,22 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 22 - Source GLSL 150 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 12 ExecutionMode 4 OriginLowerLeft + Source GLSL 150 Name 4 "main" Name 9 "foo(" Name 12 "BaseColor" Name 16 "gl_FragColor" Name 19 "bigColor" Name 21 "d" - Decorate 12(BaseColor) Smooth - Decorate 16(gl_FragColor) BuiltIn FragColor - Decorate 19(bigColor) NoStaticUse - Decorate 21(d) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.simpleMat.vert.out b/Test/baseResults/spv.simpleMat.vert.out index e2502c1c..8963c6b4 100755 --- a/Test/baseResults/spv.simpleMat.vert.out +++ b/Test/baseResults/spv.simpleMat.vert.out @@ -3,15 +3,15 @@ spv.simpleMat.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 43 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 42 - Source GLSL 330 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 15 23 34 19 9 40 41 + Source GLSL 330 Name 4 "main" Name 9 "glPos" Name 12 "mvp" @@ -19,14 +19,10 @@ Linked vertex stage: Name 19 "f" Name 23 "am3" Name 34 "arraym" - Name 41 "gl_VertexID" - Name 42 "gl_InstanceID" - Decorate 9(glPos) Smooth - Decorate 19(f) Smooth - Decorate 41(gl_VertexID) BuiltIn VertexId - Decorate 41(gl_VertexID) NoStaticUse - Decorate 42(gl_InstanceID) BuiltIn InstanceId - Decorate 42(gl_InstanceID) NoStaticUse + Name 40 "gl_VertexID" + Name 41 "gl_InstanceID" + Decorate 40(gl_VertexID) BuiltIn VertexId + Decorate 41(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,29 +42,28 @@ Linked vertex stage: 23(am3): 22(ptr) Variable Input 24: TypeInt 32 1 25: 24(int) Constant 2 - 26: TypePointer Input 20(fvec3) - 30: TypeInt 32 0 - 31: 30(int) Constant 3 + 26: TypeInt 32 0 + 27: 26(int) Constant 1 + 28: TypePointer Input 6(float) + 31: 26(int) Constant 3 32: TypeArray 10 31 33: TypePointer Input 32 34(arraym): 33(ptr) Variable Input 35: 24(int) Constant 1 - 40: TypePointer Input 24(int) - 41(gl_VertexID): 40(ptr) Variable Input -42(gl_InstanceID): 40(ptr) Variable Input + 39: TypePointer Input 24(int) + 40(gl_VertexID): 39(ptr) Variable Input +41(gl_InstanceID): 39(ptr) Variable Input 4(main): 2 Function None 3 5: Label 13: 10 Load 12(mvp) 16: 7(fvec4) Load 15(v) 17: 7(fvec4) MatrixTimesVector 13 16 Store 9(glPos) 17 - 27: 26(ptr) AccessChain 23(am3) 25 - 28: 20(fvec3) Load 27 - 29: 6(float) CompositeExtract 28 1 - 36: 14(ptr) AccessChain 34(arraym) 35 25 - 37: 7(fvec4) Load 36 - 38: 6(float) CompositeExtract 37 3 - 39: 6(float) FAdd 29 38 - Store 19(f) 39 + 29: 28(ptr) AccessChain 23(am3) 25 27 + 30: 6(float) Load 29 + 36: 28(ptr) AccessChain 34(arraym) 35 25 31 + 37: 6(float) Load 36 + 38: 6(float) FAdd 30 37 + Store 19(f) 38 Return FunctionEnd diff --git a/Test/baseResults/spv.structAssignment.frag.out b/Test/baseResults/spv.structAssignment.frag.out index e7cfd0ed..faded479 100755 --- a/Test/baseResults/spv.structAssignment.frag.out +++ b/Test/baseResults/spv.structAssignment.frag.out @@ -5,16 +5,16 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 50 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 44 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "lunarStruct1" MemberName 8(lunarStruct1) 0 "i" @@ -32,12 +32,9 @@ Linked fragment stage: Name 22 "locals2" Name 27 "foo2" Name 31 "gl_FragColor" - Name 40 "sampler" + Name 40 "samp2D" Name 44 "coord" Name 49 "foo" - Decorate 31(gl_FragColor) BuiltIn FragColor - Decorate 44(coord) Smooth - Decorate 49(foo) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -62,7 +59,7 @@ Linked fragment stage: 37: TypeImage 7(float) 2D sampled format:Unknown 38: TypeSampledImage 37 39: TypePointer UniformConstant 38 - 40(sampler): 39(ptr) Variable UniformConstant + 40(samp2D): 39(ptr) Variable UniformConstant 42: TypeVector 7(float) 2 43: TypePointer Input 42(fvec2) 44(coord): 43(ptr) Variable Input @@ -88,7 +85,7 @@ Linked fragment stage: 20: Label 35: 34(ptr) AccessChain 22(locals2) 32 33 36: 7(float) Load 35 - 41: 38 Load 40(sampler) + 41: 38 Load 40(samp2D) 45: 42(fvec2) Load 44(coord) 46: 29(fvec4) ImageSampleImplicitLod 41 45 47: 29(fvec4) VectorTimesScalar 46 36 diff --git a/Test/baseResults/spv.structDeref.frag.out b/Test/baseResults/spv.structDeref.frag.out index 3e37696f..ec0f7623 100755 --- a/Test/baseResults/spv.structDeref.frag.out +++ b/Test/baseResults/spv.structDeref.frag.out @@ -5,16 +5,16 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 120 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 123 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 61 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "s0" MemberName 8(s0) 0 "i" @@ -41,14 +41,11 @@ Linked fragment stage: MemberName 54(s00) 0 "s0_0" Name 56 "locals00" Name 61 "coord" - Name 68 "foo0" - Name 83 "foo00" - Name 96 "gl_FragColor" - Name 113 "sampler" - Name 119 "foo2" - Decorate 61(coord) Smooth - Decorate 96(gl_FragColor) BuiltIn FragColor - Decorate 119(foo2) NoStaticUse + Name 71 "foo0" + Name 86 "foo00" + Name 99 "gl_FragColor" + Name 116 "samp2D" + Name 122 "foo2" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -92,27 +89,30 @@ Linked fragment stage: 59: TypeVector 7(float) 2 60: TypePointer Input 59(fvec2) 61(coord): 60(ptr) Variable Input - 67: TypePointer UniformConstant 8(s0) - 68(foo0): 67(ptr) Variable UniformConstant - 72: 7(float) Constant 1073741824 - 73: 7(float) Constant 1077936128 - 74: 7(float) Constant 1082130432 - 75: 7(float) Constant 1084227584 - 76: 38 ConstantComposite 41 29 72 73 74 75 - 82: TypePointer UniformConstant 54(s00) - 83(foo00): 82(ptr) Variable UniformConstant - 85: TypePointer Function 6(int) - 88: 6(int) Constant 5 - 94: TypeVector 7(float) 4 - 95: TypePointer Output 94(fvec4) -96(gl_FragColor): 95(ptr) Variable Output - 103: 6(int) Constant 3 - 110: TypeImage 7(float) 2D sampled format:Unknown - 111: TypeSampledImage 110 - 112: TypePointer UniformConstant 111 - 113(sampler): 112(ptr) Variable UniformConstant - 118: TypePointer UniformConstant 10(s2) - 119(foo2): 118(ptr) Variable UniformConstant + 62: 11(int) Constant 0 + 63: TypePointer Input 7(float) + 67: 11(int) Constant 1 + 70: TypePointer UniformConstant 8(s0) + 71(foo0): 70(ptr) Variable UniformConstant + 75: 7(float) Constant 1073741824 + 76: 7(float) Constant 1077936128 + 77: 7(float) Constant 1082130432 + 78: 7(float) Constant 1084227584 + 79: 38 ConstantComposite 41 29 75 76 77 78 + 85: TypePointer UniformConstant 54(s00) + 86(foo00): 85(ptr) Variable UniformConstant + 88: TypePointer Function 6(int) + 91: 6(int) Constant 5 + 97: TypeVector 7(float) 4 + 98: TypePointer Output 97(fvec4) +99(gl_FragColor): 98(ptr) Variable Output + 106: 6(int) Constant 3 + 113: TypeImage 7(float) 2D sampled format:Unknown + 114: TypeSampledImage 113 + 115: TypePointer UniformConstant 114 + 116(samp2D): 115(ptr) Variable UniformConstant + 121: TypePointer UniformConstant 10(s2) + 122(foo2): 121(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 27(locals2): 26(ptr) Variable Function @@ -138,55 +138,55 @@ Linked fragment stage: Store 56(locals00) 57 Branch 25 58: Label - 62: 59(fvec2) Load 61(coord) - 63: 7(float) CompositeExtract 62 0 - 64: 30(ptr) AccessChain 27(locals2) 28 - Store 64 63 - 65: 59(fvec2) Load 61(coord) - 66: 7(float) CompositeExtract 65 1 - 69: 8(s0) Load 68(foo0) - 70: 9(s1) CompositeConstruct 28 66 69 - 71: 35(ptr) AccessChain 27(locals2) 32 - Store 71 70 - Store 40(fArray) 76 - 77: 35(ptr) AccessChain 27(locals2) 32 - 78: 9(s1) Load 77 - 79: 35(ptr) AccessChain 46(locals1Array) 47 - Store 79 78 - 80: 67(ptr) AccessChain 49(foo1) 32 - 81: 8(s0) Load 80 - Store 53(locals0) 81 - 84: 54(s00) Load 83(foo00) - Store 56(locals00) 84 + 64: 63(ptr) AccessChain 61(coord) 62 + 65: 7(float) Load 64 + 66: 30(ptr) AccessChain 27(locals2) 28 + Store 66 65 + 68: 63(ptr) AccessChain 61(coord) 67 + 69: 7(float) Load 68 + 72: 8(s0) Load 71(foo0) + 73: 9(s1) CompositeConstruct 28 69 72 + 74: 35(ptr) AccessChain 27(locals2) 32 + Store 74 73 + Store 40(fArray) 79 + 80: 35(ptr) AccessChain 27(locals2) 32 + 81: 9(s1) Load 80 + 82: 35(ptr) AccessChain 46(locals1Array) 47 + Store 82 81 + 83: 70(ptr) AccessChain 49(foo1) 32 + 84: 8(s0) Load 83 + Store 53(locals0) 84 + 87: 54(s00) Load 86(foo00) + Store 56(locals00) 87 Branch 25 25: Label - 86: 85(ptr) AccessChain 53(locals0) 17 - 87: 6(int) Load 86 - 89: 22(bool) SGreaterThan 87 88 - SelectionMerge 91 None - BranchConditional 89 90 91 - 90: Label - 92: 52(ptr) AccessChain 56(locals00) 17 - 93: 8(s0) Load 92 - Store 53(locals0) 93 - Branch 91 - 91: Label - 97: 85(ptr) AccessChain 53(locals0) 17 - 98: 6(int) Load 97 - 99: 7(float) ConvertSToF 98 - 100: 30(ptr) AccessChain 46(locals1Array) 47 28 - 101: 7(float) Load 100 - 102: 7(float) FAdd 99 101 - 104: 30(ptr) AccessChain 40(fArray) 103 - 105: 7(float) Load 104 - 106: 7(float) FAdd 102 105 - 107: 30(ptr) AccessChain 27(locals2) 32 28 + 89: 88(ptr) AccessChain 53(locals0) 17 + 90: 6(int) Load 89 + 92: 22(bool) SGreaterThan 90 91 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 52(ptr) AccessChain 56(locals00) 17 + 96: 8(s0) Load 95 + Store 53(locals0) 96 + Branch 94 + 94: Label + 100: 88(ptr) AccessChain 53(locals0) 17 + 101: 6(int) Load 100 + 102: 7(float) ConvertSToF 101 + 103: 30(ptr) AccessChain 46(locals1Array) 47 28 + 104: 7(float) Load 103 + 105: 7(float) FAdd 102 104 + 107: 30(ptr) AccessChain 40(fArray) 106 108: 7(float) Load 107 - 109: 7(float) FAdd 106 108 - 114: 111 Load 113(sampler) - 115: 59(fvec2) Load 61(coord) - 116: 94(fvec4) ImageSampleImplicitLod 114 115 - 117: 94(fvec4) VectorTimesScalar 116 109 - Store 96(gl_FragColor) 117 + 109: 7(float) FAdd 105 108 + 110: 30(ptr) AccessChain 27(locals2) 32 28 + 111: 7(float) Load 110 + 112: 7(float) FAdd 109 111 + 117: 114 Load 116(samp2D) + 118: 59(fvec2) Load 61(coord) + 119: 97(fvec4) ImageSampleImplicitLod 117 118 + 120: 97(fvec4) VectorTimesScalar 119 112 + Store 99(gl_FragColor) 120 Return FunctionEnd diff --git a/Test/baseResults/spv.structure.frag.out b/Test/baseResults/spv.structure.frag.out index 5ae6fc49..79110b82 100755 --- a/Test/baseResults/spv.structure.frag.out +++ b/Test/baseResults/spv.structure.frag.out @@ -5,16 +5,16 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 61 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 60 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 54 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "scale" Name 18 "lunarStruct1" @@ -26,13 +26,10 @@ Linked fragment stage: MemberName 21(lunarStruct2) 1 "f" MemberName 21(lunarStruct2) 2 "s1_1" Name 24 "foo2" - Name 46 "gl_FragColor" - Name 51 "sampler" - Name 55 "coord" - Name 60 "foo" - Decorate 46(gl_FragColor) BuiltIn FragColor - Decorate 55(coord) Smooth - Decorate 60(foo) NoStaticUse + Name 45 "gl_FragColor" + Name 50 "samp2D" + Name 54 "coord" + Name 59 "foo" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -59,20 +56,20 @@ Linked fragment stage: 28: TypePointer UniformConstant 10(int) 31: TypeBool 35: 10(int) Constant 2 - 36: TypePointer UniformConstant 16(fvec4) + 36: 11(int) Constant 0 + 37: TypePointer UniformConstant 6(float) 41: 10(int) Constant 1 - 42: TypePointer UniformConstant 6(float) - 45: TypePointer Output 16(fvec4) -46(gl_FragColor): 45(ptr) Variable Output - 48: TypeImage 6(float) 2D sampled format:Unknown - 49: TypeSampledImage 48 - 50: TypePointer UniformConstant 49 - 51(sampler): 50(ptr) Variable UniformConstant - 53: TypeVector 6(float) 2 - 54: TypePointer Input 53(fvec2) - 55(coord): 54(ptr) Variable Input - 59: TypePointer UniformConstant 18(lunarStruct1) - 60(foo): 59(ptr) Variable UniformConstant + 44: TypePointer Output 16(fvec4) +45(gl_FragColor): 44(ptr) Variable Output + 47: TypeImage 6(float) 2D sampled format:Unknown + 48: TypeSampledImage 47 + 49: TypePointer UniformConstant 48 + 50(samp2D): 49(ptr) Variable UniformConstant + 52: TypeVector 6(float) 2 + 53: TypePointer Input 52(fvec2) + 54(coord): 53(ptr) Variable Input + 58: TypePointer UniformConstant 18(lunarStruct1) + 59(foo): 58(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 8(scale): 7(ptr) Variable Function @@ -83,22 +80,21 @@ Linked fragment stage: SelectionMerge 34 None BranchConditional 32 33 40 33: Label - 37: 36(ptr) AccessChain 24(foo2) 25 35 35 35 25 - 38: 16(fvec4) Load 37 - 39: 6(float) CompositeExtract 38 0 + 38: 37(ptr) AccessChain 24(foo2) 25 35 35 35 25 36 + 39: 6(float) Load 38 Store 8(scale) 39 Branch 34 40: Label - 43: 42(ptr) AccessChain 24(foo2) 25 35 35 41 25 - 44: 6(float) Load 43 - Store 8(scale) 44 + 42: 37(ptr) AccessChain 24(foo2) 25 35 35 41 25 + 43: 6(float) Load 42 + Store 8(scale) 43 Branch 34 34: Label - 47: 6(float) Load 8(scale) - 52: 49 Load 51(sampler) - 56: 53(fvec2) Load 55(coord) - 57: 16(fvec4) ImageSampleImplicitLod 52 56 - 58: 16(fvec4) VectorTimesScalar 57 47 - Store 46(gl_FragColor) 58 + 46: 6(float) Load 8(scale) + 51: 48 Load 50(samp2D) + 55: 52(fvec2) Load 54(coord) + 56: 16(fvec4) ImageSampleImplicitLod 51 55 + 57: 16(fvec4) VectorTimesScalar 56 46 + Store 45(gl_FragColor) 57 Return FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index a67c6291..97cbcf91 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -8,16 +8,16 @@ WARNING: 0:139: 'switch' : last case/default label not followed by statements Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 260 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 263 - Source ESSL 310 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 73 221 ExecutionMode 4 OriginLowerLeft + Source ESSL 310 Name 4 "main" Name 15 "foo1(vf4;vf4;i1;" Name 12 "v1" @@ -39,14 +39,13 @@ Linked fragment stage: Name 228 "param" Name 230 "param" Name 232 "param" - Name 238 "param" Name 240 "param" Name 242 "param" + Name 244 "param" Decorate 58(local) RelaxedPrecision Decorate 60(c) RelaxedPrecision Decorate 71(f) RelaxedPrecision Decorate 73(x) RelaxedPrecision - Decorate 73(x) Smooth Decorate 127(d) RelaxedPrecision Decorate 153(i) RelaxedPrecision Decorate 171(j) RelaxedPrecision @@ -82,6 +81,9 @@ Linked fragment stage: 221(color): 220(ptr) Variable Output 226: TypePointer UniformConstant 7(fvec4) 227(v): 226(ptr) Variable UniformConstant + 235: TypeInt 32 0 + 236: 235(int) Constant 1 + 247: 235(int) Constant 2 4(main): 2 Function None 3 5: Label 58(local): 10(ptr) Variable Function @@ -91,9 +93,9 @@ Linked fragment stage: 228(param): 8(ptr) Variable Function 230(param): 8(ptr) Variable Function 232(param): 10(ptr) Variable Function - 238(param): 8(ptr) Variable Function 240(param): 8(ptr) Variable Function - 242(param): 10(ptr) Variable Function + 242(param): 8(ptr) Variable Function + 244(param): 10(ptr) Variable Function 61: 9(int) Load 60(c) Store 58(local) 61 62: 9(int) Load 58(local) @@ -218,7 +220,7 @@ Linked fragment stage: 155: Label 158: 9(int) Load 153(i) 161: 160(bool) SLessThan 158 159 - LoopMerge 156 None + LoopMerge 156 155 None BranchConditional 161 157 156 157: Label 162: 9(int) Load 60(c) @@ -237,7 +239,7 @@ Linked fragment stage: 173: Label 176: 9(int) Load 171(j) 178: 160(bool) SLessThan 176 177 - LoopMerge 174 None + LoopMerge 174 173 None BranchConditional 178 175 174 175: Label 179: 6(float) Load 71(f) @@ -310,36 +312,36 @@ Linked fragment stage: 233: 9(int) Load 60(c) Store 232(param) 233 234: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 228(param) 230(param) 232(param) - 235: 6(float) CompositeExtract 234 1 - 236: 6(float) Load 221(color) - 237: 6(float) FAdd 236 235 - Store 221(color) 237 - 239: 7(fvec4) Load 227(v) - Store 238(param) 239 + 237: 6(float) CompositeExtract 234 1 + 238: 6(float) Load 221(color) + 239: 6(float) FAdd 238 237 + Store 221(color) 239 241: 7(fvec4) Load 227(v) Store 240(param) 241 - 243: 9(int) Load 60(c) + 243: 7(fvec4) Load 227(v) Store 242(param) 243 - 244: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 238(param) 240(param) 242(param) - 245: 6(float) CompositeExtract 244 2 - 246: 6(float) Load 221(color) - 247: 6(float) FAdd 246 245 - Store 221(color) 247 - 248: 9(int) Load 60(c) - SelectionMerge 251 None - Switch 248 250 - case 0: 249 - 249: Label - Branch 251 - 250: Label - Branch 251 - 251: Label - 255: 9(int) Load 60(c) - SelectionMerge 257 None - Switch 255 256 - 256: Label - Branch 257 - 257: Label + 245: 9(int) Load 60(c) + Store 244(param) 245 + 246: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 240(param) 242(param) 244(param) + 248: 6(float) CompositeExtract 246 2 + 249: 6(float) Load 221(color) + 250: 6(float) FAdd 249 248 + Store 221(color) 250 + 251: 9(int) Load 60(c) + SelectionMerge 254 None + Switch 251 253 + case 0: 252 + 252: Label + Branch 254 + 253: Label + Branch 254 + 254: Label + 258: 9(int) Load 60(c) + SelectionMerge 260 None + Switch 258 259 + 259: Label + Branch 260 + 260: Label Return FunctionEnd 15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 diff --git a/Test/baseResults/spv.swizzle.frag.out b/Test/baseResults/spv.swizzle.frag.out index 827eb5b3..f66dc4ef 100755 --- a/Test/baseResults/spv.swizzle.frag.out +++ b/Test/baseResults/spv.swizzle.frag.out @@ -3,16 +3,16 @@ spv.swizzle.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 111 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 109 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 30 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 8 "blendscale" Name 12 "w" @@ -21,16 +21,13 @@ Linked fragment stage: Name 18 "w_reorder" Name 20 "w2" Name 22 "w_flow" - Name 29 "t" - Name 48 "w_undef" - Name 55 "p" + Name 30 "t" + Name 49 "w_undef" + Name 56 "p" Name 69 "gl_FragColor" Name 81 "c" Name 83 "rep" - Name 110 "blend" - Decorate 29(t) Smooth - Decorate 69(gl_FragColor) BuiltIn FragColor - Decorate 110(blend) NoStaticUse + Name 108 "blend" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -40,22 +37,27 @@ Linked fragment stage: 11: TypePointer Function 10(fvec4) 13: TypePointer UniformConstant 10(fvec4) 14(u): 13(ptr) Variable UniformConstant - 27: TypeVector 6(float) 2 - 28: TypePointer Input 27(fvec2) - 29(t): 28(ptr) Variable Input - 53: TypeBool - 54: TypePointer UniformConstant 53(bool) - 55(p): 54(ptr) Variable UniformConstant + 25: TypeInt 32 0 + 26: 25(int) Constant 2 + 28: TypeVector 6(float) 2 + 29: TypePointer Input 28(fvec2) + 30(t): 29(ptr) Variable Input + 35: 25(int) Constant 0 + 40: 25(int) Constant 1 + 54: TypeBool + 55: TypePointer UniformConstant 54(bool) + 56(p): 55(ptr) Variable UniformConstant + 60: TypePointer Input 6(float) 68: TypePointer Output 10(fvec4) 69(gl_FragColor): 68(ptr) Variable Output - 80: TypePointer Function 27(fvec2) + 80: TypePointer Function 28(fvec2) 84: 6(float) Constant 0 85: 6(float) Constant 1065353216 86: 10(fvec4) ConstantComposite 84 84 84 85 92: 6(float) Constant 3212836864 - 103: 6(float) Constant 1079613850 - 109: TypePointer UniformConstant 6(float) - 110(blend): 109(ptr) Variable UniformConstant + 102: 6(float) Constant 1079613850 + 107: TypePointer UniformConstant 6(float) + 108(blend): 107(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function @@ -64,7 +66,7 @@ Linked fragment stage: 18(w_reorder): 11(ptr) Variable Function 20(w2): 11(ptr) Variable Function 22(w_flow): 11(ptr) Variable Function - 48(w_undef): 11(ptr) Variable Function + 49(w_undef): 11(ptr) Variable Function 81(c): 80(ptr) Variable Function 83(rep): 11(ptr) Variable Function Store 8(blendscale) 9 @@ -79,58 +81,53 @@ Linked fragment stage: 23: 10(fvec4) Load 14(u) Store 22(w_flow) 23 24: 6(float) Load 8(blendscale) - 25: 10(fvec4) Load 18(w_reorder) - 26: 10(fvec4) CompositeInsert 24 25 2 - Store 18(w_reorder) 26 - 30: 27(fvec2) Load 29(t) - 31: 10(fvec4) Load 12(w) - 32: 10(fvec4) VectorShuffle 31 30 0 5 2 4 - Store 12(w) 32 - 33: 6(float) Load 8(blendscale) - 34: 10(fvec4) Load 18(w_reorder) - 35: 10(fvec4) CompositeInsert 33 34 0 - Store 18(w_reorder) 35 - 36: 10(fvec4) Load 14(u) - 37: 10(fvec4) VectorShuffle 36 36 2 3 0 1 - Store 20(w2) 37 - 38: 6(float) Load 8(blendscale) - 39: 10(fvec4) Load 18(w_reorder) - 40: 10(fvec4) CompositeInsert 38 39 1 - Store 18(w_reorder) 40 - 41: 10(fvec4) Load 20(w2) - 42: 27(fvec2) VectorShuffle 41 41 0 2 - 43: 10(fvec4) Load 16(w_dep) - 44: 10(fvec4) VectorShuffle 43 42 4 5 2 3 - Store 16(w_dep) 44 - 45: 27(fvec2) Load 29(t) - 46: 10(fvec4) Load 16(w_dep) - 47: 10(fvec4) VectorShuffle 46 45 0 1 4 5 - Store 16(w_dep) 47 - 49: 10(fvec4) Load 14(u) - 50: 27(fvec2) VectorShuffle 49 49 2 3 - 51: 10(fvec4) Load 48(w_undef) - 52: 10(fvec4) VectorShuffle 51 50 4 5 2 3 - Store 48(w_undef) 52 - 56: 53(bool) Load 55(p) - SelectionMerge 58 None - BranchConditional 56 57 63 - 57: Label - 59: 27(fvec2) Load 29(t) - 60: 6(float) CompositeExtract 59 0 - 61: 10(fvec4) Load 22(w_flow) - 62: 10(fvec4) CompositeInsert 60 61 0 - Store 22(w_flow) 62 - Branch 58 - 63: Label - 64: 27(fvec2) Load 29(t) - 65: 6(float) CompositeExtract 64 1 - 66: 10(fvec4) Load 22(w_flow) - 67: 10(fvec4) CompositeInsert 65 66 0 - Store 22(w_flow) 67 - Branch 58 - 58: Label + 27: 7(ptr) AccessChain 18(w_reorder) 26 + Store 27 24 + 31: 28(fvec2) Load 30(t) + 32: 10(fvec4) Load 12(w) + 33: 10(fvec4) VectorShuffle 32 31 0 5 2 4 + Store 12(w) 33 + 34: 6(float) Load 8(blendscale) + 36: 7(ptr) AccessChain 18(w_reorder) 35 + Store 36 34 + 37: 10(fvec4) Load 14(u) + 38: 10(fvec4) VectorShuffle 37 37 2 3 0 1 + Store 20(w2) 38 + 39: 6(float) Load 8(blendscale) + 41: 7(ptr) AccessChain 18(w_reorder) 40 + Store 41 39 + 42: 10(fvec4) Load 20(w2) + 43: 28(fvec2) VectorShuffle 42 42 0 2 + 44: 10(fvec4) Load 16(w_dep) + 45: 10(fvec4) VectorShuffle 44 43 4 5 2 3 + Store 16(w_dep) 45 + 46: 28(fvec2) Load 30(t) + 47: 10(fvec4) Load 16(w_dep) + 48: 10(fvec4) VectorShuffle 47 46 0 1 4 5 + Store 16(w_dep) 48 + 50: 10(fvec4) Load 14(u) + 51: 28(fvec2) VectorShuffle 50 50 2 3 + 52: 10(fvec4) Load 49(w_undef) + 53: 10(fvec4) VectorShuffle 52 51 4 5 2 3 + Store 49(w_undef) 53 + 57: 54(bool) Load 56(p) + SelectionMerge 59 None + BranchConditional 57 58 64 + 58: Label + 61: 60(ptr) AccessChain 30(t) 35 + 62: 6(float) Load 61 + 63: 7(ptr) AccessChain 22(w_flow) 35 + Store 63 62 + Branch 59 + 64: Label + 65: 60(ptr) AccessChain 30(t) 40 + 66: 6(float) Load 65 + 67: 7(ptr) AccessChain 22(w_flow) 35 + Store 67 66 + Branch 59 + 59: Label 70: 10(fvec4) Load 18(w_reorder) - 71: 10(fvec4) Load 48(w_undef) + 71: 10(fvec4) Load 49(w_undef) 72: 10(fvec4) Load 12(w) 73: 10(fvec4) Load 20(w2) 74: 10(fvec4) FMul 72 73 @@ -138,39 +135,37 @@ Linked fragment stage: 76: 10(fvec4) FMul 74 75 77: 10(fvec4) Load 22(w_flow) 78: 10(fvec4) FMul 76 77 - 79: 10(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 70 71 78 + 79: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 70 71 78 Store 69(gl_FragColor) 79 - 82: 27(fvec2) Load 29(t) + 82: 28(fvec2) Load 30(t) Store 81(c) 82 Store 83(rep) 86 - 87: 27(fvec2) Load 81(c) - 88: 6(float) CompositeExtract 87 0 - 89: 53(bool) FOrdLessThan 88 84 + 87: 7(ptr) AccessChain 81(c) 35 + 88: 6(float) Load 87 + 89: 54(bool) FOrdLessThan 88 84 SelectionMerge 91 None BranchConditional 89 90 91 90: Label - 93: 27(fvec2) Load 81(c) - 94: 6(float) CompositeExtract 93 0 + 93: 7(ptr) AccessChain 81(c) 35 + 94: 6(float) Load 93 95: 6(float) FMul 94 92 - 96: 27(fvec2) Load 81(c) - 97: 27(fvec2) CompositeInsert 95 96 0 - Store 81(c) 97 + 96: 7(ptr) AccessChain 81(c) 35 + Store 96 95 Branch 91 91: Label - 98: 27(fvec2) Load 81(c) - 99: 6(float) CompositeExtract 98 0 - 100: 53(bool) FOrdLessThanEqual 99 85 - SelectionMerge 102 None - BranchConditional 100 101 102 - 101: Label - 104: 10(fvec4) Load 83(rep) - 105: 10(fvec4) CompositeInsert 103 104 0 - Store 83(rep) 105 - Branch 102 - 102: Label - 106: 10(fvec4) Load 83(rep) - 107: 10(fvec4) Load 69(gl_FragColor) - 108: 10(fvec4) FAdd 107 106 - Store 69(gl_FragColor) 108 + 97: 7(ptr) AccessChain 81(c) 35 + 98: 6(float) Load 97 + 99: 54(bool) FOrdLessThanEqual 98 85 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 103: 7(ptr) AccessChain 83(rep) 35 + Store 103 102 + Branch 101 + 101: Label + 104: 10(fvec4) Load 83(rep) + 105: 10(fvec4) Load 69(gl_FragColor) + 106: 10(fvec4) FAdd 105 104 + Store 69(gl_FragColor) 106 Return FunctionEnd diff --git a/Test/baseResults/spv.test.frag.out b/Test/baseResults/spv.test.frag.out index b8091b73..344d0213 100755 --- a/Test/baseResults/spv.test.frag.out +++ b/Test/baseResults/spv.test.frag.out @@ -1,18 +1,20 @@ spv.test.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 55 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 20 38 ExecutionMode 4 OriginLowerLeft + Source GLSL 400 Name 4 "main" Name 8 "blendscale" Name 12 "v" @@ -25,9 +27,6 @@ Linked fragment stage: Name 44 "gl_FragColor" Name 47 "u" Name 50 "blend" - Decorate 20(t) Smooth - Decorate 38(coords) Smooth - Decorate 44(gl_FragColor) BuiltIn FragColor 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -83,7 +82,7 @@ Linked fragment stage: 51: 6(float) Load 50(blend) 52: 6(float) Load 8(blendscale) 53: 6(float) FMul 51 52 - 54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 45 48 53 + 54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 45 48 53 Store 44(gl_FragColor) 54 Return FunctionEnd diff --git a/Test/baseResults/spv.test.vert.out b/Test/baseResults/spv.test.vert.out old mode 100644 new mode 100755 index c2b921bc..3995baaa --- a/Test/baseResults/spv.test.vert.out +++ b/Test/baseResults/spv.test.vert.out @@ -5,15 +5,15 @@ WARNING: 0:5: attribute deprecated in version 130; may be removed in future rele Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 27 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 21 11 9 26 + Source GLSL 130 Name 4 "main" Name 9 "uv" Name 11 "uv_in" @@ -21,10 +21,8 @@ Linked vertex stage: Name 18 "transform" Name 21 "position" Name 26 "gl_VertexID" - Decorate 9(uv) Smooth Decorate 15(gl_Position) BuiltIn Position Decorate 26(gl_VertexID) BuiltIn VertexId - Decorate 26(gl_VertexID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.texture.frag.out b/Test/baseResults/spv.texture.frag.out old mode 100644 new mode 100755 index b6a139e1..b6efb4aa --- a/Test/baseResults/spv.texture.frag.out +++ b/Test/baseResults/spv.texture.frag.out @@ -6,16 +6,16 @@ WARNING: 0:15: varying deprecated in version 130; may be removed in future relea Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 290 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 289 47 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "blendscale" Name 10 "bias" @@ -41,11 +41,6 @@ Linked fragment stage: Name 282 "blend" Name 288 "scale" Name 289 "t" - Decorate 47(coords2D) Smooth - Decorate 276(gl_FragColor) BuiltIn FragColor - Decorate 288(scale) NoStaticUse - Decorate 289(t) Smooth - Decorate 289(t) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -241,69 +236,69 @@ Linked fragment stage: 141: 16(fvec3) Load 18(coords3D) 142: 6(float) CompositeExtract 141 2 143: 6(float) ImageSampleDrefImplicitLod 140 141 142 - 144: 22(fvec4) CompositeConstruct 143 143 143 143 - 145: 22(fvec4) Load 26(color) - 146: 22(fvec4) FAdd 145 144 + 144: 22(fvec4) Load 26(color) + 145: 22(fvec4) CompositeConstruct 143 143 143 143 + 146: 22(fvec4) FAdd 144 145 Store 26(color) 146 147: 137 Load 139(shadowSampler1D) 148: 16(fvec3) Load 18(coords3D) 149: 6(float) Load 10(bias) 150: 6(float) CompositeExtract 148 2 151: 6(float) ImageSampleDrefImplicitLod 147 148 150 Bias 149 - 152: 22(fvec4) CompositeConstruct 151 151 151 151 - 153: 22(fvec4) Load 26(color) - 154: 22(fvec4) FAdd 153 152 + 152: 22(fvec4) Load 26(color) + 153: 22(fvec4) CompositeConstruct 151 151 151 151 + 154: 22(fvec4) FAdd 152 153 Store 26(color) 154 159: 156 Load 158(shadowSampler2D) 160: 16(fvec3) Load 18(coords3D) 161: 6(float) CompositeExtract 160 2 162: 6(float) ImageSampleDrefImplicitLod 159 160 161 - 163: 22(fvec4) CompositeConstruct 162 162 162 162 - 164: 22(fvec4) Load 26(color) - 165: 22(fvec4) FAdd 164 163 + 163: 22(fvec4) Load 26(color) + 164: 22(fvec4) CompositeConstruct 162 162 162 162 + 165: 22(fvec4) FAdd 163 164 Store 26(color) 165 166: 156 Load 158(shadowSampler2D) 167: 16(fvec3) Load 18(coords3D) 168: 6(float) Load 10(bias) 169: 6(float) CompositeExtract 167 2 170: 6(float) ImageSampleDrefImplicitLod 166 167 169 Bias 168 - 171: 22(fvec4) CompositeConstruct 170 170 170 170 - 172: 22(fvec4) Load 26(color) - 173: 22(fvec4) FAdd 172 171 + 171: 22(fvec4) Load 26(color) + 172: 22(fvec4) CompositeConstruct 170 170 170 170 + 173: 22(fvec4) FAdd 171 172 Store 26(color) 173 174: 137 Load 139(shadowSampler1D) 175: 22(fvec4) Load 24(coords4D) 176: 6(float) CompositeExtract 175 3 177: 6(float) ImageSampleProjDrefImplicitLod 174 175 176 - 178: 22(fvec4) CompositeConstruct 177 177 177 177 - 179: 22(fvec4) Load 26(color) - 180: 22(fvec4) FAdd 179 178 + 178: 22(fvec4) Load 26(color) + 179: 22(fvec4) CompositeConstruct 177 177 177 177 + 180: 22(fvec4) FAdd 178 179 Store 26(color) 180 181: 137 Load 139(shadowSampler1D) 182: 22(fvec4) Load 24(coords4D) 183: 6(float) Load 10(bias) 184: 6(float) CompositeExtract 182 3 185: 6(float) ImageSampleProjDrefImplicitLod 181 182 184 Bias 183 - 186: 22(fvec4) CompositeConstruct 185 185 185 185 - 187: 22(fvec4) Load 26(color) - 188: 22(fvec4) FAdd 187 186 + 186: 22(fvec4) Load 26(color) + 187: 22(fvec4) CompositeConstruct 185 185 185 185 + 188: 22(fvec4) FAdd 186 187 Store 26(color) 188 189: 156 Load 158(shadowSampler2D) 190: 22(fvec4) Load 24(coords4D) 191: 6(float) CompositeExtract 190 3 192: 6(float) ImageSampleProjDrefImplicitLod 189 190 191 - 193: 22(fvec4) CompositeConstruct 192 192 192 192 - 194: 22(fvec4) Load 26(color) - 195: 22(fvec4) FAdd 194 193 + 193: 22(fvec4) Load 26(color) + 194: 22(fvec4) CompositeConstruct 192 192 192 192 + 195: 22(fvec4) FAdd 193 194 Store 26(color) 195 196: 156 Load 158(shadowSampler2D) 197: 22(fvec4) Load 24(coords4D) 198: 6(float) Load 10(bias) 199: 6(float) CompositeExtract 197 3 200: 6(float) ImageSampleProjDrefImplicitLod 196 197 199 Bias 198 - 201: 22(fvec4) CompositeConstruct 200 200 200 200 - 202: 22(fvec4) Load 26(color) - 203: 22(fvec4) FAdd 202 201 + 201: 22(fvec4) Load 26(color) + 202: 22(fvec4) CompositeConstruct 200 200 200 200 + 203: 22(fvec4) FAdd 201 202 Store 26(color) 203 Store 207(iCoords2D) 210 Store 212(iLod) 213 @@ -375,7 +370,7 @@ Linked fragment stage: 283: 6(float) Load 282(blend) 284: 6(float) Load 8(blendscale) 285: 6(float) FMul 283 284 - 286: 22(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 277 280 285 + 286: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 277 280 285 Store 276(gl_FragColor) 286 Return FunctionEnd diff --git a/Test/baseResults/spv.texture.vert.out b/Test/baseResults/spv.texture.vert.out index 957a1ebe..807b03d0 100755 --- a/Test/baseResults/spv.texture.vert.out +++ b/Test/baseResults/spv.texture.vert.out @@ -3,15 +3,15 @@ spv.texture.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 145 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 39 144 + Source GLSL 130 Name 4 "main" Name 8 "lod" Name 10 "coords1D" @@ -29,7 +29,6 @@ Linked vertex stage: Name 144 "gl_VertexID" Decorate 140(gl_Position) BuiltIn Position Decorate 144(gl_VertexID) BuiltIn VertexId - Decorate 144(gl_VertexID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -159,36 +158,36 @@ Linked vertex stage: 105: 6(float) Load 8(lod) 106: 6(float) CompositeExtract 104 2 107: 6(float) ImageSampleDrefExplicitLod 103 104 106 Lod 105 - 108: 18(fvec4) CompositeConstruct 107 107 107 107 - 109: 18(fvec4) Load 23(color) - 110: 18(fvec4) FAdd 109 108 + 108: 18(fvec4) Load 23(color) + 109: 18(fvec4) CompositeConstruct 107 107 107 107 + 110: 18(fvec4) FAdd 108 109 Store 23(color) 110 115: 112 Load 114(shadowSampler2D) 116: 12(fvec3) Load 14(coords3D) 117: 6(float) Load 8(lod) 118: 6(float) CompositeExtract 116 2 119: 6(float) ImageSampleDrefExplicitLod 115 116 118 Lod 117 - 120: 18(fvec4) CompositeConstruct 119 119 119 119 - 121: 18(fvec4) Load 23(color) - 122: 18(fvec4) FAdd 121 120 + 120: 18(fvec4) Load 23(color) + 121: 18(fvec4) CompositeConstruct 119 119 119 119 + 122: 18(fvec4) FAdd 120 121 Store 23(color) 122 123: 100 Load 102(shadowSampler1D) 124: 18(fvec4) Load 20(coords4D) 125: 6(float) Load 8(lod) 126: 6(float) CompositeExtract 124 3 127: 6(float) ImageSampleProjDrefExplicitLod 123 124 126 Lod 125 - 128: 18(fvec4) CompositeConstruct 127 127 127 127 - 129: 18(fvec4) Load 23(color) - 130: 18(fvec4) FAdd 129 128 + 128: 18(fvec4) Load 23(color) + 129: 18(fvec4) CompositeConstruct 127 127 127 127 + 130: 18(fvec4) FAdd 128 129 Store 23(color) 130 131: 112 Load 114(shadowSampler2D) 132: 18(fvec4) Load 20(coords4D) 133: 6(float) Load 8(lod) 134: 6(float) CompositeExtract 132 3 135: 6(float) ImageSampleProjDrefExplicitLod 131 132 134 Lod 133 - 136: 18(fvec4) CompositeConstruct 135 135 135 135 - 137: 18(fvec4) Load 23(color) - 138: 18(fvec4) FAdd 137 136 + 136: 18(fvec4) Load 23(color) + 137: 18(fvec4) CompositeConstruct 135 135 135 135 + 138: 18(fvec4) FAdd 136 137 Store 23(color) 138 141: 18(fvec4) Load 23(color) Store 140(gl_Position) 141 diff --git a/Test/baseResults/spv.types.frag.out b/Test/baseResults/spv.types.frag.out index 27e4d6fe..82b97a28 100755 --- a/Test/baseResults/spv.types.frag.out +++ b/Test/baseResults/spv.types.frag.out @@ -3,16 +3,16 @@ spv.types.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 263 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 268 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 94 104 114 124 134 144 154 164 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "b" Name 10 "u_b" @@ -55,11 +55,6 @@ Linked fragment stage: Decorate 104(i_i2) Flat Decorate 114(i_i3) Flat Decorate 124(i_i4) Flat - Decorate 134(i_f) Smooth - Decorate 144(i_f2) Smooth - Decorate 154(i_f3) Smooth - Decorate 164(i_f4) Smooth - Decorate 168(gl_FragColor) BuiltIn FragColor 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -132,8 +127,13 @@ Linked fragment stage: 164(i_f4): 163(ptr) Variable Input 167: TypePointer Output 157(fvec4) 168(gl_FragColor): 167(ptr) Variable Output - 260: 127(float) Constant 1065353216 - 261: 157(fvec4) ConstantComposite 260 260 260 260 + 201: TypeInt 32 0 + 202: 201(int) Constant 0 + 206: 201(int) Constant 1 + 216: 201(int) Constant 2 + 229: 201(int) Constant 3 + 265: 127(float) Constant 1065353216 + 266: 157(fvec4) ConstantComposite 265 265 265 265 4(main): 2 Function None 3 5: Label 8(b): 7(ptr) Variable Function @@ -271,74 +271,74 @@ Linked fragment stage: 196: 6(bool) CompositeExtract 195 3 197: 6(bool) LogicalOr 194 196 SelectionMerge 199 None - BranchConditional 197 198 259 + BranchConditional 197 198 264 198: Label 200: 87(int) Load 89(i) - 201: 97(ivec2) Load 99(i2) - 202: 87(int) CompositeExtract 201 0 - 203: 87(int) IAdd 200 202 - 204: 97(ivec2) Load 99(i2) - 205: 87(int) CompositeExtract 204 1 - 206: 87(int) IAdd 203 205 - 207: 107(ivec3) Load 109(i3) - 208: 87(int) CompositeExtract 207 0 - 209: 87(int) IAdd 206 208 - 210: 107(ivec3) Load 109(i3) - 211: 87(int) CompositeExtract 210 1 + 203: 88(ptr) AccessChain 99(i2) 202 + 204: 87(int) Load 203 + 205: 87(int) IAdd 200 204 + 207: 88(ptr) AccessChain 99(i2) 206 + 208: 87(int) Load 207 + 209: 87(int) IAdd 205 208 + 210: 88(ptr) AccessChain 109(i3) 202 + 211: 87(int) Load 210 212: 87(int) IAdd 209 211 - 213: 107(ivec3) Load 109(i3) - 214: 87(int) CompositeExtract 213 2 + 213: 88(ptr) AccessChain 109(i3) 206 + 214: 87(int) Load 213 215: 87(int) IAdd 212 214 - 216: 117(ivec4) Load 119(i4) - 217: 87(int) CompositeExtract 216 0 - 218: 87(int) IAdd 215 217 - 219: 117(ivec4) Load 119(i4) - 220: 87(int) CompositeExtract 219 1 - 221: 87(int) IAdd 218 220 - 222: 117(ivec4) Load 119(i4) - 223: 87(int) CompositeExtract 222 2 - 224: 87(int) IAdd 221 223 - 225: 117(ivec4) Load 119(i4) - 226: 87(int) CompositeExtract 225 3 - 227: 87(int) IAdd 224 226 - 228: 127(float) ConvertSToF 227 - 229: 127(float) Load 129(f) - 230: 127(float) FAdd 228 229 - 231: 137(fvec2) Load 139(f2) - 232: 127(float) CompositeExtract 231 0 - 233: 127(float) FAdd 230 232 - 234: 137(fvec2) Load 139(f2) - 235: 127(float) CompositeExtract 234 1 - 236: 127(float) FAdd 233 235 - 237: 147(fvec3) Load 149(f3) - 238: 127(float) CompositeExtract 237 0 - 239: 127(float) FAdd 236 238 - 240: 147(fvec3) Load 149(f3) - 241: 127(float) CompositeExtract 240 1 - 242: 127(float) FAdd 239 241 - 243: 147(fvec3) Load 149(f3) - 244: 127(float) CompositeExtract 243 2 - 245: 127(float) FAdd 242 244 - 246: 157(fvec4) Load 159(f4) - 247: 127(float) CompositeExtract 246 0 - 248: 127(float) FAdd 245 247 - 249: 157(fvec4) Load 159(f4) - 250: 127(float) CompositeExtract 249 1 - 251: 127(float) FAdd 248 250 - 252: 157(fvec4) Load 159(f4) - 253: 127(float) CompositeExtract 252 2 - 254: 127(float) FAdd 251 253 - 255: 157(fvec4) Load 159(f4) - 256: 127(float) CompositeExtract 255 3 - 257: 127(float) FAdd 254 256 - 258: 157(fvec4) CompositeConstruct 257 257 257 257 - Store 169 258 + 217: 88(ptr) AccessChain 109(i3) 216 + 218: 87(int) Load 217 + 219: 87(int) IAdd 215 218 + 220: 88(ptr) AccessChain 119(i4) 202 + 221: 87(int) Load 220 + 222: 87(int) IAdd 219 221 + 223: 88(ptr) AccessChain 119(i4) 206 + 224: 87(int) Load 223 + 225: 87(int) IAdd 222 224 + 226: 88(ptr) AccessChain 119(i4) 216 + 227: 87(int) Load 226 + 228: 87(int) IAdd 225 227 + 230: 88(ptr) AccessChain 119(i4) 229 + 231: 87(int) Load 230 + 232: 87(int) IAdd 228 231 + 233: 127(float) ConvertSToF 232 + 234: 127(float) Load 129(f) + 235: 127(float) FAdd 233 234 + 236: 128(ptr) AccessChain 139(f2) 202 + 237: 127(float) Load 236 + 238: 127(float) FAdd 235 237 + 239: 128(ptr) AccessChain 139(f2) 206 + 240: 127(float) Load 239 + 241: 127(float) FAdd 238 240 + 242: 128(ptr) AccessChain 149(f3) 202 + 243: 127(float) Load 242 + 244: 127(float) FAdd 241 243 + 245: 128(ptr) AccessChain 149(f3) 206 + 246: 127(float) Load 245 + 247: 127(float) FAdd 244 246 + 248: 128(ptr) AccessChain 149(f3) 216 + 249: 127(float) Load 248 + 250: 127(float) FAdd 247 249 + 251: 128(ptr) AccessChain 159(f4) 202 + 252: 127(float) Load 251 + 253: 127(float) FAdd 250 252 + 254: 128(ptr) AccessChain 159(f4) 206 + 255: 127(float) Load 254 + 256: 127(float) FAdd 253 255 + 257: 128(ptr) AccessChain 159(f4) 216 + 258: 127(float) Load 257 + 259: 127(float) FAdd 256 258 + 260: 128(ptr) AccessChain 159(f4) 229 + 261: 127(float) Load 260 + 262: 127(float) FAdd 259 261 + 263: 157(fvec4) CompositeConstruct 262 262 262 262 + Store 169 263 Branch 199 - 259: Label - Store 169 261 + 264: Label + Store 169 266 Branch 199 199: Label - 262: 157(fvec4) Load 169 - Store 168(gl_FragColor) 262 + 267: 157(fvec4) Load 169 + Store 168(gl_FragColor) 267 Return FunctionEnd diff --git a/Test/baseResults/spv.uint.frag.out b/Test/baseResults/spv.uint.frag.out index d7951a98..3cf1a76f 100755 --- a/Test/baseResults/spv.uint.frag.out +++ b/Test/baseResults/spv.uint.frag.out @@ -3,64 +3,58 @@ spv.uint.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 206 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 207 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 15 200 77 68 ExecutionMode 4 OriginLowerLeft + Source ESSL 300 Name 4 "main" Name 8 "count" Name 12 "u" Name 15 "t" - Name 53 "shiftedii" - Name 55 "shiftedui" - Name 57 "shiftediu" - Name 58 "shifteduu" - Name 66 "c" - Name 70 "usampler" - Name 75 "tc" - Name 108 "af" - Name 112 "ab" - Name 116 "ai" - Name 151 "mask1" - Name 153 "mask2" - Name 155 "mask3" - Name 159 "mask4" - Name 199 "f" - Name 201 "v" - Name 203 "i" - Name 205 "b" + Name 55 "shiftedii" + Name 57 "shiftedui" + Name 59 "shiftediu" + Name 60 "shifteduu" + Name 68 "c" + Name 72 "usampler" + Name 77 "tc" + Name 111 "af" + Name 115 "ab" + Name 118 "ai" + Name 152 "mask1" + Name 154 "mask2" + Name 156 "mask3" + Name 160 "mask4" + Name 200 "f" + Name 202 "v" + Name 204 "i" + Name 206 "b" Decorate 8(count) RelaxedPrecision Decorate 12(u) RelaxedPrecision Decorate 15(t) RelaxedPrecision Decorate 15(t) Flat - Decorate 53(shiftedii) RelaxedPrecision - Decorate 55(shiftedui) RelaxedPrecision - Decorate 57(shiftediu) RelaxedPrecision - Decorate 58(shifteduu) RelaxedPrecision - Decorate 66(c) RelaxedPrecision - Decorate 70(usampler) RelaxedPrecision - Decorate 75(tc) RelaxedPrecision - Decorate 75(tc) Smooth - Decorate 108(af) RelaxedPrecision - Decorate 116(ai) RelaxedPrecision - Decorate 151(mask1) RelaxedPrecision - Decorate 153(mask2) RelaxedPrecision - Decorate 155(mask3) RelaxedPrecision - Decorate 159(mask4) RelaxedPrecision - Decorate 199(f) RelaxedPrecision - Decorate 199(f) Smooth - Decorate 199(f) NoStaticUse - Decorate 201(v) RelaxedPrecision - Decorate 201(v) NoStaticUse - Decorate 203(i) RelaxedPrecision - Decorate 203(i) NoStaticUse - Decorate 205(b) NoStaticUse + Decorate 55(shiftedii) RelaxedPrecision + Decorate 57(shiftedui) RelaxedPrecision + Decorate 59(shiftediu) RelaxedPrecision + Decorate 60(shifteduu) RelaxedPrecision + Decorate 68(c) RelaxedPrecision + Decorate 72(usampler) RelaxedPrecision + Decorate 77(tc) RelaxedPrecision + Decorate 111(af) RelaxedPrecision + Decorate 118(ai) RelaxedPrecision + Decorate 152(mask1) RelaxedPrecision + Decorate 154(mask2) RelaxedPrecision + Decorate 156(mask3) RelaxedPrecision + Decorate 160(mask4) RelaxedPrecision + Decorate 200(f) RelaxedPrecision + Decorate 202(v) RelaxedPrecision + Decorate 204(i) RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -71,285 +65,286 @@ Linked fragment stage: 13: TypeVector 10(int) 2 14: TypePointer Input 13(ivec2) 15(t): 14(ptr) Variable Input - 18: 10(int) Constant 3 - 20: TypeBool - 21: 20(bool) ConstantTrue - 24: 6(int) Constant 2 - 29: 6(int) Constant 3 - 32: 20(bool) ConstantFalse - 35: 6(int) Constant 5 - 40: 6(int) Constant 7 - 45: 6(int) Constant 11 - 50: 6(int) Constant 13 - 54: 6(int) Constant 4294967295 - 56: 10(int) Constant 4194303 - 64: TypeVector 10(int) 4 - 65: TypePointer Output 64(ivec4) - 66(c): 65(ptr) Variable Output - 67: TypeImage 10(int) 2D sampled format:Unknown - 68: TypeSampledImage 67 - 69: TypePointer UniformConstant 68 - 70(usampler): 69(ptr) Variable UniformConstant - 72: TypeFloat 32 - 73: TypeVector 72(float) 2 - 74: TypePointer Input 73(fvec2) - 75(tc): 74(ptr) Variable Input - 85: 72(float) Constant 1065353216 - 97: 72(float) Constant 1073741824 - 98: 73(fvec2) ConstantComposite 97 97 - 103: 10(int) Constant 4 - 107: TypePointer Function 72(float) - 111: TypePointer Function 20(bool) - 114: 10(int) Constant 0 - 122: 10(int) Constant 1 - 133: 6(int) Constant 17 - 138: 6(int) Constant 19 - 143: 6(int) Constant 23 - 148: 6(int) Constant 27 - 152: 10(int) Constant 161 - 154: 10(int) Constant 2576 - 157: 6(int) Constant 4 - 160: 10(int) Constant 2737 - 198: TypePointer Input 72(float) - 199(f): 198(ptr) Variable Input - 200: TypePointer UniformConstant 64(ivec4) - 201(v): 200(ptr) Variable UniformConstant - 202: TypePointer UniformConstant 6(int) - 203(i): 202(ptr) Variable UniformConstant - 204: TypePointer UniformConstant 20(bool) - 205(b): 204(ptr) Variable UniformConstant + 16: 10(int) Constant 1 + 17: TypePointer Input 10(int) + 20: 10(int) Constant 3 + 22: TypeBool + 23: 22(bool) ConstantTrue + 26: 6(int) Constant 2 + 31: 6(int) Constant 3 + 34: 22(bool) ConstantFalse + 37: 6(int) Constant 5 + 42: 6(int) Constant 7 + 47: 6(int) Constant 11 + 52: 6(int) Constant 13 + 56: 6(int) Constant 4294967295 + 58: 10(int) Constant 4194303 + 66: TypeVector 10(int) 4 + 67: TypePointer Output 66(ivec4) + 68(c): 67(ptr) Variable Output + 69: TypeImage 10(int) 2D sampled format:Unknown + 70: TypeSampledImage 69 + 71: TypePointer UniformConstant 70 + 72(usampler): 71(ptr) Variable UniformConstant + 74: TypeFloat 32 + 75: TypeVector 74(float) 2 + 76: TypePointer Input 75(fvec2) + 77(tc): 76(ptr) Variable Input + 87: 74(float) Constant 1065353216 + 99: 74(float) Constant 1073741824 + 100: 75(fvec2) ConstantComposite 99 99 + 103: 10(int) Constant 0 + 106: 10(int) Constant 4 + 110: TypePointer Function 74(float) + 114: TypePointer Function 22(bool) + 134: 6(int) Constant 17 + 139: 6(int) Constant 19 + 144: 6(int) Constant 23 + 149: 6(int) Constant 27 + 153: 10(int) Constant 161 + 155: 10(int) Constant 2576 + 158: 6(int) Constant 4 + 161: 10(int) Constant 2737 + 199: TypePointer Input 74(float) + 200(f): 199(ptr) Variable Input + 201: TypePointer UniformConstant 66(ivec4) + 202(v): 201(ptr) Variable UniformConstant + 203: TypePointer UniformConstant 6(int) + 204(i): 203(ptr) Variable UniformConstant + 205: TypePointer UniformConstant 22(bool) + 206(b): 205(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 8(count): 7(ptr) Variable Function 12(u): 11(ptr) Variable Function - 53(shiftedii): 7(ptr) Variable Function - 55(shiftedui): 11(ptr) Variable Function - 57(shiftediu): 7(ptr) Variable Function - 58(shifteduu): 11(ptr) Variable Function - 108(af): 107(ptr) Variable Function - 112(ab): 111(ptr) Variable Function - 116(ai): 7(ptr) Variable Function - 151(mask1): 11(ptr) Variable Function - 153(mask2): 11(ptr) Variable Function - 155(mask3): 11(ptr) Variable Function - 159(mask4): 11(ptr) Variable Function + 55(shiftedii): 7(ptr) Variable Function + 57(shiftedui): 11(ptr) Variable Function + 59(shiftediu): 7(ptr) Variable Function + 60(shifteduu): 11(ptr) Variable Function + 111(af): 110(ptr) Variable Function + 115(ab): 114(ptr) Variable Function + 118(ai): 7(ptr) Variable Function + 152(mask1): 11(ptr) Variable Function + 154(mask2): 11(ptr) Variable Function + 156(mask3): 11(ptr) Variable Function + 160(mask4): 11(ptr) Variable Function Store 8(count) 9 - 16: 13(ivec2) Load 15(t) - 17: 10(int) CompositeExtract 16 1 - 19: 10(int) IAdd 17 18 - Store 12(u) 19 - SelectionMerge 23 None - BranchConditional 21 22 23 - 22: Label - 25: 6(int) Load 8(count) - 26: 6(int) IMul 25 24 - Store 8(count) 26 - Branch 23 - 23: Label - SelectionMerge 28 None - BranchConditional 21 27 28 - 27: Label - 30: 6(int) Load 8(count) - 31: 6(int) IMul 30 29 - Store 8(count) 31 - Branch 28 - 28: Label - SelectionMerge 34 None - BranchConditional 32 33 34 - 33: Label - 36: 6(int) Load 8(count) - 37: 6(int) IMul 36 35 - Store 8(count) 37 - Branch 34 - 34: Label - SelectionMerge 39 None - BranchConditional 21 38 39 - 38: Label - 41: 6(int) Load 8(count) - 42: 6(int) IMul 41 40 - Store 8(count) 42 - Branch 39 - 39: Label - SelectionMerge 44 None - BranchConditional 21 43 44 - 43: Label - 46: 6(int) Load 8(count) - 47: 6(int) IMul 46 45 - Store 8(count) 47 - Branch 44 - 44: Label - SelectionMerge 49 None - BranchConditional 32 48 49 - 48: Label - 51: 6(int) Load 8(count) - 52: 6(int) IMul 51 50 - Store 8(count) 52 - Branch 49 - 49: Label - Store 53(shiftedii) 54 - Store 55(shiftedui) 56 - Store 57(shiftediu) 54 - Store 58(shifteduu) 56 - 59: 6(int) Load 53(shiftedii) - 60: 6(int) Load 57(shiftediu) - 61: 20(bool) IEqual 59 60 - SelectionMerge 63 None - BranchConditional 61 62 63 - 62: Label - 71: 68 Load 70(usampler) - 76: 73(fvec2) Load 75(tc) - 77: 64(ivec4) ImageSampleImplicitLod 71 76 - Store 66(c) 77 - Branch 63 - 63: Label - 78: 10(int) Load 55(shiftedui) - 79: 10(int) Load 58(shifteduu) - 80: 20(bool) IEqual 78 79 - SelectionMerge 82 None - BranchConditional 80 81 82 - 81: Label - 83: 68 Load 70(usampler) - 84: 73(fvec2) Load 75(tc) - 86: 73(fvec2) CompositeConstruct 85 85 - 87: 73(fvec2) FAdd 84 86 - 88: 64(ivec4) ImageSampleImplicitLod 83 87 - Store 66(c) 88 - Branch 82 - 82: Label - 89: 6(int) Load 53(shiftedii) - 90: 10(int) Load 55(shiftedui) - 91: 6(int) Bitcast 90 - 92: 20(bool) IEqual 89 91 - SelectionMerge 94 None - BranchConditional 92 93 94 - 93: Label - 95: 68 Load 70(usampler) - 96: 73(fvec2) Load 75(tc) - 99: 73(fvec2) FSub 96 98 - 100: 64(ivec4) ImageSampleImplicitLod 95 99 - Store 66(c) 100 - Branch 94 - 94: Label - 101: 13(ivec2) Load 15(t) - 102: 10(int) CompositeExtract 101 0 - 104: 20(bool) UGreaterThan 102 103 - SelectionMerge 106 None - BranchConditional 104 105 106 - 105: Label - 109: 10(int) Load 12(u) - 110: 72(float) ConvertUToF 109 - Store 108(af) 110 - 113: 10(int) Load 12(u) - 115: 20(bool) INotEqual 113 114 - Store 112(ab) 115 - 117: 10(int) Load 12(u) - 118: 6(int) Bitcast 117 - Store 116(ai) 118 - 119: 72(float) Load 108(af) - 120: 10(int) ConvertFToU 119 - 121: 20(bool) Load 112(ab) - 123: 10(int) Select 121 122 114 - 124: 6(int) Load 116(ai) - 125: 10(int) Bitcast 124 - 126: 6(int) Load 8(count) - 127: 10(int) Bitcast 126 - 128: 64(ivec4) CompositeConstruct 120 123 125 127 - 129: 64(ivec4) Load 66(c) - 130: 64(ivec4) IAdd 129 128 - Store 66(c) 130 - Branch 106 - 106: Label - SelectionMerge 132 None - BranchConditional 21 131 132 - 131: Label - 134: 6(int) Load 8(count) - 135: 6(int) IMul 134 133 - Store 8(count) 135 - Branch 132 - 132: Label - SelectionMerge 137 None - BranchConditional 32 136 137 - 136: Label - 139: 6(int) Load 8(count) - 140: 6(int) IMul 139 138 - Store 8(count) 140 - Branch 137 - 137: Label - SelectionMerge 142 None - BranchConditional 21 141 142 - 141: Label - 144: 6(int) Load 8(count) - 145: 6(int) IMul 144 143 - Store 8(count) 145 - Branch 142 - 142: Label - SelectionMerge 147 None - BranchConditional 21 146 147 - 146: Label - 149: 6(int) Load 8(count) - 150: 6(int) IMul 149 148 - Store 8(count) 150 - Branch 147 - 147: Label - Store 151(mask1) 152 - Store 153(mask2) 154 - 156: 10(int) Load 151(mask1) - 158: 10(int) ShiftLeftLogical 156 157 - Store 155(mask3) 158 - Store 159(mask4) 160 - 161: 10(int) Load 155(mask3) - 162: 10(int) Load 153(mask2) - 163: 20(bool) IEqual 161 162 - SelectionMerge 165 None - BranchConditional 163 164 165 - 164: Label - 166: 6(int) Load 8(count) - 167: 6(int) IMul 166 24 - Store 8(count) 167 - Branch 165 - 165: Label - 168: 10(int) Load 155(mask3) - 169: 10(int) Load 151(mask1) - 170: 10(int) BitwiseAnd 168 169 - 171: 20(bool) INotEqual 170 114 - SelectionMerge 173 None - BranchConditional 171 172 173 - 172: Label - 174: 6(int) Load 8(count) - 175: 6(int) IMul 174 29 - Store 8(count) 175 - Branch 173 - 173: Label - 176: 10(int) Load 151(mask1) - 177: 10(int) Load 155(mask3) - 178: 10(int) BitwiseOr 176 177 - 179: 10(int) Load 159(mask4) - 180: 20(bool) IEqual 178 179 - SelectionMerge 182 None - BranchConditional 180 181 182 - 181: Label - 183: 6(int) Load 8(count) - 184: 6(int) IMul 183 35 - Store 8(count) 184 - Branch 182 - 182: Label - 185: 10(int) Load 151(mask1) - 186: 10(int) Load 159(mask4) - 187: 10(int) BitwiseXor 185 186 - 188: 20(bool) IEqual 187 154 - SelectionMerge 190 None - BranchConditional 188 189 190 - 189: Label - 191: 6(int) Load 8(count) - 192: 6(int) IMul 191 40 - Store 8(count) 192 - Branch 190 - 190: Label - 193: 6(int) Load 8(count) - 194: 10(int) Bitcast 193 - 195: 64(ivec4) CompositeConstruct 194 194 194 194 - 196: 64(ivec4) Load 66(c) - 197: 64(ivec4) IAdd 196 195 - Store 66(c) 197 + 18: 17(ptr) AccessChain 15(t) 16 + 19: 10(int) Load 18 + 21: 10(int) IAdd 19 20 + Store 12(u) 21 + SelectionMerge 25 None + BranchConditional 23 24 25 + 24: Label + 27: 6(int) Load 8(count) + 28: 6(int) IMul 27 26 + Store 8(count) 28 + Branch 25 + 25: Label + SelectionMerge 30 None + BranchConditional 23 29 30 + 29: Label + 32: 6(int) Load 8(count) + 33: 6(int) IMul 32 31 + Store 8(count) 33 + Branch 30 + 30: Label + SelectionMerge 36 None + BranchConditional 34 35 36 + 35: Label + 38: 6(int) Load 8(count) + 39: 6(int) IMul 38 37 + Store 8(count) 39 + Branch 36 + 36: Label + SelectionMerge 41 None + BranchConditional 23 40 41 + 40: Label + 43: 6(int) Load 8(count) + 44: 6(int) IMul 43 42 + Store 8(count) 44 + Branch 41 + 41: Label + SelectionMerge 46 None + BranchConditional 23 45 46 + 45: Label + 48: 6(int) Load 8(count) + 49: 6(int) IMul 48 47 + Store 8(count) 49 + Branch 46 + 46: Label + SelectionMerge 51 None + BranchConditional 34 50 51 + 50: Label + 53: 6(int) Load 8(count) + 54: 6(int) IMul 53 52 + Store 8(count) 54 + Branch 51 + 51: Label + Store 55(shiftedii) 56 + Store 57(shiftedui) 58 + Store 59(shiftediu) 56 + Store 60(shifteduu) 58 + 61: 6(int) Load 55(shiftedii) + 62: 6(int) Load 59(shiftediu) + 63: 22(bool) IEqual 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 73: 70 Load 72(usampler) + 78: 75(fvec2) Load 77(tc) + 79: 66(ivec4) ImageSampleImplicitLod 73 78 + Store 68(c) 79 + Branch 65 + 65: Label + 80: 10(int) Load 57(shiftedui) + 81: 10(int) Load 60(shifteduu) + 82: 22(bool) IEqual 80 81 + SelectionMerge 84 None + BranchConditional 82 83 84 + 83: Label + 85: 70 Load 72(usampler) + 86: 75(fvec2) Load 77(tc) + 88: 75(fvec2) CompositeConstruct 87 87 + 89: 75(fvec2) FAdd 86 88 + 90: 66(ivec4) ImageSampleImplicitLod 85 89 + Store 68(c) 90 + Branch 84 + 84: Label + 91: 6(int) Load 55(shiftedii) + 92: 10(int) Load 57(shiftedui) + 93: 6(int) Bitcast 92 + 94: 22(bool) IEqual 91 93 + SelectionMerge 96 None + BranchConditional 94 95 96 + 95: Label + 97: 70 Load 72(usampler) + 98: 75(fvec2) Load 77(tc) + 101: 75(fvec2) FSub 98 100 + 102: 66(ivec4) ImageSampleImplicitLod 97 101 + Store 68(c) 102 + Branch 96 + 96: Label + 104: 17(ptr) AccessChain 15(t) 103 + 105: 10(int) Load 104 + 107: 22(bool) UGreaterThan 105 106 + SelectionMerge 109 None + BranchConditional 107 108 109 + 108: Label + 112: 10(int) Load 12(u) + 113: 74(float) ConvertUToF 112 + Store 111(af) 113 + 116: 10(int) Load 12(u) + 117: 22(bool) INotEqual 116 103 + Store 115(ab) 117 + 119: 10(int) Load 12(u) + 120: 6(int) Bitcast 119 + Store 118(ai) 120 + 121: 74(float) Load 111(af) + 122: 10(int) ConvertFToU 121 + 123: 22(bool) Load 115(ab) + 124: 10(int) Select 123 16 103 + 125: 6(int) Load 118(ai) + 126: 10(int) Bitcast 125 + 127: 6(int) Load 8(count) + 128: 10(int) Bitcast 127 + 129: 66(ivec4) CompositeConstruct 122 124 126 128 + 130: 66(ivec4) Load 68(c) + 131: 66(ivec4) IAdd 130 129 + Store 68(c) 131 + Branch 109 + 109: Label + SelectionMerge 133 None + BranchConditional 23 132 133 + 132: Label + 135: 6(int) Load 8(count) + 136: 6(int) IMul 135 134 + Store 8(count) 136 + Branch 133 + 133: Label + SelectionMerge 138 None + BranchConditional 34 137 138 + 137: Label + 140: 6(int) Load 8(count) + 141: 6(int) IMul 140 139 + Store 8(count) 141 + Branch 138 + 138: Label + SelectionMerge 143 None + BranchConditional 23 142 143 + 142: Label + 145: 6(int) Load 8(count) + 146: 6(int) IMul 145 144 + Store 8(count) 146 + Branch 143 + 143: Label + SelectionMerge 148 None + BranchConditional 23 147 148 + 147: Label + 150: 6(int) Load 8(count) + 151: 6(int) IMul 150 149 + Store 8(count) 151 + Branch 148 + 148: Label + Store 152(mask1) 153 + Store 154(mask2) 155 + 157: 10(int) Load 152(mask1) + 159: 10(int) ShiftLeftLogical 157 158 + Store 156(mask3) 159 + Store 160(mask4) 161 + 162: 10(int) Load 156(mask3) + 163: 10(int) Load 154(mask2) + 164: 22(bool) IEqual 162 163 + SelectionMerge 166 None + BranchConditional 164 165 166 + 165: Label + 167: 6(int) Load 8(count) + 168: 6(int) IMul 167 26 + Store 8(count) 168 + Branch 166 + 166: Label + 169: 10(int) Load 156(mask3) + 170: 10(int) Load 152(mask1) + 171: 10(int) BitwiseAnd 169 170 + 172: 22(bool) INotEqual 171 103 + SelectionMerge 174 None + BranchConditional 172 173 174 + 173: Label + 175: 6(int) Load 8(count) + 176: 6(int) IMul 175 31 + Store 8(count) 176 + Branch 174 + 174: Label + 177: 10(int) Load 152(mask1) + 178: 10(int) Load 156(mask3) + 179: 10(int) BitwiseOr 177 178 + 180: 10(int) Load 160(mask4) + 181: 22(bool) IEqual 179 180 + SelectionMerge 183 None + BranchConditional 181 182 183 + 182: Label + 184: 6(int) Load 8(count) + 185: 6(int) IMul 184 37 + Store 8(count) 185 + Branch 183 + 183: Label + 186: 10(int) Load 152(mask1) + 187: 10(int) Load 160(mask4) + 188: 10(int) BitwiseXor 186 187 + 189: 22(bool) IEqual 188 155 + SelectionMerge 191 None + BranchConditional 189 190 191 + 190: Label + 192: 6(int) Load 8(count) + 193: 6(int) IMul 192 42 + Store 8(count) 193 + Branch 191 + 191: Label + 194: 6(int) Load 8(count) + 195: 10(int) Bitcast 194 + 196: 66(ivec4) CompositeConstruct 195 195 195 195 + 197: 66(ivec4) Load 68(c) + 198: 66(ivec4) IAdd 197 196 + Store 68(c) 198 Return FunctionEnd diff --git a/Test/baseResults/spv.uniformArray.frag.out b/Test/baseResults/spv.uniformArray.frag.out index b6536097..03439d94 100755 --- a/Test/baseResults/spv.uniformArray.frag.out +++ b/Test/baseResults/spv.uniformArray.frag.out @@ -3,25 +3,23 @@ spv.uniformArray.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 52 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 53 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "texColor" Name 14 "color" Name 25 "inColor" Name 35 "alpha" - Name 46 "gl_FragColor" - Name 51 "texSampler2D" - Decorate 46(gl_FragColor) BuiltIn FragColor - Decorate 51(texSampler2D) NoStaticUse + Name 47 "gl_FragColor" + Name 52 "texSampler2D" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -44,12 +42,14 @@ Linked fragment stage: 35(alpha): 34(ptr) Variable UniformConstant 36: 15(int) Constant 12 37: TypePointer UniformConstant 6(float) - 45: TypePointer Output 7(fvec4) -46(gl_FragColor): 45(ptr) Variable Output - 48: TypeImage 6(float) 2D sampled format:Unknown - 49: TypeSampledImage 48 - 50: TypePointer UniformConstant 49 -51(texSampler2D): 50(ptr) Variable UniformConstant + 40: 10(int) Constant 3 + 41: TypePointer Function 6(float) + 46: TypePointer Output 7(fvec4) +47(gl_FragColor): 46(ptr) Variable Output + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 +52(texSampler2D): 51(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(texColor): 8(ptr) Variable Function @@ -68,13 +68,12 @@ Linked fragment stage: Store 9(texColor) 31 38: 37(ptr) AccessChain 35(alpha) 36 39: 6(float) Load 38 - 40: 7(fvec4) Load 9(texColor) - 41: 6(float) CompositeExtract 40 3 - 42: 6(float) FAdd 41 39 - 43: 7(fvec4) Load 9(texColor) - 44: 7(fvec4) CompositeInsert 42 43 3 - Store 9(texColor) 44 - 47: 7(fvec4) Load 9(texColor) - Store 46(gl_FragColor) 47 + 42: 41(ptr) AccessChain 9(texColor) 40 + 43: 6(float) Load 42 + 44: 6(float) FAdd 43 39 + 45: 41(ptr) AccessChain 9(texColor) 40 + Store 45 44 + 48: 7(fvec4) Load 9(texColor) + Store 47(gl_FragColor) 48 Return FunctionEnd diff --git a/Test/baseResults/spv.variableArrayIndex.frag.out b/Test/baseResults/spv.variableArrayIndex.frag.out index 215c22a9..1aa08718 100755 --- a/Test/baseResults/spv.variableArrayIndex.frag.out +++ b/Test/baseResults/spv.variableArrayIndex.frag.out @@ -5,16 +5,16 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 93 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 63 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 8 "iLocal" Name 10 "Count" @@ -35,11 +35,9 @@ Linked fragment stage: Name 34 "foo2" Name 36 "foo" Name 54 "gl_FragColor" - Name 59 "sampler" + Name 59 "samp2D" Name 63 "coord" Name 69 "constructed" - Decorate 54(gl_FragColor) BuiltIn FragColor - Decorate 63(coord) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -73,7 +71,7 @@ Linked fragment stage: 56: TypeImage 12(float) 2D sampled format:Unknown 57: TypeSampledImage 56 58: TypePointer UniformConstant 57 - 59(sampler): 58(ptr) Variable UniformConstant + 59(samp2D): 58(ptr) Variable UniformConstant 61: TypeVector 12(float) 2 62: TypePointer Input 61(fvec2) 63(coord): 62(ptr) Variable Input @@ -116,7 +114,7 @@ Linked fragment stage: Branch 28 28: Label 55: 12(float) Load 30(scale) - 60: 57 Load 59(sampler) + 60: 57 Load 59(samp2D) 64: 61(fvec2) Load 63(coord) 65: 52(fvec4) ImageSampleImplicitLod 60 64 66: 52(fvec4) VectorTimesScalar 65 55 diff --git a/Test/baseResults/spv.varyingArray.frag.out b/Test/baseResults/spv.varyingArray.frag.out index f42947f4..afadee3d 100755 --- a/Test/baseResults/spv.varyingArray.frag.out +++ b/Test/baseResults/spv.varyingArray.frag.out @@ -8,29 +8,24 @@ WARNING: 0:8: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 61 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 34 39 19 19 48 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "texColor" Name 13 "texSampler2D" Name 19 "gl_TexCoord" Name 34 "color" Name 39 "alpha" - Name 44 "gl_FragColor" + Name 45 "gl_FragColor" Name 48 "foo" - Decorate 19(gl_TexCoord) Smooth - Decorate 34(color) Smooth - Decorate 39(alpha) Smooth - Decorate 44(gl_FragColor) BuiltIn FragColor - Decorate 48(foo) Smooth 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -53,10 +48,11 @@ Linked fragment stage: 34(color): 22(ptr) Variable Input 38: TypePointer Input 6(float) 39(alpha): 38(ptr) Variable Input - 43: TypePointer Output 7(fvec4) -44(gl_FragColor): 43(ptr) Variable Output - 45: 15(int) Constant 3 - 46: TypeArray 7(fvec4) 45 + 41: 15(int) Constant 3 + 42: TypePointer Function 6(float) + 44: TypePointer Output 7(fvec4) +45(gl_FragColor): 44(ptr) Variable Output + 46: TypeArray 7(fvec4) 41 47: TypePointer Input 46 48(foo): 47(ptr) Variable Input 49: 20(int) Constant 1 @@ -80,9 +76,8 @@ Linked fragment stage: 37: 7(fvec4) FAdd 36 35 Store 9(texColor) 37 40: 6(float) Load 39(alpha) - 41: 7(fvec4) Load 9(texColor) - 42: 7(fvec4) CompositeInsert 40 41 3 - Store 9(texColor) 42 + 43: 42(ptr) AccessChain 9(texColor) 41 + Store 43 40 50: 22(ptr) AccessChain 48(foo) 49 51: 7(fvec4) Load 50 53: 22(ptr) AccessChain 19(gl_TexCoord) 52 @@ -93,6 +88,6 @@ Linked fragment stage: 58: 7(fvec4) FAdd 55 57 59: 7(fvec4) Load 9(texColor) 60: 7(fvec4) FAdd 58 59 - Store 44(gl_FragColor) 60 + Store 45(gl_FragColor) 60 Return FunctionEnd diff --git a/Test/baseResults/spv.varyingArrayIndirect.frag.out b/Test/baseResults/spv.varyingArrayIndirect.frag.out index a6db8960..ba5bb2ed 100755 --- a/Test/baseResults/spv.varyingArrayIndirect.frag.out +++ b/Test/baseResults/spv.varyingArrayIndirect.frag.out @@ -8,16 +8,16 @@ WARNING: 0:8: varying deprecated in version 130; may be removed in future releas Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 69 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 70 - Source GLSL 130 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 45 50 30 30 19 ExecutionMode 4 OriginLowerLeft + Source GLSL 130 Name 4 "main" Name 9 "texColor" Name 13 "texSampler2D" @@ -27,12 +27,7 @@ Linked fragment stage: Name 31 "a" Name 45 "color" Name 50 "alpha" - Name 55 "gl_FragColor" - Decorate 19(userIn) Smooth - Decorate 30(gl_TexCoord) Smooth - Decorate 45(color) Smooth - Decorate 50(alpha) Smooth - Decorate 55(gl_FragColor) BuiltIn FragColor + Name 56 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -61,9 +56,11 @@ Linked fragment stage: 45(color): 24(ptr) Variable Input 49: TypePointer Input 6(float) 50(alpha): 49(ptr) Variable Input - 54: TypePointer Output 7(fvec4) -55(gl_FragColor): 54(ptr) Variable Output - 56: 20(int) Constant 0 + 52: 15(int) Constant 3 + 53: TypePointer Function 6(float) + 55: TypePointer Output 7(fvec4) +56(gl_FragColor): 55(ptr) Variable Output + 57: 20(int) Constant 0 4(main): 2 Function None 3 5: Label 9(texColor): 8(ptr) Variable Function @@ -88,21 +85,20 @@ Linked fragment stage: 48: 7(fvec4) FAdd 47 46 Store 9(texColor) 48 51: 6(float) Load 50(alpha) - 52: 7(fvec4) Load 9(texColor) - 53: 7(fvec4) CompositeInsert 51 52 3 - Store 9(texColor) 53 - 57: 24(ptr) AccessChain 30(gl_TexCoord) 56 - 58: 7(fvec4) Load 57 - 59: 20(int) Load 22(b) - 60: 24(ptr) AccessChain 30(gl_TexCoord) 59 - 61: 7(fvec4) Load 60 - 62: 7(fvec4) FAdd 58 61 - 63: 7(fvec4) Load 9(texColor) - 64: 7(fvec4) FAdd 62 63 - 65: 20(int) Load 31(a) - 66: 24(ptr) AccessChain 19(userIn) 65 - 67: 7(fvec4) Load 66 - 68: 7(fvec4) FAdd 64 67 - Store 55(gl_FragColor) 68 + 54: 53(ptr) AccessChain 9(texColor) 52 + Store 54 51 + 58: 24(ptr) AccessChain 30(gl_TexCoord) 57 + 59: 7(fvec4) Load 58 + 60: 20(int) Load 22(b) + 61: 24(ptr) AccessChain 30(gl_TexCoord) 60 + 62: 7(fvec4) Load 61 + 63: 7(fvec4) FAdd 59 62 + 64: 7(fvec4) Load 9(texColor) + 65: 7(fvec4) FAdd 63 64 + 66: 20(int) Load 31(a) + 67: 24(ptr) AccessChain 19(userIn) 66 + 68: 7(fvec4) Load 67 + 69: 7(fvec4) FAdd 65 68 + Store 56(gl_FragColor) 69 Return FunctionEnd diff --git a/Test/baseResults/spv.voidFunction.frag.out b/Test/baseResults/spv.voidFunction.frag.out index a5086d3a..0fa95657 100755 --- a/Test/baseResults/spv.voidFunction.frag.out +++ b/Test/baseResults/spv.voidFunction.frag.out @@ -3,46 +3,45 @@ spv.voidFunction.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 42 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 44 - Source GLSL 120 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 41 ExecutionMode 4 OriginLowerLeft + Source GLSL 120 Name 4 "main" Name 6 "foo(" Name 8 "foo2(" Name 12 "bar" Name 22 "outColor" Name 24 "bigColor" - Name 35 "gl_FragColor" - Name 39 "BaseColor" - Name 41 "d" - Decorate 35(gl_FragColor) BuiltIn FragColor - Decorate 39(BaseColor) Smooth - Decorate 39(BaseColor) NoStaticUse - Decorate 41(d) NoStaticUse + Name 37 "gl_FragColor" + Name 41 "BaseColor" + Name 43 "d" 2: TypeVoid 3: TypeFunction 2 10: TypeFloat 32 - 11: TypePointer PrivateGlobal 10(float) - 12(bar): 11(ptr) Variable PrivateGlobal + 11: TypePointer Private 10(float) + 12(bar): 11(ptr) Variable Private 13: 10(float) Constant 1073741824 15: 10(float) Constant 1065353216 20: TypeVector 10(float) 4 21: TypePointer Function 20(fvec4) 23: TypePointer UniformConstant 20(fvec4) 24(bigColor): 23(ptr) Variable UniformConstant - 34: TypePointer Output 20(fvec4) -35(gl_FragColor): 34(ptr) Variable Output - 38: TypePointer Input 20(fvec4) - 39(BaseColor): 38(ptr) Variable Input - 40: TypePointer UniformConstant 10(float) - 41(d): 40(ptr) Variable UniformConstant + 29: TypeInt 32 0 + 30: 29(int) Constant 0 + 31: TypePointer Function 10(float) + 36: TypePointer Output 20(fvec4) +37(gl_FragColor): 36(ptr) Variable Output + 40: TypePointer Input 20(fvec4) + 41(BaseColor): 40(ptr) Variable Input + 42: TypePointer UniformConstant 10(float) + 43(d): 42(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 22(outColor): 21(ptr) Variable Function @@ -52,14 +51,13 @@ Linked fragment stage: 26: 2 FunctionCall 6(foo() 27: 2 FunctionCall 8(foo2() 28: 10(float) Load 12(bar) - 29: 20(fvec4) Load 22(outColor) - 30: 10(float) CompositeExtract 29 0 - 31: 10(float) FAdd 30 28 - 32: 20(fvec4) Load 22(outColor) - 33: 20(fvec4) CompositeInsert 31 32 0 - Store 22(outColor) 33 - 36: 20(fvec4) Load 22(outColor) - Store 35(gl_FragColor) 36 + 32: 31(ptr) AccessChain 22(outColor) 30 + 33: 10(float) Load 32 + 34: 10(float) FAdd 33 28 + 35: 31(ptr) AccessChain 22(outColor) 30 + Store 35 34 + 38: 20(fvec4) Load 22(outColor) + Store 37(gl_FragColor) 38 Return FunctionEnd 6(foo(): 2 Function None 3 diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out index 533e4cba..5305b987 100755 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -3,15 +3,15 @@ spv.while-continue-break.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 42 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 40 41 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 17 "A" @@ -21,9 +21,7 @@ Linked vertex stage: Name 40 "gl_VertexID" Name 41 "gl_InstanceID" Decorate 40(gl_VertexID) BuiltIn VertexId - Decorate 40(gl_VertexID) NoStaticUse Decorate 41(gl_InstanceID) BuiltIn InstanceId - Decorate 41(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -50,7 +48,7 @@ Linked vertex stage: 10: Label 13: 6(int) Load 8(i) 16: 15(bool) SLessThan 13 14 - LoopMerge 11 None + LoopMerge 11 10 None BranchConditional 16 12 11 12: Label Store 17(A) 18 diff --git a/Test/baseResults/spv.while-simple.vert.out b/Test/baseResults/spv.while-simple.vert.out index 9b04a521..14d46dd3 100755 --- a/Test/baseResults/spv.while-simple.vert.out +++ b/Test/baseResults/spv.while-simple.vert.out @@ -3,23 +3,21 @@ spv.while-simple.vert Linked vertex stage: -// Module Version 99 -// Generated by (magic number): 51a00bb +// Module Version 10000 +// Generated by (magic number): 80001 // Id's are bound by 23 - Source ESSL 300 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" + EntryPoint Vertex 4 "main" 21 22 + Source ESSL 300 Name 4 "main" Name 8 "i" Name 21 "gl_VertexID" Name 22 "gl_InstanceID" Decorate 21(gl_VertexID) BuiltIn VertexId - Decorate 21(gl_VertexID) NoStaticUse Decorate 22(gl_InstanceID) BuiltIn InstanceId - Decorate 22(gl_InstanceID) NoStaticUse 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -39,7 +37,7 @@ Linked vertex stage: 10: Label 13: 6(int) Load 8(i) 16: 15(bool) SLessThan 13 14 - LoopMerge 11 None + LoopMerge 11 10 None BranchConditional 16 12 11 12: Label 17: 6(int) Load 8(i) diff --git a/Test/baseResults/spv.whileLoop.frag.out b/Test/baseResults/spv.whileLoop.frag.out index f6e59e15..591129cd 100755 --- a/Test/baseResults/spv.whileLoop.frag.out +++ b/Test/baseResults/spv.whileLoop.frag.out @@ -3,24 +3,22 @@ spv.whileLoop.frag Linked fragment stage: -// Module Version 99 -// Generated by (magic number): 51a00bb -// Id's are bound by 31 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 34 - Source GLSL 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" + EntryPoint Fragment 4 "main" 11 ExecutionMode 4 OriginLowerLeft + Source GLSL 110 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 19 "d" - Name 24 "bigColor" - Name 29 "gl_FragColor" - Decorate 11(BaseColor) Smooth - Decorate 29(gl_FragColor) BuiltIn FragColor + Name 22 "d" + Name 27 "bigColor" + Name 32 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -28,13 +26,16 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 18: TypePointer UniformConstant 6(float) - 19(d): 18(ptr) Variable UniformConstant - 21: TypeBool - 23: TypePointer UniformConstant 7(fvec4) - 24(bigColor): 23(ptr) Variable UniformConstant - 28: TypePointer Output 7(fvec4) -29(gl_FragColor): 28(ptr) Variable Output + 16: TypeInt 32 0 + 17: 16(int) Constant 0 + 18: TypePointer Function 6(float) + 21: TypePointer UniformConstant 6(float) + 22(d): 21(ptr) Variable UniformConstant + 24: TypeBool + 26: TypePointer UniformConstant 7(fvec4) + 27(bigColor): 26(ptr) Variable UniformConstant + 31: TypePointer Output 7(fvec4) +32(gl_FragColor): 31(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -42,20 +43,20 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 16: 7(fvec4) Load 9(color) - 17: 6(float) CompositeExtract 16 0 - 20: 6(float) Load 19(d) - 22: 21(bool) FOrdLessThan 17 20 - LoopMerge 14 None - BranchConditional 22 15 14 + 19: 18(ptr) AccessChain 9(color) 17 + 20: 6(float) Load 19 + 23: 6(float) Load 22(d) + 25: 24(bool) FOrdLessThan 20 23 + LoopMerge 14 13 None + BranchConditional 25 15 14 15: Label - 25: 7(fvec4) Load 24(bigColor) - 26: 7(fvec4) Load 9(color) - 27: 7(fvec4) FAdd 26 25 - Store 9(color) 27 + 28: 7(fvec4) Load 27(bigColor) + 29: 7(fvec4) Load 9(color) + 30: 7(fvec4) FAdd 29 28 + Store 9(color) 30 Branch 13 14: Label - 30: 7(fvec4) Load 9(color) - Store 29(gl_FragColor) 30 + 33: 7(fvec4) Load 9(color) + Store 32(gl_FragColor) 33 Return FunctionEnd diff --git a/Test/spv.130.frag b/Test/spv.130.frag index 5b27e0cc..0e580e4f 100644 --- a/Test/spv.130.frag +++ b/Test/spv.130.frag @@ -90,23 +90,6 @@ uniform vec2 v2; uniform vec3 v3; uniform vec4 v4; -void bar7() -{ - vec4 v; - - o += texture2DRect(s2DR, v2); - o += texture2DRectProj(s2DR, v3); - o += texture2DRectProj(s2DR, v4); - o += shadow2DRect(s2DRS, v3); - o += shadow2DRectProj(s2DRS, v4); - - o += texture1DGradARB(s1D, f, f, f); - o += texture2DProjGradARB(s2D, v, v2, v2); - o += shadow2DProjGradARB(s2DS, v, v2, v2); - - o += shadow2DRectProjGradARB(s2DRS, v, v2, v2); -} - void main() { o = textureGather(sampC, vec3(0.2)); @@ -115,5 +98,4 @@ void main() bar4(); bar5(); bar6(); - bar7(); } \ No newline at end of file diff --git a/Test/spv.140.frag b/Test/spv.140.frag index 4c67d6b1..61ad1a6f 100644 --- a/Test/spv.140.frag +++ b/Test/spv.140.frag @@ -39,3 +39,8 @@ float foo() { return i1 + i2; } + +// test arrayed block +layout(std140) uniform bi { + vec3 v[2]; +} bname[4]; diff --git a/Test/spv.aggOps.frag b/Test/spv.aggOps.frag index a0450dca..9df89ed9 100644 --- a/Test/spv.aggOps.frag +++ b/Test/spv.aggOps.frag @@ -1,6 +1,6 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying mediump vec2 coord; varying vec4 u, w; @@ -28,9 +28,9 @@ void main() b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); if (foo2a == foo2b) - v = texture2D(sampler, coord); + v = texture(samp2D, coord); else - v = texture2D(sampler, 2.0*coord); + v = texture(samp2D, 2.0*coord); if (u == v) v *= 3.0; diff --git a/Test/spv.atomic.comp b/Test/spv.atomic.comp index 1a91b3e7..76e0c3df 100644 --- a/Test/spv.atomic.comp +++ b/Test/spv.atomic.comp @@ -25,6 +25,12 @@ void main() shared int atomi; shared uint atomu; +layout (std140, binding = 0) restrict buffer dataSSB +{ + float f; + ivec4 n_frames_rendered; +} result; + void atoms() { int origi = atomicAdd(atomi, 3); @@ -35,4 +41,5 @@ void atoms() origi = atomicMax(atomi, 7); origi = atomicExchange(atomi, origi); origu = atomicCompSwap(atomu, 10u, value); + atomicAdd(result.n_frames_rendered.z, 1); } diff --git a/Test/spv.conditionalDiscard.frag b/Test/spv.conditionalDiscard.frag index 58e6fa5d..ea803374 100644 --- a/Test/spv.conditionalDiscard.frag +++ b/Test/spv.conditionalDiscard.frag @@ -1,11 +1,11 @@ -#version 110 +#version 400 uniform sampler2D tex; -varying vec2 coord; +in vec2 coord; void main (void) { - vec4 v = texture2D(tex, coord); + vec4 v = texture(tex, coord); if (v == vec4(0.1,0.2,0.3,0.4)) discard; diff --git a/Test/spv.deepRvalue.frag b/Test/spv.deepRvalue.frag index 4d880866..2c88ca8a 100644 --- a/Test/spv.deepRvalue.frag +++ b/Test/spv.deepRvalue.frag @@ -1,6 +1,6 @@ -#version 120 +#version 330 -uniform sampler2D sampler; +uniform sampler2D samp2D; vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); @@ -25,7 +25,7 @@ void main() float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 - float i = texture2D(sampler, vec2(0.5,0.5)).y; + float i = texture(samp2D, vec2(0.5,0.5)).y; i += (i > 0.1 ? v1 : v2)[3]; diff --git a/Test/spv.depthOut.frag b/Test/spv.depthOut.frag index 9b6890e3..feb8a0d4 100644 --- a/Test/spv.depthOut.frag +++ b/Test/spv.depthOut.frag @@ -3,10 +3,9 @@ in vec4 Color; in float Depth; -layout(depth_any) out float gl_FragDepth; +layout(depth_greater) out float gl_FragDepth; void main() { gl_FragDepth = Depth; - gl_FragColor = Color; } diff --git a/Test/spv.localAggregates.frag b/Test/spv.localAggregates.frag index d8a7fb18..9cfa34ee 100644 --- a/Test/spv.localAggregates.frag +++ b/Test/spv.localAggregates.frag @@ -1,6 +1,6 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying vec2 coord; varying vec4 color; @@ -68,5 +68,5 @@ void main() locals2.bleh = color; locals2.bleh.z = coord.y; - gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture2D(sampler, coord); + gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture(samp2D, coord); } diff --git a/Test/spv.set.vert b/Test/spv.set.vert index 5f7807c7..d211ef11 100644 --- a/Test/spv.set.vert +++ b/Test/spv.set.vert @@ -1,6 +1,6 @@ #version 450 -layout(set = 4, binding = 7) uniform sampler2D sampler; +layout(set = 4, binding = 7) uniform sampler2D samp2D; layout(set = 0, binding = 8) buffer setBuf { vec4 color; diff --git a/Test/spv.structAssignment.frag b/Test/spv.structAssignment.frag index 959f854e..072d6b56 100644 --- a/Test/spv.structAssignment.frag +++ b/Test/spv.structAssignment.frag @@ -1,6 +1,6 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying mediump vec2 coord; struct lunarStruct1 { @@ -35,5 +35,5 @@ void main() else locals2 = foo2; - gl_FragColor = locals2.s1_1.f * texture2D(sampler, coord); + gl_FragColor = locals2.s1_1.f * texture(samp2D, coord); } diff --git a/Test/spv.structDeref.frag b/Test/spv.structDeref.frag index 376e408f..b702583d 100644 --- a/Test/spv.structDeref.frag +++ b/Test/spv.structDeref.frag @@ -1,6 +1,6 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying vec2 coord; struct s0 { @@ -67,5 +67,5 @@ void main() if (locals0.i > 5) locals0 = locals00.s0_0; - gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture2D(sampler, coord); + gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture(samp2D, coord); } diff --git a/Test/spv.structure.frag b/Test/spv.structure.frag index 97e79cb0..4ed439da 100644 --- a/Test/spv.structure.frag +++ b/Test/spv.structure.frag @@ -1,5 +1,5 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying vec2 coord; struct lunarStruct1 { @@ -26,6 +26,6 @@ void main() else scale = foo2[3].s1_1[2].f[3]; - gl_FragColor = scale * texture2D(sampler, coord); + gl_FragColor = scale * texture(samp2D, coord); } diff --git a/Test/spv.test.frag b/Test/spv.test.frag index 1b7d0e95..c4fe62d2 100644 --- a/Test/spv.test.frag +++ b/Test/spv.test.frag @@ -1,4 +1,4 @@ -#version 110 +#version 400 uniform sampler2D texSampler2D; uniform sampler3D texSampler3D; @@ -7,16 +7,16 @@ uniform float blend; uniform vec2 scale; uniform vec4 u; -varying vec2 t; -varying vec3 coords; +in vec2 t; +in vec3 coords; void main() { float blendscale = 1.789; - vec4 v = texture2D(texSampler2D, (t + scale) / scale ).wzyx; + vec4 v = texture(texSampler2D, (t + scale) / scale ).wzyx; - vec4 w = texture3D(texSampler3D, coords) + v; + vec4 w = texture(texSampler3D, coords) + v; gl_FragColor = mix(w, u, blend * blendscale); } diff --git a/Test/spv.texture.frag b/Test/spv.texture.frag index 8e5391ee..1d6a1af7 100644 --- a/Test/spv.texture.frag +++ b/Test/spv.texture.frag @@ -25,34 +25,34 @@ void main() vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - color += texture1D (texSampler1D, coords1D); - color += texture1D (texSampler1D, coords1D, bias); - color += texture1DProj(texSampler1D, coords2D); - color += texture1DProj(texSampler1D, coords4D); - color += texture1DProj(texSampler1D, coords2D, bias); - color += texture1DProj(texSampler1D, coords4D, bias); + color += texture (texSampler1D, coords1D); + color += texture (texSampler1D, coords1D, bias); + color += textureProj(texSampler1D, coords2D); + color += textureProj(texSampler1D, coords4D); + color += textureProj(texSampler1D, coords2D, bias); + color += textureProj(texSampler1D, coords4D, bias); - color += texture2D (texSampler2D, coords2D); - color += texture2D (texSampler2D, coords2D, bias); - color += texture2DProj (texSampler2D, coords3D); - color += texture2DProj (texSampler2D, coords4D, bias); + color += texture (texSampler2D, coords2D); + color += texture (texSampler2D, coords2D, bias); + color += textureProj (texSampler2D, coords3D); + color += textureProj (texSampler2D, coords4D, bias); - color += texture3D (texSampler3D, coords3D); - color += texture3D (texSampler3D, coords3D, bias); - color += texture3DProj (texSampler3D, coords4D); - color += texture3DProj (texSampler3D, coords4D, bias); + color += texture (texSampler3D, coords3D); + color += texture (texSampler3D, coords3D, bias); + color += textureProj (texSampler3D, coords4D); + color += textureProj (texSampler3D, coords4D, bias); - color += textureCube (texSamplerCube, coords3D); - color += textureCube (texSamplerCube, coords3D, bias); + color += texture (texSamplerCube, coords3D); + color += texture (texSamplerCube, coords3D, bias); - color += shadow1D (shadowSampler1D, coords3D); - color += shadow1D (shadowSampler1D, coords3D, bias); - color += shadow2D (shadowSampler2D, coords3D); - color += shadow2D (shadowSampler2D, coords3D, bias); - color += shadow1DProj (shadowSampler1D, coords4D); - color += shadow1DProj (shadowSampler1D, coords4D, bias); - color += shadow2DProj (shadowSampler2D, coords4D); - color += shadow2DProj (shadowSampler2D, coords4D, bias); + color += texture (shadowSampler1D, coords3D); + color += texture (shadowSampler1D, coords3D, bias); + color += texture (shadowSampler2D, coords3D); + color += texture (shadowSampler2D, coords3D, bias); + color += textureProj (shadowSampler1D, coords4D); + color += textureProj (shadowSampler1D, coords4D, bias); + color += textureProj (shadowSampler2D, coords4D); + color += textureProj (shadowSampler2D, coords4D, bias); ivec2 iCoords2D = ivec2(0, 5); int iLod = 1; diff --git a/Test/spv.texture.vert b/Test/spv.texture.vert index d2cbd7b9..a135b9d7 100644 --- a/Test/spv.texture.vert +++ b/Test/spv.texture.vert @@ -17,23 +17,23 @@ void main() vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - color += texture1DLod(texSampler1D, coords1D, lod); - color += texture1DProjLod(texSampler1D, coords2D, lod); - color += texture1DProjLod(texSampler1D, coords4D, lod); + color += textureLod(texSampler1D, coords1D, lod); + color += textureProjLod(texSampler1D, coords2D, lod); + color += textureProjLod(texSampler1D, coords4D, lod); - color += texture2DLod (texSampler2D, coords2D, lod); - color += texture2DProjLod (texSampler2D, coords3D, lod); - color += texture2DProjLod (texSampler2D, coords4D, lod); + color += textureLod (texSampler2D, coords2D, lod); + color += textureProjLod (texSampler2D, coords3D, lod); + color += textureProjLod (texSampler2D, coords4D, lod); - color += texture3DLod (texSampler3D, coords3D, lod); - color += texture3DProjLod (texSampler3D, coords4D, lod); + color += textureLod (texSampler3D, coords3D, lod); + color += textureProjLod (texSampler3D, coords4D, lod); - color += textureCubeLod (texSamplerCube, coords3D, lod); + color += textureLod (texSamplerCube, coords3D, lod); - color += shadow1DLod (shadowSampler1D, coords3D, lod); - color += shadow2DLod (shadowSampler2D, coords3D, lod); - color += shadow1DProjLod(shadowSampler1D, coords4D, lod); - color += shadow2DProjLod(shadowSampler2D, coords4D, lod); + color += textureLod (shadowSampler1D, coords3D, lod); + color += textureLod (shadowSampler2D, coords3D, lod); + color += textureProjLod(shadowSampler1D, coords4D, lod); + color += textureProjLod(shadowSampler2D, coords4D, lod); gl_Position = color; } diff --git a/Test/spv.variableArrayIndex.frag b/Test/spv.variableArrayIndex.frag index 63b49c78..67fbf93e 100644 --- a/Test/spv.variableArrayIndex.frag +++ b/Test/spv.variableArrayIndex.frag @@ -1,5 +1,5 @@ #version 130 -uniform sampler2D sampler; +uniform sampler2D samp2D; varying vec2 coord; struct lunarStruct1 { @@ -40,7 +40,7 @@ void main() // scale += foo2[i].f; //} - gl_FragColor = scale * texture2D(sampler, coord); + gl_FragColor = scale * texture(samp2D, coord); vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); diff --git a/Test/spv.varyingArray.frag b/Test/spv.varyingArray.frag index 3bd152fe..4bd6f942 100644 --- a/Test/spv.varyingArray.frag +++ b/Test/spv.varyingArray.frag @@ -9,7 +9,7 @@ varying vec4 foo[3]; void main() { - vec4 texColor = texture2D(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); + vec4 texColor = texture(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); texColor += color; diff --git a/Test/spv.varyingArrayIndirect.frag b/Test/spv.varyingArrayIndirect.frag index d45e601b..e424e6e7 100644 --- a/Test/spv.varyingArrayIndirect.frag +++ b/Test/spv.varyingArrayIndirect.frag @@ -11,7 +11,7 @@ uniform int a, b; void main() { - vec4 texColor = texture2D(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); + vec4 texColor = texture(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); texColor += color; diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 0e235872..1efcfcb3 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -10,7 +10,6 @@ spv.while-simple.vert # vulkan-specific tests spv.set.vert spv.double.comp -# snapshot of some LunarGLASS tests, so glslang can stand on its own and tests can now evolve separately spv.100ops.frag spv.130.frag spv.140.frag @@ -56,6 +55,7 @@ spv.matrix2.frag spv.newTexture.frag spv.nonSquare.vert spv.Operations.frag +spv.intOps.vert spv.precision.frag spv.prepost.frag spv.qualifiers.vert diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index efab2d85..e9433699 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -66,13 +66,13 @@ enum TSamplerDim { EsdNumDims }; -struct TSampler { +struct TSampler { // misnomer now; includes images, textures without sampler, and textures with sampler TBasicType type : 8; // type returned by sampler TSamplerDim dim : 8; bool arrayed : 1; bool shadow : 1; bool ms : 1; - bool image : 1; + bool image : 1; // image, combined should be false bool external : 1; // GL_OES_EGL_image_external void clear() @@ -86,26 +86,27 @@ struct TSampler { external = false; } + // make a combined sampler and texture void set(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false) { + clear(); type = t; dim = d; arrayed = a; shadow = s; ms = m; - image = false; - external = false; } + // make an image void setImage(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false) { + clear(); type = t; dim = d; arrayed = a; shadow = s; ms = m; image = true; - external = false; } bool operator==(const TSampler& right) const @@ -119,6 +120,11 @@ struct TSampler { external == right.external; } + bool operator!=(const TSampler& right) const + { + return ! operator==(right); + } + TString getString() const { TString s; @@ -129,21 +135,22 @@ struct TSampler { case EbtUint: s.append("u"); break; default: break; // some compilers want this } - if (image) + if (image) { s.append("image"); - else + } else { s.append("sampler"); + } if (external) { s.append("ExternalOES"); return s; } switch (dim) { - case Esd1D: s.append("1D"); break; - case Esd2D: s.append("2D"); break; - case Esd3D: s.append("3D"); break; - case EsdCube: s.append("Cube"); break; - case EsdRect: s.append("2DRect"); break; - case EsdBuffer: s.append("Buffer"); break; + case Esd1D: s.append("1D"); break; + case Esd2D: s.append("2D"); break; + case Esd3D: s.append("3D"); break; + case EsdCube: s.append("Cube"); break; + case EsdRect: s.append("2DRect"); break; + case EsdBuffer: s.append("Buffer"); break; default: break; // some compilers want this } if (ms) @@ -290,7 +297,7 @@ enum TLayoutDepth { EldGreater, EldLess, EldUnchanged, - + EldCount }; @@ -330,37 +337,37 @@ public: // drop qualifiers that don't belong in a temporary variable void makeTemporary() { - storage = EvqTemporary; - builtIn = EbvNone; - centroid = false; - smooth = false; - flat = false; - nopersp = false; - patch = false; - sample = false; - coherent = false; - volatil = false; - restrict = false; - readonly = false; - writeonly = false; + storage = EvqTemporary; + builtIn = EbvNone; + centroid = false; + smooth = false; + flat = false; + nopersp = false; + patch = false; + sample = false; + coherent = false; + volatil = false; + restrict = false; + readonly = false; + writeonly = false; clearLayout(); } TStorageQualifier storage : 6; TBuiltInVariable builtIn : 8; TPrecisionQualifier precision : 3; - bool invariant : 1; - bool centroid : 1; - bool smooth : 1; - bool flat : 1; - bool nopersp : 1; - bool patch : 1; - bool sample : 1; - bool coherent : 1; - bool volatil : 1; - bool restrict : 1; - bool readonly : 1; - bool writeonly : 1; + bool invariant : 1; + bool centroid : 1; + bool smooth : 1; + bool flat : 1; + bool nopersp : 1; + bool patch : 1; + bool sample : 1; + bool coherent : 1; + bool volatil : 1; + bool restrict : 1; + bool readonly : 1; + bool writeonly : 1; bool isMemory() const { @@ -501,7 +508,7 @@ public: } bool hasLayout() const { - return hasUniformLayout() || + return hasUniformLayout() || hasAnyLocation() || hasBinding() || hasStream() || @@ -513,34 +520,34 @@ public: int layoutOffset; int layoutAlign; - unsigned int layoutLocation :12; - static const unsigned int layoutLocationEnd = 0xFFF; + unsigned int layoutLocation :12; + static const unsigned int layoutLocationEnd = 0xFFF; - unsigned int layoutComponent : 3; - static const unsigned int layoutComponentEnd = 4; + unsigned int layoutComponent : 3; + static const unsigned int layoutComponentEnd = 4; - unsigned int layoutSet : 7; - static const unsigned int layoutSetEnd = 0x3F; + unsigned int layoutSet : 7; + static const unsigned int layoutSetEnd = 0x3F; - unsigned int layoutBinding : 8; - static const unsigned int layoutBindingEnd = 0xFF; + unsigned int layoutBinding : 8; + static const unsigned int layoutBindingEnd = 0xFF; - unsigned int layoutIndex : 8; - static const unsigned int layoutIndexEnd = 0xFF; + unsigned int layoutIndex : 8; + static const unsigned int layoutIndexEnd = 0xFF; - unsigned int layoutStream : 8; - static const unsigned int layoutStreamEnd = 0xFF; + unsigned int layoutStream : 8; + static const unsigned int layoutStreamEnd = 0xFF; - unsigned int layoutXfbBuffer : 4; - static const unsigned int layoutXfbBufferEnd = 0xF; + unsigned int layoutXfbBuffer : 4; + static const unsigned int layoutXfbBufferEnd = 0xF; - unsigned int layoutXfbStride : 10; - static const unsigned int layoutXfbStrideEnd = 0x3FF; + unsigned int layoutXfbStride : 10; + static const unsigned int layoutXfbStrideEnd = 0x3FF; - unsigned int layoutXfbOffset : 10; - static const unsigned int layoutXfbOffsetEnd = 0x3FF; + unsigned int layoutXfbOffset : 10; + static const unsigned int layoutXfbOffsetEnd = 0x3FF; - TLayoutFormat layoutFormat : 8; + TLayoutFormat layoutFormat : 8; bool hasUniformLayout() const { @@ -893,10 +900,7 @@ public: return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr; } - bool isImage() const - { - return basicType == EbtSampler && sampler.image; - } + bool isImage() const { return basicType == EbtSampler && sampler.image; } }; // @@ -984,7 +988,7 @@ public: typeName = NewPoolTString(n.c_str()); } // For interface blocks - TType(TTypeList* userDef, const TString& n, const TQualifier& q) : + TType(TTypeList* userDef, const TString& n, const TQualifier& q) : basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr) { @@ -992,10 +996,10 @@ public: typeName = NewPoolTString(n.c_str()); } virtual ~TType() {} - + // Not for use across pool pops; it will cause multiple instances of TType to point to the same information. - // This only works if that information (like a structure's list of types) does not change and - // the instances are sharing the same pool. + // This only works if that information (like a structure's list of types) does not change and + // the instances are sharing the same pool. void shallowCopy(const TType& copyOf) { basicType = copyOf.basicType; @@ -1035,7 +1039,7 @@ public: if (copyOf.typeName) typeName = NewPoolTString(copyOf.typeName->c_str()); } - + TType* clone() { TType *newType = new TType(); @@ -1105,6 +1109,7 @@ public: virtual bool isImplicitlySizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage != EvqBuffer; } virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; } virtual bool isStruct() const { return structure != nullptr; } + virtual bool isImage() const { return basicType == EbtSampler && getSampler().image; } // Recursively checks if the type contains the given basic type @@ -1182,7 +1187,7 @@ public: // // N.B.: Don't share with the shared symbol tables (symbols are // marked as isReadOnly(). Such symbols with arrays that will be - // edited need to copyUp() on first use, so that + // edited need to copyUp() on first use, so that // A) the edits don't effect the shared symbol table, and // B) the edits are shared across all users. void updateArraySizes(const TType& type) @@ -1220,7 +1225,7 @@ public: } } - const char* getBasicString() const + const char* getBasicString() const { return TType::getBasicString(basicType); } @@ -1401,8 +1406,8 @@ public: // in different places, but still might satisfy the definition of matching. // From the spec: // - // "Structures must have the same name, sequence of type names, and - // type definitions, and member names to be considered the same type. + // "Structures must have the same name, sequence of type names, and + // type definitions, and member names to be considered the same type. // This rule applies recursively for nested or embedded types." // bool sameStructType(const TType& right) const diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 7ae1573d..a995181d 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "3.0.790" -#define GLSLANG_DATE "15-Oct-2015" +#define GLSLANG_REVISION "3.0.798" +#define GLSLANG_DATE "15-Nov-2015" diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index a929876b..c7f05b5a 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -54,7 +54,7 @@ namespace glslang { // TODO: ARB_Compatability: do full extension support -bool ARBCompatibility = true; +const bool ARBCompatibility = true; const bool ForwardCompatibility = false; @@ -62,9 +62,9 @@ const bool ForwardCompatibility = false; // Using PureOperatorBuiltins=false is deprecated. bool PureOperatorBuiltins = true; -inline bool IncludeLegacy(int version, EProfile profile) +inline bool IncludeLegacy(int version, EProfile profile, int spv) { - return profile != EEsProfile && (version <= 130 || ARBCompatibility || profile == ECompatibilityProfile); + return profile != EEsProfile && (version <= 130 || (spv == 0 && ARBCompatibility) || profile == ECompatibilityProfile); } TBuiltIns::TBuiltIns() @@ -99,7 +99,7 @@ TBuiltIns::~TBuiltIns() // Most built-ins variables can be added as simple text strings. Some need to // be added programmatically, which is done later in IdentifyBuiltIns() below. // -void TBuiltIns::initialize(int version, EProfile profile) +void TBuiltIns::initialize(int version, EProfile profile, int spv) { //============================================================================ // @@ -788,54 +788,60 @@ void TBuiltIns::initialize(int version, EProfile profile) profile == ECompatibilityProfile || (profile == ECoreProfile && version < 420) || profile == ENoProfile) { - commonBuiltins.append( - "vec4 texture2D(sampler2D, vec2);" + if (spv == 0) { + commonBuiltins.append( + "vec4 texture2D(sampler2D, vec2);" - "vec4 texture2DProj(sampler2D, vec3);" - "vec4 texture2DProj(sampler2D, vec4);" + "vec4 texture2DProj(sampler2D, vec3);" + "vec4 texture2DProj(sampler2D, vec4);" - "vec4 texture3D(sampler3D, vec3);" // OES_texture_3D, but caught by keyword check - "vec4 texture3DProj(sampler3D, vec4);" // OES_texture_3D, but caught by keyword check + "vec4 texture3D(sampler3D, vec3);" // OES_texture_3D, but caught by keyword check + "vec4 texture3DProj(sampler3D, vec4);" // OES_texture_3D, but caught by keyword check - "vec4 textureCube(samplerCube, vec3);" + "vec4 textureCube(samplerCube, vec3);" - "\n"); + "\n"); + } } if ( profile == ECompatibilityProfile || (profile == ECoreProfile && version < 420) || profile == ENoProfile) { - commonBuiltins.append( - "vec4 texture1D(sampler1D, float);" + if (spv == 0) { + commonBuiltins.append( + "vec4 texture1D(sampler1D, float);" - "vec4 texture1DProj(sampler1D, vec2);" - "vec4 texture1DProj(sampler1D, vec4);" + "vec4 texture1DProj(sampler1D, vec2);" + "vec4 texture1DProj(sampler1D, vec4);" - "vec4 shadow1D(sampler1DShadow, vec3);" - "vec4 shadow2D(sampler2DShadow, vec3);" - "vec4 shadow1DProj(sampler1DShadow, vec4);" - "vec4 shadow2DProj(sampler2DShadow, vec4);" + "vec4 shadow1D(sampler1DShadow, vec3);" + "vec4 shadow2D(sampler2DShadow, vec3);" + "vec4 shadow1DProj(sampler1DShadow, vec4);" + "vec4 shadow2DProj(sampler2DShadow, vec4);" - "vec4 texture2DRect(sampler2DRect, vec2);" // GL_ARB_texture_rectangle, caught by keyword check - "vec4 texture2DRectProj(sampler2DRect, vec3);" // GL_ARB_texture_rectangle, caught by keyword check - "vec4 texture2DRectProj(sampler2DRect, vec4);" // GL_ARB_texture_rectangle, caught by keyword check - "vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check - "vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture2DRect(sampler2DRect, vec2);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture2DRectProj(sampler2DRect, vec3);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture2DRectProj(sampler2DRect, vec4);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check - "\n"); + "\n"); + } } - if (profile == EEsProfile) { - commonBuiltins.append( - "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external, caught by keyword check - "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external, caught by keyword check - "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external, caught by keyword check - "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod - "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod - "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);" // GL_EXT_shader_texture_lod - "vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);" // GL_EXT_shader_texture_lod + if (profile == EEsProfile) { + if (spv == 0) { + commonBuiltins.append( + "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external, caught by keyword check + "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external, caught by keyword check + "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external, caught by keyword check + "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);" // GL_EXT_shader_texture_lod + "vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);" // GL_EXT_shader_texture_lod - "\n"); + "\n"); + } } // @@ -977,7 +983,7 @@ void TBuiltIns::initialize(int version, EProfile profile) // // Geometric Functions. // - if (IncludeLegacy(version, profile)) + if (IncludeLegacy(version, profile, spv)) stageBuiltins[EShLangVertex].append("vec4 ftransform();"); // @@ -991,49 +997,53 @@ void TBuiltIns::initialize(int version, EProfile profile) if ((profile == EEsProfile && version == 100) || profile == ECompatibilityProfile || (profile == ECoreProfile && version < 420) || - profile == ENoProfile) { - s->append( - "vec4 texture2DLod(sampler2D, vec2, float);" // GL_ARB_shader_texture_lod - "vec4 texture2DProjLod(sampler2D, vec3, float);" // GL_ARB_shader_texture_lod - "vec4 texture2DProjLod(sampler2D, vec4, float);" // GL_ARB_shader_texture_lod - "vec4 texture3DLod(sampler3D, vec3, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check - "vec4 texture3DProjLod(sampler3D, vec4, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check - "vec4 textureCubeLod(samplerCube, vec3, float);" // GL_ARB_shader_texture_lod + profile == ENoProfile) { + if (spv == 0) { + s->append( + "vec4 texture2DLod(sampler2D, vec2, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjLod(sampler2D, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjLod(sampler2D, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 texture3DLod(sampler3D, vec3, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check + "vec4 texture3DProjLod(sampler3D, vec4, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check + "vec4 textureCubeLod(samplerCube, vec3, float);" // GL_ARB_shader_texture_lod - "\n"); + "\n"); + } } if ( profile == ECompatibilityProfile || (profile == ECoreProfile && version < 420) || profile == ENoProfile) { - s->append( - "vec4 texture1DLod(sampler1D, float, float);" // GL_ARB_shader_texture_lod - "vec4 texture1DProjLod(sampler1D, vec2, float);" // GL_ARB_shader_texture_lod - "vec4 texture1DProjLod(sampler1D, vec4, float);" // GL_ARB_shader_texture_lod - "vec4 shadow1DLod(sampler1DShadow, vec3, float);" // GL_ARB_shader_texture_lod - "vec4 shadow2DLod(sampler2DShadow, vec3, float);" // GL_ARB_shader_texture_lod - "vec4 shadow1DProjLod(sampler1DShadow, vec4, float);" // GL_ARB_shader_texture_lod - "vec4 shadow2DProjLod(sampler2DShadow, vec4, float);" // GL_ARB_shader_texture_lod + if (spv == 0) { + s->append( + "vec4 texture1DLod(sampler1D, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjLod(sampler1D, vec2, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjLod(sampler1D, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DLod(sampler1DShadow, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DLod(sampler2DShadow, vec3, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DProjLod(sampler1DShadow, vec4, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DProjLod(sampler2DShadow, vec4, float);" // GL_ARB_shader_texture_lod - "vec4 texture1DGradARB(sampler1D, float, float, float);" // GL_ARB_shader_texture_lod - "vec4 texture1DProjGradARB(sampler1D, vec2, float, float);" // GL_ARB_shader_texture_lod - "vec4 texture1DProjGradARB(sampler1D, vec4, float, float);" // GL_ARB_shader_texture_lod - "vec4 texture2DGradARB(sampler2D, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture2DProjGradARB(sampler2D, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture2DProjGradARB(sampler2D, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture3DGradARB(sampler3D, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod - "vec4 texture3DProjGradARB(sampler3D, vec4, vec3, vec3);" // GL_ARB_shader_texture_lod - "vec4 textureCubeGradARB(samplerCube, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod - "vec4 shadow1DGradARB(sampler1DShadow, vec3, float, float);" // GL_ARB_shader_texture_lod - "vec4 shadow1DProjGradARB( sampler1DShadow, vec4, float, float);" // GL_ARB_shader_texture_lod - "vec4 shadow2DGradARB(sampler2DShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 shadow2DProjGradARB( sampler2DShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture2DRectGradARB(sampler2DRect, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture2DRectProjGradARB( sampler2DRect, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 texture2DRectProjGradARB( sampler2DRect, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 shadow2DRectGradARB( sampler2DRectShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod - "vec4 shadow2DRectProjGradARB(sampler2DRectShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture1DGradARB(sampler1D, float, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjGradARB(sampler1D, vec2, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture1DProjGradARB(sampler1D, vec4, float, float);" // GL_ARB_shader_texture_lod + "vec4 texture2DGradARB(sampler2D, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjGradARB(sampler2D, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DProjGradARB(sampler2D, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture3DGradARB(sampler3D, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 texture3DProjGradARB(sampler3D, vec4, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 textureCubeGradARB(samplerCube, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod + "vec4 shadow1DGradARB(sampler1DShadow, vec3, float, float);" // GL_ARB_shader_texture_lod + "vec4 shadow1DProjGradARB( sampler1DShadow, vec4, float, float);" // GL_ARB_shader_texture_lod + "vec4 shadow2DGradARB(sampler2DShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DProjGradARB( sampler2DShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectGradARB(sampler2DRect, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectProjGradARB( sampler2DRect, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 texture2DRectProjGradARB( sampler2DRect, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DRectGradARB( sampler2DRectShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod + "vec4 shadow2DRectProjGradARB(sampler2DRectShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod - "\n"); + "\n"); + } } if ((profile != EEsProfile && version >= 150) || @@ -1095,7 +1105,7 @@ void TBuiltIns::initialize(int version, EProfile profile) // // Original-style texture Functions with bias. // - if (profile != EEsProfile || version == 100) { + if (spv == 0 && (profile != EEsProfile || version == 100)) { stageBuiltins[EShLangFragment].append( "vec4 texture2D(sampler2D, vec2, float);" "vec4 texture2DProj(sampler2D, vec3, float);" @@ -1106,7 +1116,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "\n"); } - if (profile != EEsProfile && version > 100) { + if (spv == 0 && (profile != EEsProfile && version > 100)) { stageBuiltins[EShLangFragment].append( "vec4 texture1D(sampler1D, float, float);" "vec4 texture1DProj(sampler1D, vec2, float);" @@ -1118,7 +1128,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "\n"); } - if (profile == EEsProfile) { + if (spv == 0 && profile == EEsProfile) { stageBuiltins[EShLangFragment].append( "vec4 texture2DLodEXT(sampler2D, vec2, float);" // GL_EXT_shader_texture_lod "vec4 texture2DProjLodEXT(sampler2D, vec3, float);" // GL_EXT_shader_texture_lod @@ -1237,7 +1247,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "uniform gl_DepthRangeParameters gl_DepthRange;" "\n"); - if (IncludeLegacy(version, profile)) { + if (IncludeLegacy(version, profile, spv)) { // // Matrix state. p. 31, 32, 37, 39, 40. // @@ -1400,7 +1410,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "attribute vec4 gl_MultiTexCoord7;" "attribute float gl_FogCoord;" "\n"); - } else if (IncludeLegacy(version, profile)) { + } else if (IncludeLegacy(version, profile, spv)) { stageBuiltins[EShLangVertex].append( "in vec4 gl_Color;" "in vec4 gl_SecondaryColor;" @@ -1429,7 +1439,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "varying vec4 gl_TexCoord[];" "varying float gl_FogFragCoord;" "\n"); - } else if (IncludeLegacy(version, profile)) { + } else if (IncludeLegacy(version, profile, spv)) { stageBuiltins[EShLangVertex].append( " vec4 gl_ClipVertex;" // needs qualifier fixed later "out vec4 gl_FrontColor;" @@ -1457,7 +1467,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "float gl_PointSize;" // needs qualifier fixed later "float gl_ClipDistance[];" ); - if (IncludeLegacy(version, profile)) + if (IncludeLegacy(version, profile, spv)) stageBuiltins[EShLangVertex].append( "vec4 gl_ClipVertex;" // needs qualifier fixed later "vec4 gl_FrontColor;" @@ -1750,7 +1760,7 @@ void TBuiltIns::initialize(int version, EProfile profile) stageBuiltins[EShLangFragment].append( "vec2 gl_PointCoord;" // needs qualifier fixed later ); - if (IncludeLegacy(version, profile) || (! ForwardCompatibility && version < 420)) + if (IncludeLegacy(version, profile, spv) || (! ForwardCompatibility && version < 420)) stageBuiltins[EShLangFragment].append( "vec4 gl_FragColor;" // needs qualifier fixed later ); @@ -1767,7 +1777,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "in float gl_ClipDistance[];" ); - if (IncludeLegacy(version, profile)) { + if (IncludeLegacy(version, profile, spv)) { if (version < 150) stageBuiltins[EShLangFragment].append( "in float gl_FogFragCoord;" @@ -1853,7 +1863,7 @@ void TBuiltIns::initialize(int version, EProfile profile) stageBuiltins[EShLangFragment].append("\n"); if (version >= 130) - add2ndGenerationSamplingImaging(version, profile); + add2ndGenerationSamplingImaging(version, profile, spv); //printf("%s\n", commonBuiltins.c_str()); //printf("%s\n", stageBuiltins[EShLangFragment].c_str()); @@ -1863,7 +1873,7 @@ void TBuiltIns::initialize(int version, EProfile profile) // Helper function for initialize(), to add the second set of names for texturing, // when adding context-independent built-in functions. // -void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) +void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, int spv) { // // In this function proper, enumerate the types, then calls the next set of functions @@ -1879,7 +1889,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) for (int shadow = 0; shadow <= 1; ++shadow) { // loop over "bool" shadow or not for (int ms = 0; ms <=1; ++ms) { - if ((ms || image) && shadow) continue; if (ms && profile != EEsProfile && version < 150) @@ -1891,7 +1900,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, 2D, ..., buffer - if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) continue; if (dim != Esd2D && ms) @@ -1922,11 +1930,15 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) // TSampler sampler; - sampler.set(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, - shadow ? true : false, - ms ? true : false); - if (image) - sampler.image = true; + if (image) { + sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, + shadow ? true : false, + ms ? true : false); + } else { + sampler.set(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, + shadow ? true : false, + ms ? true : false); + } TString typeName = sampler.getString(); @@ -2374,7 +2386,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers // add stage-specific entries to the commonBuiltins, and only if that stage // was requested. // -void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, EShLanguage language) +void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, EShLanguage language) { // // Initialize the context-dependent (resource-dependent) built-in strings for parsing. @@ -2537,7 +2549,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents); s.append(builtInConstant); - if (IncludeLegacy(version, profile)) { + if (IncludeLegacy(version, profile, spv)) { // // OpenGL'uniform' state. Page numbers are in reference to version // 1.4 of the OpenGL specification. @@ -2881,7 +2893,7 @@ void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable b // 3) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymbolTable& symbolTable) +void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage language, TSymbolTable& symbolTable) { // // Tag built-in variables and functions with additional qualifier and extension information @@ -2908,25 +2920,29 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb } // Compatibility variables, vertex only - BuiltInVariable("gl_Color", EbvColor, symbolTable); - BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); - BuiltInVariable("gl_Normal", EbvNormal, symbolTable); - BuiltInVariable("gl_Vertex", EbvVertex, symbolTable); - BuiltInVariable("gl_MultiTexCoord0", EbvMultiTexCoord0, symbolTable); - BuiltInVariable("gl_MultiTexCoord1", EbvMultiTexCoord1, symbolTable); - BuiltInVariable("gl_MultiTexCoord2", EbvMultiTexCoord2, symbolTable); - BuiltInVariable("gl_MultiTexCoord3", EbvMultiTexCoord3, symbolTable); - BuiltInVariable("gl_MultiTexCoord4", EbvMultiTexCoord4, symbolTable); - BuiltInVariable("gl_MultiTexCoord5", EbvMultiTexCoord5, symbolTable); - BuiltInVariable("gl_MultiTexCoord6", EbvMultiTexCoord6, symbolTable); - BuiltInVariable("gl_MultiTexCoord7", EbvMultiTexCoord7, symbolTable); - BuiltInVariable("gl_FogCoord", EbvFogFragCoord, symbolTable); + if (spv == 0) { + BuiltInVariable("gl_Color", EbvColor, symbolTable); + BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); + BuiltInVariable("gl_Normal", EbvNormal, symbolTable); + BuiltInVariable("gl_Vertex", EbvVertex, symbolTable); + BuiltInVariable("gl_MultiTexCoord0", EbvMultiTexCoord0, symbolTable); + BuiltInVariable("gl_MultiTexCoord1", EbvMultiTexCoord1, symbolTable); + BuiltInVariable("gl_MultiTexCoord2", EbvMultiTexCoord2, symbolTable); + BuiltInVariable("gl_MultiTexCoord3", EbvMultiTexCoord3, symbolTable); + BuiltInVariable("gl_MultiTexCoord4", EbvMultiTexCoord4, symbolTable); + BuiltInVariable("gl_MultiTexCoord5", EbvMultiTexCoord5, symbolTable); + BuiltInVariable("gl_MultiTexCoord6", EbvMultiTexCoord6, symbolTable); + BuiltInVariable("gl_MultiTexCoord7", EbvMultiTexCoord7, symbolTable); + BuiltInVariable("gl_FogCoord", EbvFogFragCoord, symbolTable); + } if (profile == EEsProfile) { - symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + if (spv == 0) { + symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + } if (version >= 310) symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5); } @@ -3071,13 +3087,15 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb // built-in functions if (profile == EEsProfile) { - symbolTable.setFunctionExtensions("texture2DLodEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjLodEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeLodEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + if (spv == 0) { + symbolTable.setFunctionExtensions("texture2DLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeLodEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); + } if (version == 100) { symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_OES_standard_derivatives); symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_OES_standard_derivatives); @@ -3090,21 +3108,23 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb symbolTable.setFunctionExtensions("interpolateAtOffset", 1, &E_GL_OES_shader_multisample_interpolation); } } else if (version < 130) { - symbolTable.setFunctionExtensions("texture1DLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture3DLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture1DProjLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture3DProjLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow1DLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow1DProjLod", 1, &E_GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DProjLod", 1, &E_GL_ARB_shader_texture_lod); + if (spv == 0) { + symbolTable.setFunctionExtensions("texture1DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture1DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DProjLod", 1, &E_GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DProjLod", 1, &E_GL_ARB_shader_texture_lod); + } } // E_GL_ARB_shader_texture_lod functions usable only with the extension enabled - if (profile != EEsProfile) { + if (profile != EEsProfile && spv == 0) { symbolTable.setFunctionExtensions("texture1DGradARB", 1, &E_GL_ARB_shader_texture_lod); symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); symbolTable.setFunctionExtensions("texture2DGradARB", 1, &E_GL_ARB_shader_texture_lod); @@ -3346,7 +3366,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset); symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets); - if (IncludeLegacy(version, profile) || (profile == EEsProfile && version == 100)) { + if (spv == 0 && (IncludeLegacy(version, profile, spv) || (profile == EEsProfile && version == 100))) { symbolTable.relateToOperator("ftransform", EOpFtransform); symbolTable.relateToOperator("texture1D", EOpTexture); @@ -3453,7 +3473,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb // 2) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) +void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) { if (profile != EEsProfile && version >= 430 && version < 440) { symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); @@ -3469,7 +3489,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb switch(language) { case EShLangFragment: // Set up gl_FragData based on current array size. - if (version == 100 || IncludeLegacy(version, profile) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { + if (version == 100 || IncludeLegacy(version, profile, spv) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; TType fragData(EbtFloat, EvqFragColor, pq, 4); TArraySizes& arraySizes = *new TArraySizes; diff --git a/glslang/MachineIndependent/Initialize.h b/glslang/MachineIndependent/Initialize.h index a45f4259..156db7d7 100644 --- a/glslang/MachineIndependent/Initialize.h +++ b/glslang/MachineIndependent/Initialize.h @@ -59,13 +59,13 @@ public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) TBuiltIns(); virtual ~TBuiltIns(); - void initialize(int version, EProfile); - void initialize(const TBuiltInResource& resources, int version, EProfile, EShLanguage); + void initialize(int version, EProfile, int spv); + void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, EShLanguage); const TString& getCommonString() const { return commonBuiltins; } const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } protected: - void add2ndGenerationSamplingImaging(int version, EProfile profile); + void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv); void addQueryFunctions(TSampler, TString& typeName, int version, EProfile profile); void addImageFunctions(TSampler, TString& typeName, int version, EProfile profile); void addSamplingFunctions(TSampler, TString& typeName, int version, EProfile profile); @@ -81,8 +81,8 @@ protected: int dimMap[EsdNumDims]; }; -void IdentifyBuiltIns(int version, EProfile profile, EShLanguage, TSymbolTable&); -void IdentifyBuiltIns(int version, EProfile profile, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); +void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&); +void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); } // end namespace glslang diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index b5d245c2..8a9b2694 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -47,10 +47,10 @@ extern int yyparse(glslang::TParseContext*); namespace glslang { -TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, EShLanguage L, TInfoSink& is, +TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, EShLanguage L, TInfoSink& is, bool fc, EShMessages m) : intermediate(interm), symbolTable(symt), infoSink(is), language(L), - version(v), profile(p), forwardCompatible(fc), + version(v), profile(p), spv(spv), forwardCompatible(fc), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), postMainReturn(false), tokensBeforeEOF(false), limits(resources.limits), messages(m), currentScanner(nullptr), @@ -1674,11 +1674,14 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu // TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const { - if (type.isStruct()) - return EOpConstructStruct; - TOperator op = EOpNull; + switch (type.getBasicType()) { + case EbtStruct: + op = EOpConstructStruct; + break; + case EbtSampler: + break; case EbtFloat: if (type.isMatrix()) { switch (type.getMatrixCols()) { @@ -2325,8 +2328,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str()); - else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) + else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) { error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + } } void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) @@ -3598,6 +3602,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutPacking = ElpStd430; return; } + // TODO: compile-time performance: may need to stop doing linear searches for (TLayoutFormat format = (TLayoutFormat)(ElfNone + 1); format < ElfCount; format = (TLayoutFormat)(format + 1)) { if (id == TQualifier::getLayoutFormatString(format)) { if ((format > ElfEsFloatGuard && format < ElfFloatGuard) || diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 3766bffd..19a8a240 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -65,7 +65,7 @@ typedef std::set TIdSetType; // class TParseContext { public: - TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, EShLanguage, TInfoSink&, + TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, int spv, EShLanguage, TInfoSink&, bool forwardCompatible = false, EShMessages messages = EShMsgDefault); virtual ~TParseContext(); @@ -85,8 +85,6 @@ public: bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } - bool vulkanRules() const { return (messages & EShMsgVulkanRules) != 0; } - bool spirvRules() const { return (messages & EShMsgSpvRules) != 0; } void reservedErrorCheck(const TSourceLoc&, const TString&); void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op); @@ -282,6 +280,7 @@ public: EShLanguage language; // vertex or fragment language int version; // version, updated by #version in the shader EProfile profile; // the declared profile in the shader (core by default) + int spv; // SPIR-V version; 0 means not SPIR-V bool forwardCompatible; // true if errors are to be given for use of deprecated features // Current state of parsing diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 23e5191f..806f735d 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -345,8 +345,6 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["mat2"] = MAT2; (*KeywordMap)["mat3"] = MAT3; (*KeywordMap)["mat4"] = MAT4; - (*KeywordMap)["sampler2D"] = SAMPLER2D; - (*KeywordMap)["samplerCube"] = SAMPLERCUBE; (*KeywordMap)["true"] = BOOLCONSTANT; (*KeywordMap)["false"] = BOOLCONSTANT; (*KeywordMap)["attribute"] = ATTRIBUTE; @@ -425,6 +423,13 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["dvec2"] = DVEC2; (*KeywordMap)["dvec3"] = DVEC3; (*KeywordMap)["dvec4"] = DVEC4; + (*KeywordMap)["uint"] = UINT; + (*KeywordMap)["uvec2"] = UVEC2; + (*KeywordMap)["uvec3"] = UVEC3; + (*KeywordMap)["uvec4"] = UVEC4; + + (*KeywordMap)["sampler2D"] = SAMPLER2D; + (*KeywordMap)["samplerCube"] = SAMPLERCUBE; (*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY; (*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW; (*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY; @@ -435,10 +440,6 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["isampler1D"] = ISAMPLER1D; (*KeywordMap)["usampler1DArray"] = USAMPLER1DARRAY; (*KeywordMap)["samplerBuffer"] = SAMPLERBUFFER; - (*KeywordMap)["uint"] = UINT; - (*KeywordMap)["uvec2"] = UVEC2; - (*KeywordMap)["uvec3"] = UVEC3; - (*KeywordMap)["uvec4"] = UVEC4; (*KeywordMap)["samplerCubeShadow"] = SAMPLERCUBESHADOW; (*KeywordMap)["sampler2DArray"] = SAMPLER2DARRAY; (*KeywordMap)["sampler2DArrayShadow"] = SAMPLER2DARRAYSHADOW; @@ -467,7 +468,9 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["sampler2DRect"] = SAMPLER2DRECT; (*KeywordMap)["sampler2DRectShadow"] = SAMPLER2DRECTSHADOW; (*KeywordMap)["sampler1DArray"] = SAMPLER1DARRAY; + (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external + (*KeywordMap)["noperspective"] = NOPERSPECTIVE; (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index ecf888c1..8167e3c2 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -124,12 +124,12 @@ TPoolAllocator* PerProcessGPA = 0; // // Parse and add to the given symbol table the content of the given shader string. // -bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, EShLanguage language, TInfoSink& infoSink, +bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, int spv, EShLanguage language, TInfoSink& infoSink, TSymbolTable& symbolTable) { TIntermediate intermediate(language, version, profile); - TParseContext parseContext(symbolTable, intermediate, true, version, profile, language, infoSink); + TParseContext parseContext(symbolTable, intermediate, true, version, profile, spv, language, infoSink); TPpContext ppContext(parseContext, TShader::ForbidInclude()); TScanContext scanContext(parseContext); parseContext.setScanContext(&scanContext); @@ -152,6 +152,7 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil if (! parseContext.parseShaderStrings(ppContext, input) != 0) { infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); printf("Unable to parse built-ins\n%s\n", infoSink.info.c_str()); + printf("%s\n", builtInShaders[0]); return false; } @@ -167,11 +168,11 @@ int CommonIndex(EProfile profile, EShLanguage language) // // To initialize per-stage shared tables, with the common table already complete. // -void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) +void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, int spv, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); - InitializeSymbolTable(builtIns.getStageString(language), version, profile, language, infoSink, *symbolTables[language]); - IdentifyBuiltIns(version, profile, language, *symbolTables[language]); + InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, language, infoSink, *symbolTables[language]); + IdentifyBuiltIns(version, profile, spv, language, *symbolTables[language]); if (profile == EEsProfile && version >= 300) (*symbolTables[language]).setNoBuiltInRedeclarations(); if (version == 110) @@ -182,49 +183,49 @@ void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profi // Initialize the full set of shareable symbol tables; // The common (cross-stage) and those shareable per-stage. // -bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile) +bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv) { TBuiltIns builtIns; - builtIns.initialize(version, profile); + builtIns.initialize(version, profile, spv); // do the common tables - InitializeSymbolTable(builtIns.getCommonString(), version, profile, EShLangVertex, infoSink, *commonTable[EPcGeneral]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangVertex, infoSink, *commonTable[EPcGeneral]); if (profile == EEsProfile) - InitializeSymbolTable(builtIns.getCommonString(), version, profile, EShLangFragment, infoSink, *commonTable[EPcFragment]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangFragment, infoSink, *commonTable[EPcFragment]); // do the per-stage tables // always have vertex and fragment - InitializeStageSymbolTable(builtIns, version, profile, EShLangVertex, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, EShLangFragment, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangVertex, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangFragment, infoSink, commonTable, symbolTables); // check for tessellation if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) { - InitializeStageSymbolTable(builtIns, version, profile, EShLangTessControl, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, EShLangTessEvaluation, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessControl, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessEvaluation, infoSink, commonTable, symbolTables); } // check for geometry if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, EShLangGeometry, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangGeometry, infoSink, commonTable, symbolTables); // check for compute if ((profile != EEsProfile && version >= 430) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, EShLangCompute, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangCompute, infoSink, commonTable, symbolTables); return true; } -bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, EShLanguage language) +bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, EShLanguage language) { TBuiltIns builtIns; - builtIns.initialize(*resources, version, profile, language); - InitializeSymbolTable(builtIns.getCommonString(), version, profile, language, infoSink, symbolTable); - IdentifyBuiltIns(version, profile, language, symbolTable, *resources); + builtIns.initialize(*resources, version, profile, spv, language); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, language, infoSink, symbolTable); + IdentifyBuiltIns(version, profile, spv, language, symbolTable, *resources); return true; } @@ -241,7 +242,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // This only gets done the first time any thread needs a particular symbol table // (lazy evaluation). // -void SetupBuiltinSymbolTable(int version, EProfile profile) +void SetupBuiltinSymbolTable(int version, EProfile profile, int spv) { TInfoSink infoSink; @@ -271,7 +272,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile) stageTables[stage] = new TSymbolTable; // Generate the local symbol tables using the new pool - InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile); + InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv); // Switch to the process-global pool SetThreadPoolAllocator(*PerProcessGPA); @@ -542,9 +543,11 @@ bool ProcessDeferred( versionWillBeError = true; } + int spv = (messages & EShMsgSpvRules) ? 100 : 0; intermediate.setVersion(version); intermediate.setProfile(profile); - SetupBuiltinSymbolTable(version, profile); + intermediate.setSpv(spv); + SetupBuiltinSymbolTable(version, profile, spv); TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapProfileToIndex(profile)] @@ -558,13 +561,13 @@ bool ProcessDeferred( // Add built-in symbols that are potentially context dependent; // they get popped again further down. - AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, compiler->getLanguage()); + AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, compiler->getLanguage()); // // Now we can process the full shader under proper symbols and rules. // - TParseContext parseContext(symbolTable, intermediate, false, version, profile, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); glslang::TScanContext scanContext(parseContext); TPpContext ppContext(parseContext, includer); parseContext.setScanContext(&scanContext); @@ -1271,6 +1274,11 @@ const char* GetGlslVersionString() return "4.20 glslang LunarG Khronos." GLSLANG_REVISION " " GLSLANG_DATE; } +int GetKhronosToolId() +{ + return 8; +} + bool InitializeProcess() { return ShInitialize() != 0; diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 0e0fca25..73805941 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -134,6 +134,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token DMAT4X2 DMAT4X3 DMAT4X4 %token ATOMIC_UINT +// combined image/sampler %token SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW %token SAMPLERCUBESHADOW SAMPLER1DARRAY SAMPLER2DARRAY SAMPLER1DARRAYSHADOW %token SAMPLER2DARRAYSHADOW ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index 015f91e6..d319c6f5 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -381,7 +381,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructDMat3x4: out.debug << "Construct dmat3x4"; break; case EOpConstructDMat4x2: out.debug << "Construct dmat4x2"; break; case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break; - case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; + case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; case EOpConstructStruct: out.debug << "Construct structure"; break; case EOpLessThan: out.debug << "Compare Less Than"; break; diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 5212abe4..17f8bc4f 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -124,7 +124,7 @@ class TVariable; // class TIntermediate { public: - explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), + explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), spv(0), numMains(0), numErrors(0), recursive(false), invocations(0), vertices(0), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false) @@ -144,6 +144,8 @@ public: int getVersion() const { return version; } void setProfile(EProfile p) { profile = p; } EProfile getProfile() const { return profile; } + void setSpv(int s) { spv = s; } + int getSpv() const { return spv; } EShLanguage getStage() const { return language; } void addRequestedExtension(const char* extension) { requestedExtensions.insert(extension); } const std::set& getRequestedExtensions() const { return requestedExtensions; } @@ -320,6 +322,7 @@ protected: TIntermNode* treeRoot; EProfile profile; int version; + int spv; std::set requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them TBuiltInResource resources; int numMains; diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index 3fbfe354..0c97e39f 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -242,7 +242,7 @@ SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* // The below is further designed to handle multiple compilation units per stage, where // the intermediate results, including the parse tree, are preserved until link time, // rather than the above interface which is designed to have each compilation unit -// lowered at compile time. In above model, linking occurs on the lowered results, +// lowered at compile time. In the above model, linking occurs on the lowered results, // whereas in this model intra-stage linking can occur at the parse tree // (treeRoot in TIntermediate) level, and then a full stage can be lowered. // @@ -258,6 +258,7 @@ namespace glslang { const char* GetEsslVersionString(); const char* GetGlslVersionString(); +int GetKhronosToolId(); class TIntermediate; class TProgram;