diff --git a/.gitignore b/.gitignore index 153aa048..d93c2022 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ *.so *.exe tags -glslang/MachineIndependent/glslang_tab.cpp -glslang/MachineIndependent/glslang_tab.cpp.h build/ Test/localResults/ Test/multiThread.out diff --git a/README.md b/README.md index f56817c7..7a60e280 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,20 @@ CMake: The currently maintained and preferred way of building is through CMake. In MSVC, after running CMake, you may need to use the Configuration Manager to check the INSTALL project. +The grammar in glslang/MachineIndependent/glslang.y has to be recompiled with +bison if it changes, the output files are committed to the repo to avoid every +developer needing to have bison configured to compile the project when grammar +changes are quite infrequent. For windows you can get binaries from +[GnuWin32](http://gnuwin32.sourceforge.net/packages/bison.htm). + +The command to rebuild is: + +``` +bison --defines=MachineIndependent/glslang_tab.cpp.h + -t MachineIndependent/glslang.y + -o MachineIndependent/glslang_tab.cpp +``` + Programmatic Interfaces ----------------------- diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 945350e7..50cda686 100755 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) set(SOURCES GlslangToSpv.cpp + InReadableOrder.cpp SpvBuilder.cpp SPVRemapper.cpp doc.cpp diff --git a/SPIRV/GLSL.std.450.h b/SPIRV/GLSL.std.450.h index d1c9b5c1..df31092b 100755 --- a/SPIRV/GLSL.std.450.h +++ b/SPIRV/GLSL.std.450.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2014-2015 The Khronos Group Inc. +** Copyright (c) 2014-2016 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and/or associated documentation files (the "Materials"), @@ -27,8 +27,8 @@ #ifndef GLSLstd450_H #define GLSLstd450_H -const int GLSLstd450Version = 99; -const int GLSLstd450Revision = 3; +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 1; enum GLSLstd450 { GLSLstd450Bad = 0, // Don't use @@ -83,7 +83,7 @@ enum GLSLstd450 { GLSLstd450UClamp = 44, GLSLstd450SClamp = 45, GLSLstd450FMix = 46, - GLSLstd450IMix = 47, + GLSLstd450IMix = 47, // Reserved GLSLstd450Step = 48, GLSLstd450SmoothStep = 49, @@ -121,6 +121,10 @@ enum GLSLstd450 { GLSLstd450InterpolateAtSample = 77, GLSLstd450InterpolateAtOffset = 78, + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + GLSLstd450Count }; diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 964ff09e..1a8ba449 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1,5 +1,6 @@ // -//Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -88,10 +89,16 @@ public: void dumpSpv(std::vector& out); protected: + spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); + spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable); + spv::ImageFormat TranslateImageFormat(const glslang::TType& type); spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id getSampledType(const glslang::TSampler&); spv::Id convertGlslangToSpvType(const glslang::TType& type); spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim); + spv::Id accessChainLoad(const glslang::TType& type); + void accessChainStore(const glslang::TType& type, spv::Id rvalue); glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); @@ -110,6 +117,7 @@ protected: spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right); spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); + spv::Id createUnaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destTypeId, spv::Id operand); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); @@ -119,6 +127,7 @@ protected: 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); + void addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value); 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); @@ -144,7 +153,6 @@ protected: std::unordered_map structMap[glslang::ElpCount][glslang::ElmCount]; std::unordered_map > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) std::stack breakForLoop; // false means break for switch - std::stack loopTerminal; // code from the last part of a for loop: for(...; ...; terminal), needed for e.g., continue }; }; // @@ -190,6 +198,8 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type) else if (type.getQualifier().isPipeOutput()) return spv::StorageClassOutput; else if (type.getQualifier().isUniformOrBuffer()) { + if (type.getQualifier().layoutPushConstant) + return spv::StorageClassPushConstant; if (type.getBasicType() == glslang::EbtBlock) return spv::StorageClassUniform; else if (type.getBasicType() == glslang::EbtAtomicUint) @@ -220,6 +230,7 @@ spv::Dim TranslateDimensionality(const glslang::TSampler& sampler) case glslang::EsdCube: return spv::DimCube; case glslang::EsdRect: return spv::DimRect; case glslang::EsdBuffer: return spv::DimBuffer; + case glslang::EsdSubpass: return spv::DimSubpassData; default: assert(0); return spv::Dim2D; @@ -232,7 +243,6 @@ spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type) switch (type.getQualifier().precision) { case glslang::EpqLow: return spv::DecorationRelaxedPrecision; case glslang::EpqMedium: return spv::DecorationRelaxedPrecision; - case glslang::EpqHigh: return spv::NoPrecision; default: return spv::NoPrecision; } @@ -256,6 +266,21 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type) return (spv::Decoration)spv::BadValue; } +// Translate glslang type to SPIR-V memory decorations. +void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector& memory) +{ + if (qualifier.coherent) + memory.push_back(spv::DecorationCoherent); + if (qualifier.volatil) + memory.push_back(spv::DecorationVolatile); + if (qualifier.restrict) + memory.push_back(spv::DecorationRestrict); + if (qualifier.readonly) + memory.push_back(spv::DecorationNonWritable); + if (qualifier.writeonly) + memory.push_back(spv::DecorationNonReadable); +} + // Translate glslang type to SPIR-V layout decorations. spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::TLayoutMatrix matrixLayout) { @@ -299,7 +324,7 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T // Translate glslang type to SPIR-V interpolation decorations. // Returns spv::Decoration(spv::BadValue) when no decoration // should be applied. -spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier) +spv::Decoration TGlslangToSpvTraverser::TranslateInterpolationDecoration(const glslang::TQualifier& qualifier) { if (qualifier.smooth) { // Smooth decoration doesn't exist in SPIR-V 1.0 @@ -313,13 +338,14 @@ spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qual return spv::DecorationFlat; else if (qualifier.centroid) return spv::DecorationCentroid; - else if (qualifier.sample) + else if (qualifier.sample) { + builder.addCapability(spv::CapabilitySampleRateShading); return spv::DecorationSample; - else + } else return (spv::Decoration)spv::BadValue; } -// If glslang type is invaraiant, return SPIR-V invariant decoration. +// If glslang type is invariant, return SPIR-V invariant decoration. spv::Decoration TranslateInvariantDecoration(const glslang::TQualifier& qualifier) { if (qualifier.invariant) @@ -329,15 +355,52 @@ spv::Decoration TranslateInvariantDecoration(const glslang::TQualifier& qualifie } // Translate glslang built-in variable to SPIR-V built in decoration. -spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) +spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) { switch (builtIn) { + case glslang::EbvPointSize: + switch (glslangIntermediate->getStage()) { + case EShLangGeometry: + builder.addCapability(spv::CapabilityGeometryPointSize); + break; + case EShLangTessControl: + case EShLangTessEvaluation: + builder.addCapability(spv::CapabilityTessellationPointSize); + break; + default: + break; + } + return spv::BuiltInPointSize; + + case glslang::EbvClipDistance: + builder.addCapability(spv::CapabilityClipDistance); + return spv::BuiltInClipDistance; + + case glslang::EbvCullDistance: + builder.addCapability(spv::CapabilityCullDistance); + return spv::BuiltInCullDistance; + + case glslang::EbvViewportIndex: + builder.addCapability(spv::CapabilityMultiViewport); + return spv::BuiltInViewportIndex; + + case glslang::EbvSampleId: + builder.addCapability(spv::CapabilitySampleRateShading); + return spv::BuiltInSampleId; + + case glslang::EbvSamplePosition: + builder.addCapability(spv::CapabilitySampleRateShading); + return spv::BuiltInSamplePosition; + + case glslang::EbvSampleMask: + builder.addCapability(spv::CapabilitySampleRateShading); + return spv::BuiltInSampleMask; + case glslang::EbvPosition: return spv::BuiltInPosition; - case glslang::EbvPointSize: return spv::BuiltInPointSize; - case glslang::EbvClipDistance: return spv::BuiltInClipDistance; - case glslang::EbvCullDistance: return spv::BuiltInCullDistance; case glslang::EbvVertexId: return spv::BuiltInVertexId; case glslang::EbvInstanceId: return spv::BuiltInInstanceId; + case glslang::EbvVertexIndex: return spv::BuiltInVertexIndex; + case glslang::EbvInstanceIndex: return spv::BuiltInInstanceIndex; case glslang::EbvBaseVertex: case glslang::EbvBaseInstance: case glslang::EbvDrawId: @@ -347,7 +410,6 @@ spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) case glslang::EbvPrimitiveId: return spv::BuiltInPrimitiveId; case glslang::EbvInvocationId: return spv::BuiltInInvocationId; case glslang::EbvLayer: return spv::BuiltInLayer; - case glslang::EbvViewportIndex: return spv::BuiltInViewportIndex; case glslang::EbvTessLevelInner: return spv::BuiltInTessLevelInner; case glslang::EbvTessLevelOuter: return spv::BuiltInTessLevelOuter; case glslang::EbvTessCoord: return spv::BuiltInTessCoord; @@ -355,9 +417,6 @@ spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) case glslang::EbvFragCoord: return spv::BuiltInFragCoord; case glslang::EbvPointCoord: return spv::BuiltInPointCoord; case glslang::EbvFace: return spv::BuiltInFrontFacing; - case glslang::EbvSampleId: return spv::BuiltInSampleId; - case glslang::EbvSamplePosition: return spv::BuiltInSamplePosition; - case glslang::EbvSampleMask: return spv::BuiltInSampleMask; case glslang::EbvFragDepth: return spv::BuiltInFragDepth; case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation; case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups; @@ -371,10 +430,48 @@ spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) } // Translate glslang image layout format to SPIR-V image format. -spv::ImageFormat TranslateImageFormat(const glslang::TType& type) +spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TType& type) { assert(type.getBasicType() == glslang::EbtSampler); + // Check for capabilities + switch (type.getQualifier().layoutFormat) { + case glslang::ElfRg32f: + case glslang::ElfRg16f: + case glslang::ElfR11fG11fB10f: + case glslang::ElfR16f: + case glslang::ElfRgba16: + case glslang::ElfRgb10A2: + case glslang::ElfRg16: + case glslang::ElfRg8: + case glslang::ElfR16: + case glslang::ElfR8: + case glslang::ElfRgba16Snorm: + case glslang::ElfRg16Snorm: + case glslang::ElfRg8Snorm: + case glslang::ElfR16Snorm: + case glslang::ElfR8Snorm: + + case glslang::ElfRg32i: + case glslang::ElfRg16i: + case glslang::ElfRg8i: + case glslang::ElfR16i: + case glslang::ElfR8i: + + case glslang::ElfRgb10a2ui: + case glslang::ElfRg32ui: + case glslang::ElfRg16ui: + case glslang::ElfRg8ui: + case glslang::ElfR16ui: + case glslang::ElfR8ui: + builder.addCapability(spv::CapabilityStorageImageExtendedFormats); + break; + + default: + break; + } + + // do the translation switch (type.getQualifier().layoutFormat) { case glslang::ElfNone: return spv::ImageFormatUnknown; case glslang::ElfRgba32f: return spv::ImageFormatRgba32f; @@ -420,6 +517,25 @@ spv::ImageFormat TranslateImageFormat(const glslang::TType& type) } } +// Return whether or not the given type is something that should be tied to a +// descriptor set. +bool IsDescriptorResource(const glslang::TType& type) +{ + // uniform and buffer blocks are included, unless it is a push_constant + if (type.getBasicType() == glslang::EbtBlock) + return type.getQualifier().isUniformOrBuffer() && ! type.getQualifier().layoutPushConstant; + + // non block... + // basically samplerXXX/subpass/sampler/texture are all included + // if they are the global-scope-class, not the function parameter + // (or local, if they ever exist) class. + if (type.getBasicType() == glslang::EbtSampler) + return type.getQualifier().isUniformOrBuffer(); + + // None of the above. + return false; +} + void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& parent) { if (child.layoutMatrix == glslang::ElmNone) @@ -437,15 +553,25 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa child.patch = true; if (parent.sample) child.sample = true; + if (parent.coherent) + child.coherent = true; + if (parent.volatil) + child.volatil = true; + if (parent.restrict) + child.restrict = true; + if (parent.readonly) + child.readonly = true; + if (parent.writeonly) + child.writeonly = true; } bool HasNonLayoutQualifiers(const glslang::TQualifier& qualifier) { - // This should list qualifiers that simultaneous satisify: + // This should list qualifiers that simultaneous satisfy: // - struct members can inherit from a struct declaration // - effect decorations on the struct members (note smooth does not, and expecting something like volatile to effect the whole object) // - are not part of the offset/st430/etc or row/column-major layout - return qualifier.invariant || qualifier.nopersp || qualifier.flat || qualifier.centroid || qualifier.patch || qualifier.sample; + return qualifier.invariant || qualifier.nopersp || qualifier.flat || qualifier.centroid || qualifier.patch || qualifier.sample || qualifier.hasLocation(); } // @@ -474,8 +600,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls // Add the top-level modes for this shader. - if (glslangIntermediate->getXfbMode()) + if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::CapabilityTransformFeedback); builder.addExecutionMode(shaderEntry, spv::ExecutionModeXfb); + } unsigned int mode; switch (glslangIntermediate->getStage()) { @@ -588,8 +716,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls void TGlslangToSpvTraverser::dumpSpv(std::vector& out) { // finish off the entry-point SPV instruction by adding the Input/Output - for (auto it : iOSet) - entryPoint->addIdOperand(it); + for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it) + entryPoint->addIdOperand(*it); builder.dump(out); } @@ -632,7 +760,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) } // Only process non-linkage-only nodes for generating actual static uses - if (! linkageOnly) { + if (! linkageOnly || symbol->getQualifier().isSpecConstant()) { // Prepare to generate code for the access // L-value chains will be computed left to right. We're on the symbol now, @@ -641,10 +769,14 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) builder.clearAccessChain(); // For now, we consider all user variables as being in memory, so they are pointers, - // except for "const in" arguments to a function, which are an intermediate object. - // See comments in handleUserFunctionCall(). - glslang::TStorageQualifier qualifier = symbol->getQualifier().storage; - if (qualifier == glslang::EvqConstReadOnly && constReadOnlyParameters.find(symbol->getId()) != constReadOnlyParameters.end()) + // except for + // A) "const in" arguments to a function, which are an intermediate object. + // See comments in handleUserFunctionCall(). + // B) Specialization constants (normal constant don't even come in as a variable), + // These are also pure R-values. + glslang::TQualifier qualifier = symbol->getQualifier(); + if ((qualifier.storage == glslang::EvqConstReadOnly && constReadOnlyParameters.find(symbol->getId()) != constReadOnlyParameters.end()) || + qualifier.isSpecConstant()) builder.setAccessChainRValue(id); else builder.setAccessChainLValue(id); @@ -683,12 +815,12 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // evaluate the right builder.clearAccessChain(); node->getRight()->traverse(this); - spv::Id rValue = builder.accessChainLoad(convertGlslangToSpvType(node->getRight()->getType())); + spv::Id rValue = accessChainLoad(node->getRight()->getType()); if (node->getOp() != glslang::EOpAssign) { // the left is also an r-value builder.setAccessChain(lValue); - spv::Id leftRValue = builder.accessChainLoad(convertGlslangToSpvType(node->getLeft()->getType())); + spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); // do the operation rValue = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getType()), @@ -701,7 +833,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // store the result builder.setAccessChain(lValue); - builder.accessChainStore(rValue); + accessChainStore(node->getType(), rValue); // assignments are expressions having an rValue after they are evaluated... builder.clearAccessChain(); @@ -756,7 +888,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // compute the next index in the chain builder.clearAccessChain(); node->getRight()->traverse(this); - spv::Id index = builder.accessChainLoad(convertGlslangToSpvType(node->getRight()->getType())); + spv::Id index = accessChainLoad(node->getRight()->getType()); // restore the saved access chain builder.setAccessChain(partial); @@ -798,21 +930,20 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // Assume generic binary op... - // Get the operands + // get right operand builder.clearAccessChain(); node->getLeft()->traverse(this); - spv::Id left = builder.accessChainLoad(convertGlslangToSpvType(node->getLeft()->getType())); + spv::Id left = accessChainLoad(node->getLeft()->getType()); + // get left operand builder.clearAccessChain(); node->getRight()->traverse(this); - spv::Id right = builder.accessChainLoad(convertGlslangToSpvType(node->getRight()->getType())); + spv::Id right = accessChainLoad(node->getRight()->getType()); - spv::Id result; - spv::Decoration precision = TranslatePrecisionDecoration(node->getType()); - - result = createBinaryOperation(node->getOp(), precision, - convertGlslangToSpvType(node->getType()), left, right, - node->getLeft()->getType().getBasicType()); + // get result + spv::Id result = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getType()), + convertGlslangToSpvType(node->getType()), left, right, + node->getLeft()->getType().getBasicType()); builder.clearAccessChain(); if (! result) { @@ -870,7 +1001,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI node->getOp() == glslang::EOpInterpolateAtCentroid) operand = builder.accessChainGetLValue(); // Special case l-value operands else - operand = builder.accessChainLoad(convertGlslangToSpvType(node->getOperand()->getType())); + operand = accessChainLoad(node->getOperand()->getType()); spv::Decoration precision = TranslatePrecisionDecoration(node->getType()); @@ -1035,9 +1166,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt { if (node->isUserDefined()) result = handleUserFunctionCall(node); - assert(result); - builder.clearAccessChain(); - builder.setAccessChainRValue(result); + //assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done + if (result) { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else + spv::MissingFunctionality("missing user function; linker needs to catch that"); return false; } @@ -1082,12 +1216,15 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructUVec3: case glslang::EOpConstructUVec4: case glslang::EOpConstructStruct: + case glslang::EOpConstructTextureSampler: { std::vector arguments; translateArguments(*node, arguments); spv::Id resultTypeId = convertGlslangToSpvType(node->getType()); spv::Id constructed; - if (node->getOp() == glslang::EOpConstructStruct || node->getType().isArray()) { + if (node->getOp() == glslang::EOpConstructTextureSampler) + constructed = builder.createOp(spv::OpSampledImage, resultTypeId, arguments); + else if (node->getOp() == glslang::EOpConstructStruct || node->getType().isArray()) { std::vector constituents; for (int c = 0; c < (int)arguments.size(); ++c) constituents.push_back(arguments[c]); @@ -1182,11 +1319,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.clearAccessChain(); left->traverse(this); - spv::Id leftId = builder.accessChainLoad(convertGlslangToSpvType(left->getType())); + spv::Id leftId = accessChainLoad(left->getType()); builder.clearAccessChain(); right->traverse(this); - spv::Id rightId = builder.accessChainLoad(convertGlslangToSpvType(right->getType())); + spv::Id rightId = accessChainLoad(right->getType()); result = createBinaryOperation(binOp, precision, convertGlslangToSpvType(node->getType()), leftId, rightId, @@ -1249,7 +1386,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (lvalue) operands.push_back(builder.accessChainGetLValue()); else - operands.push_back(builder.accessChainLoad(convertGlslangToSpvType(glslangOperands[arg]->getAsTyped()->getType()))); + operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); } if (atomic) { @@ -1299,13 +1436,13 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang node->getCondition()->traverse(this); // make an "if" based on the value created by the condition - spv::Builder::If ifBuilder(builder.accessChainLoad(convertGlslangToSpvType(node->getCondition()->getType())), builder); + spv::Builder::If ifBuilder(accessChainLoad(node->getCondition()->getType()), builder); if (node->getTrueBlock()) { // emit the "then" statement node->getTrueBlock()->traverse(this); if (result) - builder.createStore(builder.accessChainLoad(convertGlslangToSpvType(node->getTrueBlock()->getAsTyped()->getType())), result); + builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); } if (node->getFalseBlock()) { @@ -1313,7 +1450,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // emit the "else" statement node->getFalseBlock()->traverse(this); if (result) - builder.createStore(builder.accessChainLoad(convertGlslangToSpvType(node->getFalseBlock()->getAsTyped()->getType())), result); + builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); } ifBuilder.makeEndIf(); @@ -1334,7 +1471,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T { // emit and get the condition before doing anything with switch node->getCondition()->traverse(this); - spv::Id selector = builder.accessChainLoad(convertGlslangToSpvType(node->getCondition()->getAsTyped()->getType())); + spv::Id selector = accessChainLoad(node->getCondition()->getAsTyped()->getType()); // browse the children to sort out code segments int defaultSegment = -1; @@ -1390,33 +1527,64 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) { - // body emission needs to know what the for-loop terminal is when it sees a "continue" - loopTerminal.push(node->getTerminal()); + auto blocks = builder.makeNewLoop(); + builder.createBranch(&blocks.head); + // Spec requires back edges to target header blocks, and every header block + // must dominate its merge block. Make a header block first to ensure these + // conditions are met. By definition, it will contain OpLoopMerge, followed + // by a block-ending branch. But we don't want to put any other body/test + // instructions in it, since the body/test may have arbitrary instructions, + // including merges of its own. + builder.setBuildPoint(&blocks.head); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone); + if (node->testFirst() && node->getTest()) { + spv::Block& test = builder.makeNewBlock(); + builder.createBranch(&test); - builder.makeNewLoop(node->testFirst()); - - if (node->getTest()) { + builder.setBuildPoint(&test); node->getTest()->traverse(this); - // the AST only contained the test computation, not the branch, we have to add it - spv::Id condition = builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); - builder.createLoopTestBranch(condition); - } else { - builder.createBranchToBody(); - } + spv::Id condition = + accessChainLoad(node->getTest()->getType()); + builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); - if (node->getBody()) { + builder.setBuildPoint(&blocks.body); breakForLoop.push(true); - node->getBody()->traverse(this); + if (node->getBody()) + node->getBody()->traverse(this); + builder.createBranch(&blocks.continue_target); breakForLoop.pop(); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + builder.createBranch(&blocks.head); + } else { + builder.createBranch(&blocks.body); + + breakForLoop.push(true); + builder.setBuildPoint(&blocks.body); + if (node->getBody()) + node->getBody()->traverse(this); + builder.createBranch(&blocks.continue_target); + breakForLoop.pop(); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + if (node->getTest()) { + node->getTest()->traverse(this); + spv::Id condition = + accessChainLoad(node->getTest()->getType()); + builder.createConditionalBranch(condition, &blocks.head, &blocks.merge); + } else { + // TODO: unless there was a break/return/discard instruction + // somewhere in the body, this is an infinite loop, so we should + // issue a warning. + builder.createBranch(&blocks.head); + } } - - if (loopTerminal.top()) - loopTerminal.top()->traverse(this); - + builder.setBuildPoint(&blocks.merge); builder.closeLoop(); - - loopTerminal.pop(); - return false; } @@ -1436,13 +1604,11 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T builder.addSwitchBreak(); break; case glslang::EOpContinue: - if (loopTerminal.top()) - loopTerminal.top()->traverse(this); builder.createLoopContinue(); break; case glslang::EOpReturn: if (node->getExpression()) - builder.makeReturn(false, builder.accessChainLoad(convertGlslangToSpvType(node->getExpression()->getType()))); + builder.makeReturn(false, accessChainLoad(node->getExpression()->getType())); else builder.makeReturn(false); @@ -1499,7 +1665,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty } // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. -// explicitLayout can be kept the same throughout the heirarchical recursive walk. +// explicitLayout can be kept the same throughout the hierarchical recursive walk. spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier) { spv::Id spvType = spv::NoResult; @@ -1516,7 +1682,12 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeFloatType(64); break; case glslang::EbtBool: - spvType = builder.makeBoolType(); + // "transparent" bool doesn't exist in SPIR-V. The GLSL convention is + // a 32-bit int where non-0 means true. + if (explicitLayout != glslang::ElpNone) + spvType = builder.makeUintType(32); + else + spvType = builder.makeBoolType(); break; case glslang::EbtInt: spvType = builder.makeIntType(32); @@ -1531,11 +1702,17 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtSampler: { const glslang::TSampler& sampler = type.getSampler(); - // 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); + if (sampler.sampler) { + // pure sampler + spvType = builder.makeSamplerType(); + } else { + // 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.combined) { + // already has both image and sampler, make the combined type + spvType = builder.makeSampledImageType(spvType); + } } } break; @@ -1559,6 +1736,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, except sometimes for blocks if (type.getBasicType() == glslang::EbtBlock) memberRemapper[glslangStruct].resize(glslangStruct->size()); + int locationOffset = 0; // for use across struct members, when they are called recursively for (int i = 0; i < (int)glslangStruct->size(); i++) { glslang::TType& glslangType = *(*glslangStruct)[i].type; if (glslangType.hiddenMember()) { @@ -1571,6 +1749,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // modify just this child's view of the qualifier glslang::TQualifier subQualifier = glslangType.getQualifier(); InheritQualifiers(subQualifier, qualifier); + + // manually inherit location; it's more complex + if (! subQualifier.hasLocation() && qualifier.hasLocation()) + subQualifier.layoutLocation = qualifier.layoutLocation + locationOffset; + if (qualifier.hasLocation()) + locationOffset += glslangIntermediate->computeTypeLocationSize(glslangType); + + // recurse structFields.push_back(convertGlslangToSpvType(glslangType, explicitLayout, subQualifier)); } } @@ -1582,6 +1768,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // Name and decorate the non-hidden members int offset = -1; + locationOffset = 0; // for use within the members of this struct, right now for (int i = 0; i < (int)glslangStruct->size(); i++) { glslang::TType& glslangType = *(*glslangStruct)[i].type; int member = i; @@ -1599,8 +1786,29 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangType)); addMemberDecoration(spvType, member, TranslateInterpolationDecoration(subQualifier)); addMemberDecoration(spvType, member, TranslateInvariantDecoration(subQualifier)); - if (glslangType.getQualifier().hasLocation()) - builder.addMemberDecoration(spvType, member, spv::DecorationLocation, glslangType.getQualifier().layoutLocation); + + if (qualifier.storage == glslang::EvqBuffer) { + std::vector memory; + TranslateMemoryDecoration(subQualifier, memory); + for (unsigned int i = 0; i < memory.size(); ++i) + addMemberDecoration(spvType, member, memory[i]); + } + + // compute location decoration; tricky based on whether inheritance is at play + // TODO: This algorithm (and it's cousin above doing almost the same thing) should + // probably move to the linker stage of the front end proper, and just have the + // answer sitting already distributed throughout the individual member locations. + int location = -1; // will only decorate if present or inherited + if (subQualifier.hasLocation()) // no inheritance, or override of inheritance + location = subQualifier.layoutLocation; + else if (qualifier.hasLocation()) // inheritance + location = qualifier.layoutLocation + locationOffset; + if (qualifier.hasLocation()) // track for upcoming inheritance + locationOffset += glslangIntermediate->computeTypeLocationSize(glslangType); + if (location >= 0) + builder.addMemberDecoration(spvType, member, spv::DecorationLocation, location); + + // component, XFB, others if (glslangType.getQualifier().hasComponent()) builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangType.getQualifier().layoutComponent); if (glslangType.getQualifier().hasXfbOffset()) @@ -1620,16 +1828,19 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // built-in variable decorations spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangType.getQualifier().builtIn); if (builtIn != spv::BadValue) - builder.addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); + addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); } } // Decorate the structure addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); addDecoration(spvType, TranslateBlockDecoration(type)); - if (type.getQualifier().hasStream()) + if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { + builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); + } if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::CapabilityTransformFeedback); if (type.getQualifier().hasXfbStride()) builder.addDecoration(spvType, spv::DecorationXfbStride, type.getQualifier().layoutXfbStride); if (type.getQualifier().hasXfbBuffer()) @@ -1670,12 +1881,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // make the arrays for (int dim = type.getArraySizes()->getNumDims() - 1; dim > 0; --dim) { - int size = type.getArraySizes()->getDimSize(dim); - assert(size > 0); - spvType = builder.makeArrayType(spvType, size, stride); + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), dim), stride); if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); - stride *= size; + stride *= type.getArraySizes()->getDimSize(dim); } } else { // single-dimensional array, and don't yet have stride @@ -1690,7 +1899,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeRuntimeArray(spvType); } else { assert(type.getOuterArraySize() > 0); - spvType = builder.makeArrayType(spvType, type.getOuterArraySize(), stride); + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); } if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); @@ -1699,6 +1908,86 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return spvType; } +// Turn the expression forming the array size into an id. +// This is not quite trivial, because of specialization constants. +// Sometimes, a raw constant is turned into an Id, and sometimes +// a specialization constant expression is. +spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim) +{ + // First, see if this is sized with a node, meaning a specialization constant: + glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim); + if (specNode != nullptr) { + builder.clearAccessChain(); + specNode->traverse(this); + return accessChainLoad(specNode->getAsTyped()->getType()); + } + + // Otherwise, need a compile-time (front end) size, get it: + int size = arraySizes.getDimSize(dim); + assert(size > 0); + return builder.makeUintConstant(size); +} + +// Wrap the builder's accessChainLoad to: +// - localize handling of RelaxedPrecision +// - use the SPIR-V inferred type instead of another conversion of the glslang type +// (avoids unnecessary work and possible type punning for structures) +// - do conversion of concrete to abstract type +spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) +{ + spv::Id nominalTypeId = builder.accessChainGetInferredType(); + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), nominalTypeId); + + // Need to convert to abstract types when necessary + if (type.getBasicType() == glslang::EbtBool) { + if (builder.isScalarType(nominalTypeId)) { + // Conversion for bool + spv::Id boolType = builder.makeBoolType(); + if (nominalTypeId != boolType) + loadedId = builder.createBinOp(spv::OpINotEqual, boolType, loadedId, builder.makeUintConstant(0)); + } else if (builder.isVectorType(nominalTypeId)) { + // Conversion for bvec + int vecSize = builder.getNumTypeComponents(nominalTypeId); + spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize); + if (nominalTypeId != bvecType) + loadedId = builder.createBinOp(spv::OpINotEqual, bvecType, loadedId, makeSmearedConstant(builder.makeUintConstant(0), vecSize)); + } + } + + return loadedId; +} + +// Wrap the builder's accessChainStore to: +// - do conversion of concrete to abstract type +void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::Id rvalue) +{ + // Need to convert to abstract types when necessary + if (type.getBasicType() == glslang::EbtBool) { + spv::Id nominalTypeId = builder.accessChainGetInferredType(); + + if (builder.isScalarType(nominalTypeId)) { + // Conversion for bool + spv::Id boolType = builder.makeBoolType(); + if (nominalTypeId != boolType) { + spv::Id zero = builder.makeUintConstant(0); + spv::Id one = builder.makeUintConstant(1); + rvalue = builder.createTriOp(spv::OpSelect, nominalTypeId, rvalue, one, zero); + } + } else if (builder.isVectorType(nominalTypeId)) { + // Conversion for bvec + int vecSize = builder.getNumTypeComponents(nominalTypeId); + spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize); + if (nominalTypeId != bvecType) { + spv::Id zero = makeSmearedConstant(builder.makeUintConstant(0), vecSize); + spv::Id one = makeSmearedConstant(builder.makeUintConstant(1), vecSize); + rvalue = builder.createTriOp(spv::OpSelect, nominalTypeId, rvalue, one, zero); + } + } + } + + builder.accessChainStore(rvalue); +} + // Decide whether or not this type should be // decorated with offsets and strides, and if so // whether std140 or std430 rules should be applied. @@ -1754,7 +2043,7 @@ int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, gl // 'currentOffset' should be passed in already initialized, ready to modify, and reflecting // the migration of data from nextOffset -> currentOffset. It should be -1 on the first call. // -1 means a non-forced member offset (no decoration needed). -void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, +void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& /*structType*/, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) { // this will get a positive value when deemed necessary @@ -1819,6 +2108,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF // copy-in/copy-out semantics. They can be handled though with a pointer to a copy. std::vector paramTypes; + std::vector paramPrecisions; glslang::TIntermSequence& parameters = glslFunction->getSequence()[0]->getAsAggregate()->getSequence(); for (int p = 0; p < (int)parameters.size(); ++p) { @@ -1828,12 +2118,14 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF typeId = builder.makePointer(spv::StorageClassFunction, typeId); else constReadOnlyParameters.insert(parameters[p]->getAsSymbolNode()->getId()); + paramPrecisions.push_back(TranslatePrecisionDecoration(paramType)); paramTypes.push_back(typeId); } spv::Block* functionBlock; - spv::Function *function = builder.makeFunctionEntry(convertGlslangToSpvType(glslFunction->getType()), glslFunction->getName().c_str(), - paramTypes, &functionBlock); + spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()), + convertGlslangToSpvType(glslFunction->getType()), + glslFunction->getName().c_str(), paramTypes, paramPrecisions, &functionBlock); // Track function to emit/call later functionMap[glslFunction->getName().c_str()] = function; @@ -1884,6 +2176,14 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments) { const glslang::TIntermSequence& glslangArguments = node.getSequence(); + + glslang::TSampler sampler = {}; + bool cubeCompare = false; + if (node.isTexture() || node.isImage()) { + sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); + cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; + } + for (int i = 0; i < (int)glslangArguments.size(); ++i) { builder.clearAccessChain(); glslangArguments[i]->traverse(this); @@ -1902,6 +2202,55 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 0) lvalue = true; break; + case glslang::EOpSparseImageLoad: + if ((sampler.ms && i == 3) || (! sampler.ms && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTexture: + if ((cubeCompare && i == 3) || (! cubeCompare && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureClamp: + if ((cubeCompare && i == 4) || (! cubeCompare && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLod: + case glslang::EOpSparseTextureOffset: + if (i == 3) + lvalue = true; + break; + case glslang::EOpSparseTextureFetch: + if ((sampler.dim != glslang::EsdRect && i == 3) || (sampler.dim == glslang::EsdRect && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureFetchOffset: + if ((sampler.dim != glslang::EsdRect && i == 4) || (sampler.dim == glslang::EsdRect && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLodOffset: + case glslang::EOpSparseTextureGrad: + case glslang::EOpSparseTextureOffsetClamp: + if (i == 4) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffset: + case glslang::EOpSparseTextureGradClamp: + if (i == 5) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffsetClamp: + if (i == 6) + lvalue = true; + break; + case glslang::EOpSparseTextureGather: + if ((sampler.shadow && i == 3) || (! sampler.shadow && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureGatherOffset: + case glslang::EOpSparseTextureGatherOffsets: + if ((sampler.shadow && i == 4) || (! sampler.shadow && i == 3)) + lvalue = true; + break; default: break; } @@ -1909,7 +2258,7 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (lvalue) arguments.push_back(builder.accessChainGetLValue()); else - arguments.push_back(builder.accessChainLoad(convertGlslangToSpvType(glslangArguments[i]->getAsTyped()->getType()))); + arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType())); } } @@ -1917,7 +2266,7 @@ void TGlslangToSpvTraverser::translateArguments(glslang::TIntermUnary& node, std { builder.clearAccessChain(); node.getOperand()->traverse(this); - arguments.push_back(builder.accessChainLoad(convertGlslangToSpvType(node.getOperand()->getType()))); + arguments.push_back(accessChainLoad(node.getOperand()->getType())); } spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermOperator* node) @@ -1963,6 +2312,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO return builder.createTextureQueryCall(spv::OpImageQueryLod, params); case glslang::EOpTextureQueryLevels: return builder.createTextureQueryCall(spv::OpImageQueryLevels, params); + case glslang::EOpSparseTexelsResident: + return builder.createUnaryOp(spv::OpImageSparseTexelsResident, builder.makeBoolType(), arguments[0]); default: assert(0); break; @@ -1974,12 +2325,32 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO std::vector operands; auto opIt = arguments.begin(); operands.push_back(*(opIt++)); + + // Handle subpass operations + // TODO: GLSL should change to have the "MS" only on the type rather than the + // built-in function. + if (cracked.subpass) { + // add on the (0,0) coordinate + spv::Id zero = builder.makeIntConstant(0); + std::vector comps; + comps.push_back(zero); + comps.push_back(zero); + operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps)); + if (sampler.ms) { + operands.push_back(spv::ImageOperandsSampleMask); + operands.push_back(*(opIt++)); + } + return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands); + } + operands.push_back(*(opIt++)); if (node->getOp() == glslang::EOpImageLoad) { if (sampler.ms) { operands.push_back(spv::ImageOperandsSampleMask); operands.push_back(*opIt); } + if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) + builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands); } else if (node->getOp() == glslang::EOpImageStore) { if (sampler.ms) { @@ -1989,13 +2360,36 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } else operands.push_back(*opIt); builder.createNoResultOp(spv::OpImageWrite, operands); + if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) + builder.addCapability(spv::CapabilityStorageImageWriteWithoutFormat); return spv::NoResult; + } else if (node->getOp() == glslang::EOpSparseImageLoad) { + builder.addCapability(spv::CapabilitySparseResidency); + if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) + builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); + + if (sampler.ms) { + operands.push_back(spv::ImageOperandsSampleMask); + operands.push_back(*opIt++); + } + + // Create the return type that was a special structure + spv::Id texelOut = *opIt; + spv::Id typeId0 = convertGlslangToSpvType(node->getType()); + spv::Id typeId1 = builder.getDerefTypeId(texelOut); + spv::Id resultTypeId = builder.makeStructResultType(typeId0, typeId1); + + spv::Id resultId = builder.createOp(spv::OpImageSparseRead, resultTypeId, operands); + + // Decode the return type + builder.createStore(builder.createCompositeExtract(resultId, typeId1, 1), texelOut); + return builder.createCompositeExtract(resultId, typeId0, 0); } else { // Process image atomic operations // GLSL "IMAGE_PARAMS" will involve in constructing an image texel pointer and this pointer, // as the first source operand, is required by SPIR-V atomic operations. - operands.push_back(sampler.ms ? *(opIt++) : 0); // For non-MS, the value should be 0 + operands.push_back(sampler.ms ? *(opIt++) : builder.makeUintConstant(0)); // For non-MS, the value should be 0 spv::Id resultTypeId = builder.makePointer(spv::StorageClassImage, convertGlslangToSpvType(node->getType())); spv::Id pointer = builder.createOp(spv::OpImageTexelPointer, resultTypeId, operands); @@ -2010,7 +2404,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } // Check for texture functions other than queries - + bool sparse = node->isSparseTexture(); bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; // check for bias argument @@ -2021,6 +2415,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO ++nonBiasArgCount; if (cracked.grad) nonBiasArgCount += 2; + if (cracked.lodClamp) + ++nonBiasArgCount; + if (sparse) + ++nonBiasArgCount; if ((int)arguments.size() > nonBiasArgCount) bias = true; @@ -2030,11 +2428,13 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO params.coords = arguments[1]; int extraArgs = 0; + bool noImplicitLod = false; // sort out where Dref is coming from - if (sampler.shadow && sampler.dim == glslang::EsdCube && sampler.arrayed) + if (cubeCompare) { params.Dref = arguments[2]; - else if (sampler.shadow && cracked.gather) { + ++extraArgs; + } else if (sampler.shadow && cracked.gather) { params.Dref = arguments[2]; ++extraArgs; } else if (sampler.shadow) { @@ -2050,7 +2450,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO if (cracked.lod) { params.lod = arguments[2]; ++extraArgs; - } else if (sampler.ms) { + } else if (glslangIntermediate->getStage() != EShLangFragment) { + // we need to invent the default lod for an explicit lod instruction for a non-fragment stage + noImplicitLod = true; + } + if (sampler.ms) { params.sample = arguments[2]; // For MS, "sample" should be specified ++extraArgs; } @@ -2066,6 +2470,14 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO params.offsets = arguments[2 + extraArgs]; ++extraArgs; } + if (cracked.lodClamp) { + params.lodClamp = arguments[2 + extraArgs]; + ++extraArgs; + } + if (sparse) { + params.texelOut = arguments[2 + extraArgs]; + ++extraArgs; + } if (bias) { params.bias = arguments[2 + extraArgs]; ++extraArgs; @@ -2080,7 +2492,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } - return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), cracked.fetch, cracked.proj, cracked.gather, params); + return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params); } spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) @@ -2104,19 +2516,19 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg // 1. Evaluate the arguments std::vector lValues; std::vector rValues; - std::vector argTypes; + std::vector argTypes; for (int a = 0; a < (int)glslangArgs.size(); ++a) { // build l-value builder.clearAccessChain(); glslangArgs[a]->traverse(this); - argTypes.push_back(convertGlslangToSpvType(glslangArgs[a]->getAsTyped()->getType())); + argTypes.push_back(&glslangArgs[a]->getAsTyped()->getType()); // keep outputs as l-values, evaluate input-only as r-values if (qualifiers[a] != glslang::EvqConstReadOnly) { // save l-value lValues.push_back(builder.getAccessChain()); } else { // process r-value - rValues.push_back(builder.accessChainLoad(argTypes.back())); + rValues.push_back(accessChainLoad(*argTypes.back())); } } @@ -2136,7 +2548,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { // need to copy the input into output space builder.setAccessChain(lValues[lValueCount]); - spv::Id copy = builder.accessChainLoad(argTypes[a]); + spv::Id copy = accessChainLoad(*argTypes[a]); builder.createStore(copy, arg); } ++lValueCount; @@ -2149,6 +2561,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg // 3. Make the call. spv::Id result = builder.createFunctionCall(function, spvArgs); + builder.setPrecision(result, TranslatePrecisionDecoration(node->getType())); // 4. Copy back out an "out" arguments. lValueCount = 0; @@ -2157,7 +2570,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { spv::Id copy = builder.createLoad(spvArgs[a]); builder.setAccessChain(lValues[lValueCount]); - builder.accessChainStore(copy); + accessChainStore(glslangArgs[a]->getAsTyped()->getType(), copy); } ++lValueCount; } @@ -2309,10 +2722,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv if (needMatchingVectors) builder.promoteScalar(precision, left, right); - spv::Id id = builder.createBinOp(binOp, typeId, left, right); - builder.setPrecision(id, precision); - - return id; + return builder.setPrecision(builder.createBinOp(binOp, typeId, left, right), precision); } if (! comparison) @@ -2377,12 +2787,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv break; } - if (binOp != spv::OpNop) { - spv::Id id = builder.createBinOp(binOp, typeId, left, right); - builder.setPrecision(id, precision); - - return id; - } + if (binOp != spv::OpNop) + return builder.setPrecision(builder.createBinOp(binOp, typeId, left, right), precision); return 0; } @@ -2437,12 +2843,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec break; } - if (firstClass) { - spv::Id id = builder.createBinOp(op, typeId, left, right); - builder.setPrecision(id, precision); - - return id; - } + if (firstClass) + return builder.setPrecision(builder.createBinOp(op, typeId, left, right), precision); // Handle component-wise +, -, *, and / for all combinations of type. // The result type of all of them is the same type as the (a) matrix operand. @@ -2482,9 +2884,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec } // put the pieces together - spv::Id id = builder.createCompositeConstruct(typeId, results); - builder.setPrecision(id, precision); - return id; + return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); } default: assert(0); @@ -2501,9 +2901,11 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: switch (op) { case glslang::EOpNegative: - if (isFloat) + if (isFloat) { unaryOp = spv::OpFNegate; - else + if (builder.isMatrixType(typeId)) + return createUnaryMatrixOperation(unaryOp, precision, typeId, operand, typeProxy); + } else unaryOp = spv::OpSNegate; break; @@ -2675,24 +3077,31 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: unaryOp = spv::OpFwidth; break; case glslang::EOpDPdxFine: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdxFine; break; case glslang::EOpDPdyFine: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdyFine; break; case glslang::EOpFwidthFine: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpFwidthFine; break; case glslang::EOpDPdxCoarse: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdxCoarse; break; case glslang::EOpDPdyCoarse: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdyCoarse; break; case glslang::EOpFwidthCoarse: + builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpFwidthCoarse; break; case glslang::EOpInterpolateAtCentroid: + builder.addCapability(spv::CapabilityInterpolationFunction); libCall = spv::GLSLstd450InterpolateAtCentroid; break; case glslang::EOpAny: @@ -2725,10 +3134,6 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: return createAtomicOperation(op, precision, typeId, operands, typeProxy); } - case glslang::EOpImageLoad: - unaryOp = spv::OpImageRead; - break; - case glslang::EOpBitFieldReverse: unaryOp = spv::OpBitReverse; break; @@ -2753,13 +3158,41 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: if (libCall >= 0) { std::vector args; args.push_back(operand); - id = builder.createBuiltinCall(precision, typeId, stdBuiltins, libCall, args); + id = builder.createBuiltinCall(typeId, stdBuiltins, libCall, args); } else id = builder.createUnaryOp(unaryOp, typeId, operand); - builder.setPrecision(id, precision); + return builder.setPrecision(id, precision); +} - return id; +// Create a unary operation on a matrix +spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Id typeId, spv::Id operand, glslang::TBasicType /* typeProxy */) +{ + // Handle unary operations vector by vector. + // The result type is the same type as the original type. + // The algorithm is to: + // - break the matrix into vectors + // - apply the operation to each vector + // - make a matrix out the vector results + + // get the types sorted out + int numCols = builder.getNumColumns(operand); + int numRows = builder.getNumRows(operand); + spv::Id scalarType = builder.getScalarTypeId(typeId); + spv::Id vecType = builder.makeVectorType(scalarType, numRows); + std::vector results; + + // do each vector op + for (int c = 0; c < numCols; ++c) { + std::vector indexes; + indexes.push_back(c); + spv::Id vec = builder.createCompositeExtract(operand, vecType, indexes); + results.push_back(builder.createUnaryOp(op, vecType, vec)); + builder.setPrecision(results.back(), precision); + } + + // put the pieces together + return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); } spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destType, spv::Id operand) @@ -2852,9 +3285,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec } else result = builder.createUnaryOp(convOp, destType, operand); - builder.setPrecision(result, precision); - - return result; + return builder.setPrecision(result, precision); } spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vectorSize) @@ -2870,7 +3301,7 @@ spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vector } // For glslang ops that map to SPV atomic opCodes -spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { spv::Op opCode = spv::OpNop; @@ -2954,7 +3385,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: spv::Op opCode = spv::OpNop; int libCall = -1; - int consumedOperands = operands.size(); + size_t consumedOperands = operands.size(); spv::Id typeId0 = 0; if (consumedOperands > 0) typeId0 = builder.getTypeId(operands[0]); @@ -3005,8 +3436,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpMix: if (isFloat) libCall = spv::GLSLstd450FMix; - else - libCall = spv::GLSLstd450IMix; + else { + opCode = spv::OpSelect; + spv::MissingFunctionality("translating integer mix to OpSelect"); + } builder.promoteScalar(precision, operands.front(), operands.back()); break; case glslang::EOpStep: @@ -3035,9 +3468,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450Refract; break; case glslang::EOpInterpolateAtSample: + builder.addCapability(spv::CapabilityInterpolationFunction); libCall = spv::GLSLstd450InterpolateAtSample; break; case glslang::EOpInterpolateAtOffset: + builder.addCapability(spv::CapabilityInterpolationFunction); libCall = spv::GLSLstd450InterpolateAtOffset; break; case glslang::EOpAddCarry: @@ -3096,7 +3531,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: // Construct the call arguments, without modifying the original operands vector. // We might need the remaining arguments, e.g. in the EOpFrexp case. std::vector callArguments(operands.begin(), operands.begin() + consumedOperands); - id = builder.createBuiltinCall(precision, typeId, stdBuiltins, libCall, callArguments); + id = builder.createBuiltinCall(typeId, stdBuiltins, libCall, callArguments); } else { switch (consumedOperands) { case 0: @@ -3139,9 +3574,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: break; } - builder.setPrecision(id, precision); - - return id; + return builder.setPrecision(id, precision); } // Intrinsics with no arguments, no return value, and no precision. @@ -3200,6 +3633,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (! symbol->getType().isStruct()) { addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + if (symbol->getType().getQualifier().hasSpecConstantId()) + addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); if (symbol->getQualifier().hasLocation()) builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); if (symbol->getQualifier().hasIndex()) @@ -3207,6 +3642,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (symbol->getQualifier().hasComponent()) builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::CapabilityTransformFeedback); if (symbol->getQualifier().hasXfbStride()) builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); if (symbol->getQualifier().hasXfbBuffer()) @@ -3217,23 +3653,39 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); - if (symbol->getQualifier().hasStream()) + if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { + builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(id, spv::DecorationStream, symbol->getQualifier().layoutStream); + } if (symbol->getQualifier().hasSet()) builder.addDecoration(id, spv::DecorationDescriptorSet, symbol->getQualifier().layoutSet); + else if (IsDescriptorResource(symbol->getType())) { + // default to 0 + builder.addDecoration(id, spv::DecorationDescriptorSet, 0); + } if (symbol->getQualifier().hasBinding()) builder.addDecoration(id, spv::DecorationBinding, symbol->getQualifier().layoutBinding); + if (symbol->getQualifier().hasAttachment()) + builder.addDecoration(id, spv::DecorationInputAttachmentIndex, symbol->getQualifier().layoutAttachment); if (glslangIntermediate->getXfbMode()) { + builder.addCapability(spv::CapabilityTransformFeedback); if (symbol->getQualifier().hasXfbStride()) builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); if (symbol->getQualifier().hasXfbBuffer()) builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); } + if (symbol->getType().isImage()) { + std::vector memory; + TranslateMemoryDecoration(symbol->getType().getQualifier(), memory); + for (unsigned int i = 0; i < memory.size(); ++i) + addDecoration(id, memory[i]); + } + // built-in variable decorations spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn); if (builtIn != spv::BadValue) - builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); + addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); return id; } @@ -3259,8 +3711,15 @@ void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::De builder.addMemberDecoration(id, (unsigned)member, dec); } +// If 'dec' is valid, add a one-operand decoration to a struct member +void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value) +{ + if (dec != spv::BadValue) + builder.addMemberDecoration(id, (unsigned)member, dec, value); +} + // Make a full tree of instructions to build a SPIR-V specialization constant, -// or regularly constant if possible. +// or regular constant if possible. // // TBD: this is not yet done, nor verified to be the best design, it does do the leaf symbols though // @@ -3273,10 +3732,38 @@ spv::Id TGlslangToSpvTraverser::createSpvSpecConstant(const glslang::TIntermType { 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); + if (! node.getQualifier().specConstant) { + // 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); + } + + // We now know we have a specialization constant to build + + if (node.getAsSymbolNode() && node.getQualifier().hasSpecConstantId()) { + // this is a direct literal assigned to a layout(constant_id=) declaration + int nextConst = 0; + return createSpvConstant(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), + nextConst, true); + } else { + // gl_WorkgroupSize is a special case until the front-end handles hierarchical specialization constants, + // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ... + if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) + addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); + } + return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); + } else { + spv::MissingFunctionality("specialization-constant expression trees"); + return spv::NoResult; + } + } } // Use 'consts' as the flattened glslang source of scalar constants to recursively @@ -3452,7 +3939,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan // emit left operand builder.clearAccessChain(); left.traverse(this); - spv::Id leftId = builder.accessChainLoad(boolTypeId); + spv::Id leftId = accessChainLoad(left.getType()); // Operands to accumulate OpPhi operands std::vector phiOperands; @@ -3475,7 +3962,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan // emit right operand as the "then" part of the "if" builder.clearAccessChain(); right.traverse(this); - spv::Id rightId = builder.accessChainLoad(boolTypeId); + spv::Id rightId = accessChainLoad(right.getType()); // accumulate left operand's phi information phiOperands.push_back(rightId); diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp new file mode 100644 index 00000000..142d716b --- /dev/null +++ b/SPIRV/InReadableOrder.cpp @@ -0,0 +1,117 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. + +// +// Author: Dejan Mircevski, Google +// + +// The SPIR-V spec requires code blocks to appear in an order satisfying the +// dominator-tree direction (ie, dominator before the dominated). This is, +// actually, easy to achieve: any pre-order CFG traversal algorithm will do it. +// Because such algorithms visit a block only after traversing some path to it +// from the root, they necessarily visit the block's idom first. +// +// But not every graph-traversal algorithm outputs blocks in an order that +// appears logical to human readers. The problem is that unrelated branches may +// be interspersed with each other, and merge blocks may come before some of the +// branches being merged. +// +// A good, human-readable order of blocks may be achieved by performing +// depth-first search but delaying merge nodes until after all their branches +// have been visited. This is implemented below by the inReadableOrder() +// function. + +#include "spvIR.h" + +#include +#include + +using spv::Block; +using spv::Id; + +namespace { +// Traverses CFG in a readable order, invoking a pre-set callback on each block. +// Use by calling visit() on the root block. +class ReadableOrderTraverser { +public: + explicit ReadableOrderTraverser(std::function callback) : callback_(callback) {} + // Visits the block if it hasn't been visited already and isn't currently + // being delayed. Invokes callback(block), then descends into its + // successors. Delays merge-block and continue-block processing until all + // the branches have been completed. + void visit(Block* block) + { + assert(block); + if (visited_[block] || delayed_[block]) + return; + callback_(block); + visited_[block] = true; + Block* mergeBlock = nullptr; + Block* continueBlock = nullptr; + auto mergeInst = block->getMergeInstruction(); + if (mergeInst) { + Id mergeId = mergeInst->getIdOperand(0); + mergeBlock = block->getParent().getParent().getInstruction(mergeId)->getBlock(); + delayed_[mergeBlock] = true; + if (mergeInst->getOpCode() == spv::OpLoopMerge) { + Id continueId = mergeInst->getIdOperand(1); + continueBlock = + block->getParent().getParent().getInstruction(continueId)->getBlock(); + delayed_[continueBlock] = true; + } + } + const auto successors = block->getSuccessors(); + for (auto it = successors.cbegin(); it != successors.cend(); ++it) + visit(*it); + if (continueBlock) { + delayed_[continueBlock] = false; + visit(continueBlock); + } + if (mergeBlock) { + delayed_[mergeBlock] = false; + visit(mergeBlock); + } + } + +private: + std::function callback_; + // Whether a block has already been visited or is being delayed. + std::unordered_map visited_, delayed_; +}; +} + +void spv::inReadableOrder(Block* root, std::function callback) +{ + ReadableOrderTraverser(callback).visit(root); +} diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index 9beba211..965867ef 100755 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -140,20 +140,17 @@ namespace spv { } } - bool spirvbin_t::isFlowCtrlOpen(spv::Op opCode) const + bool spirvbin_t::isFlowCtrl(spv::Op opCode) const { switch (opCode) { case spv::OpBranchConditional: - case spv::OpSwitch: return true; - default: return false; - } - } - - bool spirvbin_t::isFlowCtrlClose(spv::Op opCode) const - { - switch (opCode) { + case spv::OpBranch: + case spv::OpSwitch: case spv::OpLoopMerge: - case spv::OpSelectionMerge: return true; + case spv::OpSelectionMerge: + case spv::OpLabel: + case spv::OpFunction: + case spv::OpFunctionEnd: return true; default: return false; } } @@ -440,7 +437,7 @@ namespace spv { } // Store IDs from instruction in our map - for (int op = 0; op < spv::InstructionDesc[opCode].operands.getNum(); ++op, --numOperands) { + for (int op = 0; numOperands > 0; ++op, --numOperands) { switch (spv::InstructionDesc[opCode].operands.getClass(op)) { case spv::OperandId: idFn(asId(word++)); @@ -468,19 +465,36 @@ namespace spv { } return nextInst; - case spv::OperandLiteralString: - // word += literalStringWords(literalString(word)); // for clarity + case spv::OperandLiteralString: { + const int stringWordCount = literalStringWords(literalString(word)); + word += stringWordCount; + numOperands -= (stringWordCount-1); // -1 because for() header post-decrements + break; + } + + // Execution mode might have extra literal operands. Skip them. + case spv::OperandExecutionMode: return nextInst; - // Single word operands we simply ignore, as they hold no IDs + // Single word operands we simply ignore, as they hold no IDs case spv::OperandLiteralNumber: case spv::OperandSource: case spv::OperandExecutionModel: case spv::OperandAddressing: case spv::OperandMemory: - case spv::OperandExecutionMode: case spv::OperandStorage: case spv::OperandDimensionality: + case spv::OperandSamplerAddressingMode: + case spv::OperandSamplerFilterMode: + case spv::OperandSamplerImageFormat: + case spv::OperandImageChannelOrder: + case spv::OperandImageChannelDataType: + case spv::OperandImageOperands: + case spv::OperandFPFastMath: + case spv::OperandFPRoundingMode: + case spv::OperandLinkageType: + case spv::OperandAccessQualifier: + case spv::OperandFuncParamAttr: case spv::OperandDecoration: case spv::OperandBuiltIn: case spv::OperandSelect: @@ -492,10 +506,12 @@ namespace spv { case spv::OperandGroupOperation: case spv::OperandKernelEnqueueFlags: case spv::OperandKernelProfilingInfo: + case spv::OperandCapability: ++word; break; default: + assert(0 && "Unhandled Operand Class"); break; } } @@ -558,7 +574,7 @@ namespace spv { // Window size for context-sensitive canonicalization values // Emperical best size from a single data set. TODO: Would be a good tunable. - // We essentially performa a little convolution around each instruction, + // We essentially perform a little convolution around each instruction, // to capture the flavor of nearby code, to hopefully match to similar // code in other modules. static const unsigned windowSize = 2; @@ -713,49 +729,71 @@ namespace spv { strip(); // strip out data we decided to eliminate } - // remove bodies of uncalled functions + // optimize loads and stores void spirvbin_t::optLoadStore() { - idset_t fnLocalVars; - // Map of load result IDs to what they load - idmap_t idMap; + idset_t fnLocalVars; // candidates for removal (only locals) + idmap_t idMap; // Map of load result IDs to what they load + blockmap_t blockMap; // Map of IDs to blocks they first appear in + int blockNum = 0; // block count, to avoid crossing flow control // Find all the function local pointers stored at most once, and not via access chains process( [&](spv::Op opCode, unsigned start) { const int wordCount = asWordCount(start); + // Count blocks, so we can avoid crossing flow control + if (isFlowCtrl(opCode)) + ++blockNum; + // Add local variables to the map - if ((opCode == spv::OpVariable && spv[start+3] == spv::StorageClassFunction && asWordCount(start) == 4)) + if ((opCode == spv::OpVariable && spv[start+3] == spv::StorageClassFunction && asWordCount(start) == 4)) { fnLocalVars.insert(asId(start+2)); + return true; + } // Ignore process vars referenced via access chain if ((opCode == spv::OpAccessChain || opCode == spv::OpInBoundsAccessChain) && fnLocalVars.count(asId(start+3)) > 0) { fnLocalVars.erase(asId(start+3)); idMap.erase(asId(start+3)); + return true; } if (opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { - // Avoid loads before stores (TODO: why? Crashes driver, but seems like it shouldn't). - if (idMap.find(asId(start+3)) == idMap.end()) { - fnLocalVars.erase(asId(start+3)); - idMap.erase(asId(start+3)); + const spv::Id varId = asId(start+3); + + // Avoid loads before stores + if (idMap.find(varId) == idMap.end()) { + fnLocalVars.erase(varId); + idMap.erase(varId); } // don't do for volatile references if (wordCount > 4 && (spv[start+4] & spv::MemoryAccessVolatileMask)) { - fnLocalVars.erase(asId(start+3)); - idMap.erase(asId(start+3)); + fnLocalVars.erase(varId); + idMap.erase(varId); } + + // Handle flow control + if (blockMap.find(varId) == blockMap.end()) { + blockMap[varId] = blockNum; // track block we found it in. + } else if (blockMap[varId] != blockNum) { + fnLocalVars.erase(varId); // Ignore if crosses flow control + idMap.erase(varId); + } + + return true; } if (opCode == spv::OpStore && fnLocalVars.count(asId(start+1)) > 0) { - if (idMap.find(asId(start+1)) == idMap.end()) { - idMap[asId(start+1)] = asId(start+2); + const spv::Id varId = asId(start+1); + + if (idMap.find(varId) == idMap.end()) { + idMap[varId] = asId(start+2); } else { // Remove if it has more than one store to the same pointer - fnLocalVars.erase(asId(start+1)); - idMap.erase(asId(start+1)); + fnLocalVars.erase(varId); + idMap.erase(varId); } // don't do for volatile references @@ -763,11 +801,29 @@ namespace spv { fnLocalVars.erase(asId(start+3)); idMap.erase(asId(start+3)); } + + // Handle flow control + if (blockMap.find(varId) == blockMap.end()) { + blockMap[varId] = blockNum; // track block we found it in. + } else if (blockMap[varId] != blockNum) { + fnLocalVars.erase(varId); // Ignore if crosses flow control + idMap.erase(varId); + } + + return true; } - return true; + return false; }, - op_fn_nop); + + // If local var id used anywhere else, don't eliminate + [&](spv::Id& id) { + if (fnLocalVars.count(id) > 0) { + fnLocalVars.erase(id); + idMap.erase(id); + } + } + ); process( [&](spv::Op opCode, unsigned start) { @@ -777,12 +833,27 @@ namespace spv { }, op_fn_nop); + // Chase replacements to their origins, in case there is a chain such as: + // 2 = store 1 + // 3 = load 2 + // 4 = store 3 + // 5 = load 4 + // We want to replace uses of 5 with 1. + for (const auto& idPair : idMap) { + spv::Id id = idPair.first; + while (idMap.find(id) != idMap.end()) // Chase to end of chain + id = idMap[id]; + + idMap[idPair.first] = id; // replace with final result + } + // Remove the load/store/variables for the ones we've discovered process( [&](spv::Op opCode, unsigned start) { if ((opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) || (opCode == spv::OpStore && fnLocalVars.count(asId(start+1)) > 0) || (opCode == spv::OpVariable && fnLocalVars.count(asId(start+2)) > 0)) { + stripInst(start); return true; } @@ -790,7 +861,9 @@ namespace spv { return false; }, - [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } + [&](spv::Id& id) { + if (idMap.find(id) != idMap.end()) id = idMap[id]; + } ); strip(); // strip out data we decided to eliminate diff --git a/SPIRV/SPVRemapper.h b/SPIRV/SPVRemapper.h index 37f995b6..e5e8e1bd 100755 --- a/SPIRV/SPVRemapper.h +++ b/SPIRV/SPVRemapper.h @@ -131,6 +131,7 @@ private: // Local to global, or global to local ID map typedef std::unordered_map idmap_t; typedef std::unordered_set idset_t; + typedef std::unordered_map blockmap_t; void remap(std::uint32_t opts = DO_EVERYTHING); @@ -164,8 +165,7 @@ private: bool isConstOp(spv::Op opCode) const; bool isTypeOp(spv::Op opCode) const; bool isStripOp(spv::Op opCode) const; - bool isFlowCtrlOpen(spv::Op opCode) const; - bool isFlowCtrlClose(spv::Op opCode) const; + bool isFlowCtrl(spv::Op opCode) const; range_t literalRange(spv::Op opCode) const; range_t typeRange(spv::Op opCode) const; range_t constRange(spv::Op opCode) const; diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp old mode 100755 new mode 100644 index dc02f0e8..658b525a --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1,5 +1,6 @@ // -//Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -74,7 +75,7 @@ Id Builder::import(const char* name) Instruction* import = new Instruction(getUniqueId(), NoType, OpExtInstImport); import->addStringOperand(name); - imports.push_back(import); + imports.push_back(std::unique_ptr(import)); return import->getResultId(); } @@ -85,7 +86,7 @@ Id Builder::makeVoidType() if (groupedTypes[OpTypeVoid].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeVoid); groupedTypes[OpTypeVoid].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeVoid].back(); @@ -99,7 +100,7 @@ Id Builder::makeBoolType() if (groupedTypes[OpTypeBool].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeBool); groupedTypes[OpTypeBool].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeBool].back(); @@ -113,7 +114,7 @@ Id Builder::makeSamplerType() if (groupedTypes[OpTypeSampler].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeSampler); groupedTypes[OpTypeSampler].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeSampler].back(); @@ -137,7 +138,7 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee) type->addImmediateOperand(storageClass); type->addIdOperand(pointee); groupedTypes[OpTypePointer].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -159,9 +160,21 @@ Id Builder::makeIntegerType(int width, bool hasSign) type->addImmediateOperand(width); type->addImmediateOperand(hasSign ? 1 : 0); groupedTypes[OpTypeInt].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // deal with capabilities + switch (width) { + case 16: + addCapability(CapabilityInt16); + break; + case 64: + addCapability(CapabilityInt64); + break; + default: + break; + } + return type->getResultId(); } @@ -179,9 +192,21 @@ Id Builder::makeFloatType(int width) type = new Instruction(getUniqueId(), NoType, OpTypeFloat); type->addImmediateOperand(width); groupedTypes[OpTypeFloat].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // deal with capabilities + switch (width) { + case 16: + addCapability(CapabilityFloat16); + break; + case 64: + addCapability(CapabilityFloat64); + break; + default: + break; + } + return type->getResultId(); } @@ -189,7 +214,7 @@ Id Builder::makeFloatType(int width) // 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) +Id Builder::makeStructType(const std::vector& members, const char* name) { // Don't look for previous one, because in the general case, // structs can be duplicated except for decorations. @@ -199,7 +224,7 @@ Id Builder::makeStructType(std::vector& members, const char* name) for (int op = 0; op < (int)members.size(); ++op) type->addIdOperand(members[op]); groupedTypes[OpTypeStruct].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); addName(type->getResultId(), name); @@ -244,7 +269,7 @@ Id Builder::makeVectorType(Id component, int size) type->addIdOperand(component); type->addImmediateOperand(size); groupedTypes[OpTypeVector].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -269,7 +294,7 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) type->addIdOperand(column); type->addImmediateOperand(cols); groupedTypes[OpTypeMatrix].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -278,11 +303,9 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) // TODO: performance: track arrays per stride // If a stride is supplied (non-zero) make an array. // If no stride (0), reuse previous array types. -Id Builder::makeArrayType(Id element, unsigned size, int stride) +// 'size' is an Id of a constant or specialization constant of the array size +Id Builder::makeArrayType(Id element, Id sizeId, int stride) { - // First, we need a constant instruction for the size - Id sizeId = makeUintConstant(size); - Instruction* type; if (stride == 0) { // try to find existing type @@ -298,7 +321,7 @@ Id Builder::makeArrayType(Id element, unsigned size, int stride) type->addIdOperand(element); type->addIdOperand(sizeId); groupedTypes[OpTypeArray].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -308,13 +331,13 @@ Id Builder::makeRuntimeArray(Id element) { Instruction* type = new Instruction(getUniqueId(), NoType, OpTypeRuntimeArray); type->addIdOperand(element); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); } -Id Builder::makeFunctionType(Id returnType, std::vector& paramTypes) +Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) { // try to find it Instruction* type; @@ -340,7 +363,7 @@ Id Builder::makeFunctionType(Id returnType, std::vector& paramTypes) for (int p = 0; p < (int)paramTypes.size(); ++p) type->addIdOperand(paramTypes[p]); groupedTypes[OpTypeFunction].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -374,9 +397,51 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo type->addImmediateOperand((unsigned int)format); groupedTypes[OpTypeImage].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // deal with capabilities + switch (dim) { + case DimBuffer: + if (sampled) + addCapability(CapabilitySampledBuffer); + else + addCapability(CapabilityImageBuffer); + break; + case Dim1D: + if (sampled) + addCapability(CapabilitySampled1D); + else + addCapability(CapabilityImage1D); + break; + case DimCube: + if (arrayed) { + if (sampled) + addCapability(CapabilitySampledCubeArray); + else + addCapability(CapabilityImageCubeArray); + } + break; + case DimRect: + if (sampled) + addCapability(CapabilitySampledRect); + else + addCapability(CapabilityImageRect); + break; + case DimSubpassData: + addCapability(CapabilityInputAttachment); + break; + default: + break; + } + + if (ms) { + if (arrayed) + addCapability(CapabilityImageMSArray); + if (!sampled) + addCapability(CapabilityStorageImageMultisample); + } + return type->getResultId(); } @@ -395,7 +460,7 @@ Id Builder::makeSampledImageType(Id imageType) type->addIdOperand(imageType); groupedTypes[OpTypeSampledImage].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -445,8 +510,11 @@ int Builder::getNumTypeConstituents(Id typeId) const return 1; case OpTypeVector: case OpTypeMatrix: - case OpTypeArray: return instr->getImmediateOperand(1); + case OpTypeArray: { + Id lengthId = instr->getImmediateOperand(1); + return module.getInstruction(lengthId)->getImmediateOperand(0); + } case OpTypeStruct: return instr->getNumOperands(); default: @@ -566,20 +634,23 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) 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 && constant->getOpCode() == opcode) - existing = constant->getResultId(); - } + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = 0; + for (int i = 0; i < (int)groupedConstants[OpTypeBool].size(); ++i) { + constant = groupedConstants[OpTypeBool][i]; + if (constant->getTypeId() == typeId && constant->getOpCode() == opcode) + existing = constant->getResultId(); + } - if (existing) - return existing; + if (existing) + return existing; + } // Make it Instruction* c = new Instruction(getUniqueId(), typeId, opcode); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeBool].push_back(c); module.mapInstruction(c); @@ -589,13 +660,18 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; - Id existing = findScalarConstant(OpTypeInt, opcode, typeId, value); - if (existing) - return existing; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(OpTypeInt, opcode, typeId, value); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeInt].push_back(c); module.mapInstruction(c); @@ -606,14 +682,24 @@ 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, opcode, typeId, value); - if (existing) - return existing; + union { + float fl; + unsigned int ui; + } u; + u.fl = f; + unsigned value = u.ui; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeFloat].push_back(c); module.mapInstruction(c); @@ -624,17 +710,27 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; Id typeId = makeFloatType(64); - unsigned long long value = *(unsigned long long*)&d; + union { + double db; + unsigned long long ull; + } u; + u.db = d; + unsigned long long value = u.ull; unsigned op1 = value & 0xFFFFFFFF; unsigned op2 = value >> 32; - Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, op1, op2); - if (existing) - return existing; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (!specConstant) { + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, op1, op2); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(op1); c->addImmediateOperand(op2); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeFloat].push_back(c); module.mapInstruction(c); @@ -670,8 +766,9 @@ Id Builder::findCompositeConstant(Op typeClass, std::vector& comps) const } // Comments in header -Id Builder::makeCompositeConstant(Id typeId, std::vector& members) +Id Builder::makeCompositeConstant(Id typeId, std::vector& members, bool specConstant) { + Op opcode = specConstant ? OpSpecConstantComposite : OpConstantComposite; assert(typeId); Op typeClass = getTypeClass(typeId); @@ -686,14 +783,16 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector& members) return makeFloatConstant(0.0); } - Id existing = findCompositeConstant(typeClass, members); - if (existing) - return existing; + if (!specConstant) { + Id existing = findCompositeConstant(typeClass, members); + if (existing) + return existing; + } - Instruction* c = new Instruction(getUniqueId(), typeId, OpConstantComposite); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); for (int op = 0; op < (int)members.size(); ++op) c->addIdOperand(members[op]); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[typeClass].push_back(c); module.mapInstruction(c); @@ -707,7 +806,7 @@ Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, co entryPoint->addIdOperand(function->getId()); entryPoint->addStringOperand(name); - entryPoints.push_back(entryPoint); + entryPoints.push_back(std::unique_ptr(entryPoint)); return entryPoint; } @@ -726,7 +825,7 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int val if (value3 >= 0) instr->addImmediateOperand(value3); - executionModes.push_back(instr); + executionModes.push_back(std::unique_ptr(instr)); } void Builder::addName(Id id, const char* string) @@ -735,7 +834,7 @@ void Builder::addName(Id id, const char* string) name->addIdOperand(id); name->addStringOperand(string); - names.push_back(name); + names.push_back(std::unique_ptr(name)); } void Builder::addMemberName(Id id, int memberNumber, const char* string) @@ -745,7 +844,7 @@ void Builder::addMemberName(Id id, int memberNumber, const char* string) name->addImmediateOperand(memberNumber); name->addStringOperand(string); - names.push_back(name); + names.push_back(std::unique_ptr(name)); } void Builder::addLine(Id target, Id fileName, int lineNum, int column) @@ -756,7 +855,7 @@ void Builder::addLine(Id target, Id fileName, int lineNum, int column) line->addImmediateOperand(lineNum); line->addImmediateOperand(column); - lines.push_back(line); + lines.push_back(std::unique_ptr(line)); } void Builder::addDecoration(Id id, Decoration decoration, int num) @@ -769,7 +868,7 @@ void Builder::addDecoration(Id id, Decoration decoration, int num) if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(dec); + decorations.push_back(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) @@ -781,7 +880,7 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(dec); + decorations.push_back(std::unique_ptr(dec)); } // Comments in header @@ -791,20 +890,30 @@ Function* Builder::makeMain() Block* entry; std::vector params; + std::vector precisions; - mainFunction = makeFunctionEntry(makeVoidType(), "main", params, &entry); + mainFunction = + makeFunctionEntry(NoPrecision, makeVoidType(), "main", params, precisions, &entry); return mainFunction; } // Comments in header -Function* Builder::makeFunctionEntry(Id returnType, const char* name, std::vector& paramTypes, - Block** entry) +Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, + const std::vector& paramTypes, + const std::vector& precisions, Block** entry) { + // Make the function and initial instructions in it Id typeId = makeFunctionType(returnType, paramTypes); Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); Function* function = new Function(getUniqueId(), returnType, typeId, firstParamId, module); + // Set up the precisions + setPrecision(function->getId(), precision); + for (unsigned p = 0; p < (unsigned)precisions.size(); ++p) + setPrecision(firstParamId + p, precisions[p]); + + // CFG if (entry) { *entry = new Block(getUniqueId(), *function); function->addBlock(*entry); @@ -814,6 +923,8 @@ Function* Builder::makeFunctionEntry(Id returnType, const char* name, std::vecto if (name) addName(function->getId(), name); + functions.push_back(std::unique_ptr(function)); + return function; } @@ -823,9 +934,10 @@ void Builder::makeReturn(bool implicit, Id retVal) if (retVal) { Instruction* inst = new Instruction(NoResult, NoType, OpReturnValue); inst->addIdOperand(retVal); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); } else - buildPoint->addInstruction(new Instruction(NoResult, NoType, OpReturn)); + buildPoint->addInstruction( + std::unique_ptr(new Instruction(NoResult, NoType, OpReturn))); if (!implicit) createAndSetNoPredecessorBlock("post-return"); @@ -840,23 +952,10 @@ void Builder::leaveFunction() // If our function did not contain a return, add a return void now. if (!block->isTerminated()) { - // Whether we're in an unreachable (non-entry) block. - bool unreachable = function.getEntryBlock() != block && block->getNumPredecessors() == 0; - - if (unreachable) { - // Given that this block is at the end of a function, it must be right after an - // explicit return, just remove it. - function.popBlock(block); - } else { - // We'll add a return instruction at the end of the current block, - // which for a non-void function is really error recovery (?), as the source - // being translated should have had an explicit return, which would have been - // followed by an unreachable block, which was handled above. - if (function.getReturnType() == makeVoidType()) - makeReturn(true); - else { - makeReturn(true, createUndefined(function.getReturnType())); - } + if (function.getReturnType() == makeVoidType()) + makeReturn(true); + else { + makeReturn(true, createUndefined(function.getReturnType())); } } } @@ -864,7 +963,7 @@ void Builder::leaveFunction() // Comments in header void Builder::makeDiscard() { - buildPoint->addInstruction(new Instruction(OpKill)); + buildPoint->addInstruction(std::unique_ptr(new Instruction(OpKill))); createAndSetNoPredecessorBlock("post-discard"); } @@ -878,11 +977,11 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name) switch (storageClass) { case StorageClassFunction: // Validation rules require the declaration in the entry block - buildPoint->getParent().addLocalVariable(inst); + buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); break; default: - constantsTypesGlobals.push_back(inst); + constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); break; } @@ -897,7 +996,7 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name) Id Builder::createUndefined(Id type) { Instruction* inst = new Instruction(getUniqueId(), type, OpUndef); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -907,7 +1006,7 @@ void Builder::createStore(Id rValue, Id lValue) Instruction* store = new Instruction(OpStore); store->addIdOperand(lValue); store->addIdOperand(rValue); - buildPoint->addInstruction(store); + buildPoint->addInstruction(std::unique_ptr(store)); } // Comments in header @@ -915,7 +1014,7 @@ Id Builder::createLoad(Id lValue) { Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), OpLoad); load->addIdOperand(lValue); - buildPoint->addInstruction(load); + buildPoint->addInstruction(std::unique_ptr(load)); return load->getResultId(); } @@ -941,7 +1040,7 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, std::vectoraddIdOperand(base); for (int i = 0; i < (int)offsets.size(); ++i) chain->addIdOperand(offsets[i]); - buildPoint->addInstruction(chain); + buildPoint->addInstruction(std::unique_ptr(chain)); return chain->getResultId(); } @@ -951,7 +1050,7 @@ Id Builder::createArrayLength(Id base, unsigned int member) Instruction* length = new Instruction(getUniqueId(), makeIntType(32), OpArrayLength); length->addIdOperand(base); length->addImmediateOperand(member); - buildPoint->addInstruction(length); + buildPoint->addInstruction(std::unique_ptr(length)); return length->getResultId(); } @@ -961,7 +1060,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); extract->addImmediateOperand(index); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -972,7 +1071,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vectoraddIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) extract->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -983,7 +1082,7 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, unsigned i insert->addIdOperand(object); insert->addIdOperand(composite); insert->addImmediateOperand(index); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -996,7 +1095,7 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, insert->addIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) insert->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -1006,7 +1105,7 @@ Id Builder::createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex) Instruction* extract = new Instruction(getUniqueId(), typeId, OpVectorExtractDynamic); extract->addIdOperand(vector); extract->addIdOperand(componentIndex); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -1017,7 +1116,7 @@ Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id com insert->addIdOperand(vector); insert->addIdOperand(component); insert->addIdOperand(componentIndex); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -1026,7 +1125,7 @@ Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id com void Builder::createNoResultOp(Op opCode) { Instruction* op = new Instruction(opCode); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operand, no result id, and no type @@ -1034,16 +1133,16 @@ void Builder::createNoResultOp(Op opCode, Id operand) { Instruction* op = new Instruction(opCode); op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operand, no result id, and no type void Builder::createNoResultOp(Op opCode, const std::vector& operands) { Instruction* op = new Instruction(opCode); - for (auto operand : operands) - op->addIdOperand(operand); - buildPoint->addInstruction(op); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) + op->addIdOperand(*it); + buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics) @@ -1052,7 +1151,7 @@ void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemantic op->addImmediateOperand(makeUintConstant(execution)); op->addImmediateOperand(makeUintConstant(memory)); op->addImmediateOperand(makeUintConstant(semantics)); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics) @@ -1060,7 +1159,7 @@ void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemant Instruction* op = new Instruction(OpMemoryBarrier); op->addImmediateOperand(makeUintConstant(executionScope)); op->addImmediateOperand(makeUintConstant(memorySemantics)); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operands, a result id, and a type @@ -1068,7 +1167,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1078,7 +1177,7 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(left); op->addIdOperand(right); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1089,7 +1188,7 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) op->addIdOperand(op1); op->addIdOperand(op2); op->addIdOperand(op3); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1097,9 +1196,9 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); - for (auto operand : operands) - op->addIdOperand(operand); - buildPoint->addInstruction(op); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) + op->addIdOperand(*it); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1110,16 +1209,17 @@ Id Builder::createFunctionCall(spv::Function* function, std::vector& ar op->addIdOperand(function->getId()); for (int a = 0; a < (int)args.size(); ++a) op->addIdOperand(args[a]); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } // Comments in header -Id Builder::createRvalueSwizzle(Id typeId, Id source, std::vector& channels) +Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, + std::vector& channels) { if (channels.size() == 1) - return createCompositeExtract(source, typeId, channels.front()); + return setPrecision(createCompositeExtract(source, typeId, channels.front()), precision); Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); assert(isVector(source)); @@ -1127,9 +1227,9 @@ Id Builder::createRvalueSwizzle(Id typeId, Id source, std::vector& cha swizzle->addIdOperand(source); for (int i = 0; i < (int)channels.size(); ++i) swizzle->addImmediateOperand(channels[i]); - buildPoint->addInstruction(swizzle); + buildPoint->addInstruction(std::unique_ptr(swizzle)); - return swizzle->getResultId(); + return setPrecision(swizzle->getResultId(), precision); } // Comments in header @@ -1158,7 +1258,7 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, std::vectoraddImmediateOperand(components[i]); - buildPoint->addInstruction(swizzle); + buildPoint->addInstruction(std::unique_ptr(swizzle)); return swizzle->getResultId(); } @@ -1179,7 +1279,7 @@ void Builder::promoteScalar(Decoration precision, Id& left, Id& right) } // Comments in header -Id Builder::smearScalar(Decoration /*precision*/, Id scalar, Id vectorType) +Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) { assert(getNumComponents(scalar) == 1); assert(getTypeId(scalar) == getScalarTypeId(vectorType)); @@ -1191,14 +1291,13 @@ Id Builder::smearScalar(Decoration /*precision*/, Id scalar, Id vectorType) Instruction* smear = new Instruction(getUniqueId(), vectorType, OpCompositeConstruct); for (int c = 0; c < numComponents; ++c) smear->addIdOperand(scalar); - buildPoint->addInstruction(smear); + buildPoint->addInstruction(std::unique_ptr(smear)); - return smear->getResultId(); + return setPrecision(smear->getResultId(), precision); } // Comments in header -Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builtins, int entryPoint, - std::vector& args) +Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, std::vector& args) { Instruction* inst = new Instruction(getUniqueId(), resultType, OpExtInst); inst->addIdOperand(builtins); @@ -1206,14 +1305,16 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti for (int arg = 0; arg < (int)args.size(); ++arg) inst->addIdOperand(args[arg]); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); + return inst->getResultId(); } // 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, - bool gather, const TextureParameters& parameters) +Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, + bool proj, bool gather, bool noImplicitLod, + const TextureParameters& parameters) { static const int maxTextureArgs = 10; Id texArgs[maxTextureArgs] = {}; @@ -1222,7 +1323,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b // Set up the fixed arguments // int numArgs = 0; - bool xplicit = false; + bool explicitLod = false; texArgs[numArgs++] = parameters.sampler; texArgs[numArgs++] = parameters.coords; if (parameters.Dref) @@ -1244,13 +1345,18 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b if (parameters.lod) { mask = (ImageOperandsMask)(mask | ImageOperandsLodMask); texArgs[numArgs++] = parameters.lod; - xplicit = true; - } - if (parameters.gradX) { + explicitLod = true; + } else if (parameters.gradX) { mask = (ImageOperandsMask)(mask | ImageOperandsGradMask); texArgs[numArgs++] = parameters.gradX; texArgs[numArgs++] = parameters.gradY; - xplicit = true; + explicitLod = true; + } else if (noImplicitLod && !fetch && !gather) { + // have to explicitly use lod of 0 if not allowed to have them be implicit, and + // we would otherwise be about to issue an implicit instruction + mask = (ImageOperandsMask)(mask | ImageOperandsLodMask); + texArgs[numArgs++] = makeFloatConstant(0.0); + explicitLod = true; } if (parameters.offset) { if (isConstant(parameters.offset)) @@ -1267,6 +1373,13 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask); texArgs[numArgs++] = parameters.sample; } + if (parameters.lodClamp) { + // capability if this bit is used + addCapability(CapabilityMinLod); + + mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask); + texArgs[numArgs++] = parameters.lodClamp; + } if (mask == ImageOperandsMaskNone) --numArgs; // undo speculative reservation for the mask argument else @@ -1275,36 +1388,63 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b // // Set up the instruction // - Op opCode; - opCode = OpImageSampleImplicitLod; + Op opCode = OpNop; // All paths below need to set this if (fetch) { - opCode = OpImageFetch; + if (sparse) + opCode = OpImageSparseFetch; + else + opCode = OpImageFetch; } else if (gather) { if (parameters.Dref) - opCode = OpImageDrefGather; + if (sparse) + opCode = OpImageSparseDrefGather; + else + opCode = OpImageDrefGather; + else if (sparse) + opCode = OpImageSparseGather; else opCode = OpImageGather; - } else if (xplicit) { + } else if (explicitLod) { if (parameters.Dref) { if (proj) - opCode = OpImageSampleProjDrefExplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjDrefExplicitLod; + else + opCode = OpImageSampleProjDrefExplicitLod; + else if (sparse) + opCode = OpImageSparseSampleDrefExplicitLod; else opCode = OpImageSampleDrefExplicitLod; } else { if (proj) - opCode = OpImageSampleProjExplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjExplicitLod; + else + opCode = OpImageSampleProjExplicitLod; + else if (sparse) + opCode = OpImageSparseSampleExplicitLod; else opCode = OpImageSampleExplicitLod; } } else { if (parameters.Dref) { if (proj) - opCode = OpImageSampleProjDrefImplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjDrefImplicitLod; + else + opCode = OpImageSampleProjDrefImplicitLod; + else if (sparse) + opCode = OpImageSparseSampleDrefImplicitLod; else opCode = OpImageSampleDrefImplicitLod; } else { if (proj) - opCode = OpImageSampleProjImplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjImplicitLod; + else + opCode = OpImageSampleProjImplicitLod; + else if (sparse) + opCode = OpImageSparseSampleImplicitLod; else opCode = OpImageSampleImplicitLod; } @@ -1327,6 +1467,15 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b } } + Id typeId0 = 0; + Id typeId1 = 0; + + if (sparse) { + typeId0 = resultType; + typeId1 = getDerefTypeId(parameters.texelOut); + resultType = makeStructResultType(typeId0, typeId1); + } + // Build the SPIR-V instruction Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); for (int op = 0; op < optArgNum; ++op) @@ -1336,14 +1485,24 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b for (int op = optArgNum + 1; op < numArgs; ++op) textureInst->addIdOperand(texArgs[op]); setPrecision(textureInst->getResultId(), precision); - buildPoint->addInstruction(textureInst); + buildPoint->addInstruction(std::unique_ptr(textureInst)); Id resultId = textureInst->getResultId(); - // When a smear is needed, do it, as per what was computed - // above when resultType was changed to a scalar type. - if (resultType != smearedType) - resultId = smearScalar(precision, resultId, smearedType); + if (sparse) { + // set capability + addCapability(CapabilitySparseResidency); + + // Decode the return type that was a special structure + createStore(createCompositeExtract(resultId, typeId1, 1), parameters.texelOut); + resultId = createCompositeExtract(resultId, typeId0, 0); + setPrecision(resultId, precision); + } else { + // When a smear is needed, do it, as per what was computed + // above when resultType was changed to a scalar type. + if (resultType != smearedType) + resultId = smearScalar(precision, resultId, smearedType); + } return resultId; } @@ -1351,12 +1510,15 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b // Comments in header Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters) { + // All these need a capability + addCapability(CapabilityImageQuery); + // Figure out the result type Id resultType = 0; switch (opCode) { case OpImageQuerySize: case OpImageQuerySizeLod: { - int numComponents; + int numComponents = 0; switch (getTypeDimensionality(getImageType(parameters.sampler))) { case Dim1D: case DimBuffer: @@ -1403,7 +1565,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter query->addIdOperand(parameters.coords); if (parameters.lod) query->addIdOperand(parameters.lod); - buildPoint->addInstruction(query); + buildPoint->addInstruction(std::unique_ptr(query)); return query->getResultId(); } @@ -1415,7 +1577,7 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b Id boolType = makeBoolType(); Id valueType = getTypeId(value1); - Id resultId; + Id resultId = NoResult; int numConstituents = getNumTypeConstituents(valueType); @@ -1431,6 +1593,7 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b op = equal ? OpFOrdEqual : OpFOrdNotEqual; break; case OpTypeInt: + default: op = equal ? OpIEqual : OpINotEqual; break; case OpTypeBool: @@ -1442,7 +1605,6 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b if (isScalarType(valueType)) { // scalar resultId = createBinOp(op, boolType, value1, value2); - setPrecision(resultId, precision); } else { // vector resultId = createBinOp(op, makeVectorType(boolType, numConstituents), value1, value2); @@ -1451,7 +1613,7 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b resultId = createUnaryOp(equal ? OpAll : OpAny, boolType, resultId); } - return resultId; + return setPrecision(resultId, precision); } // Only structs, arrays, and matrices should be left. @@ -1471,8 +1633,9 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b if (constituent == 0) resultId = subResultId; else - resultId = - createBinOp(equal ? OpLogicalAnd : OpLogicalOr, boolType, resultId, subResultId); + resultId = setPrecision( + createBinOp(equal ? OpLogicalAnd : OpLogicalOr, boolType, resultId, subResultId), + precision); } return resultId; @@ -1487,7 +1650,7 @@ Id Builder::createCompositeConstruct(Id typeId, std::vector& constituents) Instruction* op = new Instruction(getUniqueId(), typeId, OpCompositeConstruct); for (int c = 0; c < (int)constituents.size(); ++c) op->addIdOperand(constituents[c]); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1495,7 +1658,7 @@ Id Builder::createCompositeConstruct(Id typeId, std::vector& constituents) // Vector or scalar constructor Id Builder::createConstructor(Decoration precision, const std::vector& sources, Id resultTypeId) { - Id result = 0; + Id result = NoResult; unsigned int numTargetComponents = getNumTypeComponents(resultTypeId); unsigned int targetComponent = 0; @@ -1518,7 +1681,7 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc if (sourceSize > 1) { std::vector swiz; swiz.push_back(s); - arg = createRvalueSwizzle(scalarTypeId, arg, swiz); + arg = createRvalueSwizzle(precision, scalarTypeId, arg, swiz); } if (numTargetComponents > 1) @@ -1535,9 +1698,7 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc if (constituents.size() > 0) result = createCompositeConstruct(resultTypeId, constituents); - setPrecision(result, precision); - - return result; + return setPrecision(result, precision); } // Comments in header @@ -1619,11 +1780,13 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& std::vector vectorComponents; for (int row = 0; row < numRows; ++row) vectorComponents.push_back(ids[col][row]); - matrixColumns.push_back(createCompositeConstruct(columnTypeId, vectorComponents)); + Id column = createCompositeConstruct(columnTypeId, vectorComponents); + setPrecision(column, precision); + matrixColumns.push_back(column); } // make the matrix - return createCompositeConstruct(resultTypeId, matrixColumns); + return setPrecision(createCompositeConstruct(resultTypeId, matrixColumns), precision); } // Comments in header @@ -1697,13 +1860,15 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector& caseVal // make the switch instruction Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch); switchInst->addIdOperand(selector); - switchInst->addIdOperand(defaultSegment >= 0 ? segmentBlocks[defaultSegment]->getId() - : mergeBlock->getId()); + auto defaultOrMerge = (defaultSegment >= 0) ? segmentBlocks[defaultSegment] : mergeBlock; + switchInst->addIdOperand(defaultOrMerge->getId()); + defaultOrMerge->addPredecessor(buildPoint); for (int i = 0; i < (int)caseValues.size(); ++i) { switchInst->addImmediateOperand(caseValues[i]); switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); + segmentBlocks[valueIndexToSegment[i]]->addPredecessor(buildPoint); } - buildPoint->addInstruction(switchInst); + buildPoint->addInstruction(std::unique_ptr(switchInst)); // push the merge block switchMerges.push(mergeBlock); @@ -1744,150 +1909,37 @@ void Builder::endSwitch(std::vector& /*segmentBlock*/) switchMerges.pop(); } -// Comments in header -void Builder::makeNewLoop(bool loopTestFirst) +Block& Builder::makeNewBlock() { - loops.push(Loop(*this, loopTestFirst)); - const Loop& loop = loops.top(); - - // The loop test is always emitted before the loop body. - // But if the loop test executes at the bottom of the loop, then - // execute the test only on the second and subsequent iterations. - - // Remember the block that branches to the loop header. This - // is required for the test-after-body case. - Block* preheader = getBuildPoint(); - - // Branch into the loop - createBranch(loop.header); - - // Set ourselves inside the loop - loop.function->addBlock(loop.header); - setBuildPoint(loop.header); - - if (!loopTestFirst) { - // Generate code to defer the loop test until the second and - // subsequent iterations. - - // It's always the first iteration when coming from the preheader. - // All other branches to this loop header will need to indicate "false", - // but we don't yet know where they will come from. - loop.isFirstIteration->addIdOperand(makeBoolConstant(true)); - loop.isFirstIteration->addIdOperand(preheader->getId()); - getBuildPoint()->addInstruction(loop.isFirstIteration); - - // Mark the end of the structured loop. This must exist in the loop header block. - 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 - // the selection merge instructions can't both be in the same - // (header) block. - Block* firstIterationCheck = new Block(getUniqueId(), *loop.function); - createBranch(firstIterationCheck); - loop.function->addBlock(firstIterationCheck); - setBuildPoint(firstIterationCheck); - - // 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. - createSelectionMerge(loop.body, SelectionControlMaskNone); - - Block* loopTest = new Block(getUniqueId(), *loop.function); - createConditionalBranch(loop.isFirstIteration->getResultId(), loop.body, loopTest); - - loop.function->addBlock(loopTest); - setBuildPoint(loopTest); - } + Function& function = buildPoint->getParent(); + auto block = new Block(getUniqueId(), function); + function.addBlock(block); + return *block; } -void Builder::createLoopTestBranch(Id condition) +Builder::LoopBlocks& Builder::makeNewLoop() { - const Loop& loop = loops.top(); - - // Generate the merge instruction. If the loop test executes before - // 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) { - createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); - // Branching to the "body" block will keep control inside - // the loop. - createConditionalBranch(condition, loop.body, loop.merge); - loop.function->addBlock(loop.body); - setBuildPoint(loop.body); - } else { - // The branch to the loop merge block is the allowed exception - // to the structured control flow. Otherwise, control flow will - // continue to loop.body block. Since that is already the target - // 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); - createSelectionMerge(stayInLoopBlock, SelectionControlMaskNone); - - // This is the loop test. - createConditionalBranch(condition, stayInLoopBlock, loop.merge); - - // The dummy block just branches to the real loop body. - loop.function->addBlock(stayInLoopBlock); - setBuildPoint(stayInLoopBlock); - createBranchToBody(); - } -} - -void Builder::createBranchToBody() -{ - const Loop& loop = loops.top(); - assert(loop.body); - - // This is a reconvergence of control flow, so no merge instruction - // is required. - createBranch(loop.body); - loop.function->addBlock(loop.body); - setBuildPoint(loop.body); + // Older MSVC versions don't allow inlining of blocks below. + LoopBlocks blocks = {makeNewBlock(), makeNewBlock(), makeNewBlock(), makeNewBlock()}; + loops.push(blocks); + return loops.top(); } void Builder::createLoopContinue() { - createBranchToLoopHeaderFromInside(loops.top()); + createBranch(&loops.top().continue_target); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-continue"); } -// Add an exit (e.g. "break") for the innermost loop that you're in void Builder::createLoopExit() { - createBranch(loops.top().merge); + createBranch(&loops.top().merge); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-break"); } -// Close the innermost loop -void Builder::closeLoop() -{ - const Loop& loop = loops.top(); - - // Branch back to the top - createBranchToLoopHeaderFromInside(loop); - - // Add the merge block and set the build point to it - loop.function->addBlock(loop.merge); - setBuildPoint(loop.merge); - - loops.pop(); -} - -// Create a branch to the header of the given loop, from inside -// the loop body. -// Adjusts the phi node for the first-iteration value if needeed. -void Builder::createBranchToLoopHeaderFromInside(const Loop& loop) -{ - createBranch(loop.header); - if (loop.isFirstIteration) { - loop.isFirstIteration->addIdOperand(makeBoolConstant(false)); - loop.isFirstIteration->addIdOperand(getBuildPoint()->getId()); - } -} - +void Builder::closeLoop() { loops.pop(); } void Builder::clearAccessChain() { accessChain.base = NoResult; @@ -1955,7 +2007,7 @@ void Builder::accessChainStore(Id rvalue) } // Comments in header -Id Builder::accessChainLoad(Id resultType) +Id Builder::accessChainLoad(Decoration precision, Id resultType) { Id id; @@ -1996,12 +2048,14 @@ Id Builder::accessChainLoad(Id resultType) // load through the access chain id = createLoad(collapseAccessChain()); } + setPrecision(id, precision); } else - id = accessChain.base; + id = accessChain.base; // no precision, it was set when this was defined } else { transferAccessChainSwizzle(true); // load through the access chain id = createLoad(collapseAccessChain()); + setPrecision(id, precision); } // Done, unless there are swizzles to do @@ -2015,12 +2069,13 @@ Id Builder::accessChainLoad(Id resultType) Id swizzledType = getScalarTypeId(getTypeId(id)); if (accessChain.swizzle.size() > 1) swizzledType = makeVectorType(swizzledType, (int)accessChain.swizzle.size()); - id = createRvalueSwizzle(swizzledType, id, accessChain.swizzle); + id = createRvalueSwizzle(precision, swizzledType, id, accessChain.swizzle); } // dynamic single-component selection if (accessChain.component != NoResult) - id = createVectorExtractDynamic(id, resultType, accessChain.component); + id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), + precision); return id; } @@ -2041,6 +2096,39 @@ Id Builder::accessChainGetLValue() return lvalue; } +// comment in header +Id Builder::accessChainGetInferredType() +{ + // anything to operate on? + if (accessChain.base == NoResult) + return NoType; + Id type = getTypeId(accessChain.base); + + // do initial dereference + if (!accessChain.isRValue) + type = getContainedTypeId(type); + + // dereference each index + for (auto it = accessChain.indexChain.cbegin(); it != accessChain.indexChain.cend(); ++it) { + if (isStructType(type)) + type = getContainedTypeId(type, getConstantScalar(*it)); + else + type = getContainedTypeId(type); + } + + // dereference swizzle + if (accessChain.swizzle.size() == 1) + type = getContainedTypeId(type); + else if (accessChain.swizzle.size() > 1) + type = makeVectorType(getContainedTypeId(type), (int)accessChain.swizzle.size()); + + // dereference component selection + if (accessChain.component) + type = getContainedTypeId(type); + + return type; +} + void Builder::dump(std::vector& out) const { // Header, before first instructions: @@ -2051,9 +2139,9 @@ void Builder::dump(std::vector& out) const out.push_back(0); // Capabilities - for (auto cap : capabilities) { + for (auto it = capabilities.cbegin(); it != capabilities.cend(); ++it) { Instruction capInst(0, 0, OpCapability); - capInst.addImmediateOperand(cap); + capInst.addImmediateOperand(*it); capInst.dump(out); } @@ -2203,7 +2291,7 @@ void Builder::createBranch(Block* block) { Instruction* branch = new Instruction(OpBranch); branch->addIdOperand(block->getId()); - buildPoint->addInstruction(branch); + buildPoint->addInstruction(std::unique_ptr(branch)); block->addPredecessor(buildPoint); } @@ -2212,7 +2300,7 @@ void Builder::createSelectionMerge(Block* mergeBlock, unsigned int control) Instruction* merge = new Instruction(OpSelectionMerge); merge->addIdOperand(mergeBlock->getId()); merge->addImmediateOperand(control); - buildPoint->addInstruction(merge); + buildPoint->addInstruction(std::unique_ptr(merge)); } void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control) @@ -2221,7 +2309,7 @@ void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned merge->addIdOperand(mergeBlock->getId()); merge->addIdOperand(continueBlock->getId()); merge->addImmediateOperand(control); - buildPoint->addInstruction(merge); + buildPoint->addInstruction(std::unique_ptr(merge)); } void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock) @@ -2230,13 +2318,13 @@ void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* els branch->addIdOperand(condition); branch->addIdOperand(thenBlock->getId()); branch->addIdOperand(elseBlock->getId()); - buildPoint->addInstruction(branch); + buildPoint->addInstruction(std::unique_ptr(branch)); thenBlock->addPredecessor(buildPoint); elseBlock->addPredecessor(buildPoint); } void Builder::dumpInstructions(std::vector& out, - const std::vector& instructions) const + const std::vector >& instructions) const { for (int i = 0; i < (int)instructions.size(); ++i) { instructions[i]->dump(out); @@ -2254,23 +2342,4 @@ void TbdFunctionality(const char* tbd) } void MissingFunctionality(const char* fun) { printf("Missing functionality: %s\n", fun); } -Builder::Loop::Loop(Builder& builder, bool testFirstArg) - : function(&builder.getBuildPoint()->getParent()), - header(new Block(builder.getUniqueId(), *function)), - merge(new Block(builder.getUniqueId(), *function)), - body(new Block(builder.getUniqueId(), *function)), - testFirst(testFirstArg), - isFirstIteration(nullptr) -{ - if (!testFirst) { - // You may be tempted to rewrite this as - // new Instruction(builder.getUniqueId(), builder.makeBoolType(), OpPhi); - // This will cause subtle test failures because builder.getUniqueId(), - // and builder.makeBoolType() can then get run in a compiler-specific - // order making tests fail for certain configurations. - Id instructionId = builder.getUniqueId(); - isFirstIteration = new Instruction(instructionId, builder.makeBoolType(), OpPhi); - } -} - }; // end spv namespace diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index bf2b2f27..918a480f 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -1,5 +1,6 @@ // -// Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // // All rights reserved. // @@ -53,6 +54,8 @@ #include #include +#include +#include #include namespace spv { @@ -77,7 +80,7 @@ public: memoryModel = mem; } - void addCapability(spv::Capability cap) { capabilities.push_back(cap); } + void addCapability(spv::Capability cap) { capabilities.insert(cap); } // To get a new for anything needing a new one. Id getUniqueId() { return ++uniqueId; } // To get a set of new s, e.g., for a set of function parameters @@ -96,13 +99,13 @@ public: Id makeIntType(int width) { return makeIntegerType(width, true); } Id makeUintType(int width) { return makeIntegerType(width, false); } Id makeFloatType(int width); - Id makeStructType(std::vector& members, const char*); + Id makeStructType(const 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, int stride); // 0 means no stride decoration + Id makeArrayType(Id element, Id sizeId, int stride); // 0 stride means no stride decoration Id makeRuntimeArray(Id element); - Id makeFunctionType(Id returnType, std::vector& paramTypes); + Id makeFunctionType(Id returnType, const std::vector& paramTypes); Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format); Id makeSamplerType(); @@ -121,6 +124,11 @@ public: Id getContainedTypeId(Id typeId) const; Id getContainedTypeId(Id typeId, int) const; StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); } + ImageFormat getImageTypeFormat(Id typeId) const + { + return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); + } + 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)); } @@ -201,7 +209,7 @@ public: 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); + Id makeCompositeConstant(Id type, std::vector& comps, bool specConst = false); // Methods for adding information outside the CFG. Instruction* addEntryPoint(ExecutionModel, Function*, const char* name); @@ -216,13 +224,16 @@ public: // At the end of what block do the next create*() instructions go? void setBuildPoint(Block* bp) { buildPoint = bp; } Block* getBuildPoint() const { return buildPoint; } - // Make the main function. + // Make the main function. The returned pointer is only valid + // for the lifetime of this builder. Function* makeMain(); // Make a shader-style function, and create its entry block if entry is non-zero. // Return the function, pass back the entry. - Function* makeFunctionEntry(Id returnType, const char* name, std::vector& paramTypes, - Block** entry = 0); + // The returned pointer is only valid for the lifetime of this builder. + Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, + const std::vector& paramTypes, + const std::vector& precisions, Block** entry = 0); // Create a return. An 'implicit' return is one not appearing in the source // code. In the case of an implicit return, no post-return block is inserted. @@ -237,7 +248,7 @@ public: // Create a global or function local or IO variable. Id createVariable(StorageClass, Id type, const char* name = 0); - // Create an imtermediate with an undefined value. + // Create an intermediate with an undefined value. Id createUndefined(Id type); // Store into an Id and return the l-value @@ -274,7 +285,8 @@ public: // Take an rvalue (source) and a set of channels to extract from it to // make a new rvalue, which is returned. - Id createRvalueSwizzle(Id typeId, Id source, std::vector& channels); + Id createRvalueSwizzle(Decoration precision, Id typeId, Id source, + std::vector& channels); // Take a copy of an lvalue (target) and a source of components, and set the // source components into the lvalue where the 'channels' say to put them. @@ -282,13 +294,15 @@ public: // (No true lvalue or stores are used.) Id createLvalueSwizzle(Id typeId, Id target, Id source, std::vector& channels); - // If the value passed in is an instruction and the precision is not NoPrecision, - // it gets tagged with the requested precision. - void setPrecision(Id /* value */, Decoration precision) + // If both the id and precision are valid, the id + // gets tagged with the requested precision. + // The passed in id is always the returned id, to simplify use patterns. + Id setPrecision(Id id, Decoration precision) { - if (precision != NoPrecision) { - ; // TODO - } + if (precision != NoPrecision && id != NoResult) + addDecoration(id, precision); + + return id; } // Can smear a scalar to a vector for the following forms: @@ -312,8 +326,7 @@ public: Id smearScalar(Decoration precision, Id scalarVal, Id vectorType); // Create a call to a built-in function. - Id createBuiltinCall(Decoration precision, Id resultType, Id builtins, int entryPoint, - std::vector& args); + Id createBuiltinCall(Id resultType, Id builtins, int entryPoint, std::vector& args); // List of parameters used to create a texture operation struct TextureParameters { @@ -328,11 +341,13 @@ public: Id gradY; Id sample; Id comp; + Id texelOut; + Id lodClamp; }; // Select the correct texture operation based on all inputs, and emit the correct instruction - Id createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, bool gather, - const TextureParameters&); + Id createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, + bool gather, bool noImplicit, const TextureParameters&); // Emit the OpTextureQuery* instruction that was passed in. // Figure out the right return value and type, and return it. @@ -343,7 +358,7 @@ public: Id createBitFieldExtractCall(Decoration precision, Id, Id, Id, bool isSigned); Id createBitFieldInsertCall(Decoration precision, Id, Id, Id, Id); - // Reduction comparision for composites: For equal and not-equal resulting in a scalar. + // Reduction comparison for composites: For equal and not-equal resulting in a scalar. Id createCompositeCompare(Decoration precision, Id, Id, bool /* true if for equal, false if for not-equal */); @@ -403,28 +418,24 @@ public: // Finish off the innermost switch. void endSwitch(std::vector& segmentBB); - // Start the beginning of a new loop, and prepare the builder to - // generate code for the loop test. - // The loopTestFirst parameter is true when the loop test executes before - // the body. (It is false for do-while loops.) - void makeNewLoop(bool loopTestFirst); + struct LoopBlocks { + Block &head, &body, &merge, &continue_target; + }; - // Add the branch for the loop test, based on the given condition. - // The true branch goes to the first block in the loop body, and - // the false branch goes to the loop's merge block. The builder insertion - // point will be placed at the start of the body. - void createLoopTestBranch(Id condition); + // Start a new loop and prepare the builder to generate code for it. Until + // closeLoop() is called for this loop, createLoopContinue() and + // createLoopExit() will target its corresponding blocks. + LoopBlocks& makeNewLoop(); - // Generate an unconditional branch to the loop body. The builder insertion - // point will be placed at the start of the body. Use this when there is - // no loop test. - void createBranchToBody(); + // Create a new block in the function containing the build point. Memory is + // owned by the function object. + Block& makeNewBlock(); - // Add a branch to the test of the current (innermost) loop. - // The way we generate code, that's also the loop header. + // Add a branch to the continue_target of the current (innermost) loop. void createLoopContinue(); - // Add an exit (e.g. "break") for the innermost loop that you're in + // Add an exit (e.g. "break") from the innermost loop that we're currently + // in. void createLoopExit(); // Close the innermost loop that you're in @@ -515,13 +526,21 @@ public: void accessChainStore(Id rvalue); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Id ResultType); + Id accessChainLoad(Decoration precision, Id ResultType); // get the direct pointer for an l-value Id accessChainGetLValue(); + // Get the inferred SPIR-V type of the result of the current access chain, + // based on the type of the base and the chain of dereferences. + Id accessChainGetInferredType(); + void dump(std::vector&) const; + void createBranch(Block* block); + void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); + protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; @@ -531,21 +550,16 @@ protected: void transferAccessChainSwizzle(bool dynamic); void simplifyAccessChainSwizzle(); void createAndSetNoPredecessorBlock(const char*); - void createBranch(Block* block); 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; - - struct Loop; // Defined below. - void createBranchToLoopHeaderFromInside(const Loop& loop); + void dumpInstructions(std::vector&, + const std::vector >&) const; SourceLanguage source; int sourceVersion; std::vector extensions; AddressingModel addressModel; MemoryModel memoryModel; - std::vector capabilities; + std::set capabilities; int builderNumber; Module module; Block* buildPoint; @@ -554,14 +568,15 @@ protected: AccessChain accessChain; // special blocks of instructions for output - std::vector imports; - std::vector entryPoints; - std::vector executionModes; - std::vector names; - std::vector lines; - std::vector decorations; - std::vector constantsTypesGlobals; - std::vector externals; + std::vector > imports; + std::vector > entryPoints; + std::vector > executionModes; + std::vector > names; + std::vector > lines; + std::vector > decorations; + std::vector > constantsTypesGlobals; + std::vector > externals; + std::vector > functions; // not output, internally used for quick & dirty canonical (unique) creation std::vector groupedConstants[OpConstant]; // all types appear before OpConstant @@ -570,47 +585,8 @@ protected: // stack of switches std::stack switchMerges; - // Data that needs to be kept in order to properly handle loops. - struct Loop { - // Constructs a default Loop structure containing new header, merge, and - // body blocks for the current function. - // The testFirst argument indicates whether the loop test executes at - // the top of the loop rather than at the bottom. In the latter case, - // also create a phi instruction whose value indicates whether we're on - // the first iteration of the loop. The phi instruction is initialized - // with no values or predecessor operands. - Loop(Builder& builder, bool testFirst); - - // The function containing the loop. - Function* const function; - // The header is the first block generated for the loop. - // It dominates all the blocks in the loop, i.e. it is always - // executed before any others. - // If the loop test is executed before the body (as in "while" and - // "for" loops), then the header begins with the test code. - // Otherwise, the loop is a "do-while" loop and the header contains the - // start of the body of the loop (if the body exists). - Block* const header; - // The merge block marks the end of the loop. Control is transferred - // to the merge block when either the loop test fails, or when a - // nested "break" is encountered. - Block* const merge; - // The body block is the first basic block in the body of the loop, i.e. - // the code that is to be repeatedly executed, aside from loop control. - // This member is null until we generate code that references the loop - // body block. - Block* const body; - // True when the loop test executes before the body. - const bool testFirst; - // When the test executes after the body, this is defined as the phi - // instruction that tells us whether we are on the first iteration of - // the loop. Otherwise this is null. This is non-const because - // it has to be initialized outside of the initializer-list. - Instruction* isFirstIteration; - }; - // Our loop stack. - std::stack loops; + std::stack loops; }; // end Builder class // Use for non-fatal notes about what's not complete diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp old mode 100755 new mode 100644 index 08f905ef..e1edddec --- a/SPIRV/disassemble.cpp +++ b/SPIRV/disassemble.cpp @@ -59,7 +59,7 @@ const char* GlslStd450DebugNames[spv::GLSLstd450Count]; namespace spv { -void Kill(std::ostream& out, const char* message) +static void Kill(std::ostream& out, const char* message) { out << std::endl << "Disassembly failed: " << message << std::endl; exit(1); @@ -473,6 +473,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, else out << OperandClassParams[operandClass].getName(stream[word++]); --numOperands; + break; } } @@ -480,7 +481,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, return; } -void GLSLstd450GetDebugNames(const char** names) +static void GLSLstd450GetDebugNames(const char** names) { for (int i = 0; i < GLSLstd450Count; ++i) names[i] = "Unknown"; @@ -531,7 +532,6 @@ void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450SClamp] = "SClamp"; names[GLSLstd450UClamp] = "UClamp"; names[GLSLstd450FMix] = "FMix"; - names[GLSLstd450IMix] = "IMix"; names[GLSLstd450Step] = "Step"; names[GLSLstd450SmoothStep] = "SmoothStep"; names[GLSLstd450Fma] = "Fma"; @@ -568,6 +568,7 @@ void GLSLstd450GetDebugNames(const char** names) void Disassemble(std::ostream& out, const std::vector& stream) { SpirvStream SpirvStream(out, stream); + spv::Parameterize(); GLSLstd450GetDebugNames(GlslStd450DebugNames); SpirvStream.validate(); SpirvStream.processInstructions(); diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index 64a55f99..7cf1c87f 100755 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -712,7 +712,7 @@ const char* KernelProfilingInfoString(int info) } } -const int CapabilityCeiling = 57; +const int CapabilityCeiling = 58; const char* CapabilityString(int info) { @@ -775,6 +775,7 @@ const char* CapabilityString(int info) case 54: return "GeometryStreams"; case 55: return "StorageImageReadWithoutFormat"; case 56: return "StorageImageWriteWithoutFormat"; + case 57: return "MultiViewport"; case CapabilityCeiling: default: return "Bad"; @@ -1104,6 +1105,7 @@ const char* OpcodeString(int op) case 317: return "OpNoLine"; case 318: return "OpAtomicFlagTestAndSet"; case 319: return "OpAtomicFlagClear"; + case 320: return "OpImageSparseRead"; case OpcodeCeiling: default: @@ -1311,7 +1313,6 @@ void Parameterize() 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); @@ -1353,6 +1354,7 @@ void Parameterize() CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry); CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader); CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry); AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses); AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses); @@ -1362,7 +1364,7 @@ void Parameterize() MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel); MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader); - MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityShader); + MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage); ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader); ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation); @@ -1528,7 +1530,7 @@ void Parameterize() DecorationParams[DecorationFlat].caps.push_back(CapabilityShader); DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation); DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader); - DecorationParams[DecorationSample].caps.push_back(CapabilityShader); + DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading); DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader); DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel); DecorationParams[DecorationUniform].caps.push_back(CapabilityShader); @@ -1537,14 +1539,14 @@ void Parameterize() DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams); DecorationParams[DecorationLocation].caps.push_back(CapabilityShader); DecorationParams[DecorationComponent].caps.push_back(CapabilityShader); + DecorationParams[DecorationOffset].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(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); + DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix); DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel); DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel); DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel); @@ -1556,8 +1558,8 @@ void Parameterize() 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[BuiltInClipDistance].caps.push_back(CapabilityClipDistance); + BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance); BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader); BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . ."; @@ -1576,7 +1578,7 @@ void Parameterize() BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry); BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityGeometry); + BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport); BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation); @@ -1584,9 +1586,9 @@ void Parameterize() BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader); BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader); BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading); + BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading); + BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading); BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader); BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader); BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel); @@ -1962,6 +1964,12 @@ void Parameterize() InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency); + InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'"); + InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency); + InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'"); InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency); diff --git a/SPIRV/doc.h b/SPIRV/doc.h old mode 100755 new mode 100644 index accdd65d..b7929793 --- a/SPIRV/doc.h +++ b/SPIRV/doc.h @@ -67,6 +67,8 @@ const char* SamplerFilterModeString(int); const char* ImageFormatString(int); const char* ImageChannelOrderString(int); const char* ImageChannelTypeString(int); +const char* ImageChannelDataTypeString(int type); +const char* ImageOperandsString(int format); const char* ImageOperands(int); const char* FPFastMathString(int); const char* FPRoundingModeString(int); @@ -81,6 +83,7 @@ const char* KernelEnqueueFlagsString(int); const char* KernelProfilingInfoString(int); const char* CapabilityString(int); const char* OpcodeString(int); +const char* ScopeString(int mem); // For grouping opcodes into subsections enum OpcodeClass { @@ -243,7 +246,7 @@ protected: int resultPresent : 1; }; -const int OpcodeCeiling = 320; +const int OpcodeCeiling = 321; // The set of objects that hold all the instruction/operand // parameterization information. diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index f3d42a93..5620aba7 100755 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2015 The Khronos Group Inc. +// Copyright (c) 2014-2016 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -39,19 +39,19 @@ // "Mask" in their name, and a parallel enum that has the shift // amount (1 << x) for each corresponding enumerant. -#ifndef spirv_H -#define spirv_H +#ifndef spirv_HPP +#define spirv_HPP namespace spv { typedef unsigned int Id; -#define SPV_VERSION 10000 -#define SPV_REVISION 2 +#define SPV_VERSION 0x10000 +#define SPV_REVISION 3 static const unsigned int MagicNumber = 0x07230203; static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 2; +static const unsigned int Revision = 3; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -563,6 +563,7 @@ enum Capability { CapabilityGeometryStreams = 54, CapabilityStorageImageReadWithoutFormat = 55, CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, }; enum Op { @@ -859,6 +860,7 @@ enum Op { OpNoLine = 317, OpAtomicFlagTestAndSet = 318, OpAtomicFlagClear = 319, + OpImageSparseRead = 320, }; // Overload operator| for mask bit combining @@ -874,5 +876,4 @@ inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfil } // end namespace spv -#endif // #ifndef spirv_H - +#endif // #ifndef spirv_HPP diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 92911854..98f4971b 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -52,12 +52,16 @@ #include "spirv.hpp" -#include +#include +#include +#include #include -#include +#include +#include namespace spv { +class Block; class Function; class Module; @@ -66,7 +70,17 @@ const Id NoType = 0; const unsigned int BadValue = 0xFFFFFFFF; const Decoration NoPrecision = (Decoration)BadValue; -const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF; +const MemorySemanticsMask MemorySemanticsAllMemory = + (MemorySemanticsMask)(MemorySemanticsAcquireMask | + MemorySemanticsReleaseMask | + MemorySemanticsAcquireReleaseMask | + MemorySemanticsSequentiallyConsistentMask | + MemorySemanticsUniformMemoryMask | + MemorySemanticsSubgroupMemoryMask | + MemorySemanticsWorkgroupMemoryMask | + MemorySemanticsCrossWorkgroupMemoryMask | + MemorySemanticsAtomicCounterMemoryMask | + MemorySemanticsImageMemoryMask); // // SPIR-V IR instruction. @@ -74,8 +88,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF; class Instruction { public: - Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode) { } - explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode) { } + Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } + explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } virtual ~Instruction() {} void addIdOperand(Id id) { operands.push_back(id); } void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } @@ -106,6 +120,8 @@ public: addImmediateOperand(word); } } + void setBlock(Block* b) { block = b; } + Block* getBlock() const { return block; } Op getOpCode() const { return opCode; } int getNumOperands() const { return (int)operands.size(); } Id getResultId() const { return resultId; } @@ -144,6 +160,7 @@ protected: Op opCode; std::vector operands; std::string originalString; // could be optimized away; convenience for getting string operand + Block* block; }; // @@ -155,18 +172,31 @@ public: Block(Id id, Function& parent); virtual ~Block() { - // TODO: free instructions } - + Id getId() { return instructions.front()->getResultId(); } Function& getParent() const { return parent; } - void addInstruction(Instruction* inst); - void addPredecessor(Block* pred) { predecessors.push_back(pred); } - void addLocalVariable(Instruction* inst) { localVariables.push_back(inst); } - int getNumPredecessors() const { return (int)predecessors.size(); } + void addInstruction(std::unique_ptr inst); + void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);} + void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } + const std::vector& getPredecessors() const { return predecessors; } + const std::vector& getSuccessors() const { return successors; } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } + // Returns the block's merge instruction, if one exists (otherwise null). + const Instruction* getMergeInstruction() const { + if (instructions.size() < 2) return nullptr; + const Instruction* nextToLast = (instructions.cend() - 2)->get(); + switch (nextToLast->getOpCode()) { + case OpSelectionMerge: + case OpLoopMerge: + return nextToLast; + default: + return nullptr; + } + return nullptr; + } bool isTerminated() const { @@ -185,12 +215,6 @@ public: void dump(std::vector& out) const { - // skip the degenerate unreachable blocks - // TODO: code gen: skip all unreachable blocks (transitive closure) - // (but, until that's done safer to keep non-degenerate unreachable blocks, in case others depend on something) - if (unreachable && instructions.size() <= 2) - return; - instructions[0]->dump(out); for (int i = 0; i < (int)localVariables.size(); ++i) localVariables[i]->dump(out); @@ -205,9 +229,9 @@ protected: // To enforce keeping parent and ownership in sync: friend Function; - std::vector instructions; - std::vector predecessors; - std::vector localVariables; + std::vector > instructions; + std::vector predecessors, successors; + std::vector > localVariables; Function& parent; // track whether this block is known to be uncreachable (not necessarily @@ -216,6 +240,11 @@ protected: bool unreachable; }; +// Traverses the control-flow graph rooted at root in an order suited for +// readable code generation. Invokes callback at every node in the traversal +// order. +void inReadableOrder(Block* root, std::function callback); + // // SPIR-V IR Function. // @@ -235,12 +264,18 @@ public: Id getParamId(int p) { return parameterInstructions[p]->getResultId(); } void addBlock(Block* block) { blocks.push_back(block); } - void popBlock(Block*) { blocks.pop_back(); } + void removeBlock(Block* block) + { + auto found = find(blocks.begin(), blocks.end(), block); + assert(found != blocks.end()); + blocks.erase(found); + delete block; + } Module& getParent() const { return parent; } Block* getEntryBlock() const { return blocks.front(); } Block* getLastBlock() const { return blocks.back(); } - void addLocalVariable(Instruction* inst); + void addLocalVariable(std::unique_ptr inst); Id getReturnType() const { return functionInstruction.getTypeId(); } void dump(std::vector& out) const { @@ -252,8 +287,7 @@ public: parameterInstructions[p]->dump(out); // Blocks - for (int b = 0; b < (int)blocks.size(); ++b) - blocks[b]->dump(out); + inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); }); Instruction end(0, 0, OpFunctionEnd); end.dump(out); } @@ -341,22 +375,27 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam } } -__inline void Function::addLocalVariable(Instruction* inst) +__inline void Function::addLocalVariable(std::unique_ptr inst) { - blocks[0]->addLocalVariable(inst); - parent.mapInstruction(inst); + Instruction* raw_instruction = inst.get(); + blocks[0]->addLocalVariable(std::move(inst)); + parent.mapInstruction(raw_instruction); } __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false) { - instructions.push_back(new Instruction(id, NoType, OpLabel)); + instructions.push_back(std::unique_ptr(new Instruction(id, NoType, OpLabel))); + instructions.back()->setBlock(this); + parent.getParent().mapInstruction(instructions.back().get()); } -__inline void Block::addInstruction(Instruction* inst) +__inline void Block::addInstruction(std::unique_ptr inst) { - instructions.push_back(inst); - if (inst->getResultId()) - parent.getParent().mapInstruction(inst); + Instruction* raw_instruction = inst.get(); + instructions.push_back(std::move(inst)); + raw_instruction->setBlock(this); + if (raw_instruction->getResultId()) + parent.getParent().mapInstruction(raw_instruction); } }; // end spv namespace diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 92010840..cc59d389 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -435,6 +435,8 @@ void ProcessConfigFile() } if (configStrings) FreeFileData(configStrings); + else + delete[] config; } // thread-safe list of shaders to asynchronously grab and compile @@ -658,17 +660,27 @@ void StderrIfNonEmpty(const char* str) } } +// Simple bundling of what makes a compilation unit for ease in passing around, +// and separation of handling file IO versus API (programmatic) compilation. +struct ShaderCompUnit { + EShLanguage stage; + std::string fileName; + char** text; // memory owned/managed externally +}; + // -// For linking mode: Will independently parse each item in the worklist, but then put them -// in the same program and link them together. +// For linking mode: Will independently parse each compilation unit, but then put them +// in the same program and link them together, making at most one linked module per +// pipeline stage. // // Uses the new C++ interface instead of the old handle-based interface. // -void CompileAndLinkShaders() + +void CompileAndLinkShaderUnits(std::vector compUnits) { // keep track of what to free std::list shaders; - + EShMessages messages = EShMsgDefault; SetMessageOptions(messages); @@ -677,22 +689,14 @@ void CompileAndLinkShaders() // glslang::TProgram& program = *new glslang::TProgram; - glslang::TWorkItem* workItem; - while (Worklist.remove(workItem)) { - EShLanguage stage = FindLanguage(workItem->name); - glslang::TShader* shader = new glslang::TShader(stage); + for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) { + const auto &compUnit = *it; + glslang::TShader* shader = new glslang::TShader(compUnit.stage); + shader->setStrings(compUnit.text, 1); shaders.push_back(shader); - - char** shaderStrings = ReadFileData(workItem->name.c_str()); - if (! shaderStrings) { - usage(); - delete &program; - return; - } const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100; - shader->setStrings(shaderStrings, 1); if (Options & EOptionOutputPreprocessed) { std::string str; if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, @@ -703,7 +707,6 @@ void CompileAndLinkShaders() } StderrIfNonEmpty(shader->getInfoLog()); StderrIfNonEmpty(shader->getInfoDebugLog()); - FreeFileData(shaderStrings); continue; } if (! shader->parse(&Resources, defaultVersion, false, messages)) @@ -711,13 +714,12 @@ void CompileAndLinkShaders() program.addShader(shader); - if (! (Options & EOptionSuppressInfolog)) { - PutsIfNonEmpty(workItem->name.c_str()); + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { + PutsIfNonEmpty(compUnit.fileName.c_str()); PutsIfNonEmpty(shader->getInfoLog()); PutsIfNonEmpty(shader->getInfoDebugLog()); } - - FreeFileData(shaderStrings); } // @@ -727,7 +729,8 @@ void CompileAndLinkShaders() if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages)) LinkFailed = true; - if (! (Options & EOptionSuppressInfolog)) { + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { PutsIfNonEmpty(program.getInfoLog()); PutsIfNonEmpty(program.getInfoDebugLog()); } @@ -745,10 +748,14 @@ void CompileAndLinkShaders() if (program.getIntermediate((EShLanguage)stage)) { std::vector spirv; glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv); - glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); - if (Options & EOptionHumanReadableSpv) { - spv::Parameterize(); - spv::Disassemble(std::cout, spirv); + + // Dump the spv to a file or stdout, etc., but only if not doing + // memory/perf testing, as it's not internal to programmatic use. + if (! (Options & EOptionMemoryLeakMode)) { + glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); + if (Options & EOptionHumanReadableSpv) { + spv::Disassemble(std::cout, spirv); + } } } } @@ -766,6 +773,59 @@ void CompileAndLinkShaders() } } +// +// Do file IO part of compile and link, handing off the pure +// API/programmatic mode to CompileAndLinkShaderUnits(), which can +// be put in a loop for testing memory footprint and performance. +// +// This is just for linking mode: meaning all the shaders will be put into the +// the same program linked together. +// +// This means there are a limited number of work items (not multi-threading mode) +// and that the point is testing at the linking level. Hence, to enable +// performance and memory testing, the actual compile/link can be put in +// a loop, independent of processing the work items and file IO. +// +void CompileAndLinkShaderFiles() +{ + std::vector compUnits; + + // Transfer all the work items from to a simple list of + // of compilation units. (We don't care about the thread + // work-item distribution properties in this path, which + // is okay due to the limited number of shaders, know since + // they are all getting linked together.) + glslang::TWorkItem* workItem; + while (Worklist.remove(workItem)) { + ShaderCompUnit compUnit = { + FindLanguage(workItem->name), + workItem->name, + ReadFileData(workItem->name.c_str()) + }; + + if (! compUnit.text) { + usage(); + return; + } + + compUnits.push_back(compUnit); + } + + // Actual call to programmatic processing of compile and link, + // in a loop for testing memory and performance. This part contains + // all the perf/memory that a programmatic consumer will care about. + for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { + for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) + CompileAndLinkShaderUnits(compUnits); + + if (Options & EOptionMemoryLeakMode) + glslang::OS_DumpMemoryCounters(); + } + + for (auto it = compUnits.begin(); it != compUnits.end(); ++it) + FreeFileData(it->text); +} + int C_DECL main(int argc, char* argv[]) { ProcessArguments(argc, argv); @@ -803,8 +863,13 @@ int C_DECL main(int argc, char* argv[]) if (Options & EOptionLinkProgram || Options & EOptionOutputPreprocessed) { glslang::InitializeProcess(); - CompileAndLinkShaders(); + CompileAndLinkShaderFiles(); glslang::FinalizeProcess(); + for (int w = 0; w < NumWorkItems; ++w) { + if (Work[w]) { + delete Work[w]; + } + } } else { ShInitialize(); @@ -837,6 +902,8 @@ int C_DECL main(int argc, char* argv[]) ShFinalize(); } + delete[] Work; + if (CompileFailed) return EFailCompile; if (LinkFailed) diff --git a/StandAlone/spirv-remap.cpp b/StandAlone/spirv-remap.cpp index 2091feb1..f35b58ed 100644 --- a/StandAlone/spirv-remap.cpp +++ b/StandAlone/spirv-remap.cpp @@ -120,7 +120,8 @@ namespace { if (fp.fail()) errHandler(std::string("error opening file for write: ") + outFile); - for (auto word : spv) { + for (auto it = spv.cbegin(); it != spv.cend(); ++it) { + SpvWord word = *it; fp.write((char *)&word, sizeof(word)); if (fp.fail()) errHandler(std::string("error writing file: ") + outFile); @@ -157,7 +158,8 @@ namespace { void execute(const std::vector& inputFile, const std::string& outputDir, int opts, int verbosity) { - for (const auto& filename : inputFile) { + for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) { + const std::string &filename = *it; std::vector spv; read(spv, filename, verbosity); spv::spirvbin_t(verbosity).remap(spv, opts); diff --git a/Test/100.conf b/Test/100.conf index 29b9b63d..3899d343 100644 --- a/Test/100.conf +++ b/Test/100.conf @@ -1,28 +1,28 @@ -MaxLights 32 -MaxClipPlanes 6 -MaxTextureUnits 32 -MaxTextureCoords 32 -MaxVertexAttribs 8 -MaxVertexUniformComponents 4096 -MaxVaryingFloats 64 -MaxVertexTextureImageUnits 0 -MaxCombinedTextureImageUnits 8 -MaxTextureImageUnits 8 -MaxFragmentUniformComponents 4096 -MaxDrawBuffers 1 -MaxVertexUniformVectors 16 -MaxVaryingVectors 8 -MaxFragmentUniformVectors 16 -MaxVertexOutputVectors 16 -MaxFragmentInputVectors 15 -MinProgramTexelOffset -8 -MaxProgramTexelOffset 7 -nonInductiveForLoops 0 -whileLoops 0 -doWhileLoops 0 -generalUniformIndexing 0 -generalAttributeMatrixVectorIndexing 0 -generalVaryingIndexing 0 -generalSamplerIndexing 0 -generalVariableIndexing 0 -generalConstantMatrixVectorIndexing 0 +MaxLights 32 +MaxClipPlanes 6 +MaxTextureUnits 32 +MaxTextureCoords 32 +MaxVertexAttribs 8 +MaxVertexUniformComponents 4096 +MaxVaryingFloats 64 +MaxVertexTextureImageUnits 0 +MaxCombinedTextureImageUnits 8 +MaxTextureImageUnits 8 +MaxFragmentUniformComponents 4096 +MaxDrawBuffers 1 +MaxVertexUniformVectors 16 +MaxVaryingVectors 8 +MaxFragmentUniformVectors 16 +MaxVertexOutputVectors 16 +MaxFragmentInputVectors 15 +MinProgramTexelOffset -8 +MaxProgramTexelOffset 7 +nonInductiveForLoops 0 +whileLoops 0 +doWhileLoops 0 +generalUniformIndexing 0 +generalAttributeMatrixVectorIndexing 0 +generalVaryingIndexing 0 +generalSamplerIndexing 0 +generalVariableIndexing 0 +generalConstantMatrixVectorIndexing 0 diff --git a/Test/120.vert b/Test/120.vert index cc7a8723..b7724b43 100644 --- a/Test/120.vert +++ b/Test/120.vert @@ -139,6 +139,14 @@ void foo2() bool b = any(lessThan(v4, attv4)); // tests aggregate arg to unary built-in } +void noise() +{ + float f1 = noise1(1.0); + vec2 f2 = noise2(vec2(1.0)); + vec3 f3 = noise3(vec3(1.0)); + vec4 f4 = noise4(vec4(1.0)); +} + // version 130 features uniform int c; diff --git a/Test/400.frag b/Test/400.frag index bb4d2b58..b7460b4a 100644 --- a/Test/400.frag +++ b/Test/400.frag @@ -60,7 +60,7 @@ patch out vec4 patchOut; // ERROR void foo24() { dvec3 df, di; - df = modf(outp.xyz, di); + df = modf(dvec3(outp.xyz), di); } in float in1; @@ -185,3 +185,13 @@ void qlod() } struct SKeyMem { int precise; } KeyMem; // ERROR, keyword can't be a member + +uniform uint uu; +out int iout; + +void bitwiseConv() +{ + iout = uu & i; + iout += uu ^ i; + iout += i | uu; +} diff --git a/Test/400.geom b/Test/400.geom index e2ca9b91..0b77e121 100644 --- a/Test/400.geom +++ b/Test/400.geom @@ -115,3 +115,216 @@ void qlod() lod = textureQueryLod(samp1D, pf); // ERROR, only in fragment lod = textureQueryLod(samp2Ds, pf2); // ERROR, only in fragment } + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(2.1)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); +} diff --git a/Test/Operations.frag b/Test/Operations.frag index 820048f2..ca06a752 100644 --- a/Test/Operations.frag +++ b/Test/Operations.frag @@ -7,10 +7,10 @@ uniform bvec4 ub41, ub42; uniform float uf; uniform int ui; -#ifdef TEST_POST_110 + uniform uvec4 uuv4; -uniform unsigned int uui; -#endif +uniform uint uui; + void main() { @@ -19,9 +19,9 @@ void main() bool b; bvec4 bv4; int i; -#ifdef TEST_POST_110 + uint u; -#endif + // floating point v = radians(uv4); @@ -51,37 +51,37 @@ void main() v += sign(v); v += floor(v); -#ifdef TEST_POST_110 + v += trunc(v); v += round(v); v += roundEven(v); -#endif + v += ceil(v); v += fract(v); v += mod(v, v); v += mod(v, v.x); -#ifdef TEST_POST_110 + v += modf(v, v); -#endif + v += min(v, uv4); v += max(v, uv4); v += clamp(v, uv4, uv4); v += mix(v,v,v); -#ifdef TEST_POST_110 - v += mix(v,v,ub); - v += intBitsToFloat(v); - v += uintBitsToFloat(v); - v += fma(v); + + v += mix(v,v,bv4); + v += intBitsToFloat(ivec4(i)); + v += uintBitsToFloat(uv4); + v += fma(v,v,v); v += frexp(v); v += ldexp(v); v += unpackUnorm2x16(v); v += unpackUnorm4x8(v); v += unpackSnorm4x8(v); -#endif + v += step(v,v); v += smoothstep(v,v,v); @@ -96,7 +96,7 @@ void main() v += fwidth(v); //noise*(v); -#ifdef TEST_POST_110 + // signed integer i += abs(ui); i += sign(i); @@ -118,15 +118,15 @@ void main() u += floatsBitToInt(v); u += packUnorm2x16(v); u += packUnorm4x8(v); - u += packSnorm4x8(v); - u += floatBitsToUInt(v); -#endif + i += uui & i; // ERRORs, no int/uint conversions before 400 + i += uui ^ i; + i += i | uui; // bool -#ifdef TEST_POST_110 + b = isnan(uf); - b = isinf(v); -#endif + b = isinf(v.y); + b = any(lessThan(v, uv4)); b = (b && any(lessThanEqual(v, uv4))); b = (b && any(greaterThan(v, uv4))); diff --git a/Test/baseResults/120.vert.out b/Test/baseResults/120.vert.out index 4c069094..6c63744f 100644 --- a/Test/baseResults/120.vert.out +++ b/Test/baseResults/120.vert.out @@ -45,39 +45,39 @@ ERROR: 0:108: 'overloadE' : no matching overloaded function found ERROR: 0:111: 'overloadE' : no matching overloaded function found ERROR: 0:117: 'overloadF' : no matching overloaded function found ERROR: 0:121: 'gl_TexCoord array size' : must be less than gl_MaxTextureCoords (32) -ERROR: 0:157: 'switch' : Reserved word. -ERROR: 0:163: 'default' : Reserved word. -ERROR: 0:157: 'switch statements' : not supported for this version or the enabled extensions -ERROR: 0:168: 'bit shift left' : not supported for this version or the enabled extensions -ERROR: 0:168: 'bit shift right' : not supported for this version or the enabled extensions -ERROR: 0:168: 'bitwise and' : not supported for this version or the enabled extensions -ERROR: 0:168: 'bitwise inclusive or' : not supported for this version or the enabled extensions -ERROR: 0:171: 'modf' : no matching overloaded function found -ERROR: 0:171: '=' : cannot convert from 'const float' to 'temp 3-component vector of float' -ERROR: 0:172: 'trunc' : no matching overloaded function found -ERROR: 0:173: 'round' : no matching overloaded function found -ERROR: 0:173: '=' : cannot convert from 'const float' to 'temp 2-component vector of float' -ERROR: 0:174: 'roundEven' : no matching overloaded function found -ERROR: 0:174: '=' : cannot convert from 'const float' to 'temp 2-component vector of float' -ERROR: 0:175: 'isnan' : no matching overloaded function found -ERROR: 0:175: '=' : cannot convert from 'const float' to 'temp 2-component vector of bool' -ERROR: 0:176: 'isinf' : no matching overloaded function found -ERROR: 0:176: '=' : cannot convert from 'const float' to 'temp 4-component vector of bool' -ERROR: 0:178: 'sinh' : no matching overloaded function found -ERROR: 0:179: 'cosh' : no matching overloaded function found -ERROR: 0:179: 'tanh' : no matching overloaded function found -ERROR: 0:180: 'c4D' : undeclared identifier -ERROR: 0:180: 'asinh' : no matching overloaded function found -ERROR: 0:180: 'acosh' : no matching overloaded function found -ERROR: 0:181: 'atanh' : no matching overloaded function found -ERROR: 0:183: 'gl_VertexID' : undeclared identifier -ERROR: 0:183: '=' : cannot convert from 'temp float' to 'temp int' -ERROR: 0:184: 'gl_ClipDistance' : undeclared identifier -ERROR: 0:184: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector -ERROR: 0:184: 'assign' : l-value required (can't modify a const) -ERROR: 0:190: 'token pasting (##)' : not supported for this version or the enabled extensions -ERROR: 0:190: '##' : token pasting not implemented (internal error) -ERROR: 0:190: '' : syntax error +ERROR: 0:165: 'switch' : Reserved word. +ERROR: 0:171: 'default' : Reserved word. +ERROR: 0:165: 'switch statements' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bit shift left' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bit shift right' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bitwise and' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bitwise inclusive or' : not supported for this version or the enabled extensions +ERROR: 0:179: 'modf' : no matching overloaded function found +ERROR: 0:179: '=' : cannot convert from 'const float' to 'temp 3-component vector of float' +ERROR: 0:180: 'trunc' : no matching overloaded function found +ERROR: 0:181: 'round' : no matching overloaded function found +ERROR: 0:181: '=' : cannot convert from 'const float' to 'temp 2-component vector of float' +ERROR: 0:182: 'roundEven' : no matching overloaded function found +ERROR: 0:182: '=' : cannot convert from 'const float' to 'temp 2-component vector of float' +ERROR: 0:183: 'isnan' : no matching overloaded function found +ERROR: 0:183: '=' : cannot convert from 'const float' to 'temp 2-component vector of bool' +ERROR: 0:184: 'isinf' : no matching overloaded function found +ERROR: 0:184: '=' : cannot convert from 'const float' to 'temp 4-component vector of bool' +ERROR: 0:186: 'sinh' : no matching overloaded function found +ERROR: 0:187: 'cosh' : no matching overloaded function found +ERROR: 0:187: 'tanh' : no matching overloaded function found +ERROR: 0:188: 'c4D' : undeclared identifier +ERROR: 0:188: 'asinh' : no matching overloaded function found +ERROR: 0:188: 'acosh' : no matching overloaded function found +ERROR: 0:189: 'atanh' : no matching overloaded function found +ERROR: 0:191: 'gl_VertexID' : undeclared identifier +ERROR: 0:191: '=' : cannot convert from 'temp float' to 'temp int' +ERROR: 0:192: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:192: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:192: 'assign' : l-value required (can't modify a const) +ERROR: 0:198: 'token pasting (##)' : not supported for this version or the enabled extensions +ERROR: 0:198: '##' : token pasting not implemented (internal error) +ERROR: 0:198: '' : syntax error ERROR: 79 compilation errors. No code generated. @@ -314,66 +314,99 @@ ERROR: node is still EOpNull! 0:139 Compare Less Than (global 4-component vector of bool) 0:139 'v4' (temp 4-component vector of float) 0:139 'attv4' (in 4-component vector of float) -0:154 Function Definition: foo213( (global void) -0:154 Function Parameters: -0:156 Sequence -0:156 Sequence -0:156 move second child to first child (temp float) -0:156 'f' (temp float) -0:156 Constant: -0:156 3.000000 -0:157 switch -0:157 condition -0:157 'c' (uniform int) -0:157 body -0:157 Sequence -0:158 case: with expression -0:158 Constant: -0:158 1 (const int) +0:142 Function Definition: noise( (global void) +0:142 Function Parameters: +0:144 Sequence +0:144 Sequence +0:144 move second child to first child (temp float) +0:144 'f1' (temp float) +0:144 noise (global float) +0:144 Constant: +0:144 1.000000 +0:145 Sequence +0:145 move second child to first child (temp 2-component vector of float) +0:145 'f2' (temp 2-component vector of float) +0:145 noise (global 2-component vector of float) +0:145 Constant: +0:145 1.000000 +0:145 1.000000 +0:146 Sequence +0:146 move second child to first child (temp 3-component vector of float) +0:146 'f3' (temp 3-component vector of float) +0:146 noise (global 3-component vector of float) +0:146 Constant: +0:146 1.000000 +0:146 1.000000 +0:146 1.000000 +0:147 Sequence +0:147 move second child to first child (temp 4-component vector of float) +0:147 'f4' (temp 4-component vector of float) +0:147 noise (global 4-component vector of float) +0:147 Constant: +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:162 Function Definition: foo213( (global void) +0:162 Function Parameters: +0:164 Sequence +0:164 Sequence +0:164 move second child to first child (temp float) +0:164 'f' (temp float) +0:164 Constant: +0:164 3.000000 +0:165 switch +0:165 condition +0:165 'c' (uniform int) +0:165 body +0:165 Sequence +0:166 case: with expression +0:166 Constant: +0:166 1 (const int) 0:? Sequence -0:159 move second child to first child (temp float) -0:159 'f' (temp float) -0:159 sine (global float) -0:159 'f' (temp float) -0:160 Branch: Break -0:161 case: with expression -0:161 Constant: -0:161 2 (const int) +0:167 move second child to first child (temp float) +0:167 'f' (temp float) +0:167 sine (global float) +0:167 'f' (temp float) +0:168 Branch: Break +0:169 case: with expression +0:169 Constant: +0:169 2 (const int) 0:? Sequence -0:162 move second child to first child (temp float) -0:162 'f' (temp float) -0:162 component-wise multiply (temp float) -0:162 'f' (temp float) -0:162 'f' (temp float) -0:163 default: +0:170 move second child to first child (temp float) +0:170 'f' (temp float) +0:170 component-wise multiply (temp float) +0:170 'f' (temp float) +0:170 'f' (temp float) +0:171 default: 0:? Sequence -0:164 move second child to first child (temp float) -0:164 'f' (temp float) -0:164 Constant: -0:164 3.000000 -0:168 inclusive-or (temp int) -0:168 left-shift (temp int) -0:168 'i' (temp int) -0:168 Constant: -0:168 3 (const int) -0:168 Constant: -0:168 69 (const int) -0:172 Sequence -0:172 move second child to first child (temp float) -0:172 't' (temp float) -0:172 Constant: -0:172 0.000000 -0:178 Constant: -0:178 0.000000 -0:180 Constant: -0:180 0.000000 -0:181 Constant: -0:181 0.000000 -0:184 move second child to first child (temp float) -0:184 Constant: -0:184 0.000000 -0:184 Constant: -0:184 0.300000 +0:172 move second child to first child (temp float) +0:172 'f' (temp float) +0:172 Constant: +0:172 3.000000 +0:176 inclusive-or (temp int) +0:176 left-shift (temp int) +0:176 'i' (temp int) +0:176 Constant: +0:176 3 (const int) +0:176 Constant: +0:176 69 (const int) +0:180 Sequence +0:180 move second child to first child (temp float) +0:180 't' (temp float) +0:180 Constant: +0:180 0.000000 +0:186 Constant: +0:186 0.000000 +0:188 Constant: +0:188 0.000000 +0:189 Constant: +0:189 0.000000 +0:192 move second child to first child (temp float) +0:192 Constant: +0:192 0.000000 +0:192 Constant: +0:192 0.300000 0:? Linker Objects 0:? 'i' (in 4-component vector of float) 0:? 'o' (smooth out 4-component vector of float) @@ -633,66 +666,99 @@ ERROR: node is still EOpNull! 0:139 Compare Less Than (global 4-component vector of bool) 0:139 'v4' (temp 4-component vector of float) 0:139 'attv4' (in 4-component vector of float) -0:154 Function Definition: foo213( (global void) -0:154 Function Parameters: -0:156 Sequence -0:156 Sequence -0:156 move second child to first child (temp float) -0:156 'f' (temp float) -0:156 Constant: -0:156 3.000000 -0:157 switch -0:157 condition -0:157 'c' (uniform int) -0:157 body -0:157 Sequence -0:158 case: with expression -0:158 Constant: -0:158 1 (const int) +0:142 Function Definition: noise( (global void) +0:142 Function Parameters: +0:144 Sequence +0:144 Sequence +0:144 move second child to first child (temp float) +0:144 'f1' (temp float) +0:144 noise (global float) +0:144 Constant: +0:144 1.000000 +0:145 Sequence +0:145 move second child to first child (temp 2-component vector of float) +0:145 'f2' (temp 2-component vector of float) +0:145 noise (global 2-component vector of float) +0:145 Constant: +0:145 1.000000 +0:145 1.000000 +0:146 Sequence +0:146 move second child to first child (temp 3-component vector of float) +0:146 'f3' (temp 3-component vector of float) +0:146 noise (global 3-component vector of float) +0:146 Constant: +0:146 1.000000 +0:146 1.000000 +0:146 1.000000 +0:147 Sequence +0:147 move second child to first child (temp 4-component vector of float) +0:147 'f4' (temp 4-component vector of float) +0:147 noise (global 4-component vector of float) +0:147 Constant: +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:162 Function Definition: foo213( (global void) +0:162 Function Parameters: +0:164 Sequence +0:164 Sequence +0:164 move second child to first child (temp float) +0:164 'f' (temp float) +0:164 Constant: +0:164 3.000000 +0:165 switch +0:165 condition +0:165 'c' (uniform int) +0:165 body +0:165 Sequence +0:166 case: with expression +0:166 Constant: +0:166 1 (const int) 0:? Sequence -0:159 move second child to first child (temp float) -0:159 'f' (temp float) -0:159 sine (global float) -0:159 'f' (temp float) -0:160 Branch: Break -0:161 case: with expression -0:161 Constant: -0:161 2 (const int) +0:167 move second child to first child (temp float) +0:167 'f' (temp float) +0:167 sine (global float) +0:167 'f' (temp float) +0:168 Branch: Break +0:169 case: with expression +0:169 Constant: +0:169 2 (const int) 0:? Sequence -0:162 move second child to first child (temp float) -0:162 'f' (temp float) -0:162 component-wise multiply (temp float) -0:162 'f' (temp float) -0:162 'f' (temp float) -0:163 default: +0:170 move second child to first child (temp float) +0:170 'f' (temp float) +0:170 component-wise multiply (temp float) +0:170 'f' (temp float) +0:170 'f' (temp float) +0:171 default: 0:? Sequence -0:164 move second child to first child (temp float) -0:164 'f' (temp float) -0:164 Constant: -0:164 3.000000 -0:168 inclusive-or (temp int) -0:168 left-shift (temp int) -0:168 'i' (temp int) -0:168 Constant: -0:168 3 (const int) -0:168 Constant: -0:168 69 (const int) -0:172 Sequence -0:172 move second child to first child (temp float) -0:172 't' (temp float) -0:172 Constant: -0:172 0.000000 -0:178 Constant: -0:178 0.000000 -0:180 Constant: -0:180 0.000000 -0:181 Constant: -0:181 0.000000 -0:184 move second child to first child (temp float) -0:184 Constant: -0:184 0.000000 -0:184 Constant: -0:184 0.300000 +0:172 move second child to first child (temp float) +0:172 'f' (temp float) +0:172 Constant: +0:172 3.000000 +0:176 inclusive-or (temp int) +0:176 left-shift (temp int) +0:176 'i' (temp int) +0:176 Constant: +0:176 3 (const int) +0:176 Constant: +0:176 69 (const int) +0:180 Sequence +0:180 move second child to first child (temp float) +0:180 't' (temp float) +0:180 Constant: +0:180 0.000000 +0:186 Constant: +0:186 0.000000 +0:188 Constant: +0:188 0.000000 +0:189 Constant: +0:189 0.000000 +0:192 move second child to first child (temp float) +0:192 Constant: +0:192 0.000000 +0:192 Constant: +0:192 0.300000 0:? Linker Objects 0:? 'i' (in 4-component vector of float) 0:? 'o' (smooth out 4-component vector of float) diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index e61d2aae..ff438e3a 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -8,7 +8,7 @@ ERROR: 0:39: 'location qualifier on input' : not supported in this stage: comput ERROR: 0:40: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:41: 'out' : global storage output qualifier cannot be used in a compute shader ERROR: 0:44: 'shared' : cannot apply layout qualifiers to a shared variable -ERROR: 0:44: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:44: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:45: 'shared' : cannot initialize this type of qualifier ERROR: 0:47: 'local_size' : can only apply to 'in' ERROR: 0:47: 'local_size' : can only apply to 'in' diff --git a/Test/baseResults/400.frag.out b/Test/baseResults/400.frag.out index 0069585b..33a8c9ab 100644 --- a/Test/baseResults/400.frag.out +++ b/Test/baseResults/400.frag.out @@ -218,26 +218,18 @@ ERROR: node is still EOpNull! 0:? Sequence 0:63 move second child to first child (temp 3-component vector of double) 0:63 'df' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 Comma (global 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) -0:63 modf (global 3-component vector of float) -0:63 vector swizzle (temp 3-component vector of float) -0:63 'outp' (out 4-component vector of float) -0:63 Sequence -0:63 Constant: -0:63 0 (const int) -0:63 Constant: -0:63 1 (const int) -0:63 Constant: -0:63 2 (const int) -0:63 'tempArg' (temp 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of double) -0:63 'di' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 'tempArg' (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) +0:63 modf (global 3-component vector of double) +0:63 Convert float to double (temp 3-component vector of double) +0:63 vector swizzle (temp 3-component vector of float) +0:63 'outp' (out 4-component vector of float) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'di' (temp 3-component vector of double) 0:71 Function Definition: foodc1( (global void) 0:71 Function Parameters: 0:73 Sequence @@ -707,26 +699,18 @@ ERROR: node is still EOpNull! 0:? Sequence 0:63 move second child to first child (temp 3-component vector of double) 0:63 'df' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 Comma (global 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) -0:63 modf (global 3-component vector of float) -0:63 vector swizzle (temp 3-component vector of float) -0:63 'outp' (out 4-component vector of float) -0:63 Sequence -0:63 Constant: -0:63 0 (const int) -0:63 Constant: -0:63 1 (const int) -0:63 Constant: -0:63 2 (const int) -0:63 'tempArg' (temp 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of double) -0:63 'di' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 'tempArg' (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) +0:63 modf (global 3-component vector of double) +0:63 Convert float to double (temp 3-component vector of double) +0:63 vector swizzle (temp 3-component vector of float) +0:63 'outp' (out 4-component vector of float) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'di' (temp 3-component vector of double) 0:71 Function Definition: foodc1( (global void) 0:71 Function Parameters: 0:73 Sequence diff --git a/Test/baseResults/400.geom.out b/Test/baseResults/400.geom.out index f120327b..16117e62 100644 --- a/Test/baseResults/400.geom.out +++ b/Test/baseResults/400.geom.out @@ -174,6 +174,855 @@ ERROR: node is still EOpNull! 0:? Sequence 0:115 'lod' (temp 2-component vector of float) 0:116 'lod' (temp 2-component vector of float) +0:119 Function Definition: doubles( (global void) +0:119 Function Parameters: +0:? Sequence +0:131 move second child to first child (temp double) +0:131 'doublev' (temp double) +0:131 Constant: +0:131 1.702939 +0:132 move second child to first child (temp 2-component vector of double) +0:132 'dvec2v' (temp 2-component vector of double) +0:132 Constant: +0:132 1.643168 +0:132 1.643168 +0:133 move second child to first child (temp 3-component vector of double) +0:133 'dvec3v' (temp 3-component vector of double) +0:133 Constant: +0:133 1.414214 +0:133 1.414214 +0:133 1.414214 +0:134 move second child to first child (temp 4-component vector of double) +0:134 'dvec4v' (temp 4-component vector of double) +0:134 Constant: +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:136 add second child into first child (temp double) +0:136 'doublev' (temp double) +0:136 inverse sqrt (global double) +0:136 'doublev' (temp double) +0:137 add second child into first child (temp 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:137 inverse sqrt (global 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:138 add second child into first child (temp 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:138 inverse sqrt (global 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:139 add second child into first child (temp 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:139 inverse sqrt (global 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:141 add second child into first child (temp double) +0:141 'doublev' (temp double) +0:141 Absolute value (global double) +0:141 'doublev' (temp double) +0:142 add second child into first child (temp 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:142 Absolute value (global 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:143 add second child into first child (temp 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:143 Absolute value (global 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:144 add second child into first child (temp 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:144 Absolute value (global 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:146 add second child into first child (temp double) +0:146 'doublev' (temp double) +0:146 Sign (global double) +0:146 'doublev' (temp double) +0:147 add second child into first child (temp 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:147 Sign (global 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:148 add second child into first child (temp 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:148 Sign (global 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:149 add second child into first child (temp 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:149 Sign (global 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:151 add second child into first child (temp double) +0:151 'doublev' (temp double) +0:151 Floor (global double) +0:151 'doublev' (temp double) +0:152 add second child into first child (temp 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:152 Floor (global 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:153 add second child into first child (temp 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:153 Floor (global 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:154 add second child into first child (temp 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:154 Floor (global 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:156 add second child into first child (temp double) +0:156 'doublev' (temp double) +0:156 trunc (global double) +0:156 'doublev' (temp double) +0:157 add second child into first child (temp 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:157 trunc (global 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:158 add second child into first child (temp 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:158 trunc (global 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:159 add second child into first child (temp 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:159 trunc (global 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:161 add second child into first child (temp double) +0:161 'doublev' (temp double) +0:161 round (global double) +0:161 'doublev' (temp double) +0:162 add second child into first child (temp 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:162 round (global 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:163 add second child into first child (temp 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:163 round (global 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:164 add second child into first child (temp 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:164 round (global 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:166 add second child into first child (temp double) +0:166 'doublev' (temp double) +0:166 roundEven (global double) +0:166 'doublev' (temp double) +0:167 add second child into first child (temp 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:167 roundEven (global 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:168 add second child into first child (temp 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:168 roundEven (global 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:169 add second child into first child (temp 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:169 roundEven (global 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:171 add second child into first child (temp double) +0:171 'doublev' (temp double) +0:171 Ceiling (global double) +0:171 'doublev' (temp double) +0:172 add second child into first child (temp 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:172 Ceiling (global 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:173 add second child into first child (temp 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:173 Ceiling (global 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:174 add second child into first child (temp 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:174 Ceiling (global 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:176 add second child into first child (temp double) +0:176 'doublev' (temp double) +0:176 Fraction (global double) +0:176 'doublev' (temp double) +0:177 add second child into first child (temp 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:177 Fraction (global 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:178 add second child into first child (temp 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:178 Fraction (global 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:179 add second child into first child (temp 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:179 Fraction (global 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:181 add second child into first child (temp double) +0:181 'doublev' (temp double) +0:181 mod (global double) +0:181 'doublev' (temp double) +0:181 'doublev' (temp double) +0:182 add second child into first child (temp 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 mod (global 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 'doublev' (temp double) +0:183 add second child into first child (temp 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 mod (global 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 'doublev' (temp double) +0:184 add second child into first child (temp 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 mod (global 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 'doublev' (temp double) +0:185 add second child into first child (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 mod (global 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:186 add second child into first child (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 mod (global 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:187 add second child into first child (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 mod (global 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:189 add second child into first child (temp double) +0:189 'doublev' (temp double) +0:189 modf (global double) +0:189 'doublev' (temp double) +0:189 'doublev' (temp double) +0:190 add second child into first child (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 modf (global 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:191 add second child into first child (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 modf (global 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:192 add second child into first child (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 modf (global 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:194 add second child into first child (temp double) +0:194 'doublev' (temp double) +0:194 min (global double) +0:194 'doublev' (temp double) +0:194 'doublev' (temp double) +0:195 add second child into first child (temp 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 min (global 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 'doublev' (temp double) +0:196 add second child into first child (temp 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 min (global 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 'doublev' (temp double) +0:197 add second child into first child (temp 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 min (global 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 'doublev' (temp double) +0:198 add second child into first child (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 min (global 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:199 add second child into first child (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 min (global 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:200 add second child into first child (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 min (global 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:202 add second child into first child (temp double) +0:202 'doublev' (temp double) +0:202 max (global double) +0:202 'doublev' (temp double) +0:202 'doublev' (temp double) +0:203 add second child into first child (temp 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 max (global 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 'doublev' (temp double) +0:204 add second child into first child (temp 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 max (global 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 'doublev' (temp double) +0:205 add second child into first child (temp 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 max (global 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 'doublev' (temp double) +0:206 add second child into first child (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 max (global 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:207 add second child into first child (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 max (global 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:208 add second child into first child (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 max (global 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:210 add second child into first child (temp double) +0:210 'doublev' (temp double) +0:210 clamp (global double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:211 add second child into first child (temp 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 clamp (global 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 'doublev' (temp double) +0:211 'doublev' (temp double) +0:212 add second child into first child (temp 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 clamp (global 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 'doublev' (temp double) +0:212 'doublev' (temp double) +0:213 add second child into first child (temp 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 clamp (global 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 'doublev' (temp double) +0:213 'doublev' (temp double) +0:214 add second child into first child (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 clamp (global 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:215 add second child into first child (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 clamp (global 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:216 add second child into first child (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 clamp (global 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:218 add second child into first child (temp double) +0:218 'doublev' (temp double) +0:218 mix (global double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:219 add second child into first child (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 mix (global 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'doublev' (temp double) +0:220 add second child into first child (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 mix (global 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'doublev' (temp double) +0:221 add second child into first child (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 mix (global 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'doublev' (temp double) +0:222 add second child into first child (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 mix (global 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:223 add second child into first child (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 mix (global 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:224 add second child into first child (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 mix (global 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:225 add second child into first child (temp double) +0:225 'doublev' (temp double) +0:225 mix (global double) +0:225 'doublev' (temp double) +0:225 'doublev' (temp double) +0:225 'boolv' (temp bool) +0:226 add second child into first child (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 mix (global 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'bvec2v' (temp 2-component vector of bool) +0:227 add second child into first child (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 mix (global 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'bvec3v' (temp 3-component vector of bool) +0:228 add second child into first child (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 mix (global 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'bvec4v' (temp 4-component vector of bool) +0:230 add second child into first child (temp double) +0:230 'doublev' (temp double) +0:230 step (global double) +0:230 'doublev' (temp double) +0:230 'doublev' (temp double) +0:231 add second child into first child (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 step (global 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:232 add second child into first child (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 step (global 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:233 add second child into first child (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 step (global 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:234 add second child into first child (temp 2-component vector of double) +0:234 'dvec2v' (temp 2-component vector of double) +0:234 step (global 2-component vector of double) +0:234 'doublev' (temp double) +0:234 'dvec2v' (temp 2-component vector of double) +0:235 add second child into first child (temp 3-component vector of double) +0:235 'dvec3v' (temp 3-component vector of double) +0:235 step (global 3-component vector of double) +0:235 'doublev' (temp double) +0:235 'dvec3v' (temp 3-component vector of double) +0:236 add second child into first child (temp 4-component vector of double) +0:236 'dvec4v' (temp 4-component vector of double) +0:236 step (global 4-component vector of double) +0:236 'doublev' (temp double) +0:236 'dvec4v' (temp 4-component vector of double) +0:238 add second child into first child (temp double) +0:238 'doublev' (temp double) +0:238 smoothstep (global double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:239 add second child into first child (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 smoothstep (global 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:240 add second child into first child (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 smoothstep (global 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:241 add second child into first child (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 smoothstep (global 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:242 add second child into first child (temp 2-component vector of double) +0:242 'dvec2v' (temp 2-component vector of double) +0:242 smoothstep (global 2-component vector of double) +0:242 'doublev' (temp double) +0:242 'doublev' (temp double) +0:242 'dvec2v' (temp 2-component vector of double) +0:243 add second child into first child (temp 3-component vector of double) +0:243 'dvec3v' (temp 3-component vector of double) +0:243 smoothstep (global 3-component vector of double) +0:243 'doublev' (temp double) +0:243 'doublev' (temp double) +0:243 'dvec3v' (temp 3-component vector of double) +0:244 add second child into first child (temp 4-component vector of double) +0:244 'dvec4v' (temp 4-component vector of double) +0:244 smoothstep (global 4-component vector of double) +0:244 'doublev' (temp double) +0:244 'doublev' (temp double) +0:244 'dvec4v' (temp 4-component vector of double) +0:246 move second child to first child (temp bool) +0:246 'boolv' (temp bool) +0:246 isnan (global bool) +0:246 'doublev' (temp double) +0:247 move second child to first child (temp 2-component vector of bool) +0:247 'bvec2v' (temp 2-component vector of bool) +0:247 isnan (global 2-component vector of bool) +0:247 'dvec2v' (temp 2-component vector of double) +0:248 move second child to first child (temp 3-component vector of bool) +0:248 'bvec3v' (temp 3-component vector of bool) +0:248 isnan (global 3-component vector of bool) +0:248 'dvec3v' (temp 3-component vector of double) +0:249 move second child to first child (temp 4-component vector of bool) +0:249 'bvec4v' (temp 4-component vector of bool) +0:249 isnan (global 4-component vector of bool) +0:249 'dvec4v' (temp 4-component vector of double) +0:251 move second child to first child (temp bool) +0:251 'boolv' (temp bool) +0:251 Test condition and select (temp bool) +0:251 Condition +0:251 'boolv' (temp bool) +0:251 true case +0:251 isinf (global bool) +0:251 'doublev' (temp double) +0:251 false case +0:251 Constant: +0:251 false (const bool) +0:252 move second child to first child (temp 2-component vector of bool) +0:252 'bvec2v' (temp 2-component vector of bool) +0:252 Test condition and select (temp 2-component vector of bool) +0:252 Condition +0:252 'boolv' (temp bool) +0:252 true case +0:252 isinf (global 2-component vector of bool) +0:252 'dvec2v' (temp 2-component vector of double) +0:252 false case +0:252 Constant: +0:252 false (const bool) +0:252 false (const bool) +0:253 move second child to first child (temp 3-component vector of bool) +0:253 'bvec3v' (temp 3-component vector of bool) +0:253 Test condition and select (temp 3-component vector of bool) +0:253 Condition +0:253 'boolv' (temp bool) +0:253 true case +0:253 isinf (global 3-component vector of bool) +0:253 'dvec3v' (temp 3-component vector of double) +0:253 false case +0:253 Constant: +0:253 false (const bool) +0:253 false (const bool) +0:253 false (const bool) +0:254 move second child to first child (temp 4-component vector of bool) +0:254 'bvec4v' (temp 4-component vector of bool) +0:254 Test condition and select (temp 4-component vector of bool) +0:254 Condition +0:254 'boolv' (temp bool) +0:254 true case +0:254 isinf (global 4-component vector of bool) +0:254 'dvec4v' (temp 4-component vector of double) +0:254 false case +0:254 Constant: +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:256 add second child into first child (temp double) +0:256 'doublev' (temp double) +0:256 length (global double) +0:256 'doublev' (temp double) +0:257 add second child into first child (temp double) +0:257 'doublev' (temp double) +0:257 length (global double) +0:257 'dvec2v' (temp 2-component vector of double) +0:258 add second child into first child (temp double) +0:258 'doublev' (temp double) +0:258 length (global double) +0:258 'dvec3v' (temp 3-component vector of double) +0:259 add second child into first child (temp double) +0:259 'doublev' (temp double) +0:259 length (global double) +0:259 'dvec4v' (temp 4-component vector of double) +0:261 add second child into first child (temp double) +0:261 'doublev' (temp double) +0:261 distance (global double) +0:261 'doublev' (temp double) +0:261 'doublev' (temp double) +0:262 add second child into first child (temp double) +0:262 'doublev' (temp double) +0:262 distance (global double) +0:262 'dvec2v' (temp 2-component vector of double) +0:262 'dvec2v' (temp 2-component vector of double) +0:263 add second child into first child (temp double) +0:263 'doublev' (temp double) +0:263 distance (global double) +0:263 'dvec3v' (temp 3-component vector of double) +0:263 'dvec3v' (temp 3-component vector of double) +0:264 add second child into first child (temp double) +0:264 'doublev' (temp double) +0:264 distance (global double) +0:264 'dvec4v' (temp 4-component vector of double) +0:264 'dvec4v' (temp 4-component vector of double) +0:266 add second child into first child (temp double) +0:266 'doublev' (temp double) +0:266 dot-product (global double) +0:266 'doublev' (temp double) +0:266 'doublev' (temp double) +0:267 add second child into first child (temp double) +0:267 'doublev' (temp double) +0:267 dot-product (global double) +0:267 'dvec2v' (temp 2-component vector of double) +0:267 'dvec2v' (temp 2-component vector of double) +0:268 add second child into first child (temp double) +0:268 'doublev' (temp double) +0:268 dot-product (global double) +0:268 'dvec3v' (temp 3-component vector of double) +0:268 'dvec3v' (temp 3-component vector of double) +0:269 add second child into first child (temp double) +0:269 'doublev' (temp double) +0:269 dot-product (global double) +0:269 'dvec4v' (temp 4-component vector of double) +0:269 'dvec4v' (temp 4-component vector of double) +0:271 add second child into first child (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 cross-product (global 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:273 add second child into first child (temp double) +0:273 'doublev' (temp double) +0:273 normalize (global double) +0:273 'doublev' (temp double) +0:274 add second child into first child (temp 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:274 normalize (global 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:275 add second child into first child (temp 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:275 normalize (global 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:276 add second child into first child (temp 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:276 normalize (global 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:278 add second child into first child (temp double) +0:278 'doublev' (temp double) +0:278 face-forward (global double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:279 add second child into first child (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 face-forward (global 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:280 add second child into first child (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 face-forward (global 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:281 add second child into first child (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 face-forward (global 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:283 add second child into first child (temp double) +0:283 'doublev' (temp double) +0:283 reflect (global double) +0:283 'doublev' (temp double) +0:283 'doublev' (temp double) +0:284 add second child into first child (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 reflect (global 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:285 add second child into first child (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 reflect (global 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:286 add second child into first child (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 reflect (global 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:288 add second child into first child (temp double) +0:288 'doublev' (temp double) +0:288 refract (global double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:289 add second child into first child (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 refract (global 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'doublev' (temp double) +0:290 add second child into first child (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 refract (global 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'doublev' (temp double) +0:291 add second child into first child (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 refract (global 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'doublev' (temp double) +0:293 Sequence +0:293 move second child to first child (temp 2X2 matrix of double) +0:293 'dmat2v' (temp 2X2 matrix of double) +0:293 outer product (global 2X2 matrix of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:294 Sequence +0:294 move second child to first child (temp 3X3 matrix of double) +0:294 'dmat3v' (temp 3X3 matrix of double) +0:294 outer product (global 3X3 matrix of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:295 Sequence +0:295 move second child to first child (temp 4X4 matrix of double) +0:295 'dmat4v' (temp 4X4 matrix of double) +0:295 outer product (global 4X4 matrix of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:296 Sequence +0:296 move second child to first child (temp 2X3 matrix of double) +0:296 'dmat2x3v' (temp 2X3 matrix of double) +0:296 outer product (global 2X3 matrix of double) +0:296 'dvec3v' (temp 3-component vector of double) +0:296 'dvec2v' (temp 2-component vector of double) +0:297 Sequence +0:297 move second child to first child (temp 3X2 matrix of double) +0:297 'dmat3x2v' (temp 3X2 matrix of double) +0:297 outer product (global 3X2 matrix of double) +0:297 'dvec2v' (temp 2-component vector of double) +0:297 'dvec3v' (temp 3-component vector of double) +0:298 Sequence +0:298 move second child to first child (temp 2X4 matrix of double) +0:298 'dmat2x4v' (temp 2X4 matrix of double) +0:298 outer product (global 2X4 matrix of double) +0:298 'dvec4v' (temp 4-component vector of double) +0:298 'dvec2v' (temp 2-component vector of double) +0:299 Sequence +0:299 move second child to first child (temp 4X2 matrix of double) +0:299 'dmat4x2v' (temp 4X2 matrix of double) +0:299 outer product (global 4X2 matrix of double) +0:299 'dvec2v' (temp 2-component vector of double) +0:299 'dvec4v' (temp 4-component vector of double) +0:300 Sequence +0:300 move second child to first child (temp 3X4 matrix of double) +0:300 'dmat3x4v' (temp 3X4 matrix of double) +0:300 outer product (global 3X4 matrix of double) +0:300 'dvec4v' (temp 4-component vector of double) +0:300 'dvec3v' (temp 3-component vector of double) +0:301 Sequence +0:301 move second child to first child (temp 4X3 matrix of double) +0:301 'dmat4x3v' (temp 4X3 matrix of double) +0:301 outer product (global 4X3 matrix of double) +0:301 'dvec3v' (temp 3-component vector of double) +0:301 'dvec4v' (temp 4-component vector of double) +0:303 matrix mult second child into first child (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 component-wise multiply (global 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:304 matrix mult second child into first child (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 component-wise multiply (global 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:305 matrix mult second child into first child (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 component-wise multiply (global 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:306 move second child to first child (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 component-wise multiply (global 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:307 move second child to first child (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 component-wise multiply (global 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:308 move second child to first child (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 component-wise multiply (global 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:309 move second child to first child (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 component-wise multiply (global 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:310 move second child to first child (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 component-wise multiply (global 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:311 move second child to first child (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 component-wise multiply (global 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:313 matrix mult second child into first child (temp 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:313 transpose (global 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:314 matrix mult second child into first child (temp 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:314 transpose (global 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:315 matrix mult second child into first child (temp 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:315 transpose (global 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:316 move second child to first child (temp 2X3 matrix of double) +0:316 'dmat2x3v' (temp 2X3 matrix of double) +0:316 transpose (global 2X3 matrix of double) +0:316 'dmat3x2v' (temp 3X2 matrix of double) +0:317 move second child to first child (temp 3X2 matrix of double) +0:317 'dmat3x2v' (temp 3X2 matrix of double) +0:317 transpose (global 3X2 matrix of double) +0:317 'dmat2x3v' (temp 2X3 matrix of double) +0:318 move second child to first child (temp 2X4 matrix of double) +0:318 'dmat2x4v' (temp 2X4 matrix of double) +0:318 transpose (global 2X4 matrix of double) +0:318 'dmat4x2v' (temp 4X2 matrix of double) +0:319 move second child to first child (temp 4X2 matrix of double) +0:319 'dmat4x2v' (temp 4X2 matrix of double) +0:319 transpose (global 4X2 matrix of double) +0:319 'dmat2x4v' (temp 2X4 matrix of double) +0:320 move second child to first child (temp 3X4 matrix of double) +0:320 'dmat3x4v' (temp 3X4 matrix of double) +0:320 transpose (global 3X4 matrix of double) +0:320 'dmat4x3v' (temp 4X3 matrix of double) +0:321 move second child to first child (temp 4X3 matrix of double) +0:321 'dmat4x3v' (temp 4X3 matrix of double) +0:321 transpose (global 4X3 matrix of double) +0:321 'dmat3x4v' (temp 3X4 matrix of double) +0:323 add second child into first child (temp double) +0:323 'doublev' (temp double) +0:323 determinant (global double) +0:323 'dmat2v' (temp 2X2 matrix of double) +0:324 add second child into first child (temp double) +0:324 'doublev' (temp double) +0:324 determinant (global double) +0:324 'dmat3v' (temp 3X3 matrix of double) +0:325 add second child into first child (temp double) +0:325 'doublev' (temp double) +0:325 determinant (global double) +0:325 'dmat4v' (temp 4X4 matrix of double) +0:327 matrix mult second child into first child (temp 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:327 inverse (global 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:328 matrix mult second child into first child (temp 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:328 inverse (global 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:329 matrix mult second child into first child (temp 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) +0:329 inverse (global 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) 0:? Linker Objects 0:? 'bn' (in 3-element array of block{in int a}) 0:? 'gl_in' (in 3-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) @@ -347,6 +1196,855 @@ ERROR: node is still EOpNull! 0:? Sequence 0:115 'lod' (temp 2-component vector of float) 0:116 'lod' (temp 2-component vector of float) +0:119 Function Definition: doubles( (global void) +0:119 Function Parameters: +0:? Sequence +0:131 move second child to first child (temp double) +0:131 'doublev' (temp double) +0:131 Constant: +0:131 1.702939 +0:132 move second child to first child (temp 2-component vector of double) +0:132 'dvec2v' (temp 2-component vector of double) +0:132 Constant: +0:132 1.643168 +0:132 1.643168 +0:133 move second child to first child (temp 3-component vector of double) +0:133 'dvec3v' (temp 3-component vector of double) +0:133 Constant: +0:133 1.414214 +0:133 1.414214 +0:133 1.414214 +0:134 move second child to first child (temp 4-component vector of double) +0:134 'dvec4v' (temp 4-component vector of double) +0:134 Constant: +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:136 add second child into first child (temp double) +0:136 'doublev' (temp double) +0:136 inverse sqrt (global double) +0:136 'doublev' (temp double) +0:137 add second child into first child (temp 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:137 inverse sqrt (global 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:138 add second child into first child (temp 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:138 inverse sqrt (global 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:139 add second child into first child (temp 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:139 inverse sqrt (global 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:141 add second child into first child (temp double) +0:141 'doublev' (temp double) +0:141 Absolute value (global double) +0:141 'doublev' (temp double) +0:142 add second child into first child (temp 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:142 Absolute value (global 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:143 add second child into first child (temp 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:143 Absolute value (global 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:144 add second child into first child (temp 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:144 Absolute value (global 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:146 add second child into first child (temp double) +0:146 'doublev' (temp double) +0:146 Sign (global double) +0:146 'doublev' (temp double) +0:147 add second child into first child (temp 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:147 Sign (global 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:148 add second child into first child (temp 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:148 Sign (global 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:149 add second child into first child (temp 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:149 Sign (global 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:151 add second child into first child (temp double) +0:151 'doublev' (temp double) +0:151 Floor (global double) +0:151 'doublev' (temp double) +0:152 add second child into first child (temp 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:152 Floor (global 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:153 add second child into first child (temp 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:153 Floor (global 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:154 add second child into first child (temp 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:154 Floor (global 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:156 add second child into first child (temp double) +0:156 'doublev' (temp double) +0:156 trunc (global double) +0:156 'doublev' (temp double) +0:157 add second child into first child (temp 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:157 trunc (global 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:158 add second child into first child (temp 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:158 trunc (global 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:159 add second child into first child (temp 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:159 trunc (global 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:161 add second child into first child (temp double) +0:161 'doublev' (temp double) +0:161 round (global double) +0:161 'doublev' (temp double) +0:162 add second child into first child (temp 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:162 round (global 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:163 add second child into first child (temp 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:163 round (global 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:164 add second child into first child (temp 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:164 round (global 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:166 add second child into first child (temp double) +0:166 'doublev' (temp double) +0:166 roundEven (global double) +0:166 'doublev' (temp double) +0:167 add second child into first child (temp 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:167 roundEven (global 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:168 add second child into first child (temp 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:168 roundEven (global 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:169 add second child into first child (temp 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:169 roundEven (global 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:171 add second child into first child (temp double) +0:171 'doublev' (temp double) +0:171 Ceiling (global double) +0:171 'doublev' (temp double) +0:172 add second child into first child (temp 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:172 Ceiling (global 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:173 add second child into first child (temp 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:173 Ceiling (global 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:174 add second child into first child (temp 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:174 Ceiling (global 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:176 add second child into first child (temp double) +0:176 'doublev' (temp double) +0:176 Fraction (global double) +0:176 'doublev' (temp double) +0:177 add second child into first child (temp 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:177 Fraction (global 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:178 add second child into first child (temp 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:178 Fraction (global 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:179 add second child into first child (temp 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:179 Fraction (global 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:181 add second child into first child (temp double) +0:181 'doublev' (temp double) +0:181 mod (global double) +0:181 'doublev' (temp double) +0:181 'doublev' (temp double) +0:182 add second child into first child (temp 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 mod (global 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 'doublev' (temp double) +0:183 add second child into first child (temp 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 mod (global 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 'doublev' (temp double) +0:184 add second child into first child (temp 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 mod (global 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 'doublev' (temp double) +0:185 add second child into first child (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 mod (global 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:186 add second child into first child (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 mod (global 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:187 add second child into first child (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 mod (global 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:189 add second child into first child (temp double) +0:189 'doublev' (temp double) +0:189 modf (global double) +0:189 'doublev' (temp double) +0:189 'doublev' (temp double) +0:190 add second child into first child (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 modf (global 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:191 add second child into first child (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 modf (global 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:192 add second child into first child (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 modf (global 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:194 add second child into first child (temp double) +0:194 'doublev' (temp double) +0:194 min (global double) +0:194 'doublev' (temp double) +0:194 'doublev' (temp double) +0:195 add second child into first child (temp 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 min (global 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 'doublev' (temp double) +0:196 add second child into first child (temp 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 min (global 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 'doublev' (temp double) +0:197 add second child into first child (temp 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 min (global 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 'doublev' (temp double) +0:198 add second child into first child (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 min (global 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:199 add second child into first child (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 min (global 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:200 add second child into first child (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 min (global 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:202 add second child into first child (temp double) +0:202 'doublev' (temp double) +0:202 max (global double) +0:202 'doublev' (temp double) +0:202 'doublev' (temp double) +0:203 add second child into first child (temp 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 max (global 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 'doublev' (temp double) +0:204 add second child into first child (temp 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 max (global 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 'doublev' (temp double) +0:205 add second child into first child (temp 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 max (global 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 'doublev' (temp double) +0:206 add second child into first child (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 max (global 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:207 add second child into first child (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 max (global 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:208 add second child into first child (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 max (global 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:210 add second child into first child (temp double) +0:210 'doublev' (temp double) +0:210 clamp (global double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:211 add second child into first child (temp 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 clamp (global 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 'doublev' (temp double) +0:211 'doublev' (temp double) +0:212 add second child into first child (temp 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 clamp (global 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 'doublev' (temp double) +0:212 'doublev' (temp double) +0:213 add second child into first child (temp 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 clamp (global 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 'doublev' (temp double) +0:213 'doublev' (temp double) +0:214 add second child into first child (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 clamp (global 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:215 add second child into first child (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 clamp (global 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:216 add second child into first child (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 clamp (global 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:218 add second child into first child (temp double) +0:218 'doublev' (temp double) +0:218 mix (global double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:219 add second child into first child (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 mix (global 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'doublev' (temp double) +0:220 add second child into first child (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 mix (global 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'doublev' (temp double) +0:221 add second child into first child (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 mix (global 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'doublev' (temp double) +0:222 add second child into first child (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 mix (global 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:223 add second child into first child (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 mix (global 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:224 add second child into first child (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 mix (global 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:225 add second child into first child (temp double) +0:225 'doublev' (temp double) +0:225 mix (global double) +0:225 'doublev' (temp double) +0:225 'doublev' (temp double) +0:225 'boolv' (temp bool) +0:226 add second child into first child (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 mix (global 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'bvec2v' (temp 2-component vector of bool) +0:227 add second child into first child (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 mix (global 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'bvec3v' (temp 3-component vector of bool) +0:228 add second child into first child (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 mix (global 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'bvec4v' (temp 4-component vector of bool) +0:230 add second child into first child (temp double) +0:230 'doublev' (temp double) +0:230 step (global double) +0:230 'doublev' (temp double) +0:230 'doublev' (temp double) +0:231 add second child into first child (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 step (global 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:232 add second child into first child (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 step (global 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:233 add second child into first child (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 step (global 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:234 add second child into first child (temp 2-component vector of double) +0:234 'dvec2v' (temp 2-component vector of double) +0:234 step (global 2-component vector of double) +0:234 'doublev' (temp double) +0:234 'dvec2v' (temp 2-component vector of double) +0:235 add second child into first child (temp 3-component vector of double) +0:235 'dvec3v' (temp 3-component vector of double) +0:235 step (global 3-component vector of double) +0:235 'doublev' (temp double) +0:235 'dvec3v' (temp 3-component vector of double) +0:236 add second child into first child (temp 4-component vector of double) +0:236 'dvec4v' (temp 4-component vector of double) +0:236 step (global 4-component vector of double) +0:236 'doublev' (temp double) +0:236 'dvec4v' (temp 4-component vector of double) +0:238 add second child into first child (temp double) +0:238 'doublev' (temp double) +0:238 smoothstep (global double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:239 add second child into first child (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 smoothstep (global 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:240 add second child into first child (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 smoothstep (global 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:241 add second child into first child (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 smoothstep (global 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:242 add second child into first child (temp 2-component vector of double) +0:242 'dvec2v' (temp 2-component vector of double) +0:242 smoothstep (global 2-component vector of double) +0:242 'doublev' (temp double) +0:242 'doublev' (temp double) +0:242 'dvec2v' (temp 2-component vector of double) +0:243 add second child into first child (temp 3-component vector of double) +0:243 'dvec3v' (temp 3-component vector of double) +0:243 smoothstep (global 3-component vector of double) +0:243 'doublev' (temp double) +0:243 'doublev' (temp double) +0:243 'dvec3v' (temp 3-component vector of double) +0:244 add second child into first child (temp 4-component vector of double) +0:244 'dvec4v' (temp 4-component vector of double) +0:244 smoothstep (global 4-component vector of double) +0:244 'doublev' (temp double) +0:244 'doublev' (temp double) +0:244 'dvec4v' (temp 4-component vector of double) +0:246 move second child to first child (temp bool) +0:246 'boolv' (temp bool) +0:246 isnan (global bool) +0:246 'doublev' (temp double) +0:247 move second child to first child (temp 2-component vector of bool) +0:247 'bvec2v' (temp 2-component vector of bool) +0:247 isnan (global 2-component vector of bool) +0:247 'dvec2v' (temp 2-component vector of double) +0:248 move second child to first child (temp 3-component vector of bool) +0:248 'bvec3v' (temp 3-component vector of bool) +0:248 isnan (global 3-component vector of bool) +0:248 'dvec3v' (temp 3-component vector of double) +0:249 move second child to first child (temp 4-component vector of bool) +0:249 'bvec4v' (temp 4-component vector of bool) +0:249 isnan (global 4-component vector of bool) +0:249 'dvec4v' (temp 4-component vector of double) +0:251 move second child to first child (temp bool) +0:251 'boolv' (temp bool) +0:251 Test condition and select (temp bool) +0:251 Condition +0:251 'boolv' (temp bool) +0:251 true case +0:251 isinf (global bool) +0:251 'doublev' (temp double) +0:251 false case +0:251 Constant: +0:251 false (const bool) +0:252 move second child to first child (temp 2-component vector of bool) +0:252 'bvec2v' (temp 2-component vector of bool) +0:252 Test condition and select (temp 2-component vector of bool) +0:252 Condition +0:252 'boolv' (temp bool) +0:252 true case +0:252 isinf (global 2-component vector of bool) +0:252 'dvec2v' (temp 2-component vector of double) +0:252 false case +0:252 Constant: +0:252 false (const bool) +0:252 false (const bool) +0:253 move second child to first child (temp 3-component vector of bool) +0:253 'bvec3v' (temp 3-component vector of bool) +0:253 Test condition and select (temp 3-component vector of bool) +0:253 Condition +0:253 'boolv' (temp bool) +0:253 true case +0:253 isinf (global 3-component vector of bool) +0:253 'dvec3v' (temp 3-component vector of double) +0:253 false case +0:253 Constant: +0:253 false (const bool) +0:253 false (const bool) +0:253 false (const bool) +0:254 move second child to first child (temp 4-component vector of bool) +0:254 'bvec4v' (temp 4-component vector of bool) +0:254 Test condition and select (temp 4-component vector of bool) +0:254 Condition +0:254 'boolv' (temp bool) +0:254 true case +0:254 isinf (global 4-component vector of bool) +0:254 'dvec4v' (temp 4-component vector of double) +0:254 false case +0:254 Constant: +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:256 add second child into first child (temp double) +0:256 'doublev' (temp double) +0:256 length (global double) +0:256 'doublev' (temp double) +0:257 add second child into first child (temp double) +0:257 'doublev' (temp double) +0:257 length (global double) +0:257 'dvec2v' (temp 2-component vector of double) +0:258 add second child into first child (temp double) +0:258 'doublev' (temp double) +0:258 length (global double) +0:258 'dvec3v' (temp 3-component vector of double) +0:259 add second child into first child (temp double) +0:259 'doublev' (temp double) +0:259 length (global double) +0:259 'dvec4v' (temp 4-component vector of double) +0:261 add second child into first child (temp double) +0:261 'doublev' (temp double) +0:261 distance (global double) +0:261 'doublev' (temp double) +0:261 'doublev' (temp double) +0:262 add second child into first child (temp double) +0:262 'doublev' (temp double) +0:262 distance (global double) +0:262 'dvec2v' (temp 2-component vector of double) +0:262 'dvec2v' (temp 2-component vector of double) +0:263 add second child into first child (temp double) +0:263 'doublev' (temp double) +0:263 distance (global double) +0:263 'dvec3v' (temp 3-component vector of double) +0:263 'dvec3v' (temp 3-component vector of double) +0:264 add second child into first child (temp double) +0:264 'doublev' (temp double) +0:264 distance (global double) +0:264 'dvec4v' (temp 4-component vector of double) +0:264 'dvec4v' (temp 4-component vector of double) +0:266 add second child into first child (temp double) +0:266 'doublev' (temp double) +0:266 dot-product (global double) +0:266 'doublev' (temp double) +0:266 'doublev' (temp double) +0:267 add second child into first child (temp double) +0:267 'doublev' (temp double) +0:267 dot-product (global double) +0:267 'dvec2v' (temp 2-component vector of double) +0:267 'dvec2v' (temp 2-component vector of double) +0:268 add second child into first child (temp double) +0:268 'doublev' (temp double) +0:268 dot-product (global double) +0:268 'dvec3v' (temp 3-component vector of double) +0:268 'dvec3v' (temp 3-component vector of double) +0:269 add second child into first child (temp double) +0:269 'doublev' (temp double) +0:269 dot-product (global double) +0:269 'dvec4v' (temp 4-component vector of double) +0:269 'dvec4v' (temp 4-component vector of double) +0:271 add second child into first child (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 cross-product (global 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:273 add second child into first child (temp double) +0:273 'doublev' (temp double) +0:273 normalize (global double) +0:273 'doublev' (temp double) +0:274 add second child into first child (temp 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:274 normalize (global 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:275 add second child into first child (temp 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:275 normalize (global 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:276 add second child into first child (temp 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:276 normalize (global 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:278 add second child into first child (temp double) +0:278 'doublev' (temp double) +0:278 face-forward (global double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:279 add second child into first child (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 face-forward (global 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:280 add second child into first child (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 face-forward (global 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:281 add second child into first child (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 face-forward (global 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:283 add second child into first child (temp double) +0:283 'doublev' (temp double) +0:283 reflect (global double) +0:283 'doublev' (temp double) +0:283 'doublev' (temp double) +0:284 add second child into first child (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 reflect (global 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:285 add second child into first child (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 reflect (global 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:286 add second child into first child (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 reflect (global 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:288 add second child into first child (temp double) +0:288 'doublev' (temp double) +0:288 refract (global double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:289 add second child into first child (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 refract (global 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'doublev' (temp double) +0:290 add second child into first child (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 refract (global 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'doublev' (temp double) +0:291 add second child into first child (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 refract (global 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'doublev' (temp double) +0:293 Sequence +0:293 move second child to first child (temp 2X2 matrix of double) +0:293 'dmat2v' (temp 2X2 matrix of double) +0:293 outer product (global 2X2 matrix of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:294 Sequence +0:294 move second child to first child (temp 3X3 matrix of double) +0:294 'dmat3v' (temp 3X3 matrix of double) +0:294 outer product (global 3X3 matrix of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:295 Sequence +0:295 move second child to first child (temp 4X4 matrix of double) +0:295 'dmat4v' (temp 4X4 matrix of double) +0:295 outer product (global 4X4 matrix of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:296 Sequence +0:296 move second child to first child (temp 2X3 matrix of double) +0:296 'dmat2x3v' (temp 2X3 matrix of double) +0:296 outer product (global 2X3 matrix of double) +0:296 'dvec3v' (temp 3-component vector of double) +0:296 'dvec2v' (temp 2-component vector of double) +0:297 Sequence +0:297 move second child to first child (temp 3X2 matrix of double) +0:297 'dmat3x2v' (temp 3X2 matrix of double) +0:297 outer product (global 3X2 matrix of double) +0:297 'dvec2v' (temp 2-component vector of double) +0:297 'dvec3v' (temp 3-component vector of double) +0:298 Sequence +0:298 move second child to first child (temp 2X4 matrix of double) +0:298 'dmat2x4v' (temp 2X4 matrix of double) +0:298 outer product (global 2X4 matrix of double) +0:298 'dvec4v' (temp 4-component vector of double) +0:298 'dvec2v' (temp 2-component vector of double) +0:299 Sequence +0:299 move second child to first child (temp 4X2 matrix of double) +0:299 'dmat4x2v' (temp 4X2 matrix of double) +0:299 outer product (global 4X2 matrix of double) +0:299 'dvec2v' (temp 2-component vector of double) +0:299 'dvec4v' (temp 4-component vector of double) +0:300 Sequence +0:300 move second child to first child (temp 3X4 matrix of double) +0:300 'dmat3x4v' (temp 3X4 matrix of double) +0:300 outer product (global 3X4 matrix of double) +0:300 'dvec4v' (temp 4-component vector of double) +0:300 'dvec3v' (temp 3-component vector of double) +0:301 Sequence +0:301 move second child to first child (temp 4X3 matrix of double) +0:301 'dmat4x3v' (temp 4X3 matrix of double) +0:301 outer product (global 4X3 matrix of double) +0:301 'dvec3v' (temp 3-component vector of double) +0:301 'dvec4v' (temp 4-component vector of double) +0:303 matrix mult second child into first child (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 component-wise multiply (global 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:304 matrix mult second child into first child (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 component-wise multiply (global 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:305 matrix mult second child into first child (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 component-wise multiply (global 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:306 move second child to first child (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 component-wise multiply (global 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:307 move second child to first child (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 component-wise multiply (global 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:308 move second child to first child (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 component-wise multiply (global 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:309 move second child to first child (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 component-wise multiply (global 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:310 move second child to first child (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 component-wise multiply (global 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:311 move second child to first child (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 component-wise multiply (global 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:313 matrix mult second child into first child (temp 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:313 transpose (global 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:314 matrix mult second child into first child (temp 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:314 transpose (global 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:315 matrix mult second child into first child (temp 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:315 transpose (global 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:316 move second child to first child (temp 2X3 matrix of double) +0:316 'dmat2x3v' (temp 2X3 matrix of double) +0:316 transpose (global 2X3 matrix of double) +0:316 'dmat3x2v' (temp 3X2 matrix of double) +0:317 move second child to first child (temp 3X2 matrix of double) +0:317 'dmat3x2v' (temp 3X2 matrix of double) +0:317 transpose (global 3X2 matrix of double) +0:317 'dmat2x3v' (temp 2X3 matrix of double) +0:318 move second child to first child (temp 2X4 matrix of double) +0:318 'dmat2x4v' (temp 2X4 matrix of double) +0:318 transpose (global 2X4 matrix of double) +0:318 'dmat4x2v' (temp 4X2 matrix of double) +0:319 move second child to first child (temp 4X2 matrix of double) +0:319 'dmat4x2v' (temp 4X2 matrix of double) +0:319 transpose (global 4X2 matrix of double) +0:319 'dmat2x4v' (temp 2X4 matrix of double) +0:320 move second child to first child (temp 3X4 matrix of double) +0:320 'dmat3x4v' (temp 3X4 matrix of double) +0:320 transpose (global 3X4 matrix of double) +0:320 'dmat4x3v' (temp 4X3 matrix of double) +0:321 move second child to first child (temp 4X3 matrix of double) +0:321 'dmat4x3v' (temp 4X3 matrix of double) +0:321 transpose (global 4X3 matrix of double) +0:321 'dmat3x4v' (temp 3X4 matrix of double) +0:323 add second child into first child (temp double) +0:323 'doublev' (temp double) +0:323 determinant (global double) +0:323 'dmat2v' (temp 2X2 matrix of double) +0:324 add second child into first child (temp double) +0:324 'doublev' (temp double) +0:324 determinant (global double) +0:324 'dmat3v' (temp 3X3 matrix of double) +0:325 add second child into first child (temp double) +0:325 'doublev' (temp double) +0:325 determinant (global double) +0:325 'dmat4v' (temp 4X4 matrix of double) +0:327 matrix mult second child into first child (temp 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:327 inverse (global 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:328 matrix mult second child into first child (temp 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:328 inverse (global 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:329 matrix mult second child into first child (temp 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) +0:329 inverse (global 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) 0:? Linker Objects 0:? 'bn' (in 3-element array of block{in int a}) 0:? 'gl_in' (in 3-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index 6d7b3618..3b0dfaea 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -9,7 +9,6 @@ ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sa ERROR: 0:13: 'uniform' : too many storage qualifiers ERROR: 0:18: '=' : global const initializers must be constant 'const int' ERROR: 0:20: 'const' : no qualifiers allowed for function return -ERROR: 0:27: '' : constant expression required ERROR: 0:27: '' : array size must be a constant integer expression ERROR: 0:38: 'j' : undeclared identifier ERROR: 0:38: '=' : cannot convert from 'temp float' to 'temp int' @@ -33,7 +32,6 @@ ERROR: 0:85: 'patch' : not supported in this stage: vertex ERROR: 0:85: '' : vertex input cannot be further qualified ERROR: 0:86: 'patch' : not supported in this stage: vertex ERROR: 0:100: '=' : global const initializers must be constant 'const int' -ERROR: 0:101: '' : constant expression required ERROR: 0:101: '' : array size must be a constant integer expression ERROR: 0:107: '' : image variables not declared 'writeonly' must have a format layout qualifier ERROR: 0:114: 'imageAtomicMin' : only supported on image with format r32i or r32ui @@ -53,7 +51,7 @@ ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:157: 'assign' : cannot convert from 'const float' to 'temp int' ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:158: 'assign' : cannot convert from 'const float' to 'temp int' -ERROR: 52 compilation errors. No code generated. +ERROR: 50 compilation errors. No code generated. Shader version: 420 diff --git a/Test/baseResults/430.comp.out b/Test/baseResults/430.comp.out index 39896593..aecf42fc 100644 --- a/Test/baseResults/430.comp.out +++ b/Test/baseResults/430.comp.out @@ -7,7 +7,7 @@ ERROR: 0:43: 'location qualifier on input' : not supported in this stage: comput ERROR: 0:44: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:45: 'out' : global storage output qualifier cannot be used in a compute shader ERROR: 0:48: 'shared' : cannot apply layout qualifiers to a shared variable -ERROR: 0:48: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:48: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:49: 'shared' : cannot initialize this type of qualifier ERROR: 0:51: 'local_size' : can only apply to 'in' ERROR: 0:51: 'local_size' : can only apply to 'in' diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index 30e2cafe..8cfd20c0 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -1,6 +1,6 @@ 430.vert Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:3: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:3: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:7: 'input block' : not supported in this stage: vertex ERROR: 0:7: 'location qualifier on in/out block' : not supported for this version or the enabled extensions ERROR: 0:8: 'location qualifier on in/out block' : not supported for this version or the enabled extensions diff --git a/Test/baseResults/Operations.frag.out b/Test/baseResults/Operations.frag.out index 4bf19699..bc12fe0d 100644 --- a/Test/baseResults/Operations.frag.out +++ b/Test/baseResults/Operations.frag.out @@ -1,6 +1,34 @@ Operations.frag +ERROR: 0:76: 'intBitsToFloat' : no matching overloaded function found +ERROR: 0:77: 'uintBitsToFloat' : no matching overloaded function found +ERROR: 0:78: 'fma' : no matching overloaded function found +ERROR: 0:79: 'frexp' : no matching overloaded function found +ERROR: 0:80: 'ldexp' : no matching overloaded function found +ERROR: 0:81: 'unpackUnorm2x16' : no matching overloaded function found +ERROR: 0:82: 'unpackUnorm4x8' : no matching overloaded function found +ERROR: 0:83: 'unpackSnorm4x8' : no matching overloaded function found +ERROR: 0:107: 'floatsBitsToInt' : no matching overloaded function found +ERROR: 0:108: 'packUnorm2x16' : no matching overloaded function found +ERROR: 0:109: 'packUnorm4x8' : no matching overloaded function found +ERROR: 0:110: 'packSnorm4x8' : no matching overloaded function found +ERROR: 0:113: 'assign' : cannot convert from 'global float' to 'temp uint' +ERROR: 0:114: 'assign' : cannot convert from 'global float' to 'temp uint' +ERROR: 0:118: 'floatsBitToInt' : no matching overloaded function found +ERROR: 0:118: 'assign' : cannot convert from 'const float' to 'temp uint' +ERROR: 0:119: 'packUnorm2x16' : no matching overloaded function found +ERROR: 0:119: 'assign' : cannot convert from 'const float' to 'temp uint' +ERROR: 0:120: 'packUnorm4x8' : no matching overloaded function found +ERROR: 0:120: 'assign' : cannot convert from 'const float' to 'temp uint' +ERROR: 0:121: '&' : wrong operand types: no operation '&' exists that takes a left-hand operand of type 'uniform uint' and a right operand of type 'temp int' (or there is no acceptable conversion) +ERROR: 0:121: 'assign' : cannot convert from 'uniform uint' to 'temp int' +ERROR: 0:122: '^' : wrong operand types: no operation '^' exists that takes a left-hand operand of type 'uniform uint' and a right operand of type 'temp int' (or there is no acceptable conversion) +ERROR: 0:122: 'assign' : cannot convert from 'uniform uint' to 'temp int' +ERROR: 0:123: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type 'temp int' and a right operand of type 'uniform uint' (or there is no acceptable conversion) +ERROR: 25 compilation errors. No code generated. + + Shader version: 130 -0:? Sequence +ERROR: node is still EOpNull! 0:15 Function Definition: main( (global void) 0:15 Function Parameters: 0:? Sequence @@ -107,6 +135,18 @@ Shader version: 130 0:52 'v' (temp 4-component vector of float) 0:52 Floor (global 4-component vector of float) 0:52 'v' (temp 4-component vector of float) +0:55 add second child into first child (temp 4-component vector of float) +0:55 'v' (temp 4-component vector of float) +0:55 trunc (global 4-component vector of float) +0:55 'v' (temp 4-component vector of float) +0:56 add second child into first child (temp 4-component vector of float) +0:56 'v' (temp 4-component vector of float) +0:56 round (global 4-component vector of float) +0:56 'v' (temp 4-component vector of float) +0:57 add second child into first child (temp 4-component vector of float) +0:57 'v' (temp 4-component vector of float) +0:57 roundEven (global 4-component vector of float) +0:57 'v' (temp 4-component vector of float) 0:60 add second child into first child (temp 4-component vector of float) 0:60 'v' (temp 4-component vector of float) 0:60 Ceiling (global 4-component vector of float) @@ -128,6 +168,11 @@ Shader version: 130 0:63 'v' (temp 4-component vector of float) 0:63 Constant: 0:63 0 (const int) +0:66 add second child into first child (temp 4-component vector of float) +0:66 'v' (temp 4-component vector of float) +0:66 modf (global 4-component vector of float) +0:66 'v' (temp 4-component vector of float) +0:66 'v' (temp 4-component vector of float) 0:69 add second child into first child (temp 4-component vector of float) 0:69 'v' (temp 4-component vector of float) 0:69 min (global 4-component vector of float) @@ -150,6 +195,44 @@ Shader version: 130 0:72 'v' (temp 4-component vector of float) 0:72 'v' (temp 4-component vector of float) 0:72 'v' (temp 4-component vector of float) +0:75 add second child into first child (temp 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 mix (global 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 'bv4' (temp 4-component vector of bool) +0:76 add second child into first child (temp 4-component vector of float) +0:76 'v' (temp 4-component vector of float) +0:76 Constant: +0:76 0.000000 +0:77 add second child into first child (temp 4-component vector of float) +0:77 'v' (temp 4-component vector of float) +0:77 Constant: +0:77 0.000000 +0:78 add second child into first child (temp 4-component vector of float) +0:78 'v' (temp 4-component vector of float) +0:78 Constant: +0:78 0.000000 +0:79 add second child into first child (temp 4-component vector of float) +0:79 'v' (temp 4-component vector of float) +0:79 Constant: +0:79 0.000000 +0:80 add second child into first child (temp 4-component vector of float) +0:80 'v' (temp 4-component vector of float) +0:80 Constant: +0:80 0.000000 +0:81 add second child into first child (temp 4-component vector of float) +0:81 'v' (temp 4-component vector of float) +0:81 Constant: +0:81 0.000000 +0:82 add second child into first child (temp 4-component vector of float) +0:82 'v' (temp 4-component vector of float) +0:82 Constant: +0:82 0.000000 +0:83 add second child into first child (temp 4-component vector of float) +0:83 'v' (temp 4-component vector of float) +0:83 Constant: +0:83 0.000000 0:86 add second child into first child (temp 4-component vector of float) 0:86 'v' (temp 4-component vector of float) 0:86 step (global 4-component vector of float) @@ -205,6 +288,75 @@ Shader version: 130 0:96 'v' (temp 4-component vector of float) 0:96 fwidth (global 4-component vector of float) 0:96 'v' (temp 4-component vector of float) +0:101 add second child into first child (temp int) +0:101 'i' (temp int) +0:101 Absolute value (global int) +0:101 'ui' (uniform int) +0:102 add second child into first child (temp int) +0:102 'i' (temp int) +0:102 Sign (global int) +0:102 'i' (temp int) +0:103 add second child into first child (temp int) +0:103 'i' (temp int) +0:103 min (global int) +0:103 'i' (temp int) +0:103 'ui' (uniform int) +0:104 add second child into first child (temp int) +0:104 'i' (temp int) +0:104 max (global int) +0:104 'i' (temp int) +0:104 'ui' (uniform int) +0:105 add second child into first child (temp int) +0:105 'i' (temp int) +0:105 clamp (global int) +0:105 'i' (temp int) +0:105 'ui' (uniform int) +0:105 'ui' (uniform int) +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:110 Constant: +0:110 0.000000 +0:113 'u' (temp uint) +0:114 'u' (temp uint) +0:115 add second child into first child (temp uint) +0:115 'u' (temp uint) +0:115 min (global uint) +0:115 'u' (temp uint) +0:115 'uui' (uniform uint) +0:116 add second child into first child (temp uint) +0:116 'u' (temp uint) +0:116 max (global uint) +0:116 'u' (temp uint) +0:116 'uui' (uniform uint) +0:117 add second child into first child (temp uint) +0:117 'u' (temp uint) +0:117 clamp (global uint) +0:117 'u' (temp uint) +0:117 'uui' (uniform uint) +0:117 'uui' (uniform uint) +0:118 'u' (temp uint) +0:119 'u' (temp uint) +0:120 'u' (temp uint) +0:121 'i' (temp int) +0:122 'i' (temp int) +0:123 add second child into first child (temp int) +0:123 'i' (temp int) +0:123 'i' (temp int) +0:127 move second child to first child (temp bool) +0:127 'b' (temp bool) +0:127 isnan (global bool) +0:127 'uf' (uniform float) +0:128 move second child to first child (temp bool) +0:128 'b' (temp bool) +0:128 isinf (global bool) +0:128 direct index (temp float) +0:128 'v' (temp 4-component vector of float) +0:128 Constant: +0:128 1 (const int) 0:130 move second child to first child (temp bool) 0:130 'b' (temp bool) 0:130 any (global bool) @@ -431,13 +583,15 @@ Shader version: 130 0:? 'ub42' (uniform 4-component vector of bool) 0:? 'uf' (uniform float) 0:? 'ui' (uniform int) +0:? 'uuv4' (uniform 4-component vector of uint) +0:? 'uui' (uniform uint) Linked fragment stage: Shader version: 130 -0:? Sequence +ERROR: node is still EOpNull! 0:15 Function Definition: main( (global void) 0:15 Function Parameters: 0:? Sequence @@ -544,6 +698,18 @@ Shader version: 130 0:52 'v' (temp 4-component vector of float) 0:52 Floor (global 4-component vector of float) 0:52 'v' (temp 4-component vector of float) +0:55 add second child into first child (temp 4-component vector of float) +0:55 'v' (temp 4-component vector of float) +0:55 trunc (global 4-component vector of float) +0:55 'v' (temp 4-component vector of float) +0:56 add second child into first child (temp 4-component vector of float) +0:56 'v' (temp 4-component vector of float) +0:56 round (global 4-component vector of float) +0:56 'v' (temp 4-component vector of float) +0:57 add second child into first child (temp 4-component vector of float) +0:57 'v' (temp 4-component vector of float) +0:57 roundEven (global 4-component vector of float) +0:57 'v' (temp 4-component vector of float) 0:60 add second child into first child (temp 4-component vector of float) 0:60 'v' (temp 4-component vector of float) 0:60 Ceiling (global 4-component vector of float) @@ -565,6 +731,11 @@ Shader version: 130 0:63 'v' (temp 4-component vector of float) 0:63 Constant: 0:63 0 (const int) +0:66 add second child into first child (temp 4-component vector of float) +0:66 'v' (temp 4-component vector of float) +0:66 modf (global 4-component vector of float) +0:66 'v' (temp 4-component vector of float) +0:66 'v' (temp 4-component vector of float) 0:69 add second child into first child (temp 4-component vector of float) 0:69 'v' (temp 4-component vector of float) 0:69 min (global 4-component vector of float) @@ -587,6 +758,44 @@ Shader version: 130 0:72 'v' (temp 4-component vector of float) 0:72 'v' (temp 4-component vector of float) 0:72 'v' (temp 4-component vector of float) +0:75 add second child into first child (temp 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 mix (global 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 'v' (temp 4-component vector of float) +0:75 'bv4' (temp 4-component vector of bool) +0:76 add second child into first child (temp 4-component vector of float) +0:76 'v' (temp 4-component vector of float) +0:76 Constant: +0:76 0.000000 +0:77 add second child into first child (temp 4-component vector of float) +0:77 'v' (temp 4-component vector of float) +0:77 Constant: +0:77 0.000000 +0:78 add second child into first child (temp 4-component vector of float) +0:78 'v' (temp 4-component vector of float) +0:78 Constant: +0:78 0.000000 +0:79 add second child into first child (temp 4-component vector of float) +0:79 'v' (temp 4-component vector of float) +0:79 Constant: +0:79 0.000000 +0:80 add second child into first child (temp 4-component vector of float) +0:80 'v' (temp 4-component vector of float) +0:80 Constant: +0:80 0.000000 +0:81 add second child into first child (temp 4-component vector of float) +0:81 'v' (temp 4-component vector of float) +0:81 Constant: +0:81 0.000000 +0:82 add second child into first child (temp 4-component vector of float) +0:82 'v' (temp 4-component vector of float) +0:82 Constant: +0:82 0.000000 +0:83 add second child into first child (temp 4-component vector of float) +0:83 'v' (temp 4-component vector of float) +0:83 Constant: +0:83 0.000000 0:86 add second child into first child (temp 4-component vector of float) 0:86 'v' (temp 4-component vector of float) 0:86 step (global 4-component vector of float) @@ -642,6 +851,75 @@ Shader version: 130 0:96 'v' (temp 4-component vector of float) 0:96 fwidth (global 4-component vector of float) 0:96 'v' (temp 4-component vector of float) +0:101 add second child into first child (temp int) +0:101 'i' (temp int) +0:101 Absolute value (global int) +0:101 'ui' (uniform int) +0:102 add second child into first child (temp int) +0:102 'i' (temp int) +0:102 Sign (global int) +0:102 'i' (temp int) +0:103 add second child into first child (temp int) +0:103 'i' (temp int) +0:103 min (global int) +0:103 'i' (temp int) +0:103 'ui' (uniform int) +0:104 add second child into first child (temp int) +0:104 'i' (temp int) +0:104 max (global int) +0:104 'i' (temp int) +0:104 'ui' (uniform int) +0:105 add second child into first child (temp int) +0:105 'i' (temp int) +0:105 clamp (global int) +0:105 'i' (temp int) +0:105 'ui' (uniform int) +0:105 'ui' (uniform int) +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:110 Constant: +0:110 0.000000 +0:113 'u' (temp uint) +0:114 'u' (temp uint) +0:115 add second child into first child (temp uint) +0:115 'u' (temp uint) +0:115 min (global uint) +0:115 'u' (temp uint) +0:115 'uui' (uniform uint) +0:116 add second child into first child (temp uint) +0:116 'u' (temp uint) +0:116 max (global uint) +0:116 'u' (temp uint) +0:116 'uui' (uniform uint) +0:117 add second child into first child (temp uint) +0:117 'u' (temp uint) +0:117 clamp (global uint) +0:117 'u' (temp uint) +0:117 'uui' (uniform uint) +0:117 'uui' (uniform uint) +0:118 'u' (temp uint) +0:119 'u' (temp uint) +0:120 'u' (temp uint) +0:121 'i' (temp int) +0:122 'i' (temp int) +0:123 add second child into first child (temp int) +0:123 'i' (temp int) +0:123 'i' (temp int) +0:127 move second child to first child (temp bool) +0:127 'b' (temp bool) +0:127 isnan (global bool) +0:127 'uf' (uniform float) +0:128 move second child to first child (temp bool) +0:128 'b' (temp bool) +0:128 isinf (global bool) +0:128 direct index (temp float) +0:128 'v' (temp 4-component vector of float) +0:128 Constant: +0:128 1 (const int) 0:130 move second child to first child (temp bool) 0:130 'b' (temp bool) 0:130 any (global bool) @@ -868,4 +1146,6 @@ Shader version: 130 0:? 'ub42' (uniform 4-component vector of bool) 0:? 'uf' (uniform float) 0:? 'ui' (uniform int) +0:? 'uuv4' (uniform 4-component vector of uint) +0:? 'uui' (uniform uint) diff --git a/Test/baseResults/constErrors.frag.out b/Test/baseResults/constErrors.frag.out index 6f12aecd..f04c7369 100644 --- a/Test/baseResults/constErrors.frag.out +++ b/Test/baseResults/constErrors.frag.out @@ -1,14 +1,11 @@ constErrors.frag ERROR: 0:14: 'non-constant initializer' : not supported for this version or the enabled extensions -ERROR: 0:17: '' : constant expression required ERROR: 0:17: '' : array size must be a constant integer expression -ERROR: 0:18: '' : constant expression required ERROR: 0:18: '' : array size must be a constant integer expression -ERROR: 0:19: '' : constant expression required ERROR: 0:19: '' : array size must be a constant integer expression ERROR: 0:27: '=' : global const initializers must be constant 'const structure{global 3-component vector of float v3, global 2-component vector of int iv2}' ERROR: 0:33: '=' : global const initializers must be constant 'const structure{global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}' -ERROR: 9 compilation errors. No code generated. +ERROR: 6 compilation errors. No code generated. Shader version: 330 diff --git a/Test/baseResults/constFold.frag.out b/Test/baseResults/constFold.frag.out index c03d865d..f5c3e9c5 100644 --- a/Test/baseResults/constFold.frag.out +++ b/Test/baseResults/constFold.frag.out @@ -270,6 +270,14 @@ ERROR: node is still EOpNull! 0:128 76.000000 0:128 59.000000 0:128 88.000000 +0:138 Function Definition: foo4( (global void) +0:138 Function Parameters: +0:140 Sequence +0:140 Sequence +0:140 move second child to first child (temp int) +0:140 'a' (temp int) +0:140 Constant: +0:140 9 (const int) 0:? Linker Objects 0:? 'a' (const int) 0:? 1 (const int) @@ -356,6 +364,16 @@ ERROR: node is still EOpNull! 0:? 13.000000 0:? 14.000000 0:? 15.000000 +0:? 'a0' (const 3-element array of structure{global int i, global float f, global bool b}) +0:? 3 (const int) +0:? 2.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 5.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 9.000000 +0:? false (const bool) Linked fragment stage: @@ -622,6 +640,14 @@ ERROR: node is still EOpNull! 0:128 76.000000 0:128 59.000000 0:128 88.000000 +0:138 Function Definition: foo4( (global void) +0:138 Function Parameters: +0:140 Sequence +0:140 Sequence +0:140 move second child to first child (temp int) +0:140 'a' (temp int) +0:140 Constant: +0:140 9 (const int) 0:? Linker Objects 0:? 'a' (const int) 0:? 1 (const int) @@ -708,4 +734,14 @@ ERROR: node is still EOpNull! 0:? 13.000000 0:? 14.000000 0:? 15.000000 +0:? 'a0' (const 3-element array of structure{global int i, global float f, global bool b}) +0:? 3 (const int) +0:? 2.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 5.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 9.000000 +0:? false (const bool) diff --git a/Test/baseResults/nonVulkan.frag.out b/Test/baseResults/nonVulkan.frag.out new file mode 100644 index 00000000..10c693c0 --- /dev/null +++ b/Test/baseResults/nonVulkan.frag.out @@ -0,0 +1,30 @@ +nonVulkan.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:3: 'constant_id' : only allowed when generating SPIR-V +ERROR: 0:4: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:4: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:5: 'push_constant' : only allowed when using GLSL for Vulkan +ERROR: 4 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' (specialization-constant const int) +0:? 12 (const int) +0:? 'foo' (temp int) +0:? 'ubi' (layout(column_major std430 push_constant ) uniform block{layout(column_major std430 offset=0 ) uniform int a}) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' (specialization-constant const int) +0:? 12 (const int) +0:? 'foo' (temp int) +0:? 'ubi' (layout(column_major std430 push_constant ) uniform block{layout(column_major std430 offset=0 ) uniform int a}) + diff --git a/Test/baseResults/reflection.vert.out b/Test/baseResults/reflection.vert.out index 7e9d322d..43fb2340 100644 --- a/Test/baseResults/reflection.vert.out +++ b/Test/baseResults/reflection.vert.out @@ -85,7 +85,7 @@ Uniform block reflection: nameless: offset -1, type ffffffff, size 496, index -1 named: offset -1, type ffffffff, size 304, index -1 c_nameless: offset -1, type ffffffff, size 112, index -1 -nested: offset -1, type ffffffff, size 28, index -1 +nested: offset -1, type ffffffff, size 32, index -1 abl[0]: offset -1, type ffffffff, size 4, index -1 abl[1]: offset -1, type ffffffff, size 4, index -1 abl[2]: offset -1, type ffffffff, size 4, index -1 diff --git a/Test/baseResults/specExamples.vert.out b/Test/baseResults/specExamples.vert.out index bec3fb32..eb399e1b 100644 --- a/Test/baseResults/specExamples.vert.out +++ b/Test/baseResults/specExamples.vert.out @@ -1,6 +1,6 @@ specExamples.vert Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:29: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:29: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:31: 'triangles' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) ERROR: 0:31: 'invocations' : there is no such layout identifier for this stage taking an assigned value ERROR: 0:33: 'lines' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) diff --git a/Test/baseResults/spv.100ops.frag.out b/Test/baseResults/spv.100ops.frag.out index fa21783e..9b40c920 100755 --- a/Test/baseResults/spv.100ops.frag.out +++ b/Test/baseResults/spv.100ops.frag.out @@ -1,18 +1,20 @@ spv.100ops.frag +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 47 +// Id's are bound by 49 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 36 - ExecutionMode 4 OriginLowerLeft - Source ESSL 100 + EntryPoint Fragment 4 "main" 21 26 37 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 Name 4 "main" Name 8 "foo(" Name 11 "face1" @@ -20,13 +22,29 @@ Linked fragment stage: Name 17 "z" Name 21 "low" Name 26 "high" - Name 36 "gl_FragColor" + Name 37 "Color" + Decorate 8(foo() RelaxedPrecision Decorate 11(face1) RelaxedPrecision Decorate 13(face2) RelaxedPrecision Decorate 17(z) RelaxedPrecision Decorate 21(low) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 23 RelaxedPrecision + Decorate 25 RelaxedPrecision Decorate 26(high) RelaxedPrecision - Decorate 36(gl_FragColor) RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 34 RelaxedPrecision + Decorate 37(Color) RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 39 RelaxedPrecision + Decorate 40 RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 42 RelaxedPrecision + Decorate 43 RelaxedPrecision + Decorate 44 RelaxedPrecision + Decorate 45 RelaxedPrecision + Decorate 46 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -39,47 +57,48 @@ Linked fragment stage: 15: TypeInt 32 1 16: TypePointer Function 15(int) 18: 15(int) Constant 3 - 19: 15(int) Constant 2 - 20: TypePointer UniformConstant 15(int) - 21(low): 20(ptr) Variable UniformConstant - 24: 15(int) Constant 1 - 26(high): 20(ptr) Variable UniformConstant + 19: 6(float) Constant 1073741824 + 20: TypePointer Input 6(float) + 21(low): 20(ptr) Variable Input + 24: 6(float) Constant 1065353216 + 26(high): 20(ptr) Variable Input 28: TypeBool - 34: TypeVector 6(float) 4 - 35: TypePointer Output 34(fvec4) -36(gl_FragColor): 35(ptr) Variable Output + 33: 15(int) Constant 1 + 35: TypeVector 6(float) 4 + 36: TypePointer Output 35(fvec4) + 37(Color): 36(ptr) Variable Output 4(main): 2 Function None 3 5: Label 17(z): 16(ptr) Variable Function Store 11(face1) 12 Store 13(face2) 14 Store 17(z) 18 - 22: 15(int) Load 21(low) - 23: 15(int) IMul 19 22 - 25: 15(int) IAdd 23 24 - 27: 15(int) Load 26(high) - 29: 28(bool) SLessThan 25 27 + 22: 6(float) Load 21(low) + 23: 6(float) FMul 19 22 + 25: 6(float) FAdd 23 24 + 27: 6(float) Load 26(high) + 29: 28(bool) FOrdLessThan 25 27 SelectionMerge 31 None BranchConditional 29 30 31 30: Label 32: 15(int) Load 17(z) - 33: 15(int) IAdd 32 24 - Store 17(z) 33 + 34: 15(int) IAdd 32 33 + Store 17(z) 34 Branch 31 31: Label - 37: 6(float) Load 11(face1) - 38: 15(int) Load 17(z) - 39: 6(float) ConvertSToF 38 - 40: 34(fvec4) CompositeConstruct 39 39 39 39 - 41: 34(fvec4) VectorTimesScalar 40 37 - 42: 6(float) FunctionCall 8(foo() - 43: 34(fvec4) CompositeConstruct 42 42 42 42 - 44: 34(fvec4) FAdd 41 43 - Store 36(gl_FragColor) 44 + 38: 6(float) Load 11(face1) + 39: 15(int) Load 17(z) + 40: 6(float) ConvertSToF 39 + 41: 35(fvec4) CompositeConstruct 40 40 40 40 + 42: 35(fvec4) VectorTimesScalar 41 38 + 43: 6(float) FunctionCall 8(foo() + 44: 35(fvec4) CompositeConstruct 43 43 43 43 + 45: 35(fvec4) FAdd 42 44 + Store 37(Color) 45 Return FunctionEnd 8(foo(): 6(float) Function None 7 9: Label - 45: 6(float) Load 13(face2) - ReturnValue 45 + 46: 6(float) Load 13(face2) + ReturnValue 46 FunctionEnd diff --git a/Test/baseResults/spv.130.frag.out b/Test/baseResults/spv.130.frag.out index f4fb19b7..8d881f50 100644 --- a/Test/baseResults/spv.130.frag.out +++ b/Test/baseResults/spv.130.frag.out @@ -1,5 +1,5 @@ spv.130.frag -WARNING: 0:34: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 +WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 Linked fragment stage: @@ -7,14 +7,19 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 214 +// Id's are bound by 205 Capability Shader + Capability ClipDistance + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 17 68 79 99 173 184 185 186 187 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 17 68 79 99 173 184 185 186 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 SourceExtension "GL_ARB_gpu_shader5" SourceExtension "GL_ARB_shader_texture_lod" SourceExtension "GL_ARB_shading_language_420pack" @@ -50,21 +55,31 @@ Linked fragment stage: Name 184 "fflat" Name 185 "fsmooth" Name 186 "fnop" - Name 187 "gl_Color" - Name 194 "bounds" - Name 195 "s2D" - Name 196 "s2DR" - Name 200 "s2DRS" - Name 204 "s1D" - Name 205 "s2DS" - Name 207 "f" - Name 209 "v2" - Name 211 "v3" - Name 213 "v4" + Name 193 "bounds" + Name 194 "s2D" + Name 195 "s2DR" + Name 199 "s2DRS" + Name 203 "s1D" + Name 204 "s2DS" + Decorate 21(samp2D) DescriptorSet 0 + Decorate 37(samp2DA) DescriptorSet 0 + Decorate 47(samp2DR) DescriptorSet 0 + Decorate 55(samp2DS) DescriptorSet 0 + Decorate 72(Sca) DescriptorSet 0 + Decorate 87(Isca) DescriptorSet 0 + Decorate 103(Usca) DescriptorSet 0 + Decorate 118(Scas) DescriptorSet 0 + Decorate 167(sampC) DescriptorSet 0 Decorate 173(gl_ClipDistance) BuiltIn ClipDistance Decorate 184(fflat) Flat Decorate 186(fnop) NoPerspective - Decorate 194(bounds) Binding 0 + Decorate 193(bounds) DescriptorSet 0 + Decorate 193(bounds) Binding 0 + Decorate 194(s2D) DescriptorSet 0 + Decorate 195(s2DR) DescriptorSet 0 + Decorate 199(s2DRS) DescriptorSet 0 + Decorate 203(s1D) DescriptorSet 0 + Decorate 204(s2DS) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 14: TypeFloat 32 @@ -155,33 +170,24 @@ Linked fragment stage: 184(fflat): 128(ptr) Variable Input 185(fsmooth): 128(ptr) Variable Input 186(fnop): 128(ptr) Variable Input - 187(gl_Color): 78(ptr) Variable Input - 188: 96(int) Constant 3 - 189: TypeArray 26(int) 188 - 190: 26(int) Constant 10 - 191: 26(int) Constant 23 - 192: 26(int) Constant 32 - 193: 189 ConstantComposite 190 191 192 - 194(bounds): 20(ptr) Variable UniformConstant - 195(s2D): 20(ptr) Variable UniformConstant - 196(s2DR): 46(ptr) Variable UniformConstant - 197: TypeImage 14(float) Rect depth sampled format:Unknown - 198: TypeSampledImage 197 - 199: TypePointer UniformConstant 198 - 200(s2DRS): 199(ptr) Variable UniformConstant - 201: TypeImage 14(float) 1D sampled format:Unknown - 202: TypeSampledImage 201 - 203: TypePointer UniformConstant 202 - 204(s1D): 203(ptr) Variable UniformConstant - 205(s2DS): 54(ptr) Variable UniformConstant - 206: TypePointer UniformConstant 14(float) - 207(f): 206(ptr) Variable UniformConstant - 208: TypePointer UniformConstant 23(fvec2) - 209(v2): 208(ptr) Variable UniformConstant - 210: TypePointer UniformConstant 39(fvec3) - 211(v3): 210(ptr) Variable UniformConstant - 212: TypePointer UniformConstant 15(fvec4) - 213(v4): 212(ptr) Variable UniformConstant + 187: 96(int) Constant 3 + 188: TypeArray 26(int) 187 + 189: 26(int) Constant 10 + 190: 26(int) Constant 23 + 191: 26(int) Constant 32 + 192: 188 ConstantComposite 189 190 191 + 193(bounds): 20(ptr) Variable UniformConstant + 194(s2D): 20(ptr) Variable UniformConstant + 195(s2DR): 46(ptr) Variable UniformConstant + 196: TypeImage 14(float) Rect depth sampled format:Unknown + 197: TypeSampledImage 196 + 198: TypePointer UniformConstant 197 + 199(s2DRS): 198(ptr) Variable UniformConstant + 200: TypeImage 14(float) 1D sampled format:Unknown + 201: TypeSampledImage 200 + 202: TypePointer UniformConstant 201 + 203(s1D): 202(ptr) Variable UniformConstant + 204(s2DS): 54(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 168: 165 Load 167(sampC) diff --git a/Test/baseResults/spv.140.frag.out b/Test/baseResults/spv.140.frag.out index e54dda6c..f302478c 100755 --- a/Test/baseResults/spv.140.frag.out +++ b/Test/baseResults/spv.140.frag.out @@ -5,13 +5,17 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 100 +// Id's are bound by 101 Capability Shader + Capability ClipDistance + Capability SampledRect + Capability SampledBuffer + Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 16 28 33 43 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "foo(" @@ -23,40 +27,45 @@ Linked fragment stage: Name 43 "k" Name 55 "sampR" Name 63 "sampB" - Name 86 "samp2Da" - Name 91 "bn" - MemberName 91(bn) 0 "matra" - MemberName 91(bn) 1 "matca" - MemberName 91(bn) 2 "matr" - MemberName 91(bn) 3 "matc" - MemberName 91(bn) 4 "matrdef" - Name 93 "" - Name 96 "bi" - MemberName 96(bi) 0 "v" - Name 99 "bname" + Name 87 "samp2Da" + Name 92 "bn" + MemberName 92(bn) 0 "matra" + MemberName 92(bn) 1 "matca" + MemberName 92(bn) 2 "matr" + MemberName 92(bn) 3 "matc" + MemberName 92(bn) 4 "matrdef" + Name 94 "" + Name 97 "bi" + MemberName 97(bi) 0 "v" + Name 100 "bname" Decorate 16(gl_FrontFacing) BuiltIn FrontFacing Decorate 33(gl_ClipDistance) BuiltIn ClipDistance - Decorate 89 ArrayStride 64 + Decorate 55(sampR) DescriptorSet 0 + Decorate 63(sampB) DescriptorSet 0 + Decorate 87(samp2Da) DescriptorSet 0 Decorate 90 ArrayStride 64 - MemberDecorate 91(bn) 0 RowMajor - MemberDecorate 91(bn) 0 Offset 0 - MemberDecorate 91(bn) 0 MatrixStride 16 - MemberDecorate 91(bn) 1 ColMajor - MemberDecorate 91(bn) 1 Offset 256 - MemberDecorate 91(bn) 1 MatrixStride 16 - MemberDecorate 91(bn) 2 RowMajor - MemberDecorate 91(bn) 2 Offset 512 - MemberDecorate 91(bn) 2 MatrixStride 16 - MemberDecorate 91(bn) 3 ColMajor - MemberDecorate 91(bn) 3 Offset 576 - MemberDecorate 91(bn) 3 MatrixStride 16 - MemberDecorate 91(bn) 4 RowMajor - MemberDecorate 91(bn) 4 Offset 640 - MemberDecorate 91(bn) 4 MatrixStride 16 - Decorate 91(bn) Block - Decorate 95 ArrayStride 16 - MemberDecorate 96(bi) 0 Offset 0 - Decorate 96(bi) Block + Decorate 91 ArrayStride 64 + MemberDecorate 92(bn) 0 RowMajor + MemberDecorate 92(bn) 0 Offset 0 + MemberDecorate 92(bn) 0 MatrixStride 16 + MemberDecorate 92(bn) 1 ColMajor + MemberDecorate 92(bn) 1 Offset 256 + MemberDecorate 92(bn) 1 MatrixStride 16 + MemberDecorate 92(bn) 2 RowMajor + MemberDecorate 92(bn) 2 Offset 512 + MemberDecorate 92(bn) 2 MatrixStride 16 + MemberDecorate 92(bn) 3 ColMajor + MemberDecorate 92(bn) 3 Offset 576 + MemberDecorate 92(bn) 3 MatrixStride 16 + MemberDecorate 92(bn) 4 RowMajor + MemberDecorate 92(bn) 4 Offset 640 + MemberDecorate 92(bn) 4 MatrixStride 16 + Decorate 92(bn) Block + Decorate 94 DescriptorSet 0 + Decorate 96 ArrayStride 16 + MemberDecorate 97(bi) 0 Offset 0 + Decorate 97(bi) Block + Decorate 100(bname) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -100,24 +109,24 @@ Linked fragment stage: 69: TypeVector 6(float) 2 72: 6(float) Constant 1120403456 74: 29(int) Constant 3 - 82: TypeImage 6(float) 2D sampled format:Unknown - 83: TypeSampledImage 82 - 84: TypeArray 83 74 - 85: TypePointer UniformConstant 84 - 86(samp2Da): 85(ptr) Variable UniformConstant - 87: TypeMatrix 26(fvec4) 4 - 88: 29(int) Constant 4 - 89: TypeArray 87 88 - 90: TypeArray 87 88 - 91(bn): TypeStruct 89 90 87 87 87 - 92: TypePointer Uniform 91(bn) - 93: 92(ptr) Variable Uniform - 94: TypeVector 6(float) 3 - 95: TypeArray 94(fvec3) 50 - 96(bi): TypeStruct 95 - 97: TypeArray 96(bi) 88 - 98: TypePointer Uniform 97 - 99(bname): 98(ptr) Variable Uniform + 83: TypeImage 6(float) 2D sampled format:Unknown + 84: TypeSampledImage 83 + 85: TypeArray 84 74 + 86: TypePointer UniformConstant 85 + 87(samp2Da): 86(ptr) Variable UniformConstant + 88: TypeMatrix 26(fvec4) 4 + 89: 29(int) Constant 4 + 90: TypeArray 88 89 + 91: TypeArray 88 89 + 92(bn): TypeStruct 90 91 88 88 88 + 93: TypePointer Uniform 92(bn) + 94: 93(ptr) Variable Uniform + 95: TypeVector 6(float) 3 + 96: TypeArray 95(fvec3) 50 + 97(bi): TypeStruct 96 + 98: TypeArray 97(bi) 89 + 99: TypePointer Uniform 98 + 100(bname): 99(ptr) Variable Uniform 4(main): 2 Function None 3 5: Label 13: 12(ptr) Variable Function diff --git a/Test/baseResults/spv.150.geom.out b/Test/baseResults/spv.150.geom.out index 31fda5fc..b09f0c04 100755 --- a/Test/baseResults/spv.150.geom.out +++ b/Test/baseResults/spv.150.geom.out @@ -8,6 +8,9 @@ Linked geometry stage: // Id's are bound by 71 Capability Geometry + Capability GeometryPointSize + Capability ClipDistance + Capability GeometryStreams 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Geometry 4 "main" 10 18 29 33 47 49 51 70 diff --git a/Test/baseResults/spv.150.vert.out b/Test/baseResults/spv.150.vert.out index 8767bf80..5ccf1a81 100755 --- a/Test/baseResults/spv.150.vert.out +++ b/Test/baseResults/spv.150.vert.out @@ -5,12 +5,13 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 50 +// Id's are bound by 63 Capability Shader + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 13 17 39 48 49 + EntryPoint Vertex 4 "main" 13 17 23 38 62 Source GLSL 150 Name 4 "main" Name 11 "gl_PerVertex" @@ -20,25 +21,23 @@ Linked vertex stage: Name 13 "" Name 17 "iv4" Name 23 "ps" - Name 35 "s1" - MemberName 35(s1) 0 "a" - MemberName 35(s1) 1 "a2" - MemberName 35(s1) 2 "b" - Name 37 "s2" - MemberName 37(s2) 0 "c" - MemberName 37(s2) 1 "d" - Name 39 "s2out" - Name 41 "i" - Name 46 "ui" - Name 48 "gl_VertexID" - Name 49 "gl_InstanceID" + Name 34 "s1" + MemberName 34(s1) 0 "a" + MemberName 34(s1) 1 "a2" + MemberName 34(s1) 2 "b" + Name 36 "s2" + MemberName 36(s2) 0 "c" + MemberName 36(s2) 1 "d" + Name 38 "s2out" + Name 40 "i" + Name 47 "s2D" + Name 62 "ui" 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 + Decorate 47(s2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -55,41 +54,54 @@ Linked vertex stage: 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 + 22: TypePointer Input 6(float) + 23(ps): 22(ptr) Variable Input 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 14(int) 14(int) 34 - 36: TypeArray 35(s1) 9 - 37(s2): TypeStruct 14(int) 36 - 38: TypePointer Output 37(s2) - 39(s2out): 38(ptr) Variable Output - 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 + 32: 8(int) Constant 3 + 33: TypeArray 7(fvec4) 32 + 34(s1): TypeStruct 14(int) 14(int) 33 + 35: TypeArray 34(s1) 9 + 36(s2): TypeStruct 14(int) 35 + 37: TypePointer Output 36(s2) + 38(s2out): 37(ptr) Variable Output + 39: TypePointer Function 14(int) + 44: TypeImage 6(float) 2D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s2D): 46(ptr) Variable UniformConstant + 49: TypeVector 6(float) 2 + 50: 6(float) Constant 1056964608 + 51: 49(fvec2) ConstantComposite 50 50 + 52: 6(float) Constant 0 + 55: TypeVector 6(float) 3 + 56: 55(fvec3) ConstantComposite 50 50 50 + 59: 6(float) Constant 1078774989 + 61: TypePointer Input 14(int) + 62(ui): 61(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 41(i): 40(ptr) Variable Function + 40(i): 39(ptr) Variable Function 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: 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 + 29: 22(ptr) AccessChain 17(iv4) 28 + 30: 6(float) Load 29 + 31: 25(ptr) AccessChain 13 27 27 + Store 31 30 + 41: 14(int) Load 40(i) + 42: 6(float) Load 23(ps) + 43: 25(ptr) AccessChain 38(s2out) 21 41 27 27 32 + Store 43 42 + 48: 45 Load 47(s2D) + 53: 7(fvec4) ImageSampleExplicitLod 48 51 Lod 52 + 54: 45 Load 47(s2D) + 57: 7(fvec4) ImageSampleProjExplicitLod 54 56 Lod 52 + 58: 45 Load 47(s2D) + 60: 7(fvec4) ImageSampleExplicitLod 58 51 Lod 59 Return FunctionEnd diff --git a/Test/baseResults/spv.300BuiltIns.vert.out b/Test/baseResults/spv.300BuiltIns.vert.out index de5b61c4..ab07f4a8 100755 --- a/Test/baseResults/spv.300BuiltIns.vert.out +++ b/Test/baseResults/spv.300BuiltIns.vert.out @@ -1,76 +1,79 @@ spv.300BuiltIns.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 40 +// Id's are bound by 42 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 11 23 25 33 39 - Source ESSL 300 + EntryPoint Vertex 4 "main" 10 14 21 34 + Source ESSL 310 Name 4 "main" - Name 8 "i" - Name 11 "gl_VertexID" - Name 16 "j" - Name 23 "gl_Position" - Name 25 "ps" - Name 33 "gl_PointSize" - Name 39 "gl_InstanceID" - Decorate 8(i) RelaxedPrecision - Decorate 11(gl_VertexID) BuiltIn VertexId - Decorate 16(j) RelaxedPrecision - Decorate 23(gl_Position) Invariant - Decorate 23(gl_Position) BuiltIn Position - Decorate 25(ps) RelaxedPrecision - Decorate 33(gl_PointSize) BuiltIn PointSize - Decorate 39(gl_InstanceID) BuiltIn InstanceId + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + MemberName 8(gl_PerVertex) 1 "gl_PointSize" + Name 10 "" + Name 14 "ps" + Name 21 "gl_VertexIndex" + Name 34 "gl_InstanceIndex" + MemberDecorate 8(gl_PerVertex) 0 Invariant + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize + Decorate 8(gl_PerVertex) Block + Decorate 14(ps) RelaxedPrecision + Decorate 15 RelaxedPrecision + Decorate 21(gl_VertexIndex) BuiltIn VertexIndex + Decorate 30 RelaxedPrecision + Decorate 34(gl_InstanceIndex) BuiltIn InstanceIndex 2: TypeVoid 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 4 - 10: TypePointer Input 6(int) - 11(gl_VertexID): 10(ptr) Variable Input - 14: 6(int) Constant 10 - 20: TypeFloat 32 - 21: TypeVector 20(float) 4 - 22: TypePointer Output 21(fvec4) - 23(gl_Position): 22(ptr) Variable Output - 24: TypePointer Input 20(float) - 25(ps): 24(ptr) Variable Input - 32: TypePointer Output 20(float) -33(gl_PointSize): 32(ptr) Variable Output -39(gl_InstanceID): 10(ptr) Variable Input + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) 6(float) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 6(float) + 14(ps): 13(ptr) Variable Input + 17: TypePointer Output 7(fvec4) + 19: 11(int) Constant 4 + 20: TypePointer Input 11(int) +21(gl_VertexIndex): 20(ptr) Variable Input + 29: 11(int) Constant 1 + 31: TypePointer Output 6(float) + 33: 11(int) Constant 5 +34(gl_InstanceIndex): 20(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 8(i): 7(ptr) Variable Function - 16(j): 7(ptr) Variable Function - 12: 6(int) Load 11(gl_VertexID) - 13: 6(int) IMul 9 12 - 15: 6(int) ISub 13 14 - Store 8(i) 15 - 17: 6(int) Load 11(gl_VertexID) - 18: 6(int) IMul 9 17 - 19: 6(int) ISub 18 14 - Store 16(j) 19 - 26: 20(float) Load 25(ps) - 27: 21(fvec4) CompositeConstruct 26 26 26 26 - Store 23(gl_Position) 27 - 28: 6(int) Load 8(i) - 29: 20(float) ConvertSToF 28 - 30: 21(fvec4) Load 23(gl_Position) - 31: 21(fvec4) VectorTimesScalar 30 29 - Store 23(gl_Position) 31 - 34: 20(float) Load 25(ps) - Store 33(gl_PointSize) 34 - 35: 6(int) Load 16(j) - 36: 20(float) ConvertSToF 35 - 37: 20(float) Load 33(gl_PointSize) - 38: 20(float) FMul 37 36 - Store 33(gl_PointSize) 38 + 15: 6(float) Load 14(ps) + 16: 7(fvec4) CompositeConstruct 15 15 15 15 + 18: 17(ptr) AccessChain 10 12 + Store 18 16 + 22: 11(int) Load 21(gl_VertexIndex) + 23: 11(int) ISub 19 22 + 24: 6(float) ConvertSToF 23 + 25: 17(ptr) AccessChain 10 12 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) VectorTimesScalar 26 24 + 28: 17(ptr) AccessChain 10 12 + Store 28 27 + 30: 6(float) Load 14(ps) + 32: 31(ptr) AccessChain 10 29 + Store 32 30 + 35: 11(int) Load 34(gl_InstanceIndex) + 36: 11(int) ISub 33 35 + 37: 6(float) ConvertSToF 36 + 38: 31(ptr) AccessChain 10 29 + 39: 6(float) Load 38 + 40: 6(float) FMul 39 37 + 41: 31(ptr) AccessChain 10 29 + Store 41 40 Return FunctionEnd diff --git a/Test/baseResults/spv.300layout.frag.out b/Test/baseResults/spv.300layout.frag.out index e08f1e92..e340c1b2 100755 --- a/Test/baseResults/spv.300layout.frag.out +++ b/Test/baseResults/spv.300layout.frag.out @@ -1,4 +1,6 @@ spv.300layout.frag +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: @@ -11,8 +13,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 9 11 15 26 29 - ExecutionMode 4 OriginLowerLeft - Source ESSL 300 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 Name 4 "main" Name 9 "c" Name 11 "color" @@ -25,11 +27,17 @@ Linked fragment stage: Decorate 9(c) RelaxedPrecision Decorate 9(c) Location 7 Decorate 11(color) RelaxedPrecision + Decorate 12 RelaxedPrecision MemberDecorate 13(S) 0 RelaxedPrecision MemberDecorate 13(S) 1 RelaxedPrecision + Decorate 19 RelaxedPrecision + Decorate 20 RelaxedPrecision Decorate 26(p) RelaxedPrecision Decorate 26(p) Location 3 Decorate 29(pos) RelaxedPrecision + Decorate 30 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 34 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.300layout.vert.out b/Test/baseResults/spv.300layout.vert.out index 02e15a71..859794a3 100644 --- a/Test/baseResults/spv.300layout.vert.out +++ b/Test/baseResults/spv.300layout.vert.out @@ -1,17 +1,19 @@ spv.300layout.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 165 +// Id's are bound by 163 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 99 101 109 121 129 163 164 - Source ESSL 300 + EntryPoint Vertex 4 "main" 9 11 98 100 108 114 120 128 + Source ESSL 310 Name 4 "main" Name 9 "pos" Name 11 "p" @@ -27,21 +29,19 @@ Linked vertex stage: MemberName 45(T3) 2 "N2" MemberName 45(T3) 3 "uv3a" Name 47 "" - Name 79 "T2" - MemberName 79(T2) 0 "b" - MemberName 79(T2) 1 "t2m" - Name 81 "" - Name 99 "color" - Name 101 "c" - Name 109 "iout" - Name 115 "uiuin" - Name 121 "aiv2" - Name 127 "S" - MemberName 127(S) 0 "c" - MemberName 127(S) 1 "f" - Name 129 "s" - Name 163 "gl_VertexID" - Name 164 "gl_InstanceID" + Name 78 "T2" + MemberName 78(T2) 0 "b" + MemberName 78(T2) 1 "t2m" + Name 80 "" + Name 98 "color" + Name 100 "c" + Name 108 "iout" + Name 114 "uiuin" + Name 120 "aiv2" + Name 126 "S" + MemberName 126(S) 0 "c" + MemberName 126(S) 1 "f" + Name 128 "s" Decorate 11(p) Location 3 MemberDecorate 17(Transform) 0 RowMajor MemberDecorate 17(Transform) 0 Offset 0 @@ -54,19 +54,29 @@ Linked vertex stage: MemberDecorate 17(Transform) 2 MatrixStride 16 MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 44 ArrayStride 16 MemberDecorate 45(T3) 0 ColMajor + MemberDecorate 45(T3) 0 Offset 0 + MemberDecorate 45(T3) 0 MatrixStride 16 MemberDecorate 45(T3) 1 RowMajor + MemberDecorate 45(T3) 1 Offset 64 + MemberDecorate 45(T3) 1 MatrixStride 16 MemberDecorate 45(T3) 2 ColMajor - Decorate 45(T3) GLSLShared + MemberDecorate 45(T3) 2 Offset 128 + MemberDecorate 45(T3) 2 MatrixStride 16 + MemberDecorate 45(T3) 3 Offset 160 Decorate 45(T3) Block - MemberDecorate 79(T2) 1 RowMajor - Decorate 79(T2) GLSLShared - Decorate 79(T2) Block - Decorate 101(c) Location 7 - Decorate 109(iout) Flat - Decorate 121(aiv2) Location 9 - Decorate 163(gl_VertexID) BuiltIn VertexId - Decorate 164(gl_InstanceID) BuiltIn InstanceId + Decorate 47 DescriptorSet 0 + MemberDecorate 78(T2) 0 Offset 0 + MemberDecorate 78(T2) 1 RowMajor + MemberDecorate 78(T2) 1 Offset 16 + MemberDecorate 78(T2) 1 MatrixStride 16 + Decorate 78(T2) Block + Decorate 80 DescriptorSet 0 + Decorate 100(c) Location 7 + Decorate 108(iout) Flat + Decorate 120(aiv2) Location 9 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -93,42 +103,40 @@ Linked vertex stage: 45(T3): TypeStruct 13 13 40 44 46: TypePointer Uniform 45(T3) 47: 46(ptr) Variable Uniform - 78: TypeBool - 79(T2): TypeStruct 78(bool) 13 - 80: TypePointer Uniform 79(T2) - 81: 80(ptr) Variable Uniform - 98: TypePointer Output 14(fvec3) - 99(color): 98(ptr) Variable Output - 100: TypePointer Input 14(fvec3) - 101(c): 100(ptr) Variable Input - 103: 16(int) Constant 2 - 104: TypePointer Uniform 15 - 108: TypePointer Output 16(int) - 109(iout): 108(ptr) Variable Output - 110: 16(int) Constant 3 - 111: TypePointer Uniform 16(int) - 114: TypePointer UniformConstant 41(int) - 115(uiuin): 114(ptr) Variable UniformConstant - 119: TypeVector 16(int) 2 - 120: TypePointer Input 119(ivec2) - 121(aiv2): 120(ptr) Variable Input - 122: 41(int) Constant 1 - 123: TypePointer Input 16(int) - 127(S): TypeStruct 14(fvec3) 6(float) - 128: TypePointer Output 127(S) - 129(s): 128(ptr) Variable Output - 132: 41(int) Constant 0 - 133: TypePointer Input 6(float) - 136: TypePointer Output 6(float) + 78(T2): TypeStruct 41(int) 13 + 79: TypePointer Uniform 78(T2) + 80: 79(ptr) Variable Uniform + 97: TypePointer Output 14(fvec3) + 98(color): 97(ptr) Variable Output + 99: TypePointer Input 14(fvec3) + 100(c): 99(ptr) Variable Input + 102: 16(int) Constant 2 + 103: TypePointer Uniform 15 + 107: TypePointer Output 16(int) + 108(iout): 107(ptr) Variable Output + 109: 16(int) Constant 3 + 110: TypePointer Uniform 16(int) + 113: TypePointer Input 41(int) + 114(uiuin): 113(ptr) Variable Input + 118: TypeVector 16(int) 2 + 119: TypePointer Input 118(ivec2) + 120(aiv2): 119(ptr) Variable Input + 121: 41(int) Constant 1 + 122: TypePointer Input 16(int) + 126(S): TypeStruct 14(fvec3) 6(float) + 127: TypePointer Output 126(S) + 128(s): 127(ptr) Variable Output + 131: 41(int) Constant 0 + 132: TypePointer Input 6(float) + 135: TypePointer Output 6(float) + 137: TypeBool 138: TypePointer Uniform 14(fvec3) 141: 6(float) Constant 1065353216 142: 14(fvec3) ConstantComposite 141 141 141 - 143: TypeVector 78(bool) 3 + 143: TypeVector 137(bool) 3 149: TypePointer Uniform 42(ivec3) 152: 41(int) Constant 5 153: 42(ivec3) ConstantComposite 152 152 152 -163(gl_VertexID): 123(ptr) Variable Input -164(gl_InstanceID): 123(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(p) @@ -179,63 +187,63 @@ Linked vertex stage: 75: 7(fvec4) CompositeExtract 64 3 76: 7(fvec4) FAdd 74 75 77: 13 CompositeConstruct 67 70 73 76 - 82: 21(ptr) AccessChain 81 24 - 83: 13 Load 82 - 84: 7(fvec4) CompositeExtract 77 0 - 85: 7(fvec4) CompositeExtract 83 0 - 86: 7(fvec4) FAdd 84 85 - 87: 7(fvec4) CompositeExtract 77 1 - 88: 7(fvec4) CompositeExtract 83 1 - 89: 7(fvec4) FAdd 87 88 - 90: 7(fvec4) CompositeExtract 77 2 - 91: 7(fvec4) CompositeExtract 83 2 - 92: 7(fvec4) FAdd 90 91 - 93: 7(fvec4) CompositeExtract 77 3 - 94: 7(fvec4) CompositeExtract 83 3 - 95: 7(fvec4) FAdd 93 94 - 96: 13 CompositeConstruct 86 89 92 95 - 97: 7(fvec4) VectorTimesMatrix 12 96 - Store 9(pos) 97 - 102: 14(fvec3) Load 101(c) - 105: 104(ptr) AccessChain 19(tblock) 103 - 106: 15 Load 105 - 107: 14(fvec3) VectorTimesMatrix 102 106 - Store 99(color) 107 - 112: 111(ptr) AccessChain 19(tblock) 110 - 113: 16(int) Load 112 - 116: 41(int) Load 115(uiuin) - 117: 16(int) Bitcast 116 - 118: 16(int) IAdd 113 117 - 124: 123(ptr) AccessChain 121(aiv2) 122 - 125: 16(int) Load 124 - 126: 16(int) IAdd 118 125 - Store 109(iout) 126 - 130: 14(fvec3) Load 101(c) - 131: 98(ptr) AccessChain 129(s) 20 - Store 131 130 - 134: 133(ptr) AccessChain 11(p) 132 - 135: 6(float) Load 134 - 137: 136(ptr) AccessChain 129(s) 24 - Store 137 135 - 139: 138(ptr) AccessChain 47 103 24 + 81: 21(ptr) AccessChain 80 24 + 82: 13 Load 81 + 83: 7(fvec4) CompositeExtract 77 0 + 84: 7(fvec4) CompositeExtract 82 0 + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) CompositeExtract 77 1 + 87: 7(fvec4) CompositeExtract 82 1 + 88: 7(fvec4) FAdd 86 87 + 89: 7(fvec4) CompositeExtract 77 2 + 90: 7(fvec4) CompositeExtract 82 2 + 91: 7(fvec4) FAdd 89 90 + 92: 7(fvec4) CompositeExtract 77 3 + 93: 7(fvec4) CompositeExtract 82 3 + 94: 7(fvec4) FAdd 92 93 + 95: 13 CompositeConstruct 85 88 91 94 + 96: 7(fvec4) VectorTimesMatrix 12 95 + Store 9(pos) 96 + 101: 14(fvec3) Load 100(c) + 104: 103(ptr) AccessChain 19(tblock) 102 + 105: 15 Load 104 + 106: 14(fvec3) VectorTimesMatrix 101 105 + Store 98(color) 106 + 111: 110(ptr) AccessChain 19(tblock) 109 + 112: 16(int) Load 111 + 115: 41(int) Load 114(uiuin) + 116: 16(int) Bitcast 115 + 117: 16(int) IAdd 112 116 + 123: 122(ptr) AccessChain 120(aiv2) 121 + 124: 16(int) Load 123 + 125: 16(int) IAdd 117 124 + Store 108(iout) 125 + 129: 14(fvec3) Load 100(c) + 130: 97(ptr) AccessChain 128(s) 20 + Store 130 129 + 133: 132(ptr) AccessChain 11(p) 131 + 134: 6(float) Load 133 + 136: 135(ptr) AccessChain 128(s) 24 + Store 136 134 + 139: 138(ptr) AccessChain 47 102 24 140: 14(fvec3) Load 139 144: 143(bvec3) FOrdNotEqual 140 142 - 145: 78(bool) Any 144 - 146: 78(bool) LogicalNot 145 + 145: 137(bool) Any 144 + 146: 137(bool) LogicalNot 145 SelectionMerge 148 None BranchConditional 146 147 148 147: Label - 150: 149(ptr) AccessChain 47 110 103 + 150: 149(ptr) AccessChain 47 109 102 151: 42(ivec3) Load 150 154: 143(bvec3) INotEqual 151 153 - 155: 78(bool) Any 154 + 155: 137(bool) Any 154 Branch 148 148: Label - 156: 78(bool) Phi 145 5 155 147 + 156: 137(bool) Phi 145 5 155 147 SelectionMerge 158 None BranchConditional 156 157 158 157: Label - 159: 98(ptr) AccessChain 129(s) 20 + 159: 97(ptr) AccessChain 128(s) 20 160: 14(fvec3) Load 159 161: 14(fvec3) CompositeConstruct 141 141 141 162: 14(fvec3) FAdd 160 161 diff --git a/Test/baseResults/spv.300layoutp.vert.out b/Test/baseResults/spv.300layoutp.vert.out index b5580b5c..ebad9635 100755 --- a/Test/baseResults/spv.300layoutp.vert.out +++ b/Test/baseResults/spv.300layoutp.vert.out @@ -1,17 +1,19 @@ spv.300layoutp.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 117 +// Id's are bound by 115 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 51 53 61 73 81 115 116 - Source ESSL 300 + EntryPoint Vertex 4 "main" 9 11 50 52 60 72 80 + Source ESSL 310 Name 4 "main" Name 9 "pos" Name 11 "p" @@ -27,21 +29,19 @@ Linked vertex stage: MemberName 33(T3) 2 "N2" MemberName 33(T3) 3 "uv3a" Name 35 "" - Name 43 "T2" - MemberName 43(T2) 0 "b" - MemberName 43(T2) 1 "t2m" - Name 45 "" - Name 51 "color" - Name 53 "c" - Name 61 "iout" - Name 67 "uiuin" - Name 73 "aiv2" - Name 79 "S" - MemberName 79(S) 0 "c" - MemberName 79(S) 1 "f" - Name 81 "s" - Name 115 "gl_VertexID" - Name 116 "gl_InstanceID" + Name 42 "T2" + MemberName 42(T2) 0 "b" + MemberName 42(T2) 1 "t2m" + Name 44 "" + Name 50 "color" + Name 52 "c" + Name 60 "iout" + Name 66 "uiuin" + Name 72 "aiv2" + Name 78 "S" + MemberName 78(S) 0 "c" + MemberName 78(S) 1 "f" + Name 80 "s" Decorate 11(p) Location 3 MemberDecorate 17(Transform) 0 RowMajor MemberDecorate 17(Transform) 0 Offset 0 @@ -54,19 +54,29 @@ Linked vertex stage: MemberDecorate 17(Transform) 2 MatrixStride 16 MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 32 ArrayStride 16 MemberDecorate 33(T3) 0 ColMajor + MemberDecorate 33(T3) 0 Offset 0 + MemberDecorate 33(T3) 0 MatrixStride 16 MemberDecorate 33(T3) 1 RowMajor + MemberDecorate 33(T3) 1 Offset 64 + MemberDecorate 33(T3) 1 MatrixStride 16 MemberDecorate 33(T3) 2 ColMajor - Decorate 33(T3) GLSLShared + MemberDecorate 33(T3) 2 Offset 128 + MemberDecorate 33(T3) 2 MatrixStride 16 + MemberDecorate 33(T3) 3 Offset 160 Decorate 33(T3) Block - MemberDecorate 43(T2) 1 RowMajor - Decorate 43(T2) GLSLShared - Decorate 43(T2) Block - Decorate 53(c) Location 7 - Decorate 61(iout) Flat - Decorate 73(aiv2) Location 9 - Decorate 115(gl_VertexID) BuiltIn VertexId - Decorate 116(gl_InstanceID) BuiltIn InstanceId + Decorate 35 DescriptorSet 0 + MemberDecorate 42(T2) 0 Offset 0 + MemberDecorate 42(T2) 1 RowMajor + MemberDecorate 42(T2) 1 Offset 16 + MemberDecorate 42(T2) 1 MatrixStride 16 + Decorate 42(T2) Block + Decorate 44 DescriptorSet 0 + Decorate 52(c) Location 7 + Decorate 60(iout) Flat + Decorate 72(aiv2) Location 9 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -93,42 +103,40 @@ Linked vertex stage: 33(T3): TypeStruct 13 13 28 32 34: TypePointer Uniform 33(T3) 35: 34(ptr) Variable Uniform - 42: TypeBool - 43(T2): TypeStruct 42(bool) 13 - 44: TypePointer Uniform 43(T2) - 45: 44(ptr) Variable Uniform - 50: TypePointer Output 14(fvec3) - 51(color): 50(ptr) Variable Output - 52: TypePointer Input 14(fvec3) - 53(c): 52(ptr) Variable Input - 55: 16(int) Constant 2 - 56: TypePointer Uniform 15 - 60: TypePointer Output 16(int) - 61(iout): 60(ptr) Variable Output - 62: 16(int) Constant 3 - 63: TypePointer Uniform 16(int) - 66: TypePointer UniformConstant 29(int) - 67(uiuin): 66(ptr) Variable UniformConstant - 71: TypeVector 16(int) 2 - 72: TypePointer Input 71(ivec2) - 73(aiv2): 72(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) + 42(T2): TypeStruct 29(int) 13 + 43: TypePointer Uniform 42(T2) + 44: 43(ptr) Variable Uniform + 49: TypePointer Output 14(fvec3) + 50(color): 49(ptr) Variable Output + 51: TypePointer Input 14(fvec3) + 52(c): 51(ptr) Variable Input + 54: 16(int) Constant 2 + 55: TypePointer Uniform 15 + 59: TypePointer Output 16(int) + 60(iout): 59(ptr) Variable Output + 61: 16(int) Constant 3 + 62: TypePointer Uniform 16(int) + 65: TypePointer Private 29(int) + 66(uiuin): 65(ptr) Variable Private + 70: TypeVector 16(int) 2 + 71: TypePointer Input 70(ivec2) + 72(aiv2): 71(ptr) Variable Input + 73: 29(int) Constant 1 + 74: TypePointer Input 16(int) + 78(S): TypeStruct 14(fvec3) 6(float) + 79: TypePointer Output 78(S) + 80(s): 79(ptr) Variable Output + 83: 29(int) Constant 0 + 84: TypePointer Input 6(float) + 87: TypePointer Output 6(float) + 89: TypeBool 90: TypePointer Uniform 14(fvec3) 93: 6(float) Constant 1065353216 94: 14(fvec3) ConstantComposite 93 93 93 - 95: TypeVector 42(bool) 3 + 95: TypeVector 89(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) @@ -143,51 +151,51 @@ Linked vertex stage: 39: 21(ptr) AccessChain 35 20 40: 13 Load 39 41: 13 MatrixTimesMatrix 38 40 - 46: 21(ptr) AccessChain 45 24 - 47: 13 Load 46 - 48: 13 MatrixTimesMatrix 41 47 - 49: 7(fvec4) VectorTimesMatrix 12 48 - Store 9(pos) 49 - 54: 14(fvec3) Load 53(c) - 57: 56(ptr) AccessChain 19(tblock) 55 - 58: 15 Load 57 - 59: 14(fvec3) VectorTimesMatrix 54 58 - Store 51(color) 59 - 64: 63(ptr) AccessChain 19(tblock) 62 - 65: 16(int) Load 64 - 68: 29(int) Load 67(uiuin) - 69: 16(int) Bitcast 68 - 70: 16(int) IAdd 65 69 - 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 + 45: 21(ptr) AccessChain 44 24 + 46: 13 Load 45 + 47: 13 MatrixTimesMatrix 41 46 + 48: 7(fvec4) VectorTimesMatrix 12 47 + Store 9(pos) 48 + 53: 14(fvec3) Load 52(c) + 56: 55(ptr) AccessChain 19(tblock) 54 + 57: 15 Load 56 + 58: 14(fvec3) VectorTimesMatrix 53 57 + Store 50(color) 58 + 63: 62(ptr) AccessChain 19(tblock) 61 + 64: 16(int) Load 63 + 67: 29(int) Load 66(uiuin) + 68: 16(int) Bitcast 67 + 69: 16(int) IAdd 64 68 + 75: 74(ptr) AccessChain 72(aiv2) 73 + 76: 16(int) Load 75 + 77: 16(int) IAdd 69 76 + Store 60(iout) 77 + 81: 14(fvec3) Load 52(c) + 82: 49(ptr) AccessChain 80(s) 20 + Store 82 81 + 85: 84(ptr) AccessChain 11(p) 83 + 86: 6(float) Load 85 + 88: 87(ptr) AccessChain 80(s) 24 + Store 88 86 + 91: 90(ptr) AccessChain 35 54 24 92: 14(fvec3) Load 91 96: 95(bvec3) FOrdNotEqual 92 94 - 97: 42(bool) Any 96 - 98: 42(bool) LogicalNot 97 + 97: 89(bool) Any 96 + 98: 89(bool) LogicalNot 97 SelectionMerge 100 None BranchConditional 98 99 100 99: Label - 102: 101(ptr) AccessChain 35 62 55 + 102: 101(ptr) AccessChain 35 61 54 103: 30(ivec3) Load 102 106: 95(bvec3) INotEqual 103 105 - 107: 42(bool) Any 106 + 107: 89(bool) Any 106 Branch 100 100: Label - 108: 42(bool) Phi 97 5 107 99 + 108: 89(bool) Phi 97 5 107 99 SelectionMerge 110 None BranchConditional 108 109 110 109: Label - 111: 50(ptr) AccessChain 81(s) 20 + 111: 49(ptr) AccessChain 80(s) 20 112: 14(fvec3) Load 111 113: 14(fvec3) CompositeConstruct 93 93 93 114: 14(fvec3) FAdd 112 113 diff --git a/Test/baseResults/spv.310.comp.out b/Test/baseResults/spv.310.comp.out index 93e49b51..fa23af92 100755 --- a/Test/baseResults/spv.310.comp.out +++ b/Test/baseResults/spv.310.comp.out @@ -33,19 +33,29 @@ Linked compute stage: MemberName 48(outs) 1 "va" Name 50 "outnames" Name 53 "gl_LocalInvocationID" - Decorate 13(outb) GLSLShared + Decorate 12 ArrayStride 16 + MemberDecorate 13(outb) 0 Offset 0 + MemberDecorate 13(outb) 1 Offset 4 + MemberDecorate 13(outb) 2 Offset 8 + MemberDecorate 13(outb) 3 Offset 16 Decorate 13(outb) BufferBlock - Decorate 24(outbna) GLSLShared + Decorate 15(outbname) DescriptorSet 0 + MemberDecorate 24(outbna) 0 Offset 0 + MemberDecorate 24(outbna) 1 Offset 16 Decorate 24(outbna) BufferBlock - Decorate 48(outs) GLSLShared + Decorate 26(outbnamena) DescriptorSet 0 + Decorate 47 ArrayStride 16 + MemberDecorate 48(outs) 0 Offset 0 + MemberDecorate 48(outs) 1 Offset 16 Decorate 48(outs) BufferBlock + Decorate 50(outnames) DescriptorSet 0 Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 66 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: 6(int) Constant 1 - 8: 6(int) Constant 1023 + 8: 6(int) Constant 4062 9: 6(int) Constant 0 10: TypeFloat 32 11: TypeVector 10(float) 3 diff --git a/Test/baseResults/spv.330.geom.out b/Test/baseResults/spv.330.geom.out index fb409a9d..3077769a 100755 --- a/Test/baseResults/spv.330.geom.out +++ b/Test/baseResults/spv.330.geom.out @@ -8,6 +8,7 @@ Linked geometry stage: // Id's are bound by 32 Capability Geometry + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Geometry 4 "main" 13 20 @@ -29,8 +30,6 @@ Linked geometry stage: MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position MemberDecorate 11(gl_PerVertex) 1 BuiltIn ClipDistance Decorate 11(gl_PerVertex) Block - Decorate 11(gl_PerVertex) Stream 0 - Decorate 13 Stream 0 MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position MemberDecorate 16(gl_PerVertex) 1 BuiltIn ClipDistance Decorate 16(gl_PerVertex) Block diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 39fefd24..a851500c 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -7,168 +7,1366 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 125 +// Id's are bound by 1104 Capability Shader + Capability Float64 + Capability ClipDistance + Capability SampledRect 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 44 50 56 69 96 117 119 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 13 1025 1031 1036 1048 1074 1095 1097 + ExecutionMode 4 OriginUpperLeft 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 + Name 8 "doubles(" + Name 13 "outp" + Name 17 "u2drs" + Name 39 "doublev" + Name 43 "dvec2v" + Name 48 "dvec3v" + Name 53 "dvec4v" + Name 428 "boolv" + Name 437 "bvec2v" + Name 446 "bvec3v" + Name 455 "bvec4v" + Name 737 "dmat2v" + Name 743 "dmat3v" + Name 749 "dmat4v" + Name 755 "dmat2x3v" + Name 761 "dmat3x2v" + Name 767 "dmat2x4v" + Name 773 "dmat4x2v" + Name 779 "dmat3x4v" + Name 785 "dmat4x3v" + Name 1017 "v" + Name 1023 "arrayedSampler" + Name 1025 "i" + Name 1031 "c2D" + Name 1036 "gl_ClipDistance" + Name 1048 "uoutp" + Name 1052 "samp2dr" + Name 1074 "ioutp" + Name 1078 "isamp2DA" + Name 1095 "gl_FragCoord" + Name 1097 "vl2" + Decorate 17(u2drs) DescriptorSet 0 + Decorate 1023(arrayedSampler) DescriptorSet 0 + Decorate 1025(i) Flat + Decorate 1036(gl_ClipDistance) BuiltIn ClipDistance + Decorate 1052(samp2dr) DescriptorSet 0 + Decorate 1078(isamp2DA) DescriptorSet 0 + Decorate 1095(gl_FragCoord) BuiltIn FragCoord + Decorate 1097(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 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Output 11(fvec4) + 13(outp): 12(ptr) Variable Output + 14: TypeImage 10(float) Rect depth sampled format:Unknown + 15: TypeSampledImage 14 + 16: TypePointer UniformConstant 15 + 17(u2drs): 16(ptr) Variable UniformConstant + 20: TypeVector 10(float) 2 + 21: 10(float) Constant 0 + 22: 20(fvec2) ConstantComposite 21 21 + 23: TypeInt 32 1 + 24: TypeVector 23(int) 2 + 25: 23(int) Constant 3 + 26: 23(int) Constant 4 + 27: 24(ivec2) ConstantComposite 25 26 + 30: TypeInt 32 0 + 31: 30(int) Constant 0 + 32: TypePointer Output 10(float) + 37: TypeFloat 64 + 38: TypePointer Function 37(float) + 40: 37(float) Constant 2507418074 1073430332 + 41: TypeVector 37(float) 2 + 42: TypePointer Function 41(fvec2) + 44: 37(float) Constant 796182188 1073367658 + 45: 41(fvec2) ConstantComposite 44 44 + 46: TypeVector 37(float) 3 + 47: TypePointer Function 46(fvec3) + 49: 37(float) Constant 1719614413 1073127582 + 50: 46(fvec3) ConstantComposite 49 49 49 + 51: TypeVector 37(float) 4 + 52: TypePointer Function 51(fvec4) + 426: TypeBool + 427: TypePointer Function 426(bool) + 435: TypeVector 426(bool) 2 + 436: TypePointer Function 435(bvec2) + 444: TypeVector 426(bool) 3 + 445: TypePointer Function 444(bvec3) + 453: TypeVector 426(bool) 4 + 454: TypePointer Function 453(bvec4) + 561: 426(bool) ConstantFalse + 570: 435(bvec2) ConstantComposite 561 561 + 579: 444(bvec3) ConstantComposite 561 561 561 + 588: 453(bvec4) ConstantComposite 561 561 561 561 + 735: TypeMatrix 41(fvec2) 2 + 736: TypePointer Function 735 + 741: TypeMatrix 46(fvec3) 3 + 742: TypePointer Function 741 + 747: TypeMatrix 51(fvec4) 4 + 748: TypePointer Function 747 + 753: TypeMatrix 46(fvec3) 2 + 754: TypePointer Function 753 + 759: TypeMatrix 41(fvec2) 3 + 760: TypePointer Function 759 + 765: TypeMatrix 51(fvec4) 2 + 766: TypePointer Function 765 + 771: TypeMatrix 41(fvec2) 4 + 772: TypePointer Function 771 + 777: TypeMatrix 51(fvec4) 3 + 778: TypePointer Function 777 + 783: TypeMatrix 46(fvec3) 4 + 784: TypePointer Function 783 + 952: 30(int) Constant 1 + 956: 30(int) Constant 2 + 960: 30(int) Constant 3 + 964: 23(int) Constant 1 + 968: 23(int) Constant 2 + 994: 10(float) Constant 1065353216 + 1016: TypePointer Function 11(fvec4) + 1018: TypeImage 10(float) 2D sampled format:Unknown + 1019: TypeSampledImage 1018 + 1020: 30(int) Constant 5 + 1021: TypeArray 1019 1020 + 1022: TypePointer UniformConstant 1021 +1023(arrayedSampler): 1022(ptr) Variable UniformConstant + 1024: TypePointer Input 23(int) + 1025(i): 1024(ptr) Variable Input + 1027: TypePointer UniformConstant 1019 + 1030: TypePointer Input 20(fvec2) + 1031(c2D): 1030(ptr) Variable Input + 1034: TypeArray 10(float) 956 + 1035: TypePointer Input 1034 +1036(gl_ClipDistance): 1035(ptr) Variable Input + 1037: TypePointer Input 10(float) + 1041: TypeVector 10(float) 3 + 1046: TypeVector 30(int) 4 + 1047: TypePointer Output 1046(ivec4) + 1048(uoutp): 1047(ptr) Variable Output + 1049: TypeImage 30(int) Rect sampled format:Unknown + 1050: TypeSampledImage 1049 + 1051: TypePointer UniformConstant 1050 + 1052(samp2dr): 1051(ptr) Variable UniformConstant + 1055: 30(int) Constant 4 + 1056: TypeArray 24(ivec2) 1055 + 1057: 24(ivec2) ConstantComposite 964 968 + 1058: 23(int) Constant 15 + 1059: 23(int) Constant 16 + 1060: 24(ivec2) ConstantComposite 1058 1059 + 1061: 23(int) Constant 4294967294 + 1062: 23(int) Constant 0 + 1063: 24(ivec2) ConstantComposite 1061 1062 + 1064: 1056 ConstantComposite 1057 27 1060 1063 + 1072: TypeVector 23(int) 4 + 1073: TypePointer Output 1072(ivec4) + 1074(ioutp): 1073(ptr) Variable Output + 1075: TypeImage 23(int) 2D array sampled format:Unknown + 1076: TypeSampledImage 1075 + 1077: TypePointer UniformConstant 1076 + 1078(isamp2DA): 1077(ptr) Variable UniformConstant + 1080: 10(float) Constant 1036831949 + 1081: 1041(fvec3) ConstantComposite 1080 1080 1080 + 1082: 24(ivec2) ConstantComposite 964 964 + 1094: TypePointer Input 11(fvec4) +1095(gl_FragCoord): 1094(ptr) Variable Input + 1097(vl2): 1094(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() + 1017(v): 1016(ptr) Variable Function + 1026: 23(int) Load 1025(i) + 1028: 1027(ptr) AccessChain 1023(arrayedSampler) 1026 + 1029: 1019 Load 1028 + 1032: 20(fvec2) Load 1031(c2D) + 1033: 11(fvec4) ImageSampleImplicitLod 1029 1032 + Store 1017(v) 1033 + 1038: 1037(ptr) AccessChain 1036(gl_ClipDistance) 964 + 1039: 10(float) Load 1038 + 1040: 32(ptr) AccessChain 13(outp) 31 + Store 1040 1039 + 1042: 11(fvec4) Load 1017(v) + 1043: 1041(fvec3) VectorShuffle 1042 1042 1 2 3 + 1044: 11(fvec4) Load 13(outp) + 1045: 11(fvec4) VectorShuffle 1044 1043 0 4 5 6 + Store 13(outp) 1045 + 1053: 1050 Load 1052(samp2dr) + 1054: 20(fvec2) Load 1031(c2D) + 1065: 1046(ivec4) ImageGather 1053 1054 968 ConstOffsets 1064 + Store 1048(uoutp) 1065 + 1066: 1027(ptr) AccessChain 1023(arrayedSampler) 1062 + 1067: 1019 Load 1066 + 1068: 20(fvec2) Load 1031(c2D) + 1069: 11(fvec4) ImageGather 1067 1068 1062 + 1070: 11(fvec4) Load 13(outp) + 1071: 11(fvec4) FAdd 1070 1069 + Store 13(outp) 1071 + 1079: 1076 Load 1078(isamp2DA) + 1083: 1072(ivec4) ImageGather 1079 1081 25 ConstOffset 1082 + Store 1074(ioutp) 1083 + 1084: 1076 Load 1078(isamp2DA) + 1085: 1072(ivec4) ImageGather 1084 1081 25 ConstOffset 1082 + 1086: 1072(ivec4) Load 1074(ioutp) + 1087: 1072(ivec4) IAdd 1086 1085 + Store 1074(ioutp) 1087 + 1088: 1076 Load 1078(isamp2DA) + 1089: 23(int) Load 1025(i) + 1090: 24(ivec2) CompositeConstruct 1089 1089 + 1091: 1072(ivec4) ImageGather 1088 1081 1062 Offset 1090 + 1092: 1072(ivec4) Load 1074(ioutp) + 1093: 1072(ivec4) IAdd 1092 1091 + Store 1074(ioutp) 1093 + 1096: 11(fvec4) Load 1095(gl_FragCoord) + 1098: 11(fvec4) Load 1097(vl2) + 1099: 11(fvec4) FAdd 1096 1098 + 1100: 11(fvec4) Load 13(outp) + 1101: 11(fvec4) FAdd 1100 1099 + Store 13(outp) 1101 + 1102: 2 FunctionCall 6(foo23() + 1103: 2 FunctionCall 8(doubles() 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 2 - 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 + 18: 15 Load 17(u2drs) + 19: 11(fvec4) Load 13(outp) + 28: 10(float) CompositeExtract 19 2 + 29: 10(float) ImageSampleProjDrefExplicitLod 18 19 28 Grad ConstOffset 22 22 27 + 33: 32(ptr) AccessChain 13(outp) 31 + 34: 10(float) Load 33 + 35: 10(float) FAdd 34 29 + 36: 32(ptr) AccessChain 13(outp) 31 + Store 36 35 + Return + FunctionEnd + 8(doubles(): 2 Function None 3 + 9: Label + 39(doublev): 38(ptr) Variable Function + 43(dvec2v): 42(ptr) Variable Function + 48(dvec3v): 47(ptr) Variable Function + 53(dvec4v): 52(ptr) Variable Function + 428(boolv): 427(ptr) Variable Function + 437(bvec2v): 436(ptr) Variable Function + 446(bvec3v): 445(ptr) Variable Function + 455(bvec4v): 454(ptr) Variable Function + 554: 427(ptr) Variable Function + 563: 436(ptr) Variable Function + 572: 445(ptr) Variable Function + 581: 454(ptr) Variable Function + 737(dmat2v): 736(ptr) Variable Function + 743(dmat3v): 742(ptr) Variable Function + 749(dmat4v): 748(ptr) Variable Function + 755(dmat2x3v): 754(ptr) Variable Function + 761(dmat3x2v): 760(ptr) Variable Function + 767(dmat2x4v): 766(ptr) Variable Function + 773(dmat4x2v): 772(ptr) Variable Function + 779(dmat3x4v): 778(ptr) Variable Function + 785(dmat4x3v): 784(ptr) Variable Function + Store 39(doublev) 40 + Store 43(dvec2v) 45 + Store 48(dvec3v) 50 + 54: 37(float) Load 39(doublev) + 55: 51(fvec4) CompositeConstruct 54 54 54 54 + 56: 51(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 55 + Store 53(dvec4v) 56 + 57: 37(float) Load 39(doublev) + 58: 37(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 57 + 59: 37(float) Load 39(doublev) + 60: 37(float) FAdd 59 58 + Store 39(doublev) 60 + 61: 41(fvec2) Load 43(dvec2v) + 62: 41(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 61 + 63: 41(fvec2) Load 43(dvec2v) + 64: 41(fvec2) FAdd 63 62 + Store 43(dvec2v) 64 + 65: 46(fvec3) Load 48(dvec3v) + 66: 46(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 65 + 67: 46(fvec3) Load 48(dvec3v) + 68: 46(fvec3) FAdd 67 66 + Store 48(dvec3v) 68 + 69: 51(fvec4) Load 53(dvec4v) + 70: 51(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 69 + 71: 51(fvec4) Load 53(dvec4v) + 72: 51(fvec4) FAdd 71 70 + Store 53(dvec4v) 72 + 73: 37(float) Load 39(doublev) + 74: 37(float) ExtInst 1(GLSL.std.450) 4(FAbs) 73 + 75: 37(float) Load 39(doublev) + 76: 37(float) FAdd 75 74 + Store 39(doublev) 76 + 77: 41(fvec2) Load 43(dvec2v) + 78: 41(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 77 + 79: 41(fvec2) Load 43(dvec2v) + 80: 41(fvec2) FAdd 79 78 + Store 43(dvec2v) 80 + 81: 46(fvec3) Load 48(dvec3v) + 82: 46(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 81 + 83: 46(fvec3) Load 48(dvec3v) + 84: 46(fvec3) FAdd 83 82 + Store 48(dvec3v) 84 + 85: 51(fvec4) Load 53(dvec4v) + 86: 51(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 85 + 87: 51(fvec4) Load 53(dvec4v) + 88: 51(fvec4) FAdd 87 86 + Store 53(dvec4v) 88 + 89: 37(float) Load 39(doublev) + 90: 37(float) ExtInst 1(GLSL.std.450) 6(FSign) 89 + 91: 37(float) Load 39(doublev) + 92: 37(float) FAdd 91 90 + Store 39(doublev) 92 + 93: 41(fvec2) Load 43(dvec2v) + 94: 41(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 93 + 95: 41(fvec2) Load 43(dvec2v) + 96: 41(fvec2) FAdd 95 94 + Store 43(dvec2v) 96 + 97: 46(fvec3) Load 48(dvec3v) + 98: 46(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 97 + 99: 46(fvec3) Load 48(dvec3v) + 100: 46(fvec3) FAdd 99 98 + Store 48(dvec3v) 100 + 101: 51(fvec4) Load 53(dvec4v) + 102: 51(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 101 + 103: 51(fvec4) Load 53(dvec4v) + 104: 51(fvec4) FAdd 103 102 + Store 53(dvec4v) 104 + 105: 37(float) Load 39(doublev) + 106: 37(float) ExtInst 1(GLSL.std.450) 8(Floor) 105 + 107: 37(float) Load 39(doublev) + 108: 37(float) FAdd 107 106 + Store 39(doublev) 108 + 109: 41(fvec2) Load 43(dvec2v) + 110: 41(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 109 + 111: 41(fvec2) Load 43(dvec2v) + 112: 41(fvec2) FAdd 111 110 + Store 43(dvec2v) 112 + 113: 46(fvec3) Load 48(dvec3v) + 114: 46(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 113 + 115: 46(fvec3) Load 48(dvec3v) + 116: 46(fvec3) FAdd 115 114 + Store 48(dvec3v) 116 + 117: 51(fvec4) Load 53(dvec4v) + 118: 51(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 117 + 119: 51(fvec4) Load 53(dvec4v) + 120: 51(fvec4) FAdd 119 118 + Store 53(dvec4v) 120 + 121: 37(float) Load 39(doublev) + 122: 37(float) ExtInst 1(GLSL.std.450) 3(Trunc) 121 + 123: 37(float) Load 39(doublev) + 124: 37(float) FAdd 123 122 + Store 39(doublev) 124 + 125: 41(fvec2) Load 43(dvec2v) + 126: 41(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 125 + 127: 41(fvec2) Load 43(dvec2v) + 128: 41(fvec2) FAdd 127 126 + Store 43(dvec2v) 128 + 129: 46(fvec3) Load 48(dvec3v) + 130: 46(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 129 + 131: 46(fvec3) Load 48(dvec3v) + 132: 46(fvec3) FAdd 131 130 + Store 48(dvec3v) 132 + 133: 51(fvec4) Load 53(dvec4v) + 134: 51(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 133 + 135: 51(fvec4) Load 53(dvec4v) + 136: 51(fvec4) FAdd 135 134 + Store 53(dvec4v) 136 + 137: 37(float) Load 39(doublev) + 138: 37(float) ExtInst 1(GLSL.std.450) 1(Round) 137 + 139: 37(float) Load 39(doublev) + 140: 37(float) FAdd 139 138 + Store 39(doublev) 140 + 141: 41(fvec2) Load 43(dvec2v) + 142: 41(fvec2) ExtInst 1(GLSL.std.450) 1(Round) 141 + 143: 41(fvec2) Load 43(dvec2v) + 144: 41(fvec2) FAdd 143 142 + Store 43(dvec2v) 144 + 145: 46(fvec3) Load 48(dvec3v) + 146: 46(fvec3) ExtInst 1(GLSL.std.450) 1(Round) 145 + 147: 46(fvec3) Load 48(dvec3v) + 148: 46(fvec3) FAdd 147 146 + Store 48(dvec3v) 148 + 149: 51(fvec4) Load 53(dvec4v) + 150: 51(fvec4) ExtInst 1(GLSL.std.450) 1(Round) 149 + 151: 51(fvec4) Load 53(dvec4v) + 152: 51(fvec4) FAdd 151 150 + Store 53(dvec4v) 152 + 153: 37(float) Load 39(doublev) + 154: 37(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 153 + 155: 37(float) Load 39(doublev) + 156: 37(float) FAdd 155 154 + Store 39(doublev) 156 + 157: 41(fvec2) Load 43(dvec2v) + 158: 41(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 157 + 159: 41(fvec2) Load 43(dvec2v) + 160: 41(fvec2) FAdd 159 158 + Store 43(dvec2v) 160 + 161: 46(fvec3) Load 48(dvec3v) + 162: 46(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 161 + 163: 46(fvec3) Load 48(dvec3v) + 164: 46(fvec3) FAdd 163 162 + Store 48(dvec3v) 164 + 165: 51(fvec4) Load 53(dvec4v) + 166: 51(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 165 + 167: 51(fvec4) Load 53(dvec4v) + 168: 51(fvec4) FAdd 167 166 + Store 53(dvec4v) 168 + 169: 37(float) Load 39(doublev) + 170: 37(float) ExtInst 1(GLSL.std.450) 9(Ceil) 169 + 171: 37(float) Load 39(doublev) + 172: 37(float) FAdd 171 170 + Store 39(doublev) 172 + 173: 41(fvec2) Load 43(dvec2v) + 174: 41(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 173 + 175: 41(fvec2) Load 43(dvec2v) + 176: 41(fvec2) FAdd 175 174 + Store 43(dvec2v) 176 + 177: 46(fvec3) Load 48(dvec3v) + 178: 46(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 177 + 179: 46(fvec3) Load 48(dvec3v) + 180: 46(fvec3) FAdd 179 178 + Store 48(dvec3v) 180 + 181: 51(fvec4) Load 53(dvec4v) + 182: 51(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 181 + 183: 51(fvec4) Load 53(dvec4v) + 184: 51(fvec4) FAdd 183 182 + Store 53(dvec4v) 184 + 185: 37(float) Load 39(doublev) + 186: 37(float) ExtInst 1(GLSL.std.450) 10(Fract) 185 + 187: 37(float) Load 39(doublev) + 188: 37(float) FAdd 187 186 + Store 39(doublev) 188 + 189: 41(fvec2) Load 43(dvec2v) + 190: 41(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 189 + 191: 41(fvec2) Load 43(dvec2v) + 192: 41(fvec2) FAdd 191 190 + Store 43(dvec2v) 192 + 193: 46(fvec3) Load 48(dvec3v) + 194: 46(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 193 + 195: 46(fvec3) Load 48(dvec3v) + 196: 46(fvec3) FAdd 195 194 + Store 48(dvec3v) 196 + 197: 51(fvec4) Load 53(dvec4v) + 198: 51(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 197 + 199: 51(fvec4) Load 53(dvec4v) + 200: 51(fvec4) FAdd 199 198 + Store 53(dvec4v) 200 + 201: 37(float) Load 39(doublev) + 202: 37(float) Load 39(doublev) + 203: 37(float) FMod 201 202 + 204: 37(float) Load 39(doublev) + 205: 37(float) FAdd 204 203 + Store 39(doublev) 205 + 206: 41(fvec2) Load 43(dvec2v) + 207: 37(float) Load 39(doublev) + 208: 41(fvec2) CompositeConstruct 207 207 + 209: 41(fvec2) FMod 206 208 + 210: 41(fvec2) Load 43(dvec2v) + 211: 41(fvec2) FAdd 210 209 + Store 43(dvec2v) 211 + 212: 46(fvec3) Load 48(dvec3v) + 213: 37(float) Load 39(doublev) + 214: 46(fvec3) CompositeConstruct 213 213 213 + 215: 46(fvec3) FMod 212 214 + 216: 46(fvec3) Load 48(dvec3v) + 217: 46(fvec3) FAdd 216 215 + Store 48(dvec3v) 217 + 218: 51(fvec4) Load 53(dvec4v) + 219: 37(float) Load 39(doublev) + 220: 51(fvec4) CompositeConstruct 219 219 219 219 + 221: 51(fvec4) FMod 218 220 + 222: 51(fvec4) Load 53(dvec4v) + 223: 51(fvec4) FAdd 222 221 + Store 53(dvec4v) 223 + 224: 41(fvec2) Load 43(dvec2v) + 225: 41(fvec2) Load 43(dvec2v) + 226: 41(fvec2) FMod 224 225 + 227: 41(fvec2) Load 43(dvec2v) + 228: 41(fvec2) FAdd 227 226 + Store 43(dvec2v) 228 + 229: 46(fvec3) Load 48(dvec3v) + 230: 46(fvec3) Load 48(dvec3v) + 231: 46(fvec3) FMod 229 230 + 232: 46(fvec3) Load 48(dvec3v) + 233: 46(fvec3) FAdd 232 231 + Store 48(dvec3v) 233 + 234: 51(fvec4) Load 53(dvec4v) + 235: 51(fvec4) Load 53(dvec4v) + 236: 51(fvec4) FMod 234 235 + 237: 51(fvec4) Load 53(dvec4v) + 238: 51(fvec4) FAdd 237 236 + Store 53(dvec4v) 238 + 239: 37(float) Load 39(doublev) + 240: 37(float) ExtInst 1(GLSL.std.450) 35(Modf) 239 39(doublev) + 241: 37(float) Load 39(doublev) + 242: 37(float) FAdd 241 240 + Store 39(doublev) 242 + 243: 41(fvec2) Load 43(dvec2v) + 244: 41(fvec2) ExtInst 1(GLSL.std.450) 35(Modf) 243 43(dvec2v) + 245: 41(fvec2) Load 43(dvec2v) + 246: 41(fvec2) FAdd 245 244 + Store 43(dvec2v) 246 + 247: 46(fvec3) Load 48(dvec3v) + 248: 46(fvec3) ExtInst 1(GLSL.std.450) 35(Modf) 247 48(dvec3v) + 249: 46(fvec3) Load 48(dvec3v) + 250: 46(fvec3) FAdd 249 248 + Store 48(dvec3v) 250 + 251: 51(fvec4) Load 53(dvec4v) + 252: 51(fvec4) ExtInst 1(GLSL.std.450) 35(Modf) 251 53(dvec4v) + 253: 51(fvec4) Load 53(dvec4v) + 254: 51(fvec4) FAdd 253 252 + Store 53(dvec4v) 254 + 255: 37(float) Load 39(doublev) + 256: 37(float) Load 39(doublev) + 257: 37(float) ExtInst 1(GLSL.std.450) 37(FMin) 255 256 + 258: 37(float) Load 39(doublev) + 259: 37(float) FAdd 258 257 + Store 39(doublev) 259 + 260: 41(fvec2) Load 43(dvec2v) + 261: 37(float) Load 39(doublev) + 262: 41(fvec2) CompositeConstruct 261 261 + 263: 41(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 260 262 + 264: 41(fvec2) Load 43(dvec2v) + 265: 41(fvec2) FAdd 264 263 + Store 43(dvec2v) 265 + 266: 46(fvec3) Load 48(dvec3v) + 267: 37(float) Load 39(doublev) + 268: 46(fvec3) CompositeConstruct 267 267 267 + 269: 46(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 266 268 + 270: 46(fvec3) Load 48(dvec3v) + 271: 46(fvec3) FAdd 270 269 + Store 48(dvec3v) 271 + 272: 51(fvec4) Load 53(dvec4v) + 273: 37(float) Load 39(doublev) + 274: 51(fvec4) CompositeConstruct 273 273 273 273 + 275: 51(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 272 274 + 276: 51(fvec4) Load 53(dvec4v) + 277: 51(fvec4) FAdd 276 275 + Store 53(dvec4v) 277 + 278: 41(fvec2) Load 43(dvec2v) + 279: 41(fvec2) Load 43(dvec2v) + 280: 41(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 278 279 + 281: 41(fvec2) Load 43(dvec2v) + 282: 41(fvec2) FAdd 281 280 + Store 43(dvec2v) 282 + 283: 46(fvec3) Load 48(dvec3v) + 284: 46(fvec3) Load 48(dvec3v) + 285: 46(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 283 284 + 286: 46(fvec3) Load 48(dvec3v) + 287: 46(fvec3) FAdd 286 285 + Store 48(dvec3v) 287 + 288: 51(fvec4) Load 53(dvec4v) + 289: 51(fvec4) Load 53(dvec4v) + 290: 51(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 288 289 + 291: 51(fvec4) Load 53(dvec4v) + 292: 51(fvec4) FAdd 291 290 + Store 53(dvec4v) 292 + 293: 37(float) Load 39(doublev) + 294: 37(float) Load 39(doublev) + 295: 37(float) ExtInst 1(GLSL.std.450) 40(FMax) 293 294 + 296: 37(float) Load 39(doublev) + 297: 37(float) FAdd 296 295 + Store 39(doublev) 297 + 298: 41(fvec2) Load 43(dvec2v) + 299: 37(float) Load 39(doublev) + 300: 41(fvec2) CompositeConstruct 299 299 + 301: 41(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 298 300 + 302: 41(fvec2) Load 43(dvec2v) + 303: 41(fvec2) FAdd 302 301 + Store 43(dvec2v) 303 + 304: 46(fvec3) Load 48(dvec3v) + 305: 37(float) Load 39(doublev) + 306: 46(fvec3) CompositeConstruct 305 305 305 + 307: 46(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 304 306 + 308: 46(fvec3) Load 48(dvec3v) + 309: 46(fvec3) FAdd 308 307 + Store 48(dvec3v) 309 + 310: 51(fvec4) Load 53(dvec4v) + 311: 37(float) Load 39(doublev) + 312: 51(fvec4) CompositeConstruct 311 311 311 311 + 313: 51(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 310 312 + 314: 51(fvec4) Load 53(dvec4v) + 315: 51(fvec4) FAdd 314 313 + Store 53(dvec4v) 315 + 316: 41(fvec2) Load 43(dvec2v) + 317: 41(fvec2) Load 43(dvec2v) + 318: 41(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 316 317 + 319: 41(fvec2) Load 43(dvec2v) + 320: 41(fvec2) FAdd 319 318 + Store 43(dvec2v) 320 + 321: 46(fvec3) Load 48(dvec3v) + 322: 46(fvec3) Load 48(dvec3v) + 323: 46(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 321 322 + 324: 46(fvec3) Load 48(dvec3v) + 325: 46(fvec3) FAdd 324 323 + Store 48(dvec3v) 325 + 326: 51(fvec4) Load 53(dvec4v) + 327: 51(fvec4) Load 53(dvec4v) + 328: 51(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 326 327 + 329: 51(fvec4) Load 53(dvec4v) + 330: 51(fvec4) FAdd 329 328 + Store 53(dvec4v) 330 + 331: 37(float) Load 39(doublev) + 332: 37(float) Load 39(doublev) + 333: 37(float) Load 39(doublev) + 334: 37(float) ExtInst 1(GLSL.std.450) 43(FClamp) 331 332 333 + 335: 37(float) Load 39(doublev) + 336: 37(float) FAdd 335 334 + Store 39(doublev) 336 + 337: 41(fvec2) Load 43(dvec2v) + 338: 37(float) Load 39(doublev) + 339: 37(float) Load 39(doublev) + 340: 41(fvec2) CompositeConstruct 338 338 + 341: 41(fvec2) CompositeConstruct 339 339 + 342: 41(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 337 340 341 + 343: 41(fvec2) Load 43(dvec2v) + 344: 41(fvec2) FAdd 343 342 + Store 43(dvec2v) 344 + 345: 46(fvec3) Load 48(dvec3v) + 346: 37(float) Load 39(doublev) + 347: 37(float) Load 39(doublev) + 348: 46(fvec3) CompositeConstruct 346 346 346 + 349: 46(fvec3) CompositeConstruct 347 347 347 + 350: 46(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 345 348 349 + 351: 46(fvec3) Load 48(dvec3v) + 352: 46(fvec3) FAdd 351 350 + Store 48(dvec3v) 352 + 353: 51(fvec4) Load 53(dvec4v) + 354: 37(float) Load 39(doublev) + 355: 37(float) Load 39(doublev) + 356: 51(fvec4) CompositeConstruct 354 354 354 354 + 357: 51(fvec4) CompositeConstruct 355 355 355 355 + 358: 51(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 353 356 357 + 359: 51(fvec4) Load 53(dvec4v) + 360: 51(fvec4) FAdd 359 358 + Store 53(dvec4v) 360 + 361: 41(fvec2) Load 43(dvec2v) + 362: 41(fvec2) Load 43(dvec2v) + 363: 41(fvec2) Load 43(dvec2v) + 364: 41(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 361 362 363 + 365: 41(fvec2) Load 43(dvec2v) + 366: 41(fvec2) FAdd 365 364 + Store 43(dvec2v) 366 + 367: 46(fvec3) Load 48(dvec3v) + 368: 46(fvec3) Load 48(dvec3v) + 369: 46(fvec3) Load 48(dvec3v) + 370: 46(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 367 368 369 + 371: 46(fvec3) Load 48(dvec3v) + 372: 46(fvec3) FAdd 371 370 + Store 48(dvec3v) 372 + 373: 51(fvec4) Load 53(dvec4v) + 374: 51(fvec4) Load 53(dvec4v) + 375: 51(fvec4) Load 53(dvec4v) + 376: 51(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 373 374 375 + 377: 51(fvec4) Load 53(dvec4v) + 378: 51(fvec4) FAdd 377 376 + Store 53(dvec4v) 378 + 379: 37(float) Load 39(doublev) + 380: 37(float) Load 39(doublev) + 381: 37(float) Load 39(doublev) + 382: 37(float) ExtInst 1(GLSL.std.450) 46(FMix) 379 380 381 + 383: 37(float) Load 39(doublev) + 384: 37(float) FAdd 383 382 + Store 39(doublev) 384 + 385: 41(fvec2) Load 43(dvec2v) + 386: 41(fvec2) Load 43(dvec2v) + 387: 37(float) Load 39(doublev) + 388: 41(fvec2) CompositeConstruct 387 387 + 389: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 385 386 388 + 390: 41(fvec2) Load 43(dvec2v) + 391: 41(fvec2) FAdd 390 389 + Store 43(dvec2v) 391 + 392: 46(fvec3) Load 48(dvec3v) + 393: 46(fvec3) Load 48(dvec3v) + 394: 37(float) Load 39(doublev) + 395: 46(fvec3) CompositeConstruct 394 394 394 + 396: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 392 393 395 + 397: 46(fvec3) Load 48(dvec3v) + 398: 46(fvec3) FAdd 397 396 + Store 48(dvec3v) 398 + 399: 51(fvec4) Load 53(dvec4v) + 400: 51(fvec4) Load 53(dvec4v) + 401: 37(float) Load 39(doublev) + 402: 51(fvec4) CompositeConstruct 401 401 401 401 + 403: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 399 400 402 + 404: 51(fvec4) Load 53(dvec4v) + 405: 51(fvec4) FAdd 404 403 + Store 53(dvec4v) 405 + 406: 41(fvec2) Load 43(dvec2v) + 407: 41(fvec2) Load 43(dvec2v) + 408: 41(fvec2) Load 43(dvec2v) + 409: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 406 407 408 + 410: 41(fvec2) Load 43(dvec2v) + 411: 41(fvec2) FAdd 410 409 + Store 43(dvec2v) 411 + 412: 46(fvec3) Load 48(dvec3v) + 413: 46(fvec3) Load 48(dvec3v) + 414: 46(fvec3) Load 48(dvec3v) + 415: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 412 413 414 + 416: 46(fvec3) Load 48(dvec3v) + 417: 46(fvec3) FAdd 416 415 + Store 48(dvec3v) 417 + 418: 51(fvec4) Load 53(dvec4v) + 419: 51(fvec4) Load 53(dvec4v) + 420: 51(fvec4) Load 53(dvec4v) + 421: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 418 419 420 + 422: 51(fvec4) Load 53(dvec4v) + 423: 51(fvec4) FAdd 422 421 + Store 53(dvec4v) 423 + 424: 37(float) Load 39(doublev) + 425: 37(float) Load 39(doublev) + 429: 426(bool) Load 428(boolv) + 430: 37(float) ExtInst 1(GLSL.std.450) 46(FMix) 424 425 429 + 431: 37(float) Load 39(doublev) + 432: 37(float) FAdd 431 430 + Store 39(doublev) 432 + 433: 41(fvec2) Load 43(dvec2v) + 434: 41(fvec2) Load 43(dvec2v) + 438: 435(bvec2) Load 437(bvec2v) + 439: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 433 434 438 + 440: 41(fvec2) Load 43(dvec2v) + 441: 41(fvec2) FAdd 440 439 + Store 43(dvec2v) 441 + 442: 46(fvec3) Load 48(dvec3v) + 443: 46(fvec3) Load 48(dvec3v) + 447: 444(bvec3) Load 446(bvec3v) + 448: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 442 443 447 + 449: 46(fvec3) Load 48(dvec3v) + 450: 46(fvec3) FAdd 449 448 + Store 48(dvec3v) 450 + 451: 51(fvec4) Load 53(dvec4v) + 452: 51(fvec4) Load 53(dvec4v) + 456: 453(bvec4) Load 455(bvec4v) + 457: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 451 452 456 + 458: 51(fvec4) Load 53(dvec4v) + 459: 51(fvec4) FAdd 458 457 + Store 53(dvec4v) 459 + 460: 37(float) Load 39(doublev) + 461: 37(float) Load 39(doublev) + 462: 37(float) ExtInst 1(GLSL.std.450) 48(Step) 460 461 + 463: 37(float) Load 39(doublev) + 464: 37(float) FAdd 463 462 + Store 39(doublev) 464 + 465: 41(fvec2) Load 43(dvec2v) + 466: 41(fvec2) Load 43(dvec2v) + 467: 41(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 465 466 + 468: 41(fvec2) Load 43(dvec2v) + 469: 41(fvec2) FAdd 468 467 + Store 43(dvec2v) 469 + 470: 46(fvec3) Load 48(dvec3v) + 471: 46(fvec3) Load 48(dvec3v) + 472: 46(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 470 471 + 473: 46(fvec3) Load 48(dvec3v) + 474: 46(fvec3) FAdd 473 472 + Store 48(dvec3v) 474 + 475: 51(fvec4) Load 53(dvec4v) + 476: 51(fvec4) Load 53(dvec4v) + 477: 51(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 475 476 + 478: 51(fvec4) Load 53(dvec4v) + 479: 51(fvec4) FAdd 478 477 + Store 53(dvec4v) 479 + 480: 37(float) Load 39(doublev) + 481: 41(fvec2) Load 43(dvec2v) + 482: 41(fvec2) CompositeConstruct 480 480 + 483: 41(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 482 481 + 484: 41(fvec2) Load 43(dvec2v) + 485: 41(fvec2) FAdd 484 483 + Store 43(dvec2v) 485 + 486: 37(float) Load 39(doublev) + 487: 46(fvec3) Load 48(dvec3v) + 488: 46(fvec3) CompositeConstruct 486 486 486 + 489: 46(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 488 487 + 490: 46(fvec3) Load 48(dvec3v) + 491: 46(fvec3) FAdd 490 489 + Store 48(dvec3v) 491 + 492: 37(float) Load 39(doublev) + 493: 51(fvec4) Load 53(dvec4v) + 494: 51(fvec4) CompositeConstruct 492 492 492 492 + 495: 51(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 494 493 + 496: 51(fvec4) Load 53(dvec4v) + 497: 51(fvec4) FAdd 496 495 + Store 53(dvec4v) 497 + 498: 37(float) Load 39(doublev) + 499: 37(float) Load 39(doublev) + 500: 37(float) Load 39(doublev) + 501: 37(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 498 499 500 + 502: 37(float) Load 39(doublev) + 503: 37(float) FAdd 502 501 + Store 39(doublev) 503 + 504: 41(fvec2) Load 43(dvec2v) + 505: 41(fvec2) Load 43(dvec2v) + 506: 41(fvec2) Load 43(dvec2v) + 507: 41(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 504 505 506 + 508: 41(fvec2) Load 43(dvec2v) + 509: 41(fvec2) FAdd 508 507 + Store 43(dvec2v) 509 + 510: 46(fvec3) Load 48(dvec3v) + 511: 46(fvec3) Load 48(dvec3v) + 512: 46(fvec3) Load 48(dvec3v) + 513: 46(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 510 511 512 + 514: 46(fvec3) Load 48(dvec3v) + 515: 46(fvec3) FAdd 514 513 + Store 48(dvec3v) 515 + 516: 51(fvec4) Load 53(dvec4v) + 517: 51(fvec4) Load 53(dvec4v) + 518: 51(fvec4) Load 53(dvec4v) + 519: 51(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 516 517 518 + 520: 51(fvec4) Load 53(dvec4v) + 521: 51(fvec4) FAdd 520 519 + Store 53(dvec4v) 521 + 522: 37(float) Load 39(doublev) + 523: 37(float) Load 39(doublev) + 524: 41(fvec2) Load 43(dvec2v) + 525: 41(fvec2) CompositeConstruct 522 522 + 526: 41(fvec2) CompositeConstruct 523 523 + 527: 41(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 525 526 524 + 528: 41(fvec2) Load 43(dvec2v) + 529: 41(fvec2) FAdd 528 527 + Store 43(dvec2v) 529 + 530: 37(float) Load 39(doublev) + 531: 37(float) Load 39(doublev) + 532: 46(fvec3) Load 48(dvec3v) + 533: 46(fvec3) CompositeConstruct 530 530 530 + 534: 46(fvec3) CompositeConstruct 531 531 531 + 535: 46(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 533 534 532 + 536: 46(fvec3) Load 48(dvec3v) + 537: 46(fvec3) FAdd 536 535 + Store 48(dvec3v) 537 + 538: 37(float) Load 39(doublev) + 539: 37(float) Load 39(doublev) + 540: 51(fvec4) Load 53(dvec4v) + 541: 51(fvec4) CompositeConstruct 538 538 538 538 + 542: 51(fvec4) CompositeConstruct 539 539 539 539 + 543: 51(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 541 542 540 + 544: 51(fvec4) Load 53(dvec4v) + 545: 51(fvec4) FAdd 544 543 + Store 53(dvec4v) 545 + 546: 37(float) Load 39(doublev) + 547: 426(bool) IsNan 546 + Store 428(boolv) 547 + 548: 41(fvec2) Load 43(dvec2v) + 549: 435(bvec2) IsNan 548 + Store 437(bvec2v) 549 + 550: 46(fvec3) Load 48(dvec3v) + 551: 444(bvec3) IsNan 550 + Store 446(bvec3v) 551 + 552: 51(fvec4) Load 53(dvec4v) + 553: 453(bvec4) IsNan 552 + Store 455(bvec4v) 553 + 555: 426(bool) Load 428(boolv) + SelectionMerge 557 None + BranchConditional 555 556 560 + 556: Label + 558: 37(float) Load 39(doublev) + 559: 426(bool) IsInf 558 + Store 554 559 + Branch 557 + 560: Label + Store 554 561 + Branch 557 + 557: Label + 562: 426(bool) Load 554 + Store 428(boolv) 562 + 564: 426(bool) Load 428(boolv) + SelectionMerge 566 None + BranchConditional 564 565 569 + 565: Label + 567: 41(fvec2) Load 43(dvec2v) + 568: 435(bvec2) IsInf 567 + Store 563 568 + Branch 566 + 569: Label + Store 563 570 + Branch 566 + 566: Label + 571: 435(bvec2) Load 563 + Store 437(bvec2v) 571 + 573: 426(bool) Load 428(boolv) + SelectionMerge 575 None + BranchConditional 573 574 578 + 574: Label + 576: 46(fvec3) Load 48(dvec3v) + 577: 444(bvec3) IsInf 576 + Store 572 577 + Branch 575 + 578: Label + Store 572 579 + Branch 575 + 575: Label + 580: 444(bvec3) Load 572 + Store 446(bvec3v) 580 + 582: 426(bool) Load 428(boolv) + SelectionMerge 584 None + BranchConditional 582 583 587 + 583: Label + 585: 51(fvec4) Load 53(dvec4v) + 586: 453(bvec4) IsInf 585 + Store 581 586 + Branch 584 + 587: Label + Store 581 588 + Branch 584 + 584: Label + 589: 453(bvec4) Load 581 + Store 455(bvec4v) 589 + 590: 37(float) Load 39(doublev) + 591: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 590 + 592: 37(float) Load 39(doublev) + 593: 37(float) FAdd 592 591 + Store 39(doublev) 593 + 594: 41(fvec2) Load 43(dvec2v) + 595: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 594 + 596: 37(float) Load 39(doublev) + 597: 37(float) FAdd 596 595 + Store 39(doublev) 597 + 598: 46(fvec3) Load 48(dvec3v) + 599: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 598 + 600: 37(float) Load 39(doublev) + 601: 37(float) FAdd 600 599 + Store 39(doublev) 601 + 602: 51(fvec4) Load 53(dvec4v) + 603: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 602 + 604: 37(float) Load 39(doublev) + 605: 37(float) FAdd 604 603 + Store 39(doublev) 605 + 606: 37(float) Load 39(doublev) + 607: 37(float) Load 39(doublev) + 608: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 606 607 + 609: 37(float) Load 39(doublev) + 610: 37(float) FAdd 609 608 + Store 39(doublev) 610 + 611: 41(fvec2) Load 43(dvec2v) + 612: 41(fvec2) Load 43(dvec2v) + 613: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 611 612 + 614: 37(float) Load 39(doublev) + 615: 37(float) FAdd 614 613 + Store 39(doublev) 615 + 616: 46(fvec3) Load 48(dvec3v) + 617: 46(fvec3) Load 48(dvec3v) + 618: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 616 617 + 619: 37(float) Load 39(doublev) + 620: 37(float) FAdd 619 618 + Store 39(doublev) 620 + 621: 51(fvec4) Load 53(dvec4v) + 622: 51(fvec4) Load 53(dvec4v) + 623: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 621 622 + 624: 37(float) Load 39(doublev) + 625: 37(float) FAdd 624 623 + Store 39(doublev) 625 + 626: 37(float) Load 39(doublev) + 627: 37(float) Load 39(doublev) + 628: 37(float) FMul 626 627 + 629: 37(float) Load 39(doublev) + 630: 37(float) FAdd 629 628 + Store 39(doublev) 630 + 631: 41(fvec2) Load 43(dvec2v) + 632: 41(fvec2) Load 43(dvec2v) + 633: 37(float) Dot 631 632 + 634: 37(float) Load 39(doublev) + 635: 37(float) FAdd 634 633 + Store 39(doublev) 635 + 636: 46(fvec3) Load 48(dvec3v) + 637: 46(fvec3) Load 48(dvec3v) + 638: 37(float) Dot 636 637 + 639: 37(float) Load 39(doublev) + 640: 37(float) FAdd 639 638 + Store 39(doublev) 640 + 641: 51(fvec4) Load 53(dvec4v) + 642: 51(fvec4) Load 53(dvec4v) + 643: 37(float) Dot 641 642 + 644: 37(float) Load 39(doublev) + 645: 37(float) FAdd 644 643 + Store 39(doublev) 645 + 646: 46(fvec3) Load 48(dvec3v) + 647: 46(fvec3) Load 48(dvec3v) + 648: 46(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 646 647 + 649: 46(fvec3) Load 48(dvec3v) + 650: 46(fvec3) FAdd 649 648 + Store 48(dvec3v) 650 + 651: 37(float) Load 39(doublev) + 652: 37(float) ExtInst 1(GLSL.std.450) 69(Normalize) 651 + 653: 37(float) Load 39(doublev) + 654: 37(float) FAdd 653 652 + Store 39(doublev) 654 + 655: 41(fvec2) Load 43(dvec2v) + 656: 41(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 655 + 657: 41(fvec2) Load 43(dvec2v) + 658: 41(fvec2) FAdd 657 656 + Store 43(dvec2v) 658 + 659: 46(fvec3) Load 48(dvec3v) + 660: 46(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 659 + 661: 46(fvec3) Load 48(dvec3v) + 662: 46(fvec3) FAdd 661 660 + Store 48(dvec3v) 662 + 663: 51(fvec4) Load 53(dvec4v) + 664: 51(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 663 + 665: 51(fvec4) Load 53(dvec4v) + 666: 51(fvec4) FAdd 665 664 + Store 53(dvec4v) 666 + 667: 37(float) Load 39(doublev) + 668: 37(float) Load 39(doublev) + 669: 37(float) Load 39(doublev) + 670: 37(float) ExtInst 1(GLSL.std.450) 70(FaceForward) 667 668 669 + 671: 37(float) Load 39(doublev) + 672: 37(float) FAdd 671 670 + Store 39(doublev) 672 + 673: 41(fvec2) Load 43(dvec2v) + 674: 41(fvec2) Load 43(dvec2v) + 675: 41(fvec2) Load 43(dvec2v) + 676: 41(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 673 674 675 + 677: 41(fvec2) Load 43(dvec2v) + 678: 41(fvec2) FAdd 677 676 + Store 43(dvec2v) 678 + 679: 46(fvec3) Load 48(dvec3v) + 680: 46(fvec3) Load 48(dvec3v) + 681: 46(fvec3) Load 48(dvec3v) + 682: 46(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 679 680 681 + 683: 46(fvec3) Load 48(dvec3v) + 684: 46(fvec3) FAdd 683 682 + Store 48(dvec3v) 684 + 685: 51(fvec4) Load 53(dvec4v) + 686: 51(fvec4) Load 53(dvec4v) + 687: 51(fvec4) Load 53(dvec4v) + 688: 51(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 685 686 687 + 689: 51(fvec4) Load 53(dvec4v) + 690: 51(fvec4) FAdd 689 688 + Store 53(dvec4v) 690 + 691: 37(float) Load 39(doublev) + 692: 37(float) Load 39(doublev) + 693: 37(float) ExtInst 1(GLSL.std.450) 71(Reflect) 691 692 + 694: 37(float) Load 39(doublev) + 695: 37(float) FAdd 694 693 + Store 39(doublev) 695 + 696: 41(fvec2) Load 43(dvec2v) + 697: 41(fvec2) Load 43(dvec2v) + 698: 41(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 696 697 + 699: 41(fvec2) Load 43(dvec2v) + 700: 41(fvec2) FAdd 699 698 + Store 43(dvec2v) 700 + 701: 46(fvec3) Load 48(dvec3v) + 702: 46(fvec3) Load 48(dvec3v) + 703: 46(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 701 702 + 704: 46(fvec3) Load 48(dvec3v) + 705: 46(fvec3) FAdd 704 703 + Store 48(dvec3v) 705 + 706: 51(fvec4) Load 53(dvec4v) + 707: 51(fvec4) Load 53(dvec4v) + 708: 51(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 706 707 + 709: 51(fvec4) Load 53(dvec4v) + 710: 51(fvec4) FAdd 709 708 + Store 53(dvec4v) 710 + 711: 37(float) Load 39(doublev) + 712: 37(float) Load 39(doublev) + 713: 37(float) Load 39(doublev) + 714: 37(float) ExtInst 1(GLSL.std.450) 72(Refract) 711 712 713 + 715: 37(float) Load 39(doublev) + 716: 37(float) FAdd 715 714 + Store 39(doublev) 716 + 717: 41(fvec2) Load 43(dvec2v) + 718: 41(fvec2) Load 43(dvec2v) + 719: 37(float) Load 39(doublev) + 720: 41(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 717 718 719 + 721: 41(fvec2) Load 43(dvec2v) + 722: 41(fvec2) FAdd 721 720 + Store 43(dvec2v) 722 + 723: 46(fvec3) Load 48(dvec3v) + 724: 46(fvec3) Load 48(dvec3v) + 725: 37(float) Load 39(doublev) + 726: 46(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 723 724 725 + 727: 46(fvec3) Load 48(dvec3v) + 728: 46(fvec3) FAdd 727 726 + Store 48(dvec3v) 728 + 729: 51(fvec4) Load 53(dvec4v) + 730: 51(fvec4) Load 53(dvec4v) + 731: 37(float) Load 39(doublev) + 732: 51(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 729 730 731 + 733: 51(fvec4) Load 53(dvec4v) + 734: 51(fvec4) FAdd 733 732 + Store 53(dvec4v) 734 + 738: 41(fvec2) Load 43(dvec2v) + 739: 41(fvec2) Load 43(dvec2v) + 740: 735 OuterProduct 738 739 + Store 737(dmat2v) 740 + 744: 46(fvec3) Load 48(dvec3v) + 745: 46(fvec3) Load 48(dvec3v) + 746: 741 OuterProduct 744 745 + Store 743(dmat3v) 746 + 750: 51(fvec4) Load 53(dvec4v) + 751: 51(fvec4) Load 53(dvec4v) + 752: 747 OuterProduct 750 751 + Store 749(dmat4v) 752 + 756: 46(fvec3) Load 48(dvec3v) + 757: 41(fvec2) Load 43(dvec2v) + 758: 753 OuterProduct 756 757 + Store 755(dmat2x3v) 758 + 762: 41(fvec2) Load 43(dvec2v) + 763: 46(fvec3) Load 48(dvec3v) + 764: 759 OuterProduct 762 763 + Store 761(dmat3x2v) 764 + 768: 51(fvec4) Load 53(dvec4v) + 769: 41(fvec2) Load 43(dvec2v) + 770: 765 OuterProduct 768 769 + Store 767(dmat2x4v) 770 + 774: 41(fvec2) Load 43(dvec2v) + 775: 51(fvec4) Load 53(dvec4v) + 776: 771 OuterProduct 774 775 + Store 773(dmat4x2v) 776 + 780: 51(fvec4) Load 53(dvec4v) + 781: 46(fvec3) Load 48(dvec3v) + 782: 777 OuterProduct 780 781 + Store 779(dmat3x4v) 782 + 786: 46(fvec3) Load 48(dvec3v) + 787: 51(fvec4) Load 53(dvec4v) + 788: 783 OuterProduct 786 787 + Store 785(dmat4x3v) 788 + 789: 735 Load 737(dmat2v) + 790: 735 Load 737(dmat2v) + 791: 41(fvec2) CompositeExtract 789 0 + 792: 41(fvec2) CompositeExtract 790 0 + 793: 41(fvec2) FMul 791 792 + 794: 41(fvec2) CompositeExtract 789 1 + 795: 41(fvec2) CompositeExtract 790 1 + 796: 41(fvec2) FMul 794 795 + 797: 735 CompositeConstruct 793 796 + 798: 735 Load 737(dmat2v) + 799: 735 MatrixTimesMatrix 798 797 + Store 737(dmat2v) 799 + 800: 741 Load 743(dmat3v) + 801: 741 Load 743(dmat3v) + 802: 46(fvec3) CompositeExtract 800 0 + 803: 46(fvec3) CompositeExtract 801 0 + 804: 46(fvec3) FMul 802 803 + 805: 46(fvec3) CompositeExtract 800 1 + 806: 46(fvec3) CompositeExtract 801 1 + 807: 46(fvec3) FMul 805 806 + 808: 46(fvec3) CompositeExtract 800 2 + 809: 46(fvec3) CompositeExtract 801 2 + 810: 46(fvec3) FMul 808 809 + 811: 741 CompositeConstruct 804 807 810 + 812: 741 Load 743(dmat3v) + 813: 741 MatrixTimesMatrix 812 811 + Store 743(dmat3v) 813 + 814: 747 Load 749(dmat4v) + 815: 747 Load 749(dmat4v) + 816: 51(fvec4) CompositeExtract 814 0 + 817: 51(fvec4) CompositeExtract 815 0 + 818: 51(fvec4) FMul 816 817 + 819: 51(fvec4) CompositeExtract 814 1 + 820: 51(fvec4) CompositeExtract 815 1 + 821: 51(fvec4) FMul 819 820 + 822: 51(fvec4) CompositeExtract 814 2 + 823: 51(fvec4) CompositeExtract 815 2 + 824: 51(fvec4) FMul 822 823 + 825: 51(fvec4) CompositeExtract 814 3 + 826: 51(fvec4) CompositeExtract 815 3 + 827: 51(fvec4) FMul 825 826 + 828: 747 CompositeConstruct 818 821 824 827 + 829: 747 Load 749(dmat4v) + 830: 747 MatrixTimesMatrix 829 828 + Store 749(dmat4v) 830 + 831: 753 Load 755(dmat2x3v) + 832: 753 Load 755(dmat2x3v) + 833: 46(fvec3) CompositeExtract 831 0 + 834: 46(fvec3) CompositeExtract 832 0 + 835: 46(fvec3) FMul 833 834 + 836: 46(fvec3) CompositeExtract 831 1 + 837: 46(fvec3) CompositeExtract 832 1 + 838: 46(fvec3) FMul 836 837 + 839: 753 CompositeConstruct 835 838 + Store 755(dmat2x3v) 839 + 840: 765 Load 767(dmat2x4v) + 841: 765 Load 767(dmat2x4v) + 842: 51(fvec4) CompositeExtract 840 0 + 843: 51(fvec4) CompositeExtract 841 0 + 844: 51(fvec4) FMul 842 843 + 845: 51(fvec4) CompositeExtract 840 1 + 846: 51(fvec4) CompositeExtract 841 1 + 847: 51(fvec4) FMul 845 846 + 848: 765 CompositeConstruct 844 847 + Store 767(dmat2x4v) 848 + 849: 759 Load 761(dmat3x2v) + 850: 759 Load 761(dmat3x2v) + 851: 41(fvec2) CompositeExtract 849 0 + 852: 41(fvec2) CompositeExtract 850 0 + 853: 41(fvec2) FMul 851 852 + 854: 41(fvec2) CompositeExtract 849 1 + 855: 41(fvec2) CompositeExtract 850 1 + 856: 41(fvec2) FMul 854 855 + 857: 41(fvec2) CompositeExtract 849 2 + 858: 41(fvec2) CompositeExtract 850 2 + 859: 41(fvec2) FMul 857 858 + 860: 759 CompositeConstruct 853 856 859 + Store 761(dmat3x2v) 860 + 861: 777 Load 779(dmat3x4v) + 862: 777 Load 779(dmat3x4v) + 863: 51(fvec4) CompositeExtract 861 0 + 864: 51(fvec4) CompositeExtract 862 0 + 865: 51(fvec4) FMul 863 864 + 866: 51(fvec4) CompositeExtract 861 1 + 867: 51(fvec4) CompositeExtract 862 1 + 868: 51(fvec4) FMul 866 867 + 869: 51(fvec4) CompositeExtract 861 2 + 870: 51(fvec4) CompositeExtract 862 2 + 871: 51(fvec4) FMul 869 870 + 872: 777 CompositeConstruct 865 868 871 + Store 779(dmat3x4v) 872 + 873: 771 Load 773(dmat4x2v) + 874: 771 Load 773(dmat4x2v) + 875: 41(fvec2) CompositeExtract 873 0 + 876: 41(fvec2) CompositeExtract 874 0 + 877: 41(fvec2) FMul 875 876 + 878: 41(fvec2) CompositeExtract 873 1 + 879: 41(fvec2) CompositeExtract 874 1 + 880: 41(fvec2) FMul 878 879 + 881: 41(fvec2) CompositeExtract 873 2 + 882: 41(fvec2) CompositeExtract 874 2 + 883: 41(fvec2) FMul 881 882 + 884: 41(fvec2) CompositeExtract 873 3 + 885: 41(fvec2) CompositeExtract 874 3 + 886: 41(fvec2) FMul 884 885 + 887: 771 CompositeConstruct 877 880 883 886 + Store 773(dmat4x2v) 887 + 888: 783 Load 785(dmat4x3v) + 889: 783 Load 785(dmat4x3v) + 890: 46(fvec3) CompositeExtract 888 0 + 891: 46(fvec3) CompositeExtract 889 0 + 892: 46(fvec3) FMul 890 891 + 893: 46(fvec3) CompositeExtract 888 1 + 894: 46(fvec3) CompositeExtract 889 1 + 895: 46(fvec3) FMul 893 894 + 896: 46(fvec3) CompositeExtract 888 2 + 897: 46(fvec3) CompositeExtract 889 2 + 898: 46(fvec3) FMul 896 897 + 899: 46(fvec3) CompositeExtract 888 3 + 900: 46(fvec3) CompositeExtract 889 3 + 901: 46(fvec3) FMul 899 900 + 902: 783 CompositeConstruct 892 895 898 901 + Store 785(dmat4x3v) 902 + 903: 735 Load 737(dmat2v) + 904: 735 Transpose 903 + 905: 735 Load 737(dmat2v) + 906: 735 MatrixTimesMatrix 905 904 + Store 737(dmat2v) 906 + 907: 741 Load 743(dmat3v) + 908: 741 Transpose 907 + 909: 741 Load 743(dmat3v) + 910: 741 MatrixTimesMatrix 909 908 + Store 743(dmat3v) 910 + 911: 747 Load 749(dmat4v) + 912: 747 Transpose 911 + 913: 747 Load 749(dmat4v) + 914: 747 MatrixTimesMatrix 913 912 + Store 749(dmat4v) 914 + 915: 759 Load 761(dmat3x2v) + 916: 753 Transpose 915 + Store 755(dmat2x3v) 916 + 917: 753 Load 755(dmat2x3v) + 918: 759 Transpose 917 + Store 761(dmat3x2v) 918 + 919: 771 Load 773(dmat4x2v) + 920: 765 Transpose 919 + Store 767(dmat2x4v) 920 + 921: 765 Load 767(dmat2x4v) + 922: 771 Transpose 921 + Store 773(dmat4x2v) 922 + 923: 783 Load 785(dmat4x3v) + 924: 777 Transpose 923 + Store 779(dmat3x4v) 924 + 925: 777 Load 779(dmat3x4v) + 926: 783 Transpose 925 + Store 785(dmat4x3v) 926 + 927: 735 Load 737(dmat2v) + 928: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 927 + 929: 37(float) Load 39(doublev) + 930: 37(float) FAdd 929 928 + Store 39(doublev) 930 + 931: 741 Load 743(dmat3v) + 932: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 931 + 933: 37(float) Load 39(doublev) + 934: 37(float) FAdd 933 932 + Store 39(doublev) 934 + 935: 747 Load 749(dmat4v) + 936: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 935 + 937: 37(float) Load 39(doublev) + 938: 37(float) FAdd 937 936 + Store 39(doublev) 938 + 939: 735 Load 737(dmat2v) + 940: 735 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 939 + 941: 735 Load 737(dmat2v) + 942: 735 MatrixTimesMatrix 941 940 + Store 737(dmat2v) 942 + 943: 741 Load 743(dmat3v) + 944: 741 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 943 + 945: 741 Load 743(dmat3v) + 946: 741 MatrixTimesMatrix 945 944 + Store 743(dmat3v) 946 + 947: 747 Load 749(dmat4v) + 948: 747 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 947 + 949: 747 Load 749(dmat4v) + 950: 747 MatrixTimesMatrix 949 948 + Store 749(dmat4v) 950 + 951: 37(float) Load 39(doublev) + 953: 38(ptr) AccessChain 43(dvec2v) 952 + 954: 37(float) Load 953 + 955: 37(float) FAdd 951 954 + 957: 38(ptr) AccessChain 48(dvec3v) 956 + 958: 37(float) Load 957 + 959: 37(float) FAdd 955 958 + 961: 38(ptr) AccessChain 53(dvec4v) 960 + 962: 37(float) Load 961 + 963: 37(float) FAdd 959 962 + 965: 38(ptr) AccessChain 737(dmat2v) 964 952 + 966: 37(float) Load 965 + 967: 37(float) FAdd 963 966 + 969: 38(ptr) AccessChain 743(dmat3v) 968 956 + 970: 37(float) Load 969 + 971: 37(float) FAdd 967 970 + 972: 38(ptr) AccessChain 749(dmat4v) 25 960 + 973: 37(float) Load 972 + 974: 37(float) FAdd 971 973 + 975: 38(ptr) AccessChain 755(dmat2x3v) 964 952 + 976: 37(float) Load 975 + 977: 37(float) FAdd 974 976 + 978: 38(ptr) AccessChain 761(dmat3x2v) 964 952 + 979: 37(float) Load 978 + 980: 37(float) FAdd 977 979 + 981: 38(ptr) AccessChain 779(dmat3x4v) 968 956 + 982: 37(float) Load 981 + 983: 37(float) FAdd 980 982 + 984: 38(ptr) AccessChain 785(dmat4x3v) 968 956 + 985: 37(float) Load 984 + 986: 37(float) FAdd 983 985 + 987: 38(ptr) AccessChain 767(dmat2x4v) 964 952 + 988: 37(float) Load 987 + 989: 37(float) FAdd 986 988 + 990: 38(ptr) AccessChain 773(dmat4x2v) 964 952 + 991: 37(float) Load 990 + 992: 37(float) FAdd 989 991 + 993: 426(bool) Load 428(boolv) + 995: 10(float) Select 993 994 21 + 996: 37(float) FConvert 995 + 997: 37(float) FAdd 992 996 + 998: 435(bvec2) Load 437(bvec2v) + 999: 426(bool) CompositeExtract 998 0 + 1000: 10(float) Select 999 994 21 + 1001: 37(float) FConvert 1000 + 1002: 37(float) FAdd 997 1001 + 1003: 444(bvec3) Load 446(bvec3v) + 1004: 426(bool) CompositeExtract 1003 0 + 1005: 10(float) Select 1004 994 21 + 1006: 37(float) FConvert 1005 + 1007: 37(float) FAdd 1002 1006 + 1008: 453(bvec4) Load 455(bvec4v) + 1009: 426(bool) CompositeExtract 1008 0 + 1010: 10(float) Select 1009 994 21 + 1011: 37(float) FConvert 1010 + 1012: 37(float) FAdd 1007 1011 + 1013: 10(float) FConvert 1012 + 1014: 11(fvec4) Load 13(outp) + 1015: 11(fvec4) VectorTimesScalar 1014 1013 + Store 13(outp) 1015 Return FunctionEnd diff --git a/Test/baseResults/spv.400.tesc.out b/Test/baseResults/spv.400.tesc.out index 02c7a6cf..eea07ce7 100755 --- a/Test/baseResults/spv.400.tesc.out +++ b/Test/baseResults/spv.400.tesc.out @@ -10,6 +10,8 @@ Linked tessellation control stage: // Id's are bound by 93 Capability Tessellation + Capability TessellationPointSize + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint TessellationControl 4 "main" 23 40 43 46 52 66 73 79 83 84 87 88 91 92 @@ -71,7 +73,7 @@ Linked tessellation control stage: 3: TypeFunction 2 6: TypeInt 32 0 7: 6(int) Constant 1 - 8: 6(int) Constant 1023 + 8: 6(int) Constant 4062 9: 6(int) Constant 0 10: TypeInt 32 1 11: TypePointer Function 10(int) diff --git a/Test/baseResults/spv.400.tese.out b/Test/baseResults/spv.400.tese.out index 325da158..03e181ce 100755 --- a/Test/baseResults/spv.400.tese.out +++ b/Test/baseResults/spv.400.tese.out @@ -10,6 +10,8 @@ Linked tessellation evaluation stage: // Id's are bound by 98 Capability Tessellation + Capability TessellationPointSize + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint TessellationEvaluation 4 "main" 21 38 41 47 53 61 68 77 81 82 86 90 93 94 97 diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out index 3ba3dacb..cb535599 100644 --- a/Test/baseResults/spv.420.geom.out +++ b/Test/baseResults/spv.420.geom.out @@ -7,9 +7,12 @@ Linked geometry stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 74 +// Id's are bound by 72 Capability Geometry + Capability GeometryPointSize + Capability GeometryStreams + Capability MultiViewport 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Geometry 4 "main" 14 23 28 33 46 @@ -34,7 +37,6 @@ Linked geometry stage: 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 @@ -44,6 +46,7 @@ Linked geometry stage: Decorate 28(gl_ViewportIndex) Stream 0 Decorate 28(gl_ViewportIndex) BuiltIn ViewportIndex Decorate 33(gl_InvocationID) BuiltIn InvocationId + Decorate 41(s2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -92,12 +95,10 @@ Linked geometry stage: 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 + 63: TypePointer Private 15(int) + 64(i): 63(ptr) Variable Private 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 diff --git a/Test/baseResults/spv.430.vert.out b/Test/baseResults/spv.430.vert.out index 186406d5..a1487d53 100755 --- a/Test/baseResults/spv.430.vert.out +++ b/Test/baseResults/spv.430.vert.out @@ -1,5 +1,5 @@ spv.430.vert -Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. Linked vertex stage: @@ -7,50 +7,76 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 63 +// Id's are bound by 66 Capability Shader + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 12 23 34 44 45 61 62 - Source GLSL 430 + EntryPoint Vertex 4 "main" 12 23 34 38 41 42 62 65 + Source GLSL 450 Name 4 "main" Name 10 "gl_PerVertex" MemberName 10(gl_PerVertex) 0 "gl_ClipDistance" Name 12 "" Name 23 "bad" Name 34 "badorder3" - 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" + Name 38 "f" + Name 41 "badorder" + Name 42 "badorder2" + Name 43 "boundblock" + MemberName 43(boundblock) 0 "aoeu" + Name 45 "boundInst" + Name 46 "anonblock" + MemberName 46(anonblock) 0 "aoeu" + Name 48 "" + Name 52 "sampb1" + Name 55 "sampb2" + Name 56 "sampb4" + Name 59 "S" + MemberName 59(S) 0 "a" + MemberName 59(S) 1 "b" + MemberName 59(S) 2 "c" + Name 60 "SS" + MemberName 60(SS) 0 "b" + MemberName 60(SS) 1 "s" + MemberName 60(SS) 2 "c" + Name 62 "var" + Name 63 "MS" + MemberName 63(MS) 0 "f" + Name 65 "outMS" MemberDecorate 10(gl_PerVertex) 0 BuiltIn ClipDistance Decorate 10(gl_PerVertex) Block Decorate 34(badorder3) Flat - 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 + Decorate 42(badorder2) Invariant + MemberDecorate 43(boundblock) 0 Offset 0 + Decorate 43(boundblock) Block + Decorate 45(boundInst) DescriptorSet 0 + Decorate 45(boundInst) Binding 3 + MemberDecorate 46(anonblock) 0 Offset 0 + Decorate 46(anonblock) Block + Decorate 48 DescriptorSet 0 + Decorate 48 Binding 7 + Decorate 52(sampb1) DescriptorSet 0 + Decorate 52(sampb1) Binding 4 + Decorate 55(sampb2) DescriptorSet 0 + Decorate 55(sampb2) Binding 5 + Decorate 56(sampb4) DescriptorSet 0 + Decorate 56(sampb4) Binding 31 + MemberDecorate 59(S) 0 Flat + MemberDecorate 59(S) 0 Location 1 + MemberDecorate 59(S) 1 Flat + MemberDecorate 59(S) 1 Location 2 + MemberDecorate 59(S) 2 Flat + MemberDecorate 59(S) 2 Location 3 + MemberDecorate 60(SS) 0 Flat + MemberDecorate 60(SS) 0 Location 0 + MemberDecorate 60(SS) 1 Flat + MemberDecorate 60(SS) 1 Location 1 + MemberDecorate 60(SS) 2 Flat + MemberDecorate 60(SS) 2 Location 4 + MemberDecorate 63(MS) 0 Location 17 + Decorate 63(MS) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -77,29 +103,32 @@ Linked vertex stage: 33: TypePointer Output 19(fvec4) 34(badorder3): 33(ptr) Variable Output 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 + 38(f): 25(ptr) Variable Input + 41(badorder): 35(ptr) Variable Input + 42(badorder2): 33(ptr) Variable Output + 43(boundblock): TypeStruct 13(int) + 44: TypePointer Uniform 43(boundblock) + 45(boundInst): 44(ptr) Variable Uniform + 46(anonblock): TypeStruct 13(int) + 47: TypePointer Uniform 46(anonblock) + 48: 47(ptr) Variable Uniform + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 + 52(sampb1): 51(ptr) Variable UniformConstant + 53: TypeArray 50 20 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 + 55(sampb2): 54(ptr) Variable UniformConstant + 56(sampb4): 51(ptr) Variable UniformConstant + 57: TypeVector 7(int) 2 + 58: TypeVector 6(float) 3 + 59(S): TypeStruct 6(float) 57(ivec2) 58(fvec3) + 60(SS): TypeStruct 19(fvec4) 59(S) 19(fvec4) + 61: TypePointer Output 60(SS) + 62(var): 61(ptr) Variable Output + 63(MS): TypeStruct 6(float) + 64: TypePointer Output 63(MS) + 65(outMS): 64(ptr) Variable Output 4(main): 2 Function None 3 5: Label 18: 17(ptr) AccessChain 12 14 15 @@ -115,8 +144,8 @@ Linked vertex stage: Store 34(badorder3) 37 Branch 32 32: Label - 40: 6(float) Load 39(f) - 41: 17(ptr) AccessChain 12 14 14 - Store 41 40 + 39: 6(float) Load 38(f) + 40: 17(ptr) AccessChain 12 14 14 + Store 40 39 Return FunctionEnd diff --git a/Test/baseResults/spv.AofA.frag.out b/Test/baseResults/spv.AofA.frag.out index 822ad3d5..0dbf69ce 100644 --- a/Test/baseResults/spv.AofA.frag.out +++ b/Test/baseResults/spv.AofA.frag.out @@ -7,34 +7,40 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 103 +// Id's are bound by 104 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 38 43 77 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 39 44 68 70 72 78 + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 17 "foo(f1[5][7];" Name 16 "a" Name 20 "r" - Name 38 "outfloat" - Name 41 "g4" - Name 43 "g5" - Name 44 "param" - Name 47 "u" - Name 51 "param" - Name 65 "many" - Name 67 "i" - Name 69 "j" - Name 71 "k" - Name 77 "infloat" - Name 93 "uAofA" - MemberName 93(uAofA) 0 "f" - Name 97 "nameAofA" - Decorate 93(uAofA) GLSLShared - Decorate 93(uAofA) Block + Name 39 "outfloat" + Name 42 "g4" + Name 44 "g5" + Name 45 "param" + Name 48 "u" + Name 52 "param" + Name 66 "many" + Name 68 "i" + Name 70 "j" + Name 72 "k" + Name 78 "infloat" + Name 94 "uAofA" + MemberName 94(uAofA) 0 "f" + Name 98 "nameAofA" + Decorate 68(i) Flat + Decorate 70(j) Flat + Decorate 72(k) Flat + Decorate 92 ArrayStride 16 + Decorate 93 ArrayStride 64 + MemberDecorate 94(uAofA) 0 Offset 0 + Decorate 94(uAofA) Block + Decorate 98(nameAofA) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -53,82 +59,82 @@ Linked fragment stage: 25: 21(int) Constant 0 28: 21(int) Constant 1 32: 21(int) Constant 3 - 37: TypePointer Output 6(float) - 38(outfloat): 37(ptr) Variable Output - 39: 6(float) Constant 0 - 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 - 49: TypePointer Function 6(float) - 54: 7(int) Constant 6 - 55: TypeArray 6(float) 54 - 56: TypeArray 55 10 - 57: TypeArray 56 13 - 58: 7(int) Constant 3 - 59: TypeArray 57 58 - 60: 7(int) Constant 2 - 61: TypeArray 59 60 - 62: 7(int) Constant 1 - 63: TypeArray 61 62 - 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 Private 6(float) - 91: TypeArray 6(float) 13 - 92: TypeArray 91 60 - 93(uAofA): TypeStruct 92 - 94: TypeArray 93(uAofA) 10 - 95: TypeArray 94 58 - 96: TypePointer Uniform 95 - 97(nameAofA): 96(ptr) Variable Uniform - 98: TypePointer Uniform 6(float) + 38: TypePointer Output 6(float) + 39(outfloat): 38(ptr) Variable Output + 40: 6(float) Constant 0 + 41: TypePointer Private 14 + 42(g4): 41(ptr) Variable Private + 43: TypePointer Input 11 + 44(g5): 43(ptr) Variable Input + 49: 6(float) Constant 1077936128 + 50: TypePointer Function 6(float) + 55: 7(int) Constant 6 + 56: TypeArray 6(float) 55 + 57: TypeArray 56 10 + 58: TypeArray 57 13 + 59: 7(int) Constant 3 + 60: TypeArray 58 59 + 61: 7(int) Constant 2 + 62: TypeArray 60 61 + 63: 7(int) Constant 1 + 64: TypeArray 62 63 + 65: TypePointer Private 64 + 66(many): 65(ptr) Variable Private + 67: TypePointer Input 21(int) + 68(i): 67(ptr) Variable Input + 70(j): 67(ptr) Variable Input + 72(k): 67(ptr) Variable Input + 77: TypePointer Input 6(float) + 78(infloat): 77(ptr) Variable Input + 80: TypePointer Private 6(float) + 92: TypeArray 6(float) 13 + 93: TypeArray 92 61 + 94(uAofA): TypeStruct 93 + 95: TypeArray 94(uAofA) 10 + 96: TypeArray 95 59 + 97: TypePointer Uniform 96 + 98(nameAofA): 97(ptr) Variable Uniform + 99: TypePointer Uniform 6(float) 4(main): 2 Function None 3 5: Label - 44(param): 12(ptr) Variable Function - 47(u): 12(ptr) Variable Function - 51(param): 12(ptr) Variable Function - Store 38(outfloat) 39 - 45: 11 Load 43(g5) - Store 44(param) 45 - 46: 14 FunctionCall 17(foo(f1[5][7];) 44(param) - Store 41(g4) 46 - 50: 49(ptr) AccessChain 47(u) 22 22 - Store 50 48 - 52: 11 Load 47(u) - Store 51(param) 52 - 53: 14 FunctionCall 17(foo(f1[5][7];) 51(param) - 68: 21(int) Load 67(i) - 70: 21(int) Load 69(j) - 72: 21(int) Load 71(k) - 73: 21(int) Load 67(i) - 74: 21(int) Load 69(j) - 75: 21(int) Load 71(k) - 78: 6(float) Load 77(infloat) - 80: 79(ptr) AccessChain 65(many) 68 70 72 73 74 75 - Store 80 78 - 81: 21(int) Load 69(j) - 82: 21(int) Load 69(j) - 83: 21(int) Load 69(j) - 84: 21(int) Load 69(j) - 85: 21(int) Load 69(j) - 86: 21(int) Load 69(j) - 87: 79(ptr) AccessChain 65(many) 81 82 83 84 85 86 - 88: 6(float) Load 87 - 89: 6(float) Load 38(outfloat) - 90: 6(float) FAdd 89 88 - Store 38(outfloat) 90 - 99: 98(ptr) AccessChain 97(nameAofA) 28 22 25 25 32 - 100: 6(float) Load 99 - 101: 6(float) Load 38(outfloat) - 102: 6(float) FAdd 101 100 - Store 38(outfloat) 102 + 45(param): 12(ptr) Variable Function + 48(u): 12(ptr) Variable Function + 52(param): 12(ptr) Variable Function + Store 39(outfloat) 40 + 46: 11 Load 44(g5) + Store 45(param) 46 + 47: 14 FunctionCall 17(foo(f1[5][7];) 45(param) + Store 42(g4) 47 + 51: 50(ptr) AccessChain 48(u) 22 22 + Store 51 49 + 53: 11 Load 48(u) + Store 52(param) 53 + 54: 14 FunctionCall 17(foo(f1[5][7];) 52(param) + 69: 21(int) Load 68(i) + 71: 21(int) Load 70(j) + 73: 21(int) Load 72(k) + 74: 21(int) Load 68(i) + 75: 21(int) Load 70(j) + 76: 21(int) Load 72(k) + 79: 6(float) Load 78(infloat) + 81: 80(ptr) AccessChain 66(many) 69 71 73 74 75 76 + Store 81 79 + 82: 21(int) Load 70(j) + 83: 21(int) Load 70(j) + 84: 21(int) Load 70(j) + 85: 21(int) Load 70(j) + 86: 21(int) Load 70(j) + 87: 21(int) Load 70(j) + 88: 80(ptr) AccessChain 66(many) 82 83 84 85 86 87 + 89: 6(float) Load 88 + 90: 6(float) Load 39(outfloat) + 91: 6(float) FAdd 90 89 + Store 39(outfloat) 91 + 100: 99(ptr) AccessChain 98(nameAofA) 28 22 25 25 32 + 101: 6(float) Load 100 + 102: 6(float) Load 39(outfloat) + 103: 6(float) FAdd 102 101 + Store 39(outfloat) 103 Return FunctionEnd 17(foo(f1[5][7];): 14 Function None 15 diff --git a/Test/baseResults/spv.Operations.frag.out b/Test/baseResults/spv.Operations.frag.out index 16b0013c..b3a6d283 100755 --- a/Test/baseResults/spv.Operations.frag.out +++ b/Test/baseResults/spv.Operations.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 507 +// Id's are bound by 509 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 483 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 22 212 288 485 503 508 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "v" @@ -27,52 +27,56 @@ Linked fragment stage: Name 288 "uui" Name 305 "b" Name 342 "ub42" - Name 483 "FragColor" - Name 501 "uiv4" - Name 503 "ub" - Name 506 "uuv4" + Name 485 "FragColor" + Name 503 "uiv4" + Name 505 "ub" + Name 508 "uuv4" + Decorate 22(ui) Flat + Decorate 288(uui) Flat + Decorate 503(uiv4) Flat + Decorate 508(uuv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypePointer Function 7(fvec4) - 10: TypePointer UniformConstant 7(fvec4) - 11(uv4): 10(ptr) Variable UniformConstant + 10: TypePointer Input 7(fvec4) + 11(uv4): 10(ptr) Variable Input 18: TypeInt 32 1 19: TypePointer Function 18(int) - 21: TypePointer UniformConstant 18(int) - 22(ui): 21(ptr) Variable UniformConstant + 21: TypePointer Input 18(int) + 22(ui): 21(ptr) Variable Input 141: TypeInt 32 0 142: 141(int) Constant 0 143: TypePointer Function 6(float) 178: TypeBool 179: TypeVector 178(bool) 4 - 180: TypePointer UniformConstant 179(bvec4) - 181(ub41): 180(ptr) Variable UniformConstant - 211: TypePointer UniformConstant 6(float) - 212(uf): 211(ptr) Variable UniformConstant + 180: TypePointer Private 179(bvec4) + 181(ub41): 180(ptr) Variable Private + 211: TypePointer Input 6(float) + 212(uf): 211(ptr) Variable Input 284: TypePointer Function 141(int) - 287: TypePointer UniformConstant 141(int) - 288(uui): 287(ptr) Variable UniformConstant + 287: TypePointer Input 141(int) + 288(uui): 287(ptr) Variable Input 304: TypePointer Function 178(bool) - 342(ub42): 180(ptr) Variable UniformConstant - 396: 18(int) Constant 2 - 403: 18(int) Constant 1 - 433: TypeVector 6(float) 3 - 452: 6(float) Constant 1073741824 - 459: 6(float) Constant 1065353216 - 464: 18(int) Constant 66 - 470: 18(int) Constant 17 - 482: TypePointer Output 7(fvec4) - 483(FragColor): 482(ptr) Variable Output - 499: TypeVector 18(int) 4 - 500: TypePointer UniformConstant 499(ivec4) - 501(uiv4): 500(ptr) Variable UniformConstant - 502: TypePointer UniformConstant 178(bool) - 503(ub): 502(ptr) Variable UniformConstant - 504: TypeVector 141(int) 4 - 505: TypePointer UniformConstant 504(ivec4) - 506(uuv4): 505(ptr) Variable UniformConstant + 342(ub42): 180(ptr) Variable Private + 398: 18(int) Constant 2 + 405: 18(int) Constant 1 + 435: TypeVector 6(float) 3 + 454: 6(float) Constant 1073741824 + 461: 6(float) Constant 1065353216 + 466: 18(int) Constant 66 + 472: 18(int) Constant 17 + 484: TypePointer Output 7(fvec4) + 485(FragColor): 484(ptr) Variable Output + 501: TypeVector 18(int) 4 + 502: TypePointer Input 501(ivec4) + 503(uiv4): 502(ptr) Variable Input + 504: TypePointer Private 178(bool) + 505(ub): 504(ptr) Variable Private + 506: TypeVector 141(int) 4 + 507: TypePointer Input 506(ivec4) + 508(uuv4): 507(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function @@ -80,7 +84,7 @@ Linked fragment stage: 188(f): 143(ptr) Variable Function 285(u): 284(ptr) Variable Function 305(b): 304(ptr) Variable Function - 484: 8(ptr) Variable Function + 486: 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 @@ -529,137 +533,142 @@ Linked fragment stage: 388: 18(int) Load 20(i) 389: 18(int) Load 22(ui) 390: 178(bool) INotEqual 388 389 - 391: 18(int) Load 20(i) - 392: 18(int) Load 22(ui) - 393: 178(bool) IEqual 391 392 - 394: 178(bool) LogicalAnd 390 393 - 395: 18(int) Load 20(i) - 397: 178(bool) INotEqual 395 396 - 398: 178(bool) LogicalNotEqual 394 397 + SelectionMerge 392 None + BranchConditional 390 391 392 + 391: Label + 393: 18(int) Load 20(i) + 394: 18(int) Load 22(ui) + 395: 178(bool) IEqual 393 394 + Branch 392 + 392: Label + 396: 178(bool) Phi 390 386 395 391 + 397: 18(int) Load 20(i) + 399: 178(bool) INotEqual 397 398 + 400: 178(bool) LogicalNotEqual 396 399 Branch 387 387: Label - 399: 178(bool) Phi 384 365 398 386 - SelectionMerge 401 None - BranchConditional 399 400 401 - 400: Label - 402: 18(int) Load 20(i) - 404: 18(int) IAdd 402 403 - Store 20(i) 404 - Branch 401 - 401: Label - 405: 6(float) Load 212(uf) - 406: 6(float) Load 212(uf) - 407: 6(float) FAdd 405 406 + 401: 178(bool) Phi 384 365 400 392 + SelectionMerge 403 None + BranchConditional 401 402 403 + 402: Label + 404: 18(int) Load 20(i) + 406: 18(int) IAdd 404 405 + Store 20(i) 406 + Branch 403 + 403: Label + 407: 6(float) Load 212(uf) 408: 6(float) Load 212(uf) - 409: 6(float) FMul 407 408 + 409: 6(float) FAdd 407 408 410: 6(float) Load 212(uf) - 411: 6(float) FSub 409 410 + 411: 6(float) FMul 409 410 412: 6(float) Load 212(uf) - 413: 6(float) FDiv 411 412 - Store 188(f) 413 - 414: 7(fvec4) Load 9(v) - 415: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 414 - 416: 6(float) Load 188(f) - 417: 6(float) FAdd 416 415 - Store 188(f) 417 - 418: 7(fvec4) Load 9(v) - 419: 7(fvec4) Load 9(v) - 420: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 418 419 - 421: 6(float) Load 188(f) - 422: 6(float) FAdd 421 420 - Store 188(f) 422 - 423: 7(fvec4) Load 9(v) - 424: 7(fvec4) Load 9(v) - 425: 6(float) Dot 423 424 - 426: 6(float) Load 188(f) - 427: 6(float) FAdd 426 425 - Store 188(f) 427 + 413: 6(float) FSub 411 412 + 414: 6(float) Load 212(uf) + 415: 6(float) FDiv 413 414 + Store 188(f) 415 + 416: 7(fvec4) Load 9(v) + 417: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 416 + 418: 6(float) Load 188(f) + 419: 6(float) FAdd 418 417 + Store 188(f) 419 + 420: 7(fvec4) Load 9(v) + 421: 7(fvec4) Load 9(v) + 422: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421 + 423: 6(float) Load 188(f) + 424: 6(float) FAdd 423 422 + Store 188(f) 424 + 425: 7(fvec4) Load 9(v) + 426: 7(fvec4) Load 9(v) + 427: 6(float) Dot 425 426 428: 6(float) Load 188(f) - 429: 6(float) Load 212(uf) - 430: 6(float) FMul 428 429 - 431: 6(float) Load 188(f) - 432: 6(float) FAdd 431 430 - Store 188(f) 432 - 434: 7(fvec4) Load 9(v) - 435: 433(fvec3) VectorShuffle 434 434 0 1 2 + 429: 6(float) FAdd 428 427 + Store 188(f) 429 + 430: 6(float) Load 188(f) + 431: 6(float) Load 212(uf) + 432: 6(float) FMul 430 431 + 433: 6(float) Load 188(f) + 434: 6(float) FAdd 433 432 + Store 188(f) 434 436: 7(fvec4) Load 9(v) - 437: 433(fvec3) VectorShuffle 436 436 0 1 2 - 438: 433(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 435 437 - 439: 6(float) CompositeExtract 438 0 - 440: 6(float) Load 188(f) - 441: 6(float) FAdd 440 439 - Store 188(f) 441 + 437: 435(fvec3) VectorShuffle 436 436 0 1 2 + 438: 7(fvec4) Load 9(v) + 439: 435(fvec3) VectorShuffle 438 438 0 1 2 + 440: 435(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 437 439 + 441: 6(float) CompositeExtract 440 0 442: 6(float) Load 188(f) - 443: 6(float) Load 212(uf) - 444: 178(bool) FOrdEqual 442 443 - 445: 178(bool) LogicalNot 444 - SelectionMerge 447 None - BranchConditional 445 446 447 - 446: Label - 448: 6(float) Load 188(f) - 449: 6(float) Load 212(uf) - 450: 178(bool) FOrdNotEqual 448 449 - 451: 6(float) Load 188(f) - 453: 178(bool) FOrdNotEqual 451 452 - 454: 178(bool) LogicalAnd 450 453 - Branch 447 - 447: Label - 455: 178(bool) Phi 444 401 454 446 - SelectionMerge 457 None - BranchConditional 455 456 457 - 456: Label - 458: 6(float) Load 188(f) - 460: 6(float) FAdd 458 459 - Store 188(f) 460 - Branch 457 - 457: Label - 461: 18(int) Load 22(ui) - 462: 18(int) Load 20(i) - 463: 18(int) BitwiseAnd 462 461 - Store 20(i) 463 - 465: 18(int) Load 20(i) - 466: 18(int) BitwiseOr 465 464 - Store 20(i) 466 - 467: 18(int) Load 22(ui) - 468: 18(int) Load 20(i) - 469: 18(int) BitwiseXor 468 467 - Store 20(i) 469 - 471: 18(int) Load 20(i) - 472: 18(int) SMod 471 470 - Store 20(i) 472 + 443: 6(float) FAdd 442 441 + Store 188(f) 443 + 444: 6(float) Load 188(f) + 445: 6(float) Load 212(uf) + 446: 178(bool) FOrdEqual 444 445 + 447: 178(bool) LogicalNot 446 + SelectionMerge 449 None + BranchConditional 447 448 449 + 448: Label + 450: 6(float) Load 188(f) + 451: 6(float) Load 212(uf) + 452: 178(bool) FOrdNotEqual 450 451 + 453: 6(float) Load 188(f) + 455: 178(bool) FOrdNotEqual 453 454 + 456: 178(bool) LogicalAnd 452 455 + Branch 449 + 449: Label + 457: 178(bool) Phi 446 403 456 448 + SelectionMerge 459 None + BranchConditional 457 458 459 + 458: Label + 460: 6(float) Load 188(f) + 462: 6(float) FAdd 460 461 + Store 188(f) 462 + Branch 459 + 459: Label + 463: 18(int) Load 22(ui) + 464: 18(int) Load 20(i) + 465: 18(int) BitwiseAnd 464 463 + Store 20(i) 465 + 467: 18(int) Load 20(i) + 468: 18(int) BitwiseOr 467 466 + Store 20(i) 468 + 469: 18(int) Load 22(ui) + 470: 18(int) Load 20(i) + 471: 18(int) BitwiseXor 470 469 + Store 20(i) 471 473: 18(int) Load 20(i) - 474: 18(int) ShiftRightArithmetic 473 396 + 474: 18(int) SMod 473 472 Store 20(i) 474 - 475: 18(int) Load 22(ui) - 476: 18(int) Load 20(i) - 477: 18(int) ShiftLeftLogical 476 475 - Store 20(i) 477 + 475: 18(int) Load 20(i) + 476: 18(int) ShiftRightArithmetic 475 398 + Store 20(i) 476 + 477: 18(int) Load 22(ui) 478: 18(int) Load 20(i) - 479: 18(int) Not 478 + 479: 18(int) ShiftLeftLogical 478 477 Store 20(i) 479 - 480: 178(bool) Load 305(b) - 481: 178(bool) LogicalNot 480 - Store 305(b) 481 - 485: 178(bool) Load 305(b) - SelectionMerge 487 None - BranchConditional 485 486 496 - 486: Label - 488: 18(int) Load 20(i) - 489: 6(float) ConvertSToF 488 - 490: 7(fvec4) CompositeConstruct 489 489 489 489 - 491: 6(float) Load 188(f) + 480: 18(int) Load 20(i) + 481: 18(int) Not 480 + Store 20(i) 481 + 482: 178(bool) Load 305(b) + 483: 178(bool) LogicalNot 482 + Store 305(b) 483 + 487: 178(bool) Load 305(b) + SelectionMerge 489 None + BranchConditional 487 488 498 + 488: Label + 490: 18(int) Load 20(i) + 491: 6(float) ConvertSToF 490 492: 7(fvec4) CompositeConstruct 491 491 491 491 - 493: 7(fvec4) FAdd 490 492 - 494: 7(fvec4) Load 9(v) - 495: 7(fvec4) FAdd 493 494 - Store 484 495 - Branch 487 - 496: Label - 497: 7(fvec4) Load 9(v) - Store 484 497 - Branch 487 - 487: Label - 498: 7(fvec4) Load 484 - Store 483(FragColor) 498 + 493: 6(float) Load 188(f) + 494: 7(fvec4) CompositeConstruct 493 493 493 493 + 495: 7(fvec4) FAdd 492 494 + 496: 7(fvec4) Load 9(v) + 497: 7(fvec4) FAdd 495 496 + Store 486 497 + Branch 489 + 498: Label + 499: 7(fvec4) Load 9(v) + Store 486 499 + Branch 489 + 489: Label + 500: 7(fvec4) Load 486 + Store 485(FragColor) 500 Return FunctionEnd diff --git a/Test/baseResults/spv.accessChain.frag.out b/Test/baseResults/spv.accessChain.frag.out index b434c700..e9a9d81b 100755 --- a/Test/baseResults/spv.accessChain.frag.out +++ b/Test/baseResults/spv.accessChain.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 65 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 65 149 + ExecutionMode 4 OriginUpperLeft Source GLSL 420 Name 4 "main" Name 8 "S" @@ -72,6 +72,7 @@ Linked fragment stage: Name 190 "param" Name 194 "param" Decorate 65(OutColor) Location 0 + Decorate 149(u) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -92,8 +93,8 @@ Linked fragment stage: 141: 6(float) Constant 0 142: 7(fvec3) ConstantComposite 141 141 141 143: TypePointer Function 8(S) - 148: TypePointer UniformConstant 13(int) - 149(u): 148(ptr) Variable UniformConstant + 148: TypePointer Input 13(int) + 149(u): 148(ptr) Variable Input 4(main): 2 Function None 3 5: Label 144(s): 143(ptr) Variable Function diff --git a/Test/baseResults/spv.aggOps.frag.out b/Test/baseResults/spv.aggOps.frag.out index 124c8fb8..4888bea4 100644 --- a/Test/baseResults/spv.aggOps.frag.out +++ b/Test/baseResults/spv.aggOps.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 380 +// Id's are bound by 215 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 16 41 90 376 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 16 41 101 213 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 8 "s1" @@ -23,41 +23,47 @@ Linked fragment stage: Name 16 "u" Name 37 "b" Name 41 "w" - Name 55 "s2" - MemberName 55(s2) 0 "i" - MemberName 55(s2) 1 "f" - MemberName 55(s2) 2 "s1_1" - Name 57 "foo2a" - Name 59 "foo2b" - Name 82 "v" - Name 86 "samp2D" - Name 90 "coord" - Name 341 "s1" - MemberName 341(s1) 0 "i" - MemberName 341(s1) 1 "f" - Name 342 "s2" - MemberName 342(s2) 0 "i" - MemberName 342(s2) 1 "f" - MemberName 342(s2) 2 "s1_1" - Name 343 "bn" - MemberName 343(bn) 0 "foo2a" - Name 345 "bi" - Name 347 "s1" - MemberName 347(s1) 0 "i" - MemberName 347(s1) 1 "f" - Name 348 "s2" - MemberName 348(s2) 0 "i" - MemberName 348(s2) 1 "f" - MemberName 348(s2) 2 "s1_1" - Name 376 "color" - Name 379 "foo1" - MemberDecorate 341(s1) 0 Offset 0 - MemberDecorate 341(s1) 1 Offset 4 - MemberDecorate 342(s2) 0 Offset 0 - MemberDecorate 342(s2) 1 Offset 4 - MemberDecorate 342(s2) 2 Offset 16 - MemberDecorate 343(bn) 0 Offset 0 - Decorate 343(bn) Block + Name 55 "s1" + MemberName 55(s1) 0 "i" + MemberName 55(s1) 1 "f" + Name 56 "s2" + MemberName 56(s2) 0 "i" + MemberName 56(s2) 1 "f" + MemberName 56(s2) 2 "s1_1" + Name 57 "ub1" + MemberName 57(ub1) 0 "foo2a" + Name 59 "uName1" + Name 64 "s1" + MemberName 64(s1) 0 "i" + MemberName 64(s1) 1 "f" + Name 65 "s2" + MemberName 65(s2) 0 "i" + MemberName 65(s2) 1 "f" + MemberName 65(s2) 2 "s1_1" + Name 66 "ub2" + MemberName 66(ub2) 0 "foo2b" + Name 68 "uName2" + Name 93 "v" + Name 97 "samp2D" + Name 101 "coord" + Name 213 "color" + MemberDecorate 55(s1) 0 Offset 0 + MemberDecorate 55(s1) 1 Offset 4 + MemberDecorate 56(s2) 0 Offset 0 + MemberDecorate 56(s2) 1 Offset 4 + MemberDecorate 56(s2) 2 Offset 16 + MemberDecorate 57(ub1) 0 Offset 0 + Decorate 57(ub1) Block + Decorate 59(uName1) DescriptorSet 0 + MemberDecorate 64(s1) 0 Offset 0 + MemberDecorate 64(s1) 1 Offset 4 + MemberDecorate 65(s2) 0 Offset 0 + MemberDecorate 65(s2) 1 Offset 4 + MemberDecorate 65(s2) 2 Offset 8 + MemberDecorate 66(ub2) 0 Offset 0 + Decorate 66(ub2) BufferBlock + Decorate 68(uName2) DescriptorSet 0 + Decorate 97(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -81,46 +87,43 @@ Linked fragment stage: 39: 7(float) Constant 1099431936 40: 8(s1) ConstantComposite 38 39 41(w): 15(ptr) Variable Input - 55(s2): TypeStruct 6(int) 7(float) 8(s1) - 56: TypePointer UniformConstant 55(s2) - 57(foo2a): 56(ptr) Variable UniformConstant - 59(foo2b): 56(ptr) Variable UniformConstant - 61: TypeBool - 81: TypePointer Function 14(fvec4) - 83: TypeImage 7(float) 2D sampled format:Unknown - 84: TypeSampledImage 83 - 85: TypePointer UniformConstant 84 - 86(samp2D): 85(ptr) Variable UniformConstant - 88: TypeVector 7(float) 2 - 89: TypePointer Input 88(fvec2) - 90(coord): 89(ptr) Variable Input - 95: 7(float) Constant 1073741824 - 101: TypeVector 61(bool) 4 - 106: 7(float) Constant 1077936128 - 115: 7(float) Constant 1082130432 - 121: TypeVector 61(bool) 2 - 126: 7(float) Constant 1084227584 - 232: 7(float) Constant 1086324736 - 338: 7(float) Constant 1088421888 - 341(s1): TypeStruct 6(int) 7(float) - 342(s2): TypeStruct 6(int) 7(float) 341(s1) - 343(bn): TypeStruct 342(s2) - 344: TypePointer Uniform 343(bn) - 345(bi): 344(ptr) Variable Uniform - 346: 6(int) Constant 0 - 347(s1): TypeStruct 6(int) 7(float) - 348(s2): TypeStruct 6(int) 7(float) 347(s1) - 349: TypePointer Uniform 342(s2) - 372: 7(float) Constant 1090519040 - 375: TypePointer Output 14(fvec4) - 376(color): 375(ptr) Variable Output - 378: TypePointer UniformConstant 8(s1) - 379(foo1): 378(ptr) Variable UniformConstant + 55(s1): TypeStruct 6(int) 7(float) + 56(s2): TypeStruct 6(int) 7(float) 55(s1) + 57(ub1): TypeStruct 56(s2) + 58: TypePointer Uniform 57(ub1) + 59(uName1): 58(ptr) Variable Uniform + 60: 6(int) Constant 0 + 61: TypePointer Uniform 56(s2) + 64(s1): TypeStruct 6(int) 7(float) + 65(s2): TypeStruct 6(int) 7(float) 64(s1) + 66(ub2): TypeStruct 65(s2) + 67: TypePointer Uniform 66(ub2) + 68(uName2): 67(ptr) Variable Uniform + 69: TypePointer Uniform 65(s2) + 72: TypeBool + 92: TypePointer Function 14(fvec4) + 94: TypeImage 7(float) 2D sampled format:Unknown + 95: TypeSampledImage 94 + 96: TypePointer UniformConstant 95 + 97(samp2D): 96(ptr) Variable UniformConstant + 99: TypeVector 7(float) 2 + 100: TypePointer Input 99(fvec2) + 101(coord): 100(ptr) Variable Input + 106: 7(float) Constant 1073741824 + 112: TypeVector 72(bool) 4 + 117: 7(float) Constant 1077936128 + 126: 7(float) Constant 1082130432 + 132: TypeVector 72(bool) 2 + 137: 7(float) Constant 1084227584 + 173: 7(float) Constant 1086324736 + 209: 7(float) Constant 1088421888 + 212: TypePointer Output 14(fvec4) + 213(color): 212(ptr) Variable Output 4(main): 2 Function None 3 5: Label 13(a): 12(ptr) Variable Function 37(b): 12(ptr) Variable Function - 82(v): 81(ptr) Variable Function + 93(v): 92(ptr) Variable Function 19: 18(ptr) AccessChain 16(u) 17 20: 7(float) Load 19 21: 6(int) ConvertFToS 20 @@ -149,325 +152,159 @@ Linked fragment stage: 53: 8(s1) CompositeConstruct 50 52 54: 11 CompositeConstruct 40 47 53 Store 37(b) 54 - 58: 55(s2) Load 57(foo2a) - 60: 55(s2) Load 59(foo2b) - 62: 6(int) CompositeExtract 58 0 - 63: 6(int) CompositeExtract 60 0 - 64: 61(bool) IEqual 62 63 - 65: 7(float) CompositeExtract 58 1 - 66: 7(float) CompositeExtract 60 1 - 67: 61(bool) FOrdEqual 65 66 - 68: 61(bool) LogicalAnd 64 67 - 69: 8(s1) CompositeExtract 58 2 - 70: 8(s1) CompositeExtract 60 2 - 71: 6(int) CompositeExtract 69 0 - 72: 6(int) CompositeExtract 70 0 - 73: 61(bool) IEqual 71 72 - 74: 7(float) CompositeExtract 69 1 - 75: 7(float) CompositeExtract 70 1 - 76: 61(bool) FOrdEqual 74 75 - 77: 61(bool) LogicalAnd 73 76 - 78: 61(bool) LogicalAnd 68 77 - SelectionMerge 80 None - BranchConditional 78 79 93 - 79: Label - 87: 84 Load 86(samp2D) - 91: 88(fvec2) Load 90(coord) - 92: 14(fvec4) ImageSampleImplicitLod 87 91 - Store 82(v) 92 - Branch 80 - 93: Label - 94: 84 Load 86(samp2D) - 96: 88(fvec2) Load 90(coord) - 97: 88(fvec2) VectorTimesScalar 96 95 - 98: 14(fvec4) ImageSampleImplicitLod 94 97 - Store 82(v) 98 - Branch 80 - 80: Label - 99: 14(fvec4) Load 16(u) - 100: 14(fvec4) Load 82(v) - 102: 101(bvec4) FOrdEqual 99 100 - 103: 61(bool) All 102 - SelectionMerge 105 None - BranchConditional 103 104 105 + 62: 61(ptr) AccessChain 59(uName1) 60 + 63: 56(s2) Load 62 + 70: 69(ptr) AccessChain 68(uName2) 60 + 71: 65(s2) Load 70 + 73: 6(int) CompositeExtract 63 0 + 74: 6(int) CompositeExtract 71 0 + 75: 72(bool) IEqual 73 74 + 76: 7(float) CompositeExtract 63 1 + 77: 7(float) CompositeExtract 71 1 + 78: 72(bool) FOrdEqual 76 77 + 79: 72(bool) LogicalAnd 75 78 + 80: 55(s1) CompositeExtract 63 2 + 81: 64(s1) CompositeExtract 71 2 + 82: 6(int) CompositeExtract 80 0 + 83: 6(int) CompositeExtract 81 0 + 84: 72(bool) IEqual 82 83 + 85: 7(float) CompositeExtract 80 1 + 86: 7(float) CompositeExtract 81 1 + 87: 72(bool) FOrdEqual 85 86 + 88: 72(bool) LogicalAnd 84 87 + 89: 72(bool) LogicalAnd 79 88 + SelectionMerge 91 None + BranchConditional 89 90 104 + 90: Label + 98: 95 Load 97(samp2D) + 102: 99(fvec2) Load 101(coord) + 103: 14(fvec4) ImageSampleImplicitLod 98 102 + Store 93(v) 103 + Branch 91 104: Label - 107: 14(fvec4) Load 82(v) - 108: 14(fvec4) VectorTimesScalar 107 106 - Store 82(v) 108 - Branch 105 - 105: Label - 109: 14(fvec4) Load 16(u) - 110: 14(fvec4) Load 82(v) - 111: 101(bvec4) FOrdNotEqual 109 110 - 112: 61(bool) Any 111 - SelectionMerge 114 None - BranchConditional 112 113 114 - 113: Label - 116: 14(fvec4) Load 82(v) - 117: 14(fvec4) VectorTimesScalar 116 115 - Store 82(v) 117 - Branch 114 - 114: Label - 118: 88(fvec2) Load 90(coord) - 119: 14(fvec4) Load 82(v) - 120: 88(fvec2) VectorShuffle 119 119 1 3 - 122: 121(bvec2) FOrdEqual 118 120 - 123: 61(bool) All 122 + 105: 95 Load 97(samp2D) + 107: 99(fvec2) Load 101(coord) + 108: 99(fvec2) VectorTimesScalar 107 106 + 109: 14(fvec4) ImageSampleImplicitLod 105 108 + Store 93(v) 109 + Branch 91 + 91: Label + 110: 14(fvec4) Load 16(u) + 111: 14(fvec4) Load 93(v) + 113: 112(bvec4) FOrdEqual 110 111 + 114: 72(bool) All 113 + SelectionMerge 116 None + BranchConditional 114 115 116 + 115: Label + 118: 14(fvec4) Load 93(v) + 119: 14(fvec4) VectorTimesScalar 118 117 + Store 93(v) 119 + Branch 116 + 116: Label + 120: 14(fvec4) Load 16(u) + 121: 14(fvec4) Load 93(v) + 122: 112(bvec4) FOrdNotEqual 120 121 + 123: 72(bool) Any 122 SelectionMerge 125 None BranchConditional 123 124 125 124: Label - 127: 14(fvec4) Load 82(v) + 127: 14(fvec4) Load 93(v) 128: 14(fvec4) VectorTimesScalar 127 126 - Store 82(v) 128 + Store 93(v) 128 Branch 125 125: Label - 129: 11 Load 13(a) - 130: 11 Load 37(b) - 131: 8(s1) CompositeExtract 129 0 - 132: 8(s1) CompositeExtract 130 0 - 133: 6(int) CompositeExtract 131 0 - 134: 6(int) CompositeExtract 132 0 - 135: 61(bool) IEqual 133 134 - 136: 7(float) CompositeExtract 131 1 - 137: 7(float) CompositeExtract 132 1 - 138: 61(bool) FOrdEqual 136 137 - 139: 61(bool) LogicalAnd 135 138 - 140: 8(s1) CompositeExtract 129 1 - 141: 8(s1) CompositeExtract 130 1 - 142: 6(int) CompositeExtract 140 0 - 143: 6(int) CompositeExtract 141 0 - 144: 61(bool) IEqual 142 143 - 145: 7(float) CompositeExtract 140 1 - 146: 7(float) CompositeExtract 141 1 - 147: 61(bool) FOrdEqual 145 146 - 148: 61(bool) LogicalAnd 144 147 - 149: 61(bool) LogicalAnd 139 148 - 150: 8(s1) CompositeExtract 129 2 - 151: 8(s1) CompositeExtract 130 2 - 152: 6(int) CompositeExtract 150 0 + 129: 99(fvec2) Load 101(coord) + 130: 14(fvec4) Load 93(v) + 131: 99(fvec2) VectorShuffle 130 130 1 3 + 133: 132(bvec2) FOrdEqual 129 131 + 134: 72(bool) All 133 + SelectionMerge 136 None + BranchConditional 134 135 136 + 135: Label + 138: 14(fvec4) Load 93(v) + 139: 14(fvec4) VectorTimesScalar 138 137 + Store 93(v) 139 + Branch 136 + 136: Label + 140: 11 Load 13(a) + 141: 11 Load 37(b) + 142: 8(s1) CompositeExtract 140 0 + 143: 8(s1) CompositeExtract 141 0 + 144: 6(int) CompositeExtract 142 0 + 145: 6(int) CompositeExtract 143 0 + 146: 72(bool) IEqual 144 145 + 147: 7(float) CompositeExtract 142 1 + 148: 7(float) CompositeExtract 143 1 + 149: 72(bool) FOrdEqual 147 148 + 150: 72(bool) LogicalAnd 146 149 + 151: 8(s1) CompositeExtract 140 1 + 152: 8(s1) CompositeExtract 141 1 153: 6(int) CompositeExtract 151 0 - 154: 61(bool) IEqual 152 153 - 155: 7(float) CompositeExtract 150 1 + 154: 6(int) CompositeExtract 152 0 + 155: 72(bool) IEqual 153 154 156: 7(float) CompositeExtract 151 1 - 157: 61(bool) FOrdEqual 155 156 - 158: 61(bool) LogicalAnd 154 157 - 159: 61(bool) LogicalAnd 149 158 - 160: 8(s1) CompositeExtract 129 3 - 161: 8(s1) CompositeExtract 130 3 - 162: 6(int) CompositeExtract 160 0 + 157: 7(float) CompositeExtract 152 1 + 158: 72(bool) FOrdEqual 156 157 + 159: 72(bool) LogicalAnd 155 158 + 160: 72(bool) LogicalAnd 150 159 + 161: 8(s1) CompositeExtract 140 2 + 162: 8(s1) CompositeExtract 141 2 163: 6(int) CompositeExtract 161 0 - 164: 61(bool) IEqual 162 163 - 165: 7(float) CompositeExtract 160 1 + 164: 6(int) CompositeExtract 162 0 + 165: 72(bool) IEqual 163 164 166: 7(float) CompositeExtract 161 1 - 167: 61(bool) FOrdEqual 165 166 - 168: 61(bool) LogicalAnd 164 167 - 169: 61(bool) LogicalAnd 159 168 - 170: 8(s1) CompositeExtract 129 4 - 171: 8(s1) CompositeExtract 130 4 - 172: 6(int) CompositeExtract 170 0 - 173: 6(int) CompositeExtract 171 0 - 174: 61(bool) IEqual 172 173 - 175: 7(float) CompositeExtract 170 1 - 176: 7(float) CompositeExtract 171 1 - 177: 61(bool) FOrdEqual 175 176 - 178: 61(bool) LogicalAnd 174 177 - 179: 61(bool) LogicalAnd 169 178 - 180: 8(s1) CompositeExtract 129 5 - 181: 8(s1) CompositeExtract 130 5 - 182: 6(int) CompositeExtract 180 0 - 183: 6(int) CompositeExtract 181 0 - 184: 61(bool) IEqual 182 183 - 185: 7(float) CompositeExtract 180 1 - 186: 7(float) CompositeExtract 181 1 - 187: 61(bool) FOrdEqual 185 186 - 188: 61(bool) LogicalAnd 184 187 - 189: 61(bool) LogicalAnd 179 188 - 190: 8(s1) CompositeExtract 129 6 - 191: 8(s1) CompositeExtract 130 6 - 192: 6(int) CompositeExtract 190 0 - 193: 6(int) CompositeExtract 191 0 - 194: 61(bool) IEqual 192 193 - 195: 7(float) CompositeExtract 190 1 - 196: 7(float) CompositeExtract 191 1 - 197: 61(bool) FOrdEqual 195 196 - 198: 61(bool) LogicalAnd 194 197 - 199: 61(bool) LogicalAnd 189 198 - 200: 8(s1) CompositeExtract 129 7 - 201: 8(s1) CompositeExtract 130 7 - 202: 6(int) CompositeExtract 200 0 - 203: 6(int) CompositeExtract 201 0 - 204: 61(bool) IEqual 202 203 - 205: 7(float) CompositeExtract 200 1 - 206: 7(float) CompositeExtract 201 1 - 207: 61(bool) FOrdEqual 205 206 - 208: 61(bool) LogicalAnd 204 207 - 209: 61(bool) LogicalAnd 199 208 - 210: 8(s1) CompositeExtract 129 8 - 211: 8(s1) CompositeExtract 130 8 - 212: 6(int) CompositeExtract 210 0 - 213: 6(int) CompositeExtract 211 0 - 214: 61(bool) IEqual 212 213 - 215: 7(float) CompositeExtract 210 1 - 216: 7(float) CompositeExtract 211 1 - 217: 61(bool) FOrdEqual 215 216 - 218: 61(bool) LogicalAnd 214 217 - 219: 61(bool) LogicalAnd 209 218 - 220: 8(s1) CompositeExtract 129 9 - 221: 8(s1) CompositeExtract 130 9 - 222: 6(int) CompositeExtract 220 0 - 223: 6(int) CompositeExtract 221 0 - 224: 61(bool) IEqual 222 223 - 225: 7(float) CompositeExtract 220 1 - 226: 7(float) CompositeExtract 221 1 - 227: 61(bool) FOrdEqual 225 226 - 228: 61(bool) LogicalAnd 224 227 - 229: 61(bool) LogicalAnd 219 228 - SelectionMerge 231 None - BranchConditional 229 230 231 - 230: Label - 233: 14(fvec4) Load 82(v) - 234: 14(fvec4) VectorTimesScalar 233 232 - Store 82(v) 234 - Branch 231 - 231: Label - 235: 11 Load 13(a) - 236: 11 Load 37(b) - 237: 8(s1) CompositeExtract 235 0 - 238: 8(s1) CompositeExtract 236 0 - 239: 6(int) CompositeExtract 237 0 - 240: 6(int) CompositeExtract 238 0 - 241: 61(bool) INotEqual 239 240 - 242: 7(float) CompositeExtract 237 1 - 243: 7(float) CompositeExtract 238 1 - 244: 61(bool) FOrdNotEqual 242 243 - 245: 61(bool) LogicalOr 241 244 - 246: 8(s1) CompositeExtract 235 1 - 247: 8(s1) CompositeExtract 236 1 - 248: 6(int) CompositeExtract 246 0 - 249: 6(int) CompositeExtract 247 0 - 250: 61(bool) INotEqual 248 249 - 251: 7(float) CompositeExtract 246 1 - 252: 7(float) CompositeExtract 247 1 - 253: 61(bool) FOrdNotEqual 251 252 - 254: 61(bool) LogicalOr 250 253 - 255: 61(bool) LogicalOr 245 254 - 256: 8(s1) CompositeExtract 235 2 - 257: 8(s1) CompositeExtract 236 2 - 258: 6(int) CompositeExtract 256 0 - 259: 6(int) CompositeExtract 257 0 - 260: 61(bool) INotEqual 258 259 - 261: 7(float) CompositeExtract 256 1 - 262: 7(float) CompositeExtract 257 1 - 263: 61(bool) FOrdNotEqual 261 262 - 264: 61(bool) LogicalOr 260 263 - 265: 61(bool) LogicalOr 255 264 - 266: 8(s1) CompositeExtract 235 3 - 267: 8(s1) CompositeExtract 236 3 - 268: 6(int) CompositeExtract 266 0 - 269: 6(int) CompositeExtract 267 0 - 270: 61(bool) INotEqual 268 269 - 271: 7(float) CompositeExtract 266 1 - 272: 7(float) CompositeExtract 267 1 - 273: 61(bool) FOrdNotEqual 271 272 - 274: 61(bool) LogicalOr 270 273 - 275: 61(bool) LogicalOr 265 274 - 276: 8(s1) CompositeExtract 235 4 - 277: 8(s1) CompositeExtract 236 4 - 278: 6(int) CompositeExtract 276 0 - 279: 6(int) CompositeExtract 277 0 - 280: 61(bool) INotEqual 278 279 - 281: 7(float) CompositeExtract 276 1 - 282: 7(float) CompositeExtract 277 1 - 283: 61(bool) FOrdNotEqual 281 282 - 284: 61(bool) LogicalOr 280 283 - 285: 61(bool) LogicalOr 275 284 - 286: 8(s1) CompositeExtract 235 5 - 287: 8(s1) CompositeExtract 236 5 - 288: 6(int) CompositeExtract 286 0 - 289: 6(int) CompositeExtract 287 0 - 290: 61(bool) INotEqual 288 289 - 291: 7(float) CompositeExtract 286 1 - 292: 7(float) CompositeExtract 287 1 - 293: 61(bool) FOrdNotEqual 291 292 - 294: 61(bool) LogicalOr 290 293 - 295: 61(bool) LogicalOr 285 294 - 296: 8(s1) CompositeExtract 235 6 - 297: 8(s1) CompositeExtract 236 6 - 298: 6(int) CompositeExtract 296 0 - 299: 6(int) CompositeExtract 297 0 - 300: 61(bool) INotEqual 298 299 - 301: 7(float) CompositeExtract 296 1 - 302: 7(float) CompositeExtract 297 1 - 303: 61(bool) FOrdNotEqual 301 302 - 304: 61(bool) LogicalOr 300 303 - 305: 61(bool) LogicalOr 295 304 - 306: 8(s1) CompositeExtract 235 7 - 307: 8(s1) CompositeExtract 236 7 - 308: 6(int) CompositeExtract 306 0 - 309: 6(int) CompositeExtract 307 0 - 310: 61(bool) INotEqual 308 309 - 311: 7(float) CompositeExtract 306 1 - 312: 7(float) CompositeExtract 307 1 - 313: 61(bool) FOrdNotEqual 311 312 - 314: 61(bool) LogicalOr 310 313 - 315: 61(bool) LogicalOr 305 314 - 316: 8(s1) CompositeExtract 235 8 - 317: 8(s1) CompositeExtract 236 8 - 318: 6(int) CompositeExtract 316 0 - 319: 6(int) CompositeExtract 317 0 - 320: 61(bool) INotEqual 318 319 - 321: 7(float) CompositeExtract 316 1 - 322: 7(float) CompositeExtract 317 1 - 323: 61(bool) FOrdNotEqual 321 322 - 324: 61(bool) LogicalOr 320 323 - 325: 61(bool) LogicalOr 315 324 - 326: 8(s1) CompositeExtract 235 9 - 327: 8(s1) CompositeExtract 236 9 - 328: 6(int) CompositeExtract 326 0 - 329: 6(int) CompositeExtract 327 0 - 330: 61(bool) INotEqual 328 329 - 331: 7(float) CompositeExtract 326 1 - 332: 7(float) CompositeExtract 327 1 - 333: 61(bool) FOrdNotEqual 331 332 - 334: 61(bool) LogicalOr 330 333 - 335: 61(bool) LogicalOr 325 334 - SelectionMerge 337 None - BranchConditional 335 336 337 - 336: Label - 339: 14(fvec4) Load 82(v) - 340: 14(fvec4) VectorTimesScalar 339 338 - Store 82(v) 340 - Branch 337 - 337: Label - 350: 349(ptr) AccessChain 345(bi) 346 - 351: 342(s2) Load 350 - 352: 55(s2) Load 57(foo2a) - 353: 6(int) CompositeExtract 351 0 - 354: 6(int) CompositeExtract 352 0 - 355: 61(bool) INotEqual 353 354 - 356: 7(float) CompositeExtract 351 1 - 357: 7(float) CompositeExtract 352 1 - 358: 61(bool) FOrdNotEqual 356 357 - 359: 61(bool) LogicalOr 355 358 - 360: 341(s1) CompositeExtract 351 2 - 361: 8(s1) CompositeExtract 352 2 - 362: 6(int) CompositeExtract 360 0 - 363: 6(int) CompositeExtract 361 0 - 364: 61(bool) INotEqual 362 363 - 365: 7(float) CompositeExtract 360 1 - 366: 7(float) CompositeExtract 361 1 - 367: 61(bool) FOrdNotEqual 365 366 - 368: 61(bool) LogicalOr 364 367 - 369: 61(bool) LogicalOr 359 368 - SelectionMerge 371 None - BranchConditional 369 370 371 - 370: Label - 373: 14(fvec4) Load 82(v) - 374: 14(fvec4) VectorTimesScalar 373 372 - Store 82(v) 374 - Branch 371 - 371: Label - 377: 14(fvec4) Load 82(v) - Store 376(color) 377 + 167: 7(float) CompositeExtract 162 1 + 168: 72(bool) FOrdEqual 166 167 + 169: 72(bool) LogicalAnd 165 168 + 170: 72(bool) LogicalAnd 160 169 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 174: 14(fvec4) Load 93(v) + 175: 14(fvec4) VectorTimesScalar 174 173 + Store 93(v) 175 + Branch 172 + 172: Label + 176: 11 Load 13(a) + 177: 11 Load 37(b) + 178: 8(s1) CompositeExtract 176 0 + 179: 8(s1) CompositeExtract 177 0 + 180: 6(int) CompositeExtract 178 0 + 181: 6(int) CompositeExtract 179 0 + 182: 72(bool) INotEqual 180 181 + 183: 7(float) CompositeExtract 178 1 + 184: 7(float) CompositeExtract 179 1 + 185: 72(bool) FOrdNotEqual 183 184 + 186: 72(bool) LogicalOr 182 185 + 187: 8(s1) CompositeExtract 176 1 + 188: 8(s1) CompositeExtract 177 1 + 189: 6(int) CompositeExtract 187 0 + 190: 6(int) CompositeExtract 188 0 + 191: 72(bool) INotEqual 189 190 + 192: 7(float) CompositeExtract 187 1 + 193: 7(float) CompositeExtract 188 1 + 194: 72(bool) FOrdNotEqual 192 193 + 195: 72(bool) LogicalOr 191 194 + 196: 72(bool) LogicalOr 186 195 + 197: 8(s1) CompositeExtract 176 2 + 198: 8(s1) CompositeExtract 177 2 + 199: 6(int) CompositeExtract 197 0 + 200: 6(int) CompositeExtract 198 0 + 201: 72(bool) INotEqual 199 200 + 202: 7(float) CompositeExtract 197 1 + 203: 7(float) CompositeExtract 198 1 + 204: 72(bool) FOrdNotEqual 202 203 + 205: 72(bool) LogicalOr 201 204 + 206: 72(bool) LogicalOr 196 205 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 210: 14(fvec4) Load 93(v) + 211: 14(fvec4) VectorTimesScalar 210 209 + Store 93(v) 211 + Branch 208 + 208: Label + 214: 14(fvec4) Load 93(v) + Store 213(color) 214 Return FunctionEnd diff --git a/Test/baseResults/spv.always-discard.frag.out b/Test/baseResults/spv.always-discard.frag.out old mode 100755 new mode 100644 index a639515b..9102b3bb --- a/Test/baseResults/spv.always-discard.frag.out +++ b/Test/baseResults/spv.always-discard.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 59 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "white" Name 12 "black" @@ -110,23 +110,4 @@ Linked fragment stage: Branch 49 49: Label Kill - 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 b62d10c4..7984c832 100755 --- a/Test/baseResults/spv.always-discard2.frag.out +++ b/Test/baseResults/spv.always-discard2.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 38 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "white" Name 12 "black" diff --git a/Test/baseResults/spv.atomic.comp.out b/Test/baseResults/spv.atomic.comp.out index 2ee4978f..bc8d9b81 100755 --- a/Test/baseResults/spv.atomic.comp.out +++ b/Test/baseResults/spv.atomic.comp.out @@ -1,132 +1,205 @@ spv.atomic.comp Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +Shader version: 310 +Requested GL_ARB_gl_spirv +local_size = (1, 1, 1) +0:? Sequence +0:14 Function Definition: func(au1; (global highp uint) +0:14 Function Parameters: +0:14 'c' (in highp atomic_uint) +0:16 Sequence +0:16 Branch: Return with expression +0:16 AtomicCounterIncrement (global highp uint) +0:16 'c' (in highp atomic_uint) +0:19 Function Definition: main( (global void) +0:19 Function Parameters: +0:21 Sequence +0:21 MemoryBarrierAtomicCounter (global void) +0:22 Function Call: func(au1; (global highp uint) +0:22 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:23 Sequence +0:23 move second child to first child (temp highp uint) +0:23 'val' (temp highp uint) +0:23 AtomicCounter (global highp uint) +0:23 direct index (layout(binding=0 offset=4 ) temp highp atomic_uint) +0:23 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:23 Constant: +0:23 2 (const int) +0:24 AtomicCounterDecrement (global highp uint) +0:24 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:36 Function Definition: atoms( (global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child (temp highp int) +0:38 'origi' (temp highp int) +0:38 AtomicAdd (global highp int) +0:38 'atomi' (shared highp int) +0:38 Constant: +0:38 3 (const int) +0:39 Sequence +0:39 move second child to first child (temp highp uint) +0:39 'origu' (temp highp uint) +0:39 AtomicAnd (global highp uint) +0:39 'atomu' (shared highp uint) +0:39 'value' (shared highp uint) +0:40 move second child to first child (temp highp uint) +0:40 'origu' (temp highp uint) +0:40 AtomicOr (global highp uint) +0:40 'atomu' (shared highp uint) +0:40 Constant: +0:40 7 (const uint) +0:41 move second child to first child (temp highp uint) +0:41 'origu' (temp highp uint) +0:41 AtomicXor (global highp uint) +0:41 'atomu' (shared highp uint) +0:41 Constant: +0:41 7 (const uint) +0:42 move second child to first child (temp highp uint) +0:42 'origu' (temp highp uint) +0:42 AtomicMin (global highp uint) +0:42 'atomu' (shared highp uint) +0:42 'value' (shared highp uint) +0:43 move second child to first child (temp highp int) +0:43 'origi' (temp highp int) +0:43 AtomicMax (global highp int) +0:43 'atomi' (shared highp int) +0:43 Constant: +0:43 7 (const int) +0:44 move second child to first child (temp highp int) +0:44 'origi' (temp highp int) +0:44 AtomicExchange (global highp int) +0:44 'atomi' (shared highp int) +0:44 'origi' (temp highp int) +0:45 move second child to first child (temp highp uint) +0:45 'origu' (temp highp uint) +0:45 AtomicCompSwap (global highp uint) +0:45 'atomu' (shared highp uint) +0:45 Constant: +0:45 10 (const uint) +0:45 'value' (shared highp uint) +0:46 AtomicAdd (global highp int) +0:46 direct index (temp highp int) +0:46 n_frames_rendered: direct index for structure (layout(column_major std140 offset=16 ) buffer highp 4-component vector of int) +0:46 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:? 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:? 'value' (shared highp uint) +0:? 'arrX' (global 1-element array of highp int) +0:? 'arrY' (global 1-element array of highp int) +0:? 'arrZ' (global 1-element array of highp int) +0:? 'atomi' (shared highp int) +0:? 'atomu' (shared highp uint) +0:? 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) + 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 10000 -// Generated by (magic number): 80001 -// Id's are bound by 74 +Shader version: 310 +Requested GL_ARB_gl_spirv +local_size = (1, 1, 1) +0:? Sequence +0:14 Function Definition: func(au1; (global highp uint) +0:14 Function Parameters: +0:14 'c' (in highp atomic_uint) +0:16 Sequence +0:16 Branch: Return with expression +0:16 AtomicCounterIncrement (global highp uint) +0:16 'c' (in highp atomic_uint) +0:19 Function Definition: main( (global void) +0:19 Function Parameters: +0:21 Sequence +0:21 MemoryBarrierAtomicCounter (global void) +0:22 Function Call: func(au1; (global highp uint) +0:22 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:23 Sequence +0:23 move second child to first child (temp highp uint) +0:23 'val' (temp highp uint) +0:23 AtomicCounter (global highp uint) +0:23 direct index (layout(binding=0 offset=4 ) temp highp atomic_uint) +0:23 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:23 Constant: +0:23 2 (const int) +0:24 AtomicCounterDecrement (global highp uint) +0:24 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:36 Function Definition: atoms( (global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child (temp highp int) +0:38 'origi' (temp highp int) +0:38 AtomicAdd (global highp int) +0:38 'atomi' (shared highp int) +0:38 Constant: +0:38 3 (const int) +0:39 Sequence +0:39 move second child to first child (temp highp uint) +0:39 'origu' (temp highp uint) +0:39 AtomicAnd (global highp uint) +0:39 'atomu' (shared highp uint) +0:39 'value' (shared highp uint) +0:40 move second child to first child (temp highp uint) +0:40 'origu' (temp highp uint) +0:40 AtomicOr (global highp uint) +0:40 'atomu' (shared highp uint) +0:40 Constant: +0:40 7 (const uint) +0:41 move second child to first child (temp highp uint) +0:41 'origu' (temp highp uint) +0:41 AtomicXor (global highp uint) +0:41 'atomu' (shared highp uint) +0:41 Constant: +0:41 7 (const uint) +0:42 move second child to first child (temp highp uint) +0:42 'origu' (temp highp uint) +0:42 AtomicMin (global highp uint) +0:42 'atomu' (shared highp uint) +0:42 'value' (shared highp uint) +0:43 move second child to first child (temp highp int) +0:43 'origi' (temp highp int) +0:43 AtomicMax (global highp int) +0:43 'atomi' (shared highp int) +0:43 Constant: +0:43 7 (const int) +0:44 move second child to first child (temp highp int) +0:44 'origi' (temp highp int) +0:44 AtomicExchange (global highp int) +0:44 'atomi' (shared highp int) +0:44 'origi' (temp highp int) +0:45 move second child to first child (temp highp uint) +0:45 'origu' (temp highp uint) +0:45 AtomicCompSwap (global highp uint) +0:45 'atomu' (shared highp uint) +0:45 Constant: +0:45 10 (const uint) +0:45 'value' (shared highp uint) +0:46 AtomicAdd (global highp int) +0:46 direct index (temp highp int) +0:46 n_frames_rendered: direct index for structure (layout(column_major std140 offset=16 ) buffer highp 4-component vector of int) +0:46 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:? 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:? 'value' (shared highp uint) +0:? 'arrX' (global 1-element array of highp int) +0:? 'arrY' (global 1-element array of highp int) +0:? 'arrZ' (global 1-element array of highp int) +0:? 'atomi' (shared highp int) +0:? 'atomu' (shared highp uint) +0:? 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) - 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" - Name 12 "atoms(" - Name 20 "counter" - Name 21 "param" - Name 24 "val" - Name 28 "countArr" - Name 35 "origi" - Name 37 "atomi" - Name 40 "origu" - Name 42 "atomu" - Name 44 "value" - 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 - 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 - 7: TypePointer Function 6(int) - 8: TypeFunction 6(int) 7(ptr) - 14: 6(int) Constant 1 - 15: 6(int) Constant 0 - 18: 6(int) Constant 1024 - 19: TypePointer AtomicCounter 6(int) - 20(counter): 19(ptr) Variable AtomicCounter - 25: 6(int) Constant 4 - 26: TypeArray 6(int) 25 - 27: TypePointer AtomicCounter 26 - 28(countArr): 27(ptr) Variable AtomicCounter - 29: TypeInt 32 1 - 30: 29(int) Constant 2 - 34: TypePointer Function 29(int) - 36: TypePointer Workgroup 29(int) - 37(atomi): 36(ptr) Variable Workgroup - 38: 29(int) Constant 3 - 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: 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 - 24(val): 7(ptr) Variable Function - MemoryBarrier 14 18 - 22: 6(int) Load 20(counter) - Store 21(param) 22 - 23: 6(int) FunctionCall 10(func(au1;) 21(param) - 31: 19(ptr) AccessChain 28(countArr) 30 - 32: 6(int) AtomicLoad 31 14 15 - Store 24(val) 32 - 33: 6(int) AtomicIDecrement 20(counter) 14 15 - Return - FunctionEnd - 10(func(au1;): 6(int) Function None 8 - 9(c): 7(ptr) FunctionParameter - 11: Label - 16: 6(int) AtomicIIncrement 9(c) 14 15 - ReturnValue 16 - FunctionEnd - 12(atoms(): 2 Function None 3 - 13: Label - 35(origi): 34(ptr) Variable Function - 40(origu): 7(ptr) Variable Function - 39: 29(int) AtomicIAdd 37(atomi) 14 15 38 - Store 35(origi) 39 - 45: 6(int) Load 44(value) - 46: 6(int) AtomicAnd 42(atomu) 14 15 45 - Store 40(origu) 46 - 48: 6(int) AtomicOr 42(atomu) 14 15 47 - Store 40(origu) 48 - 49: 6(int) AtomicXor 42(atomu) 14 15 47 - Store 40(origu) 49 - 50: 6(int) Load 44(value) - 51: 6(int) AtomicUMin 42(atomu) 14 15 50 - Store 40(origu) 51 - 53: 29(int) AtomicSMax 37(atomi) 14 15 52 - Store 35(origi) 53 - 54: 29(int) Load 35(origi) - 55: 29(int) AtomicExchange 37(atomi) 14 15 54 - Store 35(origi) 55 - 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.bitCast.frag.out b/Test/baseResults/spv.bitCast.frag.out index 53f2d965..b0dc8104 100644 --- a/Test/baseResults/spv.bitCast.frag.out +++ b/Test/baseResults/spv.bitCast.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 154 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 14 26 37 48 89 98 107 116 122 130 139 148 154 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "idata" @@ -32,6 +32,14 @@ Linked fragment stage: Name 139 "u3" Name 148 "u4" Name 154 "fragColor" + Decorate 89(i1) Flat + Decorate 98(i2) Flat + Decorate 107(i3) Flat + Decorate 116(i4) Flat + Decorate 122(u1) Flat + Decorate 130(u2) Flat + Decorate 139(u3) Flat + Decorate 148(u4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -40,22 +48,22 @@ Linked fragment stage: 10: 6(int) Constant 0 11: 7(ivec4) ConstantComposite 10 10 10 10 12: TypeFloat 32 - 13: TypePointer UniformConstant 12(float) - 14(f1): 13(ptr) Variable UniformConstant + 13: TypePointer Input 12(float) + 14(f1): 13(ptr) Variable Input 17: TypeInt 32 0 18: 17(int) Constant 0 19: TypePointer Function 6(int) 24: TypeVector 12(float) 2 - 25: TypePointer UniformConstant 24(fvec2) - 26(f2): 25(ptr) Variable UniformConstant + 25: TypePointer Input 24(fvec2) + 26(f2): 25(ptr) Variable Input 28: TypeVector 6(int) 2 35: TypeVector 12(float) 3 - 36: TypePointer UniformConstant 35(fvec3) - 37(f3): 36(ptr) Variable UniformConstant + 36: TypePointer Input 35(fvec3) + 37(f3): 36(ptr) Variable Input 39: TypeVector 6(int) 3 46: TypeVector 12(float) 4 - 47: TypePointer UniformConstant 46(fvec4) - 48(f4): 47(ptr) Variable UniformConstant + 47: TypePointer Input 46(fvec4) + 48(f4): 47(ptr) Variable Input 53: TypeVector 17(int) 4 54: TypePointer Function 53(ivec4) 56: 53(ivec4) ConstantComposite 18 18 18 18 @@ -65,23 +73,23 @@ Linked fragment stage: 84: TypePointer Function 46(fvec4) 86: 12(float) Constant 0 87: 46(fvec4) ConstantComposite 86 86 86 86 - 88: TypePointer UniformConstant 6(int) - 89(i1): 88(ptr) Variable UniformConstant + 88: TypePointer Input 6(int) + 89(i1): 88(ptr) Variable Input 92: TypePointer Function 12(float) - 97: TypePointer UniformConstant 28(ivec2) - 98(i2): 97(ptr) Variable UniformConstant - 106: TypePointer UniformConstant 39(ivec3) - 107(i3): 106(ptr) Variable UniformConstant - 115: TypePointer UniformConstant 7(ivec4) - 116(i4): 115(ptr) Variable UniformConstant - 121: TypePointer UniformConstant 17(int) - 122(u1): 121(ptr) Variable UniformConstant - 129: TypePointer UniformConstant 65(ivec2) - 130(u2): 129(ptr) Variable UniformConstant - 138: TypePointer UniformConstant 73(ivec3) - 139(u3): 138(ptr) Variable UniformConstant - 147: TypePointer UniformConstant 53(ivec4) - 148(u4): 147(ptr) Variable UniformConstant + 97: TypePointer Input 28(ivec2) + 98(i2): 97(ptr) Variable Input + 106: TypePointer Input 39(ivec3) + 107(i3): 106(ptr) Variable Input + 115: TypePointer Input 7(ivec4) + 116(i4): 115(ptr) Variable Input + 121: TypePointer Input 17(int) + 122(u1): 121(ptr) Variable Input + 129: TypePointer Input 65(ivec2) + 130(u2): 129(ptr) Variable Input + 138: TypePointer Input 73(ivec3) + 139(u3): 138(ptr) Variable Input + 147: TypePointer Input 53(ivec4) + 148(u4): 147(ptr) Variable Input 153: TypePointer Output 46(fvec4) 154(fragColor): 153(ptr) Variable Output 159: TypeBool diff --git a/Test/baseResults/spv.bool.vert.out b/Test/baseResults/spv.bool.vert.out index 7217ae7b..f11fe398 100644 --- a/Test/baseResults/spv.bool.vert.out +++ b/Test/baseResults/spv.bool.vert.out @@ -10,83 +10,81 @@ Linked vertex stage: // Id's are bound by 49 Capability Shader + Capability ClipDistance + Capability CullDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 47 48 + EntryPoint Vertex 4 "main" 24 Source GLSL 450 Name 4 "main" Name 10 "foo(b1;" Name 9 "b" - Name 21 "gl_PerVertex" - MemberName 21(gl_PerVertex) 0 "gl_Position" - MemberName 21(gl_PerVertex) 1 "gl_PointSize" - MemberName 21(gl_PerVertex) 2 "gl_ClipDistance" - MemberName 21(gl_PerVertex) 3 "gl_CullDistance" - Name 23 "" - Name 28 "ubname" - MemberName 28(ubname) 0 "b" - Name 30 "ubinst" - Name 31 "param" - Name 47 "gl_VertexID" - Name 48 "gl_InstanceID" - MemberDecorate 21(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 21(gl_PerVertex) 1 BuiltIn PointSize - MemberDecorate 21(gl_PerVertex) 2 BuiltIn ClipDistance - MemberDecorate 21(gl_PerVertex) 3 BuiltIn CullDistance - Decorate 21(gl_PerVertex) Block - Decorate 28(ubname) GLSLShared - Decorate 28(ubname) Block - Decorate 47(gl_VertexID) BuiltIn VertexId - Decorate 48(gl_InstanceID) BuiltIn InstanceId + Name 22 "gl_PerVertex" + MemberName 22(gl_PerVertex) 0 "gl_Position" + MemberName 22(gl_PerVertex) 1 "gl_PointSize" + MemberName 22(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 22(gl_PerVertex) 3 "gl_CullDistance" + Name 24 "" + Name 29 "ubname" + MemberName 29(ubname) 0 "b" + Name 31 "ubinst" + Name 32 "param" + MemberDecorate 22(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 22(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 22(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 22(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 22(gl_PerVertex) Block + MemberDecorate 29(ubname) 0 Offset 0 + Decorate 29(ubname) Block + Decorate 31(ubinst) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeBool 7: TypePointer Function 6(bool) 8: TypeFunction 6(bool) 7(ptr) 13: 6(bool) ConstantFalse - 16: TypeFloat 32 - 17: TypeVector 16(float) 4 - 18: TypeInt 32 0 - 19: 18(int) Constant 1 - 20: TypeArray 16(float) 19 -21(gl_PerVertex): TypeStruct 17(fvec4) 16(float) 20 20 - 22: TypePointer Output 21(gl_PerVertex) - 23: 22(ptr) Variable Output - 24: TypeInt 32 1 - 25: 24(int) Constant 0 - 26: TypePointer Function 17(fvec4) - 28(ubname): TypeStruct 6(bool) - 29: TypePointer Uniform 28(ubname) - 30(ubinst): 29(ptr) Variable Uniform - 32: TypePointer Uniform 6(bool) - 38: 16(float) Constant 0 - 39: 17(fvec4) ConstantComposite 38 38 38 38 - 41: 16(float) Constant 1065353216 - 42: 17(fvec4) ConstantComposite 41 41 41 41 - 44: TypePointer Output 17(fvec4) - 46: TypePointer Input 24(int) - 47(gl_VertexID): 46(ptr) Variable Input -48(gl_InstanceID): 46(ptr) Variable Input + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 0 + 20: 19(int) Constant 1 + 21: TypeArray 17(float) 20 +22(gl_PerVertex): TypeStruct 18(fvec4) 17(float) 21 21 + 23: TypePointer Output 22(gl_PerVertex) + 24: 23(ptr) Variable Output + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 27: TypePointer Function 18(fvec4) + 29(ubname): TypeStruct 19(int) + 30: TypePointer Uniform 29(ubname) + 31(ubinst): 30(ptr) Variable Uniform + 33: TypePointer Uniform 19(int) + 36: 19(int) Constant 0 + 41: 17(float) Constant 0 + 42: 18(fvec4) ConstantComposite 41 41 41 41 + 44: 17(float) Constant 1065353216 + 45: 18(fvec4) ConstantComposite 44 44 44 44 + 47: TypePointer Output 18(fvec4) 4(main): 2 Function None 3 5: Label - 27: 26(ptr) Variable Function - 31(param): 7(ptr) Variable Function - 33: 32(ptr) AccessChain 30(ubinst) 25 - 34: 6(bool) Load 33 - Store 31(param) 34 - 35: 6(bool) FunctionCall 10(foo(b1;) 31(param) - SelectionMerge 37 None - BranchConditional 35 36 40 - 36: Label - Store 27 39 - Branch 37 - 40: Label - Store 27 42 - Branch 37 - 37: Label - 43: 17(fvec4) Load 27 - 45: 44(ptr) AccessChain 23 25 - Store 45 43 + 28: 27(ptr) Variable Function + 32(param): 7(ptr) Variable Function + 34: 33(ptr) AccessChain 31(ubinst) 26 + 35: 19(int) Load 34 + 37: 6(bool) INotEqual 35 36 + Store 32(param) 37 + 38: 6(bool) FunctionCall 10(foo(b1;) 32(param) + SelectionMerge 40 None + BranchConditional 38 39 43 + 39: Label + Store 28 42 + Branch 40 + 43: Label + Store 28 45 + Branch 40 + 40: Label + 46: 18(fvec4) Load 28 + 48: 47(ptr) AccessChain 24 26 + Store 48 46 Return FunctionEnd 10(foo(b1;): 6(bool) Function None 8 diff --git a/Test/baseResults/spv.boolInBlock.frag.out b/Test/baseResults/spv.boolInBlock.frag.out new file mode 100644 index 00000000..6e7cf40e --- /dev/null +++ b/Test/baseResults/spv.boolInBlock.frag.out @@ -0,0 +1,169 @@ +spv.boolInBlock.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 107 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 75 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 14 "foo(vb4;vb2;" + Name 12 "paramb4" + Name 13 "paramb2" + Name 17 "b1" + Name 24 "Buffer" + MemberName 24(Buffer) 0 "b2" + Name 26 "" + Name 39 "Uniform" + MemberName 39(Uniform) 0 "b4" + Name 41 "" + Name 62 "param" + Name 67 "param" + Name 75 "fragColor" + MemberDecorate 24(Buffer) 0 Offset 0 + Decorate 24(Buffer) BufferBlock + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 1 + MemberDecorate 39(Uniform) 0 Offset 0 + Decorate 39(Uniform) Block + Decorate 41 DescriptorSet 0 + Decorate 41 Binding 0 + Decorate 75(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypeVector 6(bool) 4 + 8: TypePointer Function 7(bvec4) + 9: TypeVector 6(bool) 2 + 10: TypePointer Function 9(bvec2) + 11: TypeFunction 2 8(ptr) 10(ptr) + 16: TypePointer Function 6(bool) + 22: TypeInt 32 0 + 23: TypeVector 22(int) 2 + 24(Buffer): TypeStruct 23(ivec2) + 25: TypePointer Uniform 24(Buffer) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: 6(bool) ConstantFalse + 30: 9(bvec2) ConstantComposite 29 29 + 31: 22(int) Constant 0 + 32: 23(ivec2) ConstantComposite 31 31 + 33: 22(int) Constant 1 + 34: 23(ivec2) ConstantComposite 33 33 + 36: TypePointer Uniform 23(ivec2) + 38: TypeVector 22(int) 4 + 39(Uniform): TypeStruct 38(ivec4) + 40: TypePointer Uniform 39(Uniform) + 41: 40(ptr) Variable Uniform + 42: TypePointer Uniform 38(ivec4) + 65: 38(ivec4) ConstantComposite 31 31 31 31 + 72: TypeFloat 32 + 73: TypeVector 72(float) 4 + 74: TypePointer Output 73(fvec4) + 75(fragColor): 74(ptr) Variable Output + 87: 72(float) Constant 0 + 88: 72(float) Constant 1065353216 + 4(main): 2 Function None 3 + 5: Label + 62(param): 8(ptr) Variable Function + 67(param): 10(ptr) Variable Function + 35: 23(ivec2) Select 30 34 32 + 37: 36(ptr) AccessChain 26 28 + Store 37 35 + 43: 42(ptr) AccessChain 41 28 + 44: 38(ivec4) Load 43 + 45: 22(int) CompositeExtract 44 2 + 46: 6(bool) INotEqual 45 31 + SelectionMerge 48 None + BranchConditional 46 47 48 + 47: Label + 49: 42(ptr) AccessChain 41 28 + 50: 38(ivec4) Load 49 + 51: 22(int) CompositeExtract 50 0 + 52: 6(bool) INotEqual 51 31 + 53: 9(bvec2) CompositeConstruct 52 52 + 54: 23(ivec2) Select 53 34 32 + 55: 36(ptr) AccessChain 26 28 + Store 55 54 + Branch 48 + 48: Label + 56: 36(ptr) AccessChain 26 28 + 57: 23(ivec2) Load 56 + 58: 22(int) CompositeExtract 57 0 + 59: 6(bool) INotEqual 58 31 + SelectionMerge 61 None + BranchConditional 59 60 61 + 60: Label + 63: 42(ptr) AccessChain 41 28 + 64: 38(ivec4) Load 63 + 66: 7(bvec4) INotEqual 64 65 + Store 62(param) 66 + 68: 2 FunctionCall 14(foo(vb4;vb2;) 62(param) 67(param) + 69: 9(bvec2) Load 67(param) + 70: 23(ivec2) Select 69 34 32 + 71: 36(ptr) AccessChain 26 28 + Store 71 70 + Branch 61 + 61: Label + 76: 42(ptr) AccessChain 41 28 + 77: 38(ivec4) Load 76 + 78: 22(int) CompositeExtract 77 0 + 79: 6(bool) INotEqual 78 31 + SelectionMerge 81 None + BranchConditional 79 80 81 + 80: Label + 82: 42(ptr) AccessChain 41 28 + 83: 38(ivec4) Load 82 + 84: 22(int) CompositeExtract 83 1 + 85: 6(bool) INotEqual 84 31 + Branch 81 + 81: Label + 86: 6(bool) Phi 79 61 85 80 + 89: 72(float) Select 86 88 87 + 90: 73(fvec4) CompositeConstruct 89 89 89 89 + Store 75(fragColor) 90 + 91: 42(ptr) AccessChain 41 28 + 92: 38(ivec4) Load 91 + 93: 22(int) CompositeExtract 92 0 + 94: 6(bool) INotEqual 93 31 + 95: 6(bool) LogicalNot 94 + SelectionMerge 97 None + BranchConditional 95 96 97 + 96: Label + 98: 42(ptr) AccessChain 41 28 + 99: 38(ivec4) Load 98 + 100: 22(int) CompositeExtract 99 1 + 101: 6(bool) INotEqual 100 31 + Branch 97 + 97: Label + 102: 6(bool) Phi 94 81 101 96 + 103: 72(float) Select 102 88 87 + 104: 73(fvec4) CompositeConstruct 103 103 103 103 + 105: 73(fvec4) Load 75(fragColor) + 106: 73(fvec4) FSub 105 104 + Store 75(fragColor) 106 + Return + FunctionEnd +14(foo(vb4;vb2;): 2 Function None 11 + 12(paramb4): 8(ptr) FunctionParameter + 13(paramb2): 10(ptr) FunctionParameter + 15: Label + 17(b1): 16(ptr) Variable Function + 18: 7(bvec4) Load 12(paramb4) + 19: 6(bool) CompositeExtract 18 2 + Store 17(b1) 19 + 20: 6(bool) Load 17(b1) + 21: 9(bvec2) CompositeConstruct 20 20 + Store 13(paramb2) 21 + Return + FunctionEnd diff --git a/Test/baseResults/spv.branch-return.vert.out b/Test/baseResults/spv.branch-return.vert.out new file mode 100644 index 00000000..217a863f --- /dev/null +++ b/Test/baseResults/spv.branch-return.vert.out @@ -0,0 +1,71 @@ +spv.branch-return.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 8 20 + Source ESSL 310 + Name 4 "main" + Name 8 "gl_InstanceIndex" + Name 18 "gl_PerVertex" + MemberName 18(gl_PerVertex) 0 "gl_Position" + MemberName 18(gl_PerVertex) 1 "gl_PointSize" + Name 20 "" + Decorate 8(gl_InstanceIndex) BuiltIn InstanceIndex + MemberDecorate 18(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 18(gl_PerVertex) 1 BuiltIn PointSize + Decorate 18(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Input 6(int) +8(gl_InstanceIndex): 7(ptr) Variable Input + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 +18(gl_PerVertex): TypeStruct 17(fvec4) 16(float) + 19: TypePointer Output 18(gl_PerVertex) + 20: 19(ptr) Variable Output + 21: 6(int) Constant 0 + 22: 16(float) Constant 0 + 23: 17(fvec4) ConstantComposite 22 22 22 22 + 24: TypePointer Output 17(fvec4) + 30: 16(float) Constant 1039918957 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Output 16(float) + 4(main): 2 Function None 3 + 5: Label + 9: 6(int) Load 8(gl_InstanceIndex) + SelectionMerge 14 None + Switch 9 14 + case 0: 10 + case 1: 11 + case 2: 12 + case 3: 13 + 10: Label + Return + 11: Label + 25: 24(ptr) AccessChain 20 21 + Store 25 23 + Branch 14 + 12: Label + Return + 13: Label + Return + 14: Label + 34: 33(ptr) AccessChain 20 21 32 + 35: 16(float) Load 34 + 36: 16(float) FAdd 35 30 + 37: 33(ptr) AccessChain 20 21 32 + Store 37 36 + Return + FunctionEnd diff --git a/Test/baseResults/spv.conditionalDiscard.frag.out b/Test/baseResults/spv.conditionalDiscard.frag.out index 73363281..ef7e3b4c 100755 --- a/Test/baseResults/spv.conditionalDiscard.frag.out +++ b/Test/baseResults/spv.conditionalDiscard.frag.out @@ -13,13 +13,14 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 17 34 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 9 "v" Name 13 "tex" Name 17 "coord" Name 34 "gl_FragColor" + Decorate 13(tex) DescriptorSet 0 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 405e6a80..bc915698 100755 --- a/Test/baseResults/spv.conversion.frag.out +++ b/Test/baseResults/spv.conversion.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 39 53 157 322 446 448 450 452 454 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "b" Name 11 "u_i" @@ -62,13 +62,13 @@ Linked fragment stage: 6: TypeBool 7: TypePointer Function 6(bool) 9: TypeInt 32 1 - 10: TypePointer UniformConstant 9(int) - 11(u_i): 10(ptr) Variable UniformConstant + 10: TypePointer Private 9(int) + 11(u_i): 10(ptr) Variable Private 13: TypeInt 32 0 14: 13(int) Constant 0 16: TypeFloat 32 - 17: TypePointer UniformConstant 16(float) - 18(u_f): 17(ptr) Variable UniformConstant + 17: TypePointer Private 16(float) + 18(u_f): 17(ptr) Variable Private 20: 16(float) Constant 0 23: TypeVector 6(bool) 2 24: TypePointer Function 23(bvec2) @@ -86,22 +86,22 @@ Linked fragment stage: 66: TypeVector 9(int) 2 67: TypePointer Function 66(ivec2) 69: TypeVector 16(float) 2 - 70: TypePointer UniformConstant 69(fvec2) - 71(u_f2): 70(ptr) Variable UniformConstant + 70: TypePointer Private 69(fvec2) + 71(u_f2): 70(ptr) Variable Private 75: 66(ivec2) ConstantComposite 62 62 76: 66(ivec2) ConstantComposite 63 63 79: TypeVector 9(int) 3 80: TypePointer Function 79(ivec3) 82: TypeVector 16(float) 3 - 83: TypePointer UniformConstant 82(fvec3) - 84(u_f3): 83(ptr) Variable UniformConstant + 83: TypePointer Private 82(fvec3) + 84(u_f3): 83(ptr) Variable Private 88: 79(ivec3) ConstantComposite 62 62 62 89: 79(ivec3) ConstantComposite 63 63 63 92: TypeVector 9(int) 4 93: TypePointer Function 92(ivec4) 95: TypeVector 16(float) 4 - 96: TypePointer UniformConstant 95(fvec4) - 97(u_f4): 96(ptr) Variable UniformConstant + 96: TypePointer Private 95(fvec4) + 97(u_f4): 96(ptr) Variable Private 101: 92(ivec4) ConstantComposite 62 62 62 62 102: 92(ivec4) ConstantComposite 63 63 63 63 105: TypePointer Function 16(float) @@ -124,24 +124,24 @@ Linked fragment stage: 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 + 427: TypePointer Private 6(bool) + 428(u_b): 427(ptr) Variable Private + 429: TypePointer Private 23(bvec2) + 430(u_b2): 429(ptr) Variable Private + 431: TypePointer Private 31(bvec3) + 432(u_b3): 431(ptr) Variable Private + 433: TypePointer Private 43(bvec4) + 434(u_b4): 433(ptr) Variable Private + 435: TypePointer Private 66(ivec2) + 436(u_i2): 435(ptr) Variable Private + 437: TypePointer Private 79(ivec3) + 438(u_i3): 437(ptr) Variable Private + 439: TypePointer Private 92(ivec4) + 440(u_i4): 439(ptr) Variable Private + 441(i_b): 427(ptr) Variable Private + 442(i_b2): 429(ptr) Variable Private + 443(i_b3): 431(ptr) Variable Private + 444(i_b4): 433(ptr) Variable Private 445: TypePointer Input 66(ivec2) 446(i_i2): 445(ptr) Variable Input 447: TypePointer Input 79(ivec3) diff --git a/Test/baseResults/spv.dataOut.frag.out b/Test/baseResults/spv.dataOut.frag.out index d96a6eca..651c96e3 100755 --- a/Test/baseResults/spv.dataOut.frag.out +++ b/Test/baseResults/spv.dataOut.frag.out @@ -1,6 +1,4 @@ spv.dataOut.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -13,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 16 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 12 "gl_FragData" Name 16 "Color" diff --git a/Test/baseResults/spv.dataOutIndirect.frag.out b/Test/baseResults/spv.dataOutIndirect.frag.out index 26a5f77c..d1227a5b 100755 --- a/Test/baseResults/spv.dataOutIndirect.frag.out +++ b/Test/baseResults/spv.dataOutIndirect.frag.out @@ -1,44 +1,51 @@ spv.dataOutIndirect.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release - Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 22 +// Id's are bound by 26 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 18 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 12 22 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" - Name 12 "gl_FragData" - Name 15 "i" - Name 18 "Color" + Name 12 "fcolor" + Name 14 "b" + MemberName 14(b) 0 "i" + Name 16 "bName" + Name 22 "Color" + MemberDecorate 14(b) 0 Offset 0 + Decorate 14(b) Block + Decorate 16(bName) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypeInt 32 0 - 9: 8(int) Constant 32 + 9: 8(int) Constant 4 10: TypeArray 7(fvec4) 9 11: TypePointer Output 10 - 12(gl_FragData): 11(ptr) Variable Output + 12(fcolor): 11(ptr) Variable Output 13: TypeInt 32 1 - 14: TypePointer UniformConstant 13(int) - 15(i): 14(ptr) Variable UniformConstant - 17: TypePointer Input 7(fvec4) - 18(Color): 17(ptr) Variable Input - 20: TypePointer Output 7(fvec4) + 14(b): TypeStruct 13(int) + 15: TypePointer Uniform 14(b) + 16(bName): 15(ptr) Variable Uniform + 17: 13(int) Constant 0 + 18: TypePointer Uniform 13(int) + 21: TypePointer Input 7(fvec4) + 22(Color): 21(ptr) Variable Input + 24: TypePointer Output 7(fvec4) 4(main): 2 Function None 3 5: Label - 16: 13(int) Load 15(i) - 19: 7(fvec4) Load 18(Color) - 21: 20(ptr) AccessChain 12(gl_FragData) 16 - Store 21 19 + 19: 18(ptr) AccessChain 16(bName) 17 + 20: 13(int) Load 19 + 23: 7(fvec4) Load 22(Color) + 25: 24(ptr) AccessChain 12(fcolor) 20 + Store 25 23 Return FunctionEnd diff --git a/Test/baseResults/spv.dataOutIndirect.vert.out b/Test/baseResults/spv.dataOutIndirect.vert.out index 6aafb426..797c6518 100755 --- a/Test/baseResults/spv.dataOutIndirect.vert.out +++ b/Test/baseResults/spv.dataOutIndirect.vert.out @@ -1,6 +1,5 @@ spv.dataOutIndirect.vert WARNING: 0:3: attribute deprecated in version 130; may be removed in future release -WARNING: 0:4: varying deprecated in version 130; may be removed in future release Linked vertex stage: @@ -13,59 +12,59 @@ Linked vertex stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 26 32 37 - Source GLSL 130 + EntryPoint Vertex 4 "main" 25 28 34 + Source GLSL 140 Name 4 "main" Name 8 "i" - Name 23 "colorOut" - Name 26 "color" - Name 32 "gl_Position" - Name 37 "gl_VertexID" - Decorate 32(gl_Position) BuiltIn Position - Decorate 37(gl_VertexID) BuiltIn VertexId + Name 25 "colorOut" + Name 28 "color" + Name 34 "gl_Position" + Decorate 34(gl_Position) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 1 - 14: 6(int) Constant 5 - 15: TypeBool - 17: TypeFloat 32 - 18: TypeVector 17(float) 4 - 19: TypeInt 32 0 - 20: 19(int) Constant 6 - 21: TypeArray 18(fvec4) 20 - 22: TypePointer Output 21 - 23(colorOut): 22(ptr) Variable Output - 25: TypePointer Input 18(fvec4) - 26(color): 25(ptr) Variable Input - 28: TypePointer Output 18(fvec4) - 32(gl_Position): 28(ptr) Variable Output - 33: 6(int) Constant 2 - 36: TypePointer Input 6(int) - 37(gl_VertexID): 36(ptr) Variable Input + 16: 6(int) Constant 5 + 17: TypeBool + 19: TypeFloat 32 + 20: TypeVector 19(float) 4 + 21: TypeInt 32 0 + 22: 21(int) Constant 6 + 23: TypeArray 20(fvec4) 22 + 24: TypePointer Output 23 + 25(colorOut): 24(ptr) Variable Output + 27: TypePointer Input 20(fvec4) + 28(color): 27(ptr) Variable Input + 30: TypePointer Output 20(fvec4) + 34(gl_Position): 30(ptr) Variable Output + 35: 6(int) Constant 2 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - 24: 6(int) Load 8(i) - 27: 18(fvec4) Load 26(color) - 29: 28(ptr) AccessChain 23(colorOut) 24 - Store 29 27 - 30: 6(int) Load 8(i) - 31: 6(int) IAdd 30 9 - Store 8(i) 31 + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + 26: 6(int) Load 8(i) + 29: 20(fvec4) Load 28(color) + 31: 30(ptr) AccessChain 25(colorOut) 26 + Store 31 29 + Branch 13 + 13: Label + 32: 6(int) Load 8(i) + 33: 6(int) IAdd 32 9 + Store 8(i) 33 Branch 10 - 11: Label - 34: 28(ptr) AccessChain 23(colorOut) 33 - 35: 18(fvec4) Load 34 - Store 32(gl_Position) 35 + 12: Label + 36: 30(ptr) AccessChain 25(colorOut) 35 + 37: 20(fvec4) Load 36 + Store 34(gl_Position) 37 Return FunctionEnd diff --git a/Test/baseResults/spv.deepRvalue.frag.out b/Test/baseResults/spv.deepRvalue.frag.out index d579ef82..b4894383 100644 --- a/Test/baseResults/spv.deepRvalue.frag.out +++ b/Test/baseResults/spv.deepRvalue.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 149 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 330 Name 4 "main" Name 9 "v1" @@ -31,6 +31,7 @@ Linked fragment stage: MemberName 134(str) 2 "c" Name 136 "t" Name 149 "gl_FragColor" + Decorate 111(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.depthOut.frag.out b/Test/baseResults/spv.depthOut.frag.out index dff7388b..6242391f 100755 --- a/Test/baseResults/spv.depthOut.frag.out +++ b/Test/baseResults/spv.depthOut.frag.out @@ -13,7 +13,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 8 10 14 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft ExecutionMode 4 DepthGreater ExecutionMode 4 DepthReplacing Source GLSL 450 diff --git a/Test/baseResults/spv.discard-dce.frag.out b/Test/baseResults/spv.discard-dce.frag.out index c2a8501a..7668233b 100755 --- a/Test/baseResults/spv.discard-dce.frag.out +++ b/Test/baseResults/spv.discard-dce.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 59 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "white" Name 12 "black" diff --git a/Test/baseResults/spv.do-simple.vert.out b/Test/baseResults/spv.do-simple.vert.out index e697f71d..c0862d1e 100755 --- a/Test/baseResults/spv.do-simple.vert.out +++ b/Test/baseResults/spv.do-simple.vert.out @@ -1,60 +1,46 @@ spv.do-simple.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 29 +// Id's are bound by 21 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 27 28 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 27 "gl_VertexID" - Name 28 "gl_InstanceID" - Decorate 27(gl_VertexID) BuiltIn VertexId - Decorate 28(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: TypeBool - 15: 14(bool) ConstantTrue - 19: 6(int) Constant 10 - 23: 6(int) Constant 1 - 25: 14(bool) ConstantFalse - 26: TypePointer Input 6(int) - 27(gl_VertexID): 26(ptr) Variable Input -28(gl_InstanceID): 26(ptr) Variable Input + 15: 6(int) Constant 1 + 18: 6(int) Constant 10 + 19: TypeBool 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 14(bool) Phi 15 5 25 12 - LoopMerge 11 10 None - Branch 16 - 16: Label - SelectionMerge 12 None - BranchConditional 13 12 17 - 17: Label - 18: 6(int) Load 8(i) - 20: 14(bool) SLessThan 18 19 - SelectionMerge 21 None - BranchConditional 20 21 11 - 21: Label - Branch 12 - 12: Label - 22: 6(int) Load 8(i) - 24: 6(int) IAdd 22 23 - Store 8(i) 24 - Branch 10 + LoopMerge 12 13 None + Branch 11 11: Label + 14: 6(int) Load 8(i) + 16: 6(int) IAdd 14 15 + Store 8(i) 16 + Branch 13 + 13: Label + 17: 6(int) Load 8(i) + 20: 19(bool) SLessThan 17 18 + BranchConditional 20 10 12 + 12: Label Return FunctionEnd diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out old mode 100755 new mode 100644 index c483861c..ebfe85d0 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -1,104 +1,84 @@ spv.do-while-continue-break.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 51 +// Id's are bound by 43 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 49 50 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 24 "A" - Name 30 "B" - Name 33 "C" - Name 39 "D" - Name 42 "E" - Name 44 "F" - Name 46 "G" - Name 49 "gl_VertexID" - Name 50 "gl_InstanceID" - Decorate 49(gl_VertexID) BuiltIn VertexId - Decorate 50(gl_InstanceID) BuiltIn InstanceId + Name 14 "A" + Name 21 "B" + Name 24 "C" + Name 30 "D" + Name 33 "E" + Name 35 "F" + Name 41 "G" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: TypeBool - 15: 14(bool) ConstantTrue - 19: 6(int) Constant 1 - 21: 6(int) Constant 19 - 26: 6(int) Constant 2 - 31: 14(bool) ConstantFalse - 35: 6(int) Constant 5 - 40: 6(int) Constant 3 - 43: 6(int) Constant 42 - 45: 6(int) Constant 99 - 47: 6(int) Constant 12 - 48: TypePointer Input 6(int) - 49(gl_VertexID): 48(ptr) Variable Input -50(gl_InstanceID): 48(ptr) Variable Input + 16: 6(int) Constant 2 + 17: TypeBool + 22: 6(int) Constant 1 + 26: 6(int) Constant 5 + 31: 6(int) Constant 3 + 34: 6(int) Constant 42 + 36: 6(int) Constant 99 + 39: 6(int) Constant 19 + 42: 6(int) Constant 12 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 24(A): 7(ptr) Variable Function - 30(B): 7(ptr) Variable Function - 33(C): 7(ptr) Variable Function - 39(D): 7(ptr) Variable Function - 42(E): 7(ptr) Variable Function - 44(F): 7(ptr) Variable Function - 46(G): 7(ptr) Variable Function + 14(A): 7(ptr) Variable Function + 21(B): 7(ptr) Variable Function + 24(C): 7(ptr) Variable Function + 30(D): 7(ptr) Variable Function + 33(E): 7(ptr) Variable Function + 35(F): 7(ptr) Variable Function + 41(G): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 14(bool) Phi 15 5 31 28 31 38 - LoopMerge 11 10 None - Branch 16 - 16: Label - SelectionMerge 12 None - BranchConditional 13 12 17 - 17: Label - 18: 6(int) Load 8(i) - 20: 6(int) IAdd 18 19 - Store 8(i) 20 - 22: 14(bool) SLessThan 20 21 - SelectionMerge 23 None - BranchConditional 22 23 11 - 23: Label - Branch 12 - 12: Label - Store 24(A) 9 + LoopMerge 12 13 None + Branch 11 + 11: Label + Store 14(A) 9 + 15: 6(int) Load 8(i) + 18: 17(bool) IEqual 15 16 + SelectionMerge 20 None + BranchConditional 18 19 20 + 19: Label + Store 21(B) 22 + Branch 13 + 20: Label 25: 6(int) Load 8(i) - 27: 14(bool) IEqual 25 26 + 27: 17(bool) IEqual 25 26 SelectionMerge 29 None BranchConditional 27 28 29 28: Label - Store 30(B) 19 - Branch 10 - 32: Label - Store 33(C) 26 - Branch 29 + Store 30(D) 31 + Branch 12 29: Label - 34: 6(int) Load 8(i) - 36: 14(bool) IEqual 34 35 - SelectionMerge 38 None - BranchConditional 36 37 38 - 37: Label - Store 39(D) 40 - Branch 11 - 41: Label - Store 42(E) 43 - Branch 38 - 38: Label - Store 44(F) 45 - Branch 10 - 11: Label - Store 46(G) 47 + Store 35(F) 36 + Branch 13 + 13: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 22 + Store 8(i) 38 + 40: 17(bool) SLessThan 38 39 + BranchConditional 40 10 12 + 12: Label + Store 41(G) 42 Return FunctionEnd diff --git a/Test/baseResults/spv.doWhileLoop.frag.out b/Test/baseResults/spv.doWhileLoop.frag.out index 5c8e7725..1d12af10 100755 --- a/Test/baseResults/spv.doWhileLoop.frag.out +++ b/Test/baseResults/spv.doWhileLoop.frag.out @@ -5,20 +5,20 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 40 +// Id's are bound by 34 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 38 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + EntryPoint Fragment 4 "main" 11 17 27 32 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" + Name 17 "bigColor" Name 27 "d" - Name 32 "bigColor" - Name 38 "gl_FragColor" + Name 32 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -26,18 +26,15 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 17: TypeBool - 18: 17(bool) ConstantTrue + 17(bigColor): 10(ptr) Variable Input 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 + 26: TypePointer Input 6(float) + 27(d): 26(ptr) Variable Input + 29: TypeBool + 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 @@ -45,29 +42,22 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 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 - 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 - 33: 7(fvec4) Load 32(bigColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 13 + LoopMerge 15 16 None + Branch 14 14: Label - 39: 7(fvec4) Load 9(color) - Store 38(gl_FragColor) 39 + 18: 7(fvec4) Load 17(bigColor) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + Branch 16 + 16: Label + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d) + 30: 29(bool) FOrdLessThan 25 28 + BranchConditional 30 13 15 + 15: Label + 33: 7(fvec4) Load 9(color) + Store 32(gl_FragColor) 33 Return FunctionEnd diff --git a/Test/baseResults/spv.double.comp.out b/Test/baseResults/spv.double.comp.out index e78065dc..766f839a 100755 --- a/Test/baseResults/spv.double.comp.out +++ b/Test/baseResults/spv.double.comp.out @@ -7,9 +7,10 @@ Linked compute stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 62 +// Id's are bound by 60 Capability Shader + Capability Float64 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint GLCompute 4 "main" 26 33 @@ -26,12 +27,15 @@ Linked compute stage: Name 33 "gl_LocalInvocationID" Name 49 "aa" Name 54 "globalCoef" - Name 58 "roll" - Name 61 "destTex" - Decorate 8(bufName) GLSLShared + Name 59 "destTex" + MemberDecorate 8(bufName) 0 Offset 0 + MemberDecorate 8(bufName) 1 Offset 8 Decorate 8(bufName) BufferBlock + Decorate 10(bufInst) DescriptorSet 0 Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 59(destTex) DescriptorSet 0 + Decorate 59(destTex) NonReadable 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -66,11 +70,9 @@ Linked compute stage: 53: 47(fvec4) ConstantComposite 50 51 52 50 55: 7(float) Constant 0 1072693248 56: 7(float) Constant 3229815407 1074340298 - 57: TypePointer UniformConstant 7(float) - 58(roll): 57(ptr) Variable UniformConstant - 59: TypeImage 6(float) 2D nonsampled format:Unknown - 60: TypePointer UniformConstant 59 - 61(destTex): 60(ptr) Variable UniformConstant + 57: TypeImage 6(float) 2D nonsampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(destTex): 58(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 22(storePos): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.earlyReturnDiscard.frag.out b/Test/baseResults/spv.earlyReturnDiscard.frag.out index 393a24fc..7e6409e6 100755 --- a/Test/baseResults/spv.earlyReturnDiscard.frag.out +++ b/Test/baseResults/spv.earlyReturnDiscard.frag.out @@ -5,29 +5,29 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 112 +// Id's are bound by 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 18 107 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 39 51 63 105 109 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 13 "color2" - Name 15 "otherColor" - Name 18 "c" - Name 21 "d" - Name 27 "bigColor" - Name 32 "smallColor" - Name 41 "minimum" - Name 53 "threshhold" - Name 65 "threshhold2" - Name 79 "b" - Name 107 "gl_FragColor" - Name 111 "threshhold3" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 39 "minimum" + Name 51 "threshhold" + Name 63 "threshhold2" + Name 77 "b" + Name 105 "gl_FragColor" + Name 109 "threshhold3" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -35,141 +35,139 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 14: TypePointer UniformConstant 7(fvec4) - 15(otherColor): 14(ptr) Variable UniformConstant - 17: TypePointer Input 6(float) - 18(c): 17(ptr) Variable Input - 20: TypePointer UniformConstant 6(float) - 21(d): 20(ptr) Variable UniformConstant - 23: TypeBool - 27(bigColor): 14(ptr) Variable UniformConstant - 32(smallColor): 14(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 + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 2 + 36: TypePointer Function 6(float) + 39(minimum): 16(ptr) Variable Input + 47: 6(float) Constant 1065353216 + 51(threshhold): 16(ptr) Variable Input + 60: 34(int) Constant 3 + 63(threshhold2): 16(ptr) Variable Input + 76: TypePointer Private 21(bool) + 77(b): 76(ptr) Variable Private + 85: 34(int) Constant 0 + 104: TypePointer Output 7(fvec4) +105(gl_FragColor): 104(ptr) Variable Output +109(threshhold3): 16(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 13(color2): 8(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - 16: 7(fvec4) Load 15(otherColor) - Store 13(color2) 16 - 19: 6(float) Load 18(c) - 22: 6(float) Load 21(d) - 24: 23(bool) FOrdGreaterThan 19 22 - SelectionMerge 26 None - BranchConditional 24 25 31 - 25: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - Branch 26 - 31: Label - 33: 7(fvec4) Load 32(smallColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 26 - 26: 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 + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 37: 36(ptr) AccessChain 9(color) 35 + 38: 6(float) Load 37 + 40: 6(float) Load 39(minimum) + 41: 21(bool) FOrdLessThan 38 40 + SelectionMerge 43 None + BranchConditional 41 42 43 + 42: Label Return - 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 + 43: Label + 45: 36(ptr) AccessChain 9(color) 35 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + 49: 36(ptr) AccessChain 9(color) 35 + 50: 6(float) Load 49 + 52: 6(float) Load 51(threshhold) + 53: 21(bool) FOrdGreaterThan 50 52 + SelectionMerge 55 None + BranchConditional 53 54 55 + 54: Label Kill - 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 + 55: Label + 57: 7(fvec4) Load 9(color) + 58: 7(fvec4) CompositeConstruct 47 47 47 47 + 59: 7(fvec4) FAdd 57 58 + Store 9(color) 59 + 61: 36(ptr) AccessChain 9(color) 60 + 62: 6(float) Load 61 + 64: 6(float) Load 63(threshhold2) + 65: 21(bool) FOrdGreaterThan 62 64 + SelectionMerge 67 None + BranchConditional 65 66 97 + 66: Label + 68: 36(ptr) AccessChain 9(color) 35 + 69: 6(float) Load 68 + 70: 6(float) Load 63(threshhold2) + 71: 21(bool) FOrdGreaterThan 69 70 + SelectionMerge 73 None + BranchConditional 71 72 75 + 72: Label Return - 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 - 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 + 75: Label + 78: 21(bool) Load 77(b) + SelectionMerge 80 None + BranchConditional 78 79 84 + 79: Label + 81: 36(ptr) AccessChain 9(color) 35 + 82: 6(float) Load 81 + 83: 6(float) FAdd 82 47 + Store 81 83 + Branch 80 + 84: Label + 86: 36(ptr) AccessChain 9(color) 85 + 87: 6(float) Load 86 + 88: 6(float) Load 39(minimum) + 89: 21(bool) FOrdLessThan 87 88 + SelectionMerge 91 None + BranchConditional 89 90 93 + 90: Label Kill - 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 + 93: Label + 94: 7(fvec4) Load 9(color) + 95: 7(fvec4) CompositeConstruct 47 47 47 47 + 96: 7(fvec4) FAdd 94 95 + Store 9(color) 96 + Branch 91 + 91: Label + Branch 80 + 80: Label + Branch 73 + 73: Label + Branch 67 + 97: Label + 98: 21(bool) Load 77(b) + SelectionMerge 100 None + BranchConditional 98 99 102 + 99: Label Kill - 104: Label + 102: Label Return - 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 + 100: Label + Branch 67 + 67: Label + 106: 7(fvec4) Load 9(color) + 107: 7(fvec4) Load 13(color2) + 108: 7(fvec4) FMul 106 107 + Store 105(gl_FragColor) 108 Return FunctionEnd diff --git a/Test/baseResults/spv.flowControl.frag.out b/Test/baseResults/spv.flowControl.frag.out index 825a4177..7ca61b7a 100755 --- a/Test/baseResults/spv.flowControl.frag.out +++ b/Test/baseResults/spv.flowControl.frag.out @@ -5,24 +5,24 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 41 +// Id's are bound by 39 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 18 37 - ExecutionMode 4 OriginLowerLeft - Source GLSL 120 + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 35 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 13 "color2" - Name 15 "otherColor" - Name 18 "c" - Name 21 "d" - Name 27 "bigColor" - Name 32 "smallColor" - Name 37 "gl_FragColor" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 35 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -30,46 +30,44 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 14: TypePointer UniformConstant 7(fvec4) - 15(otherColor): 14(ptr) Variable UniformConstant - 17: TypePointer Input 6(float) - 18(c): 17(ptr) Variable Input - 20: TypePointer UniformConstant 6(float) - 21(d): 20(ptr) Variable UniformConstant - 23: TypeBool - 27(bigColor): 14(ptr) Variable UniformConstant - 32(smallColor): 14(ptr) Variable UniformConstant - 36: TypePointer Output 7(fvec4) -37(gl_FragColor): 36(ptr) Variable Output + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(gl_FragColor): 34(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 13(color2): 8(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - 16: 7(fvec4) Load 15(otherColor) - Store 13(color2) 16 - 19: 6(float) Load 18(c) - 22: 6(float) Load 21(d) - 24: 23(bool) FOrdGreaterThan 19 22 - SelectionMerge 26 None - BranchConditional 24 25 31 - 25: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - Branch 26 - 31: Label - 33: 7(fvec4) Load 32(smallColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 26 - 26: Label - 38: 7(fvec4) Load 9(color) - 39: 7(fvec4) Load 13(color2) - 40: 7(fvec4) FMul 38 39 - Store 37(gl_FragColor) 40 + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 36: 7(fvec4) Load 9(color) + 37: 7(fvec4) Load 13(color2) + 38: 7(fvec4) FMul 36 37 + Store 35(gl_FragColor) 38 Return FunctionEnd diff --git a/Test/baseResults/spv.for-complex-condition.vert.out b/Test/baseResults/spv.for-complex-condition.vert.out new file mode 100644 index 00000000..fab7f3d9 --- /dev/null +++ b/Test/baseResults/spv.for-complex-condition.vert.out @@ -0,0 +1,72 @@ +spv.for-complex-condition.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 18 31 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 18 "flag" + Name 31 "r" + Decorate 18(flag) Location 0 + Decorate 31(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 17: TypePointer Input 6(int) + 18(flag): 17(ptr) Variable Input + 20: 6(int) Constant 1 + 21: TypeBool + 25: 6(int) Constant 10 + 27: 6(int) Constant 15 + 30: TypePointer Output 6(int) + 31(r): 30(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 16: 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 19: 6(int) Load 18(flag) + 22: 21(bool) IEqual 19 20 + SelectionMerge 24 None + BranchConditional 22 23 26 + 23: Label + Store 16 25 + Branch 24 + 26: Label + Store 16 27 + Branch 24 + 24: Label + 28: 6(int) Load 16 + 29: 21(bool) SLessThan 15 28 + BranchConditional 29 11 12 + 11: Label + 32: 6(int) Load 8(i) + Store 31(r) 32 + Branch 13 + 13: Label + 33: 6(int) Load 8(i) + 34: 6(int) IAdd 33 20 + Store 8(i) 34 + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out old mode 100755 new mode 100644 index 92976eb5..0ea2f143 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -1,50 +1,45 @@ spv.for-continue-break.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 48 +// Id's are bound by 45 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 46 47 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 17 "A" - Name 25 "B" + Name 19 "A" + Name 27 "B" Name 29 "C" Name 36 "D" Name 38 "E" Name 39 "F" Name 43 "G" - Name 46 "gl_VertexID" - Name 47 "gl_InstanceID" - Decorate 46(gl_VertexID) BuiltIn VertexId - Decorate 47(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: 6(int) Constant 2 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: 6(int) Constant 2 31: 6(int) Constant 3 40: 6(int) Constant 12 44: 6(int) Constant 99 - 45: TypePointer Input 6(int) - 46(gl_VertexID): 45(ptr) Variable Input -47(gl_InstanceID): 45(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 17(A): 7(ptr) Variable Function - 25(B): 7(ptr) Variable Function + 19(A): 7(ptr) Variable Function + 27(B): 7(ptr) Variable Function 29(C): 7(ptr) Variable Function 36(D): 7(ptr) Variable Function 38(E): 7(ptr) Variable Function @@ -53,45 +48,40 @@ Linked vertex stage: Store 8(i) 9 Branch 10 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(A) 18 - 19: 6(int) Load 8(i) - 21: 6(int) SMod 19 20 - 22: 15(bool) IEqual 21 9 - SelectionMerge 24 None - BranchConditional 22 23 24 - 23: Label - Store 25(B) 18 - 26: 6(int) Load 8(i) - 27: 6(int) IAdd 26 18 - Store 8(i) 27 - Branch 10 - 28: Label - Store 29(C) 18 - Branch 24 - 24: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(A) 20 + 21: 6(int) Load 8(i) + 23: 6(int) SMod 21 22 + 24: 17(bool) IEqual 23 9 + SelectionMerge 26 None + BranchConditional 24 25 26 + 25: Label + Store 27(B) 20 + Branch 13 + 26: Label 30: 6(int) Load 8(i) 32: 6(int) SMod 30 31 - 33: 15(bool) IEqual 32 9 + 33: 17(bool) IEqual 32 9 SelectionMerge 35 None BranchConditional 33 34 35 34: Label - Store 36(D) 18 - Branch 11 - 37: Label - Store 38(E) 18 - Branch 35 + Store 36(D) 20 + Branch 12 35: Label Store 39(F) 40 + Branch 13 + 13: Label 41: 6(int) Load 8(i) - 42: 6(int) IAdd 41 18 + 42: 6(int) IAdd 41 20 Store 8(i) 42 Branch 10 - 11: Label + 12: Label Store 43(G) 44 Return FunctionEnd diff --git a/Test/baseResults/spv.for-nobody.vert.out b/Test/baseResults/spv.for-nobody.vert.out new file mode 100644 index 00000000..a127b709 --- /dev/null +++ b/Test/baseResults/spv.for-nobody.vert.out @@ -0,0 +1,54 @@ +spv.for-nobody.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 23 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 23 "r" + Decorate 23(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: TypePointer Output 6(int) + 23(r): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Branch 13 + 13: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 10 + 12: Label + 24: 6(int) Load 8(i) + Store 23(r) 24 + Return + FunctionEnd diff --git a/Test/baseResults/spv.for-notest.vert.out b/Test/baseResults/spv.for-notest.vert.out new file mode 100644 index 00000000..67706701 --- /dev/null +++ b/Test/baseResults/spv.for-notest.vert.out @@ -0,0 +1,48 @@ +spv.for-notest.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 15 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 15 "r" + Decorate 15(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 14: TypePointer Output 6(int) + 15(r): 14(ptr) Variable Output + 18: 6(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + 16: 6(int) Load 8(i) + Store 15(r) 16 + Branch 13 + 13: Label + 17: 6(int) Load 8(i) + 19: 6(int) IAdd 17 18 + Store 8(i) 19 + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.for-simple.vert.out b/Test/baseResults/spv.for-simple.vert.out index 0ce997ba..52a047ff 100755 --- a/Test/baseResults/spv.for-simple.vert.out +++ b/Test/baseResults/spv.for-simple.vert.out @@ -1,53 +1,52 @@ spv.for-simple.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 24 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 24 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 17 "j" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId + Name 19 "j" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 12 - 20: 6(int) Constant 1 - 22: TypePointer Input 6(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 12 + 22: 6(int) Constant 1 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 17(j): 7(ptr) Variable Function + 19(j): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(j) 18 - 19: 6(int) Load 8(i) - 21: 6(int) IAdd 19 20 - Store 8(i) 21 + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(j) 20 + Branch 13 + 13: Label + 21: 6(int) Load 8(i) + 23: 6(int) IAdd 21 22 + Store 8(i) 23 Branch 10 - 11: Label + 12: Label Return FunctionEnd diff --git a/Test/baseResults/spv.forLoop.frag.out b/Test/baseResults/spv.forLoop.frag.out index a7523dc2..e606f9cc 100755 --- a/Test/baseResults/spv.forLoop.frag.out +++ b/Test/baseResults/spv.forLoop.frag.out @@ -5,30 +5,32 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 122 +// Id's are bound by 131 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 35 97 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 11 24 28 36 53 104 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 15 "i" - Name 22 "Count" - Name 27 "bigColor" - Name 35 "gl_FragColor" - Name 38 "sum" - Name 40 "i" - Name 50 "v4" - Name 60 "i" - Name 66 "tv4" - Name 83 "r" - Name 89 "i" - Name 97 "f" - Name 110 "i" + Name 24 "Count" + Name 28 "bigColor" + Name 36 "gl_FragColor" + Name 39 "sum" + Name 41 "i" + Name 53 "v4" + Name 63 "i" + Name 71 "tv4" + Name 88 "r" + Name 94 "i" + Name 104 "f" + Name 117 "i" + Decorate 24(Count) Flat + Decorate 53(v4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -39,156 +41,175 @@ Linked fragment stage: 13: TypeInt 32 1 14: TypePointer Function 13(int) 16: 13(int) Constant 0 - 21: TypePointer UniformConstant 13(int) - 22(Count): 21(ptr) Variable UniformConstant - 24: TypeBool - 26: TypePointer UniformConstant 7(fvec4) - 27(bigColor): 26(ptr) Variable UniformConstant - 32: 13(int) Constant 1 - 34: TypePointer Output 7(fvec4) -35(gl_FragColor): 34(ptr) Variable Output - 37: TypePointer Function 6(float) - 39: 6(float) Constant 0 - 45: 13(int) Constant 4 - 47: TypeInt 32 0 - 48: TypeVector 47(int) 4 - 49: TypePointer UniformConstant 48(ivec4) - 50(v4): 49(ptr) Variable UniformConstant - 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 + 23: TypePointer Input 13(int) + 24(Count): 23(ptr) Variable Input + 26: TypeBool + 28(bigColor): 10(ptr) Variable Input + 33: 13(int) Constant 1 + 35: TypePointer Output 7(fvec4) +36(gl_FragColor): 35(ptr) Variable Output + 38: TypePointer Function 6(float) + 40: 6(float) Constant 0 + 48: 13(int) Constant 4 + 50: TypeInt 32 0 + 51: TypeVector 50(int) 4 + 52: TypePointer Input 51(ivec4) + 53(v4): 52(ptr) Variable Input + 55: TypePointer Input 50(int) + 76: 50(int) Constant 4 + 89: TypeVector 6(float) 3 + 103: TypePointer Input 6(float) + 104(f): 103(ptr) Variable Input + 106: 50(int) Constant 3 + 124: 13(int) Constant 16 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 15(i): 14(ptr) Variable Function - 38(sum): 37(ptr) Variable Function - 40(i): 14(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 + 39(sum): 38(ptr) Variable Function + 41(i): 14(ptr) Variable Function + 63(i): 14(ptr) Variable Function + 71(tv4): 8(ptr) Variable Function + 88(r): 8(ptr) Variable Function + 94(i): 14(ptr) Variable Function + 117(i): 14(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Store 15(i) 16 Branch 17 17: Label - 20: 13(int) Load 15(i) - 23: 13(int) Load 22(Count) - 25: 24(bool) SLessThan 20 23 - LoopMerge 18 17 None - BranchConditional 25 19 18 - 19: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - 31: 13(int) Load 15(i) - 33: 13(int) IAdd 31 32 - Store 15(i) 33 + LoopMerge 19 20 None + Branch 21 + 21: Label + 22: 13(int) Load 15(i) + 25: 13(int) Load 24(Count) + 27: 26(bool) SLessThan 22 25 + BranchConditional 27 18 19 + 18: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 20 + 20: Label + 32: 13(int) Load 15(i) + 34: 13(int) IAdd 32 33 + Store 15(i) 34 Branch 17 - 18: Label - 36: 7(fvec4) Load 9(color) - Store 35(gl_FragColor) 36 - Store 38(sum) 39 - Store 40(i) 16 - Branch 41 - 41: Label - 44: 13(int) Load 40(i) - 46: 24(bool) SLessThan 44 45 - LoopMerge 42 41 None - BranchConditional 46 43 42 - 43: Label - 51: 13(int) Load 40(i) - 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 + 19: Label + 37: 7(fvec4) Load 9(color) + Store 36(gl_FragColor) 37 + Store 39(sum) 40 + Store 41(i) 16 + Branch 42 42: Label - 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 66(tv4) - 80: 7(fvec4) FAdd 78 79 - 81: 7(fvec4) Load 35(gl_FragColor) - 82: 7(fvec4) FAdd 81 80 - Store 35(gl_FragColor) 82 - 85: 7(fvec4) Load 11(BaseColor) - 86: 84(fvec3) VectorShuffle 85 85 0 1 2 - 87: 7(fvec4) Load 83(r) - 88: 7(fvec4) VectorShuffle 87 86 4 5 6 3 - Store 83(r) 88 - Store 89(i) 16 - Branch 90 - 90: Label - 93: 13(int) Load 89(i) - 94: 13(int) Load 22(Count) - 95: 24(bool) SLessThan 93 94 - LoopMerge 91 90 None - BranchConditional 95 92 91 - 92: Label - 98: 6(float) Load 97(f) - 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 - Branch 90 - 91: Label - 103: 7(fvec4) Load 83(r) - 104: 84(fvec3) VectorShuffle 103 103 0 1 2 - 105: 7(fvec4) Load 35(gl_FragColor) - 106: 84(fvec3) VectorShuffle 105 105 0 1 2 - 107: 84(fvec3) FAdd 106 104 - 108: 7(fvec4) Load 35(gl_FragColor) - 109: 7(fvec4) VectorShuffle 108 107 4 5 6 3 - Store 35(gl_FragColor) 109 - Store 110(i) 16 - Branch 111 - 111: Label - 114: 13(int) Load 110(i) - 116: 24(bool) SLessThan 114 115 - LoopMerge 112 111 None - BranchConditional 116 113 112 - 113: Label - 117: 6(float) Load 97(f) - 118: 7(fvec4) Load 35(gl_FragColor) - 119: 7(fvec4) VectorTimesScalar 118 117 - Store 35(gl_FragColor) 119 - 120: 13(int) Load 110(i) - 121: 13(int) IAdd 120 45 - Store 110(i) 121 - Branch 111 - 112: Label + LoopMerge 44 45 None + Branch 46 + 46: Label + 47: 13(int) Load 41(i) + 49: 26(bool) SLessThan 47 48 + BranchConditional 49 43 44 + 43: Label + 54: 13(int) Load 41(i) + 56: 55(ptr) AccessChain 53(v4) 54 + 57: 50(int) Load 56 + 58: 6(float) ConvertUToF 57 + 59: 6(float) Load 39(sum) + 60: 6(float) FAdd 59 58 + Store 39(sum) 60 + Branch 45 + 45: Label + 61: 13(int) Load 41(i) + 62: 13(int) IAdd 61 33 + Store 41(i) 62 + Branch 42 + 44: Label + Store 63(i) 16 + Branch 64 + 64: Label + LoopMerge 66 67 None + Branch 68 + 68: Label + 69: 13(int) Load 63(i) + 70: 26(bool) SLessThan 69 48 + BranchConditional 70 65 66 + 65: Label + 72: 13(int) Load 63(i) + 73: 13(int) Load 63(i) + 74: 55(ptr) AccessChain 53(v4) 73 + 75: 50(int) Load 74 + 77: 50(int) IMul 75 76 + 78: 6(float) ConvertUToF 77 + 79: 38(ptr) AccessChain 71(tv4) 72 + Store 79 78 + Branch 67 + 67: Label + 80: 13(int) Load 63(i) + 81: 13(int) IAdd 80 33 + Store 63(i) 81 + Branch 64 + 66: Label + 82: 6(float) Load 39(sum) + 83: 7(fvec4) CompositeConstruct 82 82 82 82 + 84: 7(fvec4) Load 71(tv4) + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) Load 36(gl_FragColor) + 87: 7(fvec4) FAdd 86 85 + Store 36(gl_FragColor) 87 + 90: 7(fvec4) Load 11(BaseColor) + 91: 89(fvec3) VectorShuffle 90 90 0 1 2 + 92: 7(fvec4) Load 88(r) + 93: 7(fvec4) VectorShuffle 92 91 4 5 6 3 + Store 88(r) 93 + Store 94(i) 16 + Branch 95 + 95: Label + LoopMerge 97 98 None + Branch 99 + 99: Label + 100: 13(int) Load 94(i) + 101: 13(int) Load 24(Count) + 102: 26(bool) SLessThan 100 101 + BranchConditional 102 96 97 + 96: Label + 105: 6(float) Load 104(f) + 107: 38(ptr) AccessChain 88(r) 106 + Store 107 105 + Branch 98 + 98: Label + 108: 13(int) Load 94(i) + 109: 13(int) IAdd 108 33 + Store 94(i) 109 + Branch 95 + 97: Label + 110: 7(fvec4) Load 88(r) + 111: 89(fvec3) VectorShuffle 110 110 0 1 2 + 112: 7(fvec4) Load 36(gl_FragColor) + 113: 89(fvec3) VectorShuffle 112 112 0 1 2 + 114: 89(fvec3) FAdd 113 111 + 115: 7(fvec4) Load 36(gl_FragColor) + 116: 7(fvec4) VectorShuffle 115 114 4 5 6 3 + Store 36(gl_FragColor) 116 + Store 117(i) 16 + Branch 118 + 118: Label + LoopMerge 120 121 None + Branch 122 + 122: Label + 123: 13(int) Load 117(i) + 125: 26(bool) SLessThan 123 124 + BranchConditional 125 119 120 + 119: Label + 126: 6(float) Load 104(f) + 127: 7(fvec4) Load 36(gl_FragColor) + 128: 7(fvec4) VectorTimesScalar 127 126 + Store 36(gl_FragColor) 128 + Branch 121 + 121: Label + 129: 13(int) Load 117(i) + 130: 13(int) IAdd 129 48 + Store 117(i) 130 + Branch 118 + 120: Label Return FunctionEnd diff --git a/Test/baseResults/spv.forwardFun.frag.out b/Test/baseResults/spv.forwardFun.frag.out index 8d0323b9..346523cb 100755 --- a/Test/baseResults/spv.forwardFun.frag.out +++ b/Test/baseResults/spv.forwardFun.frag.out @@ -10,9 +10,9 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 20 30 - ExecutionMode 4 OriginLowerLeft - Source ESSL 100 + EntryPoint Fragment 4 "main" 20 30 36 59 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 6 "bar(" Name 10 "unreachableReturn(" @@ -25,12 +25,6 @@ Linked fragment stage: Name 30 "gl_FragColor" Name 36 "d" Name 59 "bigColor" - Decorate 18(color) RelaxedPrecision - Decorate 20(BaseColor) RelaxedPrecision - Decorate 27(f) RelaxedPrecision - Decorate 30(gl_FragColor) RelaxedPrecision - Decorate 36(d) RelaxedPrecision - Decorate 59(bigColor) RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 @@ -43,8 +37,8 @@ Linked fragment stage: 26: TypePointer Function 8(float) 29: TypePointer Output 12(fvec4) 30(gl_FragColor): 29(ptr) Variable Output - 35: TypePointer UniformConstant 8(float) - 36(d): 35(ptr) Variable UniformConstant + 35: TypePointer Input 8(float) + 36(d): 35(ptr) Variable Input 38: 8(float) Constant 1082549862 39: TypeBool 43: 8(float) Constant 1067030938 @@ -52,8 +46,7 @@ Linked fragment stage: 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 + 59(bigColor): 19(ptr) Variable Input 4(main): 2 Function None 3 5: Label 18(color): 13(ptr) Variable Function diff --git a/Test/baseResults/spv.functionCall.frag.out b/Test/baseResults/spv.functionCall.frag.out index 5716f1d9..db40dd51 100755 --- a/Test/baseResults/spv.functionCall.frag.out +++ b/Test/baseResults/spv.functionCall.frag.out @@ -1,5 +1,7 @@ spv.functionCall.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:5: varying deprecated in version 130; may be removed in future release Linked fragment stage: @@ -12,9 +14,9 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 57 68 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 35 58 69 75 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 11 "foo(vf4;" Name 10 "bar" @@ -22,13 +24,13 @@ Linked fragment stage: Name 16 "unreachableReturn(" Name 18 "missingReturn(" Name 21 "h" - Name 34 "d" - Name 55 "color" - Name 57 "BaseColor" - Name 58 "param" - Name 63 "f" - Name 65 "g" - Name 68 "gl_FragColor" + Name 35 "d" + Name 56 "color" + Name 58 "BaseColor" + Name 59 "param" + Name 64 "f" + Name 66 "g" + Name 69 "gl_FragColor" Name 75 "bigColor" 2: TypeVoid 3: TypeFunction 2 @@ -44,42 +46,41 @@ Linked fragment stage: 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 + 34: TypePointer Input 6(float) + 35(d): 34(ptr) Variable Input + 37: 6(float) Constant 1082549862 + 38: TypeBool + 42: 6(float) Constant 1067030938 + 45: 6(float) Constant 1083179008 + 53: 6(float) Constant 1081711002 + 57: TypePointer Input 7(fvec4) + 58(BaseColor): 57(ptr) Variable Input + 68: TypePointer Output 7(fvec4) +69(gl_FragColor): 68(ptr) Variable Output + 75(bigColor): 57(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 55(color): 8(ptr) Variable Function - 58(param): 8(ptr) Variable Function - 63(f): 25(ptr) Variable Function - 65(g): 25(ptr) Variable Function + 56(color): 8(ptr) Variable Function + 59(param): 8(ptr) Variable Function + 64(f): 25(ptr) Variable Function + 66(g): 25(ptr) Variable Function Store 21(h) 22 - 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 + 60: 7(fvec4) Load 58(BaseColor) + Store 59(param) 60 + 61: 6(float) FunctionCall 11(foo(vf4;) 59(param) + 62: 7(fvec4) CompositeConstruct 61 61 61 61 + Store 56(color) 62 + 63: 2 FunctionCall 13(bar() + 65: 6(float) FunctionCall 16(unreachableReturn() + Store 64(f) 65 + 67: 6(float) FunctionCall 18(missingReturn() + Store 66(g) 67 + 70: 7(fvec4) Load 56(color) + 71: 6(float) Load 64(f) + 72: 7(fvec4) VectorTimesScalar 70 71 + 73: 6(float) Load 21(h) + 74: 7(fvec4) VectorTimesScalar 72 73 + Store 69(gl_FragColor) 74 Return FunctionEnd 11(foo(vf4;): 6(float) Function None 9 @@ -98,29 +99,29 @@ Linked fragment stage: FunctionEnd 16(unreachableReturn(): 6(float) Function None 15 17: Label - 35: 6(float) Load 34(d) - 38: 37(bool) FOrdLessThan 35 36 - SelectionMerge 40 None - BranchConditional 38 39 43 - 39: Label - ReturnValue 41 - 43: Label - ReturnValue 44 - 40: Label - 46: 6(float) Undef - ReturnValue 46 + 36: 6(float) Load 35(d) + 39: 38(bool) FOrdLessThan 36 37 + SelectionMerge 41 None + BranchConditional 39 40 44 + 40: Label + ReturnValue 42 + 44: Label + ReturnValue 45 + 41: Label + 47: 6(float) Undef + ReturnValue 47 FunctionEnd 18(missingReturn(): 6(float) Function None 15 19: Label - 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 + 48: 6(float) Load 35(d) + 49: 38(bool) FOrdLessThan 48 45 + SelectionMerge 51 None + BranchConditional 49 50 51 + 50: Label + 52: 6(float) Load 35(d) + Store 21(h) 52 + ReturnValue 53 + 51: Label + 55: 6(float) Undef + ReturnValue 55 FunctionEnd diff --git a/Test/baseResults/spv.functionSemantics.frag.out b/Test/baseResults/spv.functionSemantics.frag.out index 35d8100e..aa2abd84 100755 --- a/Test/baseResults/spv.functionSemantics.frag.out +++ b/Test/baseResults/spv.functionSemantics.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 153 +// Id's are bound by 156 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 149 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 76 152 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 15 "foo(i1;i1;i1;i1;i1;i1;" @@ -29,25 +29,25 @@ Linked fragment stage: Name 24 "r" Name 28 "foo3(" Name 30 "sum" - 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 76 "u" + Name 89 "t" + Name 92 "s" + MemberName 92(s) 0 "t" + Name 94 "f" + Name 98 "color" + Name 104 "e" Name 105 "param" - 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" + Name 106 "param" + Name 107 "param" + Name 108 "param" + Name 123 "ret" + Name 125 "tempReturn" + Name 130 "tempArg" + Name 131 "param" + Name 132 "param" + Name 133 "param" + Name 136 "arg" + Name 152 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -61,103 +61,103 @@ Linked fragment stage: 27: TypeFunction 6(int) 38: 6(int) Constant 64 43: 6(int) Constant 1024 - 61: 17(float) Constant 1077936128 - 65: 17(float) Constant 1084227584 - 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 + 62: 17(float) Constant 1077936128 + 66: 17(float) Constant 1084227584 + 67: TypeInt 32 0 + 68: 67(int) Constant 1 + 75: TypePointer Input 17(float) + 76(u): 75(ptr) Variable Input + 78: 17(float) Constant 1078774989 + 79: TypeBool + 84: 6(int) Constant 1000000 + 86: 6(int) Constant 2000000 + 90: 6(int) Constant 2 + 91: TypeVector 6(int) 4 + 92(s): TypeStruct 91(ivec4) + 93: TypePointer Function 92(s) + 95: 6(int) Constant 0 + 96: 6(int) Constant 32 + 99: 6(int) Constant 1 + 103: 6(int) Constant 8 + 115: 6(int) Constant 128 + 124: TypePointer Private 6(int) + 125(tempReturn): 124(ptr) Variable Private + 126: 17(float) Constant 1082130432 + 127: 17(float) Constant 1065353216 + 128: 17(float) Constant 1073741824 + 129: 19(fvec3) ConstantComposite 127 128 62 + 150: TypeVector 17(float) 4 + 151: TypePointer Output 150(fvec4) +152(gl_FragColor): 151(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 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 + 89(t): 7(ptr) Variable Function + 94(f): 93(ptr) Variable Function + 98(color): 7(ptr) Variable Function + 104(e): 7(ptr) Variable Function 105(param): 7(ptr) Variable Function - 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) + 106(param): 7(ptr) Variable Function + 107(param): 7(ptr) Variable Function + 108(param): 7(ptr) Variable Function + 123(ret): 18(ptr) Variable Function + 130(tempArg): 7(ptr) Variable Function + 131(param): 18(ptr) Variable Function + 132(param): 20(ptr) Variable Function + 133(param): 7(ptr) Variable Function + 136(arg): 18(ptr) Variable Function + Store 89(t) 90 + 97: 7(ptr) AccessChain 94(f) 95 68 + Store 97 96 + 100: 6(int) Load 89(t) + 101: 6(int) Load 89(t) + 102: 6(int) IAdd 100 101 + Store 105(param) 99 + Store 106(param) 102 + 109: 7(ptr) AccessChain 94(f) 95 68 + 110: 6(int) Load 109 + Store 108(param) 110 + 111: 6(int) FunctionCall 15(foo(i1;i1;i1;i1;i1;i1;) 105(param) 90 106(param) 103 107(param) 108(param) + 112: 6(int) Load 107(param) + Store 104(e) 112 + 113: 6(int) Load 108(param) + 114: 7(ptr) AccessChain 94(f) 95 68 + Store 114 113 + Store 98(color) 111 + 116: 6(int) Load 104(e) + 117: 7(ptr) AccessChain 94(f) 95 68 + 118: 6(int) Load 117 + 119: 6(int) IAdd 116 118 + 120: 6(int) IMul 115 119 + 121: 6(int) Load 98(color) + 122: 6(int) IAdd 121 120 + Store 98(color) 122 + Store 131(param) 126 + Store 132(param) 129 + 134: 6(int) FunctionCall 25(foo2(f1;vf3;i1;) 131(param) 132(param) 133(param) + 135: 6(int) Load 133(param) + Store 130(tempArg) 135 + Store 125(tempReturn) 134 + 137: 6(int) Load 130(tempArg) + 138: 17(float) ConvertSToF 137 + Store 136(arg) 138 + 139: 6(int) Load 125(tempReturn) + 140: 17(float) ConvertSToF 139 + Store 123(ret) 140 + 141: 17(float) Load 123(ret) + 142: 17(float) Load 136(arg) + 143: 17(float) FAdd 141 142 + 144: 6(int) ConvertFToS 143 + 145: 6(int) Load 98(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 + Store 98(color) 146 + 147: 6(int) FunctionCall 28(foo3() + 148: 6(int) Load 98(color) + 149: 6(int) IAdd 148 147 + Store 98(color) 149 + 153: 6(int) Load 98(color) + 154: 17(float) ConvertSToF 153 + 155: 150(fvec4) CompositeConstruct 154 154 154 154 + Store 152(gl_FragColor) 155 Return FunctionEnd 15(foo(i1;i1;i1;i1;i1;i1;): 6(int) Function None 8 @@ -209,24 +209,24 @@ Linked fragment stage: 23(b): 20(ptr) FunctionParameter 24(r): 7(ptr) FunctionParameter 26: Label - 62: 17(float) Load 22(a) - 63: 17(float) FMul 61 62 - 64: 6(int) ConvertFToS 63 - Store 24(r) 64 - 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 + 63: 17(float) Load 22(a) + 64: 17(float) FMul 62 63 + 65: 6(int) ConvertFToS 64 + Store 24(r) 65 + 69: 18(ptr) AccessChain 23(b) 68 + 70: 17(float) Load 69 + 71: 17(float) FMul 66 70 + 72: 6(int) ConvertFToS 71 + ReturnValue 72 FunctionEnd 28(foo3(): 6(int) Function None 27 29: Label - 75: 17(float) Load 74(u) - 78: 77(bool) FOrdGreaterThan 75 76 - SelectionMerge 80 None - BranchConditional 78 79 80 - 79: Label + 77: 17(float) Load 76(u) + 80: 79(bool) FOrdGreaterThan 77 78 + SelectionMerge 82 None + BranchConditional 80 81 82 + 81: Label Kill - 80: Label - ReturnValue 84 + 82: Label + ReturnValue 86 FunctionEnd diff --git a/Test/baseResults/spv.image.frag.out b/Test/baseResults/spv.image.frag.out index 1c9967d2..2bd26f79 100644 --- a/Test/baseResults/spv.image.frag.out +++ b/Test/baseResults/spv.image.frag.out @@ -7,13 +7,21 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 372 +// Id's are bound by 378 Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageMSArray + Capability StorageImageExtendedFormats + Capability ImageQuery + Capability StorageImageWriteWithoutFormat 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 356 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 132 142 152 248 362 377 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "iv" @@ -36,21 +44,43 @@ Linked fragment stage: Name 232 "ii1D" Name 245 "ui2D" Name 248 "value" - Name 356 "fragData" - Name 371 "ic4D" + Name 357 "wo2D" + Name 362 "fragData" + Name 377 "ic4D" + Decorate 15(i1D) DescriptorSet 0 Decorate 15(i1D) Binding 0 + Decorate 27(i2D) DescriptorSet 0 Decorate 27(i2D) Binding 1 + Decorate 38(i3D) DescriptorSet 0 Decorate 38(i3D) Binding 2 + Decorate 45(iCube) DescriptorSet 0 Decorate 45(iCube) Binding 3 + Decorate 55(iCubeArray) DescriptorSet 0 Decorate 55(iCubeArray) Binding 4 + Decorate 62(i2DRect) DescriptorSet 0 Decorate 62(i2DRect) Binding 5 + Decorate 72(i1DArray) DescriptorSet 0 Decorate 72(i1DArray) Binding 6 + Decorate 82(i2DArray) DescriptorSet 0 Decorate 82(i2DArray) Binding 7 + Decorate 89(iBuffer) DescriptorSet 0 Decorate 89(iBuffer) Binding 8 + Decorate 98(i2DMS) DescriptorSet 0 Decorate 98(i2DMS) Binding 9 + Decorate 108(i2DMSArray) DescriptorSet 0 Decorate 108(i2DMSArray) Binding 10 + Decorate 132(ic1D) Flat + Decorate 142(ic2D) Flat + Decorate 152(ic3D) Flat + Decorate 232(ii1D) DescriptorSet 0 Decorate 232(ii1D) Binding 11 + Decorate 245(ui2D) DescriptorSet 0 Decorate 245(ui2D) Binding 12 + Decorate 248(value) Flat + Decorate 357(wo2D) DescriptorSet 0 + Decorate 357(wo2D) Binding 1 + Decorate 357(wo2D) NonReadable + Decorate 377(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -84,7 +114,7 @@ Linked fragment stage: 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 + 80: TypeImage 12(float) 2D array nonsampled format:Rg16 81: TypePointer UniformConstant 80 82(i2DArray): 81(ptr) Variable UniformConstant 87: TypeImage 12(float) Buffer nonsampled format:Rgba32f @@ -100,12 +130,12 @@ Linked fragment stage: 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 + 131: TypePointer Input 6(int) + 132(ic1D): 131(ptr) Variable Input + 141: TypePointer Input 29(ivec2) + 142(ic2D): 141(ptr) Variable Input + 151: TypePointer Input 7(ivec3) + 152(ic3D): 151(ptr) Variable Input 210: 6(int) Constant 1 216: 6(int) Constant 2 220: 6(int) Constant 3 @@ -120,8 +150,8 @@ Linked fragment stage: 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 + 247: TypePointer Input 18(int) + 248(value): 247(ptr) Variable Input 250: TypePointer Image 18(int) 256: 6(int) Constant 11 270: 6(int) Constant 12 @@ -132,18 +162,21 @@ Linked fragment stage: 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 + 355: TypeImage 12(float) 2D nonsampled format:Unknown + 356: TypePointer UniformConstant 355 + 357(wo2D): 356(ptr) Variable UniformConstant + 361: TypePointer Output 125(fvec4) + 362(fragData): 361(ptr) Variable Output + 368: TypeBool + 375: TypeVector 6(int) 4 + 376: TypePointer Input 375(ivec4) + 377(ic4D): 376(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(iv): 8(ptr) Variable Function 127(v): 126(ptr) Variable Function 229(ui): 228(ptr) Variable Function - 357: 126(ptr) Variable Function + 363: 126(ptr) Variable Function Store 9(iv) 11 16: 13 Load 15(i1D) 17: 6(int) ImageQuerySize 16 @@ -346,7 +379,7 @@ Linked fragment stage: ImageWrite 224 225 227 Sample 226 Store 229(ui) 19 233: 6(int) Load 132(ic1D) - 236: 235(ptr) ImageTexelPointer 232(ii1D) 233 0 + 236: 235(ptr) ImageTexelPointer 232(ii1D) 233 19 238: 6(int) AtomicIAdd 236 237 19 234 239: 20(ptr) AccessChain 9(iv) 19 240: 6(int) Load 239 @@ -355,13 +388,13 @@ Linked fragment stage: Store 242 241 246: 29(ivec2) Load 142(ic2D) 249: 18(int) Load 248(value) - 251: 250(ptr) ImageTexelPointer 245(ui2D) 246 0 + 251: 250(ptr) ImageTexelPointer 245(ui2D) 246 19 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 + 257: 235(ptr) ImageTexelPointer 232(ii1D) 255 19 258: 6(int) AtomicSMin 257 237 19 256 259: 20(ptr) AccessChain 9(iv) 19 260: 6(int) Load 259 @@ -370,13 +403,13 @@ Linked fragment stage: Store 262 261 263: 29(ivec2) Load 142(ic2D) 264: 18(int) Load 248(value) - 265: 250(ptr) ImageTexelPointer 245(ui2D) 263 0 + 265: 250(ptr) ImageTexelPointer 245(ui2D) 263 19 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 + 271: 235(ptr) ImageTexelPointer 232(ii1D) 269 19 272: 6(int) AtomicSMax 271 237 19 270 273: 20(ptr) AccessChain 9(iv) 19 274: 6(int) Load 273 @@ -385,13 +418,13 @@ Linked fragment stage: Store 276 275 277: 29(ivec2) Load 142(ic2D) 278: 18(int) Load 248(value) - 279: 250(ptr) ImageTexelPointer 245(ui2D) 277 0 + 279: 250(ptr) ImageTexelPointer 245(ui2D) 277 19 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 + 285: 235(ptr) ImageTexelPointer 232(ii1D) 283 19 286: 6(int) AtomicAnd 285 237 19 284 287: 20(ptr) AccessChain 9(iv) 19 288: 6(int) Load 287 @@ -400,13 +433,13 @@ Linked fragment stage: Store 290 289 291: 29(ivec2) Load 142(ic2D) 292: 18(int) Load 248(value) - 293: 250(ptr) ImageTexelPointer 245(ui2D) 291 0 + 293: 250(ptr) ImageTexelPointer 245(ui2D) 291 19 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 + 299: 235(ptr) ImageTexelPointer 232(ii1D) 297 19 300: 6(int) AtomicOr 299 237 19 298 301: 20(ptr) AccessChain 9(iv) 19 302: 6(int) Load 301 @@ -415,13 +448,13 @@ Linked fragment stage: Store 304 303 305: 29(ivec2) Load 142(ic2D) 306: 18(int) Load 248(value) - 307: 250(ptr) ImageTexelPointer 245(ui2D) 305 0 + 307: 250(ptr) ImageTexelPointer 245(ui2D) 305 19 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 + 313: 235(ptr) ImageTexelPointer 232(ii1D) 311 19 314: 6(int) AtomicXor 313 237 19 312 315: 20(ptr) AccessChain 9(iv) 19 316: 6(int) Load 315 @@ -430,13 +463,13 @@ Linked fragment stage: Store 318 317 319: 29(ivec2) Load 142(ic2D) 320: 18(int) Load 248(value) - 321: 250(ptr) ImageTexelPointer 245(ui2D) 319 0 + 321: 250(ptr) ImageTexelPointer 245(ui2D) 319 19 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 + 327: 235(ptr) ImageTexelPointer 232(ii1D) 325 19 328: 6(int) AtomicExchange 327 237 19 326 329: 20(ptr) AccessChain 9(iv) 19 330: 6(int) Load 329 @@ -445,13 +478,13 @@ Linked fragment stage: Store 332 331 333: 29(ivec2) Load 142(ic2D) 334: 18(int) Load 248(value) - 335: 250(ptr) ImageTexelPointer 245(ui2D) 333 0 + 335: 250(ptr) ImageTexelPointer 245(ui2D) 333 19 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 + 342: 235(ptr) ImageTexelPointer 232(ii1D) 339 19 343: 6(int) AtomicCompareExchange 342 237 19 19 341 340 344: 20(ptr) AccessChain 9(iv) 19 345: 6(int) Load 344 @@ -460,27 +493,31 @@ Linked fragment stage: Store 347 346 348: 29(ivec2) Load 142(ic2D) 350: 18(int) Load 248(value) - 351: 250(ptr) ImageTexelPointer 245(ui2D) 348 0 + 351: 250(ptr) ImageTexelPointer 245(ui2D) 348 19 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 + 358: 355 Load 357(wo2D) + 359: 29(ivec2) Load 142(ic2D) + 360: 125(fvec4) Load 127(v) + ImageWrite 358 359 360 + 364: 18(int) Load 229(ui) + 365: 20(ptr) AccessChain 9(iv) 237 + 366: 6(int) Load 365 + 367: 18(int) Bitcast 366 + 369: 368(bool) INotEqual 364 367 + SelectionMerge 371 None + BranchConditional 369 370 373 + 370: Label + 372: 125(fvec4) Load 127(v) + Store 363 372 + Branch 371 + 373: Label + Store 363 129 + Branch 371 + 371: Label + 374: 125(fvec4) Load 363 + Store 362(fragData) 374 Return FunctionEnd diff --git a/Test/baseResults/spv.intOps.vert.out b/Test/baseResults/spv.intOps.vert.out index 799d4cf4..bbab470f 100644 --- a/Test/baseResults/spv.intOps.vert.out +++ b/Test/baseResults/spv.intOps.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 270 +// Id's are bound by 268 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 15 21 26 47 67 83 100 121 142 146 156 173 182 247 268 269 + EntryPoint Vertex 4 "main" 9 15 21 26 47 67 83 100 121 142 146 156 173 182 247 Source ESSL 310 Name 4 "main" Name 9 "iout" @@ -44,10 +44,8 @@ Linked vertex stage: Name 173 "u3" Name 182 "i3" Name 247 "v4" - Name 268 "gl_VertexID" - Name 269 "gl_InstanceID" - Decorate 268(gl_VertexID) BuiltIn VertexId - Decorate 269(gl_InstanceID) BuiltIn InstanceId + Decorate 261 RelaxedPrecision + Decorate 265 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -115,8 +113,6 @@ Linked vertex stage: 182(i3): 181(ptr) Variable Input 246: TypePointer Input 19(fvec4) 247(v4): 246(ptr) Variable Input -268(gl_VertexID): 155(ptr) Variable Input -269(gl_InstanceID): 155(ptr) Variable Input 4(main): 2 Function None 3 5: Label 30(u2out): 29(ptr) Variable Function diff --git a/Test/baseResults/spv.interpOps.frag.out b/Test/baseResults/spv.interpOps.frag.out index ef701f02..a5076421 100644 --- a/Test/baseResults/spv.interpOps.frag.out +++ b/Test/baseResults/spv.interpOps.frag.out @@ -7,13 +7,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 101 +// Id's are bound by 100 Capability Shader + Capability InterpolationFunction 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 13 24 33 41 99 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 13 24 33 41 47 72 98 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "f4" @@ -22,8 +23,10 @@ Linked fragment stage: Name 33 "if3" Name 41 "if4" Name 47 "samp" - Name 73 "offset" - Name 99 "fragColor" + Name 72 "offset" + Name 98 "fragColor" + Decorate 47(samp) Flat + Decorate 72(offset) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -45,12 +48,11 @@ Linked fragment stage: 40: TypePointer Input 7(fvec4) 41(if4): 40(ptr) Variable Input 45: TypeInt 32 1 - 46: TypePointer UniformConstant 45(int) - 47(samp): 46(ptr) Variable UniformConstant - 72: TypePointer UniformConstant 22(fvec2) - 73(offset): 72(ptr) Variable UniformConstant - 98: TypePointer Output 7(fvec4) - 99(fragColor): 98(ptr) Variable Output + 46: TypePointer Input 45(int) + 47(samp): 46(ptr) Variable Input + 72(offset): 23(ptr) Variable Input + 97: TypePointer Output 7(fvec4) + 98(fragColor): 97(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(f4): 8(ptr) Variable Function @@ -107,35 +109,35 @@ Linked fragment stage: 70: 7(fvec4) Load 9(f4) 71: 7(fvec4) FAdd 70 69 Store 9(f4) 71 - 74: 22(fvec2) Load 73(offset) - 75: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 13(if1) 74 - 76: 17(ptr) AccessChain 9(f4) 16 - 77: 6(float) Load 76 - 78: 6(float) FAdd 77 75 - 79: 17(ptr) AccessChain 9(f4) 16 - Store 79 78 - 80: 22(fvec2) Load 73(offset) - 81: 22(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 24(if2) 80 - 82: 7(fvec4) Load 9(f4) - 83: 22(fvec2) VectorShuffle 82 82 0 1 - 84: 22(fvec2) FAdd 83 81 - 85: 7(fvec4) Load 9(f4) - 86: 7(fvec4) VectorShuffle 85 84 4 5 2 3 - Store 9(f4) 86 - 87: 22(fvec2) Load 73(offset) - 88: 31(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33(if3) 87 - 89: 7(fvec4) Load 9(f4) - 90: 31(fvec3) VectorShuffle 89 89 0 1 2 - 91: 31(fvec3) FAdd 90 88 - 92: 7(fvec4) Load 9(f4) - 93: 7(fvec4) VectorShuffle 92 91 4 5 6 3 - Store 9(f4) 93 - 94: 22(fvec2) Load 73(offset) - 95: 7(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 41(if4) 94 - 96: 7(fvec4) Load 9(f4) - 97: 7(fvec4) FAdd 96 95 - Store 9(f4) 97 - 100: 7(fvec4) Load 9(f4) - Store 99(fragColor) 100 + 73: 22(fvec2) Load 72(offset) + 74: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 13(if1) 73 + 75: 17(ptr) AccessChain 9(f4) 16 + 76: 6(float) Load 75 + 77: 6(float) FAdd 76 74 + 78: 17(ptr) AccessChain 9(f4) 16 + Store 78 77 + 79: 22(fvec2) Load 72(offset) + 80: 22(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 24(if2) 79 + 81: 7(fvec4) Load 9(f4) + 82: 22(fvec2) VectorShuffle 81 81 0 1 + 83: 22(fvec2) FAdd 82 80 + 84: 7(fvec4) Load 9(f4) + 85: 7(fvec4) VectorShuffle 84 83 4 5 2 3 + Store 9(f4) 85 + 86: 22(fvec2) Load 72(offset) + 87: 31(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33(if3) 86 + 88: 7(fvec4) Load 9(f4) + 89: 31(fvec3) VectorShuffle 88 88 0 1 2 + 90: 31(fvec3) FAdd 89 87 + 91: 7(fvec4) Load 9(f4) + 92: 7(fvec4) VectorShuffle 91 90 4 5 6 3 + Store 9(f4) 92 + 93: 22(fvec2) Load 72(offset) + 94: 7(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 41(if4) 93 + 95: 7(fvec4) Load 9(f4) + 96: 7(fvec4) FAdd 95 94 + Store 9(f4) 96 + 99: 7(fvec4) Load 9(f4) + Store 98(fragColor) 99 Return FunctionEnd diff --git a/Test/baseResults/spv.layoutNested.vert.out b/Test/baseResults/spv.layoutNested.vert.out index 399e283b..4f3d67c1 100644 --- a/Test/baseResults/spv.layoutNested.vert.out +++ b/Test/baseResults/spv.layoutNested.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 70 +// Id's are bound by 67 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 63 66 68 69 + EntryPoint Vertex 4 "main" 63 66 Source GLSL 450 Name 4 "main" Name 14 "S" @@ -92,8 +92,6 @@ Linked vertex stage: MemberName 64(S) 1 "b" MemberName 64(S) 2 "c" Name 66 "soutinv" - Name 68 "gl_VertexID" - Name 69 "gl_InstanceID" Decorate 13 ArrayStride 32 MemberDecorate 14(S) 0 Offset 0 MemberDecorate 14(S) 1 ColMajor @@ -175,8 +173,6 @@ Linked vertex stage: MemberDecorate 64(S) 1 Invariant MemberDecorate 64(S) 2 Invariant Decorate 66(soutinv) Invariant - Decorate 68(gl_VertexID) BuiltIn VertexId - Decorate 69(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -240,9 +236,6 @@ Linked vertex stage: 64(S): TypeStruct 8(ivec3) 13 7(int) 65: TypePointer Output 64(S) 66(soutinv): 65(ptr) Variable Output - 67: TypePointer Input 6(int) - 68(gl_VertexID): 67(ptr) Variable Input -69(gl_InstanceID): 67(ptr) Variable Input 4(main): 2 Function None 3 5: Label Return diff --git a/Test/baseResults/spv.length.frag.out b/Test/baseResults/spv.length.frag.out index 84d711cc..81f98a61 100755 --- a/Test/baseResults/spv.length.frag.out +++ b/Test/baseResults/spv.length.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 14 26 - ExecutionMode 4 OriginLowerLeft - Source GLSL 120 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "t" Name 14 "v" @@ -39,8 +39,8 @@ Linked fragment stage: 28: 24(fvec4) ConstantComposite 27 27 27 27 29: 10(int) Constant 3 30: TypeArray 24(fvec4) 29 - 31: TypePointer UniformConstant 30 - 32(u): 31(ptr) Variable UniformConstant + 31: TypePointer Private 30 + 32(u): 31(ptr) Variable Private 4(main): 2 Function None 3 5: Label 9(t): 8(ptr) Variable Function diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index 91e58f93..14f56092 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -1,6 +1,5 @@ spv.localAggregates.frag -WARNING: 0:4: varying deprecated in version 130; may be removed in future release -WARNING: 0:5: varying deprecated in version 130; may be removed in future release +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. Linked fragment stage: @@ -8,14 +7,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 136 +// Id's are bound by 143 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 40 96 106 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 18 43 93 101 111 138 142 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 8 "s1" MemberName 8(s1) 0 "i" @@ -26,26 +25,69 @@ Linked fragment stage: MemberName 10(s2) 2 "s1_1" MemberName 10(s2) 3 "bleh" Name 12 "locals2" - Name 13 "s3" - MemberName 13(s3) 0 "s2_1" - MemberName 13(s3) 1 "i" - MemberName 13(s3) 2 "f" - MemberName 13(s3) 3 "s1_1" - Name 15 "foo3" - Name 36 "localFArray" - Name 40 "coord" - 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" + Name 13 "s1" + MemberName 13(s1) 0 "i" + MemberName 13(s1) 1 "f" + Name 14 "s2" + MemberName 14(s2) 0 "i" + MemberName 14(s2) 1 "f" + MemberName 14(s2) 2 "s1_1" + MemberName 14(s2) 3 "bleh" + Name 15 "s1" + MemberName 15(s1) 0 "i" + MemberName 15(s1) 1 "f" + Name 16 "s3" + MemberName 16(s3) 0 "s2_1" + MemberName 16(s3) 1 "i" + MemberName 16(s3) 2 "f" + MemberName 16(s3) 3 "s1_1" + Name 18 "foo3" + Name 39 "localFArray" + Name 43 "coord" + Name 52 "localIArray" + Name 71 "x" + Name 73 "localArray" + Name 78 "i" + Name 87 "a" + Name 93 "condition" + Name 101 "color" + Name 111 "gl_FragColor" + Name 131 "samp2D" + Name 136 "s1" + MemberName 136(s1) 0 "i" + MemberName 136(s1) 1 "f" + Name 138 "foo" + Name 139 "s1" + MemberName 139(s1) 0 "i" + MemberName 139(s1) 1 "f" + Name 140 "s2" + MemberName 140(s2) 0 "i" + MemberName 140(s2) 1 "f" + MemberName 140(s2) 2 "s1_1" + MemberName 140(s2) 3 "bleh" + Name 142 "foo2" + MemberDecorate 13(s1) 0 Flat + MemberDecorate 13(s1) 1 Flat + MemberDecorate 14(s2) 0 Flat + MemberDecorate 14(s2) 1 Flat + MemberDecorate 14(s2) 2 Flat + MemberDecorate 14(s2) 3 Flat + MemberDecorate 15(s1) 0 Flat + MemberDecorate 15(s1) 1 Flat + MemberDecorate 16(s3) 0 Flat + MemberDecorate 16(s3) 1 Flat + MemberDecorate 16(s3) 2 Flat + MemberDecorate 16(s3) 3 Flat + Decorate 93(condition) Flat + Decorate 131(samp2D) DescriptorSet 0 + MemberDecorate 136(s1) 0 Flat + MemberDecorate 136(s1) 1 Flat + MemberDecorate 139(s1) 0 Flat + MemberDecorate 139(s1) 1 Flat + MemberDecorate 140(s2) 0 Flat + MemberDecorate 140(s2) 1 Flat + MemberDecorate 140(s2) 2 Flat + MemberDecorate 140(s2) 3 Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -54,162 +96,171 @@ Linked fragment stage: 9: TypeVector 7(float) 4 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) 11: TypePointer Function 10(s2) - 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) - 14: TypePointer UniformConstant 13(s3) - 15(foo3): 14(ptr) Variable UniformConstant - 16: 6(int) Constant 0 - 17: TypePointer UniformConstant 10(s2) - 20: TypePointer UniformConstant 6(int) - 23: TypeBool - 27: 6(int) Constant 2 - 28: 6(int) Constant 1 - 29: 7(float) Constant 1065353216 - 30: TypePointer Function 7(float) - 32: TypeInt 32 0 - 33: 32(int) Constant 16 - 34: TypeArray 7(float) 33 - 35: TypePointer Function 34 - 37: 6(int) Constant 4 - 38: TypeVector 7(float) 2 - 39: TypePointer Input 38(fvec2) - 40(coord): 39(ptr) Variable Input - 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 + 13(s1): TypeStruct 6(int) 7(float) + 14(s2): TypeStruct 6(int) 7(float) 13(s1) 9(fvec4) + 15(s1): TypeStruct 6(int) 7(float) + 16(s3): TypeStruct 14(s2) 6(int) 7(float) 15(s1) + 17: TypePointer Input 16(s3) + 18(foo3): 17(ptr) Variable Input + 19: 6(int) Constant 0 + 20: TypePointer Input 14(s2) + 23: TypePointer Input 6(int) + 26: TypeBool + 30: 6(int) Constant 2 + 31: 6(int) Constant 1 + 32: 7(float) Constant 1065353216 + 33: TypePointer Function 7(float) + 35: TypeInt 32 0 + 36: 35(int) Constant 16 + 37: TypeArray 7(float) 36 + 38: TypePointer Function 37 + 40: 6(int) Constant 4 + 41: TypeVector 7(float) 2 + 42: TypePointer Input 41(fvec2) + 43(coord): 42(ptr) Variable Input + 44: 35(int) Constant 0 + 45: TypePointer Input 7(float) + 49: 35(int) Constant 8 + 50: TypeArray 6(int) 49 + 51: TypePointer Function 50 + 55: TypePointer Function 6(int) + 72: 6(int) Constant 5 + 85: 6(int) Constant 16 + 89: 7(float) Constant 0 + 93(condition): 23(ptr) Variable Input + 99: 6(int) Constant 3 + 100: TypePointer Input 9(fvec4) + 101(color): 100(ptr) Variable Input + 103: TypePointer Function 9(fvec4) + 105: 35(int) Constant 1 + 108: 35(int) Constant 2 + 110: TypePointer Output 9(fvec4) +111(gl_FragColor): 110(ptr) Variable Output + 128: TypeImage 7(float) 2D sampled format:Unknown + 129: TypeSampledImage 128 + 130: TypePointer UniformConstant 129 + 131(samp2D): 130(ptr) Variable UniformConstant + 136(s1): TypeStruct 6(int) 7(float) + 137: TypePointer Input 136(s1) + 138(foo): 137(ptr) Variable Input + 139(s1): TypeStruct 6(int) 7(float) + 140(s2): TypeStruct 6(int) 7(float) 139(s1) 9(fvec4) + 141: TypePointer Input 140(s2) + 142(foo2): 141(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12(locals2): 11(ptr) Variable Function - 36(localFArray): 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 - 21: 20(ptr) AccessChain 15(foo3) 16 16 - 22: 6(int) Load 21 - 24: 23(bool) SGreaterThan 22 16 - SelectionMerge 26 None - BranchConditional 24 25 54 - 25: Label - 31: 30(ptr) AccessChain 12(locals2) 27 28 - Store 31 29 - 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 - 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 - 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 + 39(localFArray): 38(ptr) Variable Function + 52(localIArray): 51(ptr) Variable Function + 71(x): 55(ptr) Variable Function + 73(localArray): 38(ptr) Variable Function + 78(i): 55(ptr) Variable Function + 87(a): 38(ptr) Variable Function + 21: 20(ptr) AccessChain 18(foo3) 19 + 22: 14(s2) Load 21 + Store 12(locals2) 22 + 24: 23(ptr) AccessChain 18(foo3) 19 19 + 25: 6(int) Load 24 + 27: 26(bool) SGreaterThan 25 19 + SelectionMerge 29 None + BranchConditional 27 28 57 + 28: Label + 34: 33(ptr) AccessChain 12(locals2) 30 31 + Store 34 32 + 46: 45(ptr) AccessChain 43(coord) 44 + 47: 7(float) Load 46 + 48: 33(ptr) AccessChain 39(localFArray) 40 + Store 48 47 + 53: 23(ptr) AccessChain 18(foo3) 19 19 + 54: 6(int) Load 53 + 56: 55(ptr) AccessChain 52(localIArray) 30 + Store 56 54 + Branch 29 + 57: Label + 58: 45(ptr) AccessChain 43(coord) 44 + 59: 7(float) Load 58 + 60: 33(ptr) AccessChain 12(locals2) 30 31 + Store 60 59 + 61: 33(ptr) AccessChain 39(localFArray) 40 + Store 61 32 + 62: 55(ptr) AccessChain 52(localIArray) 30 + Store 62 19 + Branch 29 + 29: Label + 63: 55(ptr) AccessChain 52(localIArray) 30 + 64: 6(int) Load 63 + 65: 26(bool) IEqual 64 19 + SelectionMerge 67 None + BranchConditional 65 66 67 + 66: Label + 68: 33(ptr) AccessChain 39(localFArray) 40 + 69: 7(float) Load 68 + 70: 7(float) FAdd 69 32 + Store 68 70 + Branch 67 + 67: Label + Store 71(x) 72 + 74: 6(int) Load 71(x) + 75: 45(ptr) AccessChain 43(coord) 44 + 76: 7(float) Load 75 + 77: 33(ptr) AccessChain 73(localArray) 74 + Store 77 76 + Store 78(i) 19 + Branch 79 + 79: Label + LoopMerge 81 82 None + Branch 83 + 83: Label + 84: 6(int) Load 78(i) + 86: 26(bool) SLessThan 84 85 + BranchConditional 86 80 81 + 80: Label + 88: 6(int) Load 78(i) + 90: 33(ptr) AccessChain 87(a) 88 + Store 90 89 + Branch 82 + 82: Label + 91: 6(int) Load 78(i) + 92: 6(int) IAdd 91 31 + Store 78(i) 92 + Branch 79 + 81: Label + 94: 6(int) Load 93(condition) + 95: 26(bool) IEqual 94 31 + SelectionMerge 97 None + BranchConditional 95 96 97 + 96: Label + 98: 37 Load 73(localArray) + Store 87(a) 98 + Branch 97 + 97: Label + 102: 9(fvec4) Load 101(color) + 104: 103(ptr) AccessChain 12(locals2) 99 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: 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 + 106: 45(ptr) AccessChain 43(coord) 105 + 107: 7(float) Load 106 + 109: 33(ptr) AccessChain 12(locals2) 99 108 + Store 109 107 + 112: 103(ptr) AccessChain 12(locals2) 99 + 113: 9(fvec4) Load 112 + 114: 33(ptr) AccessChain 39(localFArray) 40 + 115: 7(float) Load 114 + 116: 33(ptr) AccessChain 12(locals2) 30 31 + 117: 7(float) Load 116 + 118: 7(float) FAdd 115 117 + 119: 6(int) Load 71(x) + 120: 33(ptr) AccessChain 73(localArray) 119 + 121: 7(float) Load 120 + 122: 7(float) FAdd 118 121 + 123: 6(int) Load 71(x) + 124: 33(ptr) AccessChain 87(a) 123 + 125: 7(float) Load 124 + 126: 7(float) FAdd 122 125 + 127: 9(fvec4) VectorTimesScalar 113 126 + 132: 129 Load 131(samp2D) + 133: 41(fvec2) Load 43(coord) + 134: 9(fvec4) ImageSampleImplicitLod 132 133 + 135: 9(fvec4) FMul 127 134 + Store 111(gl_FragColor) 135 Return FunctionEnd diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index 1a16a64f..952f7941 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -1,76 +1,58 @@ spv.loops.frag -WARNING: 0:14: varying deprecated in version 130; may be removed in future release - Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 718 +// Id's are bound by 725 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 596 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 11 54 57 71 106 114 118 131 137 157 160 171 308 344 350 366 380 418 450 469 512 544 552 562 588 615 624 629 649 687 698 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - 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" + Name 54 "d" + Name 57 "bigColor" + Name 71 "bigColor1_1" + Name 106 "d2" + Name 114 "d3" + Name 118 "bigColor1_2" + Name 131 "bigColor1_3" + Name 137 "d4" + Name 148 "i" + Name 157 "Count" + Name 160 "bigColor2" + Name 171 "bigColor3" + Name 179 "i" + Name 195 "i" + Name 231 "i" + Name 254 "i" + Name 279 "i" + Name 308 "bigColor4" + Name 344 "bigColor5" + Name 350 "d5" + Name 366 "d6" + Name 380 "bigColor6" + Name 418 "d7" + Name 450 "bigColor7" + Name 469 "d8" + Name 512 "d9" + Name 544 "d10" + Name 552 "d11" + Name 562 "d12" + Name 588 "bigColor8" + Name 615 "gl_FragColor" + Name 624 "d14" + Name 629 "d15" + Name 649 "d16" + Name 687 "d18" + Name 698 "d17" + Decorate 157(Count) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -78,1021 +60,1049 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 16: TypeBool - 17: 16(bool) ConstantTrue - 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 + 18: TypeBool + 19: 18(bool) ConstantTrue + 20: TypeInt 32 0 + 21: 20(int) Constant 0 + 22: TypePointer Function 6(float) + 25: 6(float) Constant 1051260355 + 29: 7(fvec4) ConstantComposite 25 25 25 25 + 35: 6(float) Constant 1059648963 + 39: 7(fvec4) ConstantComposite 35 35 35 35 + 53: TypePointer Input 6(float) + 54(d): 53(ptr) Variable Input + 57(bigColor): 10(ptr) Variable Input + 66: 20(int) Constant 2 + 71(bigColor1_1): 10(ptr) Variable Input + 75: 20(int) Constant 3 + 93: 6(float) Constant 1109917696 + 96: 6(float) Constant 1065353216 + 106(d2): 53(ptr) Variable Input + 111: 20(int) Constant 1 + 114(d3): 53(ptr) Variable Input +118(bigColor1_2): 10(ptr) Variable Input +131(bigColor1_3): 10(ptr) Variable Input + 137(d4): 53(ptr) Variable Input + 146: TypeInt 32 1 + 147: TypePointer Function 146(int) + 149: 146(int) Constant 0 + 156: TypePointer Input 146(int) + 157(Count): 156(ptr) Variable Input + 160(bigColor2): 10(ptr) Variable Input + 165: 146(int) Constant 1 + 171(bigColor3): 10(ptr) Variable Input + 186: 146(int) Constant 42 + 202: 146(int) Constant 100 + 206: 6(float) Constant 1101004800 + 238: 146(int) Constant 120 + 308(bigColor4): 10(ptr) Variable Input + 344(bigColor5): 10(ptr) Variable Input + 350(d5): 53(ptr) Variable Input + 366(d6): 53(ptr) Variable Input + 380(bigColor6): 10(ptr) Variable Input + 418(d7): 53(ptr) Variable Input + 445: 6(float) Constant 0 + 450(bigColor7): 10(ptr) Variable Input + 469(d8): 53(ptr) Variable Input + 486: 6(float) Constant 1073741824 + 512(d9): 53(ptr) Variable Input + 528: 6(float) Constant 1084227584 + 544(d10): 53(ptr) Variable Input + 552(d11): 53(ptr) Variable Input + 562(d12): 53(ptr) Variable Input + 586: 6(float) Constant 1092616192 + 588(bigColor8): 10(ptr) Variable Input + 614: TypePointer Output 7(fvec4) +615(gl_FragColor): 614(ptr) Variable Output + 624(d14): 53(ptr) Variable Input + 629(d15): 53(ptr) Variable Input + 649(d16): 53(ptr) Variable Input + 687(d18): 53(ptr) Variable Input + 698(d17): 53(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(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 + 148(i): 147(ptr) Variable Function + 179(i): 147(ptr) Variable Function + 195(i): 147(ptr) Variable Function + 231(i): 147(ptr) Variable Function + 254(i): 147(ptr) Variable Function + 279(i): 147(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Branch 13 13: Label - LoopMerge 14 13 None - BranchConditional 17 15 14 - 15: Label - 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 - 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 - 36: Label - 41: 7(fvec4) Load 9(color) - 42: 7(fvec4) FAdd 41 27 - Store 9(color) 42 - Branch 14 - 14: Label - 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 + LoopMerge 15 16 None + Branch 17 + 17: Label + BranchConditional 19 14 15 + 14: Label + 23: 22(ptr) AccessChain 9(color) 21 + 24: 6(float) Load 23 + 26: 18(bool) FOrdLessThan 24 25 + SelectionMerge 28 None + BranchConditional 26 27 28 + 27: Label + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 15 + 28: Label + 33: 22(ptr) AccessChain 9(color) 21 + 34: 6(float) Load 33 + 36: 18(bool) FOrdLessThan 34 35 + SelectionMerge 38 None + BranchConditional 36 37 38 + 37: Label + 40: 7(fvec4) Load 9(color) + 41: 7(fvec4) FAdd 40 39 + Store 9(color) 41 + Branch 15 + 38: Label + 43: 7(fvec4) Load 9(color) + 44: 7(fvec4) FAdd 43 29 + Store 9(color) 44 + Branch 15 + 16: Label + Branch 13 + 15: Label + Branch 46 + 46: Label + LoopMerge 48 49 None + Branch 50 + 50: Label + 51: 22(ptr) AccessChain 9(color) 21 + 52: 6(float) Load 51 + 55: 6(float) Load 54(d) + 56: 18(bool) FOrdLessThan 52 55 + BranchConditional 56 47 48 + 47: Label + 58: 7(fvec4) Load 57(bigColor) + 59: 7(fvec4) Load 9(color) + 60: 7(fvec4) FAdd 59 58 + Store 9(color) 60 + Branch 49 + 49: Label + Branch 46 + 48: Label + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 22(ptr) AccessChain 9(color) 66 + 68: 6(float) Load 67 + 69: 6(float) Load 54(d) + 70: 18(bool) FOrdLessThan 68 69 + BranchConditional 70 62 63 + 62: Label + 72: 7(fvec4) Load 71(bigColor1_1) + 73: 7(fvec4) Load 9(color) + 74: 7(fvec4) FAdd 73 72 + Store 9(color) 74 + 76: 22(ptr) AccessChain 9(color) 75 + 77: 6(float) Load 76 + 78: 6(float) Load 54(d) + 79: 18(bool) FOrdLessThan 77 78 + SelectionMerge 81 None + BranchConditional 79 80 81 + 80: Label + Branch 64 + 81: Label + 83: 7(fvec4) Load 71(bigColor1_1) + 84: 7(fvec4) Load 9(color) + 85: 7(fvec4) FAdd 84 83 + Store 9(color) 85 + Branch 64 + 64: Label + Branch 61 + 63: Label + Branch 86 + 86: Label + LoopMerge 88 89 None + Branch 90 + 90: Label + 91: 22(ptr) AccessChain 9(color) 21 + 92: 6(float) Load 91 + 94: 18(bool) FOrdLessThan 92 93 + BranchConditional 94 87 88 + 87: Label + 95: 7(fvec4) Load 9(color) + 97: 7(fvec4) CompositeConstruct 96 96 96 96 + 98: 7(fvec4) FAdd 95 97 + Store 9(color) 98 + Branch 89 + 89: Label + Branch 86 + 88: Label + Branch 99 + 99: Label + LoopMerge 101 102 None + Branch 103 + 103: Label + 104: 22(ptr) AccessChain 9(color) 75 + 105: 6(float) Load 104 + 107: 6(float) Load 106(d2) + 108: 18(bool) FOrdLessThan 105 107 + SelectionMerge 110 None + BranchConditional 108 109 110 + 109: Label + 112: 22(ptr) AccessChain 9(color) 111 + 113: 6(float) Load 112 + 115: 6(float) Load 114(d3) + 116: 18(bool) FOrdLessThan 113 115 + Branch 110 + 110: Label + 117: 18(bool) Phi 108 103 116 109 + BranchConditional 117 100 101 + 100: Label + 119: 7(fvec4) Load 118(bigColor1_2) + 120: 7(fvec4) Load 9(color) + 121: 7(fvec4) FAdd 120 119 + Store 9(color) 121 + Branch 102 + 102: Label + Branch 99 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) + Branch 122 + 122: Label + LoopMerge 124 125 None + Branch 126 + 126: Label + 127: 22(ptr) AccessChain 9(color) 66 + 128: 6(float) Load 127 + 129: 6(float) Load 114(d3) + 130: 18(bool) FOrdLessThan 128 129 + BranchConditional 130 123 124 + 123: Label + 132: 7(fvec4) Load 131(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 + 135: 22(ptr) AccessChain 9(color) 111 + 136: 6(float) Load 135 + 138: 6(float) Load 137(d4) + 139: 18(bool) FOrdLessThan 136 138 + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + Branch 124 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 + 143: 7(fvec4) Load 131(bigColor1_3) + 144: 7(fvec4) Load 9(color) + 145: 7(fvec4) FAdd 144 143 + Store 9(color) 145 + Branch 125 + 125: Label + Branch 122 + 124: Label + Store 148(i) 149 + Branch 150 + 150: Label + LoopMerge 152 153 None 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 + 155: 146(int) Load 148(i) + 158: 146(int) Load 157(Count) + 159: 18(bool) SLessThan 155 158 + BranchConditional 159 151 152 + 151: Label + 161: 7(fvec4) Load 160(bigColor2) + 162: 7(fvec4) Load 9(color) + 163: 7(fvec4) FAdd 162 161 + Store 9(color) 163 + Branch 153 + 153: Label + 164: 146(int) Load 148(i) + 166: 146(int) IAdd 164 165 + Store 148(i) 166 + Branch 150 + 152: Label + Branch 167 + 167: Label + LoopMerge 169 170 None + Branch 168 + 168: Label + 172: 7(fvec4) Load 171(bigColor3) + 173: 7(fvec4) Load 9(color) + 174: 7(fvec4) FAdd 173 172 + Store 9(color) 174 + Branch 170 + 170: Label + 175: 22(ptr) AccessChain 9(color) 21 + 176: 6(float) Load 175 + 177: 6(float) Load 106(d2) + 178: 18(bool) FOrdLessThan 176 177 + BranchConditional 178 167 169 + 169: Label + Store 179(i) 149 + Branch 180 + 180: Label + LoopMerge 182 183 None + Branch 184 + 184: Label + 185: 146(int) Load 179(i) + 187: 18(bool) SLessThan 185 186 + BranchConditional 187 181 182 + 181: Label + 188: 6(float) Load 114(d3) + 189: 22(ptr) AccessChain 9(color) 66 + 190: 6(float) Load 189 + 191: 6(float) FAdd 190 188 + 192: 22(ptr) AccessChain 9(color) 66 + Store 192 191 + Branch 183 + 183: Label + 193: 146(int) Load 179(i) + 194: 146(int) IAdd 193 165 + Store 179(i) 194 + Branch 180 + 182: Label + Store 195(i) 149 + Branch 196 + 196: Label + LoopMerge 198 199 None + Branch 200 + 200: Label + 201: 146(int) Load 195(i) + 203: 18(bool) SLessThan 201 202 + BranchConditional 203 197 198 + 197: Label + 204: 22(ptr) AccessChain 9(color) 66 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 - 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 + 207: 18(bool) FOrdLessThan 205 206 + SelectionMerge 209 None + BranchConditional 207 208 213 + 208: Label + 210: 22(ptr) AccessChain 9(color) 21 + 211: 6(float) Load 210 + 212: 6(float) FAdd 211 96 + Store 210 212 + Branch 209 + 213: Label + 214: 22(ptr) AccessChain 9(color) 111 + 215: 6(float) Load 214 + 216: 6(float) FAdd 215 96 + Store 214 216 + Branch 209 + 209: Label + 217: 22(ptr) AccessChain 9(color) 75 + 218: 6(float) Load 217 + 219: 18(bool) FOrdLessThan 218 206 + SelectionMerge 221 None + BranchConditional 219 220 221 + 220: Label + 222: 22(ptr) AccessChain 9(color) 66 + 223: 6(float) Load 222 + 224: 22(ptr) AccessChain 9(color) 111 + 225: 6(float) Load 224 + 226: 18(bool) FOrdGreaterThan 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + Branch 228 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 + Branch 221 + 221: Label + Branch 199 + 199: Label + 229: 146(int) Load 195(i) + 230: 146(int) IAdd 229 165 + Store 195(i) 230 + Branch 196 + 198: Label + Store 231(i) 149 + Branch 232 + 232: Label + LoopMerge 234 235 None + Branch 236 + 236: Label + 237: 146(int) Load 231(i) + 239: 18(bool) SLessThan 237 238 + BranchConditional 239 233 234 + 233: Label + 240: 22(ptr) AccessChain 9(color) 66 + 241: 6(float) Load 240 + 242: 18(bool) FOrdLessThan 241 206 + SelectionMerge 244 None + BranchConditional 242 243 248 + 243: Label + 245: 22(ptr) AccessChain 9(color) 21 + 246: 6(float) Load 245 + 247: 6(float) FAdd 246 96 + Store 245 247 + Branch 244 + 248: Label + 249: 22(ptr) AccessChain 9(color) 111 + 250: 6(float) Load 249 + 251: 6(float) FAdd 250 96 + Store 249 251 + Branch 244 + 244: Label + Branch 235 + 235: Label + 252: 146(int) Load 231(i) + 253: 146(int) IAdd 252 165 + Store 231(i) 253 + Branch 232 + 234: Label + Store 254(i) 149 + Branch 255 + 255: Label + LoopMerge 257 258 None + Branch 259 + 259: Label + 260: 146(int) Load 254(i) + 261: 18(bool) SLessThan 260 186 + BranchConditional 261 256 257 + 256: Label + 262: 6(float) Load 114(d3) + 263: 22(ptr) AccessChain 9(color) 66 + 264: 6(float) Load 263 + 265: 6(float) FAdd 264 262 + 266: 22(ptr) AccessChain 9(color) 66 + Store 266 265 + 267: 22(ptr) AccessChain 9(color) 21 + 268: 6(float) Load 267 + 269: 6(float) Load 137(d4) + 270: 18(bool) FOrdLessThan 268 269 + SelectionMerge 272 None + BranchConditional 270 271 272 + 271: Label + Branch 258 + 272: Label + 274: 22(ptr) AccessChain 9(color) 75 + 275: 6(float) Load 274 + 276: 6(float) FAdd 275 96 + Store 274 276 + Branch 258 + 258: Label + 277: 146(int) Load 254(i) + 278: 146(int) IAdd 277 165 + Store 254(i) 278 + Branch 255 + 257: Label + Store 279(i) 149 + Branch 280 + 280: Label + LoopMerge 282 283 None + Branch 284 + 284: Label + 285: 146(int) Load 279(i) + 286: 18(bool) SLessThan 285 186 + BranchConditional 286 281 282 + 281: Label + 287: 6(float) Load 114(d3) + 288: 22(ptr) AccessChain 9(color) 66 + 289: 6(float) Load 288 + 290: 6(float) FAdd 289 287 + 291: 22(ptr) AccessChain 9(color) 66 + Store 291 290 + 292: 22(ptr) AccessChain 9(color) 21 + 293: 6(float) Load 292 + 294: 6(float) Load 137(d4) + 295: 18(bool) FOrdLessThan 293 294 SelectionMerge 297 None - BranchConditional 296 297 288 + BranchConditional 295 296 297 + 296: Label + Branch 282 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 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 + 299: 22(ptr) AccessChain 9(color) 75 + 300: 6(float) Load 299 + 301: 6(float) FAdd 300 96 + Store 299 301 + Branch 283 + 283: Label + 302: 146(int) Load 279(i) + 303: 146(int) IAdd 302 165 + Store 279(i) 303 + Branch 280 + 282: Label + Branch 304 + 304: Label + LoopMerge 306 307 None + Branch 305 + 305: Label + 309: 7(fvec4) Load 308(bigColor4) + 310: 7(fvec4) Load 9(color) + 311: 7(fvec4) FAdd 310 309 + Store 9(color) 311 + 312: 22(ptr) AccessChain 9(color) 21 + 313: 6(float) Load 312 + 314: 6(float) Load 137(d4) + 315: 18(bool) FOrdLessThan 313 314 + SelectionMerge 317 None + BranchConditional 315 316 317 + 316: Label + Branch 307 + 317: Label + 319: 22(ptr) AccessChain 9(color) 111 + 320: 6(float) Load 319 + 321: 6(float) Load 137(d4) + 322: 18(bool) FOrdLessThan 320 321 + SelectionMerge 324 None + BranchConditional 322 323 330 + 323: Label + 325: 6(float) Load 137(d4) + 326: 22(ptr) AccessChain 9(color) 111 + 327: 6(float) Load 326 + 328: 6(float) FAdd 327 325 + 329: 22(ptr) AccessChain 9(color) 111 + Store 329 328 + Branch 324 + 330: Label + 331: 6(float) Load 137(d4) + 332: 22(ptr) AccessChain 9(color) 21 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 + 334: 6(float) FAdd 333 331 + 335: 22(ptr) AccessChain 9(color) 21 + Store 335 334 + Branch 324 + 324: Label + Branch 307 + 307: Label + 336: 22(ptr) AccessChain 9(color) 66 + 337: 6(float) Load 336 + 338: 6(float) Load 137(d4) + 339: 18(bool) FOrdLessThan 337 338 + BranchConditional 339 304 306 + 306: Label + Branch 340 + 340: Label + LoopMerge 342 343 None + Branch 341 + 341: Label + 345: 7(fvec4) Load 344(bigColor5) + 346: 7(fvec4) Load 9(color) + 347: 7(fvec4) FAdd 346 345 + Store 9(color) 347 + 348: 22(ptr) AccessChain 9(color) 111 + 349: 6(float) Load 348 + 351: 6(float) Load 350(d5) + 352: 18(bool) FOrdLessThan 349 351 + SelectionMerge 354 None + BranchConditional 352 353 354 + 353: Label + 355: 6(float) Load 350(d5) + 356: 22(ptr) AccessChain 9(color) 111 + 357: 6(float) Load 356 + 358: 6(float) FAdd 357 355 + 359: 22(ptr) AccessChain 9(color) 111 + Store 359 358 + Branch 354 + 354: Label + Branch 343 + 343: Label + 360: 22(ptr) AccessChain 9(color) 21 + 361: 6(float) Load 360 + 362: 6(float) Load 350(d5) + 363: 18(bool) FOrdLessThan 361 362 + BranchConditional 363 340 342 + 342: Label + 364: 22(ptr) AccessChain 9(color) 21 + 365: 6(float) Load 364 + 367: 6(float) Load 366(d6) + 368: 18(bool) FOrdLessThan 365 367 + SelectionMerge 370 None + BranchConditional 368 369 384 + 369: Label + Branch 371 371: Label - Branch 372 - 372: Label - 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 372 None - BranchConditional 378 374 373 + LoopMerge 373 374 None + Branch 375 + 375: Label + 376: 22(ptr) AccessChain 9(color) 111 + 377: 6(float) Load 376 + 378: 6(float) Load 366(d6) + 379: 18(bool) FOrdLessThan 377 378 + BranchConditional 379 372 373 + 372: Label + 381: 7(fvec4) Load 380(bigColor6) + 382: 7(fvec4) Load 9(color) + 383: 7(fvec4) FAdd 382 381 + Store 9(color) 383 + Branch 374 374: Label - 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 + Branch 371 373: Label - 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 + Branch 370 + 384: Label + Branch 385 + 385: Label + LoopMerge 387 388 None + Branch 389 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 + 390: 22(ptr) AccessChain 9(color) 66 + 391: 6(float) Load 390 + 392: 6(float) Load 366(d6) + 393: 18(bool) FOrdLessThan 391 392 + BranchConditional 393 386 387 + 386: Label + 394: 53(ptr) AccessChain 380(bigColor6) 66 + 395: 6(float) Load 394 + 396: 22(ptr) AccessChain 9(color) 66 + 397: 6(float) Load 396 + 398: 6(float) FAdd 397 395 + 399: 22(ptr) AccessChain 9(color) 66 + Store 399 398 + Branch 388 + 388: Label + Branch 385 + 387: Label + Branch 370 + 370: Label + 400: 22(ptr) AccessChain 9(color) 21 + 401: 6(float) Load 400 + 402: 6(float) Load 366(d6) + 403: 18(bool) FOrdLessThan 401 402 + SelectionMerge 405 None + BranchConditional 403 404 424 + 404: Label + Branch 406 + 406: Label + LoopMerge 408 409 None + Branch 410 + 410: Label + 411: 22(ptr) AccessChain 9(color) 111 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 + 413: 6(float) Load 366(d6) + 414: 18(bool) FOrdLessThan 412 413 + BranchConditional 414 407 408 + 407: Label + 415: 7(fvec4) Load 380(bigColor6) + 416: 7(fvec4) Load 9(color) + 417: 7(fvec4) FAdd 416 415 + Store 9(color) 417 + 419: 6(float) Load 418(d7) + 420: 18(bool) FOrdLessThan 419 96 + SelectionMerge 422 None + BranchConditional 420 421 422 + 421: Label + Branch 408 + 422: Label + Branch 409 + 409: Label + Branch 406 + 408: Label + Branch 405 + 424: Label + Branch 425 + 425: Label + LoopMerge 427 428 None + Branch 429 + 429: Label + 430: 22(ptr) AccessChain 9(color) 66 + 431: 6(float) Load 430 + 432: 6(float) Load 366(d6) + 433: 18(bool) FOrdLessThan 431 432 + BranchConditional 433 426 427 + 426: Label + 434: 53(ptr) AccessChain 380(bigColor6) 66 + 435: 6(float) Load 434 + 436: 22(ptr) AccessChain 9(color) 66 + 437: 6(float) Load 436 + 438: 6(float) FAdd 437 435 + 439: 22(ptr) AccessChain 9(color) 66 + Store 439 438 + Branch 428 + 428: Label + Branch 425 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 - 442: 20(ptr) AccessChain 9(color) 61 - 443: 6(float) Load 442 - 444: 6(float) FAdd 443 89 - Store 442 444 - Branch 422 + Branch 405 + 405: Label + Branch 440 + 440: Label + LoopMerge 442 443 None + Branch 441 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 - 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 + 444: 6(float) Load 418(d7) + 446: 18(bool) FOrdLessThan 444 445 + SelectionMerge 448 None + BranchConditional 446 447 448 + 447: Label + Branch 442 + 448: Label + 451: 7(fvec4) Load 450(bigColor7) + 452: 7(fvec4) Load 9(color) + 453: 7(fvec4) FAdd 452 451 + Store 9(color) 453 + 454: 6(float) Load 418(d7) + 455: 18(bool) FOrdLessThan 454 96 + SelectionMerge 457 None + BranchConditional 455 456 457 + 456: Label + 458: 22(ptr) AccessChain 9(color) 66 + 459: 6(float) Load 458 + 460: 6(float) FAdd 459 96 + Store 458 460 + Branch 442 + 457: Label + 462: 7(fvec4) Load 11(BaseColor) + 463: 7(fvec4) Load 9(color) + 464: 7(fvec4) FAdd 463 462 + Store 9(color) 464 + Branch 443 + 443: Label + BranchConditional 19 440 442 + 442: Label + Branch 465 + 465: Label + LoopMerge 467 468 None + Branch 466 + 466: Label + 470: 6(float) Load 469(d8) + 471: 18(bool) FOrdLessThan 470 445 + SelectionMerge 473 None + BranchConditional 471 472 473 + 472: Label + Branch 467 + 473: Label + 475: 7(fvec4) Load 450(bigColor7) + 476: 7(fvec4) Load 9(color) + 477: 7(fvec4) FAdd 476 475 + Store 9(color) 477 + 478: 6(float) Load 469(d8) + 479: 18(bool) FOrdLessThan 478 96 + SelectionMerge 481 None + BranchConditional 479 480 481 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 - 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) - 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 - 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 + 482: 22(ptr) AccessChain 9(color) 66 + 483: 6(float) Load 482 + 484: 6(float) FAdd 483 96 + Store 482 484 + 485: 6(float) Load 469(d8) + 487: 18(bool) FOrdLessThan 485 486 + SelectionMerge 489 None + BranchConditional 487 488 493 + 488: Label + 490: 22(ptr) AccessChain 9(color) 111 + 491: 6(float) Load 490 + 492: 6(float) FAdd 491 96 + Store 490 492 + Branch 489 + 493: Label + 494: 22(ptr) AccessChain 9(color) 21 + 495: 6(float) Load 494 + 496: 6(float) FAdd 495 96 + Store 494 496 + Branch 489 + 489: Label + Branch 467 + 481: Label + 498: 7(fvec4) Load 11(BaseColor) + 499: 7(fvec4) Load 9(color) + 500: 7(fvec4) FAdd 499 498 + Store 9(color) 500 + Branch 468 + 468: Label + 501: 22(ptr) AccessChain 9(color) 66 + 502: 6(float) Load 501 + 503: 6(float) Load 469(d8) + 504: 18(bool) FOrdLessThan 502 503 + BranchConditional 504 465 467 + 467: Label + Branch 505 + 505: Label + LoopMerge 507 508 None + Branch 509 + 509: Label + 510: 22(ptr) AccessChain 9(color) 75 + 511: 6(float) Load 510 + 513: 6(float) Load 512(d9) + 514: 18(bool) FOrdLessThan 511 513 + BranchConditional 514 506 507 + 506: Label + 515: 6(float) Load 512(d9) + 516: 6(float) Load 469(d8) + 517: 18(bool) FOrdGreaterThan 515 516 + SelectionMerge 519 None + BranchConditional 517 518 519 + 518: Label + 520: 22(ptr) AccessChain 9(color) 21 + 521: 6(float) Load 520 + 522: 6(float) Load 418(d7) + 523: 18(bool) FOrdLessThanEqual 521 522 + SelectionMerge 525 None + BranchConditional 523 524 525 + 524: Label + 526: 22(ptr) AccessChain 9(color) 66 + 527: 6(float) Load 526 + 529: 18(bool) FOrdEqual 527 528 + SelectionMerge 531 None + BranchConditional 529 530 535 + 530: Label + 532: 22(ptr) AccessChain 9(color) 75 + 533: 6(float) Load 532 + 534: 6(float) FAdd 533 96 + Store 532 534 + Branch 531 + 535: Label + Branch 507 + 531: Label + Branch 525 + 525: Label + Branch 519 + 519: Label + Branch 508 + 508: Label + Branch 505 + 507: Label + Branch 537 + 537: Label + LoopMerge 539 540 None + Branch 541 + 541: Label + 542: 22(ptr) AccessChain 9(color) 66 + 543: 6(float) Load 542 + 545: 6(float) Load 544(d10) + 546: 18(bool) FOrdLessThan 543 545 + BranchConditional 546 538 539 + 538: Label + 547: 22(ptr) AccessChain 9(color) 111 + 548: 6(float) Load 547 + 549: 6(float) FAdd 548 96 + Store 547 549 + 550: 22(ptr) AccessChain 9(color) 111 + 551: 6(float) Load 550 + 553: 6(float) Load 552(d11) + 554: 18(bool) FOrdLessThan 551 553 + SelectionMerge 556 None + BranchConditional 554 555 556 + 555: Label + 557: 22(ptr) AccessChain 9(color) 66 + 558: 6(float) Load 557 + 559: 6(float) FAdd 558 96 + Store 557 559 + 560: 22(ptr) AccessChain 9(color) 75 + 561: 6(float) Load 560 + 563: 6(float) Load 562(d12) + 564: 18(bool) FOrdLessThan 561 563 + SelectionMerge 566 None + BranchConditional 564 565 570 + 565: Label + 567: 22(ptr) AccessChain 9(color) 75 + 568: 6(float) Load 567 + 569: 6(float) FAdd 568 96 + Store 567 569 + Branch 566 + 570: Label + 571: 22(ptr) AccessChain 9(color) 21 + 572: 6(float) Load 571 + 573: 6(float) FAdd 572 96 + Store 571 573 + Branch 566 + 566: Label + Branch 540 + 556: Label + 575: 7(fvec4) Load 9(color) + 576: 7(fvec4) CompositeConstruct 96 96 96 96 + 577: 7(fvec4) FAdd 575 576 + Store 9(color) 577 + Branch 539 + 540: Label + Branch 537 + 539: Label + Branch 579 + 579: Label + LoopMerge 581 582 None + Branch 583 + 583: Label + 584: 22(ptr) AccessChain 9(color) 21 + 585: 6(float) Load 584 + 587: 18(bool) FOrdLessThan 585 586 + BranchConditional 587 580 581 + 580: Label + 589: 7(fvec4) Load 588(bigColor8) + 590: 7(fvec4) Load 9(color) + 591: 7(fvec4) FAdd 590 589 + Store 9(color) 591 + 592: 22(ptr) AccessChain 9(color) 66 + 593: 6(float) Load 592 + 594: 6(float) Load 469(d8) + 595: 18(bool) FOrdLessThan 593 594 + SelectionMerge 597 None + BranchConditional 595 596 597 + 596: Label + 598: 22(ptr) AccessChain 9(color) 75 + 599: 6(float) Load 598 + 600: 6(float) Load 366(d6) + 601: 18(bool) FOrdLessThan 599 600 + SelectionMerge 603 None + BranchConditional 601 602 603 + 602: Label + Branch 582 + 603: Label + Branch 597 + 597: Label + 605: 53(ptr) AccessChain 588(bigColor8) 21 + 606: 6(float) Load 605 + 607: 22(ptr) AccessChain 9(color) 111 + 608: 6(float) Load 607 + 609: 6(float) FAdd 608 606 + 610: 22(ptr) AccessChain 9(color) 111 + Store 610 609 + Branch 582 + 582: Label + Branch 579 + 581: Label + 611: 7(fvec4) Load 9(color) + 612: 7(fvec4) CompositeConstruct 96 96 96 96 + 613: 7(fvec4) FAdd 611 612 + Store 9(color) 613 + 616: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 616 + Branch 617 + 617: Label + LoopMerge 619 620 None 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 - 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 + 622: 22(ptr) AccessChain 9(color) 21 + 623: 6(float) Load 622 + 625: 6(float) Load 624(d14) + 626: 18(bool) FOrdLessThan 623 625 + BranchConditional 626 618 619 + 618: Label + 627: 22(ptr) AccessChain 9(color) 111 + 628: 6(float) Load 627 + 630: 6(float) Load 629(d15) + 631: 18(bool) FOrdLessThan 628 630 + SelectionMerge 633 None + BranchConditional 631 632 635 + 632: Label Return - 654: Label - Branch 632 - 633: Label - Branch 656 + 635: Label + 636: 7(fvec4) Load 9(color) + 637: 7(fvec4) CompositeConstruct 96 96 96 96 + 638: 7(fvec4) FAdd 636 637 + Store 9(color) 638 + Branch 633 + 633: Label + Branch 620 + 620: Label + Branch 617 + 619: Label + 639: 7(fvec4) Load 9(color) + 640: 7(fvec4) CompositeConstruct 96 96 96 96 + 641: 7(fvec4) FAdd 639 640 + Store 9(color) 641 + Branch 642 + 642: Label + LoopMerge 644 645 None + Branch 646 + 646: Label + 647: 22(ptr) AccessChain 9(color) 75 + 648: 6(float) Load 647 + 650: 6(float) Load 649(d16) + 651: 18(bool) FOrdLessThan 648 650 + BranchConditional 651 643 644 + 643: Label + 652: 22(ptr) AccessChain 9(color) 75 + 653: 6(float) Load 652 + 654: 6(float) FAdd 653 96 + Store 652 654 + Branch 645 + 645: Label + Branch 642 + 644: Label + Branch 655 + 655: Label + LoopMerge 657 658 None + Branch 659 + 659: Label + 660: 22(ptr) AccessChain 9(color) 75 + 661: 6(float) Load 660 + 662: 6(float) Load 106(d2) + 663: 18(bool) FOrdLessThan 661 662 + SelectionMerge 665 None + BranchConditional 663 664 665 + 664: Label + 666: 22(ptr) AccessChain 9(color) 111 + 667: 6(float) Load 666 + 668: 6(float) Load 114(d3) + 669: 18(bool) FOrdLessThan 667 668 + Branch 665 + 665: Label + 670: 18(bool) Phi 663 659 669 664 + BranchConditional 670 656 657 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 + 671: 7(fvec4) Load 118(bigColor1_2) + 672: 7(fvec4) Load 9(color) + 673: 7(fvec4) FAdd 672 671 + Store 9(color) 673 + 674: 22(ptr) AccessChain 9(color) 66 + 675: 6(float) Load 674 + 676: 6(float) Load 114(d3) + 677: 18(bool) FOrdLessThan 675 676 + SelectionMerge 679 None + BranchConditional 677 678 679 + 678: Label Return - 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 + Branch 658 + 658: Label + Branch 655 + 657: Label + Branch 681 + 681: Label + LoopMerge 683 684 None + Branch 682 + 682: Label + 685: 22(ptr) AccessChain 9(color) 111 + 686: 6(float) Load 685 + 688: 6(float) Load 687(d18) + 689: 18(bool) FOrdLessThan 686 688 + SelectionMerge 691 None + BranchConditional 689 690 691 + 690: Label + Return + 691: Label + 693: 7(fvec4) Load 9(color) + 694: 7(fvec4) CompositeConstruct 96 96 96 96 + 695: 7(fvec4) FAdd 693 694 + Store 9(color) 695 + Branch 684 + 684: Label + 696: 22(ptr) AccessChain 9(color) 21 + 697: 6(float) Load 696 + 699: 6(float) Load 698(d17) + 700: 18(bool) FOrdLessThan 697 699 + BranchConditional 700 681 683 + 683: Label + Branch 701 + 701: Label + LoopMerge 703 704 None + Branch 705 + 705: Label + 706: 22(ptr) AccessChain 9(color) 111 + 707: 6(float) Load 706 + 708: 6(float) Load 649(d16) + 709: 18(bool) FOrdLessThan 707 708 + BranchConditional 709 702 703 + 702: Label + 710: 22(ptr) AccessChain 9(color) 75 + 711: 6(float) Load 710 + 712: 6(float) Load 649(d16) + 713: 18(bool) FOrdLessThan 711 712 + SelectionMerge 715 None + BranchConditional 713 714 717 + 714: Label Kill - 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 + 717: Label + 718: 7(fvec4) Load 9(color) + 719: 7(fvec4) CompositeConstruct 96 96 96 96 + 720: 7(fvec4) FAdd 718 719 + Store 9(color) 720 + Branch 715 + 715: Label + Branch 704 + 704: Label + Branch 701 + 703: Label + 721: 7(fvec4) Load 9(color) + 722: 7(fvec4) CompositeConstruct 96 96 96 96 + 723: 7(fvec4) FAdd 721 722 + Store 9(color) 723 + 724: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 724 Return FunctionEnd diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index 44dcb47c..5f10bd35 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -1,70 +1,40 @@ spv.loopsArtificial.frag -WARNING: 0:14: varying deprecated in version 130; may be removed in future release - Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 191 +// Id's are bound by 158 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 144 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 11 17 27 80 140 142 143 144 145 146 147 148 149 150 151 152 153 154 157 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" + Name 17 "bigColor4" 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" + Name 80 "d13" + Name 140 "gl_FragColor" + Name 142 "bigColor" + Name 143 "bigColor1_1" + Name 144 "bigColor1_2" + Name 145 "bigColor1_3" + Name 146 "bigColor2" + Name 147 "bigColor3" + Name 148 "bigColor5" + Name 149 "bigColor6" + Name 150 "bigColor7" + Name 151 "bigColor8" + Name 152 "d" + Name 153 "d2" + Name 154 "d3" + Name 157 "Count" + Decorate 157(Count) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -72,69 +42,37 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 17: TypeBool - 18: 17(bool) ConstantTrue + 17(bigColor4): 10(ptr) Variable Input 21: TypeInt 32 0 - 22: 21(int) Constant 2 + 22: 21(int) Constant 0 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 + 26: TypePointer Input 6(float) + 27(d4): 26(ptr) Variable Input + 29: TypeBool + 33: 6(float) Constant 1073741824 + 34: 21(int) Constant 2 + 47: 6(float) Constant 1065353216 + 50: 21(int) Constant 1 + 77: 21(int) Constant 3 + 80(d13): 26(ptr) Variable Input + 139: TypePointer Output 7(fvec4) +140(gl_FragColor): 139(ptr) Variable Output + 142(bigColor): 10(ptr) Variable Input +143(bigColor1_1): 10(ptr) Variable Input +144(bigColor1_2): 10(ptr) Variable Input +145(bigColor1_3): 10(ptr) Variable Input + 146(bigColor2): 10(ptr) Variable Input + 147(bigColor3): 10(ptr) Variable Input + 148(bigColor5): 10(ptr) Variable Input + 149(bigColor6): 10(ptr) Variable Input + 150(bigColor7): 10(ptr) Variable Input + 151(bigColor8): 10(ptr) Variable Input + 152(d): 26(ptr) Variable Input + 153(d2): 26(ptr) Variable Input + 154(d3): 26(ptr) Variable Input + 155: TypeInt 32 1 + 156: TypePointer Input 155(int) + 157(Count): 156(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -142,167 +80,164 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 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 - 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 - 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 - 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 + LoopMerge 15 16 None + Branch 14 14: Label - Branch 78 - 78: Label - 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 - 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 + 18: 7(fvec4) Load 17(bigColor4) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d4) + 30: 29(bool) FOrdLessThan 25 28 + SelectionMerge 32 None + BranchConditional 30 31 32 + 31: Label + 35: 23(ptr) AccessChain 9(color) 34 + 36: 6(float) Load 35 + 37: 6(float) FAdd 36 33 + 38: 23(ptr) AccessChain 9(color) 34 + Store 38 37 + 39: 23(ptr) AccessChain 9(color) 34 + 40: 6(float) Load 39 + 41: 6(float) Load 27(d4) + 42: 29(bool) FOrdLessThan 40 41 + SelectionMerge 44 None + BranchConditional 42 43 44 + 43: Label + 45: 23(ptr) AccessChain 9(color) 22 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + Branch 16 + 44: Label + Branch 32 + 32: Label + 51: 23(ptr) AccessChain 9(color) 50 + 52: 6(float) Load 51 + 53: 6(float) Load 27(d4) + 54: 29(bool) FOrdLessThan 52 53 + SelectionMerge 56 None + BranchConditional 54 55 62 + 55: Label + 57: 6(float) Load 27(d4) + 58: 23(ptr) AccessChain 9(color) 50 + 59: 6(float) Load 58 + 60: 6(float) FAdd 59 57 + 61: 23(ptr) AccessChain 9(color) 50 + Store 61 60 + Branch 56 + 62: Label + 63: 6(float) Load 27(d4) + 64: 23(ptr) AccessChain 9(color) 22 + 65: 6(float) Load 64 + 66: 6(float) FAdd 65 63 + 67: 23(ptr) AccessChain 9(color) 22 + Store 67 66 + Branch 56 + 56: Label + Branch 16 + 16: Label + 68: 23(ptr) AccessChain 9(color) 34 + 69: 6(float) Load 68 + 70: 6(float) Load 27(d4) + 71: 29(bool) FOrdLessThan 69 70 + BranchConditional 71 13 15 + 15: Label + Branch 72 + 72: Label + LoopMerge 74 75 None + Branch 76 + 76: Label + 78: 23(ptr) AccessChain 9(color) 77 + 79: 6(float) Load 78 + 81: 6(float) Load 80(d13) + 82: 29(bool) FOrdLessThan 79 81 + BranchConditional 82 73 74 + 73: Label + 83: 23(ptr) AccessChain 9(color) 34 + 84: 6(float) Load 83 + 85: 6(float) Load 80(d13) + 86: 29(bool) FOrdLessThan 84 85 + SelectionMerge 88 None + BranchConditional 86 87 92 + 87: Label + 89: 7(fvec4) Load 9(color) + 90: 7(fvec4) CompositeConstruct 47 47 47 47 + 91: 7(fvec4) FAdd 89 90 + Store 9(color) 91 + Branch 88 + 92: Label 93: 7(fvec4) Load 9(color) - 94: 7(fvec4) CompositeConstruct 56 56 56 56 - 95: 7(fvec4) FAdd 93 94 + 94: 7(fvec4) CompositeConstruct 47 47 47 47 + 95: 7(fvec4) FSub 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 + Branch 88 + 88: Label + 96: 7(fvec4) Load 17(bigColor4) + 97: 7(fvec4) Load 9(color) + 98: 7(fvec4) FAdd 97 96 + Store 9(color) 98 + 99: 23(ptr) AccessChain 9(color) 22 + 100: 6(float) Load 99 + 101: 6(float) Load 27(d4) + 102: 29(bool) FOrdLessThan 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 23(ptr) AccessChain 9(color) 34 + 106: 6(float) Load 105 + 107: 6(float) FAdd 106 33 + 108: 23(ptr) AccessChain 9(color) 34 + Store 108 107 + 109: 23(ptr) AccessChain 9(color) 34 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: 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 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 - 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 + 111: 6(float) Load 27(d4) + 112: 29(bool) FOrdLessThan 110 111 + SelectionMerge 114 None + BranchConditional 112 113 114 + 113: Label + 115: 23(ptr) AccessChain 9(color) 22 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 47 + Store 115 117 + Branch 75 + 114: Label + Branch 104 + 104: Label + 119: 23(ptr) AccessChain 9(color) 50 + 120: 6(float) Load 119 + 121: 6(float) Load 27(d4) + 122: 29(bool) FOrdLessThan 120 121 + SelectionMerge 124 None + BranchConditional 122 123 130 + 123: Label + 125: 6(float) Load 27(d4) + 126: 23(ptr) AccessChain 9(color) 50 + 127: 6(float) Load 126 + 128: 6(float) FAdd 127 125 + 129: 23(ptr) AccessChain 9(color) 50 + Store 129 128 + Branch 124 + 130: Label + 131: 6(float) Load 27(d4) + 132: 23(ptr) AccessChain 9(color) 22 + 133: 6(float) Load 132 + 134: 6(float) FAdd 133 131 + 135: 23(ptr) AccessChain 9(color) 22 + Store 135 134 + Branch 124 + 124: Label + Branch 75 + 75: Label + Branch 72 + 74: Label + 136: 7(fvec4) Load 9(color) + 137: 7(fvec4) CompositeConstruct 47 47 47 47 + 138: 7(fvec4) FAdd 136 137 + Store 9(color) 138 + 141: 7(fvec4) Load 9(color) + Store 140(gl_FragColor) 141 Return FunctionEnd diff --git a/Test/baseResults/spv.matFun.vert.out b/Test/baseResults/spv.matFun.vert.out index 122adc96..ab487763 100755 --- a/Test/baseResults/spv.matFun.vert.out +++ b/Test/baseResults/spv.matFun.vert.out @@ -1,17 +1,20 @@ spv.matFun.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 93 +// Id's are bound by 103 Capability Shader + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 69 73 92 - Source GLSL 130 + EntryPoint Vertex 4 "main" 76 81 + Source GLSL 400 Name 4 "main" Name 14 "xf(mf33;vf3;" Name 12 "m" @@ -21,18 +24,33 @@ Linked vertex stage: Name 26 "mxv(mf44;vf3;" Name 24 "m4" Name 25 "v" - Name 63 "param" - Name 69 "gl_Position" - Name 71 "m4" - Name 73 "v3" - Name 74 "param" - Name 76 "param" - Name 80 "m3" - Name 81 "param" - Name 83 "param" - Name 92 "gl_VertexID" - Decorate 69(gl_Position) BuiltIn Position - Decorate 92(gl_VertexID) BuiltIn VertexId + Name 65 "param" + Name 74 "gl_PerVertex" + MemberName 74(gl_PerVertex) 0 "gl_Position" + MemberName 74(gl_PerVertex) 1 "gl_PointSize" + MemberName 74(gl_PerVertex) 2 "gl_ClipDistance" + Name 76 "" + Name 77 "bl" + MemberName 77(bl) 0 "m4" + MemberName 77(bl) 1 "m3" + Name 79 "bName" + Name 81 "v3" + Name 82 "param" + Name 86 "param" + Name 89 "param" + Name 93 "param" + MemberDecorate 74(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 74(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 74(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 74(gl_PerVertex) Block + MemberDecorate 77(bl) 0 ColMajor + MemberDecorate 77(bl) 0 Offset 0 + MemberDecorate 77(bl) 0 MatrixStride 16 + MemberDecorate 77(bl) 1 ColMajor + MemberDecorate 77(bl) 1 Offset 64 + MemberDecorate 77(bl) 1 MatrixStride 16 + Decorate 77(bl) Block + Decorate 79(bName) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,45 +64,52 @@ Linked vertex stage: 18: TypePointer Function 17 19: TypeFunction 8 18(ptr) 23: TypeFunction 7(fvec3) 18(ptr) 10(ptr) - 32: TypeInt 32 1 - 33: 32(int) Constant 0 - 34: TypePointer Function 16(fvec4) - 38: 32(int) Constant 1 - 42: 32(int) Constant 2 - 46: 6(float) Constant 1065353216 - 47: 6(float) Constant 0 - 68: TypePointer Output 16(fvec4) - 69(gl_Position): 68(ptr) Variable Output - 70: TypePointer UniformConstant 17 - 71(m4): 70(ptr) Variable UniformConstant - 72: TypePointer Input 7(fvec3) - 73(v3): 72(ptr) Variable Input - 79: TypePointer UniformConstant 8 - 80(m3): 79(ptr) Variable UniformConstant - 91: TypePointer Input 32(int) - 92(gl_VertexID): 91(ptr) Variable Input + 33: TypeInt 32 1 + 34: 33(int) Constant 0 + 35: TypePointer Function 16(fvec4) + 39: 33(int) Constant 1 + 43: 33(int) Constant 2 + 47: 6(float) Constant 1065353216 + 48: 6(float) Constant 0 + 71: TypeInt 32 0 + 72: 71(int) Constant 1 + 73: TypeArray 6(float) 72 +74(gl_PerVertex): TypeStruct 16(fvec4) 6(float) 73 + 75: TypePointer Output 74(gl_PerVertex) + 76: 75(ptr) Variable Output + 77(bl): TypeStruct 17 8 + 78: TypePointer Uniform 77(bl) + 79(bName): 78(ptr) Variable Uniform + 80: TypePointer Input 7(fvec3) + 81(v3): 80(ptr) Variable Input + 83: TypePointer Uniform 17 + 90: TypePointer Uniform 8 + 101: TypePointer Output 16(fvec4) 4(main): 2 Function None 3 5: Label - 74(param): 18(ptr) Variable Function - 76(param): 10(ptr) Variable Function - 81(param): 9(ptr) Variable Function - 83(param): 10(ptr) Variable Function - 75: 17 Load 71(m4) - Store 74(param) 75 - 77: 7(fvec3) Load 73(v3) - Store 76(param) 77 - 78: 7(fvec3) FunctionCall 26(mxv(mf44;vf3;) 74(param) 76(param) - 82: 8 Load 80(m3) - Store 81(param) 82 - 84: 7(fvec3) Load 73(v3) - Store 83(param) 84 - 85: 7(fvec3) FunctionCall 14(xf(mf33;vf3;) 81(param) 83(param) - 86: 7(fvec3) FAdd 78 85 - 87: 6(float) CompositeExtract 86 0 - 88: 6(float) CompositeExtract 86 1 - 89: 6(float) CompositeExtract 86 2 - 90: 16(fvec4) CompositeConstruct 87 88 89 46 - Store 69(gl_Position) 90 + 82(param): 18(ptr) Variable Function + 86(param): 10(ptr) Variable Function + 89(param): 9(ptr) Variable Function + 93(param): 10(ptr) Variable Function + 84: 83(ptr) AccessChain 79(bName) 34 + 85: 17 Load 84 + Store 82(param) 85 + 87: 7(fvec3) Load 81(v3) + Store 86(param) 87 + 88: 7(fvec3) FunctionCall 26(mxv(mf44;vf3;) 82(param) 86(param) + 91: 90(ptr) AccessChain 79(bName) 39 + 92: 8 Load 91 + Store 89(param) 92 + 94: 7(fvec3) Load 81(v3) + Store 93(param) 94 + 95: 7(fvec3) FunctionCall 14(xf(mf33;vf3;) 89(param) 93(param) + 96: 7(fvec3) FAdd 88 95 + 97: 6(float) CompositeExtract 96 0 + 98: 6(float) CompositeExtract 96 1 + 99: 6(float) CompositeExtract 96 2 + 100: 16(fvec4) CompositeConstruct 97 98 99 47 + 102: 101(ptr) AccessChain 76 34 + Store 102 100 Return FunctionEnd 14(xf(mf33;vf3;): 7(fvec3) Function None 11 @@ -99,39 +124,39 @@ Linked vertex stage: 21(Mat3(mf44;): 8 Function None 19 20(m): 18(ptr) FunctionParameter 22: Label - 35: 34(ptr) AccessChain 20(m) 33 - 36: 16(fvec4) Load 35 - 37: 7(fvec3) VectorShuffle 36 36 0 1 2 - 39: 34(ptr) AccessChain 20(m) 38 - 40: 16(fvec4) Load 39 - 41: 7(fvec3) VectorShuffle 40 40 0 1 2 - 43: 34(ptr) AccessChain 20(m) 42 - 44: 16(fvec4) Load 43 - 45: 7(fvec3) VectorShuffle 44 44 0 1 2 - 48: 6(float) CompositeExtract 37 0 - 49: 6(float) CompositeExtract 37 1 - 50: 6(float) CompositeExtract 37 2 - 51: 6(float) CompositeExtract 41 0 - 52: 6(float) CompositeExtract 41 1 - 53: 6(float) CompositeExtract 41 2 - 54: 6(float) CompositeExtract 45 0 - 55: 6(float) CompositeExtract 45 1 - 56: 6(float) CompositeExtract 45 2 - 57: 7(fvec3) CompositeConstruct 48 49 50 - 58: 7(fvec3) CompositeConstruct 51 52 53 - 59: 7(fvec3) CompositeConstruct 54 55 56 - 60: 8 CompositeConstruct 57 58 59 - ReturnValue 60 + 36: 35(ptr) AccessChain 20(m) 34 + 37: 16(fvec4) Load 36 + 38: 7(fvec3) VectorShuffle 37 37 0 1 2 + 40: 35(ptr) AccessChain 20(m) 39 + 41: 16(fvec4) Load 40 + 42: 7(fvec3) VectorShuffle 41 41 0 1 2 + 44: 35(ptr) AccessChain 20(m) 43 + 45: 16(fvec4) Load 44 + 46: 7(fvec3) VectorShuffle 45 45 0 1 2 + 49: 6(float) CompositeExtract 38 0 + 50: 6(float) CompositeExtract 38 1 + 51: 6(float) CompositeExtract 38 2 + 52: 6(float) CompositeExtract 42 0 + 53: 6(float) CompositeExtract 42 1 + 54: 6(float) CompositeExtract 42 2 + 55: 6(float) CompositeExtract 46 0 + 56: 6(float) CompositeExtract 46 1 + 57: 6(float) CompositeExtract 46 2 + 58: 7(fvec3) CompositeConstruct 49 50 51 + 59: 7(fvec3) CompositeConstruct 52 53 54 + 60: 7(fvec3) CompositeConstruct 55 56 57 + 61: 8 CompositeConstruct 58 59 60 + ReturnValue 61 FunctionEnd 26(mxv(mf44;vf3;): 7(fvec3) Function None 23 24(m4): 18(ptr) FunctionParameter 25(v): 10(ptr) FunctionParameter 27: Label - 63(param): 18(ptr) Variable Function - 62: 7(fvec3) Load 25(v) - 64: 17 Load 24(m4) - Store 63(param) 64 - 65: 8 FunctionCall 21(Mat3(mf44;) 63(param) - 66: 7(fvec3) VectorTimesMatrix 62 65 - ReturnValue 66 + 65(param): 18(ptr) Variable Function + 64: 7(fvec3) Load 25(v) + 66: 17 Load 24(m4) + Store 65(param) 66 + 67: 8 FunctionCall 21(Mat3(mf44;) 65(param) + 68: 7(fvec3) VectorTimesMatrix 64 67 + ReturnValue 68 FunctionEnd diff --git a/Test/baseResults/spv.matrix.frag.out b/Test/baseResults/spv.matrix.frag.out index 4507a2fe..8f0d6463 100644 --- a/Test/baseResults/spv.matrix.frag.out +++ b/Test/baseResults/spv.matrix.frag.out @@ -11,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 14 28 140 148 166 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 10 "sum34" Name 12 "m1" diff --git a/Test/baseResults/spv.matrix2.frag.out b/Test/baseResults/spv.matrix2.frag.out index 5deb5394..e0497b09 100644 --- a/Test/baseResults/spv.matrix2.frag.out +++ b/Test/baseResults/spv.matrix2.frag.out @@ -5,13 +5,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 213 +// Id's are bound by 221 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 16 37 38 65 87 139 150 173 210 211 212 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 12 16 37 38 65 87 147 158 181 218 219 220 + ExecutionMode 4 OriginUpperLeft Source GLSL 150 Name 4 "main" Name 10 "m34" @@ -22,15 +22,15 @@ Linked fragment stage: Name 63 "m44" Name 65 "un34" Name 87 "um43" - Name 139 "um4" - Name 148 "inv" - Name 150 "um2" - Name 171 "inv3" - Name 173 "um3" - Name 182 "inv4" - Name 210 "colorTransform" - Name 211 "m" - Name 212 "n" + Name 147 "um4" + Name 156 "inv" + Name 158 "um2" + Name 179 "inv3" + Name 181 "um3" + Name 190 "inv4" + Name 218 "colorTransform" + Name 219 "m" + Name 220 "n" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -62,35 +62,35 @@ Linked fragment stage: 85: TypeMatrix 14(fvec3) 4 86: TypePointer Input 85 87(um43): 86(ptr) Variable Input - 138: TypePointer Input 61 - 139(um4): 138(ptr) Variable Input - 145: TypeVector 6(float) 2 - 146: TypeMatrix 145(fvec2) 2 - 147: TypePointer Function 146 - 149: TypePointer Input 146 - 150(um2): 149(ptr) Variable Input - 153: TypeInt 32 1 - 154: 153(int) Constant 0 - 155: TypePointer Function 6(float) - 158: 153(int) Constant 1 - 161: 54(int) Constant 1 - 169: TypeMatrix 14(fvec3) 3 - 170: TypePointer Function 169 - 172: TypePointer Input 169 - 173(um3): 172(ptr) Variable Input - 176: 153(int) Constant 2 - 202: 54(int) Constant 3 - 203: TypePointer Output 6(float) -210(colorTransform): 172(ptr) Variable Input - 211(m): 138(ptr) Variable Input - 212(n): 138(ptr) Variable Input + 146: TypePointer Input 61 + 147(um4): 146(ptr) Variable Input + 153: TypeVector 6(float) 2 + 154: TypeMatrix 153(fvec2) 2 + 155: TypePointer Function 154 + 157: TypePointer Input 154 + 158(um2): 157(ptr) Variable Input + 161: TypeInt 32 1 + 162: 161(int) Constant 0 + 163: TypePointer Function 6(float) + 166: 161(int) Constant 1 + 169: 54(int) Constant 1 + 177: TypeMatrix 14(fvec3) 3 + 178: TypePointer Function 177 + 180: TypePointer Input 177 + 181(um3): 180(ptr) Variable Input + 184: 161(int) Constant 2 + 210: 54(int) Constant 3 + 211: TypePointer Output 6(float) +218(colorTransform): 180(ptr) Variable Input + 219(m): 146(ptr) Variable Input + 220(n): 146(ptr) Variable Input 4(main): 2 Function None 3 5: Label 10(m34): 9(ptr) Variable Function 63(m44): 62(ptr) Variable Function - 148(inv): 147(ptr) Variable Function - 171(inv3): 170(ptr) Variable Function - 182(inv4): 62(ptr) Variable Function + 156(inv): 155(ptr) Variable Function + 179(inv3): 178(ptr) Variable Function + 190(inv4): 62(ptr) Variable Function 13: 7(fvec4) Load 12(v) 17: 14(fvec3) Load 16(u) 18: 8 OuterProduct 13 17 @@ -166,100 +166,108 @@ Linked fragment stage: 103: 61 CompositeConstruct 93 96 99 102 Store 63(m44) 103 104: 61 Load 63(m44) - 105: 61 FNegate 104 - 106: 7(fvec4) Load 12(v) - 107: 7(fvec4) MatrixTimesVector 105 106 - 108: 7(fvec4) Load 37(FragColor) - 109: 7(fvec4) FAdd 108 107 - Store 37(FragColor) 109 - 110: 61 Load 63(m44) - 111: 61 Load 63(m44) - 112: 7(fvec4) CompositeExtract 110 0 - 113: 7(fvec4) CompositeExtract 111 0 - 114: 7(fvec4) FMul 112 113 - 115: 7(fvec4) CompositeExtract 110 1 - 116: 7(fvec4) CompositeExtract 111 1 - 117: 7(fvec4) FMul 115 116 - 118: 7(fvec4) CompositeExtract 110 2 - 119: 7(fvec4) CompositeExtract 111 2 - 120: 7(fvec4) FMul 118 119 - 121: 7(fvec4) CompositeExtract 110 3 - 122: 7(fvec4) CompositeExtract 111 3 - 123: 7(fvec4) FMul 121 122 - 124: 61 CompositeConstruct 114 117 120 123 - 125: 7(fvec4) Load 37(FragColor) - 126: 7(fvec4) VectorTimesMatrix 125 124 - Store 37(FragColor) 126 - 127: 85 Load 87(um43) - 128: 8 Transpose 127 - Store 10(m34) 128 - 129: 7(fvec4) Load 37(FragColor) - 130: 8 Load 10(m34) - 131: 14(fvec3) VectorTimesMatrix 129 130 - 132: 6(float) CompositeExtract 131 0 - 133: 6(float) CompositeExtract 131 1 - 134: 6(float) CompositeExtract 131 2 - 135: 7(fvec4) CompositeConstruct 132 133 134 40 - 136: 7(fvec4) Load 37(FragColor) - 137: 7(fvec4) FMul 136 135 - Store 37(FragColor) 137 - 140: 61 Load 139(um4) - 141: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 140 - 142: 7(fvec4) CompositeConstruct 141 141 141 141 - 143: 7(fvec4) Load 37(FragColor) - 144: 7(fvec4) FMul 143 142 - Store 37(FragColor) 144 - 151: 146 Load 150(um2) - 152: 146 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 151 - Store 148(inv) 152 - 156: 155(ptr) AccessChain 148(inv) 154 55 - 157: 6(float) Load 156 - 159: 155(ptr) AccessChain 148(inv) 158 55 - 160: 6(float) Load 159 - 162: 155(ptr) AccessChain 148(inv) 154 161 - 163: 6(float) Load 162 - 164: 155(ptr) AccessChain 148(inv) 158 161 + 105: 7(fvec4) CompositeExtract 104 0 + 106: 7(fvec4) FNegate 105 + 107: 7(fvec4) CompositeExtract 104 1 + 108: 7(fvec4) FNegate 107 + 109: 7(fvec4) CompositeExtract 104 2 + 110: 7(fvec4) FNegate 109 + 111: 7(fvec4) CompositeExtract 104 3 + 112: 7(fvec4) FNegate 111 + 113: 61 CompositeConstruct 106 108 110 112 + 114: 7(fvec4) Load 12(v) + 115: 7(fvec4) MatrixTimesVector 113 114 + 116: 7(fvec4) Load 37(FragColor) + 117: 7(fvec4) FAdd 116 115 + Store 37(FragColor) 117 + 118: 61 Load 63(m44) + 119: 61 Load 63(m44) + 120: 7(fvec4) CompositeExtract 118 0 + 121: 7(fvec4) CompositeExtract 119 0 + 122: 7(fvec4) FMul 120 121 + 123: 7(fvec4) CompositeExtract 118 1 + 124: 7(fvec4) CompositeExtract 119 1 + 125: 7(fvec4) FMul 123 124 + 126: 7(fvec4) CompositeExtract 118 2 + 127: 7(fvec4) CompositeExtract 119 2 + 128: 7(fvec4) FMul 126 127 + 129: 7(fvec4) CompositeExtract 118 3 + 130: 7(fvec4) CompositeExtract 119 3 + 131: 7(fvec4) FMul 129 130 + 132: 61 CompositeConstruct 122 125 128 131 + 133: 7(fvec4) Load 37(FragColor) + 134: 7(fvec4) VectorTimesMatrix 133 132 + Store 37(FragColor) 134 + 135: 85 Load 87(um43) + 136: 8 Transpose 135 + Store 10(m34) 136 + 137: 7(fvec4) Load 37(FragColor) + 138: 8 Load 10(m34) + 139: 14(fvec3) VectorTimesMatrix 137 138 + 140: 6(float) CompositeExtract 139 0 + 141: 6(float) CompositeExtract 139 1 + 142: 6(float) CompositeExtract 139 2 + 143: 7(fvec4) CompositeConstruct 140 141 142 40 + 144: 7(fvec4) Load 37(FragColor) + 145: 7(fvec4) FMul 144 143 + Store 37(FragColor) 145 + 148: 61 Load 147(um4) + 149: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 148 + 150: 7(fvec4) CompositeConstruct 149 149 149 149 + 151: 7(fvec4) Load 37(FragColor) + 152: 7(fvec4) FMul 151 150 + Store 37(FragColor) 152 + 159: 154 Load 158(um2) + 160: 154 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 159 + Store 156(inv) 160 + 164: 163(ptr) AccessChain 156(inv) 162 55 165: 6(float) Load 164 - 166: 7(fvec4) CompositeConstruct 157 160 163 165 - 167: 7(fvec4) Load 37(FragColor) - 168: 7(fvec4) FMul 167 166 - Store 37(FragColor) 168 - 174: 169 Load 173(um3) - 175: 169 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 174 - Store 171(inv3) 175 - 177: 155(ptr) AccessChain 171(inv3) 176 161 - 178: 6(float) Load 177 - 179: 7(fvec4) CompositeConstruct 178 178 178 178 - 180: 7(fvec4) Load 37(FragColor) - 181: 7(fvec4) FMul 180 179 - Store 37(FragColor) 181 - 183: 61 Load 139(um4) - 184: 61 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 183 - Store 182(inv4) 184 - 185: 61 Load 182(inv4) - 186: 7(fvec4) Load 37(FragColor) - 187: 7(fvec4) VectorTimesMatrix 186 185 - Store 37(FragColor) 187 + 167: 163(ptr) AccessChain 156(inv) 166 55 + 168: 6(float) Load 167 + 170: 163(ptr) AccessChain 156(inv) 162 169 + 171: 6(float) Load 170 + 172: 163(ptr) AccessChain 156(inv) 166 169 + 173: 6(float) Load 172 + 174: 7(fvec4) CompositeConstruct 165 168 171 173 + 175: 7(fvec4) Load 37(FragColor) + 176: 7(fvec4) FMul 175 174 + Store 37(FragColor) 176 + 182: 177 Load 181(um3) + 183: 177 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 182 + Store 179(inv3) 183 + 185: 163(ptr) AccessChain 179(inv3) 184 169 + 186: 6(float) Load 185 + 187: 7(fvec4) CompositeConstruct 186 186 186 186 188: 7(fvec4) Load 37(FragColor) - 189: 8 Load 65(un34) - 190: 8 Load 65(un34) - 191: 7(fvec4) CompositeExtract 189 0 - 192: 7(fvec4) CompositeExtract 190 0 - 193: 7(fvec4) FMul 191 192 - 194: 7(fvec4) CompositeExtract 189 1 - 195: 7(fvec4) CompositeExtract 190 1 - 196: 7(fvec4) FMul 194 195 - 197: 7(fvec4) CompositeExtract 189 2 - 198: 7(fvec4) CompositeExtract 190 2 - 199: 7(fvec4) FMul 197 198 - 200: 8 CompositeConstruct 193 196 199 - 201: 14(fvec3) VectorTimesMatrix 188 200 - 204: 203(ptr) AccessChain 37(FragColor) 202 - 205: 6(float) Load 204 - 206: 6(float) CompositeExtract 201 0 - 207: 6(float) CompositeExtract 201 1 - 208: 6(float) CompositeExtract 201 2 - 209: 7(fvec4) CompositeConstruct 206 207 208 205 - Store 37(FragColor) 209 + 189: 7(fvec4) FMul 188 187 + Store 37(FragColor) 189 + 191: 61 Load 147(um4) + 192: 61 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 191 + Store 190(inv4) 192 + 193: 61 Load 190(inv4) + 194: 7(fvec4) Load 37(FragColor) + 195: 7(fvec4) VectorTimesMatrix 194 193 + Store 37(FragColor) 195 + 196: 7(fvec4) Load 37(FragColor) + 197: 8 Load 65(un34) + 198: 8 Load 65(un34) + 199: 7(fvec4) CompositeExtract 197 0 + 200: 7(fvec4) CompositeExtract 198 0 + 201: 7(fvec4) FMul 199 200 + 202: 7(fvec4) CompositeExtract 197 1 + 203: 7(fvec4) CompositeExtract 198 1 + 204: 7(fvec4) FMul 202 203 + 205: 7(fvec4) CompositeExtract 197 2 + 206: 7(fvec4) CompositeExtract 198 2 + 207: 7(fvec4) FMul 205 206 + 208: 8 CompositeConstruct 201 204 207 + 209: 14(fvec3) VectorTimesMatrix 196 208 + 212: 211(ptr) AccessChain 37(FragColor) 210 + 213: 6(float) Load 212 + 214: 6(float) CompositeExtract 209 0 + 215: 6(float) CompositeExtract 209 1 + 216: 6(float) CompositeExtract 209 2 + 217: 7(fvec4) CompositeConstruct 214 215 216 213 + Store 37(FragColor) 217 Return FunctionEnd diff --git a/Test/baseResults/spv.memoryQualifier.frag.out b/Test/baseResults/spv.memoryQualifier.frag.out new file mode 100644 index 00000000..e2bfb392 --- /dev/null +++ b/Test/baseResults/spv.memoryQualifier.frag.out @@ -0,0 +1,181 @@ +spv.memoryQualifier.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 97 + + Capability Shader + Capability SampledRect + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "texel" + Name 12 "i1D" + Name 19 "i2D" + Name 28 "i2DRect" + Name 35 "i3D" + Name 44 "iCube" + Name 49 "Data" + MemberName 49(Data) 0 "f1" + MemberName 49(Data) 1 "f2" + Name 50 "Buffer" + MemberName 50(Buffer) 0 "f1" + MemberName 50(Buffer) 1 "f2" + MemberName 50(Buffer) 2 "f3" + MemberName 50(Buffer) 3 "f4" + MemberName 50(Buffer) 4 "i1" + MemberName 50(Buffer) 5 "data" + Name 52 "" + Decorate 12(i1D) DescriptorSet 0 + Decorate 12(i1D) Binding 0 + Decorate 12(i1D) Coherent + Decorate 19(i2D) DescriptorSet 0 + Decorate 19(i2D) Binding 1 + Decorate 19(i2D) Volatile + Decorate 28(i2DRect) DescriptorSet 0 + Decorate 28(i2DRect) Binding 2 + Decorate 28(i2DRect) Restrict + Decorate 35(i3D) DescriptorSet 0 + Decorate 35(i3D) Binding 3 + Decorate 35(i3D) NonWritable + Decorate 44(iCube) DescriptorSet 0 + Decorate 44(iCube) Binding 3 + Decorate 44(iCube) NonReadable + MemberDecorate 49(Data) 0 Coherent + MemberDecorate 49(Data) 0 Offset 0 + MemberDecorate 49(Data) 1 Coherent + MemberDecorate 49(Data) 1 Offset 8 + MemberDecorate 50(Buffer) 0 Coherent + MemberDecorate 50(Buffer) 0 Volatile + MemberDecorate 50(Buffer) 0 Offset 0 + MemberDecorate 50(Buffer) 1 Coherent + MemberDecorate 50(Buffer) 1 Restrict + MemberDecorate 50(Buffer) 1 Offset 8 + MemberDecorate 50(Buffer) 2 Coherent + MemberDecorate 50(Buffer) 2 NonWritable + MemberDecorate 50(Buffer) 2 Offset 16 + MemberDecorate 50(Buffer) 3 Coherent + MemberDecorate 50(Buffer) 3 NonReadable + MemberDecorate 50(Buffer) 3 Offset 32 + MemberDecorate 50(Buffer) 4 Coherent + MemberDecorate 50(Buffer) 4 Offset 48 + MemberDecorate 50(Buffer) 5 Coherent + MemberDecorate 50(Buffer) 5 Offset 56 + Decorate 50(Buffer) BufferBlock + Decorate 52 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 1D nonsampled format:R32f + 11: TypePointer UniformConstant 10 + 12(i1D): 11(ptr) Variable UniformConstant + 14: TypeInt 32 1 + 15: 14(int) Constant 1 + 17: TypeImage 6(float) 2D nonsampled format:R32f + 18: TypePointer UniformConstant 17 + 19(i2D): 18(ptr) Variable UniformConstant + 21: TypeVector 14(int) 2 + 22: 21(ivec2) ConstantComposite 15 15 + 26: TypeImage 6(float) Rect nonsampled format:R32f + 27: TypePointer UniformConstant 26 + 28(i2DRect): 27(ptr) Variable UniformConstant + 33: TypeImage 6(float) 3D nonsampled format:R32f + 34: TypePointer UniformConstant 33 + 35(i3D): 34(ptr) Variable UniformConstant + 37: TypeVector 14(int) 3 + 38: 37(ivec3) ConstantComposite 15 15 15 + 42: TypeImage 6(float) Cube nonsampled format:R32f + 43: TypePointer UniformConstant 42 + 44(iCube): 43(ptr) Variable UniformConstant + 47: TypeVector 6(float) 2 + 48: TypeVector 6(float) 3 + 49(Data): TypeStruct 6(float) 47(fvec2) + 50(Buffer): TypeStruct 6(float) 47(fvec2) 48(fvec3) 7(fvec4) 14(int) 49(Data) + 51: TypePointer Uniform 50(Buffer) + 52: 51(ptr) Variable Uniform + 53: 14(int) Constant 4 + 54: TypePointer Uniform 14(int) + 57: 14(int) Constant 0 + 58: TypePointer Uniform 6(float) + 61: TypePointer Function 6(float) + 63: TypePointer Uniform 47(fvec2) + 71: 14(int) Constant 2 + 72: TypePointer Uniform 48(fvec3) + 80: 14(int) Constant 5 + 83: TypeInt 32 0 + 84: 83(int) Constant 1 + 88: 83(int) Constant 3 + 93: 14(int) Constant 3 + 95: TypePointer Uniform 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 9(texel): 8(ptr) Variable Function + 13: 10 Load 12(i1D) + 16: 7(fvec4) ImageRead 13 15 + Store 9(texel) 16 + 20: 17 Load 19(i2D) + 23: 7(fvec4) ImageRead 20 22 + 24: 7(fvec4) Load 9(texel) + 25: 7(fvec4) FAdd 24 23 + Store 9(texel) 25 + 29: 26 Load 28(i2DRect) + 30: 7(fvec4) ImageRead 29 22 + 31: 7(fvec4) Load 9(texel) + 32: 7(fvec4) FAdd 31 30 + Store 9(texel) 32 + 36: 33 Load 35(i3D) + 39: 7(fvec4) ImageRead 36 38 + 40: 7(fvec4) Load 9(texel) + 41: 7(fvec4) FAdd 40 39 + Store 9(texel) 41 + 45: 42 Load 44(iCube) + 46: 7(fvec4) Load 9(texel) + ImageWrite 45 38 46 + 55: 54(ptr) AccessChain 52 53 + 56: 14(int) Load 55 + 59: 58(ptr) AccessChain 52 57 + 60: 6(float) Load 59 + 62: 61(ptr) AccessChain 9(texel) 56 + Store 62 60 + 64: 63(ptr) AccessChain 52 15 + 65: 47(fvec2) Load 64 + 66: 7(fvec4) Load 9(texel) + 67: 47(fvec2) VectorShuffle 66 66 0 1 + 68: 47(fvec2) FAdd 67 65 + 69: 7(fvec4) Load 9(texel) + 70: 7(fvec4) VectorShuffle 69 68 4 5 2 3 + Store 9(texel) 70 + 73: 72(ptr) AccessChain 52 71 + 74: 48(fvec3) Load 73 + 75: 7(fvec4) Load 9(texel) + 76: 48(fvec3) VectorShuffle 75 75 0 1 2 + 77: 48(fvec3) FSub 76 74 + 78: 7(fvec4) Load 9(texel) + 79: 7(fvec4) VectorShuffle 78 77 4 5 6 3 + Store 9(texel) 79 + 81: 58(ptr) AccessChain 52 80 57 + 82: 6(float) Load 81 + 85: 58(ptr) AccessChain 52 80 15 84 + 86: 6(float) Load 85 + 87: 6(float) FAdd 82 86 + 89: 61(ptr) AccessChain 9(texel) 88 + 90: 6(float) Load 89 + 91: 6(float) FAdd 90 87 + 92: 61(ptr) AccessChain 9(texel) 88 + Store 92 91 + 94: 7(fvec4) Load 9(texel) + 96: 95(ptr) AccessChain 52 93 + Store 96 94 + Return + FunctionEnd diff --git a/Test/baseResults/spv.merge-unreachable.frag.out b/Test/baseResults/spv.merge-unreachable.frag.out new file mode 100644 index 00000000..6e326187 --- /dev/null +++ b/Test/baseResults/spv.merge-unreachable.frag.out @@ -0,0 +1,47 @@ +spv.merge-unreachable.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v" + Decorate 9(v) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Input 7(fvec4) + 9(v): 8(ptr) Variable Input + 11: 6(float) Constant 1036831949 + 12: 6(float) Constant 1045220557 + 13: 6(float) Constant 1050253722 + 14: 6(float) Constant 1053609165 + 15: 7(fvec4) ConstantComposite 11 12 13 14 + 16: TypeBool + 17: TypeVector 16(bool) 4 + 4(main): 2 Function None 3 + 5: Label + 10: 7(fvec4) Load 9(v) + 18: 17(bvec4) FOrdEqual 10 15 + 19: 16(bool) All 18 + SelectionMerge 21 None + BranchConditional 19 20 23 + 20: Label + Kill + 23: Label + Return + 21: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.newTexture.frag.out b/Test/baseResults/spv.newTexture.frag.out index 41972bbb..1c99ac01 100755 --- a/Test/baseResults/spv.newTexture.frag.out +++ b/Test/baseResults/spv.newTexture.frag.out @@ -10,10 +10,13 @@ Linked fragment stage: // Id's are bound by 278 Capability Shader + Capability SampledRect + Capability SampledCubeArray + Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 17 26 29 55 81 84 91 247 277 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 9 "v" @@ -46,9 +49,27 @@ Linked fragment stage: Name 271 "usCube" Name 275 "us2DArray" Name 277 "ic4D" + Decorate 13(s2D) DescriptorSet 0 + Decorate 23(sCubeArrayShadow) DescriptorSet 0 + Decorate 42(s3D) DescriptorSet 0 + Decorate 51(s2DArray) DescriptorSet 0 + Decorate 64(s2DShadow) DescriptorSet 0 Decorate 81(ic3D) Flat Decorate 84(ic1D) Flat Decorate 91(ic2D) Flat + Decorate 100(sr) DescriptorSet 0 + Decorate 125(sCube) DescriptorSet 0 + Decorate 136(s2DArrayShadow) DescriptorSet 0 + Decorate 168(is2D) DescriptorSet 0 + Decorate 203(is3D) DescriptorSet 0 + Decorate 215(isCube) DescriptorSet 0 + Decorate 227(is2DArray) DescriptorSet 0 + Decorate 241(sCubeShadow) DescriptorSet 0 + Decorate 259(is2Dms) DescriptorSet 0 + Decorate 263(us2D) DescriptorSet 0 + Decorate 267(us3D) DescriptorSet 0 + Decorate 271(usCube) DescriptorSet 0 + Decorate 275(us2DArray) DescriptorSet 0 Decorate 277(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.nonSquare.vert.out b/Test/baseResults/spv.nonSquare.vert.out index 51a42682..329a71cb 100755 --- a/Test/baseResults/spv.nonSquare.vert.out +++ b/Test/baseResults/spv.nonSquare.vert.out @@ -10,8 +10,8 @@ Linked vertex stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 12 28 55 - Source GLSL 120 + EntryPoint Vertex 4 "main" 12 22 28 55 + Source GLSL 140 Name 4 "main" Name 9 "a" Name 12 "v3" @@ -32,8 +32,8 @@ Linked vertex stage: 14: TypeMatrix 10(fvec3) 2 15: TypePointer Function 14 20: TypeMatrix 7(fvec2) 3 - 21: TypePointer UniformConstant 20 - 22(m32): 21(ptr) Variable UniformConstant + 21: TypePointer Output 20 + 22(m32): 21(ptr) Variable Output 26: TypeVector 6(float) 4 27: TypePointer Output 26(fvec4) 28(gl_Position): 27(ptr) Variable Output diff --git a/Test/baseResults/spv.precision.frag.out b/Test/baseResults/spv.precision.frag.out index 8c28fed7..33e4fb20 100755 --- a/Test/baseResults/spv.precision.frag.out +++ b/Test/baseResults/spv.precision.frag.out @@ -1,47 +1,92 @@ spv.precision.frag +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 112 +// Id's are bound by 127 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 23 57 59 71 - ExecutionMode 4 OriginLowerLeft - Source ESSL 300 + EntryPoint Fragment 4 "main" 23 59 61 73 116 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 Name 4 "main" Name 12 "foo(vf3;" Name 11 "mv3" Name 19 "boolfun(vb2;" Name 18 "bv2" Name 23 "highfin" - Name 36 "sum" - Name 38 "uniform_medium" - Name 40 "uniform_high" - Name 46 "uniform_low" - Name 51 "arg1" - Name 53 "arg2" - Name 55 "d" - Name 57 "lowfin" - Name 59 "mediumfin" - Name 63 "global_highp" - Name 67 "local_highp" - Name 71 "mediumfout" - Name 102 "ub2" - Name 103 "param" - Decorate 36(sum) RelaxedPrecision - Decorate 38(uniform_medium) RelaxedPrecision - Decorate 46(uniform_low) RelaxedPrecision - Decorate 51(arg1) RelaxedPrecision - Decorate 53(arg2) RelaxedPrecision - Decorate 55(d) RelaxedPrecision - Decorate 57(lowfin) RelaxedPrecision - Decorate 59(mediumfin) RelaxedPrecision - Decorate 71(mediumfout) RelaxedPrecision + Name 38 "sum" + Name 40 "uniform_medium" + Name 42 "uniform_high" + Name 48 "uniform_low" + Name 53 "arg1" + Name 55 "arg2" + Name 57 "d" + Name 59 "lowfin" + Name 61 "mediumfin" + Name 65 "global_highp" + Name 69 "local_highp" + Name 73 "mediumfout" + Name 104 "ub2" + Name 105 "param" + Name 114 "S" + MemberName 114(S) 0 "a" + MemberName 114(S) 1 "b" + Name 116 "s" + Decorate 12(foo(vf3;) RelaxedPrecision + Decorate 11(mv3) RelaxedPrecision + Decorate 38(sum) RelaxedPrecision + Decorate 40(uniform_medium) RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 48(uniform_low) RelaxedPrecision + Decorate 49 RelaxedPrecision + Decorate 50 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 53(arg1) RelaxedPrecision + Decorate 55(arg2) RelaxedPrecision + Decorate 57(d) RelaxedPrecision + Decorate 59(lowfin) RelaxedPrecision + Decorate 60 RelaxedPrecision + Decorate 61(mediumfin) RelaxedPrecision + Decorate 62 RelaxedPrecision + Decorate 63 RelaxedPrecision + Decorate 73(mediumfout) RelaxedPrecision + Decorate 74 RelaxedPrecision + Decorate 75 RelaxedPrecision + Decorate 76 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 83 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 87 RelaxedPrecision + Decorate 88 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 94 RelaxedPrecision + Decorate 95 RelaxedPrecision + Decorate 96 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 98 RelaxedPrecision + Decorate 99 RelaxedPrecision + Decorate 100 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 110 RelaxedPrecision + Decorate 112 RelaxedPrecision + Decorate 113 RelaxedPrecision + MemberDecorate 114(S) 1 RelaxedPrecision + Decorate 120 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -56,105 +101,120 @@ Linked fragment stage: 21: TypeVector 6(float) 4 22: TypePointer Input 21(fvec4) 23(highfin): 22(ptr) Variable Input - 28: 14(bool) ConstantFalse - 29: 14(bool) ConstantTrue - 30: 15(bvec2) ConstantComposite 28 29 - 34: TypeInt 32 1 - 35: TypePointer Function 34(int) - 37: TypePointer UniformConstant 34(int) -38(uniform_medium): 37(ptr) Variable UniformConstant -40(uniform_high): 37(ptr) Variable UniformConstant - 46(uniform_low): 37(ptr) Variable UniformConstant - 50: TypePointer Function 6(float) - 52: 6(float) Constant 1078774989 - 54: 6(float) Constant 1232730691 - 56: TypePointer Input 6(float) - 57(lowfin): 56(ptr) Variable Input - 59(mediumfin): 56(ptr) Variable Input - 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 - 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 + 29: 14(bool) ConstantFalse + 30: 14(bool) ConstantTrue + 31: 15(bvec2) ConstantComposite 29 30 + 36: TypeInt 32 1 + 37: TypePointer Function 36(int) + 39: TypePointer Private 36(int) +40(uniform_medium): 39(ptr) Variable Private +42(uniform_high): 39(ptr) Variable Private + 48(uniform_low): 39(ptr) Variable Private + 52: TypePointer Function 6(float) + 54: 6(float) Constant 1078774989 + 56: 6(float) Constant 1232730691 + 58: TypePointer Input 6(float) + 59(lowfin): 58(ptr) Variable Input + 61(mediumfin): 58(ptr) Variable Input + 64: TypePointer Private 6(float) +65(global_highp): 64(ptr) Variable Private + 68: TypePointer Function 21(fvec4) + 72: TypePointer Output 21(fvec4) + 73(mediumfout): 72(ptr) Variable Output + 82: 36(int) Constant 4 + 84: TypeVector 36(int) 2 + 92: TypeInt 32 0 + 93: 92(int) Constant 0 + 103: TypePointer Private 15(bvec2) + 104(ub2): 103(ptr) Variable Private + 111: 6(float) Constant 1065353216 + 114(S): TypeStruct 6(float) 6(float) + 115: TypePointer Input 114(S) + 116(s): 115(ptr) Variable Input + 117: 36(int) Constant 0 + 122: 36(int) Constant 1 4(main): 2 Function None 3 5: Label - 36(sum): 35(ptr) Variable Function - 51(arg1): 50(ptr) Variable Function - 53(arg2): 50(ptr) Variable Function - 55(d): 50(ptr) Variable Function - 67(local_highp): 66(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 - Store 36(sum) 42 - 43: 34(int) Load 40(uniform_high) - 44: 34(int) Load 36(sum) - 45: 34(int) IAdd 44 43 - Store 36(sum) 45 - 47: 34(int) Load 46(uniform_low) - 48: 34(int) Load 36(sum) - 49: 34(int) IAdd 48 47 - Store 36(sum) 49 - Store 51(arg1) 52 - Store 53(arg2) 54 - 58: 6(float) Load 57(lowfin) - 60: 6(float) Load 59(mediumfin) - 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) 66(Length) 64 - Store 63(global_highp) 65 - 68: 6(float) Load 63(global_highp) - 69: 21(fvec4) CompositeConstruct 68 68 68 68 - Store 67(local_highp) 69 - 72: 6(float) Load 55(d) - 73: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 72 - 74: 21(fvec4) CompositeConstruct 73 73 73 73 - 75: 6(float) Load 53(arg2) + 38(sum): 37(ptr) Variable Function + 53(arg1): 52(ptr) Variable Function + 55(arg2): 52(ptr) Variable Function + 57(d): 52(ptr) Variable Function + 69(local_highp): 68(ptr) Variable Function + 105(param): 16(ptr) Variable Function + 41: 36(int) Load 40(uniform_medium) + 43: 36(int) Load 42(uniform_high) + 44: 36(int) IAdd 41 43 + Store 38(sum) 44 + 45: 36(int) Load 42(uniform_high) + 46: 36(int) Load 38(sum) + 47: 36(int) IAdd 46 45 + Store 38(sum) 47 + 49: 36(int) Load 48(uniform_low) + 50: 36(int) Load 38(sum) + 51: 36(int) IAdd 50 49 + Store 38(sum) 51 + Store 53(arg1) 54 + Store 55(arg2) 56 + 60: 6(float) Load 59(lowfin) + 62: 6(float) Load 61(mediumfin) + 63: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 60 62 + Store 57(d) 63 + 66: 21(fvec4) Load 23(highfin) + 67: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 66 + Store 65(global_highp) 67 + 70: 6(float) Load 65(global_highp) + 71: 21(fvec4) CompositeConstruct 70 70 70 70 + Store 69(local_highp) 71 + 74: 6(float) Load 57(d) + 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 76: 21(fvec4) CompositeConstruct 75 75 75 75 - 77: 21(fvec4) FAdd 74 76 - 78: 21(fvec4) Load 67(local_highp) - 79: 21(fvec4) FAdd 77 78 - Store 71(mediumfout) 79 - 81: 34(int) Load 46(uniform_low) - 83: 82(ivec2) CompositeConstruct 81 81 - 84: 34(int) Load 40(uniform_high) - 85: 82(ivec2) CompositeConstruct 84 84 - 86: 82(ivec2) IMul 83 85 - 87: 34(int) Load 40(uniform_high) - 88: 82(ivec2) CompositeConstruct 87 87 - 89: 82(ivec2) IAdd 86 88 - 92: 34(int) CompositeExtract 89 0 - 93: 34(int) IAdd 80 92 - 94: 34(int) Load 36(sum) - 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 + 77: 6(float) Load 55(arg2) + 78: 21(fvec4) CompositeConstruct 77 77 77 77 + 79: 21(fvec4) FAdd 76 78 + 80: 21(fvec4) Load 69(local_highp) + 81: 21(fvec4) FAdd 79 80 + Store 73(mediumfout) 81 + 83: 36(int) Load 48(uniform_low) + 85: 84(ivec2) CompositeConstruct 83 83 + 86: 36(int) Load 42(uniform_high) + 87: 84(ivec2) CompositeConstruct 86 86 + 88: 84(ivec2) IMul 85 87 + 89: 36(int) Load 42(uniform_high) + 90: 84(ivec2) CompositeConstruct 89 89 + 91: 84(ivec2) IAdd 88 90 + 94: 36(int) CompositeExtract 91 0 + 95: 36(int) IAdd 82 94 + 96: 36(int) Load 38(sum) + 97: 36(int) IAdd 96 95 + Store 38(sum) 97 + 98: 36(int) Load 38(sum) + 99: 6(float) ConvertSToF 98 + 100: 21(fvec4) CompositeConstruct 99 99 99 99 + 101: 21(fvec4) Load 73(mediumfout) + 102: 21(fvec4) FAdd 101 100 + Store 73(mediumfout) 102 + 106: 15(bvec2) Load 104(ub2) + Store 105(param) 106 + 107: 14(bool) FunctionCall 19(boolfun(vb2;) 105(param) + SelectionMerge 109 None + BranchConditional 107 108 109 + 108: Label + 110: 21(fvec4) Load 73(mediumfout) + 112: 21(fvec4) CompositeConstruct 111 111 111 111 + 113: 21(fvec4) FAdd 110 112 + Store 73(mediumfout) 113 + Branch 109 + 109: Label + 118: 58(ptr) AccessChain 116(s) 117 + 119: 6(float) Load 118 + 120: 21(fvec4) Load 73(mediumfout) + 121: 21(fvec4) VectorTimesScalar 120 119 + Store 73(mediumfout) 121 + 123: 58(ptr) AccessChain 116(s) 122 + 124: 6(float) Load 123 + 125: 21(fvec4) Load 73(mediumfout) + 126: 21(fvec4) VectorTimesScalar 125 124 + Store 73(mediumfout) 126 Return FunctionEnd 12(foo(vf3;): 9(fvec2) Function None 10 @@ -167,8 +227,8 @@ Linked fragment stage: 19(boolfun(vb2;): 14(bool) Function None 17 18(bv2): 16(ptr) FunctionParameter 20: Label - 27: 15(bvec2) Load 18(bv2) - 31: 15(bvec2) LogicalEqual 27 30 - 32: 14(bool) All 31 - ReturnValue 32 + 28: 15(bvec2) Load 18(bv2) + 32: 15(bvec2) LogicalEqual 28 31 + 33: 14(bool) All 32 + ReturnValue 33 FunctionEnd diff --git a/Test/baseResults/spv.prepost.frag.out b/Test/baseResults/spv.prepost.frag.out index ee77a099..9581267b 100755 --- a/Test/baseResults/spv.prepost.frag.out +++ b/Test/baseResults/spv.prepost.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 90 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "index" diff --git a/Test/baseResults/spv.pushConstant.vert.out b/Test/baseResults/spv.pushConstant.vert.out new file mode 100644 index 00000000..6b314e08 --- /dev/null +++ b/Test/baseResults/spv.pushConstant.vert.out @@ -0,0 +1,67 @@ +spv.pushConstant.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 + Source GLSL 400 + Name 4 "main" + Name 11 "Material" + MemberName 11(Material) 0 "kind" + MemberName 11(Material) 1 "fa" + Name 13 "matInst" + Name 24 "color" + Decorate 10 ArrayStride 4 + MemberDecorate 11(Material) 0 Offset 0 + MemberDecorate 11(Material) 1 Offset 4 + Decorate 11(Material) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(float) 9 + 11(Material): TypeStruct 6(int) 10 + 12: TypePointer PushConstant 11(Material) + 13(matInst): 12(ptr) Variable PushConstant + 14: 6(int) Constant 0 + 15: TypePointer PushConstant 6(int) + 22: TypeVector 7(float) 4 + 23: TypePointer Output 22(fvec4) + 24(color): 23(ptr) Variable Output + 25: 7(float) Constant 1045220557 + 26: 22(fvec4) ConstantComposite 25 25 25 25 + 28: 7(float) Constant 1056964608 + 29: 22(fvec4) ConstantComposite 28 28 28 28 + 31: 7(float) Constant 0 + 32: 22(fvec4) ConstantComposite 31 31 31 31 + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 13(matInst) 14 + 17: 6(int) Load 16 + SelectionMerge 21 None + Switch 17 20 + case 1: 18 + case 2: 19 + 20: Label + Store 24(color) 32 + Branch 21 + 18: Label + Store 24(color) 26 + Branch 21 + 19: Label + Store 24(color) 29 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.qualifiers.vert.out b/Test/baseResults/spv.qualifiers.vert.out index b8f60855..bedd6912 100755 --- a/Test/baseResults/spv.qualifiers.vert.out +++ b/Test/baseResults/spv.qualifiers.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 21 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 13 15 17 19 23 24 + EntryPoint Vertex 4 "main" 9 11 13 15 17 19 Source GLSL 430 Name 4 "main" Name 9 "outVc" @@ -21,13 +21,9 @@ Linked vertex stage: Name 15 "outVf" Name 17 "outVn" Name 19 "outVcn" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" Decorate 15(outVf) Flat Decorate 17(outVn) NoPerspective Decorate 19(outVcn) NoPerspective - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -40,10 +36,6 @@ Linked vertex stage: 15(outVf): 8(ptr) Variable Output 17(outVn): 8(ptr) Variable Output 19(outVcn): 8(ptr) Variable Output - 21: TypeInt 32 1 - 22: TypePointer Input 21(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(inV) diff --git a/Test/baseResults/spv.queryL.frag.out b/Test/baseResults/spv.queryL.frag.out index d72730a5..6d2b2b97 100755 --- a/Test/baseResults/spv.queryL.frag.out +++ b/Test/baseResults/spv.queryL.frag.out @@ -10,10 +10,15 @@ Linked fragment stage: // Id's are bound by 237 Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 9 "lod" @@ -41,6 +46,26 @@ Linked fragment stage: Name 195 "usampCubeA" Name 232 "sampBuf" Name 236 "sampRect" + Decorate 13(samp1D) DescriptorSet 0 + Decorate 24(isamp2D) DescriptorSet 0 + Decorate 36(usamp3D) DescriptorSet 0 + Decorate 49(sampCube) DescriptorSet 0 + Decorate 59(isamp1DA) DescriptorSet 0 + Decorate 69(usamp2DA) DescriptorSet 0 + Decorate 79(isampCubeA) DescriptorSet 0 + Decorate 89(samp1Ds) DescriptorSet 0 + Decorate 99(samp2Ds) DescriptorSet 0 + Decorate 109(sampCubes) DescriptorSet 0 + Decorate 119(samp1DAs) DescriptorSet 0 + Decorate 129(samp2DAs) DescriptorSet 0 + Decorate 139(sampCubeAs) DescriptorSet 0 + Decorate 154(usamp2D) DescriptorSet 0 + Decorate 163(isamp3D) DescriptorSet 0 + Decorate 172(isampCube) DescriptorSet 0 + Decorate 186(samp2DA) DescriptorSet 0 + Decorate 195(usampCubeA) DescriptorSet 0 + Decorate 232(sampBuf) DescriptorSet 0 + Decorate 236(sampRect) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.separate.frag.out b/Test/baseResults/spv.separate.frag.out new file mode 100644 index 00000000..2a71a019 --- /dev/null +++ b/Test/baseResults/spv.separate.frag.out @@ -0,0 +1,427 @@ +spv.separate.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 319 + + Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageMSArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 34 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 6 "foo(" + Name 11 "color" + Name 14 "t2d" + Name 18 "s" + Name 31 "t3d" + Name 34 "i" + Name 41 "sA" + Name 58 "tex2D" + Name 64 "texCube" + Name 71 "texCubeArray" + Name 77 "sShadow" + Name 84 "itexCubeArray" + Name 91 "utexCubeArray" + Name 98 "tex1DArray" + Name 106 "itex1DArray" + Name 113 "utex1D" + Name 120 "itex1D" + Name 127 "utex1DArray" + Name 134 "texBuffer" + Name 146 "tex2DArray" + Name 158 "itex2D" + Name 165 "itex3D" + Name 172 "itexCube" + Name 179 "itex2DArray" + Name 186 "utex2D" + Name 193 "utex3D" + Name 200 "utexCube" + Name 207 "utex2DArray" + Name 214 "itex2DRect" + Name 221 "utex2DRect" + Name 228 "itexBuffer" + Name 235 "utexBuffer" + Name 242 "tex2DMS" + Name 249 "itex2DMS" + Name 256 "utex2DMS" + Name 263 "tex2DMSArray" + Name 270 "itex2DMSArray" + Name 277 "utex2DMSArray" + Name 284 "tex1D" + Name 294 "tex3D" + Name 305 "tex2DRect" + Decorate 14(t2d) DescriptorSet 0 + Decorate 18(s) DescriptorSet 0 + Decorate 31(t3d) DescriptorSet 0 + Decorate 34(i) Flat + Decorate 41(sA) DescriptorSet 0 + Decorate 58(tex2D) DescriptorSet 0 + Decorate 64(texCube) DescriptorSet 0 + Decorate 71(texCubeArray) DescriptorSet 0 + Decorate 77(sShadow) DescriptorSet 0 + Decorate 84(itexCubeArray) DescriptorSet 0 + Decorate 91(utexCubeArray) DescriptorSet 0 + Decorate 98(tex1DArray) DescriptorSet 0 + Decorate 106(itex1DArray) DescriptorSet 0 + Decorate 113(utex1D) DescriptorSet 0 + Decorate 120(itex1D) DescriptorSet 0 + Decorate 127(utex1DArray) DescriptorSet 0 + Decorate 134(texBuffer) DescriptorSet 0 + Decorate 146(tex2DArray) DescriptorSet 0 + Decorate 158(itex2D) DescriptorSet 0 + Decorate 165(itex3D) DescriptorSet 0 + Decorate 172(itexCube) DescriptorSet 0 + Decorate 179(itex2DArray) DescriptorSet 0 + Decorate 186(utex2D) DescriptorSet 0 + Decorate 193(utex3D) DescriptorSet 0 + Decorate 200(utexCube) DescriptorSet 0 + Decorate 207(utex2DArray) DescriptorSet 0 + Decorate 214(itex2DRect) DescriptorSet 0 + Decorate 221(utex2DRect) DescriptorSet 0 + Decorate 228(itexBuffer) DescriptorSet 0 + Decorate 235(utexBuffer) DescriptorSet 0 + Decorate 242(tex2DMS) DescriptorSet 0 + Decorate 249(itex2DMS) DescriptorSet 0 + Decorate 256(utex2DMS) DescriptorSet 0 + Decorate 263(tex2DMSArray) DescriptorSet 0 + Decorate 270(itex2DMSArray) DescriptorSet 0 + Decorate 277(utex2DMSArray) DescriptorSet 0 + Decorate 284(tex1D) DescriptorSet 0 + Decorate 294(tex3D) DescriptorSet 0 + Decorate 305(tex2DRect) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypePointer Output 9(fvec4) + 11(color): 10(ptr) Variable Output + 12: TypeImage 8(float) 2D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(t2d): 13(ptr) Variable UniformConstant + 16: TypeSampler + 17: TypePointer UniformConstant 16 + 18(s): 17(ptr) Variable UniformConstant + 20: TypeSampledImage 12 + 22: TypeVector 8(float) 2 + 23: 8(float) Constant 1056964608 + 24: 22(fvec2) ConstantComposite 23 23 + 26: TypeImage 8(float) 3D sampled format:Unknown + 27: TypeInt 32 0 + 28: 27(int) Constant 4 + 29: TypeArray 26 28 + 30: TypePointer UniformConstant 29 + 31(t3d): 30(ptr) Variable UniformConstant + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(i): 33(ptr) Variable Input + 36: TypePointer UniformConstant 26 + 39: TypeArray 16 28 + 40: TypePointer UniformConstant 39 + 41(sA): 40(ptr) Variable UniformConstant + 42: 32(int) Constant 2 + 45: TypeSampledImage 26 + 47: TypeVector 8(float) 3 + 48: 47(fvec3) ConstantComposite 23 23 23 + 58(tex2D): 13(ptr) Variable UniformConstant + 62: TypeImage 8(float) Cube sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(texCube): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: TypeImage 8(float) Cube array sampled format:Unknown + 70: TypePointer UniformConstant 69 +71(texCubeArray): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 77(sShadow): 17(ptr) Variable UniformConstant + 79: TypeImage 8(float) Cube depth array sampled format:Unknown + 80: TypeSampledImage 79 + 82: TypeImage 32(int) Cube array sampled format:Unknown + 83: TypePointer UniformConstant 82 +84(itexCubeArray): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: TypeImage 27(int) Cube array sampled format:Unknown + 90: TypePointer UniformConstant 89 +91(utexCubeArray): 90(ptr) Variable UniformConstant + 94: TypeSampledImage 89 + 96: TypeImage 8(float) 1D array sampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(tex1DArray): 97(ptr) Variable UniformConstant + 101: TypeImage 8(float) 1D depth array sampled format:Unknown + 102: TypeSampledImage 101 + 104: TypeImage 32(int) 1D array sampled format:Unknown + 105: TypePointer UniformConstant 104 +106(itex1DArray): 105(ptr) Variable UniformConstant + 109: TypeSampledImage 104 + 111: TypeImage 27(int) 1D sampled format:Unknown + 112: TypePointer UniformConstant 111 + 113(utex1D): 112(ptr) Variable UniformConstant + 116: TypeSampledImage 111 + 118: TypeImage 32(int) 1D sampled format:Unknown + 119: TypePointer UniformConstant 118 + 120(itex1D): 119(ptr) Variable UniformConstant + 123: TypeSampledImage 118 + 125: TypeImage 27(int) 1D array sampled format:Unknown + 126: TypePointer UniformConstant 125 +127(utex1DArray): 126(ptr) Variable UniformConstant + 130: TypeSampledImage 125 + 132: TypeImage 8(float) Buffer sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(texBuffer): 133(ptr) Variable UniformConstant + 137: TypeSampledImage 132 + 141: TypeImage 8(float) Cube depth sampled format:Unknown + 142: TypeSampledImage 141 + 144: TypeImage 8(float) 2D array sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(tex2DArray): 145(ptr) Variable UniformConstant + 149: TypeSampledImage 144 + 153: TypeImage 8(float) 2D depth array sampled format:Unknown + 154: TypeSampledImage 153 + 156: TypeImage 32(int) 2D sampled format:Unknown + 157: TypePointer UniformConstant 156 + 158(itex2D): 157(ptr) Variable UniformConstant + 161: TypeSampledImage 156 + 163: TypeImage 32(int) 3D sampled format:Unknown + 164: TypePointer UniformConstant 163 + 165(itex3D): 164(ptr) Variable UniformConstant + 168: TypeSampledImage 163 + 170: TypeImage 32(int) Cube sampled format:Unknown + 171: TypePointer UniformConstant 170 + 172(itexCube): 171(ptr) Variable UniformConstant + 175: TypeSampledImage 170 + 177: TypeImage 32(int) 2D array sampled format:Unknown + 178: TypePointer UniformConstant 177 +179(itex2DArray): 178(ptr) Variable UniformConstant + 182: TypeSampledImage 177 + 184: TypeImage 27(int) 2D sampled format:Unknown + 185: TypePointer UniformConstant 184 + 186(utex2D): 185(ptr) Variable UniformConstant + 189: TypeSampledImage 184 + 191: TypeImage 27(int) 3D sampled format:Unknown + 192: TypePointer UniformConstant 191 + 193(utex3D): 192(ptr) Variable UniformConstant + 196: TypeSampledImage 191 + 198: TypeImage 27(int) Cube sampled format:Unknown + 199: TypePointer UniformConstant 198 + 200(utexCube): 199(ptr) Variable UniformConstant + 203: TypeSampledImage 198 + 205: TypeImage 27(int) 2D array sampled format:Unknown + 206: TypePointer UniformConstant 205 +207(utex2DArray): 206(ptr) Variable UniformConstant + 210: TypeSampledImage 205 + 212: TypeImage 32(int) Rect sampled format:Unknown + 213: TypePointer UniformConstant 212 + 214(itex2DRect): 213(ptr) Variable UniformConstant + 217: TypeSampledImage 212 + 219: TypeImage 27(int) Rect sampled format:Unknown + 220: TypePointer UniformConstant 219 + 221(utex2DRect): 220(ptr) Variable UniformConstant + 224: TypeSampledImage 219 + 226: TypeImage 32(int) Buffer sampled format:Unknown + 227: TypePointer UniformConstant 226 + 228(itexBuffer): 227(ptr) Variable UniformConstant + 231: TypeSampledImage 226 + 233: TypeImage 27(int) Buffer sampled format:Unknown + 234: TypePointer UniformConstant 233 + 235(utexBuffer): 234(ptr) Variable UniformConstant + 238: TypeSampledImage 233 + 240: TypeImage 8(float) 2D multi-sampled sampled format:Unknown + 241: TypePointer UniformConstant 240 + 242(tex2DMS): 241(ptr) Variable UniformConstant + 245: TypeSampledImage 240 + 247: TypeImage 32(int) 2D multi-sampled sampled format:Unknown + 248: TypePointer UniformConstant 247 + 249(itex2DMS): 248(ptr) Variable UniformConstant + 252: TypeSampledImage 247 + 254: TypeImage 27(int) 2D multi-sampled sampled format:Unknown + 255: TypePointer UniformConstant 254 + 256(utex2DMS): 255(ptr) Variable UniformConstant + 259: TypeSampledImage 254 + 261: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown + 262: TypePointer UniformConstant 261 +263(tex2DMSArray): 262(ptr) Variable UniformConstant + 266: TypeSampledImage 261 + 268: TypeImage 32(int) 2D array multi-sampled sampled format:Unknown + 269: TypePointer UniformConstant 268 +270(itex2DMSArray): 269(ptr) Variable UniformConstant + 273: TypeSampledImage 268 + 275: TypeImage 27(int) 2D array multi-sampled sampled format:Unknown + 276: TypePointer UniformConstant 275 +277(utex2DMSArray): 276(ptr) Variable UniformConstant + 280: TypeSampledImage 275 + 282: TypeImage 8(float) 1D sampled format:Unknown + 283: TypePointer UniformConstant 282 + 284(tex1D): 283(ptr) Variable UniformConstant + 287: TypeSampledImage 282 + 291: TypeImage 8(float) 1D depth sampled format:Unknown + 292: TypeSampledImage 291 + 294(tex3D): 36(ptr) Variable UniformConstant + 300: TypeImage 8(float) 2D depth sampled format:Unknown + 301: TypeSampledImage 300 + 303: TypeImage 8(float) Rect sampled format:Unknown + 304: TypePointer UniformConstant 303 + 305(tex2DRect): 304(ptr) Variable UniformConstant + 308: TypeSampledImage 303 + 312: TypeImage 8(float) Rect depth sampled format:Unknown + 313: TypeSampledImage 312 + 317: TypeSampledImage 96 + 4(main): 2 Function None 3 + 5: Label + 15: 12 Load 14(t2d) + 19: 16 Load 18(s) + 21: 20 SampledImage 15 19 + 25: 9(fvec4) ImageSampleImplicitLod 21 24 + Store 11(color) 25 + 35: 32(int) Load 34(i) + 37: 36(ptr) AccessChain 31(t3d) 35 + 38: 26 Load 37 + 43: 17(ptr) AccessChain 41(sA) 42 + 44: 16 Load 43 + 46: 45 SampledImage 38 44 + 49: 9(fvec4) ImageSampleImplicitLod 46 48 + 50: 9(fvec4) Load 11(color) + 51: 9(fvec4) FAdd 50 49 + Store 11(color) 51 + 52: 12 Load 14(t2d) + 53: 16 Load 18(s) + 54: 20 SampledImage 52 53 + 55: 9(fvec4) ImageSampleImplicitLod 54 24 + 56: 9(fvec4) Load 11(color) + 57: 9(fvec4) FAdd 56 55 + Store 11(color) 57 + Return + FunctionEnd + 6(foo(): 2 Function None 3 + 7: Label + 59: 12 Load 58(tex2D) + 60: 16 Load 18(s) + 61: 20 SampledImage 59 60 + 65: 62 Load 64(texCube) + 66: 16 Load 18(s) + 68: 67 SampledImage 65 66 + 72: 69 Load 71(texCubeArray) + 73: 16 Load 18(s) + 75: 74 SampledImage 72 73 + 76: 69 Load 71(texCubeArray) + 78: 16 Load 77(sShadow) + 81: 80 SampledImage 76 78 + 85: 82 Load 84(itexCubeArray) + 86: 16 Load 18(s) + 88: 87 SampledImage 85 86 + 92: 89 Load 91(utexCubeArray) + 93: 16 Load 18(s) + 95: 94 SampledImage 92 93 + 99: 96 Load 98(tex1DArray) + 100: 16 Load 77(sShadow) + 103: 102 SampledImage 99 100 + 107: 104 Load 106(itex1DArray) + 108: 16 Load 18(s) + 110: 109 SampledImage 107 108 + 114: 111 Load 113(utex1D) + 115: 16 Load 18(s) + 117: 116 SampledImage 114 115 + 121: 118 Load 120(itex1D) + 122: 16 Load 18(s) + 124: 123 SampledImage 121 122 + 128: 125 Load 127(utex1DArray) + 129: 16 Load 18(s) + 131: 130 SampledImage 128 129 + 135: 132 Load 134(texBuffer) + 136: 16 Load 18(s) + 138: 137 SampledImage 135 136 + 139: 62 Load 64(texCube) + 140: 16 Load 77(sShadow) + 143: 142 SampledImage 139 140 + 147: 144 Load 146(tex2DArray) + 148: 16 Load 18(s) + 150: 149 SampledImage 147 148 + 151: 144 Load 146(tex2DArray) + 152: 16 Load 77(sShadow) + 155: 154 SampledImage 151 152 + 159: 156 Load 158(itex2D) + 160: 16 Load 18(s) + 162: 161 SampledImage 159 160 + 166: 163 Load 165(itex3D) + 167: 16 Load 18(s) + 169: 168 SampledImage 166 167 + 173: 170 Load 172(itexCube) + 174: 16 Load 18(s) + 176: 175 SampledImage 173 174 + 180: 177 Load 179(itex2DArray) + 181: 16 Load 18(s) + 183: 182 SampledImage 180 181 + 187: 184 Load 186(utex2D) + 188: 16 Load 18(s) + 190: 189 SampledImage 187 188 + 194: 191 Load 193(utex3D) + 195: 16 Load 18(s) + 197: 196 SampledImage 194 195 + 201: 198 Load 200(utexCube) + 202: 16 Load 18(s) + 204: 203 SampledImage 201 202 + 208: 205 Load 207(utex2DArray) + 209: 16 Load 18(s) + 211: 210 SampledImage 208 209 + 215: 212 Load 214(itex2DRect) + 216: 16 Load 18(s) + 218: 217 SampledImage 215 216 + 222: 219 Load 221(utex2DRect) + 223: 16 Load 18(s) + 225: 224 SampledImage 222 223 + 229: 226 Load 228(itexBuffer) + 230: 16 Load 18(s) + 232: 231 SampledImage 229 230 + 236: 233 Load 235(utexBuffer) + 237: 16 Load 18(s) + 239: 238 SampledImage 236 237 + 243: 240 Load 242(tex2DMS) + 244: 16 Load 18(s) + 246: 245 SampledImage 243 244 + 250: 247 Load 249(itex2DMS) + 251: 16 Load 18(s) + 253: 252 SampledImage 250 251 + 257: 254 Load 256(utex2DMS) + 258: 16 Load 18(s) + 260: 259 SampledImage 257 258 + 264: 261 Load 263(tex2DMSArray) + 265: 16 Load 18(s) + 267: 266 SampledImage 264 265 + 271: 268 Load 270(itex2DMSArray) + 272: 16 Load 18(s) + 274: 273 SampledImage 271 272 + 278: 275 Load 277(utex2DMSArray) + 279: 16 Load 18(s) + 281: 280 SampledImage 278 279 + 285: 282 Load 284(tex1D) + 286: 16 Load 18(s) + 288: 287 SampledImage 285 286 + 289: 282 Load 284(tex1D) + 290: 16 Load 77(sShadow) + 293: 292 SampledImage 289 290 + 295: 26 Load 294(tex3D) + 296: 16 Load 18(s) + 297: 45 SampledImage 295 296 + 298: 12 Load 58(tex2D) + 299: 16 Load 77(sShadow) + 302: 301 SampledImage 298 299 + 306: 303 Load 305(tex2DRect) + 307: 16 Load 18(s) + 309: 308 SampledImage 306 307 + 310: 303 Load 305(tex2DRect) + 311: 16 Load 77(sShadow) + 314: 313 SampledImage 310 311 + 315: 96 Load 98(tex1DArray) + 316: 16 Load 18(s) + 318: 317 SampledImage 315 316 + Return + FunctionEnd diff --git a/Test/baseResults/spv.set.vert.out b/Test/baseResults/spv.set.vert.out index 9448bca8..72fbaa70 100755 --- a/Test/baseResults/spv.set.vert.out +++ b/Test/baseResults/spv.set.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 22 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 23 24 + EntryPoint Vertex 4 "main" 9 Source GLSL 450 Name 4 "main" Name 9 "color" @@ -20,16 +20,12 @@ Linked vertex stage: MemberName 10(setBuf) 0 "color" Name 12 "setBufInst" Name 21 "samp2D" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" - Decorate 10(setBuf) GLSLShared + MemberDecorate 10(setBuf) 0 Offset 0 Decorate 10(setBuf) BufferBlock Decorate 12(setBufInst) DescriptorSet 0 Decorate 12(setBufInst) Binding 8 Decorate 21(samp2D) DescriptorSet 4 Decorate 21(samp2D) Binding 7 - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,9 +42,6 @@ Linked vertex stage: 19: TypeSampledImage 18 20: TypePointer UniformConstant 19 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 4(main): 2 Function None 3 5: Label 16: 15(ptr) AccessChain 12(setBufInst) 14 diff --git a/Test/baseResults/spv.shiftOps.frag.out b/Test/baseResults/spv.shiftOps.frag.out index 891d6899..39e40ece 100644 --- a/Test/baseResults/spv.shiftOps.frag.out +++ b/Test/baseResults/spv.shiftOps.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 9 25 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 9 11 15 25 27 30 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "icolor" @@ -22,25 +22,29 @@ Linked fragment stage: Name 25 "ucolor" Name 27 "u3" Name 30 "i1" + Decorate 11(i3) Flat + Decorate 15(u1) Flat + Decorate 27(u3) Flat + Decorate 30(i1) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypeVector 6(int) 3 8: TypePointer Output 7(ivec3) 9(icolor): 8(ptr) Variable Output - 10: TypePointer UniformConstant 7(ivec3) - 11(i3): 10(ptr) Variable UniformConstant + 10: TypePointer Input 7(ivec3) + 11(i3): 10(ptr) Variable Input 13: TypeInt 32 0 - 14: TypePointer UniformConstant 13(int) - 15(u1): 14(ptr) Variable UniformConstant + 14: TypePointer Input 13(int) + 15(u1): 14(ptr) Variable Input 17: TypeVector 13(int) 3 20: 13(int) Constant 4 24: TypePointer Output 17(ivec3) 25(ucolor): 24(ptr) Variable Output - 26: TypePointer UniformConstant 17(ivec3) - 27(u3): 26(ptr) Variable UniformConstant - 29: TypePointer UniformConstant 6(int) - 30(i1): 29(ptr) Variable UniformConstant + 26: TypePointer Input 17(ivec3) + 27(u3): 26(ptr) Variable Input + 29: TypePointer Input 6(int) + 30(i1): 29(ptr) Variable Input 34: 6(int) Constant 5 4(main): 2 Function None 3 5: Label diff --git a/Test/baseResults/spv.shortCircuit.frag.out b/Test/baseResults/spv.shortCircuit.frag.out index bbe719f9..5b39b1cb 100644 --- a/Test/baseResults/spv.shortCircuit.frag.out +++ b/Test/baseResults/spv.shortCircuit.frag.out @@ -7,26 +7,28 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 143 +// Id's are bound by 147 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 23 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 12 24 34 113 140 142 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 8 "foo(" Name 12 "of1" - Name 23 "of4" - Name 26 "ub" - Name 30 "ui" - Name 40 "uba" - Name 109 "uf" - Name 136 "uiv4" - Name 138 "uv4" - Name 141 "ub41" - Name 142 "ub42" + Name 24 "of4" + Name 27 "ub" + Name 34 "ui" + Name 44 "uba" + Name 113 "uf" + Name 140 "uiv4" + Name 142 "uv4" + Name 145 "ub41" + Name 146 "ub42" + Decorate 34(ui) Flat + Decorate 140(uiv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -36,190 +38,196 @@ Linked fragment stage: 12(of1): 11(ptr) Variable Output 14: 10(float) Constant 1065353216 17: 10(float) Constant 1092616192 - 20: 10(float) Constant 0 - 21: TypeVector 10(float) 4 - 22: TypePointer Output 21(fvec4) - 23(of4): 22(ptr) Variable Output - 24: 21(fvec4) ConstantComposite 20 20 20 20 - 25: TypePointer UniformConstant 6(bool) - 26(ub): 25(ptr) Variable UniformConstant - 28: TypeInt 32 1 - 29: TypePointer UniformConstant 28(int) - 30(ui): 29(ptr) Variable UniformConstant - 32: 28(int) Constant 2 - 40(uba): 25(ptr) Variable UniformConstant - 108: TypePointer UniformConstant 10(float) - 109(uf): 108(ptr) Variable UniformConstant - 112: 10(float) Constant 1082130432 - 134: TypeVector 28(int) 4 - 135: TypePointer UniformConstant 134(ivec4) - 136(uiv4): 135(ptr) Variable UniformConstant - 137: TypePointer UniformConstant 21(fvec4) - 138(uv4): 137(ptr) Variable UniformConstant - 139: TypeVector 6(bool) 4 - 140: TypePointer UniformConstant 139(bvec4) - 141(ub41): 140(ptr) Variable UniformConstant - 142(ub42): 140(ptr) Variable UniformConstant + 21: 10(float) Constant 0 + 22: TypeVector 10(float) 4 + 23: TypePointer Output 22(fvec4) + 24(of4): 23(ptr) Variable Output + 25: 22(fvec4) ConstantComposite 21 21 21 21 + 26: TypePointer Private 6(bool) + 27(ub): 26(ptr) Variable Private + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(ui): 33(ptr) Variable Input + 36: 32(int) Constant 2 + 44(uba): 26(ptr) Variable Private + 112: TypePointer Input 10(float) + 113(uf): 112(ptr) Variable Input + 116: 10(float) Constant 1082130432 + 138: TypeVector 32(int) 4 + 139: TypePointer Input 138(ivec4) + 140(uiv4): 139(ptr) Variable Input + 141: TypePointer Input 22(fvec4) + 142(uv4): 141(ptr) Variable Input + 143: TypeVector 6(bool) 4 + 144: TypePointer Private 143(bvec4) + 145(ub41): 144(ptr) Variable Private + 146(ub42): 144(ptr) Variable Private 4(main): 2 Function None 3 5: Label - Store 12(of1) 20 - Store 23(of4) 24 - 27: 6(bool) Load 26(ub) - 31: 28(int) Load 30(ui) - 33: 6(bool) SGreaterThan 31 32 - 34: 6(bool) LogicalOr 27 33 - SelectionMerge 36 None - BranchConditional 34 35 36 - 35: Label - 37: 10(float) Load 12(of1) - 38: 10(float) FAdd 37 14 - Store 12(of1) 38 - Branch 36 - 36: Label - 39: 6(bool) Load 26(ub) - 41: 6(bool) Load 40(uba) - 42: 6(bool) LogicalNot 41 - 43: 6(bool) LogicalAnd 39 42 - SelectionMerge 45 None - BranchConditional 43 44 45 - 44: Label - 46: 10(float) Load 12(of1) - 47: 10(float) FAdd 46 14 - Store 12(of1) 47 - Branch 45 - 45: Label - 48: 6(bool) Load 26(ub) - 49: 6(bool) LogicalNot 48 - SelectionMerge 51 None - BranchConditional 49 50 51 - 50: Label - 52: 6(bool) FunctionCall 8(foo() - Branch 51 - 51: Label - 53: 6(bool) Phi 48 45 52 50 + Store 12(of1) 21 + Store 24(of4) 25 + 28: 6(bool) Load 27(ub) + 29: 6(bool) LogicalNot 28 + SelectionMerge 31 None + BranchConditional 29 30 31 + 30: Label + 35: 32(int) Load 34(ui) + 37: 6(bool) SGreaterThan 35 36 + Branch 31 + 31: Label + 38: 6(bool) Phi 28 5 37 30 + SelectionMerge 40 None + BranchConditional 38 39 40 + 39: Label + 41: 10(float) Load 12(of1) + 42: 10(float) FAdd 41 14 + Store 12(of1) 42 + Branch 40 + 40: Label + 43: 6(bool) Load 27(ub) + 45: 6(bool) Load 44(uba) + 46: 6(bool) LogicalNot 45 + 47: 6(bool) LogicalAnd 43 46 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 10(float) Load 12(of1) + 51: 10(float) FAdd 50 14 + Store 12(of1) 51 + Branch 49 + 49: Label + 52: 6(bool) Load 27(ub) + 53: 6(bool) LogicalNot 52 SelectionMerge 55 None BranchConditional 53 54 55 54: Label - 56: 10(float) Load 12(of1) - 57: 10(float) FAdd 56 14 - Store 12(of1) 57 + 56: 6(bool) FunctionCall 8(foo() Branch 55 55: Label - 58: 6(bool) Load 26(ub) - SelectionMerge 60 None - BranchConditional 58 59 60 - 59: Label - 61: 6(bool) FunctionCall 8(foo() - Branch 60 - 60: Label - 62: 6(bool) Phi 58 55 61 59 + 57: 6(bool) Phi 52 49 56 54 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 60: 10(float) Load 12(of1) + 61: 10(float) FAdd 60 14 + Store 12(of1) 61 + Branch 59 + 59: Label + 62: 6(bool) Load 27(ub) SelectionMerge 64 None BranchConditional 62 63 64 63: Label - 65: 10(float) Load 12(of1) - 66: 10(float) FAdd 65 14 - Store 12(of1) 66 + 65: 6(bool) FunctionCall 8(foo() Branch 64 64: Label - 67: 6(bool) FunctionCall 8(foo() - 68: 6(bool) Load 26(ub) - 69: 6(bool) LogicalOr 67 68 - SelectionMerge 71 None - BranchConditional 69 70 71 - 70: Label - 72: 10(float) Load 12(of1) - 73: 10(float) FAdd 72 14 - Store 12(of1) 73 - Branch 71 - 71: Label - 74: 6(bool) FunctionCall 8(foo() - 75: 6(bool) Load 26(ub) - 76: 6(bool) LogicalAnd 74 75 - SelectionMerge 78 None - BranchConditional 76 77 78 - 77: Label - 79: 10(float) Load 12(of1) - 80: 10(float) FAdd 79 14 - Store 12(of1) 80 - Branch 78 - 78: Label - 81: 6(bool) Load 26(ub) - 82: 6(bool) LogicalNot 81 - SelectionMerge 84 None - BranchConditional 82 83 84 - 83: Label - 85: 10(float) Load 12(of1) - 86: 10(float) FAdd 85 14 - Store 12(of1) 86 - 87: 6(bool) FOrdGreaterThan 86 14 - Branch 84 - 84: Label - 88: 6(bool) Phi 81 78 87 83 - SelectionMerge 90 None - BranchConditional 88 89 90 - 89: Label - 91: 21(fvec4) Load 23(of4) - 92: 21(fvec4) CompositeConstruct 14 14 14 14 - 93: 21(fvec4) FAdd 91 92 - Store 23(of4) 93 - Branch 90 - 90: Label - 94: 10(float) Load 12(of1) - 95: 10(float) FAdd 94 14 - Store 12(of1) 95 - 96: 6(bool) FOrdGreaterThan 95 14 - 97: 6(bool) Load 26(ub) - 98: 6(bool) LogicalOr 96 97 - SelectionMerge 100 None - BranchConditional 98 99 100 - 99: Label - 101: 21(fvec4) Load 23(of4) - 102: 21(fvec4) CompositeConstruct 14 14 14 14 - 103: 21(fvec4) FAdd 101 102 - Store 23(of4) 103 - Branch 100 - 100: Label - 104: 6(bool) Load 26(ub) - 105: 6(bool) LogicalNot 104 - SelectionMerge 107 None - BranchConditional 105 106 107 - 106: Label - 110: 10(float) Load 109(uf) - 111: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 110 - 113: 10(float) FMul 111 112 - 114: 10(float) Load 12(of1) - 115: 6(bool) FOrdGreaterThan 113 114 - Branch 107 - 107: Label - 116: 6(bool) Phi 104 100 115 106 - SelectionMerge 118 None - BranchConditional 116 117 118 - 117: Label - 119: 10(float) Load 12(of1) - 120: 10(float) FAdd 119 14 - Store 12(of1) 120 - Branch 118 - 118: Label - 121: 6(bool) Load 26(ub) - SelectionMerge 123 None - BranchConditional 121 122 123 - 122: Label - 124: 10(float) Load 109(uf) - 125: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 124 - 126: 10(float) FMul 125 112 - 127: 10(float) Load 12(of1) - 128: 6(bool) FOrdGreaterThan 126 127 - Branch 123 - 123: Label - 129: 6(bool) Phi 121 118 128 122 - SelectionMerge 131 None - BranchConditional 129 130 131 - 130: Label - 132: 10(float) Load 12(of1) - 133: 10(float) FAdd 132 14 - Store 12(of1) 133 - Branch 131 - 131: Label + 66: 6(bool) Phi 62 59 65 63 + SelectionMerge 68 None + BranchConditional 66 67 68 + 67: Label + 69: 10(float) Load 12(of1) + 70: 10(float) FAdd 69 14 + Store 12(of1) 70 + Branch 68 + 68: Label + 71: 6(bool) FunctionCall 8(foo() + 72: 6(bool) Load 27(ub) + 73: 6(bool) LogicalOr 71 72 + SelectionMerge 75 None + BranchConditional 73 74 75 + 74: Label + 76: 10(float) Load 12(of1) + 77: 10(float) FAdd 76 14 + Store 12(of1) 77 + Branch 75 + 75: Label + 78: 6(bool) FunctionCall 8(foo() + 79: 6(bool) Load 27(ub) + 80: 6(bool) LogicalAnd 78 79 + SelectionMerge 82 None + BranchConditional 80 81 82 + 81: Label + 83: 10(float) Load 12(of1) + 84: 10(float) FAdd 83 14 + Store 12(of1) 84 + Branch 82 + 82: Label + 85: 6(bool) Load 27(ub) + 86: 6(bool) LogicalNot 85 + SelectionMerge 88 None + BranchConditional 86 87 88 + 87: Label + 89: 10(float) Load 12(of1) + 90: 10(float) FAdd 89 14 + Store 12(of1) 90 + 91: 6(bool) FOrdGreaterThan 90 14 + Branch 88 + 88: Label + 92: 6(bool) Phi 85 82 91 87 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 22(fvec4) Load 24(of4) + 96: 22(fvec4) CompositeConstruct 14 14 14 14 + 97: 22(fvec4) FAdd 95 96 + Store 24(of4) 97 + Branch 94 + 94: Label + 98: 10(float) Load 12(of1) + 99: 10(float) FAdd 98 14 + Store 12(of1) 99 + 100: 6(bool) FOrdGreaterThan 99 14 + 101: 6(bool) Load 27(ub) + 102: 6(bool) LogicalOr 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 22(fvec4) Load 24(of4) + 106: 22(fvec4) CompositeConstruct 14 14 14 14 + 107: 22(fvec4) FAdd 105 106 + Store 24(of4) 107 + Branch 104 + 104: Label + 108: 6(bool) Load 27(ub) + 109: 6(bool) LogicalNot 108 + SelectionMerge 111 None + BranchConditional 109 110 111 + 110: Label + 114: 10(float) Load 113(uf) + 115: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 114 + 117: 10(float) FMul 115 116 + 118: 10(float) Load 12(of1) + 119: 6(bool) FOrdGreaterThan 117 118 + Branch 111 + 111: Label + 120: 6(bool) Phi 108 104 119 110 + SelectionMerge 122 None + BranchConditional 120 121 122 + 121: Label + 123: 10(float) Load 12(of1) + 124: 10(float) FAdd 123 14 + Store 12(of1) 124 + Branch 122 + 122: Label + 125: 6(bool) Load 27(ub) + SelectionMerge 127 None + BranchConditional 125 126 127 + 126: Label + 128: 10(float) Load 113(uf) + 129: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 128 + 130: 10(float) FMul 129 116 + 131: 10(float) Load 12(of1) + 132: 6(bool) FOrdGreaterThan 130 131 + Branch 127 + 127: Label + 133: 6(bool) Phi 125 122 132 126 + SelectionMerge 135 None + BranchConditional 133 134 135 + 134: Label + 136: 10(float) Load 12(of1) + 137: 10(float) FAdd 136 14 + Store 12(of1) 137 + Branch 135 + 135: Label Return FunctionEnd 8(foo(): 6(bool) Function None 7 diff --git a/Test/baseResults/spv.simpleFunctionCall.frag.out b/Test/baseResults/spv.simpleFunctionCall.frag.out index 1a41f6ad..458a90db 100755 --- a/Test/baseResults/spv.simpleFunctionCall.frag.out +++ b/Test/baseResults/spv.simpleFunctionCall.frag.out @@ -1,26 +1,22 @@ spv.simpleFunctionCall.frag -WARNING: 0:4: varying deprecated in version 130; may be removed in future release - Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 22 +// Id's are bound by 19 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 16 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 12 17 + ExecutionMode 4 OriginUpperLeft Source GLSL 150 Name 4 "main" Name 9 "foo(" Name 12 "BaseColor" - Name 16 "gl_FragColor" - Name 19 "bigColor" - Name 21 "d" + Name 17 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -28,16 +24,12 @@ Linked fragment stage: 8: TypeFunction 7(fvec4) 11: TypePointer Input 7(fvec4) 12(BaseColor): 11(ptr) Variable Input - 15: TypePointer Output 7(fvec4) -16(gl_FragColor): 15(ptr) Variable Output - 18: TypePointer UniformConstant 7(fvec4) - 19(bigColor): 18(ptr) Variable UniformConstant - 20: TypePointer UniformConstant 6(float) - 21(d): 20(ptr) Variable UniformConstant + 16: TypePointer Output 7(fvec4) +17(gl_FragColor): 16(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 17: 7(fvec4) FunctionCall 9(foo() - Store 16(gl_FragColor) 17 + 18: 7(fvec4) FunctionCall 9(foo() + Store 17(gl_FragColor) 18 Return FunctionEnd 9(foo(): 7(fvec4) Function None 8 diff --git a/Test/baseResults/spv.simpleMat.vert.out b/Test/baseResults/spv.simpleMat.vert.out index 042aa9d9..3e0f05e1 100755 --- a/Test/baseResults/spv.simpleMat.vert.out +++ b/Test/baseResults/spv.simpleMat.vert.out @@ -1,16 +1,18 @@ spv.simpleMat.vert +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 42 +// Id's are bound by 39 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 15 19 23 34 40 41 + EntryPoint Vertex 4 "main" 9 12 15 19 23 34 Source GLSL 330 Name 4 "main" Name 9 "glPos" @@ -19,10 +21,6 @@ Linked vertex stage: Name 19 "f" Name 23 "am3" Name 34 "arraym" - 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 @@ -30,8 +28,8 @@ Linked vertex stage: 8: TypePointer Output 7(fvec4) 9(glPos): 8(ptr) Variable Output 10: TypeMatrix 7(fvec4) 4 - 11: TypePointer UniformConstant 10 - 12(mvp): 11(ptr) Variable UniformConstant + 11: TypePointer Output 10 + 12(mvp): 11(ptr) Variable Output 14: TypePointer Input 7(fvec4) 15(v): 14(ptr) Variable Input 18: TypePointer Output 6(float) @@ -50,9 +48,6 @@ Linked vertex stage: 33: TypePointer Input 32 34(arraym): 33(ptr) Variable Input 35: 24(int) Constant 1 - 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) diff --git a/Test/baseResults/spv.sparseTexture.frag.out b/Test/baseResults/spv.sparseTexture.frag.out new file mode 100644 index 00000000..315e1bb4 --- /dev/null +++ b/Test/baseResults/spv.sparseTexture.frag.out @@ -0,0 +1,588 @@ +spv.sparseTexture.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 433 + + Capability Shader + Capability SampledRect + Capability SparseResidency + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 48 89 360 388 400 418 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture2" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 35 "ResType" + Name 44 "s3D" + Name 48 "c3" + Name 59 "isCube" + Name 62 "ResType" + Name 71 "s2DShadow" + Name 77 "ResType" + Name 86 "sCubeArrayShadow" + Name 89 "c4" + Name 108 "usCubeArray" + Name 111 "ResType" + Name 140 "us2DRect" + Name 154 "s2DArrayShadow" + Name 186 "s2DMS" + Name 223 "is2DArray" + Name 256 "sCubeShadow" + Name 289 "s2DRectShadow" + Name 360 "offsets" + Name 385 "i2D" + Name 388 "ic2" + Name 397 "ii3D" + Name 400 "ic3" + Name 409 "i2DMS" + Name 418 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 44(s3D) DescriptorSet 0 + Decorate 59(isCube) DescriptorSet 0 + Decorate 71(s2DShadow) DescriptorSet 0 + Decorate 86(sCubeArrayShadow) DescriptorSet 0 + Decorate 108(usCubeArray) DescriptorSet 0 + Decorate 140(us2DRect) DescriptorSet 0 + Decorate 154(s2DArrayShadow) DescriptorSet 0 + Decorate 186(s2DMS) DescriptorSet 0 + Decorate 223(is2DArray) DescriptorSet 0 + Decorate 256(sCubeShadow) DescriptorSet 0 + Decorate 289(s2DRectShadow) DescriptorSet 0 + Decorate 360(offsets) Flat + Decorate 385(i2D) DescriptorSet 0 + Decorate 388(ic2) Flat + Decorate 397(ii3D) DescriptorSet 0 + Decorate 400(ic3) Flat + Decorate 409(i2DMS) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input + 35(ResType): TypeStruct 6(int) 11(fvec4) + 41: TypeImage 10(float) 3D sampled format:Unknown + 42: TypeSampledImage 41 + 43: TypePointer UniformConstant 42 + 44(s3D): 43(ptr) Variable UniformConstant + 46: TypeVector 10(float) 3 + 47: TypePointer Input 46(fvec3) + 48(c3): 47(ptr) Variable Input + 50: 10(float) Constant 1073741824 + 56: TypeImage 6(int) Cube sampled format:Unknown + 57: TypeSampledImage 56 + 58: TypePointer UniformConstant 57 + 59(isCube): 58(ptr) Variable UniformConstant + 62(ResType): TypeStruct 6(int) 16(ivec4) + 68: TypeImage 10(float) 2D depth sampled format:Unknown + 69: TypeSampledImage 68 + 70: TypePointer UniformConstant 69 + 71(s2DShadow): 70(ptr) Variable UniformConstant + 74: TypePointer Function 10(float) + 77(ResType): TypeStruct 6(int) 10(float) + 83: TypeImage 10(float) Cube depth array sampled format:Unknown + 84: TypeSampledImage 83 + 85: TypePointer UniformConstant 84 +86(sCubeArrayShadow): 85(ptr) Variable UniformConstant + 88: TypePointer Input 11(fvec4) + 89(c4): 88(ptr) Variable Input + 91: 10(float) Constant 1065353216 + 105: TypeImage 20(int) Cube array sampled format:Unknown + 106: TypeSampledImage 105 + 107: TypePointer UniformConstant 106 +108(usCubeArray): 107(ptr) Variable UniformConstant + 111(ResType): TypeStruct 6(int) 21(ivec4) + 119: 20(int) Constant 1 + 129: TypeVector 6(int) 3 + 130: 6(int) Constant 2 + 131: 129(ivec3) ConstantComposite 130 130 130 + 137: TypeImage 20(int) Rect sampled format:Unknown + 138: TypeSampledImage 137 + 139: TypePointer UniformConstant 138 + 140(us2DRect): 139(ptr) Variable UniformConstant + 143: TypeVector 6(int) 2 + 144: 6(int) Constant 3 + 145: 143(ivec2) ConstantComposite 144 144 + 151: TypeImage 10(float) 2D depth array sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 +154(s2DArrayShadow): 153(ptr) Variable UniformConstant + 157: 6(int) Constant 5 + 158: 143(ivec2) ConstantComposite 157 157 + 159: 20(int) Constant 2 + 183: TypeImage 10(float) 2D multi-sampled sampled format:Unknown + 184: TypeSampledImage 183 + 185: TypePointer UniformConstant 184 + 186(s2DMS): 185(ptr) Variable UniformConstant + 190: 6(int) Constant 4 + 199: 129(ivec3) ConstantComposite 190 190 190 + 220: TypeImage 6(int) 2D array sampled format:Unknown + 221: TypeSampledImage 220 + 222: TypePointer UniformConstant 221 + 223(is2DArray): 222(ptr) Variable UniformConstant + 226: 6(int) Constant 6 + 227: 143(ivec2) ConstantComposite 226 226 + 235: 6(int) Constant 7 + 236: 143(ivec2) ConstantComposite 235 235 + 253: TypeImage 10(float) Cube depth sampled format:Unknown + 254: TypeSampledImage 253 + 255: TypePointer UniformConstant 254 +256(sCubeShadow): 255(ptr) Variable UniformConstant + 286: TypeImage 10(float) Rect depth sampled format:Unknown + 287: TypeSampledImage 286 + 288: TypePointer UniformConstant 287 +289(s2DRectShadow): 288(ptr) Variable UniformConstant + 294: 20(int) Constant 3 + 306: 143(ivec2) ConstantComposite 130 130 + 335: 143(ivec2) ConstantComposite 190 190 + 357: 20(int) Constant 4 + 358: TypeArray 143(ivec2) 357 + 359: TypePointer Input 358 + 360(offsets): 359(ptr) Variable Input + 383: TypeImage 10(float) 2D nonsampled format:Rgba32f + 384: TypePointer UniformConstant 383 + 385(i2D): 384(ptr) Variable UniformConstant + 387: TypePointer Input 143(ivec2) + 388(ic2): 387(ptr) Variable Input + 395: TypeImage 6(int) 3D nonsampled format:Rgba32i + 396: TypePointer UniformConstant 395 + 397(ii3D): 396(ptr) Variable UniformConstant + 399: TypePointer Input 129(ivec3) + 400(ic3): 399(ptr) Variable Input + 407: TypeImage 10(float) 2D multi-sampled nonsampled format:Rgba32f + 408: TypePointer UniformConstant 407 + 409(i2DMS): 408(ptr) Variable UniformConstant + 417: TypePointer Output 11(fvec4) + 418(outColor): 417(ptr) Variable Output + 421: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 419: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 36: 35(ResType) ImageSparseSampleImplicitLod 30 34 + 37: 11(fvec4) CompositeExtract 36 1 + Store 13(texel) 37 + 38: 6(int) CompositeExtract 36 0 + 39: 6(int) Load 8(resident) + 40: 6(int) BitwiseOr 39 38 + Store 8(resident) 40 + 45: 42 Load 44(s3D) + 49: 46(fvec3) Load 48(c3) + 51: 35(ResType) ImageSparseSampleImplicitLod 45 49 Bias 50 + 52: 11(fvec4) CompositeExtract 51 1 + Store 13(texel) 52 + 53: 6(int) CompositeExtract 51 0 + 54: 6(int) Load 8(resident) + 55: 6(int) BitwiseOr 54 53 + Store 8(resident) 55 + 60: 57 Load 59(isCube) + 61: 46(fvec3) Load 48(c3) + 63: 62(ResType) ImageSparseSampleImplicitLod 60 61 + 64: 16(ivec4) CompositeExtract 63 1 + Store 18(itexel) 64 + 65: 6(int) CompositeExtract 63 0 + 66: 6(int) Load 8(resident) + 67: 6(int) BitwiseOr 66 65 + Store 8(resident) 67 + 72: 69 Load 71(s2DShadow) + 73: 46(fvec3) Load 48(c3) + 75: 74(ptr) AccessChain 13(texel) 24 + 76: 10(float) CompositeExtract 73 2 + 78: 77(ResType) ImageSparseSampleDrefImplicitLod 72 73 76 + 79: 10(float) CompositeExtract 78 1 + Store 75 79 + 80: 6(int) CompositeExtract 78 0 + 81: 6(int) Load 8(resident) + 82: 6(int) BitwiseOr 81 80 + Store 8(resident) 82 + 87: 84 Load 86(sCubeArrayShadow) + 90: 11(fvec4) Load 89(c4) + 92: 74(ptr) AccessChain 13(texel) 24 + 93: 77(ResType) ImageSparseSampleDrefImplicitLod 87 90 91 + 94: 10(float) CompositeExtract 93 1 + Store 92 94 + 95: 6(int) CompositeExtract 93 0 + 96: 6(int) Load 8(resident) + 97: 6(int) BitwiseOr 96 95 + Store 8(resident) 97 + 98: 27 Load 29(s2D) + 99: 31(fvec2) Load 33(c2) + 100: 35(ResType) ImageSparseSampleExplicitLod 98 99 Lod 50 + 101: 11(fvec4) CompositeExtract 100 1 + Store 13(texel) 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 109: 106 Load 108(usCubeArray) + 110: 11(fvec4) Load 89(c4) + 112:111(ResType) ImageSparseSampleExplicitLod 109 110 Lod 91 + 113: 21(ivec4) CompositeExtract 112 1 + Store 23(utexel) 113 + 114: 6(int) CompositeExtract 112 0 + 115: 6(int) Load 8(resident) + 116: 6(int) BitwiseOr 115 114 + Store 8(resident) 116 + 117: 69 Load 71(s2DShadow) + 118: 46(fvec3) Load 48(c3) + 120: 74(ptr) AccessChain 13(texel) 119 + 121: 10(float) CompositeExtract 118 2 + 122: 77(ResType) ImageSparseSampleDrefExplicitLod 117 118 121 Lod 50 + 123: 10(float) CompositeExtract 122 1 + Store 120 123 + 124: 6(int) CompositeExtract 122 0 + 125: 6(int) Load 8(resident) + 126: 6(int) BitwiseOr 125 124 + Store 8(resident) 126 + 127: 42 Load 44(s3D) + 128: 46(fvec3) Load 48(c3) + 132: 35(ResType) ImageSparseSampleImplicitLod 127 128 Bias ConstOffset 50 131 + 133: 11(fvec4) CompositeExtract 132 1 + Store 13(texel) 133 + 134: 6(int) CompositeExtract 132 0 + 135: 6(int) Load 8(resident) + 136: 6(int) BitwiseOr 135 134 + Store 8(resident) 136 + 141: 138 Load 140(us2DRect) + 142: 31(fvec2) Load 33(c2) + 146:111(ResType) ImageSparseSampleImplicitLod 141 142 ConstOffset 145 + 147: 21(ivec4) CompositeExtract 146 1 + Store 23(utexel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(s2DArrayShadow) + 156: 11(fvec4) Load 89(c4) + 160: 74(ptr) AccessChain 13(texel) 159 + 161: 10(float) CompositeExtract 156 3 + 162: 77(ResType) ImageSparseSampleDrefImplicitLod 155 156 161 ConstOffset 158 + 163: 10(float) CompositeExtract 162 1 + Store 160 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 167: 27 Load 29(s2D) + 168: 31(fvec2) Load 33(c2) + 169: 143(ivec2) ConvertFToS 168 + 170: 35(ResType) ImageSparseFetch 167 169 Lod 130 + 171: 11(fvec4) CompositeExtract 170 1 + Store 13(texel) 171 + 172: 6(int) CompositeExtract 170 0 + 173: 6(int) Load 8(resident) + 174: 6(int) BitwiseOr 173 172 + Store 8(resident) 174 + 175: 138 Load 140(us2DRect) + 176: 31(fvec2) Load 33(c2) + 177: 143(ivec2) ConvertFToS 176 + 178:111(ResType) ImageSparseFetch 175 177 + 179: 21(ivec4) CompositeExtract 178 1 + Store 23(utexel) 179 + 180: 6(int) CompositeExtract 178 0 + 181: 6(int) Load 8(resident) + 182: 6(int) BitwiseOr 181 180 + Store 8(resident) 182 + 187: 184 Load 186(s2DMS) + 188: 31(fvec2) Load 33(c2) + 189: 143(ivec2) ConvertFToS 188 + 191: 35(ResType) ImageSparseFetch 187 189 Sample 190 + 192: 11(fvec4) CompositeExtract 191 1 + Store 13(texel) 192 + 193: 6(int) CompositeExtract 191 0 + 194: 6(int) Load 8(resident) + 195: 6(int) BitwiseOr 194 193 + Store 8(resident) 195 + 196: 42 Load 44(s3D) + 197: 46(fvec3) Load 48(c3) + 198: 129(ivec3) ConvertFToS 197 + 200: 35(ResType) ImageSparseFetch 196 198 Lod ConstOffset 130 199 + 201: 11(fvec4) CompositeExtract 200 1 + Store 13(texel) 201 + 202: 6(int) CompositeExtract 200 0 + 203: 6(int) Load 8(resident) + 204: 6(int) BitwiseOr 203 202 + Store 8(resident) 204 + 205: 138 Load 140(us2DRect) + 206: 31(fvec2) Load 33(c2) + 207: 143(ivec2) ConvertFToS 206 + 208:111(ResType) ImageSparseFetch 205 207 ConstOffset 145 + 209: 21(ivec4) CompositeExtract 208 1 + Store 23(utexel) 209 + 210: 6(int) CompositeExtract 208 0 + 211: 6(int) Load 8(resident) + 212: 6(int) BitwiseOr 211 210 + Store 8(resident) 212 + 213: 27 Load 29(s2D) + 214: 31(fvec2) Load 33(c2) + 215: 35(ResType) ImageSparseSampleExplicitLod 213 214 Lod ConstOffset 50 158 + 216: 11(fvec4) CompositeExtract 215 1 + Store 13(texel) 216 + 217: 6(int) CompositeExtract 215 0 + 218: 6(int) Load 8(resident) + 219: 6(int) BitwiseOr 218 217 + Store 8(resident) 219 + 224: 221 Load 223(is2DArray) + 225: 46(fvec3) Load 48(c3) + 228: 62(ResType) ImageSparseSampleExplicitLod 224 225 Lod ConstOffset 50 227 + 229: 16(ivec4) CompositeExtract 228 1 + Store 18(itexel) 229 + 230: 6(int) CompositeExtract 228 0 + 231: 6(int) Load 8(resident) + 232: 6(int) BitwiseOr 231 230 + Store 8(resident) 232 + 233: 69 Load 71(s2DShadow) + 234: 46(fvec3) Load 48(c3) + 237: 74(ptr) AccessChain 13(texel) 159 + 238: 10(float) CompositeExtract 234 2 + 239: 77(ResType) ImageSparseSampleDrefExplicitLod 233 234 238 Lod ConstOffset 50 236 + 240: 10(float) CompositeExtract 239 1 + Store 237 240 + 241: 6(int) CompositeExtract 239 0 + 242: 6(int) Load 8(resident) + 243: 6(int) BitwiseOr 242 241 + Store 8(resident) 243 + 244: 42 Load 44(s3D) + 245: 46(fvec3) Load 48(c3) + 246: 46(fvec3) Load 48(c3) + 247: 46(fvec3) Load 48(c3) + 248: 35(ResType) ImageSparseSampleExplicitLod 244 245 Grad 246 247 + 249: 11(fvec4) CompositeExtract 248 1 + Store 13(texel) 249 + 250: 6(int) CompositeExtract 248 0 + 251: 6(int) Load 8(resident) + 252: 6(int) BitwiseOr 251 250 + Store 8(resident) 252 + 257: 254 Load 256(sCubeShadow) + 258: 11(fvec4) Load 89(c4) + 259: 46(fvec3) Load 48(c3) + 260: 46(fvec3) Load 48(c3) + 261: 74(ptr) AccessChain 13(texel) 119 + 262: 10(float) CompositeExtract 258 3 + 263: 77(ResType) ImageSparseSampleDrefExplicitLod 257 258 262 Grad 259 260 + 264: 10(float) CompositeExtract 263 1 + Store 261 264 + 265: 6(int) CompositeExtract 263 0 + 266: 6(int) Load 8(resident) + 267: 6(int) BitwiseOr 266 265 + Store 8(resident) 267 + 268: 106 Load 108(usCubeArray) + 269: 11(fvec4) Load 89(c4) + 270: 46(fvec3) Load 48(c3) + 271: 46(fvec3) Load 48(c3) + 272:111(ResType) ImageSparseSampleExplicitLod 268 269 Grad 270 271 + 273: 21(ivec4) CompositeExtract 272 1 + Store 23(utexel) 273 + 274: 6(int) CompositeExtract 272 0 + 275: 6(int) Load 8(resident) + 276: 6(int) BitwiseOr 275 274 + Store 8(resident) 276 + 277: 27 Load 29(s2D) + 278: 31(fvec2) Load 33(c2) + 279: 31(fvec2) Load 33(c2) + 280: 31(fvec2) Load 33(c2) + 281: 35(ResType) ImageSparseSampleExplicitLod 277 278 Grad ConstOffset 279 280 158 + 282: 11(fvec4) CompositeExtract 281 1 + Store 13(texel) 282 + 283: 6(int) CompositeExtract 281 0 + 284: 6(int) Load 8(resident) + 285: 6(int) BitwiseOr 284 283 + Store 8(resident) 285 + 290: 287 Load 289(s2DRectShadow) + 291: 46(fvec3) Load 48(c3) + 292: 31(fvec2) Load 33(c2) + 293: 31(fvec2) Load 33(c2) + 295: 74(ptr) AccessChain 13(texel) 294 + 296: 10(float) CompositeExtract 291 2 + 297: 77(ResType) ImageSparseSampleDrefExplicitLod 290 291 296 Grad ConstOffset 292 293 227 + 298: 10(float) CompositeExtract 297 1 + Store 295 298 + 299: 6(int) CompositeExtract 297 0 + 300: 6(int) Load 8(resident) + 301: 6(int) BitwiseOr 300 299 + Store 8(resident) 301 + 302: 221 Load 223(is2DArray) + 303: 46(fvec3) Load 48(c3) + 304: 31(fvec2) Load 33(c2) + 305: 31(fvec2) Load 33(c2) + 307: 62(ResType) ImageSparseSampleExplicitLod 302 303 Grad ConstOffset 304 305 306 + 308: 16(ivec4) CompositeExtract 307 1 + Store 18(itexel) 308 + 309: 6(int) CompositeExtract 307 0 + 310: 6(int) Load 8(resident) + 311: 6(int) BitwiseOr 310 309 + Store 8(resident) 311 + 312: 27 Load 29(s2D) + 313: 31(fvec2) Load 33(c2) + 314: 35(ResType) ImageSparseGather 312 313 9 + 315: 11(fvec4) CompositeExtract 314 1 + Store 13(texel) 315 + 316: 6(int) CompositeExtract 314 0 + 317: 6(int) Load 8(resident) + 318: 6(int) BitwiseOr 317 316 + Store 8(resident) 318 + 319: 221 Load 223(is2DArray) + 320: 46(fvec3) Load 48(c3) + 321: 62(ResType) ImageSparseGather 319 320 130 + 322: 16(ivec4) CompositeExtract 321 1 + Store 18(itexel) 322 + 323: 6(int) CompositeExtract 321 0 + 324: 6(int) Load 8(resident) + 325: 6(int) BitwiseOr 324 323 + Store 8(resident) 325 + 326: 152 Load 154(s2DArrayShadow) + 327: 46(fvec3) Load 48(c3) + 328: 35(ResType) ImageSparseDrefGather 326 327 50 + 329: 11(fvec4) CompositeExtract 328 1 + Store 13(texel) 329 + 330: 6(int) CompositeExtract 328 0 + 331: 6(int) Load 8(resident) + 332: 6(int) BitwiseOr 331 330 + Store 8(resident) 332 + 333: 27 Load 29(s2D) + 334: 31(fvec2) Load 33(c2) + 336: 35(ResType) ImageSparseGather 333 334 9 ConstOffset 335 + 337: 11(fvec4) CompositeExtract 336 1 + Store 13(texel) 337 + 338: 6(int) CompositeExtract 336 0 + 339: 6(int) Load 8(resident) + 340: 6(int) BitwiseOr 339 338 + Store 8(resident) 340 + 341: 221 Load 223(is2DArray) + 342: 46(fvec3) Load 48(c3) + 343: 62(ResType) ImageSparseGather 341 342 130 ConstOffset 158 + 344: 16(ivec4) CompositeExtract 343 1 + Store 18(itexel) 344 + 345: 6(int) CompositeExtract 343 0 + 346: 6(int) Load 8(resident) + 347: 6(int) BitwiseOr 346 345 + Store 8(resident) 347 + 348: 287 Load 289(s2DRectShadow) + 349: 31(fvec2) Load 33(c2) + 350: 35(ResType) ImageSparseDrefGather 348 349 50 ConstOffset 236 + 351: 11(fvec4) CompositeExtract 350 1 + Store 13(texel) 351 + 352: 6(int) CompositeExtract 350 0 + 353: 6(int) Load 8(resident) + 354: 6(int) BitwiseOr 353 352 + Store 8(resident) 354 + 355: 27 Load 29(s2D) + 356: 31(fvec2) Load 33(c2) + 361: 358 Load 360(offsets) + 362: 35(ResType) ImageSparseGather 355 356 9 ConstOffsets 361 + 363: 11(fvec4) CompositeExtract 362 1 + Store 13(texel) 363 + 364: 6(int) CompositeExtract 362 0 + 365: 6(int) Load 8(resident) + 366: 6(int) BitwiseOr 365 364 + Store 8(resident) 366 + 367: 221 Load 223(is2DArray) + 368: 46(fvec3) Load 48(c3) + 369: 358 Load 360(offsets) + 370: 62(ResType) ImageSparseGather 367 368 130 ConstOffsets 369 + 371: 16(ivec4) CompositeExtract 370 1 + Store 18(itexel) 371 + 372: 6(int) CompositeExtract 370 0 + 373: 6(int) Load 8(resident) + 374: 6(int) BitwiseOr 373 372 + Store 8(resident) 374 + 375: 287 Load 289(s2DRectShadow) + 376: 31(fvec2) Load 33(c2) + 377: 358 Load 360(offsets) + 378: 35(ResType) ImageSparseDrefGather 375 376 50 ConstOffsets 377 + 379: 11(fvec4) CompositeExtract 378 1 + Store 13(texel) 379 + 380: 6(int) CompositeExtract 378 0 + 381: 6(int) Load 8(resident) + 382: 6(int) BitwiseOr 381 380 + Store 8(resident) 382 + 386: 383 Load 385(i2D) + 389: 143(ivec2) Load 388(ic2) + 390: 35(ResType) ImageSparseRead 386 389 + 391: 11(fvec4) CompositeExtract 390 1 + Store 13(texel) 391 + 392: 6(int) CompositeExtract 390 0 + 393: 6(int) Load 8(resident) + 394: 6(int) BitwiseOr 393 392 + Store 8(resident) 394 + 398: 395 Load 397(ii3D) + 401: 129(ivec3) Load 400(ic3) + 402: 62(ResType) ImageSparseRead 398 401 + 403: 16(ivec4) CompositeExtract 402 1 + Store 18(itexel) 403 + 404: 6(int) CompositeExtract 402 0 + 405: 6(int) Load 8(resident) + 406: 6(int) BitwiseOr 405 404 + Store 8(resident) 406 + 410: 407 Load 409(i2DMS) + 411: 143(ivec2) Load 388(ic2) + 412: 35(ResType) ImageSparseRead 410 411 Sample 144 + 413: 11(fvec4) CompositeExtract 412 1 + Store 13(texel) 413 + 414: 6(int) CompositeExtract 412 0 + 415: 6(int) Load 8(resident) + 416: 6(int) BitwiseOr 415 414 + Store 8(resident) 416 + 420: 6(int) Load 8(resident) + 422: 421(bool) ImageSparseTexelsResident 420 + SelectionMerge 424 None + BranchConditional 422 423 426 + 423: Label + 425: 11(fvec4) Load 13(texel) + Store 419 425 + Branch 424 + 426: Label + 427: 16(ivec4) Load 18(itexel) + 428: 11(fvec4) ConvertSToF 427 + 429: 21(ivec4) Load 23(utexel) + 430: 11(fvec4) ConvertUToF 429 + 431: 11(fvec4) FAdd 428 430 + Store 419 431 + Branch 424 + 424: Label + 432: 11(fvec4) Load 419 + Store 418(outColor) 432 + Return + FunctionEnd diff --git a/Test/baseResults/spv.sparseTextureClamp.frag.out b/Test/baseResults/spv.sparseTextureClamp.frag.out new file mode 100644 index 00000000..1922ac12 --- /dev/null +++ b/Test/baseResults/spv.sparseTextureClamp.frag.out @@ -0,0 +1,471 @@ +spv.sparseTextureClamp.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 360 + + Capability Shader + Capability SampledRect + Capability SparseResidency + Capability MinLod + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 36 51 95 345 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture_clamp" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 36 "lodClamp" + Name 38 "ResType" + Name 47 "s3D" + Name 51 "c3" + Name 63 "isCube" + Name 67 "ResType" + Name 76 "s2DShadow" + Name 83 "ResType" + Name 92 "sCubeArrayShadow" + Name 95 "c4" + Name 154 "us2DRect" + Name 161 "ResType" + Name 170 "s2DArrayShadow" + Name 218 "sCubeShadow" + Name 235 "usCubeArray" + Name 286 "s2DRectShadow" + Name 305 "is2DArray" + Name 345 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 47(s3D) DescriptorSet 0 + Decorate 63(isCube) DescriptorSet 0 + Decorate 76(s2DShadow) DescriptorSet 0 + Decorate 92(sCubeArrayShadow) DescriptorSet 0 + Decorate 154(us2DRect) DescriptorSet 0 + Decorate 170(s2DArrayShadow) DescriptorSet 0 + Decorate 218(sCubeShadow) DescriptorSet 0 + Decorate 235(usCubeArray) DescriptorSet 0 + Decorate 286(s2DRectShadow) DescriptorSet 0 + Decorate 305(is2DArray) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input + 35: TypePointer Input 10(float) + 36(lodClamp): 35(ptr) Variable Input + 38(ResType): TypeStruct 6(int) 11(fvec4) + 44: TypeImage 10(float) 3D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s3D): 46(ptr) Variable UniformConstant + 49: TypeVector 10(float) 3 + 50: TypePointer Input 49(fvec3) + 51(c3): 50(ptr) Variable Input + 54: 10(float) Constant 1073741824 + 60: TypeImage 6(int) Cube sampled format:Unknown + 61: TypeSampledImage 60 + 62: TypePointer UniformConstant 61 + 63(isCube): 62(ptr) Variable UniformConstant + 67(ResType): TypeStruct 6(int) 16(ivec4) + 73: TypeImage 10(float) 2D depth sampled format:Unknown + 74: TypeSampledImage 73 + 75: TypePointer UniformConstant 74 + 76(s2DShadow): 75(ptr) Variable UniformConstant + 80: TypePointer Function 10(float) + 83(ResType): TypeStruct 6(int) 10(float) + 89: TypeImage 10(float) Cube depth array sampled format:Unknown + 90: TypeSampledImage 89 + 91: TypePointer UniformConstant 90 +92(sCubeArrayShadow): 91(ptr) Variable UniformConstant + 94: TypePointer Input 11(fvec4) + 95(c4): 94(ptr) Variable Input + 97: 10(float) Constant 1065353216 + 142: TypeVector 6(int) 3 + 143: 6(int) Constant 2 + 144: 142(ivec3) ConstantComposite 143 143 143 + 151: TypeImage 20(int) Rect sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 + 154(us2DRect): 153(ptr) Variable UniformConstant + 157: TypeVector 6(int) 2 + 158: 6(int) Constant 3 + 159: 157(ivec2) ConstantComposite 158 158 + 161(ResType): TypeStruct 6(int) 21(ivec4) + 167: TypeImage 10(float) 2D depth array sampled format:Unknown + 168: TypeSampledImage 167 + 169: TypePointer UniformConstant 168 +170(s2DArrayShadow): 169(ptr) Variable UniformConstant + 173: 6(int) Constant 5 + 174: 157(ivec2) ConstantComposite 173 173 + 176: 20(int) Constant 2 + 215: TypeImage 10(float) Cube depth sampled format:Unknown + 216: TypeSampledImage 215 + 217: TypePointer UniformConstant 216 +218(sCubeShadow): 217(ptr) Variable UniformConstant + 224: 20(int) Constant 1 + 232: TypeImage 20(int) Cube array sampled format:Unknown + 233: TypeSampledImage 232 + 234: TypePointer UniformConstant 233 +235(usCubeArray): 234(ptr) Variable UniformConstant + 283: TypeImage 10(float) Rect depth sampled format:Unknown + 284: TypeSampledImage 283 + 285: TypePointer UniformConstant 284 +286(s2DRectShadow): 285(ptr) Variable UniformConstant + 291: 6(int) Constant 6 + 292: 157(ivec2) ConstantComposite 291 291 + 294: 20(int) Constant 3 + 302: TypeImage 6(int) 2D array sampled format:Unknown + 303: TypeSampledImage 302 + 304: TypePointer UniformConstant 303 + 305(is2DArray): 304(ptr) Variable UniformConstant + 310: 157(ivec2) ConstantComposite 143 143 + 344: TypePointer Output 11(fvec4) + 345(outColor): 344(ptr) Variable Output + 348: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 346: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 37: 10(float) Load 36(lodClamp) + 39: 38(ResType) ImageSparseSampleImplicitLod 30 34 MinLod 37 + 40: 11(fvec4) CompositeExtract 39 1 + Store 13(texel) 40 + 41: 6(int) CompositeExtract 39 0 + 42: 6(int) Load 8(resident) + 43: 6(int) BitwiseOr 42 41 + Store 8(resident) 43 + 48: 45 Load 47(s3D) + 52: 49(fvec3) Load 51(c3) + 53: 10(float) Load 36(lodClamp) + 55: 38(ResType) ImageSparseSampleImplicitLod 48 52 Bias MinLod 54 53 + 56: 11(fvec4) CompositeExtract 55 1 + Store 13(texel) 56 + 57: 6(int) CompositeExtract 55 0 + 58: 6(int) Load 8(resident) + 59: 6(int) BitwiseOr 58 57 + Store 8(resident) 59 + 64: 61 Load 63(isCube) + 65: 49(fvec3) Load 51(c3) + 66: 10(float) Load 36(lodClamp) + 68: 67(ResType) ImageSparseSampleImplicitLod 64 65 MinLod 66 + 69: 16(ivec4) CompositeExtract 68 1 + Store 18(itexel) 69 + 70: 6(int) CompositeExtract 68 0 + 71: 6(int) Load 8(resident) + 72: 6(int) BitwiseOr 71 70 + Store 8(resident) 72 + 77: 74 Load 76(s2DShadow) + 78: 49(fvec3) Load 51(c3) + 79: 10(float) Load 36(lodClamp) + 81: 80(ptr) AccessChain 13(texel) 24 + 82: 10(float) CompositeExtract 78 2 + 84: 83(ResType) ImageSparseSampleDrefImplicitLod 77 78 82 MinLod 79 + 85: 10(float) CompositeExtract 84 1 + Store 81 85 + 86: 6(int) CompositeExtract 84 0 + 87: 6(int) Load 8(resident) + 88: 6(int) BitwiseOr 87 86 + Store 8(resident) 88 + 93: 90 Load 92(sCubeArrayShadow) + 96: 11(fvec4) Load 95(c4) + 98: 10(float) Load 36(lodClamp) + 99: 80(ptr) AccessChain 13(texel) 24 + 100: 83(ResType) ImageSparseSampleDrefImplicitLod 93 96 97 MinLod 98 + 101: 10(float) CompositeExtract 100 1 + Store 99 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 105: 27 Load 29(s2D) + 106: 31(fvec2) Load 33(c2) + 107: 10(float) Load 36(lodClamp) + 108: 11(fvec4) ImageSampleImplicitLod 105 106 MinLod 107 + 109: 11(fvec4) Load 13(texel) + 110: 11(fvec4) FAdd 109 108 + Store 13(texel) 110 + 111: 45 Load 47(s3D) + 112: 49(fvec3) Load 51(c3) + 113: 10(float) Load 36(lodClamp) + 114: 11(fvec4) ImageSampleImplicitLod 111 112 Bias MinLod 54 113 + 115: 11(fvec4) Load 13(texel) + 116: 11(fvec4) FAdd 115 114 + Store 13(texel) 116 + 117: 61 Load 63(isCube) + 118: 49(fvec3) Load 51(c3) + 119: 10(float) Load 36(lodClamp) + 120: 16(ivec4) ImageSampleImplicitLod 117 118 MinLod 119 + 121: 16(ivec4) Load 18(itexel) + 122: 16(ivec4) IAdd 121 120 + Store 18(itexel) 122 + 123: 74 Load 76(s2DShadow) + 124: 49(fvec3) Load 51(c3) + 125: 10(float) Load 36(lodClamp) + 126: 10(float) CompositeExtract 124 2 + 127: 10(float) ImageSampleDrefImplicitLod 123 124 126 MinLod 125 + 128: 80(ptr) AccessChain 13(texel) 24 + 129: 10(float) Load 128 + 130: 10(float) FAdd 129 127 + 131: 80(ptr) AccessChain 13(texel) 24 + Store 131 130 + 132: 90 Load 92(sCubeArrayShadow) + 133: 11(fvec4) Load 95(c4) + 134: 10(float) Load 36(lodClamp) + 135: 10(float) ImageSampleDrefImplicitLod 132 133 97 MinLod 134 + 136: 80(ptr) AccessChain 13(texel) 24 + 137: 10(float) Load 136 + 138: 10(float) FAdd 137 135 + 139: 80(ptr) AccessChain 13(texel) 24 + Store 139 138 + 140: 45 Load 47(s3D) + 141: 49(fvec3) Load 51(c3) + 145: 10(float) Load 36(lodClamp) + 146: 38(ResType) ImageSparseSampleImplicitLod 140 141 Bias ConstOffset MinLod 54 144 145 + 147: 11(fvec4) CompositeExtract 146 1 + Store 13(texel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(us2DRect) + 156: 31(fvec2) Load 33(c2) + 160: 10(float) Load 36(lodClamp) + 162:161(ResType) ImageSparseSampleImplicitLod 155 156 ConstOffset MinLod 159 160 + 163: 21(ivec4) CompositeExtract 162 1 + Store 23(utexel) 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 171: 168 Load 170(s2DArrayShadow) + 172: 11(fvec4) Load 95(c4) + 175: 10(float) Load 36(lodClamp) + 177: 80(ptr) AccessChain 13(texel) 176 + 178: 10(float) CompositeExtract 172 3 + 179: 83(ResType) ImageSparseSampleDrefImplicitLod 171 172 178 ConstOffset MinLod 174 175 + 180: 10(float) CompositeExtract 179 1 + Store 177 180 + 181: 6(int) CompositeExtract 179 0 + 182: 6(int) Load 8(resident) + 183: 6(int) BitwiseOr 182 181 + Store 8(resident) 183 + 184: 45 Load 47(s3D) + 185: 49(fvec3) Load 51(c3) + 186: 10(float) Load 36(lodClamp) + 187: 11(fvec4) ImageSampleImplicitLod 184 185 Bias ConstOffset MinLod 54 144 186 + 188: 11(fvec4) Load 13(texel) + 189: 11(fvec4) FAdd 188 187 + Store 13(texel) 189 + 190: 152 Load 154(us2DRect) + 191: 31(fvec2) Load 33(c2) + 192: 10(float) Load 36(lodClamp) + 193: 21(ivec4) ImageSampleImplicitLod 190 191 ConstOffset MinLod 159 192 + 194: 21(ivec4) Load 23(utexel) + 195: 21(ivec4) IAdd 194 193 + Store 23(utexel) 195 + 196: 168 Load 170(s2DArrayShadow) + 197: 11(fvec4) Load 95(c4) + 198: 10(float) Load 36(lodClamp) + 199: 10(float) CompositeExtract 197 3 + 200: 10(float) ImageSampleDrefImplicitLod 196 197 199 ConstOffset MinLod 174 198 + 201: 80(ptr) AccessChain 13(texel) 176 + 202: 10(float) Load 201 + 203: 10(float) FAdd 202 200 + 204: 80(ptr) AccessChain 13(texel) 176 + Store 204 203 + 205: 45 Load 47(s3D) + 206: 49(fvec3) Load 51(c3) + 207: 49(fvec3) Load 51(c3) + 208: 49(fvec3) Load 51(c3) + 209: 10(float) Load 36(lodClamp) + 210: 38(ResType) ImageSparseSampleExplicitLod 205 206 Grad MinLod 207 208 209 + 211: 11(fvec4) CompositeExtract 210 1 + Store 13(texel) 211 + 212: 6(int) CompositeExtract 210 0 + 213: 6(int) Load 8(resident) + 214: 6(int) BitwiseOr 213 212 + Store 8(resident) 214 + 219: 216 Load 218(sCubeShadow) + 220: 11(fvec4) Load 95(c4) + 221: 49(fvec3) Load 51(c3) + 222: 49(fvec3) Load 51(c3) + 223: 10(float) Load 36(lodClamp) + 225: 80(ptr) AccessChain 13(texel) 224 + 226: 10(float) CompositeExtract 220 3 + 227: 83(ResType) ImageSparseSampleDrefExplicitLod 219 220 226 Grad MinLod 221 222 223 + 228: 10(float) CompositeExtract 227 1 + Store 225 228 + 229: 6(int) CompositeExtract 227 0 + 230: 6(int) Load 8(resident) + 231: 6(int) BitwiseOr 230 229 + Store 8(resident) 231 + 236: 233 Load 235(usCubeArray) + 237: 11(fvec4) Load 95(c4) + 238: 49(fvec3) Load 51(c3) + 239: 49(fvec3) Load 51(c3) + 240: 10(float) Load 36(lodClamp) + 241:161(ResType) ImageSparseSampleExplicitLod 236 237 Grad MinLod 238 239 240 + 242: 21(ivec4) CompositeExtract 241 1 + Store 23(utexel) 242 + 243: 6(int) CompositeExtract 241 0 + 244: 6(int) Load 8(resident) + 245: 6(int) BitwiseOr 244 243 + Store 8(resident) 245 + 246: 45 Load 47(s3D) + 247: 49(fvec3) Load 51(c3) + 248: 49(fvec3) Load 51(c3) + 249: 49(fvec3) Load 51(c3) + 250: 10(float) Load 36(lodClamp) + 251: 11(fvec4) ImageSampleExplicitLod 246 247 Grad MinLod 248 249 250 + 252: 11(fvec4) Load 13(texel) + 253: 11(fvec4) FAdd 252 251 + Store 13(texel) 253 + 254: 216 Load 218(sCubeShadow) + 255: 11(fvec4) Load 95(c4) + 256: 49(fvec3) Load 51(c3) + 257: 49(fvec3) Load 51(c3) + 258: 10(float) Load 36(lodClamp) + 259: 10(float) CompositeExtract 255 3 + 260: 10(float) ImageSampleDrefExplicitLod 254 255 259 Grad MinLod 256 257 258 + 261: 80(ptr) AccessChain 13(texel) 224 + 262: 10(float) Load 261 + 263: 10(float) FAdd 262 260 + 264: 80(ptr) AccessChain 13(texel) 224 + Store 264 263 + 265: 233 Load 235(usCubeArray) + 266: 11(fvec4) Load 95(c4) + 267: 49(fvec3) Load 51(c3) + 268: 49(fvec3) Load 51(c3) + 269: 10(float) Load 36(lodClamp) + 270: 21(ivec4) ImageSampleExplicitLod 265 266 Grad MinLod 267 268 269 + 271: 21(ivec4) Load 23(utexel) + 272: 21(ivec4) IAdd 271 270 + Store 23(utexel) 272 + 273: 27 Load 29(s2D) + 274: 31(fvec2) Load 33(c2) + 275: 31(fvec2) Load 33(c2) + 276: 31(fvec2) Load 33(c2) + 277: 10(float) Load 36(lodClamp) + 278: 38(ResType) ImageSparseSampleExplicitLod 273 274 Grad ConstOffset MinLod 275 276 174 277 + 279: 11(fvec4) CompositeExtract 278 1 + Store 13(texel) 279 + 280: 6(int) CompositeExtract 278 0 + 281: 6(int) Load 8(resident) + 282: 6(int) BitwiseOr 281 280 + Store 8(resident) 282 + 287: 284 Load 286(s2DRectShadow) + 288: 49(fvec3) Load 51(c3) + 289: 31(fvec2) Load 33(c2) + 290: 31(fvec2) Load 33(c2) + 293: 10(float) Load 36(lodClamp) + 295: 80(ptr) AccessChain 13(texel) 294 + 296: 10(float) CompositeExtract 288 2 + 297: 83(ResType) ImageSparseSampleDrefExplicitLod 287 288 296 Grad ConstOffset MinLod 289 290 292 293 + 298: 10(float) CompositeExtract 297 1 + Store 295 298 + 299: 6(int) CompositeExtract 297 0 + 300: 6(int) Load 8(resident) + 301: 6(int) BitwiseOr 300 299 + Store 8(resident) 301 + 306: 303 Load 305(is2DArray) + 307: 49(fvec3) Load 51(c3) + 308: 31(fvec2) Load 33(c2) + 309: 31(fvec2) Load 33(c2) + 311: 10(float) Load 36(lodClamp) + 312: 67(ResType) ImageSparseSampleExplicitLod 306 307 Grad ConstOffset MinLod 308 309 310 311 + 313: 16(ivec4) CompositeExtract 312 1 + Store 18(itexel) 313 + 314: 6(int) CompositeExtract 312 0 + 315: 6(int) Load 8(resident) + 316: 6(int) BitwiseOr 315 314 + Store 8(resident) 316 + 317: 27 Load 29(s2D) + 318: 31(fvec2) Load 33(c2) + 319: 31(fvec2) Load 33(c2) + 320: 31(fvec2) Load 33(c2) + 321: 10(float) Load 36(lodClamp) + 322: 11(fvec4) ImageSampleExplicitLod 317 318 Grad ConstOffset MinLod 319 320 174 321 + 323: 11(fvec4) Load 13(texel) + 324: 11(fvec4) FAdd 323 322 + Store 13(texel) 324 + 325: 284 Load 286(s2DRectShadow) + 326: 49(fvec3) Load 51(c3) + 327: 31(fvec2) Load 33(c2) + 328: 31(fvec2) Load 33(c2) + 329: 10(float) Load 36(lodClamp) + 330: 10(float) CompositeExtract 326 2 + 331: 10(float) ImageSampleDrefExplicitLod 325 326 330 Grad ConstOffset MinLod 327 328 292 329 + 332: 80(ptr) AccessChain 13(texel) 294 + 333: 10(float) Load 332 + 334: 10(float) FAdd 333 331 + 335: 80(ptr) AccessChain 13(texel) 294 + Store 335 334 + 336: 303 Load 305(is2DArray) + 337: 49(fvec3) Load 51(c3) + 338: 31(fvec2) Load 33(c2) + 339: 31(fvec2) Load 33(c2) + 340: 10(float) Load 36(lodClamp) + 341: 16(ivec4) ImageSampleExplicitLod 336 337 Grad ConstOffset MinLod 338 339 310 340 + 342: 16(ivec4) Load 18(itexel) + 343: 16(ivec4) IAdd 342 341 + Store 18(itexel) 343 + 347: 6(int) Load 8(resident) + 349: 348(bool) ImageSparseTexelsResident 347 + SelectionMerge 351 None + BranchConditional 349 350 353 + 350: Label + 352: 11(fvec4) Load 13(texel) + Store 346 352 + Branch 351 + 353: Label + 354: 16(ivec4) Load 18(itexel) + 355: 11(fvec4) ConvertSToF 354 + 356: 21(ivec4) Load 23(utexel) + 357: 11(fvec4) ConvertUToF 356 + 358: 11(fvec4) FAdd 355 357 + Store 346 358 + Branch 351 + 351: Label + 359: 11(fvec4) Load 346 + Store 345(outColor) 359 + Return + FunctionEnd diff --git a/Test/baseResults/spv.specConstant.comp.out b/Test/baseResults/spv.specConstant.comp.out new file mode 100644 index 00000000..d1c9b0a6 --- /dev/null +++ b/Test/baseResults/spv.specConstant.comp.out @@ -0,0 +1,55 @@ +spv.specConstant.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked compute stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 32 32 1 + Source GLSL 450 + Name 4 "main" + Name 7 "bn" + MemberName 7(bn) 0 "a" + Name 9 "bi" + MemberDecorate 7(bn) 0 Offset 0 + Decorate 7(bn) BufferBlock + Decorate 9(bi) DescriptorSet 0 + Decorate 12 SpecId 18 + Decorate 14 SpecId 19 + Decorate 16 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7(bn): TypeStruct 6(int) + 8: TypePointer Uniform 7(bn) + 9(bi): 8(ptr) Variable Uniform + 10: TypeInt 32 1 + 11: 10(int) Constant 0 + 12: 6(int) SpecConstant 32 + 13: 6(int) Constant 32 + 14: 6(int) SpecConstant 1 + 15: TypeVector 6(int) 3 + 16: 15(ivec3) SpecConstantComposite 12 13 14 + 17: 6(int) Constant 0 + 19: 6(int) Constant 1 + 22: 6(int) Constant 2 + 25: TypePointer Uniform 6(int) + 4(main): 2 Function None 3 + 5: Label + 18: 6(int) CompositeExtract 16 0 + 20: 6(int) CompositeExtract 16 1 + 21: 6(int) IMul 18 20 + 23: 6(int) CompositeExtract 16 2 + 24: 6(int) IMul 21 23 + 26: 25(ptr) AccessChain 9(bi) 11 + Store 26 24 + Return + FunctionEnd diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out new file mode 100644 index 00000000..862dc19a --- /dev/null +++ b/Test/baseResults/spv.specConstant.vert.out @@ -0,0 +1,124 @@ +spv.specConstant.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 72 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 17 19 25 50 + Source GLSL 400 + Name 4 "main" + Name 14 "foo(vf4[s1498];" + Name 13 "p" + Name 17 "color" + Name 19 "ucol" + Name 25 "size" + Name 44 "param" + Name 50 "dupUcol" + Decorate 9 SpecId 16 + Decorate 27 SpecId 17 + Decorate 31 SpecId 22 + Decorate 36 SpecId 19 + Decorate 37 SpecId 18 + Decorate 47 SpecId 116 + Decorate 57 SpecId 117 + Decorate 60 SpecId 122 + Decorate 64 SpecId 119 + Decorate 65 SpecId 118 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9: 8(int) SpecConstant 5 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeFunction 2 11(ptr) + 16: TypePointer Output 7(fvec4) + 17(color): 16(ptr) Variable Output + 18: TypePointer Input 10 + 19(ucol): 18(ptr) Variable Input + 20: 8(int) Constant 2 + 21: TypePointer Input 7(fvec4) + 24: TypePointer Output 8(int) + 25(size): 24(ptr) Variable Output + 26: TypeBool + 27: 26(bool) SpecConstantTrue + 30: TypeInt 32 0 + 31: 30(int) SpecConstant 2 + 35: TypeFloat 64 + 36: 35(float) SpecConstant 1413754136 1074340347 + 37: 6(float) SpecConstant 1078523331 + 47: 8(int) SpecConstant 12 + 48: TypeArray 7(fvec4) 47 + 49: TypePointer Input 48 + 50(dupUcol): 49(ptr) Variable Input + 57: 26(bool) SpecConstantTrue + 60: 30(int) SpecConstant 2 + 64: 35(float) SpecConstant 1413754136 1074340347 + 65: 6(float) SpecConstant 1078523331 + 4(main): 2 Function None 3 + 5: Label + 44(param): 11(ptr) Variable Function + 22: 21(ptr) AccessChain 19(ucol) 20 + 23: 7(fvec4) Load 22 + Store 17(color) 23 + Store 25(size) 9 + SelectionMerge 29 None + BranchConditional 27 28 29 + 28: Label + 32: 6(float) ConvertUToF 31 + 33: 7(fvec4) Load 17(color) + 34: 7(fvec4) VectorTimesScalar 33 32 + Store 17(color) 34 + Branch 29 + 29: Label + 38: 35(float) FConvert 37 + 39: 35(float) FDiv 36 38 + 40: 6(float) FConvert 39 + 41: 7(fvec4) Load 17(color) + 42: 7(fvec4) CompositeConstruct 40 40 40 40 + 43: 7(fvec4) FAdd 41 42 + Store 17(color) 43 + 45: 10 Load 19(ucol) + Store 44(param) 45 + 46: 2 FunctionCall 14(foo(vf4[s1498];) 44(param) + Return + FunctionEnd +14(foo(vf4[s1498];): 2 Function None 12 + 13(p): 11(ptr) FunctionParameter + 15: Label + 51: 21(ptr) AccessChain 50(dupUcol) 20 + 52: 7(fvec4) Load 51 + 53: 7(fvec4) Load 17(color) + 54: 7(fvec4) FAdd 53 52 + Store 17(color) 54 + 55: 8(int) Load 25(size) + 56: 8(int) IAdd 55 47 + Store 25(size) 56 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 61: 6(float) ConvertUToF 60 + 62: 7(fvec4) Load 17(color) + 63: 7(fvec4) VectorTimesScalar 62 61 + Store 17(color) 63 + Branch 59 + 59: Label + 66: 35(float) FConvert 65 + 67: 35(float) FDiv 64 66 + 68: 6(float) FConvert 67 + 69: 7(fvec4) Load 17(color) + 70: 7(fvec4) CompositeConstruct 68 68 68 68 + 71: 7(fvec4) FAdd 69 70 + Store 17(color) 71 + Return + FunctionEnd diff --git a/Test/baseResults/spv.structAssignment.frag.out b/Test/baseResults/spv.structAssignment.frag.out index 9675d88f..7c28e103 100755 --- a/Test/baseResults/spv.structAssignment.frag.out +++ b/Test/baseResults/spv.structAssignment.frag.out @@ -1,6 +1,4 @@ spv.structAssignment.frag -WARNING: 0:4: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -13,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 31 44 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "lunarStruct1" MemberName 8(lunarStruct1) 0 "i" @@ -35,6 +33,7 @@ Linked fragment stage: Name 40 "samp2D" Name 44 "coord" Name 49 "foo" + Decorate 40(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -42,14 +41,14 @@ Linked fragment stage: 8(lunarStruct1): TypeStruct 6(int) 7(float) 9(lunarStruct2): TypeStruct 6(int) 7(float) 8(lunarStruct1) 10(lunarStruct3): TypeStruct 9(lunarStruct2) 6(int) 7(float) 8(lunarStruct1) - 11: TypePointer UniformConstant 10(lunarStruct3) - 12(foo3): 11(ptr) Variable UniformConstant + 11: TypePointer Private 10(lunarStruct3) + 12(foo3): 11(ptr) Variable Private 13: 6(int) Constant 0 - 14: TypePointer UniformConstant 6(int) + 14: TypePointer Private 6(int) 17: TypeBool 21: TypePointer Function 9(lunarStruct2) - 23: TypePointer UniformConstant 9(lunarStruct2) - 27(foo2): 23(ptr) Variable UniformConstant + 23: TypePointer Private 9(lunarStruct2) + 27(foo2): 23(ptr) Variable Private 29: TypeVector 7(float) 4 30: TypePointer Output 29(fvec4) 31(gl_FragColor): 30(ptr) Variable Output @@ -63,8 +62,8 @@ Linked fragment stage: 42: TypeVector 7(float) 2 43: TypePointer Input 42(fvec2) 44(coord): 43(ptr) Variable Input - 48: TypePointer UniformConstant 8(lunarStruct1) - 49(foo): 48(ptr) Variable UniformConstant + 48: TypePointer Private 8(lunarStruct1) + 49(foo): 48(ptr) Variable Private 4(main): 2 Function None 3 5: Label 22(locals2): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.structDeref.frag.out b/Test/baseResults/spv.structDeref.frag.out index 8d34ea30..78ebdc63 100755 --- a/Test/baseResults/spv.structDeref.frag.out +++ b/Test/baseResults/spv.structDeref.frag.out @@ -1,6 +1,4 @@ spv.structDeref.frag -WARNING: 0:4: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -13,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 61 99 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "s0" MemberName 8(s0) 0 "i" @@ -46,6 +44,7 @@ Linked fragment stage: Name 99 "gl_FragColor" Name 116 "samp2D" Name 122 "foo2" + Decorate 116(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -57,11 +56,11 @@ Linked fragment stage: 12: 11(int) Constant 12 13: TypeArray 10(s2) 12 14(s3): TypeStruct 13 6(int) 7(float) 9(s1) - 15: TypePointer UniformConstant 14(s3) - 16(foo3): 15(ptr) Variable UniformConstant + 15: TypePointer Private 14(s3) + 16(foo3): 15(ptr) Variable Private 17: 6(int) Constant 0 18: 6(int) Constant 9 - 19: TypePointer UniformConstant 6(int) + 19: TypePointer Private 6(int) 22: TypeBool 26: TypePointer Function 10(s2) 28: 6(int) Constant 1 @@ -80,8 +79,8 @@ Linked fragment stage: 44: TypeArray 9(s1) 43 45: TypePointer Function 44 47: 6(int) Constant 6 - 48: TypePointer UniformConstant 9(s1) - 49(foo1): 48(ptr) Variable UniformConstant + 48: TypePointer Private 9(s1) + 49(foo1): 48(ptr) Variable Private 52: TypePointer Function 8(s0) 54(s00): TypeStruct 8(s0) 55: TypePointer Function 54(s00) @@ -92,15 +91,15 @@ Linked fragment stage: 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 + 70: TypePointer Private 8(s0) + 71(foo0): 70(ptr) Variable Private 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 + 85: TypePointer Private 54(s00) + 86(foo00): 85(ptr) Variable Private 88: TypePointer Function 6(int) 91: 6(int) Constant 5 97: TypeVector 7(float) 4 @@ -111,8 +110,8 @@ Linked fragment stage: 114: TypeSampledImage 113 115: TypePointer UniformConstant 114 116(samp2D): 115(ptr) Variable UniformConstant - 121: TypePointer UniformConstant 10(s2) - 122(foo2): 121(ptr) Variable UniformConstant + 121: TypePointer Private 10(s2) + 122(foo2): 121(ptr) Variable Private 4(main): 2 Function None 3 5: Label 27(locals2): 26(ptr) Variable Function diff --git a/Test/baseResults/spv.structure.frag.out b/Test/baseResults/spv.structure.frag.out index bcf5222d..8d91ed04 100755 --- a/Test/baseResults/spv.structure.frag.out +++ b/Test/baseResults/spv.structure.frag.out @@ -1,6 +1,4 @@ spv.structure.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -13,8 +11,8 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 45 54 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "scale" Name 18 "lunarStruct1" @@ -30,6 +28,7 @@ Linked fragment stage: Name 50 "samp2D" Name 54 "coord" Name 59 "foo" + Decorate 50(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -48,16 +47,16 @@ Linked fragment stage: 20: TypeArray 18(lunarStruct1) 19 21(lunarStruct2): TypeStruct 13 6(float) 20 22: TypeArray 21(lunarStruct2) 12 - 23: TypePointer UniformConstant 22 - 24(foo2): 23(ptr) Variable UniformConstant + 23: TypePointer Private 22 + 24(foo2): 23(ptr) Variable Private 25: 10(int) Constant 3 26: 10(int) Constant 0 27: 10(int) Constant 4 - 28: TypePointer UniformConstant 10(int) + 28: TypePointer Private 10(int) 31: TypeBool 35: 10(int) Constant 2 36: 11(int) Constant 0 - 37: TypePointer UniformConstant 6(float) + 37: TypePointer Private 6(float) 41: 10(int) Constant 1 44: TypePointer Output 16(fvec4) 45(gl_FragColor): 44(ptr) Variable Output @@ -68,8 +67,8 @@ Linked fragment stage: 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 + 58: TypePointer Private 18(lunarStruct1) + 59(foo): 58(ptr) Variable Private 4(main): 2 Function None 3 5: Label 8(scale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.subpass.frag.out b/Test/baseResults/spv.subpass.frag.out new file mode 100644 index 00000000..6393f6f2 --- /dev/null +++ b/Test/baseResults/spv.subpass.frag.out @@ -0,0 +1,123 @@ +spv.subpass.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 70 + + Capability Shader + Capability InputAttachment + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 27 54 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 11 "foo(iIPM1;" + Name 10 "sb" + Name 15 "icolor" + Name 27 "color" + Name 30 "sub" + Name 35 "subMS" + Name 42 "isub" + Name 46 "isubMS" + Name 54 "ucolor" + Name 57 "usub" + Name 62 "usubMS" + Name 67 "param" + Decorate 30(sub) DescriptorSet 0 + Decorate 30(sub) InputAttachmentIndex 1 + Decorate 35(subMS) DescriptorSet 0 + Decorate 35(subMS) InputAttachmentIndex 2 + Decorate 42(isub) DescriptorSet 0 + Decorate 42(isub) InputAttachmentIndex 3 + Decorate 46(isubMS) DescriptorSet 0 + Decorate 46(isubMS) InputAttachmentIndex 4 + Decorate 57(usub) DescriptorSet 0 + Decorate 57(usub) InputAttachmentIndex 5 + Decorate 62(usubMS) DescriptorSet 0 + Decorate 62(usubMS) InputAttachmentIndex 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeImage 6(int) SubpassData multi-sampled nonsampled format:Unknown + 8: TypePointer Function 7 + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypePointer Output 13(ivec4) + 15(icolor): 14(ptr) Variable Output + 17: 6(int) Constant 3 + 18: 6(int) Constant 0 + 19: TypeVector 6(int) 2 + 20: 19(ivec2) ConstantComposite 18 18 + 24: TypeFloat 32 + 25: TypeVector 24(float) 4 + 26: TypePointer Output 25(fvec4) + 27(color): 26(ptr) Variable Output + 28: TypeImage 24(float) SubpassData nonsampled format:Unknown + 29: TypePointer UniformConstant 28 + 30(sub): 29(ptr) Variable UniformConstant + 33: TypeImage 24(float) SubpassData multi-sampled nonsampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(subMS): 34(ptr) Variable UniformConstant + 40: TypeImage 6(int) SubpassData nonsampled format:Unknown + 41: TypePointer UniformConstant 40 + 42(isub): 41(ptr) Variable UniformConstant + 45: TypePointer UniformConstant 7 + 46(isubMS): 45(ptr) Variable UniformConstant + 51: TypeInt 32 0 + 52: TypeVector 51(int) 4 + 53: TypePointer Output 52(ivec4) + 54(ucolor): 53(ptr) Variable Output + 55: TypeImage 51(int) SubpassData nonsampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(usub): 56(ptr) Variable UniformConstant + 60: TypeImage 51(int) SubpassData multi-sampled nonsampled format:Unknown + 61: TypePointer UniformConstant 60 + 62(usubMS): 61(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 67(param): 8(ptr) Variable Function + 31: 28 Load 30(sub) + 32: 25(fvec4) ImageRead 31 20 + Store 27(color) 32 + 36: 33 Load 35(subMS) + 37: 25(fvec4) ImageRead 36 20 Sample 17 + 38: 25(fvec4) Load 27(color) + 39: 25(fvec4) FAdd 38 37 + Store 27(color) 39 + 43: 40 Load 42(isub) + 44: 13(ivec4) ImageRead 43 20 + Store 15(icolor) 44 + 47: 7 Load 46(isubMS) + 48: 13(ivec4) ImageRead 47 20 Sample 17 + 49: 13(ivec4) Load 15(icolor) + 50: 13(ivec4) IAdd 49 48 + Store 15(icolor) 50 + 58: 55 Load 57(usub) + 59: 52(ivec4) ImageRead 58 20 + Store 54(ucolor) 59 + 63: 60 Load 62(usubMS) + 64: 52(ivec4) ImageRead 63 20 Sample 17 + 65: 52(ivec4) Load 54(ucolor) + 66: 52(ivec4) IAdd 65 64 + Store 54(ucolor) 66 + 68: 7 Load 46(isubMS) + Store 67(param) 68 + 69: 2 FunctionCall 11(foo(iIPM1;) 67(param) + Return + FunctionEnd + 11(foo(iIPM1;): 2 Function None 9 + 10(sb): 8(ptr) FunctionParameter + 12: Label + 16: 7 Load 10(sb) + 21: 13(ivec4) ImageRead 16 20 Sample 17 + 22: 13(ivec4) Load 15(icolor) + 23: 13(ivec4) IAdd 22 21 + Store 15(icolor) 23 + Return + FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index 0d430832..87ea4c87 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -10,13 +10,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 263 +// Id's are bound by 269 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 73 221 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 62 75 129 227 233 + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 15 "foo1(vf4;vf4;i1;" @@ -27,30 +27,154 @@ Linked fragment stage: Name 17 "v1" Name 18 "v2" Name 19 "i1" - Name 58 "local" - Name 60 "c" - Name 71 "f" - Name 73 "x" - Name 127 "d" - Name 153 "i" - Name 171 "j" - Name 221 "color" - Name 227 "v" - Name 228 "param" - Name 230 "param" - Name 232 "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 127(d) RelaxedPrecision - Decorate 153(i) RelaxedPrecision - Decorate 171(j) RelaxedPrecision - Decorate 221(color) RelaxedPrecision - Decorate 227(v) RelaxedPrecision + Name 60 "local" + Name 62 "c" + Name 73 "f" + Name 75 "x" + Name 129 "d" + Name 155 "i" + Name 175 "j" + Name 227 "color" + Name 233 "v" + Name 234 "param" + Name 236 "param" + Name 238 "param" + Name 246 "param" + Name 248 "param" + Name 250 "param" + Decorate 15(foo1(vf4;vf4;i1;) RelaxedPrecision + Decorate 12(v1) RelaxedPrecision + Decorate 13(v2) RelaxedPrecision + Decorate 14(i1) RelaxedPrecision + Decorate 20(foo2(vf4;vf4;i1;) RelaxedPrecision + Decorate 17(v1) RelaxedPrecision + Decorate 18(v2) RelaxedPrecision + Decorate 19(i1) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 29 RelaxedPrecision + Decorate 31 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 40 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 53 RelaxedPrecision + Decorate 54 RelaxedPrecision + Decorate 55 RelaxedPrecision + Decorate 60(local) RelaxedPrecision + Decorate 62(c) RelaxedPrecision + Decorate 62(c) Flat + Decorate 63 RelaxedPrecision + Decorate 64 RelaxedPrecision + Decorate 66 RelaxedPrecision + Decorate 67 RelaxedPrecision + Decorate 73(f) RelaxedPrecision + Decorate 75(x) RelaxedPrecision + Decorate 76 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 80 RelaxedPrecision + Decorate 82 RelaxedPrecision + Decorate 83 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 92 RelaxedPrecision + Decorate 93 RelaxedPrecision + Decorate 94 RelaxedPrecision + Decorate 95 RelaxedPrecision + Decorate 96 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 99 RelaxedPrecision + Decorate 100 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 104 RelaxedPrecision + Decorate 108 RelaxedPrecision + Decorate 109 RelaxedPrecision + Decorate 110 RelaxedPrecision + Decorate 111 RelaxedPrecision + Decorate 113 RelaxedPrecision + Decorate 114 RelaxedPrecision + Decorate 115 RelaxedPrecision + Decorate 116 RelaxedPrecision + Decorate 119 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision + Decorate 127 RelaxedPrecision + Decorate 129(d) RelaxedPrecision + Decorate 129(d) Flat + Decorate 130 RelaxedPrecision + Decorate 134 RelaxedPrecision + Decorate 135 RelaxedPrecision + Decorate 136 RelaxedPrecision + Decorate 137 RelaxedPrecision + Decorate 138 RelaxedPrecision + Decorate 139 RelaxedPrecision + Decorate 140 RelaxedPrecision + Decorate 142 RelaxedPrecision + Decorate 143 RelaxedPrecision + Decorate 144 RelaxedPrecision + Decorate 145 RelaxedPrecision + Decorate 146 RelaxedPrecision + Decorate 150 RelaxedPrecision + Decorate 151 RelaxedPrecision + Decorate 152 RelaxedPrecision + Decorate 153 RelaxedPrecision + Decorate 155(i) RelaxedPrecision + Decorate 162 RelaxedPrecision + Decorate 166 RelaxedPrecision + Decorate 171 RelaxedPrecision + Decorate 172 RelaxedPrecision + Decorate 173 RelaxedPrecision + Decorate 174 RelaxedPrecision + Decorate 175(j) RelaxedPrecision + Decorate 182 RelaxedPrecision + Decorate 185 RelaxedPrecision + Decorate 186 RelaxedPrecision + Decorate 187 RelaxedPrecision + Decorate 193 RelaxedPrecision + Decorate 194 RelaxedPrecision + Decorate 196 RelaxedPrecision + Decorate 197 RelaxedPrecision + Decorate 198 RelaxedPrecision + Decorate 199 RelaxedPrecision + Decorate 202 RelaxedPrecision + Decorate 203 RelaxedPrecision + Decorate 204 RelaxedPrecision + Decorate 205 RelaxedPrecision + Decorate 207 RelaxedPrecision + Decorate 213 RelaxedPrecision + Decorate 214 RelaxedPrecision + Decorate 215 RelaxedPrecision + Decorate 219 RelaxedPrecision + Decorate 220 RelaxedPrecision + Decorate 221 RelaxedPrecision + Decorate 222 RelaxedPrecision + Decorate 227(color) RelaxedPrecision + Decorate 228 RelaxedPrecision + Decorate 229 RelaxedPrecision + Decorate 230 RelaxedPrecision + Decorate 231 RelaxedPrecision + Decorate 233(v) RelaxedPrecision + Decorate 235 RelaxedPrecision + Decorate 237 RelaxedPrecision + Decorate 239 RelaxedPrecision + Decorate 240 RelaxedPrecision + Decorate 243 RelaxedPrecision + Decorate 244 RelaxedPrecision + Decorate 245 RelaxedPrecision + Decorate 247 RelaxedPrecision + Decorate 249 RelaxedPrecision + Decorate 251 RelaxedPrecision + Decorate 252 RelaxedPrecision + Decorate 254 RelaxedPrecision + Decorate 255 RelaxedPrecision + Decorate 256 RelaxedPrecision + Decorate 257 RelaxedPrecision + Decorate 264 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -61,287 +185,295 @@ Linked fragment stage: 11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr) 36: 6(float) Constant 0 37: 7(fvec4) ConstantComposite 36 36 36 36 - 47: 6(float) Constant 1065353216 - 48: 7(fvec4) ConstantComposite 47 47 47 47 - 59: TypePointer UniformConstant 9(int) - 60(c): 59(ptr) Variable UniformConstant - 63: 9(int) Constant 1 - 70: TypePointer Function 6(float) - 72: TypePointer Input 6(float) - 73(x): 72(ptr) Variable Input - 127(d): 59(ptr) Variable UniformConstant - 154: 9(int) Constant 0 - 159: 9(int) Constant 10 - 160: TypeBool - 172: 9(int) Constant 20 - 177: 9(int) Constant 30 - 182: 6(float) Constant 1120429670 - 202: 6(float) Constant 1079739679 - 220: TypePointer Output 6(float) - 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 + 48: 6(float) Constant 1065353216 + 49: 7(fvec4) ConstantComposite 48 48 48 48 + 61: TypePointer Input 9(int) + 62(c): 61(ptr) Variable Input + 65: 9(int) Constant 1 + 72: TypePointer Function 6(float) + 74: TypePointer Input 6(float) + 75(x): 74(ptr) Variable Input + 129(d): 61(ptr) Variable Input + 156: 9(int) Constant 0 + 163: 9(int) Constant 10 + 164: TypeBool + 176: 9(int) Constant 20 + 183: 9(int) Constant 30 + 188: 6(float) Constant 1120429670 + 208: 6(float) Constant 1079739679 + 226: TypePointer Output 6(float) + 227(color): 226(ptr) Variable Output + 232: TypePointer Input 7(fvec4) + 233(v): 232(ptr) Variable Input + 241: TypeInt 32 0 + 242: 241(int) Constant 1 + 253: 241(int) Constant 2 4(main): 2 Function None 3 5: Label - 58(local): 10(ptr) Variable Function - 71(f): 70(ptr) Variable Function - 153(i): 10(ptr) Variable Function - 171(j): 10(ptr) Variable Function - 228(param): 8(ptr) Variable Function - 230(param): 8(ptr) Variable Function - 232(param): 10(ptr) Variable Function - 240(param): 8(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) - 64: 9(int) IAdd 62 63 - Store 58(local) 64 - 65: 9(int) Load 60(c) - SelectionMerge 69 None - Switch 65 68 - case 1: 66 - case 2: 67 - 66: Label - 74: 6(float) Load 73(x) - 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 - Store 71(f) 75 - Branch 69 - 67: Label - 77: 6(float) Load 73(x) - 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 - Store 71(f) 78 - Branch 69 + 60(local): 10(ptr) Variable Function + 73(f): 72(ptr) Variable Function + 155(i): 10(ptr) Variable Function + 175(j): 10(ptr) Variable Function + 234(param): 8(ptr) Variable Function + 236(param): 8(ptr) Variable Function + 238(param): 10(ptr) Variable Function + 246(param): 8(ptr) Variable Function + 248(param): 8(ptr) Variable Function + 250(param): 10(ptr) Variable Function + 63: 9(int) Load 62(c) + Store 60(local) 63 + 64: 9(int) Load 60(local) + 66: 9(int) IAdd 64 65 + Store 60(local) 66 + 67: 9(int) Load 62(c) + SelectionMerge 71 None + Switch 67 70 + case 1: 68 + case 2: 69 + 70: Label + 82: 6(float) Load 75(x) + 83: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 82 + Store 73(f) 83 + Branch 71 68: Label - 80: 6(float) Load 73(x) - 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 - Store 71(f) 81 - Branch 69 - 69: Label - 83: 9(int) Load 60(c) - SelectionMerge 87 None - Switch 83 86 - case 1: 84 - case 2: 85 - 84: Label - 88: 6(float) Load 73(x) - 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 - 90: 6(float) Load 71(f) - 91: 6(float) FAdd 90 89 - Store 71(f) 91 - Branch 85 - 85: Label - 92: 6(float) Load 73(x) - 93: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 92 - 94: 6(float) Load 71(f) - 95: 6(float) FAdd 94 93 - Store 71(f) 95 - Branch 87 + 76: 6(float) Load 75(x) + 77: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 76 + Store 73(f) 77 + Branch 71 + 69: Label + 79: 6(float) Load 75(x) + 80: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 79 + Store 73(f) 80 + Branch 71 + 71: Label + 85: 9(int) Load 62(c) + SelectionMerge 89 None + Switch 85 88 + case 1: 86 + case 2: 87 + 88: Label + 99: 6(float) Load 75(x) + 100: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 99 + 101: 6(float) Load 73(f) + 102: 6(float) FAdd 101 100 + Store 73(f) 102 + Branch 89 86: Label - 97: 6(float) Load 73(x) - 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 - 99: 6(float) Load 71(f) - 100: 6(float) FAdd 99 98 - Store 71(f) 100 + 90: 6(float) Load 75(x) + 91: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 90 + 92: 6(float) Load 73(f) + 93: 6(float) FAdd 92 91 + Store 73(f) 93 Branch 87 - 87: Label - 102: 9(int) Load 60(c) - SelectionMerge 105 None - Switch 102 105 - case 1: 103 - case 2: 104 - 103: Label - 106: 6(float) Load 73(x) - 107: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 106 - 108: 6(float) Load 71(f) - 109: 6(float) FAdd 108 107 - Store 71(f) 109 - Branch 105 - 104: Label - 111: 6(float) Load 73(x) - 112: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 111 - 113: 6(float) Load 71(f) - 114: 6(float) FAdd 113 112 - Store 71(f) 114 - Branch 105 - 105: Label - 117: 9(int) Load 60(c) - SelectionMerge 121 None - Switch 117 120 - case 1: 118 - case 2: 119 - 118: Label - 122: 6(float) Load 73(x) - 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 - 124: 6(float) Load 71(f) - 125: 6(float) FAdd 124 123 - Store 71(f) 125 - Branch 121 - 119: Label - 128: 9(int) Load 127(d) - SelectionMerge 131 None - Switch 128 131 - case 1: 129 - case 2: 130 - 129: Label - 132: 6(float) Load 73(x) - 133: 6(float) Load 73(x) - 134: 6(float) FMul 132 133 - 135: 6(float) Load 73(x) - 136: 6(float) FMul 134 135 - 137: 6(float) Load 71(f) - 138: 6(float) FAdd 137 136 - Store 71(f) 138 - Branch 131 - 130: Label - 140: 6(float) Load 73(x) - 141: 6(float) Load 73(x) - 142: 6(float) FMul 140 141 - 143: 6(float) Load 71(f) - 144: 6(float) FAdd 143 142 - Store 71(f) 144 - Branch 131 - 131: Label - Branch 121 + 87: Label + 94: 6(float) Load 75(x) + 95: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 94 + 96: 6(float) Load 73(f) + 97: 6(float) FAdd 96 95 + Store 73(f) 97 + Branch 89 + 89: Label + 104: 9(int) Load 62(c) + SelectionMerge 107 None + Switch 104 107 + case 1: 105 + case 2: 106 + 105: Label + 108: 6(float) Load 75(x) + 109: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 108 + 110: 6(float) Load 73(f) + 111: 6(float) FAdd 110 109 + Store 73(f) 111 + Branch 107 + 106: Label + 113: 6(float) Load 75(x) + 114: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 113 + 115: 6(float) Load 73(f) + 116: 6(float) FAdd 115 114 + Store 73(f) 116 + Branch 107 + 107: Label + 119: 9(int) Load 62(c) + SelectionMerge 123 None + Switch 119 122 + case 1: 120 + case 2: 121 + 122: Label + 150: 6(float) Load 75(x) + 151: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 150 + 152: 6(float) Load 73(f) + 153: 6(float) FAdd 152 151 + Store 73(f) 153 + Branch 123 120: Label - 148: 6(float) Load 73(x) - 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 - 150: 6(float) Load 71(f) - 151: 6(float) FAdd 150 149 - Store 71(f) 151 - Branch 121 - 121: Label - Store 153(i) 154 - Branch 155 - 155: Label - 158: 9(int) Load 153(i) - 161: 160(bool) SLessThan 158 159 - LoopMerge 156 155 None - BranchConditional 161 157 156 - 157: Label - 162: 9(int) Load 60(c) - SelectionMerge 166 None - Switch 162 165 - case 1: 163 - case 2: 164 - 163: Label - 167: 6(float) Load 73(x) - 168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167 - 169: 6(float) Load 71(f) - 170: 6(float) FAdd 169 168 - Store 71(f) 170 - Store 171(j) 172 - Branch 173 - 173: Label - 176: 9(int) Load 171(j) - 178: 160(bool) SLessThan 176 177 - LoopMerge 174 173 None - BranchConditional 178 175 174 - 175: Label - 179: 6(float) Load 71(f) - 180: 6(float) FAdd 179 47 - Store 71(f) 180 - 181: 6(float) Load 71(f) - 183: 160(bool) FOrdLessThan 181 182 - SelectionMerge 185 None - BranchConditional 183 184 185 - 184: Label - Branch 174 - 185: Label - 187: 9(int) Load 171(j) - 188: 9(int) IAdd 187 63 - Store 171(j) 188 - Branch 173 - 174: Label - Branch 166 - 164: Label - 190: 6(float) Load 73(x) - 191: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 190 - 192: 6(float) Load 71(f) - 193: 6(float) FAdd 192 191 - Store 71(f) 193 - Branch 166 - 165: Label - 196: 6(float) Load 73(x) - 197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 - 198: 6(float) Load 71(f) + 124: 6(float) Load 75(x) + 125: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 124 + 126: 6(float) Load 73(f) + 127: 6(float) FAdd 126 125 + Store 73(f) 127 + Branch 123 + 121: Label + 130: 9(int) Load 129(d) + SelectionMerge 133 None + Switch 130 133 + case 1: 131 + case 2: 132 + 131: Label + 134: 6(float) Load 75(x) + 135: 6(float) Load 75(x) + 136: 6(float) FMul 134 135 + 137: 6(float) Load 75(x) + 138: 6(float) FMul 136 137 + 139: 6(float) Load 73(f) + 140: 6(float) FAdd 139 138 + Store 73(f) 140 + Branch 133 + 132: Label + 142: 6(float) Load 75(x) + 143: 6(float) Load 75(x) + 144: 6(float) FMul 142 143 + 145: 6(float) Load 73(f) + 146: 6(float) FAdd 145 144 + Store 73(f) 146 + Branch 133 + 133: Label + Branch 123 + 123: Label + Store 155(i) 156 + Branch 157 + 157: Label + LoopMerge 159 160 None + Branch 161 + 161: Label + 162: 9(int) Load 155(i) + 165: 164(bool) SLessThan 162 163 + BranchConditional 165 158 159 + 158: Label + 166: 9(int) Load 62(c) + SelectionMerge 170 None + Switch 166 169 + case 1: 167 + case 2: 168 + 169: Label + 202: 6(float) Load 75(x) + 203: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 202 + 204: 6(float) Load 73(f) + 205: 6(float) FAdd 204 203 + Store 73(f) 205 + Branch 170 + 167: Label + 171: 6(float) Load 75(x) + 172: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 171 + 173: 6(float) Load 73(f) + 174: 6(float) FAdd 173 172 + Store 73(f) 174 + Store 175(j) 176 + Branch 177 + 177: Label + LoopMerge 179 180 None + Branch 181 + 181: Label + 182: 9(int) Load 175(j) + 184: 164(bool) SLessThan 182 183 + BranchConditional 184 178 179 + 178: Label + 185: 6(float) Load 73(f) + 186: 6(float) FAdd 185 48 + Store 73(f) 186 + 187: 6(float) Load 73(f) + 189: 164(bool) FOrdLessThan 187 188 + SelectionMerge 191 None + BranchConditional 189 190 191 + 190: Label + Branch 179 + 191: Label + Branch 180 + 180: Label + 193: 9(int) Load 175(j) + 194: 9(int) IAdd 193 65 + Store 175(j) 194 + Branch 177 + 179: Label + Branch 170 + 168: Label + 196: 6(float) Load 75(x) + 197: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 196 + 198: 6(float) Load 73(f) 199: 6(float) FAdd 198 197 - Store 71(f) 199 - Branch 166 - 166: Label - 201: 6(float) Load 71(f) - 203: 160(bool) FOrdLessThan 201 202 - SelectionMerge 205 None - BranchConditional 203 204 205 - 204: Label - Branch 156 - 205: Label - 207: 9(int) Load 153(i) - 208: 9(int) IAdd 207 63 - Store 153(i) 208 - Branch 155 - 156: Label - 209: 9(int) Load 60(c) - SelectionMerge 212 None - Switch 209 212 - case 1: 210 - case 2: 211 - 210: Label - 213: 6(float) Load 73(x) - 214: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 213 - 215: 6(float) Load 71(f) - 216: 6(float) FAdd 215 214 - Store 71(f) 216 - Branch 212 + Store 73(f) 199 + Branch 170 + 170: Label + 207: 6(float) Load 73(f) + 209: 164(bool) FOrdLessThan 207 208 + SelectionMerge 211 None + BranchConditional 209 210 211 + 210: Label + Branch 159 211: Label - Branch 212 - 212: Label - 222: 6(float) Load 71(f) - 223: 9(int) Load 58(local) - 224: 6(float) ConvertSToF 223 - 225: 6(float) FAdd 222 224 - Store 221(color) 225 - 229: 7(fvec4) Load 227(v) - Store 228(param) 229 - 231: 7(fvec4) Load 227(v) - Store 230(param) 231 - 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) - 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: 7(fvec4) Load 227(v) - Store 242(param) 243 - 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) + Branch 160 + 160: Label + 213: 9(int) Load 155(i) + 214: 9(int) IAdd 213 65 + Store 155(i) 214 + Branch 157 + 159: Label + 215: 9(int) Load 62(c) + SelectionMerge 218 None + Switch 215 218 + case 1: 216 + case 2: 217 + 216: Label + 219: 6(float) Load 75(x) + 220: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 219 + 221: 6(float) Load 73(f) + 222: 6(float) FAdd 221 220 + Store 73(f) 222 + Branch 218 + 217: Label + Branch 218 + 218: Label + 228: 6(float) Load 73(f) + 229: 9(int) Load 60(local) + 230: 6(float) ConvertSToF 229 + 231: 6(float) FAdd 228 230 + Store 227(color) 231 + 235: 7(fvec4) Load 233(v) + Store 234(param) 235 + 237: 7(fvec4) Load 233(v) + Store 236(param) 237 + 239: 9(int) Load 62(c) + Store 238(param) 239 + 240: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 234(param) 236(param) 238(param) + 243: 6(float) CompositeExtract 240 1 + 244: 6(float) Load 227(color) + 245: 6(float) FAdd 244 243 + Store 227(color) 245 + 247: 7(fvec4) Load 233(v) + Store 246(param) 247 + 249: 7(fvec4) Load 233(v) + Store 248(param) 249 + 251: 9(int) Load 62(c) + Store 250(param) 251 + 252: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 246(param) 248(param) 250(param) + 254: 6(float) CompositeExtract 252 2 + 255: 6(float) Load 227(color) + 256: 6(float) FAdd 255 254 + Store 227(color) 256 + 257: 9(int) Load 62(c) SelectionMerge 260 None - Switch 258 259 + Switch 257 259 + case 0: 258 259: Label Branch 260 + 258: Label + Branch 260 260: Label + 264: 9(int) Load 62(c) + SelectionMerge 266 None + Switch 264 265 + 265: Label + Branch 266 + 266: Label Return FunctionEnd 15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 @@ -375,26 +507,26 @@ Linked fragment stage: 18(v2): 8(ptr) FunctionParameter 19(i1): 10(ptr) FunctionParameter 21: Label - 39: 9(int) Load 19(i1) - SelectionMerge 44 None - Switch 39 44 - case 0: 40 - case 2: 41 - case 1: 42 - case 3: 43 - 40: Label - 45: 7(fvec4) Load 17(v1) - ReturnValue 45 + 40: 9(int) Load 19(i1) + SelectionMerge 45 None + Switch 40 45 + case 0: 41 + case 2: 42 + case 1: 43 + case 3: 44 41: Label - ReturnValue 48 + 46: 7(fvec4) Load 17(v1) + ReturnValue 46 42: Label - 50: 7(fvec4) Load 18(v2) - ReturnValue 50 + ReturnValue 49 43: Label - 52: 7(fvec4) Load 17(v1) - 53: 7(fvec4) Load 18(v2) - 54: 7(fvec4) FMul 52 53 - ReturnValue 54 - 44: Label + 51: 7(fvec4) Load 18(v2) + ReturnValue 51 + 44: Label + 53: 7(fvec4) Load 17(v1) + 54: 7(fvec4) Load 18(v2) + 55: 7(fvec4) FMul 53 54 + ReturnValue 55 + 45: Label ReturnValue 37 FunctionEnd diff --git a/Test/baseResults/spv.swizzle.frag.out b/Test/baseResults/spv.swizzle.frag.out index bfefdeab..471fed11 100755 --- a/Test/baseResults/spv.swizzle.frag.out +++ b/Test/baseResults/spv.swizzle.frag.out @@ -5,14 +5,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 109 +// Id's are bound by 108 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 30 69 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + EntryPoint Fragment 4 "main" 14 30 69 107 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "blendscale" Name 12 "w" @@ -27,7 +27,7 @@ Linked fragment stage: Name 69 "gl_FragColor" Name 81 "c" Name 83 "rep" - Name 108 "blend" + Name 107 "blend" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -35,8 +35,8 @@ Linked fragment stage: 9: 6(float) Constant 1071971828 10: TypeVector 6(float) 4 11: TypePointer Function 10(fvec4) - 13: TypePointer UniformConstant 10(fvec4) - 14(u): 13(ptr) Variable UniformConstant + 13: TypePointer Input 10(fvec4) + 14(u): 13(ptr) Variable Input 25: TypeInt 32 0 26: 25(int) Constant 2 28: TypeVector 6(float) 2 @@ -45,8 +45,8 @@ Linked fragment stage: 35: 25(int) Constant 0 40: 25(int) Constant 1 54: TypeBool - 55: TypePointer UniformConstant 54(bool) - 56(p): 55(ptr) Variable UniformConstant + 55: TypePointer Private 54(bool) + 56(p): 55(ptr) Variable Private 60: TypePointer Input 6(float) 68: TypePointer Output 10(fvec4) 69(gl_FragColor): 68(ptr) Variable Output @@ -56,8 +56,7 @@ Linked fragment stage: 86: 10(fvec4) ConstantComposite 84 84 84 85 92: 6(float) Constant 3212836864 102: 6(float) Constant 1079613850 - 107: TypePointer UniformConstant 6(float) - 108(blend): 107(ptr) Variable UniformConstant + 107(blend): 60(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.test.frag.out b/Test/baseResults/spv.test.frag.out index 5d9d1205..8f1c5260 100755 --- a/Test/baseResults/spv.test.frag.out +++ b/Test/baseResults/spv.test.frag.out @@ -7,26 +7,28 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 56 +// Id's are bound by 55 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 20 38 44 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 20 22 37 43 46 49 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 8 "blendscale" Name 12 "v" Name 16 "texSampler2D" Name 20 "t" - Name 23 "scale" - Name 30 "w" - Name 34 "texSampler3D" - Name 38 "coords" - Name 44 "gl_FragColor" - Name 47 "u" - Name 50 "blend" + Name 22 "scale" + Name 29 "w" + Name 33 "texSampler3D" + Name 37 "coords" + Name 43 "gl_FragColor" + Name 46 "u" + Name 49 "blend" + Decorate 16(texSampler2D) DescriptorSet 0 + Decorate 33(texSampler3D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -41,49 +43,48 @@ Linked fragment stage: 18: TypeVector 6(float) 2 19: TypePointer Input 18(fvec2) 20(t): 19(ptr) Variable Input - 22: TypePointer UniformConstant 18(fvec2) - 23(scale): 22(ptr) Variable UniformConstant - 31: TypeImage 6(float) 3D sampled format:Unknown - 32: TypeSampledImage 31 - 33: TypePointer UniformConstant 32 -34(texSampler3D): 33(ptr) Variable UniformConstant - 36: TypeVector 6(float) 3 - 37: TypePointer Input 36(fvec3) - 38(coords): 37(ptr) Variable Input - 43: TypePointer Output 10(fvec4) -44(gl_FragColor): 43(ptr) Variable Output - 46: TypePointer UniformConstant 10(fvec4) - 47(u): 46(ptr) Variable UniformConstant - 49: TypePointer UniformConstant 6(float) - 50(blend): 49(ptr) Variable UniformConstant + 22(scale): 19(ptr) Variable Input + 30: TypeImage 6(float) 3D sampled format:Unknown + 31: TypeSampledImage 30 + 32: TypePointer UniformConstant 31 +33(texSampler3D): 32(ptr) Variable UniformConstant + 35: TypeVector 6(float) 3 + 36: TypePointer Input 35(fvec3) + 37(coords): 36(ptr) Variable Input + 42: TypePointer Output 10(fvec4) +43(gl_FragColor): 42(ptr) Variable Output + 45: TypePointer Input 10(fvec4) + 46(u): 45(ptr) Variable Input + 48: TypePointer Input 6(float) + 49(blend): 48(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function 12(v): 11(ptr) Variable Function - 30(w): 11(ptr) Variable Function + 29(w): 11(ptr) Variable Function Store 8(blendscale) 9 17: 14 Load 16(texSampler2D) 21: 18(fvec2) Load 20(t) - 24: 18(fvec2) Load 23(scale) - 25: 18(fvec2) FAdd 21 24 - 26: 18(fvec2) Load 23(scale) - 27: 18(fvec2) FDiv 25 26 - 28: 10(fvec4) ImageSampleImplicitLod 17 27 - 29: 10(fvec4) VectorShuffle 28 28 3 2 1 0 - Store 12(v) 29 - 35: 32 Load 34(texSampler3D) - 39: 36(fvec3) Load 38(coords) - 40: 10(fvec4) ImageSampleImplicitLod 35 39 - 41: 10(fvec4) Load 12(v) - 42: 10(fvec4) FAdd 40 41 - Store 30(w) 42 - 45: 10(fvec4) Load 30(w) - 48: 10(fvec4) Load 47(u) - 51: 6(float) Load 50(blend) - 52: 6(float) Load 8(blendscale) - 53: 6(float) FMul 51 52 - 54: 10(fvec4) CompositeConstruct 53 53 53 53 - 55: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 45 48 54 - Store 44(gl_FragColor) 55 + 23: 18(fvec2) Load 22(scale) + 24: 18(fvec2) FAdd 21 23 + 25: 18(fvec2) Load 22(scale) + 26: 18(fvec2) FDiv 24 25 + 27: 10(fvec4) ImageSampleImplicitLod 17 26 + 28: 10(fvec4) VectorShuffle 27 27 3 2 1 0 + Store 12(v) 28 + 34: 31 Load 33(texSampler3D) + 38: 35(fvec3) Load 37(coords) + 39: 10(fvec4) ImageSampleImplicitLod 34 38 + 40: 10(fvec4) Load 12(v) + 41: 10(fvec4) FAdd 39 40 + Store 29(w) 41 + 44: 10(fvec4) Load 29(w) + 47: 10(fvec4) Load 46(u) + 50: 6(float) Load 49(blend) + 51: 6(float) Load 8(blendscale) + 52: 6(float) FMul 50 51 + 53: 10(fvec4) CompositeConstruct 52 52 52 52 + 54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 44 47 53 + Store 43(gl_FragColor) 54 Return FunctionEnd diff --git a/Test/baseResults/spv.test.vert.out b/Test/baseResults/spv.test.vert.out index f4dfd580..697e468d 100755 --- a/Test/baseResults/spv.test.vert.out +++ b/Test/baseResults/spv.test.vert.out @@ -7,22 +7,20 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 27 +// Id's are bound by 24 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 15 21 26 - Source GLSL 130 + EntryPoint Vertex 4 "main" 9 11 15 18 21 + Source GLSL 140 Name 4 "main" Name 9 "uv" Name 11 "uv_in" Name 15 "gl_Position" Name 18 "transform" Name 21 "position" - Name 26 "gl_VertexID" Decorate 15(gl_Position) BuiltIn Position - Decorate 26(gl_VertexID) BuiltIn VertexId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -35,13 +33,10 @@ Linked vertex stage: 14: TypePointer Output 13(fvec4) 15(gl_Position): 14(ptr) Variable Output 16: TypeMatrix 13(fvec4) 4 - 17: TypePointer UniformConstant 16 - 18(transform): 17(ptr) Variable UniformConstant + 17: TypePointer Input 16 + 18(transform): 17(ptr) Variable Input 20: TypePointer Input 13(fvec4) 21(position): 20(ptr) Variable Input - 24: TypeInt 32 1 - 25: TypePointer Input 24(int) - 26(gl_VertexID): 25(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec2) Load 11(uv_in) diff --git a/Test/baseResults/spv.texture.frag.out b/Test/baseResults/spv.texture.frag.out index 56279325..df5fe2be 100755 --- a/Test/baseResults/spv.texture.frag.out +++ b/Test/baseResults/spv.texture.frag.out @@ -1,6 +1,7 @@ spv.texture.frag -WARNING: 0:14: varying deprecated in version 130; may be removed in future release -WARNING: 0:15: varying deprecated in version 130; may be removed in future release +WARNING: 0:10: varying deprecated in version 130; may be removed in future release +WARNING: 0:11: varying deprecated in version 130; may be removed in future release +WARNING: 0:12: varying deprecated in version 130; may be removed in future release Linked fragment stage: @@ -8,14 +9,15 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 291 +// Id's are bound by 290 Capability Shader + Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 276 290 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 47 276 279 282 288 289 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "blendscale" Name 10 "bias" @@ -39,8 +41,14 @@ Linked fragment stage: Name 276 "gl_FragColor" Name 279 "u" Name 282 "blend" - Name 289 "scale" - Name 290 "t" + Name 288 "scale" + Name 289 "t" + Decorate 32(texSampler1D) DescriptorSet 0 + Decorate 72(texSampler2D) DescriptorSet 0 + Decorate 98(texSampler3D) DescriptorSet 0 + Decorate 124(texSamplerCube) DescriptorSet 0 + Decorate 139(shadowSampler1D) DescriptorSet 0 + Decorate 158(shadowSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -99,13 +107,12 @@ Linked fragment stage: 251: 205(ivec2) ConstantComposite 249 250 275: TypePointer Output 22(fvec4) 276(gl_FragColor): 275(ptr) Variable Output - 278: TypePointer UniformConstant 22(fvec4) - 279(u): 278(ptr) Variable UniformConstant - 281: TypePointer UniformConstant 6(float) - 282(blend): 281(ptr) Variable UniformConstant - 288: TypePointer UniformConstant 45(fvec2) - 289(scale): 288(ptr) Variable UniformConstant - 290(t): 46(ptr) Variable Input + 278: TypePointer Input 22(fvec4) + 279(u): 278(ptr) Variable Input + 281: TypePointer Input 6(float) + 282(blend): 281(ptr) Variable Input + 288(scale): 46(ptr) Variable Input + 289(t): 46(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.texture.vert.out b/Test/baseResults/spv.texture.vert.out index ec48714e..179e567d 100755 --- a/Test/baseResults/spv.texture.vert.out +++ b/Test/baseResults/spv.texture.vert.out @@ -5,13 +5,14 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 145 +// Id's are bound by 142 Capability Shader + Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 39 140 144 - Source GLSL 130 + EntryPoint Vertex 4 "main" 39 140 + Source GLSL 140 Name 4 "main" Name 8 "lod" Name 10 "coords1D" @@ -26,9 +27,13 @@ Linked vertex stage: Name 102 "shadowSampler1D" Name 114 "shadowSampler2D" Name 140 "gl_Position" - Name 144 "gl_VertexID" + Decorate 29(texSampler1D) DescriptorSet 0 + Decorate 54(texSampler2D) DescriptorSet 0 + Decorate 76(texSampler3D) DescriptorSet 0 + Decorate 92(texSamplerCube) DescriptorSet 0 + Decorate 102(shadowSampler1D) DescriptorSet 0 + Decorate 114(shadowSampler2D) DescriptorSet 0 Decorate 140(gl_Position) BuiltIn Position - Decorate 144(gl_VertexID) BuiltIn VertexId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -75,9 +80,6 @@ Linked vertex stage: 114(shadowSampler2D): 113(ptr) Variable UniformConstant 139: TypePointer Output 18(fvec4) 140(gl_Position): 139(ptr) Variable Output - 142: TypeInt 32 1 - 143: TypePointer Input 142(int) -144(gl_VertexID): 143(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(lod): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.types.frag.out b/Test/baseResults/spv.types.frag.out index 04a66402..4295370d 100755 --- a/Test/baseResults/spv.types.frag.out +++ b/Test/baseResults/spv.types.frag.out @@ -5,14 +5,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 268 +// Id's are bound by 260 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 94 104 114 124 134 144 154 164 168 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 91 93 100 102 109 111 118 120 127 129 136 138 145 147 154 156 160 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 8 "b" Name 10 "u_b" @@ -28,112 +28,108 @@ Linked fragment stage: Name 64 "i_b4" Name 89 "i" Name 91 "u_i" - Name 94 "i_i" - Name 99 "i2" - Name 101 "u_i2" - Name 104 "i_i2" - Name 109 "i3" - Name 111 "u_i3" - Name 114 "i_i3" - Name 119 "i4" - Name 121 "u_i4" - Name 124 "i_i4" - Name 129 "f" - Name 131 "u_f" - Name 134 "i_f" - Name 139 "f2" - Name 141 "u_f2" - Name 144 "i_f2" - Name 149 "f3" - Name 151 "u_f3" - Name 154 "i_f3" - Name 159 "f4" - Name 161 "u_f4" - Name 164 "i_f4" - Name 168 "gl_FragColor" - Decorate 94(i_i) Flat - Decorate 104(i_i2) Flat - Decorate 114(i_i3) Flat - Decorate 124(i_i4) Flat + Name 93 "i_i" + Name 98 "i2" + Name 100 "u_i2" + Name 102 "i_i2" + Name 107 "i3" + Name 109 "u_i3" + Name 111 "i_i3" + Name 116 "i4" + Name 118 "u_i4" + Name 120 "i_i4" + Name 125 "f" + Name 127 "u_f" + Name 129 "i_f" + Name 134 "f2" + Name 136 "u_f2" + Name 138 "i_f2" + Name 143 "f3" + Name 145 "u_f3" + Name 147 "i_f3" + Name 152 "f4" + Name 154 "u_f4" + Name 156 "i_f4" + Name 160 "gl_FragColor" + Decorate 91(u_i) Flat + Decorate 93(i_i) Flat + Decorate 100(u_i2) Flat + Decorate 102(i_i2) Flat + Decorate 109(u_i3) Flat + Decorate 111(i_i3) Flat + Decorate 118(u_i4) Flat + Decorate 120(i_i4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeBool 7: TypePointer Function 6(bool) - 9: TypePointer UniformConstant 6(bool) - 10(u_b): 9(ptr) Variable UniformConstant - 12(i_b): 9(ptr) Variable UniformConstant + 9: TypePointer Private 6(bool) + 10(u_b): 9(ptr) Variable Private + 12(i_b): 9(ptr) Variable Private 15: TypeVector 6(bool) 2 16: TypePointer Function 15(bvec2) - 18: TypePointer UniformConstant 15(bvec2) - 19(u_b2): 18(ptr) Variable UniformConstant - 22(i_b2): 18(ptr) Variable UniformConstant + 18: TypePointer Private 15(bvec2) + 19(u_b2): 18(ptr) Variable Private + 22(i_b2): 18(ptr) Variable Private 33: TypeVector 6(bool) 3 34: TypePointer Function 33(bvec3) - 36: TypePointer UniformConstant 33(bvec3) - 37(u_b3): 36(ptr) Variable UniformConstant - 40(i_b3): 36(ptr) Variable UniformConstant + 36: TypePointer Private 33(bvec3) + 37(u_b3): 36(ptr) Variable Private + 40(i_b3): 36(ptr) Variable Private 57: TypeVector 6(bool) 4 58: TypePointer Function 57(bvec4) - 60: TypePointer UniformConstant 57(bvec4) - 61(u_b4): 60(ptr) Variable UniformConstant - 64(i_b4): 60(ptr) Variable UniformConstant + 60: TypePointer Private 57(bvec4) + 61(u_b4): 60(ptr) Variable Private + 64(i_b4): 60(ptr) Variable Private 87: TypeInt 32 1 88: TypePointer Function 87(int) - 90: TypePointer UniformConstant 87(int) - 91(u_i): 90(ptr) Variable UniformConstant - 93: TypePointer Input 87(int) - 94(i_i): 93(ptr) Variable Input - 97: TypeVector 87(int) 2 - 98: TypePointer Function 97(ivec2) - 100: TypePointer UniformConstant 97(ivec2) - 101(u_i2): 100(ptr) Variable UniformConstant - 103: TypePointer Input 97(ivec2) - 104(i_i2): 103(ptr) Variable Input - 107: TypeVector 87(int) 3 - 108: TypePointer Function 107(ivec3) - 110: TypePointer UniformConstant 107(ivec3) - 111(u_i3): 110(ptr) Variable UniformConstant - 113: TypePointer Input 107(ivec3) - 114(i_i3): 113(ptr) Variable Input - 117: TypeVector 87(int) 4 - 118: TypePointer Function 117(ivec4) - 120: TypePointer UniformConstant 117(ivec4) - 121(u_i4): 120(ptr) Variable UniformConstant - 123: TypePointer Input 117(ivec4) - 124(i_i4): 123(ptr) Variable Input - 127: TypeFloat 32 - 128: TypePointer Function 127(float) - 130: TypePointer UniformConstant 127(float) - 131(u_f): 130(ptr) Variable UniformConstant - 133: TypePointer Input 127(float) - 134(i_f): 133(ptr) Variable Input - 137: TypeVector 127(float) 2 - 138: TypePointer Function 137(fvec2) - 140: TypePointer UniformConstant 137(fvec2) - 141(u_f2): 140(ptr) Variable UniformConstant - 143: TypePointer Input 137(fvec2) - 144(i_f2): 143(ptr) Variable Input - 147: TypeVector 127(float) 3 - 148: TypePointer Function 147(fvec3) - 150: TypePointer UniformConstant 147(fvec3) - 151(u_f3): 150(ptr) Variable UniformConstant - 153: TypePointer Input 147(fvec3) - 154(i_f3): 153(ptr) Variable Input - 157: TypeVector 127(float) 4 - 158: TypePointer Function 157(fvec4) - 160: TypePointer UniformConstant 157(fvec4) - 161(u_f4): 160(ptr) Variable UniformConstant - 163: TypePointer Input 157(fvec4) - 164(i_f4): 163(ptr) Variable Input - 167: TypePointer Output 157(fvec4) -168(gl_FragColor): 167(ptr) Variable Output - 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 + 90: TypePointer Input 87(int) + 91(u_i): 90(ptr) Variable Input + 93(i_i): 90(ptr) Variable Input + 96: TypeVector 87(int) 2 + 97: TypePointer Function 96(ivec2) + 99: TypePointer Input 96(ivec2) + 100(u_i2): 99(ptr) Variable Input + 102(i_i2): 99(ptr) Variable Input + 105: TypeVector 87(int) 3 + 106: TypePointer Function 105(ivec3) + 108: TypePointer Input 105(ivec3) + 109(u_i3): 108(ptr) Variable Input + 111(i_i3): 108(ptr) Variable Input + 114: TypeVector 87(int) 4 + 115: TypePointer Function 114(ivec4) + 117: TypePointer Input 114(ivec4) + 118(u_i4): 117(ptr) Variable Input + 120(i_i4): 117(ptr) Variable Input + 123: TypeFloat 32 + 124: TypePointer Function 123(float) + 126: TypePointer Input 123(float) + 127(u_f): 126(ptr) Variable Input + 129(i_f): 126(ptr) Variable Input + 132: TypeVector 123(float) 2 + 133: TypePointer Function 132(fvec2) + 135: TypePointer Input 132(fvec2) + 136(u_f2): 135(ptr) Variable Input + 138(i_f2): 135(ptr) Variable Input + 141: TypeVector 123(float) 3 + 142: TypePointer Function 141(fvec3) + 144: TypePointer Input 141(fvec3) + 145(u_f3): 144(ptr) Variable Input + 147(i_f3): 144(ptr) Variable Input + 150: TypeVector 123(float) 4 + 151: TypePointer Function 150(fvec4) + 153: TypePointer Input 150(fvec4) + 154(u_f4): 153(ptr) Variable Input + 156(i_f4): 153(ptr) Variable Input + 159: TypePointer Output 150(fvec4) +160(gl_FragColor): 159(ptr) Variable Output + 193: TypeInt 32 0 + 194: 193(int) Constant 0 + 198: 193(int) Constant 1 + 208: 193(int) Constant 2 + 221: 193(int) Constant 3 + 257: 123(float) Constant 1065353216 + 258: 150(fvec4) ConstantComposite 257 257 257 257 4(main): 2 Function None 3 5: Label 8(b): 7(ptr) Variable Function @@ -141,14 +137,14 @@ Linked fragment stage: 35(b3): 34(ptr) Variable Function 59(b4): 58(ptr) Variable Function 89(i): 88(ptr) Variable Function - 99(i2): 98(ptr) Variable Function - 109(i3): 108(ptr) Variable Function - 119(i4): 118(ptr) Variable Function - 129(f): 128(ptr) Variable Function - 139(f2): 138(ptr) Variable Function - 149(f3): 148(ptr) Variable Function - 159(f4): 158(ptr) Variable Function - 169: 158(ptr) Variable Function + 98(i2): 97(ptr) Variable Function + 107(i3): 106(ptr) Variable Function + 116(i4): 115(ptr) Variable Function + 125(f): 124(ptr) Variable Function + 134(f2): 133(ptr) Variable Function + 143(f3): 142(ptr) Variable Function + 152(f4): 151(ptr) Variable Function + 161: 151(ptr) Variable Function 11: 6(bool) Load 10(u_b) 13: 6(bool) Load 12(i_b) 14: 6(bool) LogicalAnd 11 13 @@ -211,134 +207,134 @@ Linked fragment stage: 86: 57(bvec4) CompositeConstruct 85 85 85 85 Store 59(b4) 86 92: 87(int) Load 91(u_i) - 95: 87(int) Load 94(i_i) - 96: 87(int) IAdd 92 95 - Store 89(i) 96 - 102: 97(ivec2) Load 101(u_i2) - 105: 97(ivec2) Load 104(i_i2) - 106: 97(ivec2) IAdd 102 105 - Store 99(i2) 106 - 112: 107(ivec3) Load 111(u_i3) - 115: 107(ivec3) Load 114(i_i3) - 116: 107(ivec3) IAdd 112 115 - Store 109(i3) 116 - 122: 117(ivec4) Load 121(u_i4) - 125: 117(ivec4) Load 124(i_i4) - 126: 117(ivec4) IAdd 122 125 - Store 119(i4) 126 - 132: 127(float) Load 131(u_f) - 135: 127(float) Load 134(i_f) - 136: 127(float) FAdd 132 135 - Store 129(f) 136 - 142: 137(fvec2) Load 141(u_f2) - 145: 137(fvec2) Load 144(i_f2) - 146: 137(fvec2) FAdd 142 145 - Store 139(f2) 146 - 152: 147(fvec3) Load 151(u_f3) - 155: 147(fvec3) Load 154(i_f3) - 156: 147(fvec3) FAdd 152 155 - Store 149(f3) 156 - 162: 157(fvec4) Load 161(u_f4) - 165: 157(fvec4) Load 164(i_f4) - 166: 157(fvec4) FAdd 162 165 - Store 159(f4) 166 - 170: 6(bool) Load 8(b) - 171: 15(bvec2) Load 17(b2) - 172: 6(bool) CompositeExtract 171 0 - 173: 6(bool) LogicalOr 170 172 - 174: 15(bvec2) Load 17(b2) - 175: 6(bool) CompositeExtract 174 1 - 176: 6(bool) LogicalOr 173 175 - 177: 33(bvec3) Load 35(b3) - 178: 6(bool) CompositeExtract 177 0 - 179: 6(bool) LogicalOr 176 178 - 180: 33(bvec3) Load 35(b3) - 181: 6(bool) CompositeExtract 180 1 - 182: 6(bool) LogicalOr 179 181 - 183: 33(bvec3) Load 35(b3) - 184: 6(bool) CompositeExtract 183 2 - 185: 6(bool) LogicalOr 182 184 - 186: 57(bvec4) Load 59(b4) - 187: 6(bool) CompositeExtract 186 0 - 188: 6(bool) LogicalOr 185 187 - 189: 57(bvec4) Load 59(b4) - 190: 6(bool) CompositeExtract 189 1 - 191: 6(bool) LogicalOr 188 190 - 192: 57(bvec4) Load 59(b4) - 193: 6(bool) CompositeExtract 192 2 - 194: 6(bool) LogicalOr 191 193 - 195: 57(bvec4) Load 59(b4) - 196: 6(bool) CompositeExtract 195 3 - 197: 6(bool) LogicalOr 194 196 - SelectionMerge 199 None - BranchConditional 197 198 264 - 198: Label - 200: 87(int) Load 89(i) - 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: 88(ptr) AccessChain 109(i3) 206 - 214: 87(int) Load 213 - 215: 87(int) IAdd 212 214 - 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 - 264: Label - Store 169 266 - Branch 199 - 199: Label - 267: 157(fvec4) Load 169 - Store 168(gl_FragColor) 267 + 94: 87(int) Load 93(i_i) + 95: 87(int) IAdd 92 94 + Store 89(i) 95 + 101: 96(ivec2) Load 100(u_i2) + 103: 96(ivec2) Load 102(i_i2) + 104: 96(ivec2) IAdd 101 103 + Store 98(i2) 104 + 110: 105(ivec3) Load 109(u_i3) + 112: 105(ivec3) Load 111(i_i3) + 113: 105(ivec3) IAdd 110 112 + Store 107(i3) 113 + 119: 114(ivec4) Load 118(u_i4) + 121: 114(ivec4) Load 120(i_i4) + 122: 114(ivec4) IAdd 119 121 + Store 116(i4) 122 + 128: 123(float) Load 127(u_f) + 130: 123(float) Load 129(i_f) + 131: 123(float) FAdd 128 130 + Store 125(f) 131 + 137: 132(fvec2) Load 136(u_f2) + 139: 132(fvec2) Load 138(i_f2) + 140: 132(fvec2) FAdd 137 139 + Store 134(f2) 140 + 146: 141(fvec3) Load 145(u_f3) + 148: 141(fvec3) Load 147(i_f3) + 149: 141(fvec3) FAdd 146 148 + Store 143(f3) 149 + 155: 150(fvec4) Load 154(u_f4) + 157: 150(fvec4) Load 156(i_f4) + 158: 150(fvec4) FAdd 155 157 + Store 152(f4) 158 + 162: 6(bool) Load 8(b) + 163: 15(bvec2) Load 17(b2) + 164: 6(bool) CompositeExtract 163 0 + 165: 6(bool) LogicalOr 162 164 + 166: 15(bvec2) Load 17(b2) + 167: 6(bool) CompositeExtract 166 1 + 168: 6(bool) LogicalOr 165 167 + 169: 33(bvec3) Load 35(b3) + 170: 6(bool) CompositeExtract 169 0 + 171: 6(bool) LogicalOr 168 170 + 172: 33(bvec3) Load 35(b3) + 173: 6(bool) CompositeExtract 172 1 + 174: 6(bool) LogicalOr 171 173 + 175: 33(bvec3) Load 35(b3) + 176: 6(bool) CompositeExtract 175 2 + 177: 6(bool) LogicalOr 174 176 + 178: 57(bvec4) Load 59(b4) + 179: 6(bool) CompositeExtract 178 0 + 180: 6(bool) LogicalOr 177 179 + 181: 57(bvec4) Load 59(b4) + 182: 6(bool) CompositeExtract 181 1 + 183: 6(bool) LogicalOr 180 182 + 184: 57(bvec4) Load 59(b4) + 185: 6(bool) CompositeExtract 184 2 + 186: 6(bool) LogicalOr 183 185 + 187: 57(bvec4) Load 59(b4) + 188: 6(bool) CompositeExtract 187 3 + 189: 6(bool) LogicalOr 186 188 + SelectionMerge 191 None + BranchConditional 189 190 256 + 190: Label + 192: 87(int) Load 89(i) + 195: 88(ptr) AccessChain 98(i2) 194 + 196: 87(int) Load 195 + 197: 87(int) IAdd 192 196 + 199: 88(ptr) AccessChain 98(i2) 198 + 200: 87(int) Load 199 + 201: 87(int) IAdd 197 200 + 202: 88(ptr) AccessChain 107(i3) 194 + 203: 87(int) Load 202 + 204: 87(int) IAdd 201 203 + 205: 88(ptr) AccessChain 107(i3) 198 + 206: 87(int) Load 205 + 207: 87(int) IAdd 204 206 + 209: 88(ptr) AccessChain 107(i3) 208 + 210: 87(int) Load 209 + 211: 87(int) IAdd 207 210 + 212: 88(ptr) AccessChain 116(i4) 194 + 213: 87(int) Load 212 + 214: 87(int) IAdd 211 213 + 215: 88(ptr) AccessChain 116(i4) 198 + 216: 87(int) Load 215 + 217: 87(int) IAdd 214 216 + 218: 88(ptr) AccessChain 116(i4) 208 + 219: 87(int) Load 218 + 220: 87(int) IAdd 217 219 + 222: 88(ptr) AccessChain 116(i4) 221 + 223: 87(int) Load 222 + 224: 87(int) IAdd 220 223 + 225: 123(float) ConvertSToF 224 + 226: 123(float) Load 125(f) + 227: 123(float) FAdd 225 226 + 228: 124(ptr) AccessChain 134(f2) 194 + 229: 123(float) Load 228 + 230: 123(float) FAdd 227 229 + 231: 124(ptr) AccessChain 134(f2) 198 + 232: 123(float) Load 231 + 233: 123(float) FAdd 230 232 + 234: 124(ptr) AccessChain 143(f3) 194 + 235: 123(float) Load 234 + 236: 123(float) FAdd 233 235 + 237: 124(ptr) AccessChain 143(f3) 198 + 238: 123(float) Load 237 + 239: 123(float) FAdd 236 238 + 240: 124(ptr) AccessChain 143(f3) 208 + 241: 123(float) Load 240 + 242: 123(float) FAdd 239 241 + 243: 124(ptr) AccessChain 152(f4) 194 + 244: 123(float) Load 243 + 245: 123(float) FAdd 242 244 + 246: 124(ptr) AccessChain 152(f4) 198 + 247: 123(float) Load 246 + 248: 123(float) FAdd 245 247 + 249: 124(ptr) AccessChain 152(f4) 208 + 250: 123(float) Load 249 + 251: 123(float) FAdd 248 250 + 252: 124(ptr) AccessChain 152(f4) 221 + 253: 123(float) Load 252 + 254: 123(float) FAdd 251 253 + 255: 150(fvec4) CompositeConstruct 254 254 254 254 + Store 161 255 + Branch 191 + 256: Label + Store 161 258 + Branch 191 + 191: Label + 259: 150(fvec4) Load 161 + Store 160(gl_FragColor) 259 Return FunctionEnd diff --git a/Test/baseResults/spv.uint.frag.out b/Test/baseResults/spv.uint.frag.out index 3dc929b4..7d934ff1 100755 --- a/Test/baseResults/spv.uint.frag.out +++ b/Test/baseResults/spv.uint.frag.out @@ -1,4 +1,6 @@ spv.uint.frag +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: @@ -10,9 +12,9 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 15 68 77 200 - ExecutionMode 4 OriginLowerLeft - Source ESSL 300 + EntryPoint Fragment 4 "main" 15 68 77 200 202 204 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 Name 4 "main" Name 8 "count" Name 12 "u" @@ -39,22 +41,108 @@ Linked fragment stage: Decorate 12(u) RelaxedPrecision Decorate 15(t) RelaxedPrecision Decorate 15(t) Flat + Decorate 19 RelaxedPrecision + Decorate 21 RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 28 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 39 RelaxedPrecision + Decorate 43 RelaxedPrecision + Decorate 44 RelaxedPrecision + Decorate 48 RelaxedPrecision + Decorate 49 RelaxedPrecision + Decorate 53 RelaxedPrecision + Decorate 54 RelaxedPrecision Decorate 55(shiftedii) RelaxedPrecision Decorate 57(shiftedui) RelaxedPrecision Decorate 59(shiftediu) RelaxedPrecision Decorate 60(shifteduu) RelaxedPrecision + Decorate 61 RelaxedPrecision + Decorate 62 RelaxedPrecision Decorate 68(c) RelaxedPrecision Decorate 72(usampler) RelaxedPrecision + Decorate 72(usampler) DescriptorSet 0 + Decorate 73 RelaxedPrecision Decorate 77(tc) RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 80 RelaxedPrecision + Decorate 81 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 86 RelaxedPrecision + Decorate 88 RelaxedPrecision + Decorate 89 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 92 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 98 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 105 RelaxedPrecision Decorate 111(af) RelaxedPrecision + Decorate 112 RelaxedPrecision + Decorate 113 RelaxedPrecision + Decorate 116 RelaxedPrecision Decorate 118(ai) RelaxedPrecision + Decorate 119 RelaxedPrecision + Decorate 120 RelaxedPrecision + Decorate 121 RelaxedPrecision + Decorate 122 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision + Decorate 127 RelaxedPrecision + Decorate 128 RelaxedPrecision + Decorate 129 RelaxedPrecision + Decorate 130 RelaxedPrecision + Decorate 131 RelaxedPrecision + Decorate 135 RelaxedPrecision + Decorate 136 RelaxedPrecision + Decorate 140 RelaxedPrecision + Decorate 141 RelaxedPrecision + Decorate 145 RelaxedPrecision + Decorate 146 RelaxedPrecision + Decorate 150 RelaxedPrecision + Decorate 151 RelaxedPrecision Decorate 152(mask1) RelaxedPrecision Decorate 154(mask2) RelaxedPrecision Decorate 156(mask3) RelaxedPrecision + Decorate 157 RelaxedPrecision + Decorate 159 RelaxedPrecision Decorate 160(mask4) RelaxedPrecision + Decorate 162 RelaxedPrecision + Decorate 163 RelaxedPrecision + Decorate 167 RelaxedPrecision + Decorate 168 RelaxedPrecision + Decorate 169 RelaxedPrecision + Decorate 170 RelaxedPrecision + Decorate 171 RelaxedPrecision + Decorate 175 RelaxedPrecision + Decorate 176 RelaxedPrecision + Decorate 177 RelaxedPrecision + Decorate 178 RelaxedPrecision + Decorate 179 RelaxedPrecision + Decorate 180 RelaxedPrecision + Decorate 184 RelaxedPrecision + Decorate 185 RelaxedPrecision + Decorate 186 RelaxedPrecision + Decorate 187 RelaxedPrecision + Decorate 188 RelaxedPrecision + Decorate 192 RelaxedPrecision + Decorate 193 RelaxedPrecision + Decorate 194 RelaxedPrecision + Decorate 195 RelaxedPrecision + Decorate 196 RelaxedPrecision + Decorate 197 RelaxedPrecision + Decorate 198 RelaxedPrecision Decorate 200(f) RelaxedPrecision Decorate 202(v) RelaxedPrecision + Decorate 202(v) Flat Decorate 204(i) RelaxedPrecision + Decorate 204(i) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -107,12 +195,12 @@ Linked fragment stage: 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 + 201: TypePointer Input 66(ivec4) + 202(v): 201(ptr) Variable Input + 203: TypePointer Input 6(int) + 204(i): 203(ptr) Variable Input + 205: TypePointer Private 22(bool) + 206(b): 205(ptr) Variable Private 4(main): 2 Function None 3 5: Label 8(count): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.uniformArray.frag.out b/Test/baseResults/spv.uniformArray.frag.out old mode 100755 new mode 100644 index 963df924..e66eda6b --- a/Test/baseResults/spv.uniformArray.frag.out +++ b/Test/baseResults/spv.uniformArray.frag.out @@ -10,9 +10,9 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 14 25 35 47 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "texColor" Name 14 "color" @@ -20,6 +20,7 @@ Linked fragment stage: Name 35 "alpha" Name 47 "gl_FragColor" Name 52 "texSampler2D" + Decorate 52(texSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -28,20 +29,20 @@ Linked fragment stage: 10: TypeInt 32 0 11: 10(int) Constant 6 12: TypeArray 7(fvec4) 11 - 13: TypePointer UniformConstant 12 - 14(color): 13(ptr) Variable UniformConstant + 13: TypePointer Input 12 + 14(color): 13(ptr) Variable Input 15: TypeInt 32 1 16: 15(int) Constant 1 - 17: TypePointer UniformConstant 7(fvec4) + 17: TypePointer Input 7(fvec4) 23: TypeVector 6(float) 3 - 24: TypePointer UniformConstant 23(fvec3) - 25(inColor): 24(ptr) Variable UniformConstant + 24: TypePointer Input 23(fvec3) + 25(inColor): 24(ptr) Variable Input 32: 10(int) Constant 16 33: TypeArray 6(float) 32 - 34: TypePointer UniformConstant 33 - 35(alpha): 34(ptr) Variable UniformConstant + 34: TypePointer Input 33 + 35(alpha): 34(ptr) Variable Input 36: 15(int) Constant 12 - 37: TypePointer UniformConstant 6(float) + 37: TypePointer Input 6(float) 40: 10(int) Constant 3 41: TypePointer Function 6(float) 46: TypePointer Output 7(fvec4) diff --git a/Test/baseResults/spv.variableArrayIndex.frag.out b/Test/baseResults/spv.variableArrayIndex.frag.out index abd39080..75ed07ee 100755 --- a/Test/baseResults/spv.variableArrayIndex.frag.out +++ b/Test/baseResults/spv.variableArrayIndex.frag.out @@ -1,5 +1,5 @@ spv.variableArrayIndex.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. Linked fragment stage: @@ -7,14 +7,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 93 +// Id's are bound by 97 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 54 63 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 10 21 37 40 58 67 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 8 "iLocal" Name 10 "Count" @@ -25,120 +25,157 @@ Linked fragment stage: MemberName 14(lunarStruct2) 0 "i" MemberName 14(lunarStruct2) 1 "f" MemberName 14(lunarStruct2) 2 "s1_1" - Name 18 "lunarStruct3" - MemberName 18(lunarStruct3) 0 "s2_1" - MemberName 18(lunarStruct3) 1 "i" - MemberName 18(lunarStruct3) 2 "f" - MemberName 18(lunarStruct3) 3 "s1_1" - Name 20 "foo3" - Name 30 "scale" - Name 34 "foo2" - Name 36 "foo" - Name 54 "gl_FragColor" - Name 59 "samp2D" - Name 63 "coord" - Name 69 "constructed" + Name 18 "lunarStruct1" + MemberName 18(lunarStruct1) 0 "i" + MemberName 18(lunarStruct1) 1 "f" + Name 19 "lunarStruct3" + MemberName 19(lunarStruct3) 0 "s2_1" + MemberName 19(lunarStruct3) 1 "i" + MemberName 19(lunarStruct3) 2 "f" + MemberName 19(lunarStruct3) 3 "s1_1" + Name 21 "foo3" + Name 31 "scale" + Name 32 "lunarStruct1" + MemberName 32(lunarStruct1) 0 "i" + MemberName 32(lunarStruct1) 1 "f" + Name 33 "lunarStruct2" + MemberName 33(lunarStruct2) 0 "i" + MemberName 33(lunarStruct2) 1 "f" + MemberName 33(lunarStruct2) 2 "s1_1" + Name 37 "foo2" + Name 38 "lunarStruct1" + MemberName 38(lunarStruct1) 0 "i" + MemberName 38(lunarStruct1) 1 "f" + Name 40 "foo" + Name 58 "gl_FragColor" + Name 63 "samp2D" + Name 67 "coord" + Name 73 "constructed" + Decorate 10(Count) Flat + MemberDecorate 13(lunarStruct1) 0 Flat + MemberDecorate 13(lunarStruct1) 1 Flat + MemberDecorate 14(lunarStruct2) 0 Flat + MemberDecorate 14(lunarStruct2) 1 Flat + MemberDecorate 14(lunarStruct2) 2 Flat + MemberDecorate 18(lunarStruct1) 0 Flat + MemberDecorate 18(lunarStruct1) 1 Flat + MemberDecorate 19(lunarStruct3) 0 Flat + MemberDecorate 19(lunarStruct3) 1 Flat + MemberDecorate 19(lunarStruct3) 2 Flat + MemberDecorate 19(lunarStruct3) 3 Flat + MemberDecorate 32(lunarStruct1) 0 Flat + MemberDecorate 32(lunarStruct1) 1 Flat + MemberDecorate 33(lunarStruct2) 0 Flat + MemberDecorate 33(lunarStruct2) 1 Flat + MemberDecorate 33(lunarStruct2) 2 Flat + MemberDecorate 38(lunarStruct1) 0 Flat + MemberDecorate 38(lunarStruct1) 1 Flat + Decorate 63(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) - 9: TypePointer UniformConstant 6(int) - 10(Count): 9(ptr) Variable UniformConstant + 9: TypePointer Input 6(int) + 10(Count): 9(ptr) Variable Input 12: TypeFloat 32 13(lunarStruct1): TypeStruct 6(int) 12(float) 14(lunarStruct2): TypeStruct 6(int) 12(float) 13(lunarStruct1) 15: TypeInt 32 0 16: 15(int) Constant 3 17: TypeArray 14(lunarStruct2) 16 -18(lunarStruct3): TypeStruct 17 6(int) 12(float) 13(lunarStruct1) - 19: TypePointer UniformConstant 18(lunarStruct3) - 20(foo3): 19(ptr) Variable UniformConstant - 21: 6(int) Constant 0 - 22: 6(int) Constant 1 - 25: TypeBool - 29: TypePointer Function 12(float) - 31: 15(int) Constant 5 - 32: TypeArray 14(lunarStruct2) 31 - 33: TypePointer UniformConstant 32 - 34(foo2): 33(ptr) Variable UniformConstant - 35: TypePointer UniformConstant 13(lunarStruct1) - 36(foo): 35(ptr) Variable UniformConstant - 41: 6(int) Constant 2 - 46: TypePointer UniformConstant 12(float) - 52: TypeVector 12(float) 4 - 53: TypePointer Output 52(fvec4) -54(gl_FragColor): 53(ptr) Variable Output - 56: TypeImage 12(float) 2D sampled format:Unknown - 57: TypeSampledImage 56 - 58: TypePointer UniformConstant 57 - 59(samp2D): 58(ptr) Variable UniformConstant - 61: TypeVector 12(float) 2 - 62: TypePointer Input 61(fvec2) - 63(coord): 62(ptr) Variable Input - 67: TypeArray 61(fvec2) 16 - 68: TypePointer Function 67 - 73: 12(float) Constant 1065353216 - 74: 12(float) Constant 1073741824 - 75: 61(fvec2) ConstantComposite 73 74 - 79: TypePointer Function 61(fvec2) +18(lunarStruct1): TypeStruct 6(int) 12(float) +19(lunarStruct3): TypeStruct 17 6(int) 12(float) 18(lunarStruct1) + 20: TypePointer Input 19(lunarStruct3) + 21(foo3): 20(ptr) Variable Input + 22: 6(int) Constant 0 + 23: 6(int) Constant 1 + 26: TypeBool + 30: TypePointer Function 12(float) +32(lunarStruct1): TypeStruct 6(int) 12(float) +33(lunarStruct2): TypeStruct 6(int) 12(float) 32(lunarStruct1) + 34: 15(int) Constant 5 + 35: TypeArray 33(lunarStruct2) 34 + 36: TypePointer Input 35 + 37(foo2): 36(ptr) Variable Input +38(lunarStruct1): TypeStruct 6(int) 12(float) + 39: TypePointer Input 38(lunarStruct1) + 40(foo): 39(ptr) Variable Input + 45: 6(int) Constant 2 + 50: TypePointer Input 12(float) + 56: TypeVector 12(float) 4 + 57: TypePointer Output 56(fvec4) +58(gl_FragColor): 57(ptr) Variable Output + 60: TypeImage 12(float) 2D sampled format:Unknown + 61: TypeSampledImage 60 + 62: TypePointer UniformConstant 61 + 63(samp2D): 62(ptr) Variable UniformConstant + 65: TypeVector 12(float) 2 + 66: TypePointer Input 65(fvec2) + 67(coord): 66(ptr) Variable Input + 71: TypeArray 65(fvec2) 16 + 72: TypePointer Function 71 + 77: 12(float) Constant 1065353216 + 78: 12(float) Constant 1073741824 + 79: 65(fvec2) ConstantComposite 77 78 + 83: TypePointer Function 65(fvec2) 4(main): 2 Function None 3 5: Label 8(iLocal): 7(ptr) Variable Function - 30(scale): 29(ptr) Variable Function - 69(constructed): 68(ptr) Variable Function + 31(scale): 30(ptr) Variable Function + 73(constructed): 72(ptr) Variable Function 11: 6(int) Load 10(Count) Store 8(iLocal) 11 - 23: 9(ptr) AccessChain 20(foo3) 21 22 21 - 24: 6(int) Load 23 - 26: 25(bool) SGreaterThan 24 21 - SelectionMerge 28 None - BranchConditional 26 27 49 - 27: Label - 37: 9(ptr) AccessChain 36(foo) 21 - 38: 6(int) Load 37 - 39: 9(ptr) AccessChain 20(foo3) 21 38 21 - 40: 6(int) Load 39 - 42: 6(int) IAdd 40 41 - 43: 6(int) Load 8(iLocal) - 44: 6(int) IAdd 43 22 - Store 8(iLocal) 44 - 45: 6(int) IAdd 42 44 - 47: 46(ptr) AccessChain 34(foo2) 45 41 22 - 48: 12(float) Load 47 - Store 30(scale) 48 - Branch 28 - 49: Label - 50: 46(ptr) AccessChain 20(foo3) 21 21 41 22 - 51: 12(float) Load 50 - Store 30(scale) 51 - Branch 28 - 28: Label - 55: 12(float) Load 30(scale) - 60: 57 Load 59(samp2D) - 64: 61(fvec2) Load 63(coord) - 65: 52(fvec4) ImageSampleImplicitLod 60 64 - 66: 52(fvec4) VectorTimesScalar 65 55 - Store 54(gl_FragColor) 66 - 70: 61(fvec2) Load 63(coord) - 71: 12(float) Load 30(scale) - 72: 61(fvec2) CompositeConstruct 71 71 - 76: 67 CompositeConstruct 70 72 75 - Store 69(constructed) 76 - 77: 9(ptr) AccessChain 36(foo) 21 - 78: 6(int) Load 77 - 80: 79(ptr) AccessChain 69(constructed) 78 - 81: 61(fvec2) Load 80 - 82: 9(ptr) AccessChain 36(foo) 21 - 83: 6(int) Load 82 - 84: 79(ptr) AccessChain 69(constructed) 83 - 85: 61(fvec2) Load 84 - 86: 12(float) CompositeExtract 81 0 - 87: 12(float) CompositeExtract 81 1 - 88: 12(float) CompositeExtract 85 0 - 89: 12(float) CompositeExtract 85 1 - 90: 52(fvec4) CompositeConstruct 86 87 88 89 - 91: 52(fvec4) Load 54(gl_FragColor) - 92: 52(fvec4) FAdd 91 90 - Store 54(gl_FragColor) 92 + 24: 9(ptr) AccessChain 21(foo3) 22 23 22 + 25: 6(int) Load 24 + 27: 26(bool) SGreaterThan 25 22 + SelectionMerge 29 None + BranchConditional 27 28 53 + 28: Label + 41: 9(ptr) AccessChain 40(foo) 22 + 42: 6(int) Load 41 + 43: 9(ptr) AccessChain 21(foo3) 22 42 22 + 44: 6(int) Load 43 + 46: 6(int) IAdd 44 45 + 47: 6(int) Load 8(iLocal) + 48: 6(int) IAdd 47 23 + Store 8(iLocal) 48 + 49: 6(int) IAdd 46 48 + 51: 50(ptr) AccessChain 37(foo2) 49 45 23 + 52: 12(float) Load 51 + Store 31(scale) 52 + Branch 29 + 53: Label + 54: 50(ptr) AccessChain 21(foo3) 22 22 45 23 + 55: 12(float) Load 54 + Store 31(scale) 55 + Branch 29 + 29: Label + 59: 12(float) Load 31(scale) + 64: 61 Load 63(samp2D) + 68: 65(fvec2) Load 67(coord) + 69: 56(fvec4) ImageSampleImplicitLod 64 68 + 70: 56(fvec4) VectorTimesScalar 69 59 + Store 58(gl_FragColor) 70 + 74: 65(fvec2) Load 67(coord) + 75: 12(float) Load 31(scale) + 76: 65(fvec2) CompositeConstruct 75 75 + 80: 71 CompositeConstruct 74 76 79 + Store 73(constructed) 80 + 81: 9(ptr) AccessChain 40(foo) 22 + 82: 6(int) Load 81 + 84: 83(ptr) AccessChain 73(constructed) 82 + 85: 65(fvec2) Load 84 + 86: 9(ptr) AccessChain 40(foo) 22 + 87: 6(int) Load 86 + 88: 83(ptr) AccessChain 73(constructed) 87 + 89: 65(fvec2) Load 88 + 90: 12(float) CompositeExtract 85 0 + 91: 12(float) CompositeExtract 85 1 + 92: 12(float) CompositeExtract 89 0 + 93: 12(float) CompositeExtract 89 1 + 94: 56(fvec4) CompositeConstruct 90 91 92 93 + 95: 56(fvec4) Load 58(gl_FragColor) + 96: 56(fvec4) FAdd 95 94 + Store 58(gl_FragColor) 96 Return FunctionEnd diff --git a/Test/baseResults/spv.varyingArray.frag.out b/Test/baseResults/spv.varyingArray.frag.out index 26234e84..4a7d2ee6 100755 --- a/Test/baseResults/spv.varyingArray.frag.out +++ b/Test/baseResults/spv.varyingArray.frag.out @@ -1,9 +1,4 @@ spv.varyingArray.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release -WARNING: 0:4: varying deprecated in version 130; may be removed in future release -WARNING: 0:6: varying deprecated in version 130; may be removed in future release -WARNING: 0:8: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -16,16 +11,17 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 19 34 39 45 48 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "texColor" Name 13 "texSampler2D" - Name 19 "gl_TexCoord" + Name 19 "TexCoord" Name 34 "color" Name 39 "alpha" Name 45 "gl_FragColor" Name 48 "foo" + Decorate 13(texSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -39,7 +35,7 @@ Linked fragment stage: 16: 15(int) Constant 6 17: TypeArray 7(fvec4) 16 18: TypePointer Input 17 - 19(gl_TexCoord): 18(ptr) Variable Input + 19(TexCoord): 18(ptr) Variable Input 20: TypeInt 32 1 21: 20(int) Constant 4 22: TypePointer Input 7(fvec4) @@ -61,9 +57,9 @@ Linked fragment stage: 5: Label 9(texColor): 8(ptr) Variable Function 14: 11 Load 13(texSampler2D) - 23: 22(ptr) AccessChain 19(gl_TexCoord) 21 + 23: 22(ptr) AccessChain 19(TexCoord) 21 24: 7(fvec4) Load 23 - 26: 22(ptr) AccessChain 19(gl_TexCoord) 25 + 26: 22(ptr) AccessChain 19(TexCoord) 25 27: 7(fvec4) Load 26 28: 7(fvec4) FAdd 24 27 30: 6(float) CompositeExtract 28 0 @@ -80,10 +76,10 @@ Linked fragment stage: Store 43 40 50: 22(ptr) AccessChain 48(foo) 49 51: 7(fvec4) Load 50 - 53: 22(ptr) AccessChain 19(gl_TexCoord) 52 + 53: 22(ptr) AccessChain 19(TexCoord) 52 54: 7(fvec4) Load 53 55: 7(fvec4) FAdd 51 54 - 56: 22(ptr) AccessChain 19(gl_TexCoord) 21 + 56: 22(ptr) AccessChain 19(TexCoord) 21 57: 7(fvec4) Load 56 58: 7(fvec4) FAdd 55 57 59: 7(fvec4) Load 9(texColor) diff --git a/Test/baseResults/spv.varyingArrayIndirect.frag.out b/Test/baseResults/spv.varyingArrayIndirect.frag.out index 41ee8657..410fd3c4 100755 --- a/Test/baseResults/spv.varyingArrayIndirect.frag.out +++ b/Test/baseResults/spv.varyingArrayIndirect.frag.out @@ -1,9 +1,4 @@ spv.varyingArrayIndirect.frag -WARNING: 0:3: varying deprecated in version 130; may be removed in future release -WARNING: 0:4: varying deprecated in version 130; may be removed in future release -WARNING: 0:6: varying deprecated in version 130; may be removed in future release -WARNING: 0:8: varying deprecated in version 130; may be removed in future release - Linked fragment stage: @@ -15,19 +10,22 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 19 30 45 50 56 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 + EntryPoint Fragment 4 "main" 19 22 30 31 45 50 56 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "texColor" Name 13 "texSampler2D" Name 19 "userIn" Name 22 "b" - Name 30 "gl_TexCoord" + Name 30 "TexCoord" Name 31 "a" Name 45 "color" Name 50 "alpha" Name 56 "gl_FragColor" + Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 22(b) Flat + Decorate 31(a) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -43,14 +41,14 @@ Linked fragment stage: 18: TypePointer Input 17 19(userIn): 18(ptr) Variable Input 20: TypeInt 32 1 - 21: TypePointer UniformConstant 20(int) - 22(b): 21(ptr) Variable UniformConstant + 21: TypePointer Input 20(int) + 22(b): 21(ptr) Variable Input 24: TypePointer Input 7(fvec4) 27: 15(int) Constant 6 28: TypeArray 7(fvec4) 27 29: TypePointer Input 28 - 30(gl_TexCoord): 29(ptr) Variable Input - 31(a): 21(ptr) Variable UniformConstant + 30(TexCoord): 29(ptr) Variable Input + 31(a): 21(ptr) Variable Input 36: 20(int) Constant 5 40: TypeVector 6(float) 2 45(color): 24(ptr) Variable Input @@ -69,10 +67,10 @@ Linked fragment stage: 25: 24(ptr) AccessChain 19(userIn) 23 26: 7(fvec4) Load 25 32: 20(int) Load 31(a) - 33: 24(ptr) AccessChain 30(gl_TexCoord) 32 + 33: 24(ptr) AccessChain 30(TexCoord) 32 34: 7(fvec4) Load 33 35: 7(fvec4) FAdd 26 34 - 37: 24(ptr) AccessChain 30(gl_TexCoord) 36 + 37: 24(ptr) AccessChain 30(TexCoord) 36 38: 7(fvec4) Load 37 39: 7(fvec4) FAdd 35 38 41: 6(float) CompositeExtract 39 0 @@ -87,10 +85,10 @@ Linked fragment stage: 51: 6(float) Load 50(alpha) 54: 53(ptr) AccessChain 9(texColor) 52 Store 54 51 - 58: 24(ptr) AccessChain 30(gl_TexCoord) 57 + 58: 24(ptr) AccessChain 30(TexCoord) 57 59: 7(fvec4) Load 58 60: 20(int) Load 22(b) - 61: 24(ptr) AccessChain 30(gl_TexCoord) 60 + 61: 24(ptr) AccessChain 30(TexCoord) 60 62: 7(fvec4) Load 61 63: 7(fvec4) FAdd 59 62 64: 7(fvec4) Load 9(texColor) diff --git a/Test/baseResults/spv.voidFunction.frag.out b/Test/baseResults/spv.voidFunction.frag.out index 9ef6e8df..1d4b694b 100755 --- a/Test/baseResults/spv.voidFunction.frag.out +++ b/Test/baseResults/spv.voidFunction.frag.out @@ -1,18 +1,20 @@ spv.voidFunction.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 44 +// Id's are bound by 43 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 37 41 - ExecutionMode 4 OriginLowerLeft - Source GLSL 120 + EntryPoint Fragment 4 "main" 24 37 40 42 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 6 "foo(" Name 8 "foo2(" @@ -20,8 +22,8 @@ Linked fragment stage: Name 22 "outColor" Name 24 "bigColor" Name 37 "gl_FragColor" - Name 41 "BaseColor" - Name 43 "d" + Name 40 "BaseColor" + Name 42 "d" 2: TypeVoid 3: TypeFunction 2 10: TypeFloat 32 @@ -31,17 +33,16 @@ Linked fragment stage: 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 + 23: TypePointer Input 20(fvec4) + 24(bigColor): 23(ptr) Variable Input 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 + 40(BaseColor): 23(ptr) Variable Input + 41: TypePointer Input 10(float) + 42(d): 41(ptr) Variable Input 4(main): 2 Function None 3 5: Label 22(outColor): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out old mode 100755 new mode 100644 index 5d6094f5..2ec33102 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -1,86 +1,79 @@ spv.while-continue-break.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 42 +// Id's are bound by 41 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 40 41 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 17 "A" - Name 25 "B" - Name 27 "C" - Name 37 "D" - Name 40 "gl_VertexID" - Name 41 "gl_InstanceID" - Decorate 40(gl_VertexID) BuiltIn VertexId - Decorate 41(gl_InstanceID) BuiltIn InstanceId + Name 19 "A" + Name 27 "B" + Name 29 "C" + Name 39 "D" 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: 6(int) Constant 2 - 29: 6(int) Constant 5 - 38: 6(int) Constant 3 - 39: TypePointer Input 6(int) - 40(gl_VertexID): 39(ptr) Variable Input -41(gl_InstanceID): 39(ptr) Variable Input + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: 6(int) Constant 2 + 31: 6(int) Constant 5 + 40: 6(int) Constant 3 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 17(A): 7(ptr) Variable Function - 25(B): 7(ptr) Variable Function - 27(C): 7(ptr) Variable Function - 37(D): 7(ptr) Variable Function + 19(A): 7(ptr) Variable Function + 27(B): 7(ptr) Variable Function + 29(C): 7(ptr) Variable Function + 39(D): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(A) 18 - 19: 6(int) Load 8(i) - 21: 6(int) SMod 19 20 - 22: 15(bool) IEqual 21 9 - SelectionMerge 24 None - BranchConditional 22 23 24 - 23: Label - Store 25(B) 20 - Branch 10 - 26: Label - Store 27(C) 20 - Branch 24 - 24: Label - 28: 6(int) Load 8(i) - 30: 6(int) SMod 28 29 - 31: 15(bool) IEqual 30 9 - SelectionMerge 33 None - BranchConditional 31 32 33 - 32: Label - Store 25(B) 20 - Branch 11 + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(A) 20 + 21: 6(int) Load 8(i) + 23: 6(int) SMod 21 22 + 24: 17(bool) IEqual 23 9 + SelectionMerge 26 None + BranchConditional 24 25 26 + 25: Label + Store 27(B) 22 + Branch 13 + 26: Label + 30: 6(int) Load 8(i) + 32: 6(int) SMod 30 31 + 33: 17(bool) IEqual 32 9 + SelectionMerge 35 None + BranchConditional 33 34 35 34: Label - Store 27(C) 20 - Branch 33 - 33: Label - 35: 6(int) Load 8(i) - 36: 6(int) IAdd 35 18 - Store 8(i) 36 + Store 27(B) 22 + Branch 12 + 35: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 20 + Store 8(i) 38 + Branch 13 + 13: Label Branch 10 - 11: Label - Store 37(D) 38 + 12: Label + Store 39(D) 40 Return FunctionEnd diff --git a/Test/baseResults/spv.while-simple.vert.out b/Test/baseResults/spv.while-simple.vert.out index 40accebf..0c1c8221 100755 --- a/Test/baseResults/spv.while-simple.vert.out +++ b/Test/baseResults/spv.while-simple.vert.out @@ -1,49 +1,48 @@ spv.while-simple.vert +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 23 +// Id's are bound by 22 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 21 22 - Source ESSL 300 + EntryPoint Vertex 4 "main" + Source ESSL 310 Name 4 "main" Name 8 "i" - Name 21 "gl_VertexID" - Name 22 "gl_InstanceID" - Decorate 21(gl_VertexID) BuiltIn VertexId - Decorate 22(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: TypePointer Input 6(int) - 21(gl_VertexID): 20(ptr) Variable Input -22(gl_InstanceID): 20(ptr) Variable Input + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - 17: 6(int) Load 8(i) - 19: 6(int) IAdd 17 18 - Store 8(i) 19 + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 13 + 13: Label Branch 10 - 11: Label + 12: Label Return FunctionEnd diff --git a/Test/baseResults/spv.whileLoop.frag.out b/Test/baseResults/spv.whileLoop.frag.out index 62fa84f4..8de5e956 100755 --- a/Test/baseResults/spv.whileLoop.frag.out +++ b/Test/baseResults/spv.whileLoop.frag.out @@ -5,20 +5,20 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 34 +// Id's are bound by 35 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 32 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 + EntryPoint Fragment 4 "main" 11 24 28 33 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 22 "d" - Name 27 "bigColor" - Name 32 "gl_FragColor" + Name 24 "d" + Name 28 "bigColor" + Name 33 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -26,16 +26,15 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 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 + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(float) + 23: TypePointer Input 6(float) + 24(d): 23(ptr) Variable Input + 26: TypeBool + 28(bigColor): 10(ptr) Variable Input + 32: TypePointer Output 7(fvec4) +33(gl_FragColor): 32(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -43,20 +42,24 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 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 - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 + LoopMerge 15 16 None + Branch 17 + 17: Label + 21: 20(ptr) AccessChain 9(color) 19 + 22: 6(float) Load 21 + 25: 6(float) Load 24(d) + 27: 26(bool) FOrdLessThan 22 25 + BranchConditional 27 14 15 + 14: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 16 + 16: Label Branch 13 - 14: Label - 33: 7(fvec4) Load 9(color) - Store 32(gl_FragColor) 33 + 15: Label + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 Return FunctionEnd diff --git a/Test/baseResults/vulkan.comp.out b/Test/baseResults/vulkan.comp.out new file mode 100644 index 00000000..7f1fd18a --- /dev/null +++ b/Test/baseResults/vulkan.comp.out @@ -0,0 +1,11 @@ +vulkan.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:5: 'local_size' : cannot change previously set size +ERROR: 1 compilation errors. No code generated. + + + +Linked compute stage: + + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out new file mode 100644 index 00000000..b5b9d91a --- /dev/null +++ b/Test/baseResults/vulkan.frag.out @@ -0,0 +1,42 @@ +vulkan.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:14: 'sampler2D' : sampler-constructor requires two arguments +ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:17: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:18: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:19: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:21: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:22: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:23: 'sampler2D' : sampler-constructor first argument must match type and dimensionality of constructor type +ERROR: 0:24: 'sampler2D' : sampler-constructor second argument presence of shadow must match constructor presence of shadow +ERROR: 0:25: 'sampler2DShadow' : sampler-constructor second argument presence of shadow must match constructor presence of shadow +ERROR: 0:28: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: s2D +ERROR: 0:29: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:29: 'sampler3D' : sampler/image types can only be used in uniform variables or function parameters: s3d +ERROR: 0:29: '=' : cannot convert from 'const float' to 'global 4-element array of sampler3D' +ERROR: 0:39: 'push_constant' : can only be used with a uniform +ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:43: 'push_constant' : can only be used with a block +ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block +ERROR: 0:47: 'push_constant' : requires an instance name +ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier +ERROR: 0:60: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:61: 'subpassLoad' : no matching overloaded function found +ERROR: 0:63: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:66: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:66: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:67: 'uniform' : no qualifiers allowed for function return +ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 31 compilation errors. No code generated. + + + +Linked fragment stage: + +ERROR: Linking fragment stage: Only one push_constant block is allowed per stage + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/vulkan.vert.out b/Test/baseResults/vulkan.vert.out new file mode 100644 index 00000000..0cac808f --- /dev/null +++ b/Test/baseResults/vulkan.vert.out @@ -0,0 +1,33 @@ +vulkan.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:3: 'subpass input' : not supported in this stage: vertex +ERROR: 0:4: 'subpass input' : not supported in this stage: vertex +ERROR: 0:5: 'subpass input' : not supported in this stage: vertex +ERROR: 0:6: 'subpass input' : not supported in this stage: vertex +ERROR: 0:7: 'subpass input' : not supported in this stage: vertex +ERROR: 0:8: 'subpass input' : not supported in this stage: vertex +ERROR: 0:12: 'constant_id' : can only be applied to a scalar +ERROR: 0:13: 'constant_id' : specialization-constant id already used +ERROR: 0:13: 'constant_id' : can only be applied to 'const'-qualified scalar +ERROR: 0:13: 'constant_id' : cannot be applied to this type +ERROR: 0:14: 'constant_id' : specialization-constant id is too large +ERROR: 0:15: 'constant_id' : can only be applied to a scalar +ERROR: 0:16: 'constant_id' : specialization-constant id already used +ERROR: 0:16: 'constant_id' : cannot declare a default, can only be used on a scalar +ERROR: 0:20: 'subpassLoad' : no matching overloaded function found +ERROR: 0:20: 'assign' : cannot convert from 'const float' to 'smooth out 4-component vector of float' +ERROR: 0:23: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:24: 'shared' : not allowed when using GLSL for Vulkan +ERROR: 0:25: 'packed' : not allowed when using GLSL for Vulkan +ERROR: 0:32: 'initializer' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:34: '=' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:35: '==' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:39: 'set' : cannot be used with push_constant +ERROR: 23 compilation errors. No code generated. + + + +Linked vertex stage: + + +SPIR-V is not generated for failed compile or link diff --git a/Test/constFold.frag b/Test/constFold.frag index 81c718c9..97c3b2b6 100644 --- a/Test/constFold.frag +++ b/Test/constFold.frag @@ -127,3 +127,15 @@ void foo3() { mat3x2 r32 = mm2 * mm32; } + +struct cag { + int i; + float f; + bool b; +}; +const cag a0[3] = cag[3](cag(3, 2.0, true), cag(1, 5.0, true), cag(1, 9.0, false)); + +void foo4() +{ + int a = int(a0[2].f); +} \ No newline at end of file diff --git a/Test/nonVulkan.frag b/Test/nonVulkan.frag new file mode 100644 index 00000000..c8cf4674 --- /dev/null +++ b/Test/nonVulkan.frag @@ -0,0 +1,5 @@ +#version 450 + +layout(constant_id = 17) const int arraySize = 12; // ERROR +layout(input_attachment_index = 1) int foo; // ERROR +layout(push_constant) uniform ubn { int a; } ubi; // ERROR \ No newline at end of file diff --git a/Test/spv.100ops.frag b/Test/spv.100ops.frag index b86d0423..43452a1f 100644 --- a/Test/spv.100ops.frag +++ b/Test/spv.100ops.frag @@ -1,19 +1,21 @@ -#version 100 +#version 310 es lowp float foo(); -uniform int low, high; +in lowp float low, high; lowp float face1 = 11.0; +out lowp vec4 Color; + void main() { int z = 3; - if (2 * low + 1 < high) + if (2.0 * low + 1.0 < high) ++z; - gl_FragColor = face1 * vec4(z) + foo(); + Color = face1 * vec4(z) + foo(); } lowp float face2 = -2.0; diff --git a/Test/spv.130.frag b/Test/spv.130.frag index 0e580e4f..e7fdd388 100644 --- a/Test/spv.130.frag +++ b/Test/spv.130.frag @@ -1,4 +1,4 @@ -#version 130 +#version 140 #extension GL_ARB_texture_gather : enable vec3 a; @@ -15,9 +15,6 @@ noperspective in float fnop; uniform samplerCube sampC; -in vec4 gl_Color; -flat in vec4 gl_Color; - #extension GL_ARB_texture_rectangle : enable uniform sampler2D samp2D; @@ -85,11 +82,6 @@ uniform sampler2DRectShadow s2DRS; uniform sampler1D s1D; uniform sampler2DShadow s2DS; -uniform float f; -uniform vec2 v2; -uniform vec3 v3; -uniform vec4 v4; - void main() { o = textureGather(sampC, vec3(0.2)); diff --git a/Test/spv.150.vert b/Test/spv.150.vert index 065275f8..382e3c9b 100644 --- a/Test/spv.150.vert +++ b/Test/spv.150.vert @@ -2,8 +2,9 @@ in vec4 iv4; -uniform float ps; -uniform int ui; +in float ps; +in int ui; +uniform sampler2D s2D; invariant gl_Position; @@ -27,13 +28,11 @@ void main() gl_ClipDistance[2] = iv4.x; int i; s2out.d[i].b[2].w = ps; - - // test recovery from nonsupported built-ins - //float n1 = noise1(2.4); - //n1 = noise1(vec4(n1)); - //vec2 n2 = noise2(vec3(n1)); - //vec3 n3 = noise3(n2); - //vec4 n4 = noise4(n3); + + // test non-implicit lod + texture(s2D, vec2(0.5)); + textureProj(s2D, vec3(0.5)); + textureLod(s2D, vec2(0.5), 3.2); } out float gl_ClipDistance[4]; diff --git a/Test/spv.300BuiltIns.vert b/Test/spv.300BuiltIns.vert index c8104de8..46c3f0fe 100644 --- a/Test/spv.300BuiltIns.vert +++ b/Test/spv.300BuiltIns.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es in mediump float ps; @@ -6,12 +6,9 @@ invariant gl_Position; void main() { - mediump int i = (4 * gl_VertexID - 10); - mediump int j = (4 * gl_VertexID - 10); - gl_Position = vec4(ps); - gl_Position *= float(i); + gl_Position *= float(4 - gl_VertexIndex); gl_PointSize = ps; - gl_PointSize *= float(j); + gl_PointSize *= float(5 - gl_InstanceIndex); } diff --git a/Test/spv.300layout.frag b/Test/spv.300layout.frag index d80de3ab..5b4c56c2 100644 --- a/Test/spv.300layout.frag +++ b/Test/spv.300layout.frag @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision mediump float; diff --git a/Test/spv.300layout.vert b/Test/spv.300layout.vert index 38ff374c..81218b5d 100644 --- a/Test/spv.300layout.vert +++ b/Test/spv.300layout.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es layout(location = 7) in vec3 c; layout(LocatioN = 3) in vec4 p; @@ -28,7 +28,7 @@ layout(column_major) uniform T3 { // shared and column_major uvec3 uv3a[4]; }; -uniform uint uiuin; +in uint uiuin; struct S { vec3 c; diff --git a/Test/spv.300layoutp.vert b/Test/spv.300layoutp.vert index a0986e47..d14aa1cd 100644 --- a/Test/spv.300layoutp.vert +++ b/Test/spv.300layoutp.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es layout(location = 7) in vec3 c; layout(LocatioN = 3) in vec4 p; @@ -7,7 +7,7 @@ out vec4 pos; out vec3 color; flat out int iout; -layout(shared, column_major, row_major) uniform; // default is now shared and row_major +layout(row_major) uniform; // default is now row_major layout(std140) uniform Transform { // layout of this block is std140 mat4 M1; // row_major @@ -28,7 +28,7 @@ layout(column_major) uniform T3 { // shared and column_major uvec3 uv3a[4]; }; -uniform uint uiuin; +uint uiuin; struct S { vec3 c; diff --git a/Test/spv.400.frag b/Test/spv.400.frag index f35537c9..2014b5b0 100644 --- a/Test/spv.400.frag +++ b/Test/spv.400.frag @@ -21,6 +21,223 @@ void foo23() outp.x += textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); } +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(doublev)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); // For now, relying on no dead-code elimination + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); // For now, relying on no dead-code elimination + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); + + outp *= float(doublev + dvec2v.y + dvec3v.z + dvec4v.w + + dmat2v[1][1] + dmat3v[2][2] + dmat4v[3][3] + dmat2x3v[1][1] + dmat3x2v[1][1] + dmat3x4v[2][2] + dmat4x3v[2][2] + dmat2x4v[1][1] + dmat4x2v[1][1] + + float(boolv) + float(bvec2v.x) + float(bvec3v.x) + float(bvec4v.x)); +} + void main() { vec4 v; @@ -38,5 +255,6 @@ void main() outp += gl_FragCoord + vl2; foo23(); + doubles(); } diff --git a/Test/spv.420.geom b/Test/spv.420.geom index afb04bc9..92186ae8 100644 --- a/Test/spv.420.geom +++ b/Test/spv.420.geom @@ -16,8 +16,8 @@ layout(invocations = 4) in; uniform sampler2D s2D; in vec2 coord[]; -uniform vec4 v4; -uniform int i; + +int i; void main() { diff --git a/Test/spv.430.vert b/Test/spv.430.vert index 55cb60b1..f52ff4a6 100644 --- a/Test/spv.430.vert +++ b/Test/spv.430.vert @@ -1,6 +1,6 @@ -#version 430 core +#version 450 core + -layout(location = 4) uniform vec4 uv4; out gl_PerVertex { float gl_ClipDistance[]; @@ -13,7 +13,7 @@ highp in vec4 badorder; out invariant vec4 badorder2; out flat vec4 badorder3; -uniform float f; +in float f; void main() { @@ -30,3 +30,8 @@ layout(binding = 7) uniform anonblock { int aoeu; } ; layout(binding = 4) uniform sampler2D sampb1; layout(binding = 5) uniform sampler2D sampb2[10]; layout(binding = 31) uniform sampler2D sampb4; + +struct S { mediump float a; highp uvec2 b; highp vec3 c; }; +struct SS { vec4 b; S s; vec4 c; }; +layout(location = 0) flat out SS var; +out MS { layout(location = 17) float f; } outMS; diff --git a/Test/spv.AofA.frag b/Test/spv.AofA.frag index 606d73b0..62847100 100644 --- a/Test/spv.AofA.frag +++ b/Test/spv.AofA.frag @@ -12,7 +12,7 @@ float[4][5][6] many[1][2][3]; float g4[4][7]; in float g5[5][7]; -uniform int i, j, k; +flat in int i, j, k; float[4][7] foo(float a[5][7]) { diff --git a/Test/spv.Operations.frag b/Test/spv.Operations.frag index de0fa2d6..5c8c8af0 100644 --- a/Test/spv.Operations.frag +++ b/Test/spv.Operations.frag @@ -1,14 +1,13 @@ #version 450 -uniform ivec4 uiv4; -uniform vec4 uv4; -uniform bool ub; -uniform bvec4 ub41, ub42; -uniform float uf; -uniform int ui; - -uniform uvec4 uuv4; -uniform uint uui; +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bvec4 ub41, ub42; +in float uf; +flat in int ui; +flat in uvec4 uuv4; +flat in uint uui; out vec4 FragColor; diff --git a/Test/spv.accessChain.frag b/Test/spv.accessChain.frag index 0cbf6b3c..41ec0ca3 100644 --- a/Test/spv.accessChain.frag +++ b/Test/spv.accessChain.frag @@ -7,7 +7,7 @@ struct S layout(location = 0) out vec3 OutColor; -uniform int u; +flat in int u; void GetColor1(const S i) { diff --git a/Test/spv.aggOps.frag b/Test/spv.aggOps.frag index c31186df..bc34d7ac 100644 --- a/Test/spv.aggOps.frag +++ b/Test/spv.aggOps.frag @@ -17,13 +17,8 @@ struct s2 { s1 s1_1; }; -uniform s1 foo1; -uniform s2 foo2a; -uniform s2 foo2b; - -layout(std140) uniform bn { - s2 foo2a; -} bi; +layout(std140) uniform ub1 { s2 foo2a; } uName1; +layout(std430) buffer ub2 { s2 foo2b; } uName2; void main() { @@ -32,7 +27,7 @@ void main() a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); - if (foo2a == foo2b) + if (uName1.foo2a == uName2.foo2b) v = texture(samp2D, coord); else v = texture(samp2D, 2.0*coord); @@ -52,8 +47,5 @@ void main() if (a != b) v *= 7.0; - if (bi.foo2a != foo2a) - v *= 8.0; - color = v; } diff --git a/Test/spv.always-discard.frag b/Test/spv.always-discard.frag index cea4ceec..6cd4d04f 100644 --- a/Test/spv.always-discard.frag +++ b/Test/spv.always-discard.frag @@ -1,5 +1,5 @@ -#version 110 -varying vec2 tex_coord; +#version 140 +in vec2 tex_coord; void main (void) { diff --git a/Test/spv.always-discard2.frag b/Test/spv.always-discard2.frag index a619369d..2b125f32 100644 --- a/Test/spv.always-discard2.frag +++ b/Test/spv.always-discard2.frag @@ -1,5 +1,5 @@ -#version 110 -varying vec2 tex_coord; +#version 140 +in vec2 tex_coord; void main (void) { diff --git a/Test/spv.atomic.comp b/Test/spv.atomic.comp index 76e0c3df..d1215f7c 100644 --- a/Test/spv.atomic.comp +++ b/Test/spv.atomic.comp @@ -1,9 +1,11 @@ #version 310 es +#extension GL_ARB_gl_spirv : enable + layout(binding = 0) uniform atomic_uint counter; layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; -uniform uint value; +shared uint value; int arrX[gl_WorkGroupSize.x]; int arrY[gl_WorkGroupSize.y]; diff --git a/Test/spv.bitCast.frag b/Test/spv.bitCast.frag index db7d453e..73c7e303 100644 --- a/Test/spv.bitCast.frag +++ b/Test/spv.bitCast.frag @@ -1,19 +1,19 @@ #version 450 -uniform int i1; -uniform ivec2 i2; -uniform ivec3 i3; -uniform ivec4 i4; +flat in int i1; +flat in ivec2 i2; +flat in ivec3 i3; +flat in ivec4 i4; -uniform uint u1; -uniform uvec2 u2; -uniform uvec3 u3; -uniform uvec4 u4; +flat in uint u1; +flat in uvec2 u2; +flat in uvec3 u3; +flat in uvec4 u4; -uniform float f1; -uniform vec2 f2; -uniform vec3 f3; -uniform vec4 f4; +in float f1; +in vec2 f2; +in vec3 f3; +in vec4 f4; out vec4 fragColor; diff --git a/Test/spv.boolInBlock.frag b/Test/spv.boolInBlock.frag new file mode 100644 index 00000000..a4f62fae --- /dev/null +++ b/Test/spv.boolInBlock.frag @@ -0,0 +1,31 @@ +#version 450 + +layout(binding = 0, std140) uniform Uniform +{ + bvec4 b4; +}; + +layout(binding = 1, std430) buffer Buffer +{ + bvec2 b2; +}; + +void foo(bvec4 paramb4, out bvec2 paramb2) +{ + bool b1 = paramb4.z; + paramb2 = bvec2(b1); +} + +layout(location = 0) out vec4 fragColor; + +void main() +{ + b2 = bvec2(0.0); + if (b4.z) + b2 = bvec2(b4.x); + if (b2.x) + foo(b4, b2); + + fragColor = vec4(b4.x && b4.y); + fragColor -= vec4(b4.x || b4.y); +} \ No newline at end of file diff --git a/Test/spv.branch-return.vert b/Test/spv.branch-return.vert new file mode 100644 index 00000000..4b2f5d44 --- /dev/null +++ b/Test/spv.branch-return.vert @@ -0,0 +1,10 @@ +#version 310 es +void main() { + switch (gl_InstanceIndex) { + case 0: return; + case 1: gl_Position = vec4(0.0); break; + case 2: return; + case 3: return; + } + gl_Position.x += 0.123; +} diff --git a/Test/spv.conversion.frag b/Test/spv.conversion.frag index f17293b8..3b5e5123 100644 --- a/Test/spv.conversion.frag +++ b/Test/spv.conversion.frag @@ -1,24 +1,24 @@ -#version 130 +#version 140 -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; +int u_i; +ivec2 u_i2; +ivec3 u_i3; +ivec4 u_i4; -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; +float u_f; +vec2 u_f2; +vec3 u_f3; +vec4 u_f4; + +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; flat in int i_i; flat in ivec2 i_i2; diff --git a/Test/spv.dataOut.frag b/Test/spv.dataOut.frag index 258f534e..94c6db06 100644 --- a/Test/spv.dataOut.frag +++ b/Test/spv.dataOut.frag @@ -1,6 +1,6 @@ -#version 130 +#version 140 -varying vec4 Color; +in vec4 Color; void main() { diff --git a/Test/spv.dataOutIndirect.frag b/Test/spv.dataOutIndirect.frag index d6b8667d..88a32d58 100644 --- a/Test/spv.dataOutIndirect.frag +++ b/Test/spv.dataOutIndirect.frag @@ -1,10 +1,12 @@ -#version 130 +#version 140 -varying vec4 Color; +in vec4 Color; -uniform int i; +out vec4 fcolor[4]; + +uniform b { int i; } bName; void main() { - gl_FragData[i] = Color; + fcolor[bName.i] = Color; } diff --git a/Test/spv.dataOutIndirect.vert b/Test/spv.dataOutIndirect.vert index 7c647fc0..cb6b7e0d 100644 --- a/Test/spv.dataOutIndirect.vert +++ b/Test/spv.dataOutIndirect.vert @@ -1,7 +1,7 @@ -#version 130 +#version 140 attribute vec4 color; -varying vec4 colorOut[6]; +out vec4 colorOut[6]; void main() { diff --git a/Test/spv.discard-dce.frag b/Test/spv.discard-dce.frag index f2fef4d1..e824f76e 100644 --- a/Test/spv.discard-dce.frag +++ b/Test/spv.discard-dce.frag @@ -1,5 +1,5 @@ -#version 110 -varying vec2 tex_coord; +#version 140 +in vec2 tex_coord; void main (void) { diff --git a/Test/spv.do-simple.vert b/Test/spv.do-simple.vert index a7eba1d2..77677a6d 100644 --- a/Test/spv.do-simple.vert +++ b/Test/spv.do-simple.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i = 0; do { diff --git a/Test/spv.do-while-continue-break.vert b/Test/spv.do-while-continue-break.vert index 1aa4bbd4..c085551e 100644 --- a/Test/spv.do-while-continue-break.vert +++ b/Test/spv.do-while-continue-break.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i = 0; int A, B, C, D, E, F, G; diff --git a/Test/spv.doWhileLoop.frag b/Test/spv.doWhileLoop.frag index 3d6f93c5..5abdb61b 100644 --- a/Test/spv.doWhileLoop.frag +++ b/Test/spv.doWhileLoop.frag @@ -1,8 +1,8 @@ -#version 110 +#version 140 -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; +in vec4 bigColor; +in vec4 BaseColor; +in float d; void main() { diff --git a/Test/spv.double.comp b/Test/spv.double.comp index 8f4a7893..6397e630 100644 --- a/Test/spv.double.comp +++ b/Test/spv.double.comp @@ -10,7 +10,7 @@ buffer bufName { double d; } bufInst; -uniform double roll; + uniform writeonly image2D destTex; void main() diff --git a/Test/spv.earlyReturnDiscard.frag b/Test/spv.earlyReturnDiscard.frag index 718ea72f..bba4b76d 100644 --- a/Test/spv.earlyReturnDiscard.frag +++ b/Test/spv.earlyReturnDiscard.frag @@ -1,20 +1,20 @@ -#version 110 +#version 140 -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; -varying float c; +in float c; -uniform float threshhold; -uniform float threshhold2; -uniform float threshhold3; +in float threshhold; +in float threshhold2; +in float threshhold3; -uniform float minimum; +in float minimum; -varying vec4 BaseColor; +in vec4 BaseColor; -uniform bool b; +bool b; void main() { diff --git a/Test/spv.flowControl.frag b/Test/spv.flowControl.frag index eaa6fb1d..f10c7673 100644 --- a/Test/spv.flowControl.frag +++ b/Test/spv.flowControl.frag @@ -1,11 +1,11 @@ -#version 120 +#version 140 -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; -varying float c; -varying vec4 BaseColor; +in float c; +in vec4 BaseColor; void main() { diff --git a/Test/spv.for-complex-condition.vert b/Test/spv.for-complex-condition.vert new file mode 100644 index 00000000..81dd6489 --- /dev/null +++ b/Test/spv.for-complex-condition.vert @@ -0,0 +1,7 @@ +#version 450 +layout(location=0) out highp int r; +layout(location=0) in lowp int flag; +void main() { + int i; + for (i=0; i < (flag==1 ? 10 : 15) ; i++) { r = i; } +} diff --git a/Test/spv.for-continue-break.vert b/Test/spv.for-continue-break.vert index 9044f391..afa31f2b 100644 --- a/Test/spv.for-continue-break.vert +++ b/Test/spv.for-continue-break.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i; int A, B, C, D, E, F, G; diff --git a/Test/spv.for-nobody.vert b/Test/spv.for-nobody.vert new file mode 100644 index 00000000..99634761 --- /dev/null +++ b/Test/spv.for-nobody.vert @@ -0,0 +1,7 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; i<10; i++); + r = i; +} diff --git a/Test/spv.for-notest.vert b/Test/spv.for-notest.vert new file mode 100644 index 00000000..f40e6664 --- /dev/null +++ b/Test/spv.for-notest.vert @@ -0,0 +1,6 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; ; i++) { r = i; } +} diff --git a/Test/spv.for-simple.vert b/Test/spv.for-simple.vert index 7cba22ef..a5be6db2 100644 --- a/Test/spv.for-simple.vert +++ b/Test/spv.for-simple.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i; int j; diff --git a/Test/spv.forLoop.frag b/Test/spv.forLoop.frag index 117ecad1..dfa58ad4 100644 --- a/Test/spv.forLoop.frag +++ b/Test/spv.forLoop.frag @@ -1,11 +1,11 @@ -#version 130 +#version 140 -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; in float f; -uniform int Count; -uniform uvec4 v4; +flat in int Count; +flat in uvec4 v4; void main() { diff --git a/Test/spv.forwardFun.frag b/Test/spv.forwardFun.frag index eb105829..0a71521e 100644 --- a/Test/spv.forwardFun.frag +++ b/Test/spv.forwardFun.frag @@ -1,10 +1,10 @@ -#version 100 +#version 140 precision mediump float; -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; +in vec4 bigColor; +in vec4 BaseColor; +in float d; void bar(); float foo(vec4); diff --git a/Test/spv.functionCall.frag b/Test/spv.functionCall.frag index e1fc0e07..139638d2 100644 --- a/Test/spv.functionCall.frag +++ b/Test/spv.functionCall.frag @@ -1,8 +1,8 @@ -#version 130 +#version 140 -uniform vec4 bigColor; +varying vec4 bigColor; varying vec4 BaseColor; -uniform float d; +varying float d; float h = 0.0; diff --git a/Test/spv.functionSemantics.frag b/Test/spv.functionSemantics.frag index 67ff5f51..a9b59b76 100644 --- a/Test/spv.functionSemantics.frag +++ b/Test/spv.functionSemantics.frag @@ -1,6 +1,6 @@ #version 400 -uniform float u; +in float u; int foo(int a, const int b, in int c, const in int d, out int e, inout int f) { diff --git a/Test/spv.image.frag b/Test/spv.image.frag index 2ced0acf..30b339ce 100644 --- a/Test/spv.image.frag +++ b/Test/spv.image.frag @@ -7,7 +7,7 @@ layout(rgba32f, binding = 3) uniform imageCube iCube; layout(rgba32f, binding = 4) uniform imageCubeArray iCubeArray; layout(rgba32f, binding = 5) uniform image2DRect i2DRect; layout(rgba32f, binding = 6) uniform image1DArray i1DArray; -layout(rgba32f, binding = 7) uniform image2DArray i2DArray; +layout(rg16, binding = 7) uniform image2DArray i2DArray; layout(rgba32f, binding = 8) uniform imageBuffer iBuffer; layout(rgba32f, binding = 9) uniform image2DMS i2DMS; layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; @@ -15,12 +15,14 @@ layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; layout(r32i, binding = 11) uniform iimage1D ii1D; layout(r32ui, binding = 12) uniform uimage2D ui2D; -uniform int ic1D; -uniform ivec2 ic2D; -uniform ivec3 ic3D; -uniform ivec4 ic4D; +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; -uniform uint value; +writeonly layout(binding = 1) uniform image2D wo2D; + +flat in uint value; out vec4 fragData; @@ -84,6 +86,8 @@ void main() iv.x += imageAtomicCompSwap(ii1D, ic1D, 18, 17); ui += imageAtomicCompSwap(ui2D, ic2D, 19u, value); + imageStore(wo2D, ic2D, v); + fragData = ui != iv.y ? v : vec4(0.0); } diff --git a/Test/spv.interpOps.frag b/Test/spv.interpOps.frag index fccf304a..afe28dc3 100644 --- a/Test/spv.interpOps.frag +++ b/Test/spv.interpOps.frag @@ -5,8 +5,8 @@ in vec2 if2; in vec3 if3; in vec4 if4; -uniform int samp; -uniform vec2 offset; +flat in int samp; +flat in vec2 offset; out vec4 fragColor; diff --git a/Test/spv.length.frag b/Test/spv.length.frag index 956d3be8..3b3db0b4 100644 --- a/Test/spv.length.frag +++ b/Test/spv.length.frag @@ -1,8 +1,8 @@ -#version 120 +#version 140 -uniform vec4 u[3]; +vec4 u[3]; -varying vec2 v[2]; +in vec2 v[2]; void main() { diff --git a/Test/spv.localAggregates.frag b/Test/spv.localAggregates.frag index 9cfa34ee..9bdb11b7 100644 --- a/Test/spv.localAggregates.frag +++ b/Test/spv.localAggregates.frag @@ -1,8 +1,8 @@ -#version 130 +#version 400 uniform sampler2D samp2D; -varying vec2 coord; -varying vec4 color; +in vec2 coord; +in vec4 color; struct s1 { int i; @@ -24,12 +24,12 @@ struct s3 { }; -uniform s1 foo; -uniform s2 foo2; -uniform s3 foo3; +flat in s1 foo; +flat in s2 foo2; +flat in s3 foo3; -uniform float[16] uFloatArray; -uniform int condition; + +flat in int condition; void main() { diff --git a/Test/spv.loops.frag b/Test/spv.loops.frag index ce2d2a0b..b9ec0997 100644 --- a/Test/spv.loops.frag +++ b/Test/spv.loops.frag @@ -1,54 +1,36 @@ -#version 130 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; -varying vec4 BaseColor; +in vec4 BaseColor; -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; - -uniform int Count; +in float d; +in float d2; +in float d3; +in float d4; +in float d5; +in float d6; +in float d7; +in float d8; +in float d9; +in float d10; +in float d11; +in float d12; +in float d14; +in float d15; +in float d16; +in float d17; +in float d18; +flat in int Count; void main() { diff --git a/Test/spv.loopsArtificial.frag b/Test/spv.loopsArtificial.frag index 2f196af8..ae380b94 100644 --- a/Test/spv.loopsArtificial.frag +++ b/Test/spv.loopsArtificial.frag @@ -1,54 +1,25 @@ -#version 130 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; -varying vec4 BaseColor; +in vec4 BaseColor; -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; +in float d; +in float d2; +in float d3; +in float d4; +in float d13; -uniform int Count; +flat in int Count; void main() { diff --git a/Test/spv.matFun.vert b/Test/spv.matFun.vert index e5949964..49e882f4 100644 --- a/Test/spv.matFun.vert +++ b/Test/spv.matFun.vert @@ -1,7 +1,9 @@ -#version 130 +#version 400 -uniform mat4 m4; -uniform mat3 m3; +uniform bl { + uniform mat4 m4; + uniform mat3 m3; +} bName; in vec3 v3; @@ -22,5 +24,5 @@ vec3 mxv(mat4 m4, vec3 v) void main() { - gl_Position = vec4(mxv(m4, v3) + xf(m3, v3), 1.0); + gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); } diff --git a/Test/spv.matrix.frag b/Test/spv.matrix.frag index 095bc83f..c62e9669 100644 --- a/Test/spv.matrix.frag +++ b/Test/spv.matrix.frag @@ -1,4 +1,4 @@ -#version 130 +#version 140 in mat3x4 m1; in mat3x4 m2; diff --git a/Test/spv.memoryQualifier.frag b/Test/spv.memoryQualifier.frag new file mode 100644 index 00000000..85e71478 --- /dev/null +++ b/Test/spv.memoryQualifier.frag @@ -0,0 +1,38 @@ +#version 450 + +layout(binding = 0, r32f) uniform coherent image1D i1D; +layout(binding = 1, r32f) uniform volatile image2D i2D; +layout(binding = 2, r32f) uniform restrict image2DRect i2DRect; +layout(binding = 3, r32f) uniform readonly image3D i3D; +layout(binding = 3, r32f) uniform writeonly imageCube iCube; + +struct Data +{ + float f1; + vec2 f2; +}; + +coherent buffer Buffer +{ + volatile float f1; + restrict vec2 f2; + readonly vec3 f3; + writeonly vec4 f4; + int i1; + Data data; +}; + +void main() +{ + vec4 texel = imageLoad(i1D, 1); + texel += imageLoad(i2D, ivec2(1)); + texel += imageLoad(i2DRect, ivec2(1)); + texel += imageLoad(i3D, ivec3(1)); + imageStore(iCube, ivec3(1), texel); + + texel[i1] = f1; + texel.xy += f2; + texel.xyz -= f3; + texel.w += data.f1 + data.f2[1]; + f4 = texel; +} \ No newline at end of file diff --git a/Test/spv.merge-unreachable.frag b/Test/spv.merge-unreachable.frag new file mode 100644 index 00000000..12f57cd1 --- /dev/null +++ b/Test/spv.merge-unreachable.frag @@ -0,0 +1,7 @@ +#version 450 +layout(location=1) in highp vec4 v; +void main (void) +{ + if (v == vec4(0.1,0.2,0.3,0.4)) discard; + else return; +} diff --git a/Test/spv.nonSquare.vert b/Test/spv.nonSquare.vert index 4de21a0c..9f7125bd 100644 --- a/Test/spv.nonSquare.vert +++ b/Test/spv.nonSquare.vert @@ -1,9 +1,9 @@ -#version 120 +#version 140 -attribute vec3 v3; -attribute vec4 v4; +in vec3 v3; +in vec4 v4; -uniform mat3x2 m32; +out mat3x2 m32; const vec2 cv2 = vec2(10.0, 20.0); const mat2x4 m24 = mat2x4(3.0); diff --git a/Test/spv.precision.frag b/Test/spv.precision.frag index 0c6cb12b..090c1a6a 100644 --- a/Test/spv.precision.frag +++ b/Test/spv.precision.frag @@ -1,13 +1,13 @@ -#version 300 es +#version 310 es precision mediump float; in lowp float lowfin; in mediump float mediumfin; in highp vec4 highfin; -uniform highp int uniform_high; -uniform mediump int uniform_medium; -uniform lowp int uniform_low; -uniform bvec2 ub2; +highp int uniform_high; +mediump int uniform_medium; +lowp int uniform_low; +bvec2 ub2; out mediump vec4 mediumfout; @@ -23,6 +23,13 @@ bool boolfun(bvec2 bv2) return bv2 == bvec2(false, true); } +struct S { + highp float a; + lowp float b; +}; + +in S s; + void main() { lowp int sum = uniform_medium + uniform_high; @@ -47,4 +54,7 @@ void main() if (boolfun(ub2)) ++mediumfout; + + mediumfout *= s.a; + mediumfout *= s.b; } diff --git a/Test/spv.pushConstant.vert b/Test/spv.pushConstant.vert new file mode 100644 index 00000000..b1721bc6 --- /dev/null +++ b/Test/spv.pushConstant.vert @@ -0,0 +1,17 @@ +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +} matInst; + +out vec4 color; + +void main() +{ + switch (matInst.kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(0.0); break; + } +} diff --git a/Test/spv.separate.frag b/Test/spv.separate.frag new file mode 100644 index 00000000..21e5db33 --- /dev/null +++ b/Test/spv.separate.frag @@ -0,0 +1,95 @@ +#version 400 + +uniform sampler s; +uniform samplerShadow sShadow; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +flat in int i; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(t2d, s), vec2(0.5)); + color += texture(sampler3D(t3d[i], sA[2]), vec3(0.5)); + color += texture(sampler2D(t2d, s), vec2(0.5)); +} + +uniform texture2D tex2D; +uniform textureCube texCube; +uniform textureCubeArray texCubeArray; +uniform itextureCubeArray itexCubeArray; +uniform utextureCubeArray utexCubeArray; +uniform itexture1DArray itex1DArray; +uniform utexture1D utex1D; +uniform itexture1D itex1D; +uniform utexture1DArray utex1DArray; +uniform textureBuffer texBuffer; +uniform texture2DArray tex2DArray; +uniform itexture2D itex2D; +uniform itexture3D itex3D; +uniform itextureCube itexCube; +uniform itexture2DArray itex2DArray; +uniform utexture2D utex2D; +uniform utexture3D utex3D; +uniform utextureCube utexCube; +uniform utexture2DArray utex2DArray; +uniform itexture2DRect itex2DRect; +uniform utexture2DRect utex2DRect; +uniform itextureBuffer itexBuffer; +uniform utextureBuffer utexBuffer; +uniform texture2DMS tex2DMS; +uniform itexture2DMS itex2DMS; +uniform utexture2DMS utex2DMS; +uniform texture2DMSArray tex2DMSArray; +uniform itexture2DMSArray itex2DMSArray; +uniform utexture2DMSArray utex2DMSArray; +uniform texture1D tex1D; +uniform texture3D tex3D; +uniform texture2DRect tex2DRect; +uniform texture1DArray tex1DArray; + +void foo() +{ + sampler2D (tex2D, s); + samplerCube (texCube, s); + samplerCubeArray (texCubeArray, s); + samplerCubeArrayShadow (texCubeArray, sShadow); + isamplerCubeArray (itexCubeArray, s); + usamplerCubeArray (utexCubeArray, s); + sampler1DArrayShadow (tex1DArray, sShadow); + isampler1DArray (itex1DArray, s); + usampler1D (utex1D, s); + isampler1D (itex1D, s); + usampler1DArray (utex1DArray, s); + samplerBuffer (texBuffer, s); + samplerCubeShadow (texCube, sShadow); + sampler2DArray (tex2DArray, s); + sampler2DArrayShadow (tex2DArray, sShadow); + isampler2D (itex2D, s); + isampler3D (itex3D, s); + isamplerCube (itexCube, s); + isampler2DArray (itex2DArray, s); + usampler2D (utex2D, s); + usampler3D (utex3D, s); + usamplerCube (utexCube, s); + usampler2DArray (utex2DArray, s); + isampler2DRect (itex2DRect, s); + usampler2DRect (utex2DRect, s); + isamplerBuffer (itexBuffer, s); + usamplerBuffer (utexBuffer, s); + sampler2DMS (tex2DMS, s); + isampler2DMS (itex2DMS, s); + usampler2DMS (utex2DMS, s); + sampler2DMSArray (tex2DMSArray, s); + isampler2DMSArray (itex2DMSArray, s); + usampler2DMSArray (utex2DMSArray, s); + sampler1D (tex1D, s); + sampler1DShadow (tex1D, sShadow); + sampler3D (tex3D, s); + sampler2DShadow (tex2D, sShadow); + sampler2DRect (tex2DRect, s); + sampler2DRectShadow (tex2DRect, sShadow); + sampler1DArray (tex1DArray, s); +} diff --git a/Test/spv.shiftOps.frag b/Test/spv.shiftOps.frag index 498d5bd1..7fb937f4 100644 --- a/Test/spv.shiftOps.frag +++ b/Test/spv.shiftOps.frag @@ -1,10 +1,9 @@ #version 450 -uniform int i1; -uniform uint u1; - -uniform ivec3 i3; -uniform uvec3 u3; +flat in int i1; +flat in uint u1; +flat in ivec3 i3; +flat in uvec3 u3; out ivec3 icolor; out uvec3 ucolor; diff --git a/Test/spv.shortCircuit.frag b/Test/spv.shortCircuit.frag index dc1bf79a..4a626417 100755 --- a/Test/spv.shortCircuit.frag +++ b/Test/spv.shortCircuit.frag @@ -1,12 +1,12 @@ #version 400 -uniform ivec4 uiv4; -uniform vec4 uv4; -uniform bool ub; -uniform bool uba; -uniform bvec4 ub41, ub42; -uniform float uf; -uniform int ui; +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bool uba; +bvec4 ub41, ub42; +in float uf; +flat in int ui; out float of1; out vec4 of4; diff --git a/Test/spv.simpleFunctionCall.frag b/Test/spv.simpleFunctionCall.frag index 59f0ccd5..496bb93d 100644 --- a/Test/spv.simpleFunctionCall.frag +++ b/Test/spv.simpleFunctionCall.frag @@ -1,8 +1,6 @@ #version 150 -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; +in vec4 BaseColor; vec4 foo() { diff --git a/Test/spv.simpleMat.vert b/Test/spv.simpleMat.vert index afbc0db1..897a8986 100644 --- a/Test/spv.simpleMat.vert +++ b/Test/spv.simpleMat.vert @@ -1,6 +1,6 @@ #version 330 -uniform mat4 mvp; +varying mat4 mvp; in vec4 v; in mat3 am3; diff --git a/Test/spv.sparseTexture.frag b/Test/spv.sparseTexture.frag new file mode 100644 index 00000000..c995ee2a --- /dev/null +++ b/Test/spv.sparseTexture.frag @@ -0,0 +1,91 @@ +#version 450 +#extension GL_ARB_sparse_texture2: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DMS s2DMS; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +layout(rgba32f) uniform image2D i2D; +layout(rgba32i) uniform iimage3D ii3D; +layout(rgba32f) uniform image2DMS i2DMS; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in flat ivec2 ic2; +in flat ivec3 ic3; + +in flat ivec2 offsets[4]; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureARB(s2D, c2, texel); + resident |= sparseTextureARB(s3D, c3, texel, 2.0); + resident |= sparseTextureARB(isCube, c3, itexel); + resident |= sparseTextureARB(s2DShadow, c3, texel.x); + resident |= sparseTextureARB(sCubeArrayShadow, c4, 1.0, texel.x); + + resident |= sparseTextureLodARB(s2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(usCubeArray, c4, 1.0, utexel); + resident |= sparseTextureLodARB(s2DShadow, c3, 2.0, texel.y); + + resident |= sparseTextureOffsetARB(s3D, c3, ivec3(2), texel, 2.0); + resident |= sparseTextureOffsetARB(us2DRect, c2, ivec2(3), utexel); + resident |= sparseTextureOffsetARB(s2DArrayShadow, c4, ivec2(5), texel.z); + + resident |= sparseTexelFetchARB(s2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(us2DRect, ivec2(c2), utexel); + resident |= sparseTexelFetchARB(s2DMS, ivec2(c2), 4, texel); + + resident |= sparseTexelFetchOffsetARB(s3D, ivec3(c3), 2, ivec3(4), texel); + resident |= sparseTexelFetchOffsetARB(us2DRect, ivec2(c2), ivec2(3), utexel); + + resident |= sparseTextureLodOffsetARB(s2D, c2, 2.0, ivec2(5), texel); + resident |= sparseTextureLodOffsetARB(is2DArray, c3, 2.0, ivec2(6), itexel); + resident |= sparseTextureLodOffsetARB(s2DShadow, c3, 2.0, ivec2(7), texel.z); + + resident |= sparseTextureGradARB(s3D, c3, c3, c3, texel); + resident |= sparseTextureGradARB(sCubeShadow, c4, c3, c3, texel.y); + resident |= sparseTextureGradARB(usCubeArray, c4, c3, c3, utexel); + + resident |= sparseTextureGradOffsetARB(s2D, c2, c2, c2, ivec2(5), texel); + resident |= sparseTextureGradOffsetARB(s2DRectShadow, c3, c2, c2, ivec2(6), texel.w); + resident |= sparseTextureGradOffsetARB(is2DArray, c3, c2, c2, ivec2(2), itexel); + + resident |= sparseTextureGatherARB(s2D, c2, texel); + resident |= sparseTextureGatherARB(is2DArray, c3, itexel, 2); + resident |= sparseTextureGatherARB(s2DArrayShadow, c3, 2.0, texel); + + resident |= sparseTextureGatherOffsetARB(s2D, c2, ivec2(4), texel); + resident |= sparseTextureGatherOffsetARB(is2DArray, c3, ivec2(5), itexel, 2); + resident |= sparseTextureGatherOffsetARB(s2DRectShadow, c2, 2.0, ivec2(7), texel); + + resident |= sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); + resident |= sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); + resident |= sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); + + resident |= sparseImageLoadARB(i2D, ic2, texel); + resident |= sparseImageLoadARB(ii3D, ic3, itexel); + resident |= sparseImageLoadARB(i2DMS, ic2, 3, texel); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/Test/spv.sparseTextureClamp.frag b/Test/spv.sparseTextureClamp.frag new file mode 100644 index 00000000..97317938 --- /dev/null +++ b/Test/spv.sparseTextureClamp.frag @@ -0,0 +1,70 @@ +#version 450 +#extension GL_ARB_sparse_texture_clamp: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in float lodClamp; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel); + resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0); + resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel); + resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x); + + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s3D, c3, lodClamp, 2.0); + itexel += textureClampARB(isCube, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp); + + resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0); + resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel); + resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z); + + texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0); + utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp); + texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp); + + resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel); + resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y); + resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel); + + texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp); + texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp); + utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp); + + resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel); + resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w); + resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel); + + texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp); + texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp); + itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/Test/spv.specConstant.comp b/Test/spv.specConstant.comp new file mode 100644 index 00000000..ae8ae19d --- /dev/null +++ b/Test/spv.specConstant.comp @@ -0,0 +1,13 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; + +buffer bn { + uint a; +} bi; + +void main() +{ + bi.a = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z; +} diff --git a/Test/spv.specConstant.vert b/Test/spv.specConstant.vert new file mode 100644 index 00000000..0f9764d4 --- /dev/null +++ b/Test/spv.specConstant.vert @@ -0,0 +1,43 @@ +#version 400 + +layout(constant_id = 16) const int arraySize = 5; +in vec4 ucol[arraySize]; + +layout(constant_id = 17) const bool spBool = true; +layout(constant_id = 18) const float spFloat = 3.14; +layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; +layout(constant_id = 22) const uint scale = 2; + +out vec4 color; +out int size; + +// parameter should be considered same type as ucol +void foo(vec4 p[arraySize]); + +void main() +{ + color = ucol[2]; + size = arraySize; + if (spBool) + color *= scale; + color += float(spDouble / spFloat); + + foo(ucol); +} + +layout(constant_id = 116) const int dupArraySize = 12; +in vec4 dupUcol[dupArraySize]; + +layout(constant_id = 117) const bool spDupBool = true; +layout(constant_id = 118) const float spDupFloat = 3.14; +layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; +layout(constant_id = 122) const uint dupScale = 2; + +void foo(vec4 p[arraySize]) +{ + color += dupUcol[2]; + size += dupArraySize; + if (spDupBool) + color *= dupScale; + color += float(spDupDouble / spDupFloat); +} diff --git a/Test/spv.structAssignment.frag b/Test/spv.structAssignment.frag index 072d6b56..72984f2d 100644 --- a/Test/spv.structAssignment.frag +++ b/Test/spv.structAssignment.frag @@ -1,7 +1,7 @@ -#version 130 +#version 140 uniform sampler2D samp2D; -varying mediump vec2 coord; +in mediump vec2 coord; struct lunarStruct1 { int i; @@ -22,9 +22,9 @@ struct lunarStruct3 { }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2; -uniform lunarStruct3 foo3; +lunarStruct1 foo; +lunarStruct2 foo2; +lunarStruct3 foo3; void main() { diff --git a/Test/spv.structDeref.frag b/Test/spv.structDeref.frag index b702583d..11822cdc 100644 --- a/Test/spv.structDeref.frag +++ b/Test/spv.structDeref.frag @@ -1,7 +1,7 @@ -#version 130 +#version 140 uniform sampler2D samp2D; -varying vec2 coord; +in vec2 coord; struct s0 { int i; @@ -31,12 +31,12 @@ struct s3 { }; -uniform s0 foo0; -uniform s1 foo1; -uniform s2 foo2; -uniform s3 foo3; +s0 foo0; +s1 foo1; +s2 foo2; +s3 foo3; -uniform s00 foo00; +s00 foo00; void main() { diff --git a/Test/spv.structure.frag b/Test/spv.structure.frag index 4ed439da..b81b9547 100644 --- a/Test/spv.structure.frag +++ b/Test/spv.structure.frag @@ -1,6 +1,6 @@ -#version 130 +#version 140 uniform sampler2D samp2D; -varying vec2 coord; +in vec2 coord; struct lunarStruct1 { int i; @@ -14,8 +14,8 @@ struct lunarStruct2 { lunarStruct1 s1_1[7]; }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; +lunarStruct1 foo; +lunarStruct2 foo2[5]; void main() { diff --git a/Test/spv.subpass.frag b/Test/spv.subpass.frag new file mode 100644 index 00000000..42411d99 --- /dev/null +++ b/Test/spv.subpass.frag @@ -0,0 +1,29 @@ +#version 400 + +layout(input_attachment_index = 1) uniform subpassInput sub; +layout(input_attachment_index = 2) uniform subpassInputMS subMS; +layout(input_attachment_index = 3) uniform isubpassInput isub; +layout(input_attachment_index = 4) uniform isubpassInputMS isubMS; +layout(input_attachment_index = 5) uniform usubpassInput usub; +layout(input_attachment_index = 6) uniform usubpassInputMS usubMS; + +out vec4 color; +out ivec4 icolor; +out uvec4 ucolor; + +void foo(isubpassInputMS sb) +{ + icolor += subpassLoad(sb, 3); +} + +void main() +{ + color = subpassLoad(sub); + color += subpassLoad(subMS, 3); + icolor = subpassLoad(isub); + icolor += subpassLoad(isubMS, 3); + ucolor = subpassLoad(usub); + ucolor += subpassLoad(usubMS, 3); + + foo(isubMS); +} diff --git a/Test/spv.switch.frag b/Test/spv.switch.frag index 828b069f..1808086a 100644 --- a/Test/spv.switch.frag +++ b/Test/spv.switch.frag @@ -1,9 +1,9 @@ #version 310 es precision mediump float; -uniform int c, d; +flat in int c, d; in float x; out float color; -uniform vec4 v; +in vec4 v; vec4 foo1(vec4 v1, vec4 v2, int i1) { diff --git a/Test/spv.swizzle.frag b/Test/spv.swizzle.frag index 14f507ec..5a5a203c 100644 --- a/Test/spv.swizzle.frag +++ b/Test/spv.swizzle.frag @@ -1,10 +1,10 @@ -#version 110 +#version 140 -uniform float blend; -uniform vec4 u; -uniform bool p; +in float blend; +in vec4 u; +bool p; -varying vec2 t; +in vec2 t; void main() { diff --git a/Test/spv.test.frag b/Test/spv.test.frag index c4fe62d2..3d4d8f96 100644 --- a/Test/spv.test.frag +++ b/Test/spv.test.frag @@ -3,9 +3,9 @@ uniform sampler2D texSampler2D; uniform sampler3D texSampler3D; -uniform float blend; -uniform vec2 scale; -uniform vec4 u; +in float blend; +in vec2 scale; +in vec4 u; in vec2 t; in vec3 coords; diff --git a/Test/spv.test.vert b/Test/spv.test.vert index 213c0acd..e2e16aa5 100644 --- a/Test/spv.test.vert +++ b/Test/spv.test.vert @@ -1,6 +1,6 @@ -#version 130 +#version 140 -uniform mat4 transform; +in mat4 transform; attribute vec4 position; in vec2 uv_in; diff --git a/Test/spv.texture.frag b/Test/spv.texture.frag index 1d6a1af7..73884d1c 100644 --- a/Test/spv.texture.frag +++ b/Test/spv.texture.frag @@ -1,4 +1,4 @@ -#version 130 +#version 140 uniform sampler1D texSampler1D; uniform sampler2D texSampler2D; @@ -7,12 +7,12 @@ uniform samplerCube texSamplerCube; uniform sampler1DShadow shadowSampler1D; uniform sampler2DShadow shadowSampler2D; -uniform float blend; -uniform vec2 scale; -uniform vec4 u; +varying float blend; +varying vec2 scale; +varying vec4 u; -varying vec2 t; -varying vec2 coords2D; +in vec2 t; +in vec2 coords2D; void main() { diff --git a/Test/spv.texture.vert b/Test/spv.texture.vert index a135b9d7..9b03bba0 100644 --- a/Test/spv.texture.vert +++ b/Test/spv.texture.vert @@ -1,4 +1,4 @@ -#version 130 +#version 140 uniform sampler1D texSampler1D; uniform sampler2D texSampler2D; diff --git a/Test/spv.types.frag b/Test/spv.types.frag index 48701d89..a2ab1d32 100644 --- a/Test/spv.types.frag +++ b/Test/spv.types.frag @@ -1,24 +1,21 @@ -#version 130 +#version 140 -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; - -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; - -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; +flat in int u_i; +flat in ivec2 u_i2; +flat in ivec3 u_i3; +flat in ivec4 u_i4; + in float u_f; + in vec2 u_f2; + in vec3 u_f3; + in vec4 u_f4; +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; flat in int i_i; flat in ivec2 i_i2; diff --git a/Test/spv.uint.frag b/Test/spv.uint.frag index 551ef16f..92a8f962 100644 --- a/Test/spv.uint.frag +++ b/Test/spv.uint.frag @@ -1,12 +1,12 @@ -#version 300 es +#version 310 es precision mediump float; flat in uvec2 t; in float f; in vec2 tc; -uniform uvec4 v; -uniform int i; -uniform bool b; +flat in uvec4 v; +flat in int i; +bool b; out uvec4 c; diff --git a/Test/spv.uniformArray.frag b/Test/spv.uniformArray.frag index 7db28764..b7625afe 100644 --- a/Test/spv.uniformArray.frag +++ b/Test/spv.uniformArray.frag @@ -1,8 +1,9 @@ -#version 130 +#version 140 + uniform sampler2D texSampler2D; -uniform vec3 inColor; -uniform vec4 color[6]; -uniform float alpha[16]; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; void main() { diff --git a/Test/spv.variableArrayIndex.frag b/Test/spv.variableArrayIndex.frag index 67fbf93e..cc304b8e 100644 --- a/Test/spv.variableArrayIndex.frag +++ b/Test/spv.variableArrayIndex.frag @@ -1,6 +1,7 @@ -#version 130 +#version 400 + uniform sampler2D samp2D; -varying vec2 coord; +in vec2 coord; struct lunarStruct1 { int i; @@ -21,10 +22,10 @@ struct lunarStruct3 { }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; -uniform lunarStruct3 foo3; -uniform int Count; +flat in lunarStruct1 foo; +flat in lunarStruct2 foo2[5]; +flat in lunarStruct3 foo3; +flat in int Count; void main() { diff --git a/Test/spv.varyingArray.frag b/Test/spv.varyingArray.frag index 4bd6f942..f6e043f2 100644 --- a/Test/spv.varyingArray.frag +++ b/Test/spv.varyingArray.frag @@ -1,19 +1,19 @@ -#version 130 +#version 140 uniform sampler2D texSampler2D; -varying vec4 color; -varying float alpha; +in vec4 color; +in float alpha; -varying vec4 gl_TexCoord[6]; +in vec4 TexCoord[6]; -varying vec4 foo[3]; +in vec4 foo[3]; void main() { - vec4 texColor = texture(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); + vec4 texColor = texture(texSampler2D, vec2(TexCoord[4] + TexCoord[5])); texColor += color; texColor.a = alpha; - gl_FragColor = foo[1] + gl_TexCoord[0] + gl_TexCoord[4] + texColor; + gl_FragColor = foo[1] + TexCoord[0] + TexCoord[4] + texColor; } diff --git a/Test/spv.varyingArrayIndirect.frag b/Test/spv.varyingArrayIndirect.frag index e424e6e7..a556c9eb 100644 --- a/Test/spv.varyingArrayIndirect.frag +++ b/Test/spv.varyingArrayIndirect.frag @@ -1,21 +1,21 @@ -#version 130 +#version 140 uniform sampler2D texSampler2D; -varying vec4 color; -varying float alpha; +in vec4 color; +in float alpha; -varying vec4 gl_TexCoord[6]; +in vec4 TexCoord[6]; -varying vec4 userIn[2]; +in vec4 userIn[2]; -uniform int a, b; +flat in int a, b; void main() { - vec4 texColor = texture(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); + vec4 texColor = texture(texSampler2D, vec2(userIn[b] + TexCoord[a] + TexCoord[5])); texColor += color; texColor.a = alpha; - gl_FragColor = gl_TexCoord[0] + gl_TexCoord[b] + texColor + userIn[a]; + gl_FragColor = TexCoord[0] + TexCoord[b] + texColor + userIn[a]; } diff --git a/Test/spv.voidFunction.frag b/Test/spv.voidFunction.frag index 4767f7ab..228ea1ff 100644 --- a/Test/spv.voidFunction.frag +++ b/Test/spv.voidFunction.frag @@ -1,8 +1,8 @@ -#version 120 +#version 400 -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; +in vec4 bigColor; +in vec4 BaseColor; +in float d; float bar = 2.0; diff --git a/Test/spv.while-continue-break.vert b/Test/spv.while-continue-break.vert index 751e265c..c81e8d28 100644 --- a/Test/spv.while-continue-break.vert +++ b/Test/spv.while-continue-break.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i = 0; int A, B, C, D; diff --git a/Test/spv.while-simple.vert b/Test/spv.while-simple.vert index 701dc102..0f38325d 100644 --- a/Test/spv.while-simple.vert +++ b/Test/spv.while-simple.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es void main() { int i = 0; while (i<10) { diff --git a/Test/spv.whileLoop.frag b/Test/spv.whileLoop.frag index a9541f91..f7b7141e 100644 --- a/Test/spv.whileLoop.frag +++ b/Test/spv.whileLoop.frag @@ -1,8 +1,8 @@ -#version 110 +#version 140 -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; +in vec4 bigColor; +in vec4 BaseColor; +in float d; void main() { diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 799148db..009e0453 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -3,8 +3,11 @@ # goes to the innermost target. spv.do-simple.vert spv.do-while-continue-break.vert +spv.for-complex-condition.vert spv.for-continue-break.vert spv.for-simple.vert +spv.for-notest.vert +spv.for-nobody.vert spv.while-continue-break.vert spv.while-simple.vert # vulkan-specific tests @@ -32,6 +35,8 @@ spv.always-discard.frag spv.always-discard2.frag spv.bitCast.frag spv.bool.vert +spv.boolInBlock.frag +spv.branch-return.vert spv.conditionalDiscard.frag spv.conversion.frag spv.dataOut.frag @@ -56,6 +61,8 @@ spv.loopsArtificial.frag spv.matFun.vert spv.matrix.frag spv.matrix2.frag +spv.memoryQualifier.frag +spv.merge-unreachable.frag spv.newTexture.frag spv.nonSquare.vert spv.Operations.frag @@ -66,6 +73,8 @@ spv.qualifiers.vert spv.shiftOps.frag spv.simpleFunctionCall.frag spv.simpleMat.vert +spv.sparseTexture.frag +spv.sparseTextureClamp.frag spv.structAssignment.frag spv.structDeref.frag spv.structure.frag @@ -84,7 +93,15 @@ spv.varyingArray.frag spv.varyingArrayIndirect.frag spv.voidFunction.frag spv.whileLoop.frag -spv.atomic.comp spv.AofA.frag spv.queryL.frag +spv.separate.frag spv.shortCircuit.frag +spv.pushConstant.vert +spv.subpass.frag +spv.specConstant.vert +spv.specConstant.comp +# GLSL-level semantics +vulkan.frag +vulkan.vert +vulkan.comp diff --git a/Test/testlist b/Test/testlist index 34780403..d60fbca4 100644 --- a/Test/testlist +++ b/Test/testlist @@ -127,3 +127,5 @@ varyingArray.frag varyingArrayIndirect.frag voidFunction.frag whileLoop.frag +nonVulkan.frag +spv.atomic.comp diff --git a/Test/vulkan.comp b/Test/vulkan.comp new file mode 100644 index 00000000..6b6f4cf3 --- /dev/null +++ b/Test/vulkan.comp @@ -0,0 +1,12 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; +layout(local_size_z_id = 14) in; // ERROR, can't change this + +void main() +{ + gl_WorkGroupSize; +} + +layout(local_size_y_id = 19) in; // ERROR, already used: TODO not yet reported diff --git a/Test/vulkan.frag b/Test/vulkan.frag new file mode 100644 index 00000000..b96647c7 --- /dev/null +++ b/Test/vulkan.frag @@ -0,0 +1,69 @@ +#version 450 + +uniform sampler s; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +int i; +uniform samplerShadow sShadow; +uniform texture3D t3d5[5]; +writeonly uniform image2D i2d; + +void badConst() +{ + sampler2D(t2d); // ERROR, need 2 args + sampler2D(s, s); // ERROR, wrong type + sampler2D(i, i); // ERROR, wrong type + sampler2D(t2d, i); // ERROR, wrong type + sampler2D(t2d, t2d); // ERROR, wrong type + sampler2D(t2d, sA); // ERROR, wrong type + + sampler3D[4](t3d5, sA[2]); // ERROR, can't make array + sampler2D(i2d, s); // ERROR, image instead of texture + sampler2D(t3d[1], s); // ERROR, 3D not 2D + sampler2D(t2d, sShadow); // ERROR, shadow mismatch + sampler2DShadow(t2d, s); // ERROR, shadow mismatch +} + +sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor +sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor + +out vec4 color; + +void main() +{ + color = texture(s2D, vec2(0.5)); + color += texture(s3d[i], vec3(0.5)); +} + +layout(push_constant) buffer pcb { // ERROR, not on a buffer + int a; +} pcbInst; + +layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block + +layout(push_constant) uniform; // ERROR, needs an object + +layout(push_constant) uniform pcb2 { + int a; +}; // ERROR, no instance name + +layout(input_attachment_index = 2) uniform subpassInput subD; +layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture +layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image +uniform subpassInput subDbad3; // ERROR, need attachment number +layout(input_attachment_index = 2) uniform subpassInputMS subDMS; + +void foo() +{ + vec4 v = subpassLoad(subD); + v += subpassLoadMS(subD); // ERROR, no such function + v += subpassLoad(subD, 2); // ERROR, no such sig. + v += subpassLoad(subDMS, 2); + v += subpassLoadMS(subDMS, 2); // ERROR, no such function +} + +subroutine int fooS; // ERROR, not in SPV +subroutine int fooSub(); // ERROR, not in SPV + +uniform vec4 dv4; // ERROR, no default uniforms diff --git a/Test/vulkan.vert b/Test/vulkan.vert new file mode 100644 index 00000000..ad33a53b --- /dev/null +++ b/Test/vulkan.vert @@ -0,0 +1,39 @@ +#version 450 + +layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage +layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage + +out vec4 color; + +layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar +layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier +layout(constant_id = 4000) const int c1 = 12; // ERROR, too big +layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar +layout(constant_id = 4) in; + +void main() +{ + color = subpassLoad(subD1); // ERROR, no such function in this stage +} + +layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan +layout(shared) uniform ub1n { int a; } ub1i; // ERROR, no shared +layout(packed) uniform ub2n { int a; } ub2i; // ERROR, no packed + +layout(constant_id=222) const int arraySize = 4; + +void foo() +{ + int a1[arraySize]; + int a2[arraySize] = a1; // ERROR, can't use in initializer + + a1 = a2; // ERROR, can't assign, even though the same type + if (a1 == a2) // ERROR, can't compare either + ++color; +} + +layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant diff --git a/Todo.txt b/Todo.txt deleted file mode 100644 index 57d1a8fc..00000000 --- a/Todo.txt +++ /dev/null @@ -1,320 +0,0 @@ -Current Compilation Full-Functionality Level: ESSL 1.00-3.00, GLSL 1.10-3.30 - -Key: - + means something got completed - - means something has not yet been done - [Name] means Name is working on it - -Summary of main missing features: - -AEP - + GL_KHR_blend_equation_advanced - + GL_OES_sample_variables - + GL_OES_shader_image_atomic - + GL_OES_shader_multisample_interpolation - + GL_OES_texture_storage_multisample_2d_array - + GL_EXT_geometry_shader - + GL_EXT_geometry_point_size - + GL_EXT_gpu_shader5 - + GL_EXT_primitive_bounding_box - + GL_EXT_shader_io_blocks - + GL_EXT_tessellation_shader - + GL_EXT_tessellation_point_size - + GL_EXT_texture_buffer - + GL_EXT_texture_cube_map_array - -Missing features in ES 3.1 - + Arrays of arrays - + .length() on run-time array - -Missing desktop features that are in EAP - + per-sample shading - - "precise" - -Missing desktop features, non AEP - - subroutines - - built-in functions for type 'double' - - second-generation function-overloading disambiguation algorithm (version 400) - - Preprocessor token pasting (##), ## does macro expansion after pasting not before - + textureQueryLevels and textureQueryLod - -Bugs - - implicitly-sized gl_ClipDistance[] (at least in tessellation shaders) with sizes greater than one are not getting sizes greater than one - -+ create version system - -Link Validation - + provide input config file for setting limits - - also consider spitting out measures of complexity - + ensure no static references thrown away - - generate static use of object even if the only use is to access the length of its array - Cross-stage linking - - type consistency check of uniform and ins <-> outs, both variables and blocks, stage-specific arrayness matching - - location/binding/index check - - mixed es/non-es profiles - - statically consumed input not produced by previous stage - - give error for sharing a packed block - - 1.2: matching initializers for uniforms - - 1.3: only statically used built-ins have to be redeclared as flat - - 1.5: matching between gl_PerVertex blocks and gl_PerFragment blocks - - 1.3: deprecated mixing fixed vertex/fragment stage with programmable fragment/vertex stage. - + 4.0: tessellation primitive, vertices, spacing, order, - - 4.3: compute shader not combined with any other stages - - 4.3: remove cross-version linking restrictions. - - 4.3: Allow mismatches in interpolation and auxiliary qualification across stages. - - 4.4: A stage contains two different blocks, each with no instance name, where the blocks contain a member with the same name. - Intra-stage linking, single shader - + recursion for functions - - limits checking: - + bindings - - number of input/output compononents - + tessellation limits - + tessellation primitive array sizing consistency - + Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords - + Non ES: gl_ClipDistance ... - - ... - + exactly one main - + ES 3.0: fragment outputs all have locations, if more than one - + location aliasing/overlap (except desktop vertex shader inputs) - + binding overlap for atomic counters - + Non ES: geometry shader input array sizes and input layout qualifier declaration - + Non ES: read or write to both gl_ClipVertex and gl_ClipDistance - + Non ES: write to only one of gl_FragColor, gl_FragData, or user-declared - + 1.50: match between all explicit input array sizes and input primitive - + 1.50: at least one geometry shader says input primitive and at least one says output primitive... - + 1.50: at least one geometry shader says max_vertices... - + 1.50: origin_upper_left and pixel_center_integer have to match - - Even the potential for recursion through subroutine uniforms is an error. - - 4.4: An interface contains two different blocks, each with no instance name, where the blocks contain a member with the same name. - - 4.4: component aliasing (except desktop vertex shader inputs) - - 4.4: overlapping transform/feedback offsets, offset/stride overflow checks, and stride matching - Intra-stage linking, multiple shader (Non-ES) - + type consistency check of uniforms, globals, ins, and outs - + value checking of global const initializers - + value checking of uniform initializers - + location match - - block matching - + component/binding/index/offset match check - + compute shader layout(local_size_*) matching - + mixed es/non-es profiles are an error - - binding overlap for atomic counters - - matching redeclarations of interface blocks - - 4.3: implicit array sizing is cross shader within a stage - - 4.4: If gl_FragCoord is redeclared in any fragment shader in a program, it must be redeclared in all the fragment shaders in that program that have a static use gl_FragCoord - -Shader Functionality to Implement/Finish - ESSL 2.0 (#version 100) - + implement non-inductive loop limitation detection - + implement non-inductive array accesses limitation detection - ESSL 3.0 - - "const" compile-time constant propagation in the front-end has to be complete, for all built-in functions - ESSL 3.1 - + Compute shaders - + Shader storage buffer objects - - Arrays of arrays - + Atomic counters - + Images - + Separate program objects (also known as separate shader objects) - + Explicit uniform locations - + Texture gather - + Bitfield operations - + Integer mix function - + overlapping bindings/offsets and offset post increment - + frexp/ldexp - + packUnorm4x8(),packSnorm4x8(), unpackUnorm4x8(), unpackSnorm4x8() - + 2DMS samplers and images - + inheritance of memory qualifiers in block members - GLSL 1.2 - + Handle multiple compilation units per stage - + Allow initializers on uniform declarations - + signature matching takes type conversions into account, ambiguity is an error - GLSL 1.3 - + flat redeclaration of built-in variables - - Preprocessor token pasting (##), ## does macro expansion after pasting not before - + non-perspective (linear) interpolation (noperspective) - + add gl_ClipDistance[] to both vertex and fragment shaders - + Deprecated gl_ClipVertex - + deprecate almost all built-in state - + ftransform() is deprecated - + Deprecated built-in vertex inputs (attributes) and some outputs (varyings). - GLSL 1.4 (Non-ES) - + rectangular textures - + track as removed in this release, but present in others: - + Use of gl_ClipVertex. Use gl_ClipDistance instead. - + Built-in vertex shader inputs. - + Built-in uniforms except for depth range parameters - + Built-in interface between vertex and fragment: gl_TexCoord, gl_FogFragCoord, and all the color values. - + Built-in two-sided coloring. - + Fixed functionality for a programmable stage. - + ftransform(). Use invariant outputs instead. - GLSL 1.5 (Non-ES) - + Deprecated gl_MaxVaryingComponents - + Add new minimum maximums for gl_MaxVertexOutputComponents, gl_MaxGeometryInputComponents, gl_MaxGeometryOutputComponents, and gl_MaxFragmentInputComponents, - rather than relying on gl_MaxVaryingComponents. Also, corrected gl_MaxVaryingComponents to be 60 instead of 64. - + Added gl_PrimitiveID as an input to fragment shaders. - + Added gl_FragCoord qualifiers origin_upper_left, and pixel_center_integer to modify the values returned by gl_FragCoord (and have no affect on any other aspect of the pipeline or language). - + including redeclaration of gl_FragCoord that adds nothing - + Added support for multi-sample textures through sampler2DMS and sampler2DMSArray support in texelFetch() and textureSize(). - + Broadened interface blocks from just uniforms to in and out interfaces as well. - + Broaden array usage to include vertex shader inputs (vertex in). - + Added geometry shaders. This includes targeting layers in FBO rendering. - + geometry shader layouts: they must be declared, telling the system the primitive input and output types and maximum number of vertices. - + Added geometry shader constants. - + Broaden structure usage to include geometry inputs and geometry outputs. - + texel offset limit checking - + 1.50: geometry shaders: max_vertices must be checked against gl_MaxGeometryOutputVertices (maybe at compile time) - GLSL 3.3 - + Add ARB_explicit_attrib_location extension - + Add ARB_shader_bit_encoding extension - GLSL 4.0 - + tessellation control stage and tessellation evaluation stage. Includes barrier() built-in for synchronization. - + patch in, patch out - + input/output arrays - + unsized array sizing to gl_MaxPatchVertices, including gl_in/gl_out - + built-in variables, functions, and constants verification - + layout qualifiers for primitive types - - Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine. - - 64bit floating point numbers with the new type keyword double. Built-in functions extended for doubles, and new function matching rules are added to both allow implicit conversions when calling a function and preserve most existing function matching once doubles are included. - + More implicit conversions - + float to double, and similarly for all floating-point vector and matrix types - + int to uint, and similarly for all integer vector types - + int to double, and similarly for all vectors of integers and doubles. - + uint to double, and similarly for all vectors of integers and doubles. - + Cube map array textures and texture functions texture(), textureSize(), textureLod(), and textureGrad(). - + Sampler arrays can take a variable index now, as long as it's value is uniform for all uses. - - Per-sample shading. Including sample input mask gl_SampleMaskIn[] and per-sample interpolation, with explicit interpolation built-ins interpolateAtCentroid(), interpolateAtSample(), and interpolateAtOffset(). - - New precise qualifier to disallow optimizations that re-order operations or treat different instances of the same operator with different precision. - + Add a fused multiply and add built-in, fma(), in relation to the new precise qualifier. (Because “a * b + c” will require two operations under new rules for precise.) - + Added new built-in floating-point functions - + frexp() and ldexp() - + packUnorm2x16(), unpackUnorm2x16(), - + packUnorm4x8(), packSnorm4x8(), unpackUnorm4x8(), unpackSnorm4x8() - + packDouble2x32() and unpackDouble2x32() - + Add new built-in integer functions - + uaddCarry() and usubBorrow() - + umulExtended() and imulExtended() - + bitfieldExtract() and bitfieldInsert() - + bitfieldReverse() - + bitCount(), findLSB(), andfindMSB() - + New built-in to query LOD, textureQueryLod(). - - New overloaded function matching algorithm, handling selection from many valid multiple choices. - + Texture gather functions that return four texels with a single call. - + textureGather() - + textureGatherOffset() - + textureGatherOffsets() - + Add streams out from geometry shader. Output can be directed to streams through - + EmitStreamVertex() and EndStreamPrimitive(). - GLSL 4.1 - + Support for partitioning shaders into multiple programs to provide light-weight mixing of different shader stages. - (GL_ARB_separate_shader_objects) - + layout qualifiers - + redeclaration of input/output blocks - + ... - - Add 64-bit floating-point attributes for vertex shader inputs. - + Support viewport arrays so where the geometry shader selects which viewport array will transform its output. - GLSL 4.2 - + Move these previously deprecated features to be only in the compatibility profile: - + The keyword attribute for vertex shader inputs. (Use in instead.) - + The keyword varying for inputs and outputs. (Use in and out instead.) - + The original texturing built-in functions. (Use the new forms instead.) - + The built-in variables gl_FragColor and gl_FragData. (Use out instead.) - + Built-in constants related to these. - + Change from ASCII to UTF-8 for the language character set and also allow any characters inside comments (except the byte value 0), - including '\'. - + Add line-continuation using '\', as in C++. - + ES convergence - + Clarify that .xyzwxy.xy is illegal, as it temporarily makes a “vec6”. - + Clarify that return statements only accept values (no return of a void function). - + Add image types (GL_ARB_shader_image_load_store) - + 33 new types, all with “image” in their name, correspond to the non-shadow texture types - + addition of memory qualifiers: coherent, volatile, restrict, readonly, and writeonly - + can read/write/modify images from a shader, through new built-in functions - + qualifiers can act independently on the opaque shader variable and the backing image, so extra qualifiers can be used to separately qualify these - + early_fragment_tests - + Variables declared in if and else statements are scoped only to the end of those statements, especially for non-compound statements - Note, this is not backward compatible, it may depend on #version. - + Allow implicit conversions of return values to the declared type of the function. - + The const keyword can be used to declare variables within a function body with initializer expressions that are not constant expressions. - + Qualifiers on variable declarations no longer have to follow a strict order. The layout qualifier can be used multiple times, and multiple parameter qualifiers can be used. - + Parameter qualifiers can include precision and memory qualifiers. - + Add a new atomic_uint type to support atomic counters. Also, add built-in functions for manipulating atomic counters. - + atomicCounterIncrement, atomicCounterDecrement, and atomicCounter - + Add layout qualifier identifiers binding and offset to bind units to sampler and image variable declarations, atomic counters, and uniform blocks. - + Add built-in functions to pack/unpack 16 bit floating-point numbers (ARB_shading_language_pack2f). - + packHalf2x16 and unpackHalf2x16 - + packSnorm2x16and unpackSnorm2x16 - + Add gl_FragDepth layout qualifiers to communicate what kind of changes will be made to gl_FragDepth (GL_AMD_conservative depth). - + Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used. - + Allow .length() to be applied to vectors and matrices, returning the number of components or columns. - + Clarify that .length() returns an int type and can be used as a constant integer expression. - + Allow swizzle operations on scalars. - + Positive signed decimal literals, as well as octal and hexadecimal, can set all 32 bits. This includes setting the sign bit to create a negative value. - + Clarified that a comma sequence-operator expression cannot be a constant expression. E.g., “(2,3)” is not allowed, semantically, - as a valid constant expression 3, even though it is an expression that will evaluate to 3. - + Use vec2 instead of vec3 for coordinate in textureGather*(sampler2DRect,...). - + Clarify that textureGatherOffset() can take non-constants for the offsets. - GLSL 4.3 - + Add shader storage buffer objects, as per the ARB_shader_storage_buffer_object extension. This includes - + allowing the last member of a storage buffer block to be an array that does not know its size until render time - + read/write memory shared with the application and other shader invocations - + adding the std430 layout qualifier for shader storage blocks - + add atomic built-ins - + layout(binding=) - - Allow .length() on all arrays; returning a compile-time constant or not, depending on how the - array is sized, as per the ARB_shader_storage_buffer_object extension. - - Be clear that implicit array sizing is only within a stage, not cross stage. - - Array clarifications: - - All arrays are inherently homogeneous, except for arrays of the new shader storage buffer objects - - Arrays of shader storage buffer objects will be dereferenced when the .length() method is used on an unsized array - member, so that must a have valid index. - - Arrays of other objects (uniform blocks) containing implicitly sized arrays will have the same implicit size for all - elements of the array. - - Arrays of arrays are now supported, as per the GL_ARB_arrays_of_arrays extension. - + Compute shaders are now supported, as per the GL_ARB_compute_shader extension. - + Added imageSize() built-ins to query the dimensions of an image. - - Allow explicit locations/indexes to be assigned to subroutines, as per the GL_ARB_explicit_uniform_location extension. - + Accept ES GLSL shader #version statements, which will request ES functionality for ES GLSL - versions 100 and 300, as per the GL_ARB_ES3_compatibility extension. - + Clarify and correct scoping rules to what would normally be expected and what was intended. - (Function parameters and body nest inside global space. Loop variables and body nest inside - loop scope.) - + There are no digraphs (trigraphs were already disallowed). - + Remove the CPP difference that it is a compile-time error to use #if or #elif on expressions - containing undefined macro names. This reverts back to following expected CPP behavior. - + Set both gl_MaxFragmentImageUniforms and gl_MaxCombinedImageUniforms to 8. - - Clarify textureSize() for cube map arrays. - - For layout qualifiers, - + make negative output locations a compile-time error, once integer expressions are allowed in layouts - - make indexes outside the range [0,1] a compile-time error. - + Add textureQueryLevels() built-ins to query the number of mipmap levels, as per the - GL_ARB_texture_query_levels extension. - + Make gl_Layer and gl_ViewportIndex also be inputs to the fragment shader, as per the - GL_ARB_fragment_layer_viewport extension. - - Clarify fragment output variables cannot be double precision. - + Allow the new shared keyword to be in layout-qualifier-id, allowing backward compatibility - with the shared identifier that was previously used. - + Added overlooked texture function float textureOffset (sampler2DArrayShadow sampler, vec4 P, vec2 offset [, float bias] ). - + Add missing type in grammar, ATOMIC_UINT, and missing qualifiers COHERENT, VOLATILE, RESTRICT, READONLY, and WRITEONLY. - + Add missing initializer lists to grammar. - GLSL 4.4 - + Incorporate the ARB_enhanced_layouts extension, which adds - + compile-time constant expressions for layout qualifier integers - + new offset and align layout qualifiers for control over buffer block layouts - + add location layout qualifier for input and output blocks and block members - + new component layout qualifier for finer-grained layout control of input and output variables and blocks - + new xfb_buffer, xfb_stride, and xfb_offsetlayout qualifiers to allow the shader to control - transform feedback buffering. - + Bug 10530: To be consistent with ES, include sample types as valid in a precision statement. - Note the defaults are irrelevant, as precision qualifiers are not required or have any meaning. - GLSL 4.5 - + Incorporate the ARB_ES3_1_compatibility extension - + Supports OpenGL ES 310 shaders. - + Adds imageAtomicExchange() built-in function for floating-point images. - + Adds coherent to atomic and image-atomic built-in function parameters. - + Adds gl_HelperInvocation built-in variable to say whether a fragment shader invocation is - only as a helper, so the shader can skip code not needed or harmful when in a helper invocation. - + Adds gl_MaxSamplesbuilt-in constant, and several other built-in constants. - + Adds mix() built-in functions for selection of int, uint, andbool components. - + Incorporate the GL_ARB_shader_texture_image_samples extension to query how many samples are in a multi-sample texture or image. - + Incorporate the GL_ARB_cull_distance extensions to add the built-in variable gl_CullDistance[] , which will cull whole primitives. - + Incorporate the GL_ARB_derivative_control extension diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt index 878eca5d..28f4742c 100644 --- a/glslang/CMakeLists.txt +++ b/glslang/CMakeLists.txt @@ -5,11 +5,12 @@ if(WIN32) elseif(UNIX) add_subdirectory(OSDependent/Unix) else(WIN32) - message("unkown platform") + message("unknown platform") endif(WIN32) set(SOURCES MachineIndependent/glslang.y + MachineIndependent/glslang_tab.cpp MachineIndependent/Constant.cpp MachineIndependent/InfoSink.cpp MachineIndependent/Initialize.cpp @@ -51,6 +52,7 @@ set(HEADERS Include/revision.h Include/ShHandle.h Include/Types.h + MachineIndependent/glslang_tab.cpp.h MachineIndependent/gl_types.h MachineIndependent/Initialize.h MachineIndependent/localintermediate.h @@ -64,26 +66,20 @@ set(HEADERS MachineIndependent/preprocessor/PpContext.h MachineIndependent/preprocessor/PpTokens.h) -find_package(BISON) -if(NOT BISON_FOUND) - set(BISON_EXECUTABLE ../tools/bison.exe) - message("bison not found. Assuming it is at ${BISON_EXECUTABLE}") -endif() - -# Always use a custom command since our use of --defines isn't assumed by CMake's BISON_TARGET, -# which ends up causing the target to always be rebuilt. -add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h - COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h -t ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang.y -o ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp - MAIN_DEPENDENCY MachineIndependent/glslang.y - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) +# This might be useful for making grammar changes: +# +# find_package(BISON) +# add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h +# COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h -t ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang.y -o ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp +# MAIN_DEPENDENCY MachineIndependent/glslang.y +# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +# set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) if(WIN32) source_group("Public" REGULAR_EXPRESSION "Public/*") source_group("MachineIndependent" REGULAR_EXPRESSION "MachineIndependent/[^/]*") - source_group("Generated Files" FILES MachineIndependent/glslang_tab.cpp MachineIndependent/glslang_tab.cpp.h) source_group("Include" REGULAR_EXPRESSION "Include/[^/]*") source_group("GenericCodeGen" REGULAR_EXPRESSION "GenericCodeGen/*") source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*") diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index 35d47af2..5a57664f 100644 --- a/glslang/Include/BaseTypes.h +++ b/glslang/Include/BaseTypes.h @@ -71,7 +71,7 @@ enum TStorageQualifier { EvqGlobal, // For globals read/write EvqConst, // User-defined constant values, will be semantically constant and constant folded EvqVaryingIn, // pipeline input, read only, also supercategory for all built-ins not included in this enum (see TBuiltInVariable) - EvqVaryingOut, // pipeline ouput, read/write, also supercategory for all built-ins not included in this enum (see TBuiltInVariable) + EvqVaryingOut, // pipeline output, read/write, also supercategory for all built-ins not included in this enum (see TBuiltInVariable) EvqUniform, // read only, shared with app EvqBuffer, // read/write, shared with app EvqShared, // compute shader's read/write 'shared' qualifier @@ -130,6 +130,8 @@ enum TBuiltInVariable { EbvLocalInvocationIndex, EbvVertexId, EbvInstanceId, + EbvVertexIndex, + EbvInstanceIndex, EbvBaseVertex, EbvBaseInstance, EbvDrawId, @@ -221,6 +223,8 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvLocalInvocationIndex: return "LocalInvocationIndex"; case EbvVertexId: return "VertexId"; case EbvInstanceId: return "InstanceId"; + case EbvVertexIndex: return "VertexIndex"; + case EbvInstanceIndex: return "InstanceIndex"; case EbvBaseVertex: return "BaseVertex"; case EbvBaseInstance: return "BaseInstance"; case EbvDrawId: return "DrawId"; diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 826ab14f..2872fac8 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -206,7 +206,7 @@ struct TSourceLoc { { if (name != nullptr) return quoteStringName ? ("\"" + std::string(name) + "\"") : name; - return std::to_string(string); + return std::to_string((long long)string); } const char* name; // descriptive name for this string int string; diff --git a/glslang/Include/ShHandle.h b/glslang/Include/ShHandle.h index 68b56cc6..fee64139 100644 --- a/glslang/Include/ShHandle.h +++ b/glslang/Include/ShHandle.h @@ -162,7 +162,9 @@ protected: TCompiler* ConstructCompiler(EShLanguage, int); TShHandleBase* ConstructLinker(EShExecutable, int); +TShHandleBase* ConstructBindings(); void DeleteLinker(TShHandleBase*); +void DeleteBindingList(TShHandleBase* bindingList); TUniformMap* ConstructUniformMap(); void DeleteCompiler(TCompiler*); diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index f1695839..c88bca67 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -63,6 +64,7 @@ enum TSamplerDim { EsdCube, EsdRect, EsdBuffer, + EsdSubpass, // goes only with non-sampled image (image is true) EsdNumDims }; @@ -73,8 +75,16 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool shadow : 1; bool ms : 1; bool image : 1; // image, combined should be false + bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler + bool sampler : 1; // true means a pure sampler, other fields should be clear() bool external : 1; // GL_OES_EGL_image_external + bool isImage() const { return image && dim != EsdSubpass; } + bool isSubpass() const { return dim == EsdSubpass; } + bool isCombined() const { return combined; } + bool isPureSampler() const { return sampler; } + bool isTexture() const { return !sampler && !image; } + void clear() { type = EbtVoid; @@ -83,6 +93,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler, shadow = false; ms = false; image = false; + combined = false; + sampler = false; external = false; } @@ -95,6 +107,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, arrayed = a; shadow = s; ms = m; + combined = true; } // make an image @@ -109,6 +122,35 @@ struct TSampler { // misnomer now; includes images, textures without sampler, image = true; } + // make a texture with no sampler + void setTexture(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false) + { + clear(); + type = t; + dim = d; + arrayed = a; + shadow = s; + ms = m; + } + + // make a subpass input attachment + void setSubpass(TBasicType t, bool m = false) + { + clear(); + type = t; + image = true; + dim = EsdSubpass; + ms = m; + } + + // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword + void setPureSampler(bool s) + { + clear(); + sampler = true; + shadow = s; + } + bool operator==(const TSampler& right) const { return type == right.type && @@ -117,6 +159,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler, shadow == right.shadow && ms == right.ms && image == right.image && + combined == right.combined && + sampler == right.sampler && external == right.external; } @@ -129,6 +173,11 @@ struct TSampler { // misnomer now; includes images, textures without sampler, { TString s; + if (sampler) { + s.append("sampler"); + return s; + } + switch (type) { case EbtFloat: break; case EbtInt: s.append("i"); break; @@ -136,9 +185,14 @@ struct TSampler { // misnomer now; includes images, textures without sampler, default: break; // some compilers want this } if (image) { - s.append("image"); - } else { + if (dim == EsdSubpass) + s.append("subpass"); + else + s.append("image"); + } else if (combined) { s.append("sampler"); + } else { + s.append("texture"); } if (external) { s.append("ExternalOES"); @@ -151,6 +205,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, case EsdCube: s.append("Cube"); break; case EsdRect: s.append("2DRect"); break; case EsdBuffer: s.append("Buffer"); break; + case EsdSubpass: s.append("Input"); break; default: break; // some compilers want this } if (ms) @@ -352,6 +407,7 @@ public: restrict = false; readonly = false; writeonly = false; + specConstant = false; clearLayout(); } @@ -370,6 +426,7 @@ public: bool restrict : 1; bool readonly : 1; bool writeonly : 1; + bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant bool isMemory() const { @@ -505,8 +562,12 @@ public: layoutXfbBuffer = layoutXfbBufferEnd; layoutXfbStride = layoutXfbStrideEnd; layoutXfbOffset = layoutXfbOffsetEnd; + layoutAttachment = layoutAttachmentEnd; + layoutSpecConstantId = layoutSpecConstantIdEnd; layoutFormat = ElfNone; + + layoutPushConstant = false; } bool hasLayout() const { @@ -515,7 +576,8 @@ public: hasBinding() || hasStream() || hasXfb() || - hasFormat(); + hasFormat() || + layoutPushConstant; } TLayoutMatrix layoutMatrix : 3; TLayoutPacking layoutPacking : 4; @@ -549,8 +611,16 @@ public: unsigned int layoutXfbOffset : 10; static const unsigned int layoutXfbOffsetEnd = 0x3FF; + unsigned int layoutAttachment : 8; // for input_attachment_index + static const unsigned int layoutAttachmentEnd = 0XFF; + + unsigned int layoutSpecConstantId : 11; + static const unsigned int layoutSpecConstantIdEnd = 0x7FF; + TLayoutFormat layoutFormat : 8; + bool layoutPushConstant; + bool hasUniformLayout() const { return hasMatrix() || @@ -627,6 +697,38 @@ public: { return layoutXfbOffset != layoutXfbOffsetEnd; } + bool hasAttachment() const + { + return layoutAttachment != layoutAttachmentEnd; + } + bool hasSpecConstantId() const + { + // Not the same thing as being a specialization constant, this + // is just whether or not it was declared with an ID. + return layoutSpecConstantId != layoutSpecConstantIdEnd; + } + bool isSpecConstant() const + { + // True if type is a specialization constant, whether or not it + // had a specialization-constant ID, and false if it is not a + // true front-end constant. + return specConstant; + } + bool isFrontEndConstant() const + { + // True if the front-end knows the final constant value. + // This allows front-end constant folding. + return storage == EvqConst && ! specConstant; + } + bool isConstant() const + { + // True if is either kind of constant; specialization or regular. + return isFrontEndConstant() || isSpecConstant(); + } + void makeSpecConstant() + { + specConstant = true; + } static const char* getLayoutPackingString(TLayoutPacking packing) { switch (packing) { @@ -684,7 +786,7 @@ public: case ElfRgba8ui: return "rgba8ui"; case ElfRg32ui: return "rg32ui"; case ElfRg16ui: return "rg16ui"; - case ElfRgb10a2ui: return "rgb10a2ui"; + case ElfRgb10a2ui: return "rgb10_a2ui"; case ElfRg8ui: return "rg8ui"; case ElfR32ui: return "r32ui"; case ElfR16ui: return "r16ui"; @@ -781,6 +883,7 @@ struct TShaderQualifiers { TVertexOrder order; bool pointMode; int localSize[3]; // compute shader + int localSizeSpecId[3]; // compute shader specialization id for gl_WorkGroupSize bool earlyFragmentTests; // fragment input TLayoutDepth layoutDepth; bool blendEquation; // true if any blend equation was specified @@ -798,6 +901,9 @@ struct TShaderQualifiers { localSize[0] = 1; localSize[1] = 1; localSize[2] = 1; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; earlyFragmentTests = false; layoutDepth = EldNone; blendEquation = false; @@ -827,6 +933,10 @@ struct TShaderQualifiers { if (src.localSize[i] > 1) localSize[i] = src.localSize[i]; } + for (int i = 0; i < 3; ++i) { + if (src.localSizeSpecId[i] != TQualifier::layoutNotSet) + localSizeSpecId[i] = src.localSizeSpecId[i]; + } if (src.earlyFragmentTests) earlyFragmentTests = true; if (src.layoutDepth) @@ -902,7 +1012,9 @@ public: return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr; } - bool isImage() const { return basicType == EbtSampler && sampler.image; } + // "Image" is a superset of "Subpass" + bool isImage() const { return basicType == EbtSampler && sampler.isImage(); } + bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); } }; // @@ -1112,7 +1224,9 @@ public: 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; } + // "Image" is a superset of "Subpass" + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } // Recursively checks if the type contains the given basic type virtual bool containsBasicType(TBasicType checkType) const @@ -1181,6 +1295,42 @@ public: return false; } + virtual bool containsNonOpaque() const + { + // list all non-opaque types + switch (basicType) { + case EbtVoid: + case EbtFloat: + case EbtDouble: + case EbtInt: + case EbtUint: + case EbtBool: + return true; + default: + break; + } + if (! structure) + return false; + for (unsigned int i = 0; i < structure->size(); ++i) { + if ((*structure)[i].type->containsNonOpaque()) + return true; + } + return false; + } + + virtual bool containsSpecializationSize() const + { + if (isArray() && arraySizes->containsNode()) + return true; + if (! structure) + return false; + for (unsigned int i = 0; i < structure->size(); ++i) { + if ((*structure)[i].type->containsSpecializationSize()) + return true; + } + return false; + } + // Array editing methods. Array descriptors can be shared across // type instances. This allows all uses of the same array // to be updated at once. E.g., all nodes can be explicitly sized @@ -1218,7 +1368,7 @@ public: arraySizes->addOuterSizes(s); } void changeOuterArraySize(int s) { arraySizes->changeOuterSize(s); } - void setImplicitArraySize (int s) { arraySizes->setImplicitSize(s); } + void setImplicitArraySize(int s) { arraySizes->setImplicitSize(s); } // Recursively make the implicit array size the explicit array size, through the type tree. void adoptImplicitArraySizes() @@ -1296,6 +1446,12 @@ public: p += snprintf(p, end - p, "xfb_offset=%d ", qualifier.layoutXfbOffset); if (qualifier.hasXfbStride()) p += snprintf(p, end - p, "xfb_stride=%d ", qualifier.layoutXfbStride); + if (qualifier.hasAttachment()) + p += snprintf(p, end - p, "input_attachment_index=%d ", qualifier.layoutAttachment); + if (qualifier.hasSpecConstantId()) + p += snprintf(p, end - p, "constant_id=%d ", qualifier.layoutSpecConstantId); + if (qualifier.layoutPushConstant) + p += snprintf(p, end - p, "push_constant "); p += snprintf(p, end - p, ") "); } } @@ -1324,6 +1480,8 @@ public: p += snprintf(p, end - p, "readonly "); if (qualifier.writeonly) p += snprintf(p, end - p, "writeonly "); + if (qualifier.specConstant) + p += snprintf(p, end - p, "specialization-constant "); p += snprintf(p, end - p, "%s ", getStorageQualifierString()); if (arraySizes) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { diff --git a/glslang/Include/arrays.h b/glslang/Include/arrays.h index 1d8ec435..a50088d2 100644 --- a/glslang/Include/arrays.h +++ b/glslang/Include/arrays.h @@ -46,6 +46,26 @@ namespace glslang { // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. const int UnsizedArraySize = 0; +class TIntermTyped; +extern bool SameSpecializationConstants(TIntermTyped*, TIntermTyped*); + +// Specialization constants need both a nominal size and a node that defines +// the specialization constant being used. Array types are the same when their +// size and specialization constant nodes are the same. +struct TArraySize { + unsigned int size; + TIntermTyped* node; // nullptr means no specialization constant node + bool operator==(const TArraySize& rhs) const + { + if (size != rhs.size) + return false; + if (node == nullptr || rhs.node == nullptr) + return node == rhs.node; + + return SameSpecializationConstants(node, rhs.node); + } +}; + // // TSmallArrayVector is used as the container for the set of sizes in TArraySizes. // It has generic-container semantics, while TArraySizes has array-of-array semantics. @@ -83,22 +103,31 @@ struct TSmallArrayVector { return (int)sizes->size(); } - unsigned int front() const + unsigned int frontSize() const { assert(sizes != nullptr && sizes->size() > 0); - return sizes->front(); + return sizes->front().size; + } + + TIntermTyped* frontNode() const + { + assert(sizes != nullptr && sizes->size() > 0); + return sizes->front().node; } void changeFront(unsigned int s) { assert(sizes != nullptr); - sizes->front() = s; + // this should only happen for implicitly sized arrays, not specialization constants + assert(sizes->front().node == nullptr); + sizes->front().size = s; } - void push_back(unsigned int e) + void push_back(unsigned int e, TIntermTyped* n) { alloc(); - sizes->push_back(e); + TArraySize pair = { e, n }; + sizes->push_back(pair); } void push_front(const TSmallArrayVector& newDims) @@ -129,16 +158,23 @@ struct TSmallArrayVector { } } - unsigned int operator[](int i) const + unsigned int getDimSize(int i) const { - assert(sizes != nullptr && (int)sizes->size() > i); - return (*sizes)[i]; + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].size; } - unsigned int& operator[](int i) + void setDimSize(int i, unsigned int size) const { - assert(sizes != nullptr && (int)sizes->size() > i); - return (*sizes)[i]; + assert(sizes != nullptr && (int)sizes->size() > i); + assert((*sizes)[i].node == nullptr); + (*sizes)[i].size = size; + } + + TIntermTyped* getDimNode(int i) const + { + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].node; } bool operator==(const TSmallArrayVector& rhs) const @@ -157,7 +193,7 @@ protected: void alloc() { if (sizes == nullptr) - sizes = new TVector; + sizes = new TVector; } void dealloc() { @@ -165,7 +201,7 @@ protected: sizes = nullptr; } - TVector* sizes; // will either hold such a pointer, or in the future, hold the two array sizes + TVector* sizes; // will either hold such a pointer, or in the future, hold the two array sizes }; // @@ -197,28 +233,32 @@ struct TArraySizes { // translate from array-of-array semantics to container semantics int getNumDims() const { return sizes.size(); } - int getDimSize(int dim) const { return sizes[dim]; } - void setDimSize(int dim, int size) { sizes[dim] = size; } - int getOuterSize() const { return sizes.front(); } + int getDimSize(int dim) const { return sizes.getDimSize(dim); } + TIntermTyped* getDimNode(int dim) const { return sizes.getDimNode(dim); } + void setDimSize(int dim, int size) { sizes.setDimSize(dim, size); } + int getOuterSize() const { return sizes.frontSize(); } + TIntermTyped* getOuterNode() const { return sizes.frontNode(); } int getCumulativeSize() const { int size = 1; for (int d = 0; d < sizes.size(); ++d) { // this only makes sense in paths that have a known array size - assert(sizes[d] != UnsizedArraySize); - size *= sizes[d]; + assert(sizes.getDimSize(d) != UnsizedArraySize); + size *= sizes.getDimSize(d); } return size; } - void addInnerSize() { sizes.push_back((unsigned)UnsizedArraySize); } - void addInnerSize(int s) { sizes.push_back((unsigned)s); } + void addInnerSize() { addInnerSize((unsigned)UnsizedArraySize); } + void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } + void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } + void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); } void changeOuterSize(int s) { sizes.changeFront((unsigned)s); } int getImplicitSize() const { return (int)implicitArraySize; } void setImplicitSize(int s) { implicitArraySize = s; } bool isInnerImplicit() const { for (int d = 1; d < sizes.size(); ++d) { - if (sizes[d] == (unsigned)UnsizedArraySize) + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) return true; } @@ -240,13 +280,26 @@ struct TArraySizes { return false; for (int d = 1; d < sizes.size(); ++d) { - if (sizes[d] != rhs.sizes[d]) + if (sizes.getDimSize(d) != rhs.sizes.getDimSize(d) || + sizes.getDimNode(d) != rhs.sizes.getDimNode(d)) return false; } return true; } + // Returns true if any of the dimensions of the array is sized with a node + // instead of a front-end compile-time constant. + bool containsNode() + { + for (int d = 0; d < sizes.size(); ++d) { + if (sizes.getDimNode(d) != nullptr) + return true; + } + + return false; + } + bool operator==(const TArraySizes& rhs) { return sizes == rhs.sizes; } bool operator!=(const TArraySizes& rhs) { return sizes != rhs.sizes; } diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 59955fcf..ce5fb775 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -238,6 +238,8 @@ enum TOperator { EOpFtransform, + EOpNoise, + EOpEmitVertex, // geometry only EOpEndPrimitive, // geometry only EOpEmitStreamVertex, // geometry only @@ -322,6 +324,7 @@ enum TOperator { EOpConstructDMat4x3, EOpConstructDMat4x4, EOpConstructStruct, + EOpConstructTextureSampler, EOpConstructGuardEnd, // @@ -369,6 +372,10 @@ enum TOperator { EOpImageAtomicExchange, EOpImageAtomicCompSwap, + EOpSubpassLoad, + EOpSubpassLoadMS, + EOpSparseImageLoad, + EOpImageGuardEnd, // @@ -398,6 +405,31 @@ enum TOperator { EOpTextureGather, EOpTextureGatherOffset, EOpTextureGatherOffsets, + EOpTextureClamp, + EOpTextureOffsetClamp, + EOpTextureGradClamp, + EOpTextureGradOffsetClamp, + + EOpSparseTextureGuardBegin, + + EOpSparseTexture, + EOpSparseTextureLod, + EOpSparseTextureOffset, + EOpSparseTextureFetch, + EOpSparseTextureFetchOffset, + EOpSparseTextureLodOffset, + EOpSparseTextureGrad, + EOpSparseTextureGradOffset, + EOpSparseTextureGather, + EOpSparseTextureGatherOffset, + EOpSparseTextureGatherOffsets, + EOpSparseTexelsResident, + EOpSparseTextureClamp, + EOpSparseTextureOffsetClamp, + EOpSparseTextureGradClamp, + EOpSparseTextureGradOffsetClamp, + + EOpSparseTextureGuardEnd, EOpTextureGuardEnd, @@ -577,7 +609,7 @@ protected: // class TIntermSymbol : public TIntermTyped { public: - // if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from + // if symbol is initialized as symbol(sym), the memory comes from the pool allocator of sym. If sym comes from // per process threadPoolAllocator, then it causes increased memory usage per compile // it is essential to use "symbol = sym" to assign to symbol TIntermSymbol(int i, const TString& n, const TType& t) : @@ -590,9 +622,9 @@ public: void setConstArray(const TConstUnionArray& c) { unionArray = c; } const TConstUnionArray& getConstArray() const { return unionArray; } protected: - int id; - TString name; - TConstUnionArray unionArray; + int id; // the unique id of the symbol this node represents + TString name; // the name of the symbol this node represents + TConstUnionArray unionArray; // if the symbol is a front-end compile-time constant, this is its value }; class TIntermConstantUnion : public TIntermTyped { @@ -622,6 +654,8 @@ struct TCrackedTextureOp { bool offsets; bool gather; bool grad; + bool subpass; + bool lodClamp; }; // @@ -637,6 +671,8 @@ public: bool isConstructor() const; bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; } bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; } + bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; } + bool isSparseImage() const { return op == EOpSparseImageLoad; } // Crack the op into the individual dimensions of texturing operation. void crackTexture(TSampler sampler, TCrackedTextureOp& cracked) const @@ -649,6 +685,8 @@ public: cracked.offsets = false; cracked.gather = false; cracked.grad = false; + cracked.subpass = false; + cracked.lodClamp = false; switch (op) { case EOpImageQuerySize: @@ -657,25 +695,40 @@ public: case EOpTextureQueryLod: case EOpTextureQueryLevels: case EOpTextureQuerySamples: + case EOpSparseTexelsResident: cracked.query = true; break; case EOpTexture: + case EOpSparseTexture: + break; + case EOpTextureClamp: + case EOpSparseTextureClamp: + cracked.lodClamp = true; break; case EOpTextureProj: cracked.proj = true; break; case EOpTextureLod: + case EOpSparseTextureLod: cracked.lod = true; break; case EOpTextureOffset: + case EOpSparseTextureOffset: cracked.offset = true; break; + case EOpTextureOffsetClamp: + case EOpSparseTextureOffsetClamp: + cracked.offset = true; + cracked.lodClamp = true; + break; case EOpTextureFetch: + case EOpSparseTextureFetch: cracked.fetch = true; if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D) cracked.lod = true; break; case EOpTextureFetchOffset: + case EOpSparseTextureFetchOffset: cracked.fetch = true; cracked.offset = true; if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D) @@ -686,6 +739,7 @@ public: cracked.proj = true; break; case EOpTextureLodOffset: + case EOpSparseTextureLodOffset: cracked.offset = true; cracked.lod = true; break; @@ -699,9 +753,16 @@ public: cracked.proj = true; break; case EOpTextureGrad: + case EOpSparseTextureGrad: cracked.grad = true; break; + case EOpTextureGradClamp: + case EOpSparseTextureGradClamp: + cracked.grad = true; + cracked.lodClamp = true; + break; case EOpTextureGradOffset: + case EOpSparseTextureGradOffset: cracked.grad = true; cracked.offset = true; break; @@ -714,17 +775,30 @@ public: cracked.offset = true; cracked.proj = true; break; + case EOpTextureGradOffsetClamp: + case EOpSparseTextureGradOffsetClamp: + cracked.grad = true; + cracked.offset = true; + cracked.lodClamp = true; + break; case EOpTextureGather: + case EOpSparseTextureGather: cracked.gather = true; break; case EOpTextureGatherOffset: + case EOpSparseTextureGatherOffset: cracked.gather = true; cracked.offset = true; break; case EOpTextureGatherOffsets: + case EOpSparseTextureGatherOffsets: cracked.gather = true; cracked.offsets = true; break; + case EOpSubpassLoad: + case EOpSubpassLoadMS: + cracked.subpass = true; + break; default: break; } @@ -872,7 +946,7 @@ enum TVisit // // Explicitly set postVisit to true if you want post visiting, otherwise, // filled in methods will only be called at pre-visit time (before processing -// the subtree). Similary for inVisit for in-order visiting of nodes with +// the subtree). Similarly for inVisit for in-order visiting of nodes with // multiple children. // // If you only want post-visits, explicitly turn off preVisit (and inVisit) @@ -905,7 +979,7 @@ public: void incrementDepth(TIntermNode *current) { depth++; - maxDepth = std::max(maxDepth, depth); + maxDepth = (std::max)(maxDepth, depth); path.push_back(current); } @@ -935,6 +1009,14 @@ protected: TVector path; }; +// KHR_vulkan_glsl says "Two arrays sized with specialization constants are the same type only if +// sized with the same symbol, involving no operations" +inline bool SameSpecializationConstants(TIntermTyped* node1, TIntermTyped* node2) +{ + return node1->getAsSymbolNode() && node2->getAsSymbolNode() && + node1->getAsSymbolNode()->getId() == node2->getAsSymbolNode()->getId(); +} + } // end namespace glslang #endif // __INTERMEDIATE_H diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index b14b74ad..e338849d 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 "SPIRV99.866" -#define GLSLANG_DATE "24-Dec-2015" +#define GLSLANG_REVISION "SPIRV99.947" +#define GLSLANG_DATE "15-Feb-2016" diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index a0bb8ded..db2f70da 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -43,22 +43,31 @@ namespace { using namespace glslang; +typedef union { + double d; + int i[2]; +} DoubleIntUnion; + // Some helper functions bool isNan(double x) { + DoubleIntUnion u; // tough to find a platform independent library function, do it directly - int bitPatternL = *(int*)&x; - int bitPatternH = *((int*)&x + 1); + u.d = x; + int bitPatternL = u.i[0]; + int bitPatternH = u.i[1]; return (bitPatternH & 0x7ff80000) == 0x7ff80000 && ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0); } bool isInf(double x) { + DoubleIntUnion u; // tough to find a platform independent library function, do it directly - int bitPatternL = *(int*)&x; - int bitPatternH = *((int*)&x + 1); + u.d = x; + int bitPatternL = u.i[0]; + int bitPatternH = u.i[1]; return (bitPatternH & 0x7ff00000) == 0x7ff00000 && (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0; } @@ -173,7 +182,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right case EbtInt: if (rightUnionArray[i] == 0) newConstArray[i].setIConst(0x7FFFFFFF); - else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == 0x80000000) + else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x80000000) newConstArray[i].setIConst(0x80000000); else newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); @@ -852,7 +861,7 @@ TIntermTyped* TIntermediate::foldConstructor(TIntermAggregate* aggrNode) // // Constant folding of a bracket (array-style) dereference or struct-like dot -// dereference. Can handle any thing except a multi-character swizzle, though +// dereference. Can handle anything except a multi-character swizzle, though // all swizzles may go to foldSwizzle(). // TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, const TSourceLoc& loc) @@ -861,14 +870,19 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons dereferencedType.getQualifier().storage = EvqConst; TIntermTyped* result = 0; int size = dereferencedType.computeNumComponents(); - + + // arrays, vectors, matrices, all use simple multiplicative math + // while structures need to add up heterogeneous members int start; - if (node->isStruct()) { + if (node->isArray() || ! node->isStruct()) + start = size * index; + else { + // it is a structure + assert(node->isStruct()); start = 0; for (int i = 0; i < index; ++i) start += (*node->getType().getStruct())[i].type->computeNumComponents(); - } else - start = size * index; + } result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc); diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index c852d3cb..2e094f02 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -85,6 +86,7 @@ TBuiltIns::TBuiltIns() dimMap[Esd3D] = 3; dimMap[EsdCube] = 3; dimMap[EsdBuffer] = 1; + dimMap[EsdSubpass] = 2; // potientially unused for now } TBuiltIns::~TBuiltIns() @@ -99,7 +101,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, int spv) +void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) { //============================================================================ // @@ -419,6 +421,214 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "\n"); } + // + // double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack + // + if (profile != EEsProfile && version >= 400) { + commonBuiltins.append( + + "double sqrt(double);" + "dvec2 sqrt(dvec2);" + "dvec3 sqrt(dvec3);" + "dvec4 sqrt(dvec4);" + + "double inversesqrt(double);" + "dvec2 inversesqrt(dvec2);" + "dvec3 inversesqrt(dvec3);" + "dvec4 inversesqrt(dvec4);" + + "double abs(double);" + "dvec2 abs(dvec2);" + "dvec3 abs(dvec3);" + "dvec4 abs(dvec4);" + + "double sign(double);" + "dvec2 sign(dvec2);" + "dvec3 sign(dvec3);" + "dvec4 sign(dvec4);" + + "double floor(double);" + "dvec2 floor(dvec2);" + "dvec3 floor(dvec3);" + "dvec4 floor(dvec4);" + + "double trunc(double);" + "dvec2 trunc(dvec2);" + "dvec3 trunc(dvec3);" + "dvec4 trunc(dvec4);" + + "double round(double);" + "dvec2 round(dvec2);" + "dvec3 round(dvec3);" + "dvec4 round(dvec4);" + + "double roundEven(double);" + "dvec2 roundEven(dvec2);" + "dvec3 roundEven(dvec3);" + "dvec4 roundEven(dvec4);" + + "double ceil(double);" + "dvec2 ceil(dvec2);" + "dvec3 ceil(dvec3);" + "dvec4 ceil(dvec4);" + + "double fract(double);" + "dvec2 fract(dvec2);" + "dvec3 fract(dvec3);" + "dvec4 fract(dvec4);" + + "double mod(double, double);" + "dvec2 mod(dvec2 , double);" + "dvec3 mod(dvec3 , double);" + "dvec4 mod(dvec4 , double);" + "dvec2 mod(dvec2 , dvec2);" + "dvec3 mod(dvec3 , dvec3);" + "dvec4 mod(dvec4 , dvec4);" + + "double modf(double, out double);" + "dvec2 modf(dvec2, out dvec2);" + "dvec3 modf(dvec3, out dvec3);" + "dvec4 modf(dvec4, out dvec4);" + + "double min(double, double);" + "dvec2 min(dvec2, double);" + "dvec3 min(dvec3, double);" + "dvec4 min(dvec4, double);" + "dvec2 min(dvec2, dvec2);" + "dvec3 min(dvec3, dvec3);" + "dvec4 min(dvec4, dvec4);" + + "double max(double, double);" + "dvec2 max(dvec2 , double);" + "dvec3 max(dvec3 , double);" + "dvec4 max(dvec4 , double);" + "dvec2 max(dvec2 , dvec2);" + "dvec3 max(dvec3 , dvec3);" + "dvec4 max(dvec4 , dvec4);" + + "double clamp(double, double, double);" + "dvec2 clamp(dvec2 , double, double);" + "dvec3 clamp(dvec3 , double, double);" + "dvec4 clamp(dvec4 , double, double);" + "dvec2 clamp(dvec2 , dvec2 , dvec2);" + "dvec3 clamp(dvec3 , dvec3 , dvec3);" + "dvec4 clamp(dvec4 , dvec4 , dvec4);" + + "double mix(double, double, double);" + "dvec2 mix(dvec2, dvec2, double);" + "dvec3 mix(dvec3, dvec3, double);" + "dvec4 mix(dvec4, dvec4, double);" + "dvec2 mix(dvec2, dvec2, dvec2);" + "dvec3 mix(dvec3, dvec3, dvec3);" + "dvec4 mix(dvec4, dvec4, dvec4);" + "double mix(double, double, bool);" + "dvec2 mix(dvec2, dvec2, bvec2);" + "dvec3 mix(dvec3, dvec3, bvec3);" + "dvec4 mix(dvec4, dvec4, bvec4);" + + "double step(double, double);" + "dvec2 step(dvec2 , dvec2);" + "dvec3 step(dvec3 , dvec3);" + "dvec4 step(dvec4 , dvec4);" + "dvec2 step(double, dvec2);" + "dvec3 step(double, dvec3);" + "dvec4 step(double, dvec4);" + + "double smoothstep(double, double, double);" + "dvec2 smoothstep(dvec2 , dvec2 , dvec2);" + "dvec3 smoothstep(dvec3 , dvec3 , dvec3);" + "dvec4 smoothstep(dvec4 , dvec4 , dvec4);" + "dvec2 smoothstep(double, double, dvec2);" + "dvec3 smoothstep(double, double, dvec3);" + "dvec4 smoothstep(double, double, dvec4);" + + "bool isnan(double);" + "bvec2 isnan(dvec2);" + "bvec3 isnan(dvec3);" + "bvec4 isnan(dvec4);" + + "bool isinf(double);" + "bvec2 isinf(dvec2);" + "bvec3 isinf(dvec3);" + "bvec4 isinf(dvec4);" + + "double length(double);" + "double length(dvec2);" + "double length(dvec3);" + "double length(dvec4);" + + "double distance(double, double);" + "double distance(dvec2 , dvec2);" + "double distance(dvec3 , dvec3);" + "double distance(dvec4 , dvec4);" + + "double dot(double, double);" + "double dot(dvec2 , dvec2);" + "double dot(dvec3 , dvec3);" + "double dot(dvec4 , dvec4);" + + "dvec3 cross(dvec3, dvec3);" + + "double normalize(double);" + "dvec2 normalize(dvec2);" + "dvec3 normalize(dvec3);" + "dvec4 normalize(dvec4);" + + "double faceforward(double, double, double);" + "dvec2 faceforward(dvec2, dvec2, dvec2);" + "dvec3 faceforward(dvec3, dvec3, dvec3);" + "dvec4 faceforward(dvec4, dvec4, dvec4);" + + "double reflect(double, double);" + "dvec2 reflect(dvec2 , dvec2 );" + "dvec3 reflect(dvec3 , dvec3 );" + "dvec4 reflect(dvec4 , dvec4 );" + + "double refract(double, double, double);" + "dvec2 refract(dvec2 , dvec2 , double);" + "dvec3 refract(dvec3 , dvec3 , double);" + "dvec4 refract(dvec4 , dvec4 , double);" + + "dmat2 matrixCompMult(dmat2, dmat2);" + "dmat3 matrixCompMult(dmat3, dmat3);" + "dmat4 matrixCompMult(dmat4, dmat4);" + "dmat2x3 matrixCompMult(dmat2x3, dmat2x3);" + "dmat2x4 matrixCompMult(dmat2x4, dmat2x4);" + "dmat3x2 matrixCompMult(dmat3x2, dmat3x2);" + "dmat3x4 matrixCompMult(dmat3x4, dmat3x4);" + "dmat4x2 matrixCompMult(dmat4x2, dmat4x2);" + "dmat4x3 matrixCompMult(dmat4x3, dmat4x3);" + + "dmat2 outerProduct(dvec2, dvec2);" + "dmat3 outerProduct(dvec3, dvec3);" + "dmat4 outerProduct(dvec4, dvec4);" + "dmat2x3 outerProduct(dvec3, dvec2);" + "dmat3x2 outerProduct(dvec2, dvec3);" + "dmat2x4 outerProduct(dvec4, dvec2);" + "dmat4x2 outerProduct(dvec2, dvec4);" + "dmat3x4 outerProduct(dvec4, dvec3);" + "dmat4x3 outerProduct(dvec3, dvec4);" + + "dmat2 transpose(dmat2);" + "dmat3 transpose(dmat3);" + "dmat4 transpose(dmat4);" + "dmat2x3 transpose(dmat3x2);" + "dmat3x2 transpose(dmat2x3);" + "dmat2x4 transpose(dmat4x2);" + "dmat4x2 transpose(dmat2x4);" + "dmat3x4 transpose(dmat4x3);" + "dmat4x3 transpose(dmat3x4);" + + "double determinant(dmat2);" + "double determinant(dmat3);" + "double determinant(dmat4);" + + "dmat2 inverse(dmat2);" + "dmat3 inverse(dmat3);" + "dmat4 inverse(dmat4);" + ); + } + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 430)) { commonBuiltins.append( @@ -872,17 +1082,19 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "\n"); } - // - // Atomic counter functions. - // - if ((profile != EEsProfile && version >= 300) || - (profile == EEsProfile && version >= 310)) { - commonBuiltins.append( - "uint atomicCounterIncrement(atomic_uint x);" - "uint atomicCounterDecrement(atomic_uint x);" - "uint atomicCounter(atomic_uint x);" + if (vulkan == 0) { + // + // Atomic counter functions. + // + if ((profile != EEsProfile && version >= 300) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "uint atomicCounterIncrement(atomic_uint x);" + "uint atomicCounterDecrement(atomic_uint x);" + "uint atomicCounter(atomic_uint x);" - "\n"); + "\n"); + } } // Bitfield @@ -1226,28 +1438,31 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) // // Depth range in window coordinates, p. 33 // - commonBuiltins.append( - "struct gl_DepthRangeParameters {" - ); - if (profile == EEsProfile) { + if (vulkan == 0) { commonBuiltins.append( - "highp float near;" // n - "highp float far;" // f - "highp float diff;" // f - n + "struct gl_DepthRangeParameters {" ); - } else { - commonBuiltins.append( - "float near;" // n - "float far;" // f - "float diff;" // f - n - ); - } - commonBuiltins.append( - "};" - "uniform gl_DepthRangeParameters gl_DepthRange;" - "\n"); + if (profile == EEsProfile) { + commonBuiltins.append( + "highp float near;" // n + "highp float far;" // f + "highp float diff;" // f - n + ); + } else { + commonBuiltins.append( + "float near;" // n + "float far;" // f + "float diff;" // f - n + ); + } - if (IncludeLegacy(version, profile, spv)) { + commonBuiltins.append( + "};" + "uniform gl_DepthRangeParameters gl_DepthRange;" + "\n"); + } + + if (vulkan == 0 && IncludeLegacy(version, profile, spv)) { // // Matrix state. p. 31, 32, 37, 39, 40. // @@ -1485,14 +1700,19 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "};" "\n"); } - if (version >= 130) + if (version >= 130 && vulkan == 0) stageBuiltins[EShLangVertex].append( "int gl_VertexID;" // needs qualifier fixed later ); - if (version >= 140) + if (version >= 140 && vulkan == 0) stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); + if (spv > 0 && version >= 140) + stageBuiltins[EShLangVertex].append( + "in int gl_VertexIndex;" + "in int gl_InstanceIndex;" + ); if (version >= 440) { stageBuiltins[EShLangVertex].append( "in int gl_BaseVertexARB;" @@ -1508,10 +1728,16 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "mediump float gl_PointSize;" // needs qualifier fixed later ); } else { - stageBuiltins[EShLangVertex].append( - "highp int gl_VertexID;" // needs qualifier fixed later - "highp int gl_InstanceID;" // needs qualifier fixed later - ); + if (vulkan == 0) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexID;" // needs qualifier fixed later + "in highp int gl_InstanceID;" // needs qualifier fixed later + ); + if (spv > 0) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexIndex;" + "in highp int gl_InstanceIndex;" + ); if (version < 310) stageBuiltins[EShLangVertex].append( "highp vec4 gl_Position;" // needs qualifier fixed later @@ -1863,7 +2089,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) stageBuiltins[EShLangFragment].append("\n"); if (version >= 130) - add2ndGenerationSamplingImaging(version, profile, spv); + add2ndGenerationSamplingImaging(version, profile, spv, vulkan); //printf("%s\n", commonBuiltins.c_str()); //printf("%s\n", stageBuiltins[EShLangFragment].c_str()); @@ -1873,7 +2099,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) // 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, int spv) +void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, int /*spv*/, int vulkan) { // // In this function proper, enumerate the types, then calls the next set of functions @@ -1900,9 +2126,13 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i 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 == EsdSubpass && vulkan == 0) + continue; + if (dim == EsdSubpass && (image || shadow || arrayed)) + continue; if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) continue; - if (dim != Esd2D && ms) + if (dim != Esd2D && dim != EsdSubpass && ms) continue; if ((dim == Esd3D || dim == EsdRect) && arrayed) continue; @@ -1930,7 +2160,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i // TSampler sampler; - if (image) { + if (dim == EsdSubpass) { + sampler.setSubpass(bTypes[bType], ms ? true : false); + } else if (image) { sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, shadow ? true : false, ms ? true : false); @@ -1942,6 +2174,11 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i TString typeName = sampler.getString(); + if (dim == EsdSubpass) { + addSubpassSampling(sampler, typeName, version, profile); + continue; + } + addQueryFunctions(sampler, typeName, version, profile); if (image) @@ -1956,6 +2193,14 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i } } } + + // + // sparseTexelsResidentARB() + // + + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n"); + } } // @@ -2069,6 +2314,15 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi commonBuiltins.append(prefixes[sampler.type]); commonBuiltins.append("vec4);\n"); + if (sampler.dim != Esd1D && sampler.dim != EsdBuffer && profile != EEsProfile && version >= 450) { + commonBuiltins.append("int sparseImageLoadARB(readonly volatile coherent "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", out "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4"); + commonBuiltins.append(");\n"); + } + if ( profile != EEsProfile || (profile == EEsProfile && version >= 310)) { if (sampler.type == EbtInt || sampler.type == EbtUint) { @@ -2117,13 +2371,30 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi } } +// +// Helper function for initialize(), +// when adding context-independent built-in functions. +// +// Add all the subpass access functions for the given type. +// +void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +{ + stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); + stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); + stageBuiltins[EShLangFragment].append("("); + stageBuiltins[EShLangFragment].append(typeName.c_str()); + if (sampler.ms) + stageBuiltins[EShLangFragment].append(", int"); + stageBuiltins[EShLangFragment].append(");\n"); +} + // // Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. // // Add all the texture lookup functions for the given type. // -void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) { // // texturing @@ -2196,97 +2467,148 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /* if (extraProj && (sampler.dim == Esd3D || sampler.shadow)) continue; - TString s; + for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - // return type - if (sampler.shadow) - s.append("float "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + if (lodClamp && (profile == EEsProfile || version < 450)) + continue; + if (lodClamp && (proj || lod || fetch)) + continue; - // name - if (fetch) - s.append("texel"); - else - s.append("texture"); - if (proj) - s.append("Proj"); - if (lod) - s.append("Lod"); - if (grad) - s.append("Grad"); - if (fetch) - s.append("Fetch"); - if (offset) - s.append("Offset"); - s.append("("); + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - // sampler type - s.append(typeName); + if (sparse && (profile == EEsProfile || version < 450)) + continue; + // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture + if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + continue; - // P coordinate - if (extraProj) - s.append(",vec4"); - else { - s.append(","); - TBasicType t = fetch ? EbtInt : EbtFloat; - if (totalDims == 1) - s.append(TType::getBasicString(t)); - else { - s.append(prefixes[t]); - s.append("vec"); - s.append(postfixes[totalDims]); + TString s; + + // return type + if (sparse) + s.append("int "); + else { + if (sampler.shadow) + s.append("float "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + } + + // name + if (sparse) { + if (fetch) + s.append("sparseTexel"); + else + s.append("sparseTexture"); + } else { + if (fetch) + s.append("texel"); + else + s.append("texture"); + } + if (proj) + s.append("Proj"); + if (lod) + s.append("Lod"); + if (grad) + s.append("Grad"); + if (fetch) + s.append("Fetch"); + if (offset) + s.append("Offset"); + if (lodClamp) + s.append("Clamp"); + if (lodClamp || sparse) + s.append("ARB"); + s.append("("); + + // sampler type + s.append(typeName); + + // P coordinate + if (extraProj) + s.append(",vec4"); + else { + s.append(","); + TBasicType t = fetch ? EbtInt : EbtFloat; + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } + } + + if (bias && compare) + continue; + + // non-optional lod argument (lod that's not driven by lod loop) or sample + if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || + (sampler.ms && fetch)) + s.append(",int"); + + // non-optional lod + if (lod) + s.append(",float"); + + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) + s.append(",float,float"); + else { + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + + // offset + if (offset) { + if (dimMap[sampler.dim] == 1) + s.append(",int"); + else { + s.append(",ivec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + + // non-optional compare + if (compare) + s.append(",float"); + + // lod clamp + if (lodClamp) + s.append(",float"); + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + if (sampler.shadow) + s.append("float "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + } + + // optional bias + if (bias) + s.append(",float"); + + s.append(");\n"); + + // Add to the per-language set of built-ins + + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); } } - - if (bias && compare) - continue; - - // non-optional lod argument (lod that's not driven by lod loop) or sample - if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || - (sampler.ms && fetch)) - s.append(",int"); - - // non-optional lod - if (lod) - s.append(",float"); - - // gradient arguments - if (grad) { - if (dimMap[sampler.dim] == 1) - s.append(",float,float"); - else { - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - } - } - - // offset - if (offset) { - if (dimMap[sampler.dim] == 1) - s.append(",int"); - else { - s.append(",ivec"); - s.append(postfixes[dimMap[sampler.dim]]); - } - } - - // optional bias or non-optional compare - if (bias || compare) - s.append(",float"); - - s.append(");\n"); - - // Add to the per-language set of built-ins - - if (bias) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); } } } @@ -2303,7 +2625,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /* // // Add all the texture gather functions for the given type. // -void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int version, EProfile /* profile */) +void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) { switch (sampler.dim) { case Esd2D: @@ -2330,51 +2652,71 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers if (offset > 0 && sampler.dim == EsdCube) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // return type - s.append(prefixes[sampler.type]); - s.append("vec4 "); + TString s; - // name - s.append("textureGather"); - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } + if (sparse) + s.append("ARB"); + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // refZ argument + if (sampler.shadow) + s.append(",float"); + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // comp argument + if (comp) + s.append(",int"); + + s.append(");\n"); + commonBuiltins.append(s); } - s.append("("); - - // sampler type argument - s.append(typeName); - - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); - - // refZ argument - if (sampler.shadow) - s.append(",float"); - - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } - - // comp argument - if (comp) - s.append(",int"); - - s.append(");\n"); - commonBuiltins.append(s); - //printf("%s", s.c_str()); } } } @@ -2386,7 +2728,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, int spv, EShLanguage language) +void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, int vulkan, EShLanguage language) { // // Initialize the context-dependent (resource-dependent) built-in strings for parsing. @@ -2549,7 +2891,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, spv)) { + if (vulkan == 0 && IncludeLegacy(version, profile, spv)) { // // OpenGL'uniform' state. Page numbers are in reference to version // 1.4 of the OpenGL specification. @@ -2833,7 +3175,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf // New built-in variables should use a generic (textually declarable) qualifier in // TStoraregQualifier and only call BuiltInVariable(). // -void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(name); if (symbol) { @@ -2853,7 +3195,7 @@ void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVar // // Safe to call even if name is not present. // -void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(name); if (! symbol) @@ -2870,7 +3212,7 @@ void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& s // // See comments above for other detail. // -void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) +static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(blockName); if (! symbol) @@ -2893,7 +3235,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, int spv, EShLanguage language, TSymbolTable& symbolTable) +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable) { // // Tag built-in variables and functions with additional qualifier and extension information @@ -2958,6 +3300,14 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); } + if (vulkan == 0) { + SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); + SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); + } + + BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); + BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); + // Fall through case EShLangTessControl: @@ -2973,8 +3323,6 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua SpecialQualifier("gl_Position", EvqPosition, EbvPosition, symbolTable); SpecialQualifier("gl_PointSize", EvqPointSize, EbvPointSize, symbolTable); SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable); - SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); - SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); @@ -3164,6 +3512,37 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_ARB_derivative_control); } + // E_GL_ARB_sparse_texture2 + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetsARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseImageLoadARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelsResident", 1, &E_GL_ARB_sparse_texture2); + } + + // E_GL_ARB_sparse_texture_clamp + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + } + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); if (profile == EEsProfile) { @@ -3347,6 +3726,9 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.relateToOperator("imageAtomicExchange", EOpImageAtomicExchange); symbolTable.relateToOperator("imageAtomicCompSwap", EOpImageAtomicCompSwap); + symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad); + symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS); + symbolTable.relateToOperator("textureSize", EOpTextureQuerySize); symbolTable.relateToOperator("textureQueryLod", EOpTextureQueryLod); symbolTable.relateToOperator("textureQueryLevels", EOpTextureQueryLevels); @@ -3369,6 +3751,11 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset); symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets); + symbolTable.relateToOperator("noise1", EOpNoise); + symbolTable.relateToOperator("noise2", EOpNoise); + symbolTable.relateToOperator("noise3", EOpNoise); + symbolTable.relateToOperator("noise4", EOpNoise); + if (spv == 0 && (IncludeLegacy(version, profile, spv) || (profile == EEsProfile && version == 100))) { symbolTable.relateToOperator("ftransform", EOpFtransform); @@ -3423,6 +3810,32 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.relateToOperator("shadow1DProjLod", EOpTextureProjLod); symbolTable.relateToOperator("shadow2DProjLod", EOpTextureProjLod); } + + if (profile != EEsProfile) + { + symbolTable.relateToOperator("sparseTextureARB", EOpSparseTexture); + symbolTable.relateToOperator("sparseTextureLodARB", EOpSparseTextureLod); + symbolTable.relateToOperator("sparseTextureOffsetARB", EOpSparseTextureOffset); + symbolTable.relateToOperator("sparseTexelFetchARB", EOpSparseTextureFetch); + symbolTable.relateToOperator("sparseTexelFetchOffsetARB", EOpSparseTextureFetchOffset); + symbolTable.relateToOperator("sparseTextureLodOffsetARB", EOpSparseTextureLodOffset); + symbolTable.relateToOperator("sparseTextureGradARB", EOpSparseTextureGrad); + symbolTable.relateToOperator("sparseTextureGradOffsetARB", EOpSparseTextureGradOffset); + symbolTable.relateToOperator("sparseTextureGatherARB", EOpSparseTextureGather); + symbolTable.relateToOperator("sparseTextureGatherOffsetARB", EOpSparseTextureGatherOffset); + symbolTable.relateToOperator("sparseTextureGatherOffsetsARB", EOpSparseTextureGatherOffsets); + symbolTable.relateToOperator("sparseImageLoadARB", EOpSparseImageLoad); + symbolTable.relateToOperator("sparseTexelsResidentARB", EOpSparseTexelsResident); + + symbolTable.relateToOperator("sparseTextureClampARB", EOpSparseTextureClamp); + symbolTable.relateToOperator("sparseTextureOffsetClampARB", EOpSparseTextureOffsetClamp); + symbolTable.relateToOperator("sparseTextureGradClampARB", EOpSparseTextureGradClamp); + symbolTable.relateToOperator("sparseTextureGradOffsetClampARB", EOpSparseTextureGradOffsetClamp); + symbolTable.relateToOperator("textureClampARB", EOpTextureClamp); + symbolTable.relateToOperator("textureOffsetClampARB", EOpTextureOffsetClamp); + symbolTable.relateToOperator("textureGradClampARB", EOpTextureGradClamp); + symbolTable.relateToOperator("textureGradOffsetClampARB", EOpTextureGradOffsetClamp); + } } switch(language) { @@ -3476,7 +3889,7 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua // 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, int spv, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) +void IdentifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) { if (profile != EEsProfile && version >= 430 && version < 440) { symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); diff --git a/glslang/MachineIndependent/Initialize.h b/glslang/MachineIndependent/Initialize.h index 156db7d7..ab21a2f9 100644 --- a/glslang/MachineIndependent/Initialize.h +++ b/glslang/MachineIndependent/Initialize.h @@ -59,13 +59,14 @@ public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) TBuiltIns(); virtual ~TBuiltIns(); - void initialize(int version, EProfile, int spv); - void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, EShLanguage); + void initialize(int version, EProfile, int spv, int vulkan); + void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage); const TString& getCommonString() const { return commonBuiltins; } const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } protected: - void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv); + void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv, int vulkan); + void addSubpassSampling(TSampler, TString& typeName, int version, EProfile profile); 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 +82,8 @@ protected: int dimMap[EsdNumDims]; }; -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&); -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&); +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); } // end namespace glslang diff --git a/glslang/MachineIndependent/IntermTraverse.cpp b/glslang/MachineIndependent/IntermTraverse.cpp index b0ac4c76..44743eaf 100644 --- a/glslang/MachineIndependent/IntermTraverse.cpp +++ b/glslang/MachineIndependent/IntermTraverse.cpp @@ -54,7 +54,7 @@ namespace glslang { // // -// Traversal functions for terminals are straighforward.... +// Traversal functions for terminals are straightforward.... // void TIntermMethod::traverse(TIntermTraverser*) { diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 2e9fa85c..bafcb917 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -59,6 +60,7 @@ namespace glslang { // // Returns the added node. // + TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, const TSourceLoc& loc) { TIntermSymbol* node = new TIntermSymbol(id, name, type); @@ -67,9 +69,17 @@ TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType return node; } +TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, const TConstUnionArray& constArray, const TSourceLoc& loc) +{ + TIntermSymbol* node = addSymbol(id, name, type, loc); + node->setConstArray(constArray); + + return node; +} + TIntermSymbol* TIntermediate::addSymbol(const TVariable& variable, const TSourceLoc& loc) { - return addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), loc); + return addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), variable.getConstArray(), loc); } // @@ -112,10 +122,9 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn node->updatePrecision(); // - // If they are both constants, they must be folded. + // If they are both (non-specialization) constants, they must be folded. // (Unless it's the sequence (comma) operator, but that's handled in addComma().) // - TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion(); TIntermConstantUnion *rightTempConstant = right->getAsConstantUnion(); if (leftTempConstant && rightTempConstant) { @@ -124,6 +133,13 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn return folded; } + // If either is a specialization constant, while the other is + // a constant (or specialization constant), the result is still + // a specialization constant. + if (( left->getType().getQualifier().isSpecConstant() && right->getType().getQualifier().isConstant()) || + (right->getType().getQualifier().isSpecConstant() && left->getType().getQualifier().isConstant())) + node->getWritableType().getQualifier().makeSpecConstant(); + return node; } @@ -261,9 +277,14 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo node->updatePrecision(); + // If it's a (non-specialization) constant, it must be folded. if (child->getAsConstantUnion()) return child->getAsConstantUnion()->fold(op, node->getType()); + // If it's a specialiation constant, the result is too. + if (child->getType().getQualifier().isSpecConstant()) + node->getWritableType().getQualifier().makeSpecConstant(); + return node; } @@ -379,35 +400,37 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const { // - // Does the base type allow operation? + // Does the base type even allow the operation? // switch (node->getBasicType()) { case EbtVoid: return 0; case EbtAtomicUint: case EbtSampler: - if (op != EOpFunctionCall) - return 0; - break; + // opaque types can be passed to functions + if (op == EOpFunction) + break; + // samplers can get assigned via a sampler constructor + // (well, not yet, but code in the rest of this function is ready for it) + if (node->getBasicType() == EbtSampler && op == EOpAssign && + node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler) + break; + + // otherwise, opaque types can't even be operated on, let alone converted + return 0; default: break; } - // // Otherwise, if types are identical, no problem - // if (type == node->getType()) return node; - // // If one's a structure, then no conversions. - // if (type.isStruct() || node->isStruct()) return 0; - // // If one's an array, then no conversions. - // if (type.isArray() || node->getType().isArray()) return 0; @@ -457,6 +480,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpMatrixTimesVector: case EOpMatrixTimesScalar: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpFunctionCall: case EOpReturn: case EOpAssign: @@ -1140,13 +1167,19 @@ bool TIntermBinary::promote() setType(left->getType()); type.getQualifier().clear(); - // Finish all array and structure operations. - if (left->isArray() || left->getBasicType() == EbtStruct) { + // Composite and opaque types don't having pending operator changes, e.g., + // array, structure, and samplers. Just establish final type and correctness. + if (left->isArray() || left->getBasicType() == EbtStruct || left->getBasicType() == EbtSampler) { switch (op) { case EOpEqual: case EOpNotEqual: - // Promote to conditional - setType(TType(EbtBool)); + if (left->getBasicType() == EbtSampler) { + // can't compare samplers + return false; + } else { + // Promote to conditional + setType(TType(EbtBool)); + } return true; diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 7d952c65..8cee3e4b 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -47,10 +48,10 @@ extern int yyparse(glslang::TParseContext*); namespace glslang { -TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, EShLanguage L, TInfoSink& is, +TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, int vulkan, EShLanguage L, TInfoSink& is, bool fc, EShMessages m) : intermediate(interm), symbolTable(symt), infoSink(is), language(L), - version(v), profile(p), spv(spv), forwardCompatible(fc), + version(v), profile(p), spv(spv), vulkan(vulkan), forwardCompatible(fc), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), postMainReturn(false), tokensBeforeEOF(false), limits(resources.limits), messages(m), currentScanner(nullptr), @@ -97,11 +98,11 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmColumnMajor; - globalUniformDefaults.layoutPacking = ElpShared; + globalUniformDefaults.layoutPacking = vulkan > 0 ? ElpStd140 : ElpShared; globalBufferDefaults.clear(); globalBufferDefaults.layoutMatrix = ElmColumnMajor; - globalBufferDefaults.layoutPacking = ElpShared; + globalBufferDefaults.layoutPacking = vulkan > 0 ? ElpStd430 : ElpShared; globalInputDefaults.clear(); globalOutputDefaults.clear(); @@ -463,7 +464,7 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb if (! variable) variable = new TVariable(string, TType(EbtVoid)); - if (variable->getType().getQualifier().storage == EvqConst) + if (variable->getType().getQualifier().isFrontEndConstant()) node = intermediate.addConstantUnion(variable->getConstArray(), variable->getType(), loc); else node = intermediate.addSymbol(*variable, loc); @@ -610,6 +611,16 @@ void TParseContext::makeEditable(TSymbol*& symbol) intermediate.addSymbolLinkageNode(linkage, *symbol); } +TVariable* TParseContext::getEditableVariable(const char* name) +{ + bool builtIn; + TSymbol* symbol = symbolTable.find(name, &builtIn); + if (builtIn) + makeEditable(symbol); + + return symbol->getAsVariable(); +} + // Return true if this is a geometry shader input array or tessellation control output array. bool TParseContext::isIoResizeArray(const TType& type) const { @@ -813,7 +824,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm } } - if (base->getType().getQualifier().storage == EvqConst) + if (base->getType().getQualifier().isFrontEndConstant()) result = intermediate.foldSwizzle(base, fields, loc); else { if (fields.num == 1) { @@ -1513,6 +1524,11 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; + case EOpEmitStreamVertex: + case EOpEndStreamPrimitive: + intermediate.setMultiStream(); + break; + default: break; } @@ -1530,7 +1546,7 @@ extern bool PureOperatorBuiltins; // void TParseContext::nonOpBuiltInCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermAggregate& callNode) { - // Further maintainance of this function is deprecated, because the "correct" + // Further maintenance of this function is deprecated, because the "correct" // future-oriented design is to not have to do string compares on function names. // If PureOperatorBuiltins == true, then all built-ins should be mapped @@ -1682,6 +1698,8 @@ TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const op = EOpConstructStruct; break; case EbtSampler: + if (type.getSampler().combined) + op = EOpConstructTextureSampler; break; case EbtFloat: if (type.isMatrix()) { @@ -2154,6 +2172,8 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T bool constructingMatrix = false; switch(op) { + case EOpConstructTextureSampler: + return constructorTextureSamplerError(loc, function); case EOpConstructMat2x2: case EOpConstructMat2x3: case EOpConstructMat2x4: @@ -2309,6 +2329,66 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T return false; } +// Verify all the correct semantics for constructing a combined texture/sampler. +// Return true if the semantics are incorrect. +bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const TFunction& function) +{ + TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change + const char* token = constructorName.c_str(); + + // exactly two arguments needed + if (function.getParamCount() != 2) { + error(loc, "sampler-constructor requires two arguments", token, ""); + return true; + } + + // For now, not allowing arrayed constructors, the rest of this function + // is set up to allow them, if this test is removed: + if (function.getType().isArray()) { + error(loc, "sampler-constructor cannot make an array of samplers", token, ""); + return true; + } + + // first argument + // * the constructor's first argument must be a texture type + // * the dimensionality (1D, 2D, 3D, Cube, Rect, Buffer, MS, and Array) + // of the texture type must match that of the constructed sampler type + // (that is, the suffixes of the type of the first argument and the + // type of the constructor will be spelled the same way) + if (function[0].type->getBasicType() != EbtSampler || + ! function[0].type->getSampler().isTexture() || + function[0].type->isArray()) { + error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); + return true; + } + // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() + TSampler texture = function.getType().getSampler(); + texture.combined = false; + texture.shadow = false; + if (texture != function[0].type->getSampler()) { + error(loc, "sampler-constructor first argument must match type and dimensionality of constructor type", token, ""); + return true; + } + + // second argument + // * the constructor's second argument must be a scalar of type + // *sampler* or *samplerShadow* + // * the presence or absence of depth comparison (Shadow) must match + // between the constructed sampler type and the type of the second argument + if ( function[1].type->getBasicType() != EbtSampler || + ! function[1].type->getSampler().isPureSampler() || + function[1].type->isArray()) { + error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); + return true; + } + if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) { + error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", token, ""); + return true; + } + + return false; +} + // Checks to see if a void variable has been declared and raise an error message for such a case // // returns true in case of an error @@ -2337,7 +2417,7 @@ void TParseContext::boolCheck(const TSourceLoc& loc, const TPublicType& pType) error(loc, "boolean expression expected", "", ""); } -void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier, TIntermTyped* /*initializer*/) { if (type.getQualifier().storage == EvqUniform) return; @@ -2345,6 +2425,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) { + // non-uniform sampler + // not yet: okay if it has an initializer + // if (! initializer) error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } } @@ -2360,6 +2443,19 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } +void TParseContext::transparentCheck(const TSourceLoc& loc, const TType& type, const TString& /*identifier*/) +{ + // double standard due to gl_NumSamples + if (parsingBuiltins) + return; + + // Vulkan doesn't allow transparent uniforms outside of blocks + if (vulkan == 0 || type.getQualifier().storage != EvqUniform) + return; + if (type.containsNonOpaque()) + vulkanRemoved(loc, "non-opaque uniforms outside a block"); +} + // // Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. // @@ -2605,6 +2701,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons MERGE_SINGLETON(restrict); MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); + MERGE_SINGLETON(specConstant); if (repeated) error(loc, "replicated qualifiers", "", ""); @@ -2707,22 +2804,35 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas // // Do size checking for an array type's size. // -void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, int& size) +void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) { - TIntermConstantUnion* constant = expr->getAsConstantUnion(); - if (constant == nullptr || (constant->getBasicType() != EbtInt && constant->getBasicType() != EbtUint)) { - error(loc, "array size must be a constant integer expression", "", ""); - size = 1; + bool isConst = false; + sizePair.size = 1; + sizePair.node = nullptr; + TIntermConstantUnion* constant = expr->getAsConstantUnion(); + if (constant) { + // handle true (non-specialization) constant + sizePair.size = constant->getConstArray()[0].getIConst(); + isConst = true; + } else { + // see if it's a specialization constant instead + if (expr->getQualifier().isSpecConstant()) { + isConst = true; + sizePair.node = expr; + TIntermSymbol* symbol = expr->getAsSymbolNode(); + if (symbol && symbol->getConstArray().size() > 0) + sizePair.size = symbol->getConstArray()[0].getIConst(); + } + } + + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, "array size must be a constant integer expression", "", ""); return; } - size = constant->getConstArray()[0].getIConst(); - - if (size <= 0) { + if (sizePair.size <= 0) { error(loc, "array size must be a positive integer", "", ""); - size = 1; - return; } } @@ -3390,6 +3500,12 @@ void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const error(loc, "can't use with samplers or structs containing samplers", op, ""); } +void TParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.containsSpecializationSize()) + error(loc, "can't use with types containing arrays sized with a specialization constant", op, ""); +} + void TParseContext::structTypeCheck(const TSourceLoc& /*loc*/, TPublicType& publicType) { const TTypeList& typeList = *publicType.userDef->getStruct(); @@ -3605,10 +3721,14 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } if (id == TQualifier::getLayoutPackingString(ElpPacked)) { + if (vulkan > 0) + vulkanRemoved(loc, "packed"); publicType.qualifier.layoutPacking = ElpPacked; return; } if (id == TQualifier::getLayoutPackingString(ElpShared)) { + if (vulkan > 0) + vulkanRemoved(loc, "shared"); publicType.qualifier.layoutPacking = ElpShared; return; } @@ -3636,6 +3756,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } } + if (id == "push_constant") { + requireVulkan(loc, "push_constant"); + publicType.qualifier.layoutPushConstant = true; + return; + } if (language == EShLangGeometry || language == EShLangTessEvaluation) { if (id == TQualifier::getGeometryString(ElgTriangles)) { publicType.shaderQualifiers.geometry = ElgTriangles; @@ -3874,6 +3999,27 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } } + if (id == "input_attachment_index") { + requireVulkan(loc, "input_attachment_index"); + if (value >= (int)TQualifier::layoutAttachmentEnd) + error(loc, "attachment index is too large", id.c_str(), ""); + else + publicType.qualifier.layoutAttachment = value; + return; + } + if (id == "constant_id") { + requireSpv(loc, "constant_id"); + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", id.c_str(), ""); + } else { + publicType.qualifier.layoutSpecConstantId = value; + publicType.qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", id.c_str(), ""); + } + return; + } + switch (language) { case EShLangVertex: break; @@ -3909,6 +4055,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi if (id == "stream") { requireProfile(loc, ~EEsProfile, "selecting output stream"); publicType.qualifier.layoutStream = value; + if (value > 0) + intermediate.setMultiStream(); return; } break; @@ -3924,17 +4072,33 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi break; case EShLangCompute: - if (id == "local_size_x") { - publicType.shaderQualifiers.localSize[0] = value; - return; - } - if (id == "local_size_y") { - publicType.shaderQualifiers.localSize[1] = value; - return; - } - if (id == "local_size_z") { - publicType.shaderQualifiers.localSize[2] = value; - return; + if (id.compare(0, 11, "local_size_") == 0) { + if (id == "local_size_x") { + publicType.shaderQualifiers.localSize[0] = value; + return; + } + if (id == "local_size_y") { + publicType.shaderQualifiers.localSize[1] = value; + return; + } + if (id == "local_size_z") { + publicType.shaderQualifiers.localSize[2] = value; + return; + } + if (spv > 0) { + if (id == "local_size_x_id") { + publicType.shaderQualifiers.localSizeSpecId[0] = value; + return; + } + if (id == "local_size_y_id") { + publicType.shaderQualifiers.localSizeSpecId[1] = value; + return; + } + if (id == "local_size_z_id") { + publicType.shaderQualifiers.localSizeSpecId[2] = value; + return; + } + } } break; @@ -3999,6 +4163,13 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutXfbStride = src.layoutXfbStride; if (src.hasXfbOffset()) dst.layoutXfbOffset = src.layoutXfbOffset; + if (src.hasAttachment()) + dst.layoutAttachment = src.layoutAttachment; + if (src.hasSpecConstantId()) + dst.layoutSpecConstantId = src.layoutSpecConstantId; + + if (src.layoutPushConstant) + dst.layoutPushConstant = true; } } @@ -4041,6 +4212,8 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb // "The align qualifier can only be used on blocks or block members..." if (qualifier.hasAlign()) error(loc, "cannot specify on a variable declaration", "align", ""); + if (qualifier.layoutPushConstant) + error(loc, "can only specify on a uniform block", "push_constant", ""); } break; default: @@ -4055,7 +4228,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) { const TQualifier& qualifier = type.getQualifier(); - // first, intra layout qualifier-only error checking + // first, intra-layout qualifier-only error checking layoutQualifierCheck(loc, qualifier); // now, error checking combining type and qualifier @@ -4087,7 +4260,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqBuffer: break; default: - error(loc, "can only appy to uniform, buffer, in, or out storage qualifiers", "location", ""); + error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); break; } @@ -4181,6 +4354,38 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) } } else if (type.isImage() && ! qualifier.writeonly) error(loc, "image variables not declared 'writeonly' must have a format layout qualifier", "", ""); + + if (qualifier.layoutPushConstant && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "push_constant", ""); + + // input attachment + if (type.isSubpass()) { + if (! qualifier.hasAttachment()) + error(loc, "requires an input_attachment_index layout qualifier", "subpass", ""); + } else { + if (qualifier.hasAttachment()) + error(loc, "can only be used with a subpass", "input_attachment_index", ""); + } + + // specialization-constant id + if (qualifier.hasSpecConstantId()) { + if (type.getQualifier().storage != EvqConst) + error(loc, "can only be applied to 'const'-qualified scalar", "constant_id", ""); + if (! type.isScalar()) + error(loc, "can only be applied to a scalar", "constant_id", ""); + switch (type.getBasicType()) + { + case EbtInt: + case EbtUint: + case EbtBool: + case EbtFloat: + case EbtDouble: + break; + default: + error(loc, "cannot be applied to this type", "constant_id", ""); + break; + } + } } // Do layout error checking that can be done within a layout qualifier proper, not needing to know @@ -4275,6 +4480,12 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "offset/align can only be used on a uniform or buffer", "layout", ""); } } + if (qualifier.layoutPushConstant) { + if (qualifier.storage != EvqUniform) + error(loc, "can only be used with a uniform", "push_constant", ""); + if (qualifier.hasSet()) + error(loc, "cannot be used with push_constant", "set", ""); + } } // For places that can't have shader-level layout qualifiers @@ -4297,6 +4508,8 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua for (int i = 0; i < 3; ++i) { if (shaderQualifiers.localSize[i] > 1) error(loc, message, "local_size", ""); + if (shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) + error(loc, message, "local_size id", ""); } if (shaderQualifiers.blendEquation) error(loc, message, "blend equation", ""); @@ -4490,8 +4703,9 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden else nonInitConstCheck(loc, identifier, type); - samplerCheck(loc, type, identifier); + samplerCheck(loc, type, identifier, initializer); atomicUintCheck(loc, type, identifier); + transparentCheck(loc, type, identifier); if (identifier != "gl_FragCoord" && (publicType.shaderQualifiers.originUpperLeft || publicType.shaderQualifiers.pixelCenterInteger)) error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", ""); @@ -4690,7 +4904,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp } if (qualifier == EvqConst || qualifier == EvqUniform) { - // Compile-time tagging of the variable with it's constant value... + // Compile-time tagging of the variable with its constant value... initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer); if (! initializer || ! initializer->getAsConstantUnion() || variable->getType() != initializer->getType()) { @@ -4703,6 +4917,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp variable->setConstArray(initializer->getAsConstantUnion()->getConstArray()); } else { // normal assigning of a value to a variable... + specializationCheck(loc, initializer->getType(), "initializer"); TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); TIntermNode* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); if (! initNode) @@ -4716,7 +4931,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp // // Reprocess any initializer-list { ... } parts of the initializer. -// Need to heirarchically assign correct types and implicit +// Need to hierarchically assign correct types and implicit // conversions. Will do this mimicking the same process used for // creating a constructor-style initializer, ensuring we get the // same form. @@ -4811,6 +5026,11 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* TIntermAggregate* aggrNode = node->getAsAggregate(); + // Combined texture-sampler constructors are completely semantic checked + // in constructorTextureSamplerError() + if (op == EOpConstructTextureSampler) + return intermediate.setAggregateOperator(aggrNode, op, type, loc); + TTypeList::const_iterator memberTypes; if (op == EOpConstructStruct) memberTypes = type.getStruct()->begin(); @@ -4997,7 +5217,7 @@ TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) { blockStageIoCheck(loc, currentBlockQualifier); - blockQualifierCheck(loc, currentBlockQualifier); + blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); if (arraySizes) { arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes, false, false); arrayDimCheck(loc, arraySizes, 0); @@ -5052,6 +5272,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con default: defaultQualification.clear(); break; } + // Special case for "push_constant uniform", which has a default of std430, + // contrary to normal uniform defaults, and can't have a default tracked for it. + if (currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking()) + currentBlockQualifier.layoutPacking = ElpStd430; + // fix and check for member layout qualifiers mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); @@ -5197,7 +5422,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q case EvqUniform: profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); profileRequires(loc, ENoProfile, 140, nullptr, "uniform block"); - if (currentBlockQualifier.layoutPacking == ElpStd430) + if (currentBlockQualifier.layoutPacking == ElpStd430 && ! currentBlockQualifier.layoutPushConstant) error(loc, "requires the 'buffer' storage qualifier", "std430", ""); break; case EvqBuffer: @@ -5227,7 +5452,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q } // Do all block-declaration checking regarding its qualifers. -void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier) +void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool instanceName) { // The 4.5 specification says: // @@ -5254,6 +5479,11 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& error(loc, "cannot use sample qualifier on an interface block", "sample", ""); if (qualifier.invariant) error(loc, "cannot use invariant qualifier on an interface block", "invariant", ""); + if (qualifier.layoutPushConstant) { + intermediate.addPushConstantCount(); + if (! instanceName) + error(loc, "requires an instance name", "push_constant", ""); + } } // @@ -5541,16 +5771,22 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); // Fix the existing constant gl_WorkGroupSize with this new information. - bool builtIn; - TSymbol* symbol = symbolTable.find("gl_WorkGroupSize", &builtIn); - if (builtIn) - makeEditable(symbol); - TVariable* workGroupSize = symbol->getAsVariable(); + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); } } else error(loc, "can only apply to 'in'", "local_size", ""); } + if (publicType.shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setLocalSizeSpecId(i, publicType.shaderQualifiers.localSizeSpecId[i])) + error(loc, "cannot change previously set size", "local_size", ""); + } else + error(loc, "can only apply to 'in'", "local_size id", ""); + // Set the workgroup built-in variable as a specialization constant + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableType().getQualifier().specConstant = true; + } } if (publicType.shaderQualifiers.earlyFragmentTests) { if (publicType.qualifier.storage == EvqVaryingIn) @@ -5614,6 +5850,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot declare a default, use a full declaration", "location/component/index", ""); if (qualifier.hasXfbOffset()) error(loc, "cannot declare a default, use a full declaration", "xfb_offset", ""); + if (qualifier.layoutPushConstant) + error(loc, "cannot declare a default, can only be used on a block", "push_constant", ""); + if (qualifier.hasSpecConstantId()) + error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); } // diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 19a8a240..ac1932d5 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, int spv, EShLanguage, TInfoSink&, + TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, int spv, int vulkan, EShLanguage, TInfoSink&, bool forwardCompatible = false, EShMessages messages = EShMsgDefault); virtual ~TParseContext(); @@ -98,6 +98,7 @@ public: void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); void makeEditable(TSymbol*&); + TVariable* getEditableVariable(const char* name); bool isIoResizeArray(const TType&) const; void fixIoArraySize(const TSourceLoc&, TType&); void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier); @@ -132,7 +133,8 @@ public: void integerCheck(const TIntermTyped* node, const char* token); void globalCheck(const TSourceLoc&, const char* token); bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); - void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, int& size); + bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); + void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); bool arrayQualifierError(const TSourceLoc&, const TQualifier&); bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); @@ -145,8 +147,9 @@ public: bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void boolCheck(const TSourceLoc&, const TIntermTyped*); void boolCheck(const TSourceLoc&, const TPublicType&); - void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier); + void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); + void transparentCheck(const TSourceLoc&, const TType&, const TString& identifier); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -165,6 +168,7 @@ public: void nestedStructCheck(const TSourceLoc&); void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op); void opaqueCheck(const TSourceLoc&, const TType&, const char* op); + void specializationCheck(const TSourceLoc&, const TType&, const char* op); void structTypeCheck(const TSourceLoc&, TPublicType&); void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop); void arrayLimitCheck(const TSourceLoc&, const TString&, int size); @@ -193,7 +197,7 @@ public: TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); void blockStageIoCheck(const TSourceLoc&, const TQualifier&); - void blockQualifierCheck(const TSourceLoc&, const TQualifier&); + void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockXfbOffsets(TQualifier&, TTypeList&); void fixBlockUniformOffsets(TQualifier&, TTypeList&); @@ -244,6 +248,10 @@ public: void updateExtensionBehavior(int line, const char* const extension, const char* behavior); void fullIntegerCheck(const TSourceLoc&, const char* op); void doubleCheck(const TSourceLoc&, const char* op); + void spvRemoved(const TSourceLoc&, const char* op); + void vulkanRemoved(const TSourceLoc&, const char* op); + void requireVulkan(const TSourceLoc&, const char* op); + void requireSpv(const TSourceLoc&, const char* op); void setVersionCallback(const std::function& func) { versionCallback = func; } void setPragmaCallback(const std::function&)>& func) { pragmaCallback = func; } @@ -281,6 +289,7 @@ public: 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 + int vulkan; // Vulkan version; 0 means not vulkan bool forwardCompatible; // true if errors are to be given for use of deprecated features // Current state of parsing diff --git a/glslang/MachineIndependent/PoolAlloc.cpp b/glslang/MachineIndependent/PoolAlloc.cpp index 12f45cb8..a41cadf1 100644 --- a/glslang/MachineIndependent/PoolAlloc.cpp +++ b/glslang/MachineIndependent/PoolAlloc.cpp @@ -190,7 +190,7 @@ void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) co #endif { #ifdef GUARD_BLOCKS - for (int x = 0; x < guardBlockSize; x++) { + for (size_t x = 0; x < guardBlockSize; x++) { if (blockMem[x] != val) { const int maxSize = 80; char assertMsg[maxSize]; diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 25e55d90..098f0bd0 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -53,8 +53,11 @@ #include "preprocessor/PpContext.h" #include "preprocessor/PpTokens.h" -namespace glslang { +// Required to avoid missing prototype warnings for some compilers +int yylex(YYSTYPE*, glslang::TParseContext&); +namespace glslang { + // read past any white space void TInputScanner::consumeWhiteSpace(bool& foundNonSpaceTab) { @@ -309,7 +312,7 @@ struct str_hash unsigned long hash = 5381; int c; - while ((c = *str++)) + while ((c = *str++) != 0) hash = ((hash << 5) + hash) + c; return hash; @@ -494,6 +497,50 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external + (*KeywordMap)["sampler"] = SAMPLER; + (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW; + + (*KeywordMap)["texture2D"] = TEXTURE2D; + (*KeywordMap)["textureCube"] = TEXTURECUBE; + (*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY; + (*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY; + (*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY; + (*KeywordMap)["itexture1DArray"] = ITEXTURE1DARRAY; + (*KeywordMap)["utexture1D"] = UTEXTURE1D; + (*KeywordMap)["itexture1D"] = ITEXTURE1D; + (*KeywordMap)["utexture1DArray"] = UTEXTURE1DARRAY; + (*KeywordMap)["textureBuffer"] = TEXTUREBUFFER; + (*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY; + (*KeywordMap)["itexture2D"] = ITEXTURE2D; + (*KeywordMap)["itexture3D"] = ITEXTURE3D; + (*KeywordMap)["itextureCube"] = ITEXTURECUBE; + (*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY; + (*KeywordMap)["utexture2D"] = UTEXTURE2D; + (*KeywordMap)["utexture3D"] = UTEXTURE3D; + (*KeywordMap)["utextureCube"] = UTEXTURECUBE; + (*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY; + (*KeywordMap)["itexture2DRect"] = ITEXTURE2DRECT; + (*KeywordMap)["utexture2DRect"] = UTEXTURE2DRECT; + (*KeywordMap)["itextureBuffer"] = ITEXTUREBUFFER; + (*KeywordMap)["utextureBuffer"] = UTEXTUREBUFFER; + (*KeywordMap)["texture2DMS"] = TEXTURE2DMS; + (*KeywordMap)["itexture2DMS"] = ITEXTURE2DMS; + (*KeywordMap)["utexture2DMS"] = UTEXTURE2DMS; + (*KeywordMap)["texture2DMSArray"] = TEXTURE2DMSARRAY; + (*KeywordMap)["itexture2DMSArray"] = ITEXTURE2DMSARRAY; + (*KeywordMap)["utexture2DMSArray"] = UTEXTURE2DMSARRAY; + (*KeywordMap)["texture1D"] = TEXTURE1D; + (*KeywordMap)["texture3D"] = TEXTURE3D; + (*KeywordMap)["texture2DRect"] = TEXTURE2DRECT; + (*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY; + + (*KeywordMap)["subpassInput"] = SUBPASSINPUT; + (*KeywordMap)["subpassInputMS"] = SUBPASSINPUTMS; + (*KeywordMap)["isubpassInput"] = ISUBPASSINPUT; + (*KeywordMap)["isubpassInputMS"] = ISUBPASSINPUTMS; + (*KeywordMap)["usubpassInput"] = USUBPASSINPUT; + (*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS; + (*KeywordMap)["noperspective"] = NOPERSPECTIVE; (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; @@ -987,6 +1034,57 @@ int TScanContext::tokenizeIdentifier() return keyword; return identifierOrType(); + case TEXTURE2D: + case TEXTURECUBE: + case TEXTURECUBEARRAY: + case ITEXTURECUBEARRAY: + case UTEXTURECUBEARRAY: + case ITEXTURE1DARRAY: + case UTEXTURE1D: + case ITEXTURE1D: + case UTEXTURE1DARRAY: + case TEXTUREBUFFER: + case TEXTURE2DARRAY: + case ITEXTURE2D: + case ITEXTURE3D: + case ITEXTURECUBE: + case ITEXTURE2DARRAY: + case UTEXTURE2D: + case UTEXTURE3D: + case UTEXTURECUBE: + case UTEXTURE2DARRAY: + case ITEXTURE2DRECT: + case UTEXTURE2DRECT: + case ITEXTUREBUFFER: + case UTEXTUREBUFFER: + case TEXTURE2DMS: + case ITEXTURE2DMS: + case UTEXTURE2DMS: + case TEXTURE2DMSARRAY: + case ITEXTURE2DMSARRAY: + case UTEXTURE2DMSARRAY: + case TEXTURE1D: + case TEXTURE3D: + case TEXTURE2DRECT: + case TEXTURE1DARRAY: + case SAMPLER: + case SAMPLERSHADOW: + if (parseContext.spv > 0) + return keyword; + else + return identifierOrType(); + + case SUBPASSINPUT: + case SUBPASSINPUTMS: + case ISUBPASSINPUT: + case ISUBPASSINPUTMS: + case USUBPASSINPUT: + case USUBPASSINPUTMS: + if (parseContext.spv > 0) + return keyword; + else + return identifierOrType(); + case NOPERSPECTIVE: return es30ReservedFromGLSL(130); diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index 3a07691a..1f835539 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +//Copyright (C) 2013-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -111,7 +112,7 @@ enum EPrecisionClass { // A process-global symbol table per version per profile for built-ins common // to multiple stages (languages), and a process-global symbol table per version // per profile per stage for built-ins unique to each stage. They will be sparsely -// populated, so they will only only be generated as needed. +// populated, so they will only be generated as needed. // // Each has a different set of built-ins, and we want to preserve that from // compile to compile. @@ -124,12 +125,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, int spv, EShLanguage language, TInfoSink& infoSink, +bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, TSymbolTable& symbolTable) { TIntermediate intermediate(language, version, profile); - TParseContext parseContext(symbolTable, intermediate, true, version, profile, spv, language, infoSink); + TParseContext parseContext(symbolTable, intermediate, true, version, profile, spv, vulkan, language, infoSink); TPpContext ppContext(parseContext, TShader::ForbidInclude()); TScanContext scanContext(parseContext); parseContext.setScanContext(&scanContext); @@ -168,11 +169,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, int spv, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) +void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); - InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, language, infoSink, *symbolTables[language]); - IdentifyBuiltIns(version, profile, spv, language, *symbolTables[language]); + InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, vulkan, language, infoSink, *symbolTables[language]); + IdentifyBuiltIns(version, profile, spv, vulkan, language, *symbolTables[language]); if (profile == EEsProfile && version >= 300) (*symbolTables[language]).setNoBuiltInRedeclarations(); if (version == 110) @@ -183,49 +184,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, int spv) +bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv, int vulkan) { TBuiltIns builtIns; - builtIns.initialize(version, profile, spv); + builtIns.initialize(version, profile, spv, vulkan); // do the common tables - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangVertex, infoSink, *commonTable[EPcGeneral]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangVertex, infoSink, *commonTable[EPcGeneral]); if (profile == EEsProfile) - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangFragment, infoSink, *commonTable[EPcFragment]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangFragment, infoSink, *commonTable[EPcFragment]); // do the per-stage tables // always have vertex and fragment - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangVertex, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangFragment, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangVertex, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangFragment, infoSink, commonTable, symbolTables); // check for tessellation if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) { - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessControl, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessEvaluation, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessControl, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessEvaluation, infoSink, commonTable, symbolTables); } // check for geometry if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangGeometry, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangGeometry, infoSink, commonTable, symbolTables); // check for compute if ((profile != EEsProfile && version >= 430) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangCompute, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangCompute, infoSink, commonTable, symbolTables); return true; } -bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, EShLanguage language) +bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, int vulkan, EShLanguage language) { TBuiltIns builtIns; - builtIns.initialize(*resources, version, profile, spv, language); - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, language, infoSink, symbolTable); - IdentifyBuiltIns(version, profile, spv, language, symbolTable, *resources); + builtIns.initialize(*resources, version, profile, spv, vulkan, language); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, language, infoSink, symbolTable); + IdentifyBuiltIns(version, profile, spv, vulkan, language, symbolTable, *resources); return true; } @@ -242,7 +243,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, int spv) +void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan) { TInfoSink infoSink; @@ -272,7 +273,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, int spv) stageTables[stage] = new TSymbolTable; // Generate the local symbol tables using the new pool - InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv); + InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv, vulkan); // Switch to the process-global pool SetThreadPoolAllocator(*PerProcessGPA); @@ -306,7 +307,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, int spv) glslang::ReleaseGlobalLock(); } -bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, int& version, EProfile& profile) +bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, int& version, EProfile& profile, int spv) { const int FirstProfileVersion = 150; bool correct = true; @@ -397,7 +398,24 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo infoSink.info.message(EPrefixError, "#version: statement must appear first in es-profile shader; before comments or newlines"); } - // A metacheck on the condition of the compiler itself... + // Check for SPIR-V compatibility + if (spv > 0) { + if (profile == EEsProfile) { + if (version < 310) { + correct = false; + infoSink.info.message(EPrefixError, "#version: ES shaders for SPIR-V require version 310 or higher"); + version = 310; + } + } else { + if (version < 140) { + correct = false; + infoSink.info.message(EPrefixError, "#version: Desktop shaders for SPIR-V require version 140 or higher"); + version = 140; + } + } + } + + // A meta check on the condition of the compiler itself... switch (version) { // ES versions @@ -454,7 +472,7 @@ bool ProcessDeferred( const char* customPreamble, const EShOptimizationLevel optLevel, const TBuiltInResource* resources, - int defaultVersion, // use 100 for ES environment, 110 for desktop + int defaultVersion, // use 100 for ES environment, 110 for desktop; this is the GLSL version, not SPIR-V or Vulkan EProfile defaultProfile, // set version/profile to defaultVersion/defaultProfile regardless of the #version // directive in the source code @@ -532,7 +550,9 @@ bool ProcessDeferred( version = defaultVersion; profile = defaultProfile; } - bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, version, profile); + + int spv = (messages & EShMsgSpvRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters + bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, version, profile, spv); bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst)); bool warnVersionNotFirst = false; if (! versionWillBeError && versionNotFirstToken) { @@ -542,11 +562,13 @@ bool ProcessDeferred( versionWillBeError = true; } - int spv = (messages & EShMsgSpvRules) ? 100 : 0; + int vulkan = (messages & EShMsgVulkanRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters intermediate.setVersion(version); intermediate.setProfile(profile); intermediate.setSpv(spv); - SetupBuiltinSymbolTable(version, profile, spv); + if (vulkan) + intermediate.setOriginUpperLeft(); + SetupBuiltinSymbolTable(version, profile, spv, vulkan); TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapProfileToIndex(profile)] @@ -560,13 +582,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, spv, compiler->getLanguage()); + AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, vulkan, compiler->getLanguage()); // // Now we can process the full shader under proper symbols and rules. // - TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, vulkan, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); glslang::TScanContext scanContext(parseContext); TPpContext ppContext(parseContext, includer); parseContext.setScanContext(&scanContext); diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 092fe205..9794a5d2 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -87,6 +87,7 @@ void TType::buildMangledName(TString& mangledName) case EsdCube: mangledName += "C"; break; case EsdRect: mangledName += "R2"; break; case EsdBuffer: mangledName += "B"; break; + case EsdSubpass: mangledName += "P"; break; default: break; // some compilers want this } if (sampler.ms) @@ -115,7 +116,13 @@ void TType::buildMangledName(TString& mangledName) const int maxSize = 11; char buf[maxSize]; for (int i = 0; i < arraySizes->getNumDims(); ++i) { - snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); + if (arraySizes->getDimNode(i)) { + if (arraySizes->getDimNode(i)->getAsSymbolNode()) + snprintf(buf, maxSize, "s%d", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); + else + snprintf(buf, maxSize, "s%p", arraySizes->getDimNode(i)); + } else + snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); mangledName += '['; mangledName += buf; mangledName += ']'; diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 89534988..676f4fd6 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -173,6 +173,9 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; + extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; // extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members // #line and #include @@ -274,6 +277,9 @@ const char* TParseContext::getPreamble() "#define GL_ARB_derivative_control 1\n" "#define GL_ARB_shader_texture_image_samples 1\n" "#define GL_ARB_viewport_array 1\n" + "#define GL_ARB_gl_spirv 1\n" + "#define GL_ARB_sparse_texture2 1\n" + "#define GL_ARB_sparse_texture_clamp 1\n" "#define GL_GOOGLE_cpp_style_line_directive 1\n" "#define GL_GOOGLE_include_directive 1\n" @@ -560,6 +566,9 @@ void TParseContext::updateExtensionBehavior(int line, const char* extension, con updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + // SPIR-V + else if (strcmp(extension, "GL_ARB_gl_spirv") == 0) + spv = 100; } void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) @@ -602,18 +611,14 @@ void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBeh } } -// // Call for any operation needing full GLSL integer data-type support. -// void TParseContext::fullIntegerCheck(const TSourceLoc& loc, const char* op) { profileRequires(loc, ENoProfile, 130, nullptr, op); profileRequires(loc, EEsProfile, 300, nullptr, op); } -// // Call for any operation needing GLSL double data-type support. -// void TParseContext::doubleCheck(const TSourceLoc& loc, const char* op) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); @@ -621,4 +626,32 @@ void TParseContext::doubleCheck(const TSourceLoc& loc, const char* op) profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); } +// Call for any operation removed because SPIR-V is in use. +void TParseContext::spvRemoved(const TSourceLoc& loc, const char* op) +{ + if (spv > 0) + error(loc, "not allowed when generating SPIR-V", op, ""); +} + +// Call for any operation removed because Vulkan SPIR-V is being generated. +void TParseContext::vulkanRemoved(const TSourceLoc& loc, const char* op) +{ + if (vulkan > 0) + error(loc, "not allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires Vulkan. +void TParseContext::requireVulkan(const TSourceLoc& loc, const char* op) +{ + if (vulkan == 0) + error(loc, "only allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires SPIR-V. +void TParseContext::requireSpv(const TSourceLoc& loc, const char* op) +{ + if (spv == 0) + error(loc, "only allowed when generating SPIR-V", op, ""); +} + } // end namespace glslang diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index a30ea7a6..d022d876 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -111,6 +111,9 @@ const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_pa const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gl_spirv = "GL_ARB_gl_spirv"; +const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; +const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; //const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members // #line and #include diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 73805941..847bcc9a 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -148,6 +148,24 @@ extern int yylex(YYSTYPE*, TParseContext&); %token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token SAMPLEREXTERNALOES +// pure sampler +%token SAMPLER SAMPLERSHADOW + +// texture without sampler +%token TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE +%token TEXTURE1DARRAY TEXTURE2DARRAY +%token ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE +%token ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D +%token UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY +%token TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT +%token TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER +%token TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY +%token TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS +%token TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY + +// input attachments +%token SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS + %token IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D %token UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D %token IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT @@ -503,6 +521,7 @@ equality_expression | equality_expression EQ_OP relational_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); parseContext.opaqueCheck($2.loc, $1->getType(), "=="); + parseContext.specializationCheck($2.loc, $1->getType(), "=="); $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3); if ($$ == 0) $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); @@ -510,6 +529,7 @@ equality_expression | equality_expression NE_OP relational_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); parseContext.opaqueCheck($2.loc, $1->getType(), "!="); + parseContext.specializationCheck($2.loc, $1->getType(), "!="); $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3); if ($$ == 0) $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); @@ -597,6 +617,7 @@ assignment_expression | unary_expression assignment_operator assignment_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment"); parseContext.opaqueCheck($2.loc, $1->getType(), "="); + parseContext.specializationCheck($2.loc, $1->getType(), "="); parseContext.lValueErrorCheck($2.loc, "assign", $1); parseContext.rValueErrorCheck($2.loc, "assign", $3); $$ = parseContext.intermediate.addAssign($2.op, $1, $3, $2.loc); @@ -1201,11 +1222,13 @@ storage_qualifier $$.qualifier.writeonly = true; } | SUBROUTINE { + parseContext.spvRemoved($1.loc, "subroutine"); parseContext.globalCheck($1.loc, "subroutine"); $$.init($1.loc); $$.qualifier.storage = EvqUniform; } | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN { + parseContext.spvRemoved($1.loc, "subroutine"); parseContext.globalCheck($1.loc, "subroutine"); $$.init($1.loc); $$.qualifier.storage = EvqUniform; @@ -1242,11 +1265,11 @@ array_specifier $$.arraySizes = new TArraySizes; $$.arraySizes->addInnerSize(); } - | LEFT_BRACKET constant_expression RIGHT_BRACKET { + | LEFT_BRACKET conditional_expression RIGHT_BRACKET { $$.loc = $1.loc; $$.arraySizes = new TArraySizes; - int size; + TArraySize size; parseContext.arraySizeCheck($2->getLoc(), $2, size); $$.arraySizes->addInnerSize(size); } @@ -1254,10 +1277,10 @@ array_specifier $$ = $1; $$.arraySizes->addInnerSize(); } - | array_specifier LEFT_BRACKET constant_expression RIGHT_BRACKET { + | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET { $$ = $1; - int size; + TArraySize size; parseContext.arraySizeCheck($3->getLoc(), $3, size); $$.arraySizes->addInnerSize(size); } @@ -1504,6 +1527,7 @@ type_specifier_nonarray $$.setMatrix(4, 4); } | ATOMIC_UINT { + parseContext.vulkanRemoved($1.loc, "atomic counter types"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtAtomicUint; } @@ -1707,6 +1731,181 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtUint, Esd2D, true, false, true); } + | SAMPLER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(false); + } + | SAMPLERSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(true); + } + | TEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D); + } + | TEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D); + } + | TEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd3D); + } + | TEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube); + } + | TEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D, true); + } + | TEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true); + } + | TEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube, true); + } + | ITEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D); + } + | ITEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D); + } + | ITEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd3D); + } + | ITEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube); + } + | ITEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D, true); + } + | ITEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true); + } + | ITEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube, true); + } + | UTEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D); + } + | UTEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D); + } + | UTEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd3D); + } + | UTEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube); + } + | UTEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D, true); + } + | UTEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true); + } + | UTEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube, true); + } + | TEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdRect); + } + | ITEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdRect); + } + | UTEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdRect); + } + | TEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdBuffer); + } + | ITEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdBuffer); + } + | UTEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdBuffer); + } + | TEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true); + } + | ITEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, false, false, true); + } + | UTEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, false, false, true); + } + | TEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true); + } + | ITEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true, false, true); + } + | UTEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true, false, true); + } | IMAGE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1878,6 +2077,42 @@ type_specifier_nonarray $$.sampler.set(EbtFloat, Esd2D); $$.sampler.external = true; } + | SUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat); + } + | SUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat, true); + } + | ISUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt); + } + | ISUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt, true); + } + | USUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint); + } + | USUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint, true); + } | struct_specifier { $$ = $1; $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp new file mode 100644 index 00000000..d435aa80 --- /dev/null +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -0,0 +1,7790 @@ +/* A Bison parser, made by GNU Bison 2.7. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.7" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* Copy the first part of user declarations. */ +/* Line 371 of yacc.c */ +#line 41 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + + +/* Based on: +ANSI C Yacc grammar + +In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a +matching Lex specification) for the April 30, 1985 draft version of the +ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that +original, as mentioned in the answer to question 17.25 of the comp.lang.c +FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. + +I intend to keep this version as close to the current C Standard grammar as +possible; please let me know if you discover discrepancies. + +Jutta Degener, 1995 +*/ + +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "../Public/ShaderLang.h" + +using namespace glslang; + + +/* Line 371 of yacc.c */ +#line 93 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" + +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "glslang_tab.cpp.h". */ +#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + BREAK = 266, + CONTINUE = 267, + DO = 268, + ELSE = 269, + FOR = 270, + IF = 271, + DISCARD = 272, + RETURN = 273, + SWITCH = 274, + CASE = 275, + DEFAULT = 276, + SUBROUTINE = 277, + BVEC2 = 278, + BVEC3 = 279, + BVEC4 = 280, + IVEC2 = 281, + IVEC3 = 282, + IVEC4 = 283, + UVEC2 = 284, + UVEC3 = 285, + UVEC4 = 286, + VEC2 = 287, + VEC3 = 288, + VEC4 = 289, + MAT2 = 290, + MAT3 = 291, + MAT4 = 292, + CENTROID = 293, + IN = 294, + OUT = 295, + INOUT = 296, + UNIFORM = 297, + PATCH = 298, + SAMPLE = 299, + BUFFER = 300, + SHARED = 301, + COHERENT = 302, + VOLATILE = 303, + RESTRICT = 304, + READONLY = 305, + WRITEONLY = 306, + DVEC2 = 307, + DVEC3 = 308, + DVEC4 = 309, + DMAT2 = 310, + DMAT3 = 311, + DMAT4 = 312, + NOPERSPECTIVE = 313, + FLAT = 314, + SMOOTH = 315, + LAYOUT = 316, + MAT2X2 = 317, + MAT2X3 = 318, + MAT2X4 = 319, + MAT3X2 = 320, + MAT3X3 = 321, + MAT3X4 = 322, + MAT4X2 = 323, + MAT4X3 = 324, + MAT4X4 = 325, + DMAT2X2 = 326, + DMAT2X3 = 327, + DMAT2X4 = 328, + DMAT3X2 = 329, + DMAT3X3 = 330, + DMAT3X4 = 331, + DMAT4X2 = 332, + DMAT4X3 = 333, + DMAT4X4 = 334, + ATOMIC_UINT = 335, + SAMPLER1D = 336, + SAMPLER2D = 337, + SAMPLER3D = 338, + SAMPLERCUBE = 339, + SAMPLER1DSHADOW = 340, + SAMPLER2DSHADOW = 341, + SAMPLERCUBESHADOW = 342, + SAMPLER1DARRAY = 343, + SAMPLER2DARRAY = 344, + SAMPLER1DARRAYSHADOW = 345, + SAMPLER2DARRAYSHADOW = 346, + ISAMPLER1D = 347, + ISAMPLER2D = 348, + ISAMPLER3D = 349, + ISAMPLERCUBE = 350, + ISAMPLER1DARRAY = 351, + ISAMPLER2DARRAY = 352, + USAMPLER1D = 353, + USAMPLER2D = 354, + USAMPLER3D = 355, + USAMPLERCUBE = 356, + USAMPLER1DARRAY = 357, + USAMPLER2DARRAY = 358, + SAMPLER2DRECT = 359, + SAMPLER2DRECTSHADOW = 360, + ISAMPLER2DRECT = 361, + USAMPLER2DRECT = 362, + SAMPLERBUFFER = 363, + ISAMPLERBUFFER = 364, + USAMPLERBUFFER = 365, + SAMPLERCUBEARRAY = 366, + SAMPLERCUBEARRAYSHADOW = 367, + ISAMPLERCUBEARRAY = 368, + USAMPLERCUBEARRAY = 369, + SAMPLER2DMS = 370, + ISAMPLER2DMS = 371, + USAMPLER2DMS = 372, + SAMPLER2DMSARRAY = 373, + ISAMPLER2DMSARRAY = 374, + USAMPLER2DMSARRAY = 375, + SAMPLEREXTERNALOES = 376, + SAMPLER = 377, + SAMPLERSHADOW = 378, + TEXTURE1D = 379, + TEXTURE2D = 380, + TEXTURE3D = 381, + TEXTURECUBE = 382, + TEXTURE1DARRAY = 383, + TEXTURE2DARRAY = 384, + ITEXTURE1D = 385, + ITEXTURE2D = 386, + ITEXTURE3D = 387, + ITEXTURECUBE = 388, + ITEXTURE1DARRAY = 389, + ITEXTURE2DARRAY = 390, + UTEXTURE1D = 391, + UTEXTURE2D = 392, + UTEXTURE3D = 393, + UTEXTURECUBE = 394, + UTEXTURE1DARRAY = 395, + UTEXTURE2DARRAY = 396, + TEXTURE2DRECT = 397, + ITEXTURE2DRECT = 398, + UTEXTURE2DRECT = 399, + TEXTUREBUFFER = 400, + ITEXTUREBUFFER = 401, + UTEXTUREBUFFER = 402, + TEXTURECUBEARRAY = 403, + ITEXTURECUBEARRAY = 404, + UTEXTURECUBEARRAY = 405, + TEXTURE2DMS = 406, + ITEXTURE2DMS = 407, + UTEXTURE2DMS = 408, + TEXTURE2DMSARRAY = 409, + ITEXTURE2DMSARRAY = 410, + UTEXTURE2DMSARRAY = 411, + SUBPASSINPUT = 412, + SUBPASSINPUTMS = 413, + ISUBPASSINPUT = 414, + ISUBPASSINPUTMS = 415, + USUBPASSINPUT = 416, + USUBPASSINPUTMS = 417, + IMAGE1D = 418, + IIMAGE1D = 419, + UIMAGE1D = 420, + IMAGE2D = 421, + IIMAGE2D = 422, + UIMAGE2D = 423, + IMAGE3D = 424, + IIMAGE3D = 425, + UIMAGE3D = 426, + IMAGE2DRECT = 427, + IIMAGE2DRECT = 428, + UIMAGE2DRECT = 429, + IMAGECUBE = 430, + IIMAGECUBE = 431, + UIMAGECUBE = 432, + IMAGEBUFFER = 433, + IIMAGEBUFFER = 434, + UIMAGEBUFFER = 435, + IMAGE1DARRAY = 436, + IIMAGE1DARRAY = 437, + UIMAGE1DARRAY = 438, + IMAGE2DARRAY = 439, + IIMAGE2DARRAY = 440, + UIMAGE2DARRAY = 441, + IMAGECUBEARRAY = 442, + IIMAGECUBEARRAY = 443, + UIMAGECUBEARRAY = 444, + IMAGE2DMS = 445, + IIMAGE2DMS = 446, + UIMAGE2DMS = 447, + IMAGE2DMSARRAY = 448, + IIMAGE2DMSARRAY = 449, + UIMAGE2DMSARRAY = 450, + STRUCT = 451, + VOID = 452, + WHILE = 453, + IDENTIFIER = 454, + TYPE_NAME = 455, + FLOATCONSTANT = 456, + DOUBLECONSTANT = 457, + INTCONSTANT = 458, + UINTCONSTANT = 459, + BOOLCONSTANT = 460, + LEFT_OP = 461, + RIGHT_OP = 462, + INC_OP = 463, + DEC_OP = 464, + LE_OP = 465, + GE_OP = 466, + EQ_OP = 467, + NE_OP = 468, + AND_OP = 469, + OR_OP = 470, + XOR_OP = 471, + MUL_ASSIGN = 472, + DIV_ASSIGN = 473, + ADD_ASSIGN = 474, + MOD_ASSIGN = 475, + LEFT_ASSIGN = 476, + RIGHT_ASSIGN = 477, + AND_ASSIGN = 478, + XOR_ASSIGN = 479, + OR_ASSIGN = 480, + SUB_ASSIGN = 481, + LEFT_PAREN = 482, + RIGHT_PAREN = 483, + LEFT_BRACKET = 484, + RIGHT_BRACKET = 485, + LEFT_BRACE = 486, + RIGHT_BRACE = 487, + DOT = 488, + COMMA = 489, + COLON = 490, + EQUAL = 491, + SEMICOLON = 492, + BANG = 493, + DASH = 494, + TILDE = 495, + PLUS = 496, + STAR = 497, + SLASH = 498, + PERCENT = 499, + LEFT_ANGLE = 500, + RIGHT_ANGLE = 501, + VERTICAL_BAR = 502, + CARET = 503, + AMPERSAND = 504, + QUESTION = 505, + INVARIANT = 506, + PRECISE = 507, + HIGH_PRECISION = 508, + MEDIUM_PRECISION = 509, + LOW_PRECISION = 510, + PRECISION = 511, + PACKED = 512, + RESOURCE = 513, + SUPERP = 514 + }; +#endif + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ +/* Line 387 of yacc.c */ +#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + + struct { + glslang::TSourceLoc loc; + union { + glslang::TString *string; + int i; + unsigned int u; + bool b; + double d; + }; + glslang::TSymbol* symbol; + } lex; + struct { + glslang::TSourceLoc loc; + glslang::TOperator op; + union { + TIntermNode* intermNode; + glslang::TIntermNodePair nodePair; + glslang::TIntermTyped* intermTypedNode; + }; + union { + glslang::TPublicType type; + glslang::TFunction* function; + glslang::TParameter param; + glslang::TTypeLoc typeLine; + glslang::TTypeList* typeList; + glslang::TArraySizes* arraySizes; + glslang::TIdentifierList* identifierList; + }; + } interm; + + +/* Line 387 of yacc.c */ +#line 428 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (glslang::TParseContext* pParseContext); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + +#endif /* !YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ + +/* Copy the second part of user declarations. */ +/* Line 390 of yacc.c */ +#line 98 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + + +/* windows only pragma */ +#ifdef _MSC_VER + #pragma warning(disable : 4065) + #pragma warning(disable : 4127) + #pragma warning(disable : 4244) +#endif + +#define parseContext (*pParseContext) +#define yyerror(context, msg) context->parserError(msg) + +extern int yylex(YYSTYPE*, TParseContext&); + + +/* Line 390 of yacc.c */ +#line 471 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(N) (N) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 240 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 5659 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 260 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 100 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 411 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 543 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 514 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint16 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 21, 23, 28, 30, 34, 37, 40, 42, 44, 46, + 49, 52, 55, 57, 60, 64, 67, 69, 71, 73, + 76, 79, 82, 84, 86, 88, 90, 92, 96, 100, + 104, 106, 110, 114, 116, 120, 124, 126, 130, 134, + 138, 142, 144, 148, 152, 154, 158, 160, 164, 166, + 170, 172, 176, 178, 182, 184, 188, 190, 191, 198, + 200, 204, 206, 208, 210, 212, 214, 216, 218, 220, + 222, 224, 226, 228, 232, 234, 237, 240, 245, 248, + 252, 257, 260, 264, 269, 270, 277, 280, 284, 287, + 289, 291, 294, 298, 302, 305, 309, 312, 314, 317, + 319, 321, 323, 327, 332, 339, 345, 347, 350, 354, + 360, 365, 367, 370, 372, 374, 376, 378, 383, 385, + 389, 391, 395, 397, 399, 401, 404, 406, 408, 410, + 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, + 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, + 452, 457, 459, 463, 465, 468, 471, 475, 479, 484, + 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, + 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, + 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, + 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, + 566, 568, 570, 572, 574, 576, 578, 580, 582, 584, + 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, + 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, + 646, 648, 650, 652, 654, 656, 658, 660, 662, 664, + 666, 668, 670, 672, 674, 676, 678, 680, 682, 684, + 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, + 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, + 726, 728, 730, 732, 734, 736, 738, 740, 742, 744, + 746, 748, 750, 752, 754, 756, 758, 760, 762, 764, + 766, 768, 770, 772, 774, 776, 778, 780, 782, 784, + 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, + 806, 808, 810, 812, 814, 816, 817, 824, 825, 831, + 833, 836, 840, 845, 847, 851, 853, 856, 858, 862, + 867, 869, 873, 875, 877, 879, 881, 883, 885, 887, + 889, 891, 893, 896, 897, 898, 904, 906, 908, 909, + 912, 913, 916, 919, 923, 925, 928, 930, 933, 939, + 943, 945, 947, 952, 953, 962, 963, 965, 969, 972, + 973, 980, 981, 990, 991, 999, 1001, 1003, 1005, 1006, + 1009, 1013, 1016, 1019, 1022, 1026, 1029, 1031, 1034, 1036, + 1038, 1039 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 356, 0, -1, 199, -1, 261, -1, 203, -1, 204, + -1, 201, -1, 202, -1, 205, -1, 227, 289, 228, + -1, 262, -1, 263, 229, 264, 230, -1, 265, -1, + 263, 233, 199, -1, 263, 208, -1, 263, 209, -1, + 289, -1, 266, -1, 267, -1, 269, 228, -1, 268, + 228, -1, 270, 197, -1, 270, -1, 270, 287, -1, + 269, 234, 287, -1, 271, 227, -1, 315, -1, 263, + -1, 263, -1, 208, 272, -1, 209, 272, -1, 273, + 272, -1, 241, -1, 239, -1, 238, -1, 240, -1, + 272, -1, 274, 242, 272, -1, 274, 243, 272, -1, + 274, 244, 272, -1, 274, -1, 275, 241, 274, -1, + 275, 239, 274, -1, 275, -1, 276, 206, 275, -1, + 276, 207, 275, -1, 276, -1, 277, 245, 276, -1, + 277, 246, 276, -1, 277, 210, 276, -1, 277, 211, + 276, -1, 277, -1, 278, 212, 277, -1, 278, 213, + 277, -1, 278, -1, 279, 249, 278, -1, 279, -1, + 280, 248, 279, -1, 280, -1, 281, 247, 280, -1, + 281, -1, 282, 214, 281, -1, 282, -1, 283, 216, + 282, -1, 283, -1, 284, 215, 283, -1, 284, -1, + -1, 284, 250, 286, 289, 235, 287, -1, 285, -1, + 272, 288, 287, -1, 236, -1, 217, -1, 218, -1, + 220, -1, 219, -1, 226, -1, 221, -1, 222, -1, + 223, -1, 224, -1, 225, -1, 287, -1, 289, 234, + 287, -1, 285, -1, 295, 237, -1, 302, 237, -1, + 256, 318, 315, 237, -1, 292, 237, -1, 292, 199, + 237, -1, 292, 199, 316, 237, -1, 311, 237, -1, + 311, 199, 237, -1, 311, 199, 294, 237, -1, -1, + 311, 199, 231, 293, 322, 232, -1, 234, 199, -1, + 294, 234, 199, -1, 296, 228, -1, 298, -1, 297, + -1, 298, 300, -1, 297, 234, 300, -1, 304, 199, + 227, -1, 315, 199, -1, 315, 199, 316, -1, 311, + 299, -1, 299, -1, 311, 301, -1, 301, -1, 315, + -1, 303, -1, 302, 234, 199, -1, 302, 234, 199, + 316, -1, 302, 234, 199, 316, 236, 326, -1, 302, + 234, 199, 236, 326, -1, 304, -1, 304, 199, -1, + 304, 199, 316, -1, 304, 199, 316, 236, 326, -1, + 304, 199, 236, 326, -1, 315, -1, 311, 315, -1, + 251, -1, 60, -1, 59, -1, 58, -1, 61, 227, + 308, 228, -1, 309, -1, 308, 234, 309, -1, 199, + -1, 199, 236, 290, -1, 46, -1, 252, -1, 312, + -1, 311, 312, -1, 313, -1, 307, -1, 318, -1, + 306, -1, 305, -1, 310, -1, 5, -1, 3, -1, + 4, -1, 41, -1, 39, -1, 40, -1, 38, -1, + 43, -1, 44, -1, 42, -1, 45, -1, 46, -1, + 47, -1, 48, -1, 49, -1, 50, -1, 51, -1, + 22, -1, 22, 227, 314, 228, -1, 200, -1, 314, + 234, 200, -1, 317, -1, 317, 316, -1, 229, 230, + -1, 229, 285, 230, -1, 316, 229, 230, -1, 316, + 229, 285, 230, -1, 197, -1, 7, -1, 8, -1, + 9, -1, 10, -1, 6, -1, 32, -1, 33, -1, + 34, -1, 52, -1, 53, -1, 54, -1, 23, -1, + 24, -1, 25, -1, 26, -1, 27, -1, 28, -1, + 29, -1, 30, -1, 31, -1, 35, -1, 36, -1, + 37, -1, 62, -1, 63, -1, 64, -1, 65, -1, + 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, + 55, -1, 56, -1, 57, -1, 71, -1, 72, -1, + 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, + 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, + 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, + 88, -1, 89, -1, 90, -1, 91, -1, 111, -1, + 112, -1, 92, -1, 93, -1, 94, -1, 95, -1, + 96, -1, 97, -1, 113, -1, 98, -1, 99, -1, + 100, -1, 101, -1, 102, -1, 103, -1, 114, -1, + 104, -1, 105, -1, 106, -1, 107, -1, 108, -1, + 109, -1, 110, -1, 115, -1, 116, -1, 117, -1, + 118, -1, 119, -1, 120, -1, 122, -1, 123, -1, + 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, + 129, -1, 148, -1, 130, -1, 131, -1, 132, -1, + 133, -1, 134, -1, 135, -1, 149, -1, 136, -1, + 137, -1, 138, -1, 139, -1, 140, -1, 141, -1, + 150, -1, 142, -1, 143, -1, 144, -1, 145, -1, + 146, -1, 147, -1, 151, -1, 152, -1, 153, -1, + 154, -1, 155, -1, 156, -1, 163, -1, 164, -1, + 165, -1, 166, -1, 167, -1, 168, -1, 169, -1, + 170, -1, 171, -1, 172, -1, 173, -1, 174, -1, + 175, -1, 176, -1, 177, -1, 178, -1, 179, -1, + 180, -1, 181, -1, 182, -1, 183, -1, 184, -1, + 185, -1, 186, -1, 187, -1, 188, -1, 189, -1, + 190, -1, 191, -1, 192, -1, 193, -1, 194, -1, + 195, -1, 121, -1, 157, -1, 158, -1, 159, -1, + 160, -1, 161, -1, 162, -1, 319, -1, 200, -1, + 253, -1, 254, -1, 255, -1, -1, 196, 199, 231, + 320, 322, 232, -1, -1, 196, 231, 321, 322, 232, + -1, 323, -1, 322, 323, -1, 315, 324, 237, -1, + 311, 315, 324, 237, -1, 325, -1, 324, 234, 325, + -1, 199, -1, 199, 316, -1, 287, -1, 231, 327, + 232, -1, 231, 327, 234, 232, -1, 326, -1, 327, + 234, 326, -1, 291, -1, 331, -1, 330, -1, 328, + -1, 340, -1, 341, -1, 344, -1, 347, -1, 348, + -1, 355, -1, 231, 232, -1, -1, -1, 231, 332, + 339, 333, 232, -1, 338, -1, 330, -1, -1, 336, + 331, -1, -1, 337, 330, -1, 231, 232, -1, 231, + 339, 232, -1, 329, -1, 339, 329, -1, 237, -1, + 289, 237, -1, 16, 227, 289, 228, 342, -1, 335, + 14, 335, -1, 335, -1, 289, -1, 304, 199, 236, + 326, -1, -1, 19, 227, 289, 228, 345, 231, 346, + 232, -1, -1, 339, -1, 20, 289, 235, -1, 21, + 235, -1, -1, 198, 227, 349, 343, 228, 334, -1, + -1, 13, 350, 329, 198, 227, 289, 228, 237, -1, + -1, 15, 227, 351, 352, 354, 228, 334, -1, 340, + -1, 328, -1, 343, -1, -1, 353, 237, -1, 353, + 237, 289, -1, 12, 237, -1, 11, 237, -1, 18, + 237, -1, 18, 289, 237, -1, 17, 237, -1, 357, + -1, 356, 357, -1, 358, -1, 291, -1, -1, 295, + 359, 338, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 244, 244, 250, 253, 256, 260, 263, 267, 270, + 278, 281, 284, 287, 290, 295, 303, 310, 317, 323, + 327, 334, 337, 343, 350, 360, 368, 373, 403, 409, + 413, 417, 437, 438, 439, 440, 446, 447, 452, 457, + 466, 467, 472, 480, 481, 487, 496, 497, 502, 507, + 512, 520, 521, 529, 540, 541, 550, 551, 560, 561, + 570, 571, 579, 580, 588, 589, 597, 598, 598, 616, + 617, 632, 636, 640, 644, 649, 653, 657, 661, 665, + 669, 673, 680, 683, 693, 700, 705, 710, 718, 722, + 726, 730, 735, 740, 749, 749, 760, 764, 771, 778, + 781, 788, 796, 816, 834, 849, 872, 883, 893, 903, + 913, 922, 925, 929, 933, 938, 946, 951, 956, 961, + 966, 975, 986, 1013, 1022, 1029, 1036, 1046, 1052, 1055, + 1062, 1066, 1070, 1078, 1084, 1087, 1098, 1101, 1104, 1107, + 1111, 1115, 1122, 1126, 1138, 1152, 1157, 1163, 1169, 1176, + 1182, 1187, 1192, 1197, 1204, 1208, 1212, 1216, 1220, 1224, + 1230, 1242, 1245, 1250, 1254, 1263, 1268, 1276, 1280, 1290, + 1294, 1298, 1303, 1307, 1312, 1316, 1321, 1326, 1331, 1337, + 1343, 1349, 1354, 1359, 1364, 1369, 1374, 1379, 1385, 1391, + 1397, 1402, 1407, 1412, 1417, 1422, 1427, 1432, 1437, 1442, + 1447, 1452, 1457, 1463, 1469, 1475, 1481, 1487, 1493, 1499, + 1505, 1511, 1517, 1523, 1529, 1534, 1539, 1544, 1549, 1554, + 1559, 1564, 1569, 1574, 1579, 1584, 1589, 1594, 1599, 1604, + 1609, 1614, 1619, 1624, 1629, 1634, 1639, 1644, 1649, 1654, + 1659, 1664, 1669, 1674, 1679, 1684, 1689, 1694, 1699, 1704, + 1709, 1714, 1719, 1724, 1729, 1734, 1739, 1744, 1749, 1754, + 1759, 1764, 1769, 1774, 1779, 1784, 1789, 1794, 1799, 1804, + 1809, 1814, 1819, 1824, 1829, 1834, 1839, 1844, 1849, 1854, + 1859, 1864, 1869, 1874, 1879, 1884, 1889, 1894, 1899, 1904, + 1909, 1914, 1919, 1924, 1929, 1934, 1939, 1944, 1949, 1954, + 1959, 1964, 1969, 1974, 1979, 1984, 1989, 1994, 1999, 2004, + 2009, 2014, 2019, 2024, 2029, 2034, 2039, 2044, 2049, 2054, + 2059, 2064, 2069, 2074, 2080, 2086, 2092, 2098, 2104, 2110, + 2116, 2121, 2137, 2143, 2149, 2158, 2158, 2169, 2169, 2179, + 2182, 2195, 2213, 2237, 2241, 2247, 2252, 2263, 2266, 2272, + 2281, 2284, 2290, 2294, 2295, 2301, 2302, 2303, 2304, 2305, + 2306, 2307, 2311, 2312, 2316, 2312, 2328, 2329, 2333, 2333, + 2340, 2340, 2354, 2357, 2365, 2373, 2384, 2385, 2389, 2396, + 2400, 2408, 2412, 2425, 2425, 2445, 2448, 2454, 2466, 2478, + 2478, 2493, 2493, 2509, 2509, 2530, 2533, 2539, 2542, 2548, + 2552, 2559, 2564, 2569, 2576, 2594, 2603, 2607, 2614, 2617, + 2623, 2623 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "CONST", "BOOL", + "FLOAT", "DOUBLE", "INT", "UINT", "BREAK", "CONTINUE", "DO", "ELSE", + "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", + "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", + "UVEC2", "UVEC3", "UVEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", + "MAT4", "CENTROID", "IN", "OUT", "INOUT", "UNIFORM", "PATCH", "SAMPLE", + "BUFFER", "SHARED", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", + "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", + "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "MAT2X2", "MAT2X3", + "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", + "DMAT2X2", "DMAT2X3", "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", + "DMAT4X2", "DMAT4X3", "DMAT4X4", "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", + "SAMPLER3D", "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", + "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", "SAMPLER2DARRAY", + "SAMPLER1DARRAYSHADOW", "SAMPLER2DARRAYSHADOW", "ISAMPLER1D", + "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", "ISAMPLER1DARRAY", + "ISAMPLER2DARRAY", "USAMPLER1D", "USAMPLER2D", "USAMPLER3D", + "USAMPLERCUBE", "USAMPLER1DARRAY", "USAMPLER2DARRAY", "SAMPLER2DRECT", + "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", "USAMPLER2DRECT", + "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLERCUBEARRAY", + "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", + "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", + "ISAMPLER2DMSARRAY", "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", + "SAMPLER", "SAMPLERSHADOW", "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", + "TEXTURECUBE", "TEXTURE1DARRAY", "TEXTURE2DARRAY", "ITEXTURE1D", + "ITEXTURE2D", "ITEXTURE3D", "ITEXTURECUBE", "ITEXTURE1DARRAY", + "ITEXTURE2DARRAY", "UTEXTURE1D", "UTEXTURE2D", "UTEXTURE3D", + "UTEXTURECUBE", "UTEXTURE1DARRAY", "UTEXTURE2DARRAY", "TEXTURE2DRECT", + "ITEXTURE2DRECT", "UTEXTURE2DRECT", "TEXTUREBUFFER", "ITEXTUREBUFFER", + "UTEXTUREBUFFER", "TEXTURECUBEARRAY", "ITEXTURECUBEARRAY", + "UTEXTURECUBEARRAY", "TEXTURE2DMS", "ITEXTURE2DMS", "UTEXTURE2DMS", + "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY", "UTEXTURE2DMSARRAY", + "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", "ISUBPASSINPUTMS", + "USUBPASSINPUT", "USUBPASSINPUTMS", "IMAGE1D", "IIMAGE1D", "UIMAGE1D", + "IMAGE2D", "IIMAGE2D", "UIMAGE2D", "IMAGE3D", "IIMAGE3D", "UIMAGE3D", + "IMAGE2DRECT", "IIMAGE2DRECT", "UIMAGE2DRECT", "IMAGECUBE", "IIMAGECUBE", + "UIMAGECUBE", "IMAGEBUFFER", "IIMAGEBUFFER", "UIMAGEBUFFER", + "IMAGE1DARRAY", "IIMAGE1DARRAY", "UIMAGE1DARRAY", "IMAGE2DARRAY", + "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBEARRAY", "IIMAGECUBEARRAY", + "UIMAGECUBEARRAY", "IMAGE2DMS", "IIMAGE2DMS", "UIMAGE2DMS", + "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", "STRUCT", "VOID", + "WHILE", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "DOUBLECONSTANT", + "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "LEFT_OP", "RIGHT_OP", + "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", + "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", + "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", + "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", + "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", + "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", + "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", + "AMPERSAND", "QUESTION", "INVARIANT", "PRECISE", "HIGH_PRECISION", + "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", + "SUPERP", "$accept", "variable_identifier", "primary_expression", + "postfix_expression", "integer_expression", "function_call", + "function_call_or_method", "function_call_generic", + "function_call_header_no_parameters", + "function_call_header_with_parameters", "function_call_header", + "function_identifier", "unary_expression", "unary_operator", + "multiplicative_expression", "additive_expression", "shift_expression", + "relational_expression", "equality_expression", "and_expression", + "exclusive_or_expression", "inclusive_or_expression", + "logical_and_expression", "logical_xor_expression", + "logical_or_expression", "conditional_expression", "$@1", + "assignment_expression", "assignment_operator", "expression", + "constant_expression", "declaration", "block_structure", "$@2", + "identifier_list", "function_prototype", "function_declarator", + "function_header_with_parameters", "function_header", + "parameter_declarator", "parameter_declaration", + "parameter_type_specifier", "init_declarator_list", "single_declaration", + "fully_specified_type", "invariant_qualifier", "interpolation_qualifier", + "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id", + "precise_qualifier", "type_qualifier", "single_type_qualifier", + "storage_qualifier", "type_name_list", "type_specifier", + "array_specifier", "type_specifier_nonarray", "precision_qualifier", + "struct_specifier", "$@3", "$@4", "struct_declaration_list", + "struct_declaration", "struct_declarator_list", "struct_declarator", + "initializer", "initializer_list", "declaration_statement", "statement", + "simple_statement", "compound_statement", "$@5", "$@6", + "statement_no_new_scope", "statement_scoped", "$@7", "$@8", + "compound_statement_no_new_scope", "statement_list", + "expression_statement", "selection_statement", + "selection_rest_statement", "condition", "switch_statement", "$@9", + "switch_statement_list", "case_label", "iteration_statement", "$@10", + "$@11", "$@12", "for_init_statement", "conditionopt", + "for_rest_statement", "jump_statement", "translation_unit", + "external_declaration", "function_definition", "$@13", YY_NULL +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 260, 261, 262, 262, 262, 262, 262, 262, 262, + 263, 263, 263, 263, 263, 263, 264, 265, 266, 267, + 267, 268, 268, 269, 269, 270, 271, 271, 272, 272, + 272, 272, 273, 273, 273, 273, 274, 274, 274, 274, + 275, 275, 275, 276, 276, 276, 277, 277, 277, 277, + 277, 278, 278, 278, 279, 279, 280, 280, 281, 281, + 282, 282, 283, 283, 284, 284, 285, 286, 285, 287, + 287, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 289, 289, 290, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 293, 292, 294, 294, 295, 296, + 296, 297, 297, 298, 299, 299, 300, 300, 300, 300, + 301, 302, 302, 302, 302, 302, 303, 303, 303, 303, + 303, 304, 304, 305, 306, 306, 306, 307, 308, 308, + 309, 309, 309, 310, 311, 311, 312, 312, 312, 312, + 312, 312, 313, 313, 313, 313, 313, 313, 313, 313, + 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, + 313, 314, 314, 315, 315, 316, 316, 316, 316, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 318, 318, 318, 320, 319, 321, 319, 322, + 322, 323, 323, 324, 324, 325, 325, 326, 326, 326, + 327, 327, 328, 329, 329, 330, 330, 330, 330, 330, + 330, 330, 331, 332, 333, 331, 334, 334, 336, 335, + 337, 335, 338, 338, 339, 339, 340, 340, 341, 342, + 342, 343, 343, 345, 344, 346, 346, 347, 347, 349, + 348, 350, 348, 351, 348, 352, 352, 353, 353, 354, + 354, 355, 355, 355, 355, 355, 356, 356, 357, 357, + 359, 358 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 4, 1, 3, 2, 2, 1, 1, 1, 2, + 2, 2, 1, 2, 3, 2, 1, 1, 1, 2, + 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, + 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, + 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 0, 6, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 1, 2, 2, 4, 2, 3, + 4, 2, 3, 4, 0, 6, 2, 3, 2, 1, + 1, 2, 3, 3, 2, 3, 2, 1, 2, 1, + 1, 1, 3, 4, 6, 5, 1, 2, 3, 5, + 4, 1, 2, 1, 1, 1, 1, 4, 1, 3, + 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 3, 1, 2, 2, 3, 3, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 6, 0, 5, 1, + 2, 3, 4, 1, 3, 1, 2, 1, 3, 4, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 0, 0, 5, 1, 1, 0, 2, + 0, 2, 2, 3, 1, 2, 1, 2, 5, 3, + 1, 1, 4, 0, 8, 0, 1, 3, 2, 0, + 6, 0, 8, 0, 7, 1, 1, 1, 0, 2, + 3, 2, 2, 2, 3, 2, 1, 2, 1, 1, + 0, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 0, 143, 144, 142, 174, 170, 171, 172, 173, 159, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 175, + 176, 177, 190, 191, 192, 148, 146, 147, 145, 151, + 149, 150, 152, 153, 154, 155, 156, 157, 158, 178, + 179, 180, 202, 203, 204, 126, 125, 124, 0, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 228, + 229, 230, 231, 232, 233, 235, 236, 237, 238, 239, + 240, 242, 243, 244, 245, 246, 247, 248, 226, 227, + 234, 241, 249, 250, 251, 252, 253, 254, 323, 255, + 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, + 267, 268, 269, 271, 272, 273, 274, 275, 276, 278, + 279, 280, 281, 282, 283, 263, 270, 277, 284, 285, + 286, 287, 288, 289, 324, 325, 326, 327, 328, 329, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 0, 169, 331, 123, 133, 332, 333, + 334, 0, 409, 0, 410, 0, 100, 99, 0, 111, + 116, 140, 139, 137, 141, 0, 134, 136, 121, 163, + 138, 330, 0, 406, 408, 0, 0, 0, 337, 0, + 0, 88, 85, 0, 98, 0, 107, 101, 109, 0, + 110, 0, 86, 117, 0, 91, 135, 122, 0, 164, + 1, 407, 161, 0, 132, 130, 0, 128, 335, 0, + 0, 89, 0, 0, 411, 102, 106, 108, 104, 112, + 103, 0, 118, 94, 0, 92, 0, 2, 6, 7, + 4, 5, 8, 0, 0, 0, 165, 34, 33, 35, + 32, 3, 10, 28, 12, 17, 18, 0, 0, 22, + 0, 36, 0, 40, 43, 46, 51, 54, 56, 58, + 60, 62, 64, 66, 0, 26, 0, 160, 0, 0, + 127, 0, 0, 0, 0, 0, 339, 87, 90, 0, + 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, + 363, 372, 376, 36, 69, 82, 0, 352, 0, 121, + 355, 374, 354, 353, 0, 356, 357, 358, 359, 360, + 361, 105, 0, 113, 0, 347, 120, 0, 0, 96, + 0, 93, 29, 30, 0, 14, 15, 0, 0, 20, + 19, 0, 169, 23, 25, 31, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 67, 166, 167, 0, 162, + 84, 131, 129, 0, 0, 345, 0, 343, 338, 340, + 402, 401, 0, 393, 0, 405, 403, 0, 0, 0, + 388, 389, 362, 0, 72, 73, 75, 74, 77, 78, + 79, 80, 81, 76, 71, 0, 0, 377, 373, 375, + 115, 0, 350, 0, 119, 0, 97, 9, 0, 16, + 13, 24, 37, 38, 39, 42, 41, 44, 45, 49, + 50, 47, 48, 52, 53, 55, 57, 59, 61, 63, + 65, 0, 168, 336, 0, 346, 0, 341, 0, 0, + 0, 404, 0, 387, 0, 364, 70, 83, 114, 348, + 0, 95, 11, 0, 342, 344, 0, 396, 395, 398, + 370, 383, 381, 0, 0, 0, 0, 349, 351, 0, + 0, 397, 0, 0, 380, 0, 0, 378, 0, 0, + 0, 365, 68, 0, 399, 0, 370, 369, 371, 385, + 0, 367, 390, 366, 0, 400, 394, 379, 386, 0, + 382, 392, 384 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 281, 282, 283, 448, 284, 285, 286, 287, 288, + 289, 290, 333, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 334, 471, 335, 435, 336, + 401, 337, 193, 358, 266, 338, 195, 196, 197, 226, + 227, 228, 198, 199, 200, 201, 202, 203, 246, 247, + 204, 205, 206, 207, 243, 305, 239, 209, 210, 211, + 312, 249, 315, 316, 406, 407, 356, 443, 340, 341, + 342, 343, 423, 506, 532, 514, 515, 516, 533, 344, + 345, 346, 517, 505, 347, 518, 539, 348, 349, 484, + 412, 479, 499, 512, 513, 350, 212, 213, 214, 223 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -466 +static const yytype_int16 yypact[] = +{ + 2275, -466, -466, -466, -466, -466, -466, -466, -466, -205, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -192, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -179, -466, -466, -466, -466, -466, -466, + -466, -122, -466, -186, -198, -173, -175, 3686, -194, -466, + -121, -466, -466, -466, -466, 2749, -466, -466, -466, -141, + -466, -466, 527, -466, -466, -97, -37, -117, -466, 5459, + -200, -466, -466, -112, -466, 3686, -466, -466, -466, 3686, + -71, -44, -466, -191, -142, -466, -466, -466, 4117, -82, + -466, -466, -466, -202, -466, -76, -137, -466, -466, 3686, + -73, -466, -196, 781, -466, -466, -466, -466, -141, -155, + -466, 4342, -152, -466, -38, -466, -177, -466, -466, -466, + -466, -466, -466, 5015, 5015, 5015, -466, -466, -466, -466, + -466, -466, -466, -185, -466, -466, -466, -63, -128, 5237, + -61, -466, 5015, -106, -100, -157, -183, -78, -81, -79, + -80, -43, -46, -197, -58, -466, 4568, -466, -27, 5015, + -466, -37, 3686, 3686, -25, 2984, -466, -466, -466, -62, + -57, -466, -51, -48, -56, 4793, -45, 5015, -50, -40, + -41, -466, -466, -153, -466, -466, -147, -466, -198, -39, + -466, -466, -466, -466, 1035, -466, -466, -466, -466, -466, + -466, -82, 4342, -143, 4342, -466, -466, 4342, 3686, -466, + -15, -466, -466, -466, -126, -466, -466, 5015, -10, -466, + -466, 5015, -36, -466, -466, -466, 5015, 5015, 5015, 5015, + 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, + 5015, 5015, 5015, 5015, 5015, -466, -466, -466, -35, -466, + -466, -466, -466, 3218, -25, -141, -127, -466, -466, -466, + -466, -466, 1289, -466, 5015, -466, -466, -108, 5015, -91, + -466, -466, -466, 1289, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, 5015, 5015, -466, -466, -466, + -466, 4342, -466, -92, -466, 3452, -466, -466, -34, -31, + -466, -466, -466, -466, -466, -106, -106, -100, -100, -157, + -157, -157, -157, -183, -183, -78, -81, -79, -80, -43, + -46, 5015, -466, -466, -107, -82, -25, -466, -4, 2036, + -123, -466, -116, -466, 2510, 1289, -466, -466, -466, -466, + 3890, -466, -466, -83, -466, -466, -29, -466, -466, 2510, + -32, -466, -31, 1, 3686, -24, -26, -466, -466, 5015, + 5015, -466, -30, -19, 196, -20, 1797, -466, -18, -22, + 1543, -466, -466, -113, 5015, 1543, -32, -466, -466, 1289, + 4342, -466, -466, -466, -17, -31, -466, -466, 1289, -14, + -466, -466, -466 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -52, -466, -226, -225, -261, -229, -166, -164, + -167, -165, -162, -161, -466, -227, -466, -258, -466, -269, + -466, 4, -466, -466, -466, 5, -466, -466, -466, -1, + 9, 6, -466, -466, -465, -466, -466, -466, -466, -75, + -466, -195, -204, -466, -466, 0, -212, -466, 46, -466, + -466, -466, -297, -299, -160, -238, -340, -466, -240, -337, + -440, -273, -466, -466, -282, -281, -466, -466, 23, -413, + -232, -466, -466, -251, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, 40, -466, -466 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -369 +static const yytype_int16 yytable[] = +{ + 208, 236, 229, 355, 192, 194, 364, 439, 252, 244, + 485, 304, 440, 220, 442, 403, 409, 444, 394, 503, + 217, 262, 215, 365, 366, 236, 307, 383, 384, 238, + 229, 373, 308, 306, 503, 216, 260, 251, 238, 222, + 231, 318, -27, 232, 367, 261, 351, 353, 368, 381, + 382, 221, 218, 395, 313, 224, 417, 360, 419, 225, + 361, 445, 385, 386, 424, 425, 426, 427, 428, 429, + 430, 431, 432, 433, 238, 478, 528, 306, 233, 398, + 531, 352, 400, 434, 357, 531, 306, 436, 238, 263, + 437, 310, 264, 441, 355, 265, 355, 311, 449, 355, + 370, 488, 447, 242, 409, 500, 371, 476, 436, 236, + 477, 436, 501, 451, 248, 534, 538, 313, 436, 253, + 313, 436, 459, 460, 461, 462, 436, 476, 258, 481, + 494, 188, 189, 190, 387, 388, 376, 377, 378, 379, + 489, 380, 490, 436, 483, 480, 409, 306, 439, 482, + 508, 436, 509, 455, 456, 259, 457, 458, 463, 464, + 309, 359, 245, 313, 317, 369, 374, 391, 389, 390, + 393, 392, 396, 399, 405, 410, 413, 486, 487, 414, + 411, 415, 418, 355, 446, 420, 291, 421, -26, 450, + 540, 422, -21, 475, 496, 472, 492, 230, 510, -368, + 519, 439, 493, 436, 520, 237, 521, 524, 313, 525, + 526, 330, 208, 529, 530, 502, 192, 194, 542, 250, + 541, 362, 363, 465, 467, 230, 466, 468, 256, 230, + 502, 469, 355, 470, 255, 257, 402, 219, 495, 497, + 375, 523, 527, 536, 474, 537, 254, 498, 511, 314, + 313, 522, 241, 339, 291, 535, 0, 291, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 355, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 236, 0, 0, 0, 504, 0, 0, 0, 0, 0, + 0, 0, 314, 404, 0, 314, 0, 0, 0, 0, + 0, 0, 0, 0, 452, 453, 454, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 0, 339, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 314, 0, 0, 0, 0, 0, 0, + 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, + 0, 0, 0, 0, 339, 339, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, + 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, + 339, 0, 0, 0, 0, 339, 0, 240, 0, 339, + 1, 2, 3, 4, 5, 6, 7, 8, 339, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 0, 0, 185, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, + 188, 189, 190, 191, 1, 2, 3, 4, 5, 6, + 7, 8, 319, 320, 321, 0, 322, 323, 324, 325, + 326, 327, 328, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 329, + 267, 185, 268, 269, 270, 271, 272, 0, 0, 273, + 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 275, 0, + 0, 0, 330, 331, 0, 0, 0, 0, 332, 277, + 278, 279, 280, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 186, 187, 188, 189, 190, 191, 1, 2, + 3, 4, 5, 6, 7, 8, 319, 320, 321, 0, + 322, 323, 324, 325, 326, 327, 328, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 329, 267, 185, 268, 269, 270, 271, + 272, 0, 0, 273, 274, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 275, 0, 0, 0, 330, 438, 0, 0, + 0, 0, 332, 277, 278, 279, 280, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 186, 187, 188, 189, + 190, 191, 1, 2, 3, 4, 5, 6, 7, 8, + 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, + 328, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 329, 267, 185, + 268, 269, 270, 271, 272, 0, 0, 273, 274, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 275, 0, 0, 0, + 330, 0, 0, 0, 0, 0, 332, 277, 278, 279, + 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 186, 187, 188, 189, 190, 191, 1, 2, 3, 4, + 5, 6, 7, 8, 319, 320, 321, 0, 322, 323, + 324, 325, 326, 327, 328, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 329, 267, 185, 268, 269, 270, 271, 272, 0, + 0, 273, 274, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 275, 0, 0, 0, 253, 0, 0, 0, 0, 0, + 332, 277, 278, 279, 280, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 186, 187, 188, 189, 190, 191, + 1, 2, 3, 4, 5, 6, 7, 8, 319, 320, + 321, 0, 322, 323, 324, 325, 326, 327, 328, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 329, 267, 185, 268, 269, + 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 332, 277, 278, 279, 280, 1, + 2, 3, 4, 5, 6, 7, 8, 0, 186, 187, + 188, 189, 190, 191, 0, 0, 0, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 0, 267, 185, 268, 269, 270, + 271, 272, 0, 0, 273, 274, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 332, 277, 278, 279, 280, 1, 2, + 3, 4, 5, 6, 7, 8, 0, 186, 187, 188, + 189, 190, 191, 0, 0, 0, 0, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 0, 0, 185, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 0, 0, 186, 187, 188, 189, + 190, 191, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 0, 267, + 185, 268, 269, 270, 271, 272, 0, 0, 273, 274, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 277, 278, + 279, 280, 1, 2, 3, 4, 5, 6, 7, 8, + 0, 186, 187, 188, 189, 190, 0, 0, 0, 0, + 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 0, 234, 185, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 235, 1, 2, 3, + 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, + 186, 187, 188, 189, 190, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 0, 0, 185, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, + 0, 0, 0, 0, 0, 186, 187, 188, 189, 190, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 0, 0, 185, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 473, 0, 0, 0, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 0, 0, 0, 0, 0, 0, 186, + 187, 188, 189, 190, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 0, 0, 185, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 491, 0, 0, 0, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, + 0, 0, 0, 186, 187, 188, 189, 190, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 0, 0, 185, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, + 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 186, 187, 188, + 189, 190, 39, 40, 41, 42, 43, 44, 0, 0, + 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 0, 267, + 185, 268, 269, 270, 271, 272, 0, 0, 273, 274, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, + 0, 354, 507, 4, 5, 6, 7, 8, 277, 278, + 279, 280, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 0, 267, 185, 268, 269, + 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 275, 0, 0, 276, 4, 5, + 6, 7, 8, 0, 0, 277, 278, 279, 280, 0, + 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, + 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 0, 267, 185, 268, 269, 270, 271, 272, 0, 0, + 273, 274, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, + 0, 0, 0, 354, 4, 5, 6, 7, 8, 0, + 277, 278, 279, 280, 0, 0, 0, 0, 0, 0, + 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 0, 267, 185, 268, + 269, 270, 271, 272, 0, 0, 273, 274, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 275, 0, 0, 397, 4, + 5, 6, 7, 8, 0, 0, 277, 278, 279, 280, + 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, + 44, 0, 0, 0, 0, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 0, 267, 185, 268, 269, 270, 271, 272, 0, + 0, 273, 274, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 275, 4, 5, 6, 7, 8, 0, 0, 0, 0, + 416, 277, 278, 279, 280, 0, 0, 0, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 39, 40, 41, + 42, 43, 44, 0, 0, 0, 0, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 0, 267, 185, 268, 269, 270, 271, + 272, 0, 0, 273, 274, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 275, 4, 5, 6, 7, 8, 0, 0, + 0, 0, 0, 277, 278, 279, 280, 0, 0, 0, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 372, 0, 267, 185, 268, 269, + 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 275, 4, 5, 6, 7, 8, + 0, 0, 0, 0, 0, 277, 278, 279, 280, 0, + 0, 0, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 39, 40, 41, 42, 43, 44, 0, 0, 0, + 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 0, 0, 185 +}; + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-466))) + +#define yytable_value_is_error(Yytable_value) \ + YYID (0) + +static const yytype_int16 yycheck[] = +{ + 0, 205, 197, 261, 0, 0, 275, 344, 220, 46, + 423, 238, 352, 199, 354, 312, 315, 357, 215, 484, + 199, 233, 227, 208, 209, 229, 228, 210, 211, 229, + 225, 289, 234, 229, 499, 227, 227, 237, 229, 237, + 234, 237, 227, 237, 229, 236, 258, 259, 233, 206, + 207, 237, 231, 250, 249, 228, 325, 234, 327, 234, + 237, 358, 245, 246, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 229, 412, 516, 229, 199, 306, + 520, 236, 309, 236, 236, 525, 229, 234, 229, 231, + 237, 228, 234, 236, 352, 237, 354, 234, 367, 357, + 228, 441, 228, 200, 403, 228, 234, 234, 234, 313, + 237, 234, 228, 371, 231, 228, 529, 312, 234, 231, + 315, 234, 383, 384, 385, 386, 234, 234, 199, 237, + 237, 253, 254, 255, 212, 213, 242, 243, 244, 239, + 232, 241, 234, 234, 235, 414, 445, 229, 485, 418, + 490, 234, 235, 379, 380, 199, 381, 382, 387, 388, + 236, 199, 199, 358, 237, 228, 227, 247, 249, 248, + 216, 214, 230, 200, 199, 237, 227, 435, 436, 227, + 237, 237, 227, 441, 199, 235, 238, 227, 227, 199, + 530, 232, 228, 405, 198, 230, 230, 197, 227, 231, + 199, 538, 471, 234, 228, 205, 232, 237, 403, 228, + 14, 231, 212, 231, 236, 484, 212, 212, 232, 219, + 237, 273, 274, 389, 391, 225, 390, 392, 229, 229, + 499, 393, 490, 394, 225, 229, 311, 191, 476, 479, + 292, 510, 515, 525, 404, 526, 223, 479, 499, 249, + 445, 509, 212, 253, 306, 524, -1, 309, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 530, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 484, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 504, -1, -1, -1, 499, -1, -1, -1, -1, -1, + -1, -1, 312, 313, -1, 315, -1, -1, -1, -1, + -1, -1, -1, -1, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, -1, 344, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 358, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 403, -1, -1, -1, -1, -1, -1, + -1, -1, 412, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 423, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 445, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 479, + -1, -1, -1, -1, 484, 485, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 499, + -1, -1, -1, -1, 504, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, + 520, -1, -1, -1, -1, 525, -1, 0, -1, 529, + 3, 4, 5, 6, 7, 8, 9, 10, 538, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, -1, -1, 200, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 251, 252, + 253, 254, 255, 256, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, -1, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, -1, -1, 208, + 209, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, + -1, -1, 231, 232, -1, -1, -1, -1, 237, 238, + 239, 240, 241, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 251, 252, 253, 254, 255, 256, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, -1, -1, 208, 209, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 227, -1, -1, -1, 231, 232, -1, -1, + -1, -1, 237, 238, 239, 240, 241, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 251, 252, 253, 254, + 255, 256, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, -1, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, -1, -1, 208, 209, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, + 231, -1, -1, -1, -1, -1, 237, 238, 239, 240, + 241, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 251, 252, 253, 254, 255, 256, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, -1, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, -1, + -1, 208, 209, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 227, -1, -1, -1, 231, -1, -1, -1, -1, -1, + 237, 238, 239, 240, 241, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 251, 252, 253, 254, 255, 256, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, -1, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 237, 238, 239, 240, 241, 3, + 4, 5, 6, 7, 8, 9, 10, -1, 251, 252, + 253, 254, 255, 256, -1, -1, -1, -1, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, + 204, 205, -1, -1, 208, 209, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 237, 238, 239, 240, 241, 3, 4, + 5, 6, 7, 8, 9, 10, -1, 251, 252, 253, + 254, 255, 256, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, -1, -1, 200, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, + 10, -1, -1, -1, -1, -1, 251, 252, 253, 254, + 255, 256, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, + 200, 201, 202, 203, 204, 205, -1, -1, 208, 209, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 238, 239, + 240, 241, 3, 4, 5, 6, 7, 8, 9, 10, + -1, 251, 252, 253, 254, 255, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 237, 3, 4, 5, + 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, + 251, 252, 253, 254, 255, -1, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, -1, -1, 200, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 232, -1, -1, -1, + -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, + -1, -1, -1, -1, -1, 251, 252, 253, 254, 255, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, -1, -1, 200, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 232, -1, -1, -1, -1, 3, 4, 5, 6, 7, + 8, 9, 10, -1, -1, -1, -1, -1, -1, 251, + 252, 253, 254, 255, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + -1, -1, 200, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 232, -1, -1, -1, -1, 3, + 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, + -1, -1, -1, 251, 252, 253, 254, 255, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, -1, -1, 200, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 6, 7, 8, 9, + 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 251, 252, 253, + 254, 255, 52, 53, 54, 55, 56, 57, -1, -1, + -1, -1, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, + 200, 201, 202, 203, 204, 205, -1, -1, 208, 209, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, + -1, 231, 232, 6, 7, 8, 9, 10, 238, 239, + 240, 241, -1, -1, -1, -1, -1, -1, -1, -1, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, + 53, 54, 55, 56, 57, -1, -1, -1, -1, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, + 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 227, -1, -1, 230, 6, 7, + 8, 9, 10, -1, -1, 238, 239, 240, 241, -1, + -1, -1, -1, -1, -1, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, + -1, -1, -1, -1, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + -1, 199, 200, 201, 202, 203, 204, 205, -1, -1, + 208, 209, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, + -1, -1, -1, 231, 6, 7, 8, 9, 10, -1, + 238, 239, 240, 241, -1, -1, -1, -1, -1, -1, + -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, + 202, 203, 204, 205, -1, -1, 208, 209, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 227, -1, -1, 230, 6, + 7, 8, 9, 10, -1, -1, 238, 239, 240, 241, + -1, -1, -1, -1, -1, -1, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, + 57, -1, -1, -1, -1, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, + -1, 208, 209, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 227, 6, 7, 8, 9, 10, -1, -1, -1, -1, + 237, 238, 239, 240, 241, -1, -1, -1, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 52, 53, 54, + 55, 56, 57, -1, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, + 205, -1, -1, 208, 209, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 227, 6, 7, 8, 9, 10, -1, -1, + -1, -1, -1, 238, 239, 240, 241, -1, -1, -1, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, + 53, 54, 55, 56, 57, -1, -1, -1, -1, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, + 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 227, 6, 7, 8, 9, 10, + -1, -1, -1, -1, -1, 238, 239, 240, 241, -1, + -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 52, 53, 54, 55, 56, 57, -1, -1, -1, + -1, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, -1, -1, 200 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 3, 4, 5, 6, 7, 8, 9, 10, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 200, 251, 252, 253, 254, + 255, 256, 291, 292, 295, 296, 297, 298, 302, 303, + 304, 305, 306, 307, 310, 311, 312, 313, 315, 317, + 318, 319, 356, 357, 358, 227, 227, 199, 231, 318, + 199, 237, 237, 359, 228, 234, 299, 300, 301, 311, + 315, 234, 237, 199, 199, 237, 312, 315, 229, 316, + 0, 357, 200, 314, 46, 199, 308, 309, 231, 321, + 315, 237, 316, 231, 338, 300, 299, 301, 199, 199, + 227, 236, 316, 231, 234, 237, 294, 199, 201, 202, + 203, 204, 205, 208, 209, 227, 230, 238, 239, 240, + 241, 261, 262, 263, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 315, 229, 228, 234, 236, + 228, 234, 320, 311, 315, 322, 323, 237, 237, 11, + 12, 13, 15, 16, 17, 18, 19, 20, 21, 198, + 231, 232, 237, 272, 285, 287, 289, 291, 295, 315, + 328, 329, 330, 331, 339, 340, 341, 344, 347, 348, + 355, 316, 236, 316, 231, 287, 326, 236, 293, 199, + 234, 237, 272, 272, 289, 208, 209, 229, 233, 228, + 228, 234, 197, 287, 227, 272, 242, 243, 244, 239, + 241, 206, 207, 210, 211, 245, 246, 212, 213, 249, + 248, 247, 214, 216, 215, 250, 230, 230, 285, 200, + 285, 290, 309, 322, 315, 199, 324, 325, 232, 323, + 237, 237, 350, 227, 227, 237, 237, 289, 227, 289, + 235, 227, 232, 332, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 236, 288, 234, 237, 232, 329, + 326, 236, 326, 327, 326, 322, 199, 228, 264, 289, + 199, 287, 272, 272, 272, 274, 274, 275, 275, 276, + 276, 276, 276, 277, 277, 278, 279, 280, 281, 282, + 283, 286, 230, 232, 324, 316, 234, 237, 329, 351, + 289, 237, 289, 235, 349, 339, 287, 287, 326, 232, + 234, 232, 230, 289, 237, 325, 198, 328, 340, 352, + 228, 228, 289, 304, 311, 343, 333, 232, 326, 235, + 227, 343, 353, 354, 335, 336, 337, 342, 345, 199, + 228, 232, 287, 289, 237, 228, 14, 331, 330, 231, + 236, 330, 334, 338, 228, 289, 334, 335, 339, 346, + 326, 237, 232 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (pParseContext, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval, parseContext) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, pParseContext); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + glslang::TParseContext* pParseContext; +#endif +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + if (!yyvaluep) + return; + YYUSE (pParseContext); +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, pParseContext) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + glslang::TParseContext* pParseContext; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) +#else +static void +yy_reduce_print (yyvsp, yyrule, pParseContext) + YYSTYPE *yyvsp; + int yyrule; + glslang::TParseContext* pParseContext; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , pParseContext); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule, pParseContext); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, pParseContext) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + glslang::TParseContext* pParseContext; +#endif +{ + YYUSE (yyvaluep); + YYUSE (pParseContext); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (glslang::TParseContext* pParseContext) +#else +int +yyparse (pParseContext) + glslang::TParseContext* pParseContext; +#endif +#endif +{ +/* The lookahead symbol. */ +int yychar; + + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +static YYSTYPE yyval_default; +# define YY_INITIAL_VALUE(Value) = Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +/* Line 1792 of yacc.c */ +#line 244 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[(1) - (1)].lex).loc, (yyvsp[(1) - (1)].lex).symbol, (yyvsp[(1) - (1)].lex).string); + } + break; + + case 3: +/* Line 1792 of yacc.c */ +#line 250 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 4: +/* Line 1792 of yacc.c */ +#line 253 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).i, (yyvsp[(1) - (1)].lex).loc, true); + } + break; + + case 5: +/* Line 1792 of yacc.c */ +#line 256 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).u, (yyvsp[(1) - (1)].lex).loc, true); + } + break; + + case 6: +/* Line 1792 of yacc.c */ +#line 260 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtFloat, (yyvsp[(1) - (1)].lex).loc, true); + } + break; + + case 7: +/* Line 1792 of yacc.c */ +#line 263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtDouble, (yyvsp[(1) - (1)].lex).loc, true); + } + break; + + case 8: +/* Line 1792 of yacc.c */ +#line 267 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).b, (yyvsp[(1) - (1)].lex).loc, true); + } + break; + + case 9: +/* Line 1792 of yacc.c */ +#line 270 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } + break; + + case 10: +/* Line 1792 of yacc.c */ +#line 278 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 11: +/* Line 1792 of yacc.c */ +#line 281 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode)); + } + break; + + case 12: +/* Line 1792 of yacc.c */ +#line 284 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 13: +/* Line 1792 of yacc.c */ +#line 287 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[(3) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode), *(yyvsp[(3) - (3)].lex).string); + } + break; + + case 14: +/* Line 1792 of yacc.c */ +#line 290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[(1) - (2)].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[(2) - (2)].lex).loc, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(2) - (2)].lex).loc, "++", EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode)); + } + break; + + case 15: +/* Line 1792 of yacc.c */ +#line 295 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[(1) - (2)].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[(2) - (2)].lex).loc, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(2) - (2)].lex).loc, "--", EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode)); + } + break; + + case 16: +/* Line 1792 of yacc.c */ +#line 303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.integerCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 17: +/* Line 1792 of yacc.c */ +#line 310 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[(1) - (1)].interm).loc, (yyvsp[(1) - (1)].interm).function, (yyvsp[(1) - (1)].interm).intermNode); + delete (yyvsp[(1) - (1)].interm).function; + } + break; + + case 18: +/* Line 1792 of yacc.c */ +#line 317 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (1)].interm); + } + break; + + case 19: +/* Line 1792 of yacc.c */ +#line 323 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (2)].interm); + (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + } + break; + + case 20: +/* Line 1792 of yacc.c */ +#line 327 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (2)].interm); + (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + } + break; + + case 21: +/* Line 1792 of yacc.c */ +#line 334 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (2)].interm); + } + break; + + case 22: +/* Line 1792 of yacc.c */ +#line 337 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (1)].interm); + } + break; + + case 23: +/* Line 1792 of yacc.c */ +#line 343 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()); + (yyvsp[(1) - (2)].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[(1) - (2)].interm).function; + (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode); + } + break; + + case 24: +/* Line 1792 of yacc.c */ +#line 350 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()); + (yyvsp[(1) - (3)].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[(1) - (3)].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 25: +/* Line 1792 of yacc.c */ +#line 360 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (2)].interm); + } + break; + + case 26: +/* Line 1792 of yacc.c */ +#line 368 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type)); + } + break; + + case 27: +/* Line 1792 of yacc.c */ +#line 373 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // + // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // + (yyval.interm).function = 0; + (yyval.interm).intermNode = 0; + + TIntermMethod* method = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsMethodNode(); + if (method) { + (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); + (yyval.interm).intermNode = method->getObject(); + } else { + TIntermSymbol* symbol = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsSymbolNode(); + if (symbol) { + parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); + TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); + (yyval.interm).function = function; + } else + parseContext.error((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + } + + if ((yyval.interm).function == 0) { + // error recover + TString empty(""); + (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); + } + } + break; + + case 28: +/* Line 1792 of yacc.c */ +#line 403 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.variableCheck((yyvsp[(1) - (1)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); + } + break; + + case 29: +/* Line 1792 of yacc.c */ +#line 409 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.lValueErrorCheck((yyvsp[(1) - (2)].lex).loc, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].lex).loc, "++", EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode)); + } + break; + + case 30: +/* Line 1792 of yacc.c */ +#line 413 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.lValueErrorCheck((yyvsp[(1) - (2)].lex).loc, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].lex).loc, "--", EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode)); + } + break; + + case 31: +/* Line 1792 of yacc.c */ +#line 417 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (2)].interm).op != EOpNull) { + char errorOp[2] = {0, 0}; + switch((yyvsp[(1) - (2)].interm).op) { + case EOpNegative: errorOp[0] = '-'; break; + case EOpLogicalNot: errorOp[0] = '!'; break; + case EOpBitwiseNot: errorOp[0] = '~'; break; + default: break; // some compilers want this + } + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].interm).loc, errorOp, (yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode)); + } else { + (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } + } + break; + + case 32: +/* Line 1792 of yacc.c */ +#line 437 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNull; } + break; + + case 33: +/* Line 1792 of yacc.c */ +#line 438 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNegative; } + break; + + case 34: +/* Line 1792 of yacc.c */ +#line 439 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLogicalNot; } + break; + + case 35: +/* Line 1792 of yacc.c */ +#line 440 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise not"); } + break; + + case 36: +/* Line 1792 of yacc.c */ +#line 446 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 37: +/* Line 1792 of yacc.c */ +#line 447 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "*", EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 38: +/* Line 1792 of yacc.c */ +#line 452 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "/", EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 39: +/* Line 1792 of yacc.c */ +#line 457 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "%", EOpMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 40: +/* Line 1792 of yacc.c */ +#line 466 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 41: +/* Line 1792 of yacc.c */ +#line 467 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "+", EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 42: +/* Line 1792 of yacc.c */ +#line 472 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "-", EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 43: +/* Line 1792 of yacc.c */ +#line 480 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 44: +/* Line 1792 of yacc.c */ +#line 481 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<<", EOpLeftShift, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 45: +/* Line 1792 of yacc.c */ +#line 487 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">>", EOpRightShift, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 46: +/* Line 1792 of yacc.c */ +#line 496 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 47: +/* Line 1792 of yacc.c */ +#line 497 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<", EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 48: +/* Line 1792 of yacc.c */ +#line 502 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">", EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 49: +/* Line 1792 of yacc.c */ +#line 507 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<=", EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 50: +/* Line 1792 of yacc.c */ +#line 512 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 51: +/* Line 1792 of yacc.c */ +#line 520 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 52: +/* Line 1792 of yacc.c */ +#line 521 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "==", EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 53: +/* Line 1792 of yacc.c */ +#line 529 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "!=", EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 54: +/* Line 1792 of yacc.c */ +#line 540 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 55: +/* Line 1792 of yacc.c */ +#line 541 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "&", EOpAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 56: +/* Line 1792 of yacc.c */ +#line 550 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 57: +/* Line 1792 of yacc.c */ +#line 551 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "^", EOpExclusiveOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 58: +/* Line 1792 of yacc.c */ +#line 560 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 59: +/* Line 1792 of yacc.c */ +#line 561 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "|", EOpInclusiveOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + break; + + case 60: +/* Line 1792 of yacc.c */ +#line 570 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 61: +/* Line 1792 of yacc.c */ +#line 571 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "&&", EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 62: +/* Line 1792 of yacc.c */ +#line 579 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 63: +/* Line 1792 of yacc.c */ +#line 580 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "^^", EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 64: +/* Line 1792 of yacc.c */ +#line 588 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 65: +/* Line 1792 of yacc.c */ +#line 589 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "||", EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + } + break; + + case 66: +/* Line 1792 of yacc.c */ +#line 597 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 67: +/* Line 1792 of yacc.c */ +#line 598 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + ++parseContext.controlFlowNestingLevel; + } + break; + + case 68: +/* Line 1792 of yacc.c */ +#line 601 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[(2) - (6)].lex).loc, (yyvsp[(1) - (6)].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[(2) - (6)].lex).loc, "?", (yyvsp[(1) - (6)].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[(5) - (6)].lex).loc, ":", (yyvsp[(4) - (6)].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[(5) - (6)].lex).loc, ":", (yyvsp[(6) - (6)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[(1) - (6)].interm.intermTypedNode), (yyvsp[(4) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermTypedNode), (yyvsp[(2) - (6)].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[(2) - (6)].lex).loc, ":", (yyvsp[(4) - (6)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(6) - (6)].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[(6) - (6)].interm.intermTypedNode); + } + } + break; + + case 69: +/* Line 1792 of yacc.c */ +#line 616 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } + break; + + case 70: +/* Line 1792 of yacc.c */ +#line 617 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.arrayObjectCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + } + } + break; + + case 71: +/* Line 1792 of yacc.c */ +#line 632 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpAssign; + } + break; + + case 72: +/* Line 1792 of yacc.c */ +#line 636 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpMulAssign; + } + break; + + case 73: +/* Line 1792 of yacc.c */ +#line 640 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpDivAssign; + } + break; + + case 74: +/* Line 1792 of yacc.c */ +#line 644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpModAssign; + } + break; + + case 75: +/* Line 1792 of yacc.c */ +#line 649 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpAddAssign; + } + break; + + case 76: +/* Line 1792 of yacc.c */ +#line 653 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm).op = EOpSubAssign; + } + break; + + case 77: +/* Line 1792 of yacc.c */ +#line 657 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + } + break; + + case 78: +/* Line 1792 of yacc.c */ +#line 661 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + } + break; + + case 79: +/* Line 1792 of yacc.c */ +#line 665 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpAndAssign; + } + break; + + case 80: +/* Line 1792 of yacc.c */ +#line 669 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + } + break; + + case 81: +/* Line 1792 of yacc.c */ +#line 673 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + } + break; + + case 82: +/* Line 1792 of yacc.c */ +#line 680 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 83: +/* Line 1792 of yacc.c */ +#line 683 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[(2) - (3)].lex).loc, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode); + } + } + break; + + case 84: +/* Line 1792 of yacc.c */ +#line 693 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.constantValueCheck((yyvsp[(1) - (1)].interm.intermTypedNode), ""); + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 85: +/* Line 1792 of yacc.c */ +#line 700 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.handleFunctionDeclarator((yyvsp[(1) - (2)].interm).loc, *(yyvsp[(1) - (2)].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } + break; + + case 86: +/* Line 1792 of yacc.c */ +#line 705 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (2)].interm).intermNode && (yyvsp[(1) - (2)].interm).intermNode->getAsAggregate()) + (yyvsp[(1) - (2)].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermNode; + } + break; + + case 87: +/* Line 1792 of yacc.c */ +#line 710 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (4)].lex).loc, ENoProfile, 130, 0, "precision statement"); + + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision((yyvsp[(1) - (4)].lex).loc, (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.type).qualifier.precision); + (yyval.interm.intermNode) = 0; + } + break; + + case 88: +/* Line 1792 of yacc.c */ +#line 718 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.declareBlock((yyvsp[(1) - (2)].interm).loc, *(yyvsp[(1) - (2)].interm).typeList); + (yyval.interm.intermNode) = 0; + } + break; + + case 89: +/* Line 1792 of yacc.c */ +#line 722 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.declareBlock((yyvsp[(1) - (3)].interm).loc, *(yyvsp[(1) - (3)].interm).typeList, (yyvsp[(2) - (3)].lex).string); + (yyval.interm.intermNode) = 0; + } + break; + + case 90: +/* Line 1792 of yacc.c */ +#line 726 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.declareBlock((yyvsp[(1) - (4)].interm).loc, *(yyvsp[(1) - (4)].interm).typeList, (yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].interm).arraySizes); + (yyval.interm.intermNode) = 0; + } + break; + + case 91: +/* Line 1792 of yacc.c */ +#line 730 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type)); + (yyval.interm.intermNode) = 0; + } + break; + + case 92: +/* Line 1792 of yacc.c */ +#line 735 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.checkNoShaderLayouts((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).qualifier, *(yyvsp[(2) - (3)].lex).string); + (yyval.interm.intermNode) = 0; + } + break; + + case 93: +/* Line 1792 of yacc.c */ +#line 740 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.checkNoShaderLayouts((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).shaderQualifiers); + (yyvsp[(3) - (4)].interm.identifierList)->push_back((yyvsp[(2) - (4)].lex).string); + parseContext.addQualifierToExisting((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).qualifier, *(yyvsp[(3) - (4)].interm.identifierList)); + (yyval.interm.intermNode) = 0; + } + break; + + case 94: +/* Line 1792 of yacc.c */ +#line 749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { parseContext.nestedBlockCheck((yyvsp[(1) - (3)].interm.type).loc); } + break; + + case 95: +/* Line 1792 of yacc.c */ +#line 749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + --parseContext.structNestingLevel; + parseContext.blockName = (yyvsp[(2) - (6)].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[(1) - (6)].interm.type).loc, (yyvsp[(1) - (6)].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[(1) - (6)].interm.type).loc, (yyvsp[(1) - (6)].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[(1) - (6)].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[(1) - (6)].interm.type).loc; + (yyval.interm).typeList = (yyvsp[(5) - (6)].interm.typeList); + } + break; + + case 96: +/* Line 1792 of yacc.c */ +#line 760 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[(2) - (2)].lex).string); + } + break; + + case 97: +/* Line 1792 of yacc.c */ +#line 764 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.identifierList) = (yyvsp[(1) - (3)].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[(3) - (3)].lex).string); + } + break; + + case 98: +/* Line 1792 of yacc.c */ +#line 771 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); + (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + } + break; + + case 99: +/* Line 1792 of yacc.c */ +#line 778 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + } + break; + + case 100: +/* Line 1792 of yacc.c */ +#line 781 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + } + break; + + case 101: +/* Line 1792 of yacc.c */ +#line 788 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // Add the parameter + (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); + if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid) + (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param); + else + delete (yyvsp[(2) - (2)].interm).param.type; + } + break; + + case 102: +/* Line 1792 of yacc.c */ +#line 796 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator + // + if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext.error((yyvsp[(2) - (3)].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[(3) - (3)].interm).param.type; + } else { + // Add the parameter + (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function); + (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param); + } + } + break; + + case 103: +/* Line 1792 of yacc.c */ +#line 816 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (3)].interm.type).qualifier.storage != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[(2) - (3)].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[(1) - (3)].interm.type).qualifier.storage), ""); + } + if ((yyvsp[(1) - (3)].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); + + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[(1) - (3)].interm.type)); + function = new TFunction((yyvsp[(2) - (3)].lex).string, type); + (yyval.interm.function) = function; + } + break; + + case 104: +/* Line 1792 of yacc.c */ +#line 834 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (2)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(1) - (2)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(1) - (2)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[(1) - (2)].interm.type).loc, *(yyvsp[(1) - (2)].interm.type).arraySizes); + } + if ((yyvsp[(1) - (2)].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[(2) - (2)].lex).loc, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[(2) - (2)].lex).loc, *(yyvsp[(2) - (2)].lex).string); + + TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))}; + (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm).param = param; + } + break; + + case 105: +/* Line 1792 of yacc.c */ +#line 849 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (3)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); + } + parseContext.arrayDimCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.type).arraySizes, (yyvsp[(3) - (3)].interm).arraySizes); + + parseContext.arraySizeRequiredCheck((yyvsp[(3) - (3)].interm).loc, *(yyvsp[(3) - (3)].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[(2) - (3)].lex).loc, *(yyvsp[(2) - (3)].lex).string); + + (yyvsp[(1) - (3)].interm.type).arraySizes = (yyvsp[(3) - (3)].interm).arraySizes; + + TParameter param = { (yyvsp[(2) - (3)].lex).string, new TType((yyvsp[(1) - (3)].interm.type))}; + (yyval.interm).loc = (yyvsp[(2) - (3)].lex).loc; + (yyval.interm).param = param; + } + break; + + case 106: +/* Line 1792 of yacc.c */ +#line 872 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(2) - (2)].interm); + if ((yyvsp[(1) - (2)].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[(1) - (2)].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(1) - (2)].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, *(yyval.interm).param.type); + + } + break; + + case 107: +/* Line 1792 of yacc.c */ +#line 883 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (1)].interm); + + parseContext.parameterTypeCheck((yyvsp[(1) - (1)].interm).loc, EvqIn, *(yyvsp[(1) - (1)].interm).param.type); + parseContext.paramCheckFix((yyvsp[(1) - (1)].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + } + break; + + case 108: +/* Line 1792 of yacc.c */ +#line 893 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(2) - (2)].interm); + if ((yyvsp[(1) - (2)].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[(1) - (2)].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[(1) - (2)].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(1) - (2)].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, *(yyval.interm).param.type); + } + break; + + case 109: +/* Line 1792 of yacc.c */ +#line 903 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (1)].interm); + + parseContext.parameterTypeCheck((yyvsp[(1) - (1)].interm).loc, EvqIn, *(yyvsp[(1) - (1)].interm).param.type); + parseContext.paramCheckFix((yyvsp[(1) - (1)].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + } + break; + + case 110: +/* Line 1792 of yacc.c */ +#line 913 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) }; + (yyval.interm).param = param; + if ((yyvsp[(1) - (1)].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[(1) - (1)].interm.type).loc, *(yyvsp[(1) - (1)].interm.type).arraySizes); + } + break; + + case 111: +/* Line 1792 of yacc.c */ +#line 922 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (1)].interm); + } + break; + + case 112: +/* Line 1792 of yacc.c */ +#line 925 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (3)].interm); + parseContext.declareVariable((yyvsp[(3) - (3)].lex).loc, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm).type); + } + break; + + case 113: +/* Line 1792 of yacc.c */ +#line 929 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (4)].interm); + parseContext.declareVariable((yyvsp[(3) - (4)].lex).loc, *(yyvsp[(3) - (4)].lex).string, (yyvsp[(1) - (4)].interm).type, (yyvsp[(4) - (4)].interm).arraySizes); + } + break; + + case 114: +/* Line 1792 of yacc.c */ +#line 933 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (6)].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[(3) - (6)].lex).loc, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, (yyvsp[(4) - (6)].interm).arraySizes, (yyvsp[(6) - (6)].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, initNode, (yyvsp[(5) - (6)].lex).loc); + } + break; + + case 115: +/* Line 1792 of yacc.c */ +#line 938 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (5)].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[(3) - (5)].lex).loc, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, 0, (yyvsp[(5) - (5)].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, initNode, (yyvsp[(4) - (5)].lex).loc); + } + break; + + case 116: +/* Line 1792 of yacc.c */ +#line 946 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + } + break; + + case 117: +/* Line 1792 of yacc.c */ +#line 951 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (2)].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[(2) - (2)].lex).loc, *(yyvsp[(2) - (2)].lex).string, (yyvsp[(1) - (2)].interm.type)); + } + break; + + case 118: +/* Line 1792 of yacc.c */ +#line 956 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (3)].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[(2) - (3)].lex).loc, *(yyvsp[(2) - (3)].lex).string, (yyvsp[(1) - (3)].interm.type), (yyvsp[(3) - (3)].interm).arraySizes); + } + break; + + case 119: +/* Line 1792 of yacc.c */ +#line 961 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (5)].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (5)].lex).loc, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), (yyvsp[(3) - (5)].interm).arraySizes, (yyvsp[(5) - (5)].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[(4) - (5)].lex).loc); + } + break; + + case 120: +/* Line 1792 of yacc.c */ +#line 966 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (4)].lex).loc, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), 0, (yyvsp[(4) - (4)].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[(3) - (4)].lex).loc); + } + break; + + case 121: +/* Line 1792 of yacc.c */ +#line 975 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + + parseContext.globalQualifierTypeCheck((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[(1) - (1)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(1) - (1)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(1) - (1)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); + } + break; + + case 122: +/* Line 1792 of yacc.c */ +#line 986 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier); + parseContext.globalQualifierTypeCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type)); + + if ((yyvsp[(2) - (2)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(2) - (2)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(2) - (2)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + if ((yyvsp[(2) - (2)].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier)) + (yyvsp[(2) - (2)].interm.type).arraySizes = 0; + + parseContext.checkNoShaderLayouts((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); + (yyvsp[(2) - (2)].interm.type).shaderQualifiers.merge((yyvsp[(1) - (2)].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(2) - (2)].interm.type).basicType, (yyvsp[(2) - (2)].interm.type).qualifier); + + (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); + + if (! (yyval.interm.type).qualifier.isInterpolation() && + ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) + (yyval.interm.type).qualifier.smooth = true; + } + break; + + case 123: +/* Line 1792 of yacc.c */ +#line 1013 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.invariant = true; + } + break; + + case 124: +/* Line 1792 of yacc.c */ +#line 1022 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.smooth = true; + } + break; + + case 125: +/* Line 1792 of yacc.c */ +#line 1029 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.flat = true; + } + break; + + case 126: +/* Line 1792 of yacc.c */ +#line 1036 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "noperspective"); + parseContext.requireProfile((yyvsp[(1) - (1)].lex).loc, ~EEsProfile, "noperspective"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; + } + break; + + case 127: +/* Line 1792 of yacc.c */ +#line 1046 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(3) - (4)].interm.type); + } + break; + + case 128: +/* Line 1792 of yacc.c */ +#line 1052 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 129: +/* Line 1792 of yacc.c */ +#line 1055 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (3)].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[(3) - (3)].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[(3) - (3)].interm.type).qualifier, false); + } + break; + + case 130: +/* Line 1792 of yacc.c */ +#line 1062 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + parseContext.setLayoutQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type), *(yyvsp[(1) - (1)].lex).string); + } + break; + + case 131: +/* Line 1792 of yacc.c */ +#line 1066 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (3)].lex).loc); + parseContext.setLayoutQualifier((yyvsp[(1) - (3)].lex).loc, (yyval.interm.type), *(yyvsp[(1) - (3)].lex).string, (yyvsp[(3) - (3)].interm.intermTypedNode)); + } + break; + + case 132: +/* Line 1792 of yacc.c */ +#line 1070 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type), strShared); + } + break; + + case 133: +/* Line 1792 of yacc.c */ +#line 1078 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + } + break; + + case 134: +/* Line 1792 of yacc.c */ +#line 1084 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 135: +/* Line 1792 of yacc.c */ +#line 1087 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (2)].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[(2) - (2)].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[(2) - (2)].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).qualifier, false); + } + break; + + case 136: +/* Line 1792 of yacc.c */ +#line 1098 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 137: +/* Line 1792 of yacc.c */ +#line 1101 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 138: +/* Line 1792 of yacc.c */ +#line 1104 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 139: +/* Line 1792 of yacc.c */ +#line 1107 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 140: +/* Line 1792 of yacc.c */ +#line 1111 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 141: +/* Line 1792 of yacc.c */ +#line 1115 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + } + break; + + case 142: +/* Line 1792 of yacc.c */ +#line 1122 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } + break; + + case 143: +/* Line 1792 of yacc.c */ +#line 1126 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, "attribute"); + + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } + break; + + case 144: +/* Line 1792 of yacc.c */ +#line 1138 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + if (parseContext.language == EShLangVertex) + (yyval.interm.type).qualifier.storage = EvqVaryingOut; + else + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } + break; + + case 145: +/* Line 1792 of yacc.c */ +#line 1152 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; + } + break; + + case 146: +/* Line 1792 of yacc.c */ +#line 1157 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqIn; + } + break; + + case 147: +/* Line 1792 of yacc.c */ +#line 1163 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqOut; + } + break; + + case 148: +/* Line 1792 of yacc.c */ +#line 1169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.centroid = true; + } + break; + + case 149: +/* Line 1792 of yacc.c */ +#line 1176 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "patch"); + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.patch = true; + } + break; + + case 150: +/* Line 1792 of yacc.c */ +#line 1182 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.sample = true; + } + break; + + case 151: +/* Line 1792 of yacc.c */ +#line 1187 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; + } + break; + + case 152: +/* Line 1792 of yacc.c */ +#line 1192 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; + } + break; + + case 153: +/* Line 1792 of yacc.c */ +#line 1197 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ECoreProfile | ECompatibilityProfile, 430, 0, "shared"); + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangCompute, "shared"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; + } + break; + + case 154: +/* Line 1792 of yacc.c */ +#line 1204 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.coherent = true; + } + break; + + case 155: +/* Line 1792 of yacc.c */ +#line 1208 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.volatil = true; + } + break; + + case 156: +/* Line 1792 of yacc.c */ +#line 1212 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.restrict = true; + } + break; + + case 157: +/* Line 1792 of yacc.c */ +#line 1216 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.readonly = true; + } + break; + + case 158: +/* Line 1792 of yacc.c */ +#line 1220 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; + } + break; + + case 159: +/* Line 1792 of yacc.c */ +#line 1224 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.spvRemoved((yyvsp[(1) - (1)].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; + } + break; + + case 160: +/* Line 1792 of yacc.c */ +#line 1230 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.spvRemoved((yyvsp[(1) - (4)].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[(1) - (4)].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[(1) - (4)].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; + // TODO: 4.0 semantics: subroutines + // 1) make sure each identifier is a type declared earlier with SUBROUTINE + // 2) save all of the identifiers for future comparison with the declared function + } + break; + + case 161: +/* Line 1792 of yacc.c */ +#line 1242 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // TODO: 4.0 functionality: subroutine type to list + } + break; + + case 162: +/* Line 1792 of yacc.c */ +#line 1245 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + } + break; + + case 163: +/* Line 1792 of yacc.c */ +#line 1250 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + } + break; + + case 164: +/* Line 1792 of yacc.c */ +#line 1254 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.arrayDimCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(2) - (2)].interm).arraySizes, 0); + (yyval.interm.type) = (yyvsp[(1) - (2)].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).arraySizes = (yyvsp[(2) - (2)].interm).arraySizes; + } + break; + + case 165: +/* Line 1792 of yacc.c */ +#line 1263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (2)].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + (yyval.interm).arraySizes->addInnerSize(); + } + break; + + case 166: +/* Line 1792 of yacc.c */ +#line 1268 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm).loc = (yyvsp[(1) - (3)].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[(2) - (3)].interm.intermTypedNode)->getLoc(), (yyvsp[(2) - (3)].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); + } + break; + + case 167: +/* Line 1792 of yacc.c */ +#line 1276 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (3)].interm); + (yyval.interm).arraySizes->addInnerSize(); + } + break; + + case 168: +/* Line 1792 of yacc.c */ +#line 1280 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm) = (yyvsp[(1) - (4)].interm); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLoc(), (yyvsp[(3) - (4)].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); + } + break; + + case 169: +/* Line 1792 of yacc.c */ +#line 1290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; + } + break; + + case 170: +/* Line 1792 of yacc.c */ +#line 1294 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + } + break; + + case 171: +/* Line 1792 of yacc.c */ +#line 1298 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + } + break; + + case 172: +/* Line 1792 of yacc.c */ +#line 1303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + } + break; + + case 173: +/* Line 1792 of yacc.c */ +#line 1307 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + } + break; + + case 174: +/* Line 1792 of yacc.c */ +#line 1312 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + } + break; + + case 175: +/* Line 1792 of yacc.c */ +#line 1316 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } + break; + + case 176: +/* Line 1792 of yacc.c */ +#line 1321 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } + break; + + case 177: +/* Line 1792 of yacc.c */ +#line 1326 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); + } + break; + + case 178: +/* Line 1792 of yacc.c */ +#line 1331 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); + } + break; + + case 179: +/* Line 1792 of yacc.c */ +#line 1337 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } + break; + + case 180: +/* Line 1792 of yacc.c */ +#line 1343 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } + break; + + case 181: +/* Line 1792 of yacc.c */ +#line 1349 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); + } + break; + + case 182: +/* Line 1792 of yacc.c */ +#line 1354 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); + } + break; + + case 183: +/* Line 1792 of yacc.c */ +#line 1359 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); + } + break; + + case 184: +/* Line 1792 of yacc.c */ +#line 1364 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } + break; + + case 185: +/* Line 1792 of yacc.c */ +#line 1369 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } + break; + + case 186: +/* Line 1792 of yacc.c */ +#line 1374 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); + } + break; + + case 187: +/* Line 1792 of yacc.c */ +#line 1379 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); + } + break; + + case 188: +/* Line 1792 of yacc.c */ +#line 1385 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } + break; + + case 189: +/* Line 1792 of yacc.c */ +#line 1391 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); + } + break; + + case 190: +/* Line 1792 of yacc.c */ +#line 1397 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } + break; + + case 191: +/* Line 1792 of yacc.c */ +#line 1402 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } + break; + + case 192: +/* Line 1792 of yacc.c */ +#line 1407 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } + break; + + case 193: +/* Line 1792 of yacc.c */ +#line 1412 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } + break; + + case 194: +/* Line 1792 of yacc.c */ +#line 1417 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); + } + break; + + case 195: +/* Line 1792 of yacc.c */ +#line 1422 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } + break; + + case 196: +/* Line 1792 of yacc.c */ +#line 1427 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); + } + break; + + case 197: +/* Line 1792 of yacc.c */ +#line 1432 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } + break; + + case 198: +/* Line 1792 of yacc.c */ +#line 1437 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); + } + break; + + case 199: +/* Line 1792 of yacc.c */ +#line 1442 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); + } + break; + + case 200: +/* Line 1792 of yacc.c */ +#line 1447 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); + } + break; + + case 201: +/* Line 1792 of yacc.c */ +#line 1452 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } + break; + + case 202: +/* Line 1792 of yacc.c */ +#line 1457 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } + break; + + case 203: +/* Line 1792 of yacc.c */ +#line 1463 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } + break; + + case 204: +/* Line 1792 of yacc.c */ +#line 1469 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } + break; + + case 205: +/* Line 1792 of yacc.c */ +#line 1475 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } + break; + + case 206: +/* Line 1792 of yacc.c */ +#line 1481 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); + } + break; + + case 207: +/* Line 1792 of yacc.c */ +#line 1487 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); + } + break; + + case 208: +/* Line 1792 of yacc.c */ +#line 1493 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); + } + break; + + case 209: +/* Line 1792 of yacc.c */ +#line 1499 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } + break; + + case 210: +/* Line 1792 of yacc.c */ +#line 1505 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); + } + break; + + case 211: +/* Line 1792 of yacc.c */ +#line 1511 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); + } + break; + + case 212: +/* Line 1792 of yacc.c */ +#line 1517 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); + } + break; + + case 213: +/* Line 1792 of yacc.c */ +#line 1523 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } + break; + + case 214: +/* Line 1792 of yacc.c */ +#line 1529 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.vulkanRemoved((yyvsp[(1) - (1)].lex).loc, "atomic counter types"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAtomicUint; + } + break; + + case 215: +/* Line 1792 of yacc.c */ +#line 1534 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + } + break; + + case 216: +/* Line 1792 of yacc.c */ +#line 1539 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + } + break; + + case 217: +/* Line 1792 of yacc.c */ +#line 1544 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + } + break; + + case 218: +/* Line 1792 of yacc.c */ +#line 1549 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + } + break; + + case 219: +/* Line 1792 of yacc.c */ +#line 1554 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + } + break; + + case 220: +/* Line 1792 of yacc.c */ +#line 1559 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + } + break; + + case 221: +/* Line 1792 of yacc.c */ +#line 1564 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + } + break; + + case 222: +/* Line 1792 of yacc.c */ +#line 1569 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + } + break; + + case 223: +/* Line 1792 of yacc.c */ +#line 1574 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + } + break; + + case 224: +/* Line 1792 of yacc.c */ +#line 1579 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + } + break; + + case 225: +/* Line 1792 of yacc.c */ +#line 1584 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + } + break; + + case 226: +/* Line 1792 of yacc.c */ +#line 1589 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + } + break; + + case 227: +/* Line 1792 of yacc.c */ +#line 1594 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + } + break; + + case 228: +/* Line 1792 of yacc.c */ +#line 1599 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D); + } + break; + + case 229: +/* Line 1792 of yacc.c */ +#line 1604 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D); + } + break; + + case 230: +/* Line 1792 of yacc.c */ +#line 1609 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd3D); + } + break; + + case 231: +/* Line 1792 of yacc.c */ +#line 1614 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube); + } + break; + + case 232: +/* Line 1792 of yacc.c */ +#line 1619 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + } + break; + + case 233: +/* Line 1792 of yacc.c */ +#line 1624 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + } + break; + + case 234: +/* Line 1792 of yacc.c */ +#line 1629 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + } + break; + + case 235: +/* Line 1792 of yacc.c */ +#line 1634 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D); + } + break; + + case 236: +/* Line 1792 of yacc.c */ +#line 1639 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D); + } + break; + + case 237: +/* Line 1792 of yacc.c */ +#line 1644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd3D); + } + break; + + case 238: +/* Line 1792 of yacc.c */ +#line 1649 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube); + } + break; + + case 239: +/* Line 1792 of yacc.c */ +#line 1654 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + } + break; + + case 240: +/* Line 1792 of yacc.c */ +#line 1659 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + } + break; + + case 241: +/* Line 1792 of yacc.c */ +#line 1664 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + } + break; + + case 242: +/* Line 1792 of yacc.c */ +#line 1669 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + } + break; + + case 243: +/* Line 1792 of yacc.c */ +#line 1674 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + } + break; + + case 244: +/* Line 1792 of yacc.c */ +#line 1679 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdRect); + } + break; + + case 245: +/* Line 1792 of yacc.c */ +#line 1684 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdRect); + } + break; + + case 246: +/* Line 1792 of yacc.c */ +#line 1689 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + } + break; + + case 247: +/* Line 1792 of yacc.c */ +#line 1694 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + } + break; + + case 248: +/* Line 1792 of yacc.c */ +#line 1699 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + } + break; + + case 249: +/* Line 1792 of yacc.c */ +#line 1704 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + } + break; + + case 250: +/* Line 1792 of yacc.c */ +#line 1709 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + } + break; + + case 251: +/* Line 1792 of yacc.c */ +#line 1714 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + } + break; + + case 252: +/* Line 1792 of yacc.c */ +#line 1719 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + } + break; + + case 253: +/* Line 1792 of yacc.c */ +#line 1724 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + } + break; + + case 254: +/* Line 1792 of yacc.c */ +#line 1729 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + } + break; + + case 255: +/* Line 1792 of yacc.c */ +#line 1734 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setPureSampler(false); + } + break; + + case 256: +/* Line 1792 of yacc.c */ +#line 1739 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setPureSampler(true); + } + break; + + case 257: +/* Line 1792 of yacc.c */ +#line 1744 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + } + break; + + case 258: +/* Line 1792 of yacc.c */ +#line 1749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + } + break; + + case 259: +/* Line 1792 of yacc.c */ +#line 1754 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + } + break; + + case 260: +/* Line 1792 of yacc.c */ +#line 1759 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + } + break; + + case 261: +/* Line 1792 of yacc.c */ +#line 1764 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + } + break; + + case 262: +/* Line 1792 of yacc.c */ +#line 1769 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + } + break; + + case 263: +/* Line 1792 of yacc.c */ +#line 1774 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + } + break; + + case 264: +/* Line 1792 of yacc.c */ +#line 1779 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); + } + break; + + case 265: +/* Line 1792 of yacc.c */ +#line 1784 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); + } + break; + + case 266: +/* Line 1792 of yacc.c */ +#line 1789 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); + } + break; + + case 267: +/* Line 1792 of yacc.c */ +#line 1794 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); + } + break; + + case 268: +/* Line 1792 of yacc.c */ +#line 1799 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); + } + break; + + case 269: +/* Line 1792 of yacc.c */ +#line 1804 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); + } + break; + + case 270: +/* Line 1792 of yacc.c */ +#line 1809 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); + } + break; + + case 271: +/* Line 1792 of yacc.c */ +#line 1814 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); + } + break; + + case 272: +/* Line 1792 of yacc.c */ +#line 1819 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); + } + break; + + case 273: +/* Line 1792 of yacc.c */ +#line 1824 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); + } + break; + + case 274: +/* Line 1792 of yacc.c */ +#line 1829 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); + } + break; + + case 275: +/* Line 1792 of yacc.c */ +#line 1834 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); + } + break; + + case 276: +/* Line 1792 of yacc.c */ +#line 1839 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); + } + break; + + case 277: +/* Line 1792 of yacc.c */ +#line 1844 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); + } + break; + + case 278: +/* Line 1792 of yacc.c */ +#line 1849 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); + } + break; + + case 279: +/* Line 1792 of yacc.c */ +#line 1854 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); + } + break; + + case 280: +/* Line 1792 of yacc.c */ +#line 1859 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); + } + break; + + case 281: +/* Line 1792 of yacc.c */ +#line 1864 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); + } + break; + + case 282: +/* Line 1792 of yacc.c */ +#line 1869 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); + } + break; + + case 283: +/* Line 1792 of yacc.c */ +#line 1874 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); + } + break; + + case 284: +/* Line 1792 of yacc.c */ +#line 1879 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); + } + break; + + case 285: +/* Line 1792 of yacc.c */ +#line 1884 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); + } + break; + + case 286: +/* Line 1792 of yacc.c */ +#line 1889 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); + } + break; + + case 287: +/* Line 1792 of yacc.c */ +#line 1894 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); + } + break; + + case 288: +/* Line 1792 of yacc.c */ +#line 1899 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); + } + break; + + case 289: +/* Line 1792 of yacc.c */ +#line 1904 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); + } + break; + + case 290: +/* Line 1792 of yacc.c */ +#line 1909 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); + } + break; + + case 291: +/* Line 1792 of yacc.c */ +#line 1914 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); + } + break; + + case 292: +/* Line 1792 of yacc.c */ +#line 1919 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); + } + break; + + case 293: +/* Line 1792 of yacc.c */ +#line 1924 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); + } + break; + + case 294: +/* Line 1792 of yacc.c */ +#line 1929 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); + } + break; + + case 295: +/* Line 1792 of yacc.c */ +#line 1934 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); + } + break; + + case 296: +/* Line 1792 of yacc.c */ +#line 1939 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); + } + break; + + case 297: +/* Line 1792 of yacc.c */ +#line 1944 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); + } + break; + + case 298: +/* Line 1792 of yacc.c */ +#line 1949 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); + } + break; + + case 299: +/* Line 1792 of yacc.c */ +#line 1954 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); + } + break; + + case 300: +/* Line 1792 of yacc.c */ +#line 1959 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); + } + break; + + case 301: +/* Line 1792 of yacc.c */ +#line 1964 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); + } + break; + + case 302: +/* Line 1792 of yacc.c */ +#line 1969 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); + } + break; + + case 303: +/* Line 1792 of yacc.c */ +#line 1974 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); + } + break; + + case 304: +/* Line 1792 of yacc.c */ +#line 1979 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); + } + break; + + case 305: +/* Line 1792 of yacc.c */ +#line 1984 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); + } + break; + + case 306: +/* Line 1792 of yacc.c */ +#line 1989 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); + } + break; + + case 307: +/* Line 1792 of yacc.c */ +#line 1994 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + } + break; + + case 308: +/* Line 1792 of yacc.c */ +#line 1999 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + } + break; + + case 309: +/* Line 1792 of yacc.c */ +#line 2004 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); + } + break; + + case 310: +/* Line 1792 of yacc.c */ +#line 2009 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); + } + break; + + case 311: +/* Line 1792 of yacc.c */ +#line 2014 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); + } + break; + + case 312: +/* Line 1792 of yacc.c */ +#line 2019 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); + } + break; + + case 313: +/* Line 1792 of yacc.c */ +#line 2024 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + } + break; + + case 314: +/* Line 1792 of yacc.c */ +#line 2029 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + } + break; + + case 315: +/* Line 1792 of yacc.c */ +#line 2034 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + } + break; + + case 316: +/* Line 1792 of yacc.c */ +#line 2039 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + } + break; + + case 317: +/* Line 1792 of yacc.c */ +#line 2044 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + } + break; + + case 318: +/* Line 1792 of yacc.c */ +#line 2049 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + } + break; + + case 319: +/* Line 1792 of yacc.c */ +#line 2054 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + } + break; + + case 320: +/* Line 1792 of yacc.c */ +#line 2059 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + } + break; + + case 321: +/* Line 1792 of yacc.c */ +#line 2064 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + } + break; + + case 322: +/* Line 1792 of yacc.c */ +#line 2069 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + } + break; + + case 323: +/* Line 1792 of yacc.c */ +#line 2074 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { // GL_OES_EGL_image_external + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.external = true; + } + break; + + case 324: +/* Line 1792 of yacc.c */ +#line 2080 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat); + } + break; + + case 325: +/* Line 1792 of yacc.c */ +#line 2086 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat, true); + } + break; + + case 326: +/* Line 1792 of yacc.c */ +#line 2092 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtInt); + } + break; + + case 327: +/* Line 1792 of yacc.c */ +#line 2098 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtInt, true); + } + break; + + case 328: +/* Line 1792 of yacc.c */ +#line 2104 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtUint); + } + break; + + case 329: +/* Line 1792 of yacc.c */ +#line 2110 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtUint, true); + } + break; + + case 330: +/* Line 1792 of yacc.c */ +#line 2116 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); + } + break; + + case 331: +/* Line 1792 of yacc.c */ +#line 2121 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // + // This is for user defined type names. The lexical phase looked up the + // type. + // + if (const TVariable* variable = ((yyvsp[(1) - (1)].lex).symbol)->getAsVariable()) { + const TType& structure = variable->getType(); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = &structure; + } else + parseContext.error((yyvsp[(1) - (1)].lex).loc, "expected type name", (yyvsp[(1) - (1)].lex).string->c_str(), ""); + } + break; + + case 332: +/* Line 1792 of yacc.c */ +#line 2137 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqHigh; + } + break; + + case 333: +/* Line 1792 of yacc.c */ +#line 2143 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqMedium; + } + break; + + case 334: +/* Line 1792 of yacc.c */ +#line 2149 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); + (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqLow; + } + break; + + case 335: +/* Line 1792 of yacc.c */ +#line 2158 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { parseContext.nestedStructCheck((yyvsp[(1) - (3)].lex).loc); } + break; + + case 336: +/* Line 1792 of yacc.c */ +#line 2158 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string); + parseContext.structArrayCheck((yyvsp[(2) - (6)].lex).loc, *structure); + TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true); + if (! parseContext.symbolTable.insert(*userTypeDef)) + parseContext.error((yyvsp[(2) - (6)].lex).loc, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct"); + (yyval.interm.type).init((yyvsp[(1) - (6)].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; + } + break; + + case 337: +/* Line 1792 of yacc.c */ +#line 2169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { parseContext.nestedStructCheck((yyvsp[(1) - (2)].lex).loc); } + break; + + case 338: +/* Line 1792 of yacc.c */ +#line 2169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString("")); + (yyval.interm.type).init((yyvsp[(1) - (5)].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; + } + break; + + case 339: +/* Line 1792 of yacc.c */ +#line 2179 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList); + } + break; + + case 340: +/* Line 1792 of yacc.c */ +#line 2182 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[(2) - (2)].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]); + } + } + break; + + case 341: +/* Line 1792 of yacc.c */ +#line 2195 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(1) - (3)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList); + + parseContext.voidErrorCheck((yyvsp[(1) - (3)].interm.type).loc, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type).basicType); + parseContext.precisionQualifierCheck((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).basicType, (yyvsp[(1) - (3)].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[(1) - (3)].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[(1) - (3)].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[(1) - (3)].interm.type)); + } + } + break; + + case 342: +/* Line 1792 of yacc.c */ +#line 2213 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).qualifier); + if ((yyvsp[(2) - (4)].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[(2) - (4)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[(2) - (4)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[(2) - (4)].interm.type).loc, *(yyvsp[(2) - (4)].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[(3) - (4)].interm.typeList); + + parseContext.checkNoShaderLayouts((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).shaderQualifiers); + parseContext.voidErrorCheck((yyvsp[(2) - (4)].interm.type).loc, (*(yyvsp[(3) - (4)].interm.typeList))[0].type->getFieldName(), (yyvsp[(2) - (4)].interm.type).basicType); + parseContext.mergeQualifiers((yyvsp[(2) - (4)].interm.type).loc, (yyvsp[(2) - (4)].interm.type).qualifier, (yyvsp[(1) - (4)].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[(2) - (4)].interm.type).loc, (yyvsp[(2) - (4)].interm.type).basicType, (yyvsp[(2) - (4)].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[(1) - (4)].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[(2) - (4)].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[(2) - (4)].interm.type)); + } + } + break; + + case 343: +/* Line 1792 of yacc.c */ +#line 2237 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = new TTypeList; + (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine)); + } + break; + + case 344: +/* Line 1792 of yacc.c */ +#line 2241 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine)); + } + break; + + case 345: +/* Line 1792 of yacc.c */ +#line 2247 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[(1) - (1)].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string); + } + break; + + case 346: +/* Line 1792 of yacc.c */ +#line 2252 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.arrayDimCheck((yyvsp[(1) - (2)].lex).loc, (yyvsp[(2) - (2)].interm).arraySizes, 0); + + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[(1) - (2)].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (2)].lex).string); + (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[(2) - (2)].interm).arraySizes); + } + break; + + case 347: +/* Line 1792 of yacc.c */ +#line 2263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 348: +/* Line 1792 of yacc.c */ +#line 2266 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[(1) - (3)].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[(1) - (3)].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); + } + break; + + case 349: +/* Line 1792 of yacc.c */ +#line 2272 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[(1) - (4)].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[(1) - (4)].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[(2) - (4)].interm.intermTypedNode); + } + break; + + case 350: +/* Line 1792 of yacc.c */ +#line 2281 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[(1) - (1)].interm.intermTypedNode), (yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc()); + } + break; + + case 351: +/* Line 1792 of yacc.c */ +#line 2284 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + } + break; + + case 352: +/* Line 1792 of yacc.c */ +#line 2290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 353: +/* Line 1792 of yacc.c */ +#line 2294 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 354: +/* Line 1792 of yacc.c */ +#line 2295 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 355: +/* Line 1792 of yacc.c */ +#line 2301 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 356: +/* Line 1792 of yacc.c */ +#line 2302 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 357: +/* Line 1792 of yacc.c */ +#line 2303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 358: +/* Line 1792 of yacc.c */ +#line 2304 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 359: +/* Line 1792 of yacc.c */ +#line 2305 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 360: +/* Line 1792 of yacc.c */ +#line 2306 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 361: +/* Line 1792 of yacc.c */ +#line 2307 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 362: +/* Line 1792 of yacc.c */ +#line 2311 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = 0; } + break; + + case 363: +/* Line 1792 of yacc.c */ +#line 2312 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } + break; + + case 364: +/* Line 1792 of yacc.c */ +#line 2316 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + } + break; + + case 365: +/* Line 1792 of yacc.c */ +#line 2320 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(3) - (5)].interm.intermNode) && (yyvsp[(3) - (5)].interm.intermNode)->getAsAggregate()) + (yyvsp[(3) - (5)].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[(3) - (5)].interm.intermNode); + } + break; + + case 366: +/* Line 1792 of yacc.c */ +#line 2328 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 367: +/* Line 1792 of yacc.c */ +#line 2329 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + break; + + case 368: +/* Line 1792 of yacc.c */ +#line 2333 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + ++parseContext.controlFlowNestingLevel; + } + break; + + case 369: +/* Line 1792 of yacc.c */ +#line 2336 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + --parseContext.controlFlowNestingLevel; + (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); + } + break; + + case 370: +/* Line 1792 of yacc.c */ +#line 2340 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + break; + + case 371: +/* Line 1792 of yacc.c */ +#line 2345 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); + } + break; + + case 372: +/* Line 1792 of yacc.c */ +#line 2354 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + } + break; + + case 373: +/* Line 1792 of yacc.c */ +#line 2357 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(2) - (3)].interm.intermNode) && (yyvsp[(2) - (3)].interm.intermNode)->getAsAggregate()) + (yyvsp[(2) - (3)].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermNode); + } + break; + + case 374: +/* Line 1792 of yacc.c */ +#line 2365 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode)); + if ((yyvsp[(1) - (1)].interm.intermNode) && (yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode() && ((yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence(0, (yyvsp[(1) - (1)].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } + } + break; + + case 375: +/* Line 1792 of yacc.c */ +#line 2373 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if ((yyvsp[(2) - (2)].interm.intermNode) && (yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode() && ((yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence((yyvsp[(1) - (2)].interm.intermNode) ? (yyvsp[(1) - (2)].interm.intermNode)->getAsAggregate() : 0, (yyvsp[(2) - (2)].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } else + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode)); + } + break; + + case 376: +/* Line 1792 of yacc.c */ +#line 2384 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = 0; } + break; + + case 377: +/* Line 1792 of yacc.c */ +#line 2385 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = static_cast((yyvsp[(1) - (2)].interm.intermTypedNode)); } + break; + + case 378: +/* Line 1792 of yacc.c */ +#line 2389 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.boolCheck((yyvsp[(1) - (5)].lex).loc, (yyvsp[(3) - (5)].interm.intermTypedNode)); + (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).loc); + } + break; + + case 379: +/* Line 1792 of yacc.c */ +#line 2396 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode); + (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode); + } + break; + + case 380: +/* Line 1792 of yacc.c */ +#line 2400 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.nodePair).node2 = 0; + } + break; + + case 381: +/* Line 1792 of yacc.c */ +#line 2408 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + parseContext.boolCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), (yyvsp[(1) - (1)].interm.intermTypedNode)); + } + break; + + case 382: +/* Line 1792 of yacc.c */ +#line 2412 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.boolCheck((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.type)); + + TType type((yyvsp[(1) - (4)].interm.type)); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (4)].lex).loc, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), 0, (yyvsp[(4) - (4)].interm.intermTypedNode)); + if (initNode) + (yyval.interm.intermTypedNode) = initNode->getAsTyped(); + else + (yyval.interm.intermTypedNode) = 0; + } + break; + + case 383: +/* Line 1792 of yacc.c */ +#line 2425 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // start new switch sequence on the switch stack + ++parseContext.controlFlowNestingLevel; + ++parseContext.statementNestingLevel; + parseContext.switchSequenceStack.push_back(new TIntermSequence); + parseContext.switchLevel.push_back(parseContext.statementNestingLevel); + parseContext.symbolTable.push(); + } + break; + + case 384: +/* Line 1792 of yacc.c */ +#line 2433 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[(1) - (8)].lex).loc, (yyvsp[(3) - (8)].interm.intermTypedNode), (yyvsp[(7) - (8)].interm.intermNode) ? (yyvsp[(7) - (8)].interm.intermNode)->getAsAggregate() : 0); + delete parseContext.switchSequenceStack.back(); + parseContext.switchSequenceStack.pop_back(); + parseContext.switchLevel.pop_back(); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + break; + + case 385: +/* Line 1792 of yacc.c */ +#line 2445 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + } + break; + + case 386: +/* Line 1792 of yacc.c */ +#line 2448 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + } + break; + + case 387: +/* Line 1792 of yacc.c */ +#line 2454 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error((yyvsp[(1) - (3)].lex).loc, "cannot appear outside switch statement", "case", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error((yyvsp[(1) - (3)].lex).loc, "cannot be nested inside control flow", "case", ""); + else { + parseContext.constantValueCheck((yyvsp[(2) - (3)].interm.intermTypedNode), "case"); + parseContext.integerCheck((yyvsp[(2) - (3)].interm.intermTypedNode), "case"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); + } + } + break; + + case 388: +/* Line 1792 of yacc.c */ +#line 2466 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "cannot appear outside switch statement", "default", ""); + else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "cannot be nested inside control flow", "default", ""); + else + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[(1) - (2)].lex).loc); + } + break; + + case 389: +/* Line 1792 of yacc.c */ +#line 2478 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if (! parseContext.limits.whileLoops) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "while loops not available", "limitation", ""); + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + break; + + case 390: +/* Line 1792 of yacc.c */ +#line 2486 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(4) - (6)].interm.intermTypedNode), 0, true, (yyvsp[(1) - (6)].lex).loc); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + break; + + case 391: +/* Line 1792 of yacc.c */ +#line 2493 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + break; + + case 392: +/* Line 1792 of yacc.c */ +#line 2498 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if (! parseContext.limits.whileLoops) + parseContext.error((yyvsp[(1) - (8)].lex).loc, "do-while loops not available", "limitation", ""); + + parseContext.boolCheck((yyvsp[(8) - (8)].lex).loc, (yyvsp[(6) - (8)].interm.intermTypedNode)); + + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(6) - (8)].interm.intermTypedNode), 0, false, (yyvsp[(4) - (8)].lex).loc); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + break; + + case 393: +/* Line 1792 of yacc.c */ +#line 2509 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.push(); + ++parseContext.loopNestingLevel; + ++parseContext.statementNestingLevel; + ++parseContext.controlFlowNestingLevel; + } + break; + + case 394: +/* Line 1792 of yacc.c */ +#line 2515 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[(4) - (7)].interm.intermNode), (yyvsp[(2) - (7)].lex).loc); + TIntermLoop* forLoop = parseContext.intermediate.addLoop((yyvsp[(7) - (7)].interm.intermNode), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node2), true, (yyvsp[(1) - (7)].lex).loc); + if (! parseContext.limits.nonInductiveForLoops) + parseContext.inductiveLoopCheck((yyvsp[(1) - (7)].lex).loc, (yyvsp[(4) - (7)].interm.intermNode), forLoop); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[(1) - (7)].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + --parseContext.loopNestingLevel; + --parseContext.statementNestingLevel; + --parseContext.controlFlowNestingLevel; + } + break; + + case 395: +/* Line 1792 of yacc.c */ +#line 2530 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + } + break; + + case 396: +/* Line 1792 of yacc.c */ +#line 2533 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + } + break; + + case 397: +/* Line 1792 of yacc.c */ +#line 2539 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + } + break; + + case 398: +/* Line 1792 of yacc.c */ +#line 2542 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = 0; + } + break; + + case 399: +/* Line 1792 of yacc.c */ +#line 2548 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = 0; + } + break; + + case 400: +/* Line 1792 of yacc.c */ +#line 2552 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode); + } + break; + + case 401: +/* Line 1792 of yacc.c */ +#line 2559 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if (parseContext.loopNestingLevel <= 0) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "continue statement only allowed in loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).loc); + } + break; + + case 402: +/* Line 1792 of yacc.c */ +#line 2564 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "break statement only allowed in switch and loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).loc); + } + break; + + case 403: +/* Line 1792 of yacc.c */ +#line 2569 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).loc); + if (parseContext.currentFunctionType->getBasicType() != EbtVoid) + parseContext.error((yyvsp[(1) - (2)].lex).loc, "non-void function must return a value", "return", ""); + if (parseContext.inMain) + parseContext.postMainReturn = true; + } + break; + + case 404: +/* Line 1792 of yacc.c */ +#line 2576 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.functionReturnsValue = true; + if (parseContext.currentFunctionType->getBasicType() == EbtVoid) { + parseContext.error((yyvsp[(1) - (3)].lex).loc, "void function cannot return a value", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(1) - (3)].lex).loc); + } else if (*(parseContext.currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) { + TIntermTyped* converted = parseContext.intermediate.addConversion(EOpReturn, *parseContext.currentFunctionType, (yyvsp[(2) - (3)].interm.intermTypedNode)); + if (converted) { + if (parseContext.version < 420) + parseContext.warn((yyvsp[(1) - (3)].lex).loc, "type conversion on return values was not explicitly allowed until version 420", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, converted, (yyvsp[(1) - (3)].lex).loc); + } else { + parseContext.error((yyvsp[(1) - (3)].lex).loc, "type does not match, or is not convertible to, the function's return type", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); + } + } else + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); + } + break; + + case 405: +/* Line 1792 of yacc.c */ +#line 2594 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[(1) - (2)].lex).loc, EShLangFragment, "discard"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).loc); + } + break; + + case 406: +/* Line 1792 of yacc.c */ +#line 2603 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } + break; + + case 407: +/* Line 1792 of yacc.c */ +#line 2607 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode)); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } + break; + + case 408: +/* Line 1792 of yacc.c */ +#line 2614 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + } + break; + + case 409: +/* Line 1792 of yacc.c */ +#line 2617 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + } + break; + + case 410: +/* Line 1792 of yacc.c */ +#line 2623 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + (yyvsp[(1) - (1)].interm).function = parseContext.handleFunctionDeclarator((yyvsp[(1) - (1)].interm).loc, *(yyvsp[(1) - (1)].interm).function, false /* not prototype */); + (yyvsp[(1) - (1)].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[(1) - (1)].interm).loc, *(yyvsp[(1) - (1)].interm).function); + } + break; + + case 411: +/* Line 1792 of yacc.c */ +#line 2627 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + { + // May be best done as post process phase on intermediate code + if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) + parseContext.error((yyvsp[(1) - (3)].interm).loc, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str()); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermNode)); + parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).function->getType(), (yyvsp[(1) - (3)].interm).loc); + (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str()); + + // store the pragma information for debug and optimize and other vendor specific + // information. This information can be queried from the parse tree + (yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); + (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); + (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); + } + break; + + +/* Line 1792 of yacc.c */ +#line 7558 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (pParseContext, YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (pParseContext, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, pParseContext); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, pParseContext); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (pParseContext, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, pParseContext); + } + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, pParseContext); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +/* Line 2055 of yacc.c */ +#line 2644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + diff --git a/glslang/MachineIndependent/glslang_tab.cpp.h b/glslang/MachineIndependent/glslang_tab.cpp.h new file mode 100644 index 00000000..0c6ab3bc --- /dev/null +++ b/glslang/MachineIndependent/glslang_tab.cpp.h @@ -0,0 +1,370 @@ +/* A Bison parser, made by GNU Bison 2.7. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + BREAK = 266, + CONTINUE = 267, + DO = 268, + ELSE = 269, + FOR = 270, + IF = 271, + DISCARD = 272, + RETURN = 273, + SWITCH = 274, + CASE = 275, + DEFAULT = 276, + SUBROUTINE = 277, + BVEC2 = 278, + BVEC3 = 279, + BVEC4 = 280, + IVEC2 = 281, + IVEC3 = 282, + IVEC4 = 283, + UVEC2 = 284, + UVEC3 = 285, + UVEC4 = 286, + VEC2 = 287, + VEC3 = 288, + VEC4 = 289, + MAT2 = 290, + MAT3 = 291, + MAT4 = 292, + CENTROID = 293, + IN = 294, + OUT = 295, + INOUT = 296, + UNIFORM = 297, + PATCH = 298, + SAMPLE = 299, + BUFFER = 300, + SHARED = 301, + COHERENT = 302, + VOLATILE = 303, + RESTRICT = 304, + READONLY = 305, + WRITEONLY = 306, + DVEC2 = 307, + DVEC3 = 308, + DVEC4 = 309, + DMAT2 = 310, + DMAT3 = 311, + DMAT4 = 312, + NOPERSPECTIVE = 313, + FLAT = 314, + SMOOTH = 315, + LAYOUT = 316, + MAT2X2 = 317, + MAT2X3 = 318, + MAT2X4 = 319, + MAT3X2 = 320, + MAT3X3 = 321, + MAT3X4 = 322, + MAT4X2 = 323, + MAT4X3 = 324, + MAT4X4 = 325, + DMAT2X2 = 326, + DMAT2X3 = 327, + DMAT2X4 = 328, + DMAT3X2 = 329, + DMAT3X3 = 330, + DMAT3X4 = 331, + DMAT4X2 = 332, + DMAT4X3 = 333, + DMAT4X4 = 334, + ATOMIC_UINT = 335, + SAMPLER1D = 336, + SAMPLER2D = 337, + SAMPLER3D = 338, + SAMPLERCUBE = 339, + SAMPLER1DSHADOW = 340, + SAMPLER2DSHADOW = 341, + SAMPLERCUBESHADOW = 342, + SAMPLER1DARRAY = 343, + SAMPLER2DARRAY = 344, + SAMPLER1DARRAYSHADOW = 345, + SAMPLER2DARRAYSHADOW = 346, + ISAMPLER1D = 347, + ISAMPLER2D = 348, + ISAMPLER3D = 349, + ISAMPLERCUBE = 350, + ISAMPLER1DARRAY = 351, + ISAMPLER2DARRAY = 352, + USAMPLER1D = 353, + USAMPLER2D = 354, + USAMPLER3D = 355, + USAMPLERCUBE = 356, + USAMPLER1DARRAY = 357, + USAMPLER2DARRAY = 358, + SAMPLER2DRECT = 359, + SAMPLER2DRECTSHADOW = 360, + ISAMPLER2DRECT = 361, + USAMPLER2DRECT = 362, + SAMPLERBUFFER = 363, + ISAMPLERBUFFER = 364, + USAMPLERBUFFER = 365, + SAMPLERCUBEARRAY = 366, + SAMPLERCUBEARRAYSHADOW = 367, + ISAMPLERCUBEARRAY = 368, + USAMPLERCUBEARRAY = 369, + SAMPLER2DMS = 370, + ISAMPLER2DMS = 371, + USAMPLER2DMS = 372, + SAMPLER2DMSARRAY = 373, + ISAMPLER2DMSARRAY = 374, + USAMPLER2DMSARRAY = 375, + SAMPLEREXTERNALOES = 376, + SAMPLER = 377, + SAMPLERSHADOW = 378, + TEXTURE1D = 379, + TEXTURE2D = 380, + TEXTURE3D = 381, + TEXTURECUBE = 382, + TEXTURE1DARRAY = 383, + TEXTURE2DARRAY = 384, + ITEXTURE1D = 385, + ITEXTURE2D = 386, + ITEXTURE3D = 387, + ITEXTURECUBE = 388, + ITEXTURE1DARRAY = 389, + ITEXTURE2DARRAY = 390, + UTEXTURE1D = 391, + UTEXTURE2D = 392, + UTEXTURE3D = 393, + UTEXTURECUBE = 394, + UTEXTURE1DARRAY = 395, + UTEXTURE2DARRAY = 396, + TEXTURE2DRECT = 397, + ITEXTURE2DRECT = 398, + UTEXTURE2DRECT = 399, + TEXTUREBUFFER = 400, + ITEXTUREBUFFER = 401, + UTEXTUREBUFFER = 402, + TEXTURECUBEARRAY = 403, + ITEXTURECUBEARRAY = 404, + UTEXTURECUBEARRAY = 405, + TEXTURE2DMS = 406, + ITEXTURE2DMS = 407, + UTEXTURE2DMS = 408, + TEXTURE2DMSARRAY = 409, + ITEXTURE2DMSARRAY = 410, + UTEXTURE2DMSARRAY = 411, + SUBPASSINPUT = 412, + SUBPASSINPUTMS = 413, + ISUBPASSINPUT = 414, + ISUBPASSINPUTMS = 415, + USUBPASSINPUT = 416, + USUBPASSINPUTMS = 417, + IMAGE1D = 418, + IIMAGE1D = 419, + UIMAGE1D = 420, + IMAGE2D = 421, + IIMAGE2D = 422, + UIMAGE2D = 423, + IMAGE3D = 424, + IIMAGE3D = 425, + UIMAGE3D = 426, + IMAGE2DRECT = 427, + IIMAGE2DRECT = 428, + UIMAGE2DRECT = 429, + IMAGECUBE = 430, + IIMAGECUBE = 431, + UIMAGECUBE = 432, + IMAGEBUFFER = 433, + IIMAGEBUFFER = 434, + UIMAGEBUFFER = 435, + IMAGE1DARRAY = 436, + IIMAGE1DARRAY = 437, + UIMAGE1DARRAY = 438, + IMAGE2DARRAY = 439, + IIMAGE2DARRAY = 440, + UIMAGE2DARRAY = 441, + IMAGECUBEARRAY = 442, + IIMAGECUBEARRAY = 443, + UIMAGECUBEARRAY = 444, + IMAGE2DMS = 445, + IIMAGE2DMS = 446, + UIMAGE2DMS = 447, + IMAGE2DMSARRAY = 448, + IIMAGE2DMSARRAY = 449, + UIMAGE2DMSARRAY = 450, + STRUCT = 451, + VOID = 452, + WHILE = 453, + IDENTIFIER = 454, + TYPE_NAME = 455, + FLOATCONSTANT = 456, + DOUBLECONSTANT = 457, + INTCONSTANT = 458, + UINTCONSTANT = 459, + BOOLCONSTANT = 460, + LEFT_OP = 461, + RIGHT_OP = 462, + INC_OP = 463, + DEC_OP = 464, + LE_OP = 465, + GE_OP = 466, + EQ_OP = 467, + NE_OP = 468, + AND_OP = 469, + OR_OP = 470, + XOR_OP = 471, + MUL_ASSIGN = 472, + DIV_ASSIGN = 473, + ADD_ASSIGN = 474, + MOD_ASSIGN = 475, + LEFT_ASSIGN = 476, + RIGHT_ASSIGN = 477, + AND_ASSIGN = 478, + XOR_ASSIGN = 479, + OR_ASSIGN = 480, + SUB_ASSIGN = 481, + LEFT_PAREN = 482, + RIGHT_PAREN = 483, + LEFT_BRACKET = 484, + RIGHT_BRACKET = 485, + LEFT_BRACE = 486, + RIGHT_BRACE = 487, + DOT = 488, + COMMA = 489, + COLON = 490, + EQUAL = 491, + SEMICOLON = 492, + BANG = 493, + DASH = 494, + TILDE = 495, + PLUS = 496, + STAR = 497, + SLASH = 498, + PERCENT = 499, + LEFT_ANGLE = 500, + RIGHT_ANGLE = 501, + VERTICAL_BAR = 502, + CARET = 503, + AMPERSAND = 504, + QUESTION = 505, + INVARIANT = 506, + PRECISE = 507, + HIGH_PRECISION = 508, + MEDIUM_PRECISION = 509, + LOW_PRECISION = 510, + PRECISION = 511, + PACKED = 512, + RESOURCE = 513, + SUPERP = 514 + }; +#endif + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ +/* Line 2058 of yacc.c */ +#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + + struct { + glslang::TSourceLoc loc; + union { + glslang::TString *string; + int i; + unsigned int u; + bool b; + double d; + }; + glslang::TSymbol* symbol; + } lex; + struct { + glslang::TSourceLoc loc; + glslang::TOperator op; + union { + TIntermNode* intermNode; + glslang::TIntermNodePair nodePair; + glslang::TIntermTyped* intermTypedNode; + }; + union { + glslang::TPublicType type; + glslang::TFunction* function; + glslang::TParameter param; + glslang::TTypeLoc typeLine; + glslang::TTypeList* typeList; + glslang::TArraySizes* arraySizes; + glslang::TIdentifierList* identifierList; + }; + } interm; + + +/* Line 2058 of yacc.c */ +#line 349 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (glslang::TParseContext* pParseContext); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + +#endif /* !YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index d319c6f5..b52551ff 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -48,7 +48,7 @@ namespace { bool is_positive_infinity(double x) { #ifdef _MSC_VER return _fpclass(x) == _FPCLASS_PINF; -#elif defined __ANDROID__ +#elif defined __ANDROID__ || defined __linux__ return std::isinf(x) && (x >= 0); #else return isinf(x) && (x >= 0); @@ -96,7 +96,7 @@ protected: // Helper functions for printing, not part of traversing. // -void OutputTreeText(TInfoSink& infoSink, const TIntermNode* node, const int depth) +static void OutputTreeText(TInfoSink& infoSink, const TIntermNode* node, const int depth) { int i; @@ -318,6 +318,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpFindLSB: out.debug << "findLSB"; break; case EOpFindMSB: out.debug << "findMSB"; break; + case EOpNoise: out.debug << "noise"; break; + default: out.debug.message(EPrefixError, "Bad unary op"); } @@ -383,6 +385,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break; case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; case EOpConstructStruct: out.debug << "Construct structure"; break; + case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; case EOpLessThan: out.debug << "Compare Less Than"; break; case EOpGreaterThan: out.debug << "Compare Greater Than"; break; @@ -526,7 +529,7 @@ bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node return false; } -void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, int depth) +static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, int depth) { int size = node->getType().computeNumComponents(); @@ -753,6 +756,16 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) case EShLangCompute: infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n"; + { + if (localSizeSpecId[0] != TQualifier::layoutNotSet || + localSizeSpecId[1] != TQualifier::layoutNotSet || + localSizeSpecId[2] != TQualifier::layoutNotSet) { + infoSink.debug << "local_size ids = (" << + localSizeSpecId[0] << ", " << + localSizeSpecId[1] << ", " << + localSizeSpecId[2] << ")\n"; + } + } break; default: diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 7c96d225..6fef4fb7 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -71,6 +71,7 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) { numMains += unit.numMains; numErrors += unit.numErrors; + numPushConstants += unit.numPushConstants; callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end()); if ((profile != EEsProfile && unit.profile == EEsProfile) || @@ -129,6 +130,11 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) localSize[i] = unit.localSize[i]; else if (localSize[i] != unit.localSize[i]) error(infoSink, "Contradictory local size"); + + if (localSizeSpecId[i] != TQualifier::layoutNotSet) + localSizeSpecId[i] = unit.localSizeSpecId[i]; + else if (localSizeSpecId[i] != unit.localSizeSpecId[i]) + error(infoSink, "Contradictory local size specialization ids"); } if (unit.xfbMode) @@ -353,6 +359,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink) if (numMains < 1) error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point"); + if (numPushConstants > 1) + error(infoSink, "Only one push_constant block is allowed per stage"); + // recursion checking checkCallGraphCycles(infoSink); @@ -690,6 +699,19 @@ int TIntermediate::addUsedOffsets(int binding, int offset, int numOffsets) return -1; // no collision } +// Accumulate used constant_id values. +// +// Return false is one was already used. +bool TIntermediate::addUsedConstantId(int id) +{ + if (usedConstantId.find(id) != usedConstantId.end()) + return false; + + usedConstantId.insert(id); + + return true; +} + // Recursively figure out how many locations are used up by an input or output type. // Return the size of type, as measured by "locations". int TIntermediate::computeTypeLocationSize(const TType& type) const @@ -959,6 +981,11 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b size += memberSize; } + // The structure may have padding at the end; the base offset of + // the member following the sub-structure is rounded up to the next + // multiple of the base alignment of the structure. + RoundToPow2(size, maxAlignment); + return maxAlignment; } @@ -982,7 +1009,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // rules 5 and 7 if (type.isMatrix()) { // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows - TType derefType(type, 0, type.getQualifier().layoutMatrix == ElmRowMajor); + TType derefType(type, 0, rowMajor); alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); if (std140) diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 043d31fa..99267475 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -93,7 +93,7 @@ struct TIoRange { int index; }; -// An IO range is a 2-D rectangle; the set of (binding, offset) pairs all lying +// An offset range is a 2-D rectangle; the set of (binding, offset) pairs all lying // within the same binding and offset range. struct TOffsetRange { TOffsetRange(TRange binding, TRange offset) @@ -125,14 +125,18 @@ class TVariable; class TIntermediate { public: 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), + numMains(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), - vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false) + vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), + multiStream(false), xfbMode(false) { localSize[0] = 1; localSize[1] = 1; localSize[2] = 1; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; xfbBuffers.resize(TQualifier::layoutXfbBufferEnd); } void setLimits(const TBuiltInResource& r) { resources = r; } @@ -156,8 +160,10 @@ public: void addMainCount() { ++numMains; } int getNumMains() const { return numMains; } int getNumErrors() const { return numErrors; } + void addPushConstantCount() { ++numPushConstants; } bool isRecursive() const { return recursive; } + TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, const TSourceLoc&); TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TSourceLoc&); TIntermSymbol* addSymbol(const TVariable&, const TSourceLoc&); TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const; @@ -255,8 +261,19 @@ public: } unsigned int getLocalSize(int dim) const { return localSize[dim]; } + bool setLocalSizeSpecId(int dim, int id) + { + if (localSizeSpecId[dim] != TQualifier::layoutNotSet) + return id == localSizeSpecId[dim]; + localSizeSpecId[dim] = id; + return true; + } + int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; } + void setXfbMode() { xfbMode = true; } bool getXfbMode() const { return xfbMode; } + void setMultiStream() { multiStream = true; } + bool isMultiStream() const { return multiStream; } bool setOutputPrimitive(TLayoutGeometry p) { if (outputPrimitive != ElgNone) @@ -294,6 +311,7 @@ public: int addUsedLocation(const TQualifier&, const TType&, bool& typeCollision); int addUsedOffsets(int binding, int offset, int numOffsets); + bool addUsedConstantId(int id); int computeTypeLocationSize(const TType&) const; bool setXfbBufferStride(int buffer, unsigned stride) @@ -328,6 +346,7 @@ protected: TBuiltInResource resources; int numMains; int numErrors; + int numPushConstants; bool recursive; int invocations; int vertices; @@ -339,11 +358,13 @@ protected: TVertexOrder vertexOrder; bool pointMode; int localSize[3]; + int localSizeSpecId[3]; bool earlyFragmentTests; TLayoutDepth depthLayout; bool depthReplacing; int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift bool xfbMode; + bool multiStream; typedef std::list TGraph; TGraph callGraph; @@ -352,6 +373,7 @@ protected: std::vector usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers std::vector usedAtomics; // sets of bindings used by atomic counters std::vector xfbBuffers; // all the data we need to track per xfb buffer + std::unordered_set usedConstantId; // specialization constant ids used private: void operator=(TIntermediate&); // prevent assignments diff --git a/glslang/MachineIndependent/preprocessor/Pp.cpp b/glslang/MachineIndependent/preprocessor/Pp.cpp index 72dbcae4..9a33a776 100644 --- a/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -611,9 +611,9 @@ int TPpContext::CPPinclude(TPpToken* ppToken) if (token != '\n' && token != EndOfInput) { parseContext.ppError(ppToken->loc, "extra content after file designation", "#include", ""); } else { - std::string sourceName; - std::string replacement; - std::tie(sourceName, replacement) = includer.include(filename.c_str()); + auto include = includer.include(filename.c_str()); + std::string sourceName = include.first; + std::string replacement = include.second; if (!sourceName.empty()) { if (!replacement.empty()) { const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); diff --git a/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 642793d9..52343b7c 100644 --- a/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -195,7 +195,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) case PpAtomConstUint: len = 0; ch = lReadByte(pTok); - while (ch != 0) { + while (ch != 0 && ch != EndOfInput) { if (len < MaxTokenLength) { tokenText[len] = (char)ch; len++; @@ -215,12 +215,10 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) break; case PpAtomConstFloat: case PpAtomConstDouble: - strcpy(ppToken->name, tokenText); ppToken->dval = atof(ppToken->name); break; case PpAtomConstInt: case PpAtomConstUint: - strcpy(ppToken->name, tokenText); if (len > 0 && tokenText[0] == '0') { if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X')) ppToken->ival = strtol(ppToken->name, 0, 16); diff --git a/glslang/OSDependent/Unix/ossource.cpp b/glslang/OSDependent/Unix/ossource.cpp index 7dee4df1..5ce882ab 100644 --- a/glslang/OSDependent/Unix/ossource.cpp +++ b/glslang/OSDependent/Unix/ossource.cpp @@ -54,7 +54,7 @@ namespace glslang { // Wrapper for Linux call to DetachThread. This is required as pthread_cleanup_push() expects // the cleanup routine to return void. // -void DetachThreadLinux(void *) +static void DetachThreadLinux(void *) { DetachThread(); } diff --git a/glslang/OSDependent/Windows/ossource.cpp b/glslang/OSDependent/Windows/ossource.cpp index b5ce18c2..56dbf791 100644 --- a/glslang/OSDependent/Windows/ossource.cpp +++ b/glslang/OSDependent/Windows/ossource.cpp @@ -147,6 +147,8 @@ void OS_Sleep(int milliseconds) Sleep(milliseconds); } +//#define DUMP_COUNTERS + void OS_DumpMemoryCounters() { #ifdef DUMP_COUNTERS diff --git a/glslang/OSDependent/osinclude.h b/glslang/OSDependent/osinclude.h index 0f370a00..33f88038 100644 --- a/glslang/OSDependent/osinclude.h +++ b/glslang/OSDependent/osinclude.h @@ -56,6 +56,7 @@ typedef unsigned int (*TThreadEntrypoint)(void*); void* OS_CreateThread(TThreadEntrypoint); void OS_WaitForAllThreads(void* threads, int numThreads); +void OS_CleanupThreadData(void); void OS_Sleep(int milliseconds); void OS_DumpMemoryCounters(); diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index 0c97e39f..702b66f4 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -303,7 +303,7 @@ public: // Returns an error message for any #include directive. class ForbidInclude : public Includer { public: - std::pair include(const char* filename) const override + std::pair include(const char* /*filename*/) const override { return std::make_pair("", "unexpected include directive"); } diff --git a/tools/bison.exe b/tools/bison.exe deleted file mode 100755 index bdc1101e..00000000 Binary files a/tools/bison.exe and /dev/null differ diff --git a/tools/data/Makefile.am b/tools/data/Makefile.am deleted file mode 100644 index e209325c..00000000 --- a/tools/data/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -## Copyright (C) 2002, 2005-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -dist_pkgdata_DATA = README bison.m4 \ - c-like.m4 \ - c-skel.m4 c.m4 yacc.c glr.c \ - c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \ - java-skel.m4 java.m4 lalr1.java - -m4sugardir = $(pkgdatadir)/m4sugar -dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4 - -xsltdir = $(pkgdatadir)/xslt -dist_xslt_DATA = \ - xslt/bison.xsl \ - xslt/xml2dot.xsl \ - xslt/xml2text.xsl \ - xslt/xml2xhtml.xsl diff --git a/tools/data/Makefile.in b/tools/data/Makefile.in deleted file mode 100644 index a15e670b..00000000 --- a/tools/data/Makefile.in +++ /dev/null @@ -1,1639 +0,0 @@ -# Makefile.in generated by automake 1.12.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = data -DIST_COMMON = README $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) \ - $(dist_xslt_DATA) $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ - $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/bison-i18n.m4 \ - $(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/calloc.m4 \ - $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ - $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ - $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \ - $(top_srcdir)/m4/cxx.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dmalloc.m4 \ - $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \ - $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ - $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/extern-inline.m4 \ - $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \ - $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ - $(top_srcdir)/m4/flex.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \ - $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \ - $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ - $(top_srcdir)/m4/fseterr.m4 $(top_srcdir)/m4/fstat.m4 \ - $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getdtablesize.m4 \ - $(top_srcdir)/m4/getline.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/include_next.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnan.m4 \ - $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \ - $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/iswblank.m4 \ - $(top_srcdir)/m4/javacomp.m4 $(top_srcdir)/m4/javaexec.m4 \ - $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/ldexp.m4 \ - $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libunistring-base.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ - $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ - $(top_srcdir)/m4/msvc-inval.m4 \ - $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ - $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/off_t.m4 \ - $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe2.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \ - $(top_srcdir)/m4/printf-frexp.m4 \ - $(top_srcdir)/m4/printf-frexpl.m4 \ - $(top_srcdir)/m4/printf-posix-rpl.m4 \ - $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ - $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/sched_h.m4 \ - $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ - $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ - $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ - $(top_srcdir)/m4/size_max.m4 \ - $(top_srcdir)/m4/snprintf-posix.m4 \ - $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/spawn-pipe.m4 \ - $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/sprintf-posix.m4 \ - $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ - $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \ - $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ - $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strverscmp.m4 \ - $(top_srcdir)/m4/sys_socket_h.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ - $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timevar.m4 \ - $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vfprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf.m4 \ - $(top_srcdir)/m4/vsprintf-posix.m4 \ - $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \ - $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/lib/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" \ - "$(DESTDIR)$(xsltdir)" -DATA = $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) $(dist_xslt_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -pkglibexecdir = @pkglibexecdir@ -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ -ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOM4TE = @AUTOM4TE@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BISON_CXX_WORKS = @BISON_CXX_WORKS@ -BISON_C_WORKS = @BISON_C_WORKS@ -BISON_LOCALEDIR = @BISON_LOCALEDIR@ -BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ -BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ -BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ -BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ -BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLASSPATH = @CLASSPATH@ -CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ -CONFIG_INCLUDE = @CONFIG_INCLUDE@ -CONF_JAVA = @CONF_JAVA@ -CONF_JAVAC = @CONF_JAVAC@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXX_COMPILER_POSIXLY_CORRECT = @CXX_COMPILER_POSIXLY_CORRECT@ -CYGPATH_W = @CYGPATH_W@ -C_COMPILER_POSIXLY_CORRECT = @C_COMPILER_POSIXLY_CORRECT@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOT = @DOT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ -EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ -ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ -ENOLINK_VALUE = @ENOLINK_VALUE@ -EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ -EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ -ERRNO_H = @ERRNO_H@ -EXEEXT = @EXEEXT@ -FLOAT_H = @FLOAT_H@ -GCC = @GCC@ -GETOPT_H = @GETOPT_H@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNULIB_ACOSF = @GNULIB_ACOSF@ -GNULIB_ACOSL = @GNULIB_ACOSL@ -GNULIB_ASINF = @GNULIB_ASINF@ -GNULIB_ASINL = @GNULIB_ASINL@ -GNULIB_ATAN2F = @GNULIB_ATAN2F@ -GNULIB_ATANF = @GNULIB_ATANF@ -GNULIB_ATANL = @GNULIB_ATANL@ -GNULIB_ATOLL = @GNULIB_ATOLL@ -GNULIB_BTOWC = @GNULIB_BTOWC@ -GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ -GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ -GNULIB_CBRT = @GNULIB_CBRT@ -GNULIB_CBRTF = @GNULIB_CBRTF@ -GNULIB_CBRTL = @GNULIB_CBRTL@ -GNULIB_CEIL = @GNULIB_CEIL@ -GNULIB_CEILF = @GNULIB_CEILF@ -GNULIB_CEILL = @GNULIB_CEILL@ -GNULIB_CHDIR = @GNULIB_CHDIR@ -GNULIB_CHOWN = @GNULIB_CHOWN@ -GNULIB_CLOSE = @GNULIB_CLOSE@ -GNULIB_COPYSIGN = @GNULIB_COPYSIGN@ -GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@ -GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@ -GNULIB_COSF = @GNULIB_COSF@ -GNULIB_COSHF = @GNULIB_COSHF@ -GNULIB_COSL = @GNULIB_COSL@ -GNULIB_DPRINTF = @GNULIB_DPRINTF@ -GNULIB_DUP = @GNULIB_DUP@ -GNULIB_DUP2 = @GNULIB_DUP2@ -GNULIB_DUP3 = @GNULIB_DUP3@ -GNULIB_ENVIRON = @GNULIB_ENVIRON@ -GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ -GNULIB_EXP2 = @GNULIB_EXP2@ -GNULIB_EXP2F = @GNULIB_EXP2F@ -GNULIB_EXP2L = @GNULIB_EXP2L@ -GNULIB_EXPF = @GNULIB_EXPF@ -GNULIB_EXPL = @GNULIB_EXPL@ -GNULIB_EXPM1 = @GNULIB_EXPM1@ -GNULIB_EXPM1F = @GNULIB_EXPM1F@ -GNULIB_EXPM1L = @GNULIB_EXPM1L@ -GNULIB_FABSF = @GNULIB_FABSF@ -GNULIB_FABSL = @GNULIB_FABSL@ -GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ -GNULIB_FCHDIR = @GNULIB_FCHDIR@ -GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ -GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ -GNULIB_FCLOSE = @GNULIB_FCLOSE@ -GNULIB_FCNTL = @GNULIB_FCNTL@ -GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ -GNULIB_FDOPEN = @GNULIB_FDOPEN@ -GNULIB_FFLUSH = @GNULIB_FFLUSH@ -GNULIB_FFSL = @GNULIB_FFSL@ -GNULIB_FFSLL = @GNULIB_FFSLL@ -GNULIB_FGETC = @GNULIB_FGETC@ -GNULIB_FGETS = @GNULIB_FGETS@ -GNULIB_FLOOR = @GNULIB_FLOOR@ -GNULIB_FLOORF = @GNULIB_FLOORF@ -GNULIB_FLOORL = @GNULIB_FLOORL@ -GNULIB_FMA = @GNULIB_FMA@ -GNULIB_FMAF = @GNULIB_FMAF@ -GNULIB_FMAL = @GNULIB_FMAL@ -GNULIB_FMOD = @GNULIB_FMOD@ -GNULIB_FMODF = @GNULIB_FMODF@ -GNULIB_FMODL = @GNULIB_FMODL@ -GNULIB_FOPEN = @GNULIB_FOPEN@ -GNULIB_FPRINTF = @GNULIB_FPRINTF@ -GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ -GNULIB_FPURGE = @GNULIB_FPURGE@ -GNULIB_FPUTC = @GNULIB_FPUTC@ -GNULIB_FPUTS = @GNULIB_FPUTS@ -GNULIB_FREAD = @GNULIB_FREAD@ -GNULIB_FREOPEN = @GNULIB_FREOPEN@ -GNULIB_FREXP = @GNULIB_FREXP@ -GNULIB_FREXPF = @GNULIB_FREXPF@ -GNULIB_FREXPL = @GNULIB_FREXPL@ -GNULIB_FSCANF = @GNULIB_FSCANF@ -GNULIB_FSEEK = @GNULIB_FSEEK@ -GNULIB_FSEEKO = @GNULIB_FSEEKO@ -GNULIB_FSTAT = @GNULIB_FSTAT@ -GNULIB_FSTATAT = @GNULIB_FSTATAT@ -GNULIB_FSYNC = @GNULIB_FSYNC@ -GNULIB_FTELL = @GNULIB_FTELL@ -GNULIB_FTELLO = @GNULIB_FTELLO@ -GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ -GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ -GNULIB_FWRITE = @GNULIB_FWRITE@ -GNULIB_GETC = @GNULIB_GETC@ -GNULIB_GETCHAR = @GNULIB_GETCHAR@ -GNULIB_GETCWD = @GNULIB_GETCWD@ -GNULIB_GETDELIM = @GNULIB_GETDELIM@ -GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ -GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ -GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ -GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ -GNULIB_GETLINE = @GNULIB_GETLINE@ -GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ -GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ -GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ -GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ -GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ -GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ -GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ -GNULIB_GRANTPT = @GNULIB_GRANTPT@ -GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ -GNULIB_HYPOT = @GNULIB_HYPOT@ -GNULIB_HYPOTF = @GNULIB_HYPOTF@ -GNULIB_HYPOTL = @GNULIB_HYPOTL@ -GNULIB_ILOGB = @GNULIB_ILOGB@ -GNULIB_ILOGBF = @GNULIB_ILOGBF@ -GNULIB_ILOGBL = @GNULIB_ILOGBL@ -GNULIB_IMAXABS = @GNULIB_IMAXABS@ -GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ -GNULIB_ISATTY = @GNULIB_ISATTY@ -GNULIB_ISFINITE = @GNULIB_ISFINITE@ -GNULIB_ISINF = @GNULIB_ISINF@ -GNULIB_ISNAN = @GNULIB_ISNAN@ -GNULIB_ISNAND = @GNULIB_ISNAND@ -GNULIB_ISNANF = @GNULIB_ISNANF@ -GNULIB_ISNANL = @GNULIB_ISNANL@ -GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ -GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ -GNULIB_LCHMOD = @GNULIB_LCHMOD@ -GNULIB_LCHOWN = @GNULIB_LCHOWN@ -GNULIB_LDEXPF = @GNULIB_LDEXPF@ -GNULIB_LDEXPL = @GNULIB_LDEXPL@ -GNULIB_LINK = @GNULIB_LINK@ -GNULIB_LINKAT = @GNULIB_LINKAT@ -GNULIB_LOG = @GNULIB_LOG@ -GNULIB_LOG10 = @GNULIB_LOG10@ -GNULIB_LOG10F = @GNULIB_LOG10F@ -GNULIB_LOG10L = @GNULIB_LOG10L@ -GNULIB_LOG1P = @GNULIB_LOG1P@ -GNULIB_LOG1PF = @GNULIB_LOG1PF@ -GNULIB_LOG1PL = @GNULIB_LOG1PL@ -GNULIB_LOG2 = @GNULIB_LOG2@ -GNULIB_LOG2F = @GNULIB_LOG2F@ -GNULIB_LOG2L = @GNULIB_LOG2L@ -GNULIB_LOGB = @GNULIB_LOGB@ -GNULIB_LOGBF = @GNULIB_LOGBF@ -GNULIB_LOGBL = @GNULIB_LOGBL@ -GNULIB_LOGF = @GNULIB_LOGF@ -GNULIB_LOGL = @GNULIB_LOGL@ -GNULIB_LSEEK = @GNULIB_LSEEK@ -GNULIB_LSTAT = @GNULIB_LSTAT@ -GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ -GNULIB_MBRLEN = @GNULIB_MBRLEN@ -GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSINIT = @GNULIB_MBSINIT@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MBTOWC = @GNULIB_MBTOWC@ -GNULIB_MEMCHR = @GNULIB_MEMCHR@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ -GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ -GNULIB_MKFIFO = @GNULIB_MKFIFO@ -GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ -GNULIB_MKNOD = @GNULIB_MKNOD@ -GNULIB_MKNODAT = @GNULIB_MKNODAT@ -GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ -GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ -GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ -GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ -GNULIB_MKTIME = @GNULIB_MKTIME@ -GNULIB_MODF = @GNULIB_MODF@ -GNULIB_MODFF = @GNULIB_MODFF@ -GNULIB_MODFL = @GNULIB_MODFL@ -GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ -GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ -GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ -GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ -GNULIB_OPEN = @GNULIB_OPEN@ -GNULIB_OPENAT = @GNULIB_OPENAT@ -GNULIB_PCLOSE = @GNULIB_PCLOSE@ -GNULIB_PERROR = @GNULIB_PERROR@ -GNULIB_PIPE = @GNULIB_PIPE@ -GNULIB_PIPE2 = @GNULIB_PIPE2@ -GNULIB_POPEN = @GNULIB_POPEN@ -GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ -GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ -GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ -GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ -GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ -GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ -GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ -GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ -GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ -GNULIB_POWF = @GNULIB_POWF@ -GNULIB_PREAD = @GNULIB_PREAD@ -GNULIB_PRINTF = @GNULIB_PRINTF@ -GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ -GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ -GNULIB_PTSNAME = @GNULIB_PTSNAME@ -GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ -GNULIB_PUTC = @GNULIB_PUTC@ -GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ -GNULIB_PUTENV = @GNULIB_PUTENV@ -GNULIB_PUTS = @GNULIB_PUTS@ -GNULIB_PWRITE = @GNULIB_PWRITE@ -GNULIB_RAISE = @GNULIB_RAISE@ -GNULIB_RANDOM = @GNULIB_RANDOM@ -GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ -GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ -GNULIB_READ = @GNULIB_READ@ -GNULIB_READLINK = @GNULIB_READLINK@ -GNULIB_READLINKAT = @GNULIB_READLINKAT@ -GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ -GNULIB_REALPATH = @GNULIB_REALPATH@ -GNULIB_REMAINDER = @GNULIB_REMAINDER@ -GNULIB_REMAINDERF = @GNULIB_REMAINDERF@ -GNULIB_REMAINDERL = @GNULIB_REMAINDERL@ -GNULIB_REMOVE = @GNULIB_REMOVE@ -GNULIB_RENAME = @GNULIB_RENAME@ -GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ -GNULIB_RINT = @GNULIB_RINT@ -GNULIB_RINTF = @GNULIB_RINTF@ -GNULIB_RINTL = @GNULIB_RINTL@ -GNULIB_RMDIR = @GNULIB_RMDIR@ -GNULIB_ROUND = @GNULIB_ROUND@ -GNULIB_ROUNDF = @GNULIB_ROUNDF@ -GNULIB_ROUNDL = @GNULIB_ROUNDL@ -GNULIB_RPMATCH = @GNULIB_RPMATCH@ -GNULIB_SCANF = @GNULIB_SCANF@ -GNULIB_SETENV = @GNULIB_SETENV@ -GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ -GNULIB_SIGACTION = @GNULIB_SIGACTION@ -GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ -GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ -GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ -GNULIB_SINF = @GNULIB_SINF@ -GNULIB_SINHF = @GNULIB_SINHF@ -GNULIB_SINL = @GNULIB_SINL@ -GNULIB_SLEEP = @GNULIB_SLEEP@ -GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ -GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ -GNULIB_SQRTF = @GNULIB_SQRTF@ -GNULIB_SQRTL = @GNULIB_SQRTL@ -GNULIB_STAT = @GNULIB_STAT@ -GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ -GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRERROR = @GNULIB_STRERROR@ -GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ -GNULIB_STRNCAT = @GNULIB_STRNCAT@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRPTIME = @GNULIB_STRPTIME@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ -GNULIB_STRSTR = @GNULIB_STRSTR@ -GNULIB_STRTOD = @GNULIB_STRTOD@ -GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_STRTOLL = @GNULIB_STRTOLL@ -GNULIB_STRTOULL = @GNULIB_STRTOULL@ -GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ -GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ -GNULIB_SYMLINK = @GNULIB_SYMLINK@ -GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ -GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ -GNULIB_TANF = @GNULIB_TANF@ -GNULIB_TANHF = @GNULIB_TANHF@ -GNULIB_TANL = @GNULIB_TANL@ -GNULIB_TIMEGM = @GNULIB_TIMEGM@ -GNULIB_TIME_R = @GNULIB_TIME_R@ -GNULIB_TMPFILE = @GNULIB_TMPFILE@ -GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ -GNULIB_TRUNC = @GNULIB_TRUNC@ -GNULIB_TRUNCF = @GNULIB_TRUNCF@ -GNULIB_TRUNCL = @GNULIB_TRUNCL@ -GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ -GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ -GNULIB_UNLINK = @GNULIB_UNLINK@ -GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ -GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ -GNULIB_UNSETENV = @GNULIB_UNSETENV@ -GNULIB_USLEEP = @GNULIB_USLEEP@ -GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ -GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ -GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ -GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ -GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ -GNULIB_VFSCANF = @GNULIB_VFSCANF@ -GNULIB_VPRINTF = @GNULIB_VPRINTF@ -GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ -GNULIB_VSCANF = @GNULIB_VSCANF@ -GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ -GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNULIB_WAITPID = @GNULIB_WAITPID@ -GNULIB_WCPCPY = @GNULIB_WCPCPY@ -GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ -GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ -GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ -GNULIB_WCSCAT = @GNULIB_WCSCAT@ -GNULIB_WCSCHR = @GNULIB_WCSCHR@ -GNULIB_WCSCMP = @GNULIB_WCSCMP@ -GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ -GNULIB_WCSCPY = @GNULIB_WCSCPY@ -GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ -GNULIB_WCSDUP = @GNULIB_WCSDUP@ -GNULIB_WCSLEN = @GNULIB_WCSLEN@ -GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ -GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ -GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ -GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ -GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ -GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ -GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ -GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ -GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ -GNULIB_WCSSPN = @GNULIB_WCSSPN@ -GNULIB_WCSSTR = @GNULIB_WCSSTR@ -GNULIB_WCSTOK = @GNULIB_WCSTOK@ -GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ -GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ -GNULIB_WCTOB = @GNULIB_WCTOB@ -GNULIB_WCTOMB = @GNULIB_WCTOMB@ -GNULIB_WCTRANS = @GNULIB_WCTRANS@ -GNULIB_WCTYPE = @GNULIB_WCTYPE@ -GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ -GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ -GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ -GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ -GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ -GNULIB_WMEMSET = @GNULIB_WMEMSET@ -GNULIB_WRITE = @GNULIB_WRITE@ -GNULIB__EXIT = @GNULIB__EXIT@ -GREP = @GREP@ -HAVE_ACOSF = @HAVE_ACOSF@ -HAVE_ACOSL = @HAVE_ACOSL@ -HAVE_ASINF = @HAVE_ASINF@ -HAVE_ASINL = @HAVE_ASINL@ -HAVE_ATAN2F = @HAVE_ATAN2F@ -HAVE_ATANF = @HAVE_ATANF@ -HAVE_ATANL = @HAVE_ATANL@ -HAVE_ATOLL = @HAVE_ATOLL@ -HAVE_BTOWC = @HAVE_BTOWC@ -HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ -HAVE_CBRT = @HAVE_CBRT@ -HAVE_CBRTF = @HAVE_CBRTF@ -HAVE_CBRTL = @HAVE_CBRTL@ -HAVE_CHOWN = @HAVE_CHOWN@ -HAVE_COPYSIGN = @HAVE_COPYSIGN@ -HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ -HAVE_COSF = @HAVE_COSF@ -HAVE_COSHF = @HAVE_COSHF@ -HAVE_COSL = @HAVE_COSL@ -HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ -HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ -HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ -HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ -HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ -HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ -HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ -HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ -HAVE_DECL_COSL = @HAVE_DECL_COSL@ -HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ -HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ -HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ -HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ -HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ -HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ -HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ -HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ -HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ -HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ -HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ -HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ -HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ -HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ -HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ -HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ -HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ -HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ -HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ -HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ -HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ -HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ -HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ -HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ -HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ -HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ -HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ -HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ -HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ -HAVE_DECL_LOGB = @HAVE_DECL_LOGB@ -HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ -HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@ -HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ -HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ -HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ -HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ -HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ -HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ -HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ -HAVE_DECL_SINL = @HAVE_DECL_SINL@ -HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ -HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ -HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ -HAVE_DECL_TANL = @HAVE_DECL_TANL@ -HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ -HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ -HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ -HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ -HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ -HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ -HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ -HAVE_DPRINTF = @HAVE_DPRINTF@ -HAVE_DUP2 = @HAVE_DUP2@ -HAVE_DUP3 = @HAVE_DUP3@ -HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ -HAVE_EXPF = @HAVE_EXPF@ -HAVE_EXPL = @HAVE_EXPL@ -HAVE_EXPM1 = @HAVE_EXPM1@ -HAVE_EXPM1F = @HAVE_EXPM1F@ -HAVE_FABSF = @HAVE_FABSF@ -HAVE_FABSL = @HAVE_FABSL@ -HAVE_FACCESSAT = @HAVE_FACCESSAT@ -HAVE_FCHDIR = @HAVE_FCHDIR@ -HAVE_FCHMODAT = @HAVE_FCHMODAT@ -HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ -HAVE_FCNTL = @HAVE_FCNTL@ -HAVE_FDATASYNC = @HAVE_FDATASYNC@ -HAVE_FEATURES_H = @HAVE_FEATURES_H@ -HAVE_FFSL = @HAVE_FFSL@ -HAVE_FFSLL = @HAVE_FFSLL@ -HAVE_FMA = @HAVE_FMA@ -HAVE_FMAF = @HAVE_FMAF@ -HAVE_FMAL = @HAVE_FMAL@ -HAVE_FMODF = @HAVE_FMODF@ -HAVE_FMODL = @HAVE_FMODL@ -HAVE_FREXPF = @HAVE_FREXPF@ -HAVE_FSEEKO = @HAVE_FSEEKO@ -HAVE_FSTATAT = @HAVE_FSTATAT@ -HAVE_FSYNC = @HAVE_FSYNC@ -HAVE_FTELLO = @HAVE_FTELLO@ -HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ -HAVE_FUTIMENS = @HAVE_FUTIMENS@ -HAVE_GCJ_C = @HAVE_GCJ_C@ -HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ -HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ -HAVE_GETGROUPS = @HAVE_GETGROUPS@ -HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ -HAVE_GETLOGIN = @HAVE_GETLOGIN@ -HAVE_GETOPT_H = @HAVE_GETOPT_H@ -HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ -HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ -HAVE_GIJ = @HAVE_GIJ@ -HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ -HAVE_GRANTPT = @HAVE_GRANTPT@ -HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ -HAVE_HYPOTF = @HAVE_HYPOTF@ -HAVE_HYPOTL = @HAVE_HYPOTL@ -HAVE_ILOGB = @HAVE_ILOGB@ -HAVE_ILOGBF = @HAVE_ILOGBF@ -HAVE_ILOGBL = @HAVE_ILOGBL@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_ISNAND = @HAVE_ISNAND@ -HAVE_ISNANF = @HAVE_ISNANF@ -HAVE_ISNANL = @HAVE_ISNANL@ -HAVE_ISWBLANK = @HAVE_ISWBLANK@ -HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ -HAVE_JAVA = @HAVE_JAVA@ -HAVE_JAVAC = @HAVE_JAVAC@ -HAVE_JAVAC_ENVVAR = @HAVE_JAVAC_ENVVAR@ -HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ -HAVE_JAVA_ENVVAR = @HAVE_JAVA_ENVVAR@ -HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ -HAVE_JIKES = @HAVE_JIKES@ -HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ -HAVE_JRE = @HAVE_JRE@ -HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ -HAVE_JVIEW = @HAVE_JVIEW@ -HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ -HAVE_LCHMOD = @HAVE_LCHMOD@ -HAVE_LCHOWN = @HAVE_LCHOWN@ -HAVE_LDEXPF = @HAVE_LDEXPF@ -HAVE_LINK = @HAVE_LINK@ -HAVE_LINKAT = @HAVE_LINKAT@ -HAVE_LOG10F = @HAVE_LOG10F@ -HAVE_LOG10L = @HAVE_LOG10L@ -HAVE_LOG1P = @HAVE_LOG1P@ -HAVE_LOG1PF = @HAVE_LOG1PF@ -HAVE_LOG1PL = @HAVE_LOG1PL@ -HAVE_LOGBF = @HAVE_LOGBF@ -HAVE_LOGBL = @HAVE_LOGBL@ -HAVE_LOGF = @HAVE_LOGF@ -HAVE_LOGL = @HAVE_LOGL@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ -HAVE_LSTAT = @HAVE_LSTAT@ -HAVE_MBRLEN = @HAVE_MBRLEN@ -HAVE_MBRTOWC = @HAVE_MBRTOWC@ -HAVE_MBSINIT = @HAVE_MBSINIT@ -HAVE_MBSLEN = @HAVE_MBSLEN@ -HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ -HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ -HAVE_MEMCHR = @HAVE_MEMCHR@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_MKDIRAT = @HAVE_MKDIRAT@ -HAVE_MKDTEMP = @HAVE_MKDTEMP@ -HAVE_MKFIFO = @HAVE_MKFIFO@ -HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ -HAVE_MKNOD = @HAVE_MKNOD@ -HAVE_MKNODAT = @HAVE_MKNODAT@ -HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ -HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ -HAVE_MKSTEMP = @HAVE_MKSTEMP@ -HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ -HAVE_MODFF = @HAVE_MODFF@ -HAVE_MODFL = @HAVE_MODFL@ -HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ -HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ -HAVE_OPENAT = @HAVE_OPENAT@ -HAVE_OS_H = @HAVE_OS_H@ -HAVE_PCLOSE = @HAVE_PCLOSE@ -HAVE_PIPE = @HAVE_PIPE@ -HAVE_PIPE2 = @HAVE_PIPE2@ -HAVE_POPEN = @HAVE_POPEN@ -HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ -HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ -HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ -HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@ -HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ -HAVE_POWF = @HAVE_POWF@ -HAVE_PREAD = @HAVE_PREAD@ -HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ -HAVE_PTSNAME = @HAVE_PTSNAME@ -HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ -HAVE_PWRITE = @HAVE_PWRITE@ -HAVE_RAISE = @HAVE_RAISE@ -HAVE_RANDOM = @HAVE_RANDOM@ -HAVE_RANDOM_H = @HAVE_RANDOM_H@ -HAVE_RANDOM_R = @HAVE_RANDOM_R@ -HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ -HAVE_READLINK = @HAVE_READLINK@ -HAVE_READLINKAT = @HAVE_READLINKAT@ -HAVE_REALPATH = @HAVE_REALPATH@ -HAVE_REMAINDER = @HAVE_REMAINDER@ -HAVE_REMAINDERF = @HAVE_REMAINDERF@ -HAVE_RENAMEAT = @HAVE_RENAMEAT@ -HAVE_RINT = @HAVE_RINT@ -HAVE_RINTL = @HAVE_RINTL@ -HAVE_RPMATCH = @HAVE_RPMATCH@ -HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@ -HAVE_SCHED_H = @HAVE_SCHED_H@ -HAVE_SETENV = @HAVE_SETENV@ -HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ -HAVE_SIGACTION = @HAVE_SIGACTION@ -HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ -HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ -HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ -HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ -HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ -HAVE_SIGSET_T = @HAVE_SIGSET_T@ -HAVE_SINF = @HAVE_SINF@ -HAVE_SINHF = @HAVE_SINHF@ -HAVE_SINL = @HAVE_SINL@ -HAVE_SLEEP = @HAVE_SLEEP@ -HAVE_SPAWN_H = @HAVE_SPAWN_H@ -HAVE_SQRTF = @HAVE_SQRTF@ -HAVE_SQRTL = @HAVE_SQRTL@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASESTR = @HAVE_STRCASESTR@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRPTIME = @HAVE_STRPTIME@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_STRTOD = @HAVE_STRTOD@ -HAVE_STRTOLL = @HAVE_STRTOLL@ -HAVE_STRTOULL = @HAVE_STRTOULL@ -HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ -HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ -HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ -HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ -HAVE_SYMLINK = @HAVE_SYMLINK@ -HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ -HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ -HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ -HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ -HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_TANF = @HAVE_TANF@ -HAVE_TANHF = @HAVE_TANHF@ -HAVE_TANL = @HAVE_TANL@ -HAVE_TIMEGM = @HAVE_TIMEGM@ -HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ -HAVE_UNISTD_H = @HAVE_UNISTD_H@ -HAVE_UNLINKAT = @HAVE_UNLINKAT@ -HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_USLEEP = @HAVE_USLEEP@ -HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ -HAVE_VASPRINTF = @HAVE_VASPRINTF@ -HAVE_VDPRINTF = @HAVE_VDPRINTF@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WCHAR_T = @HAVE_WCHAR_T@ -HAVE_WCPCPY = @HAVE_WCPCPY@ -HAVE_WCPNCPY = @HAVE_WCPNCPY@ -HAVE_WCRTOMB = @HAVE_WCRTOMB@ -HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ -HAVE_WCSCAT = @HAVE_WCSCAT@ -HAVE_WCSCHR = @HAVE_WCSCHR@ -HAVE_WCSCMP = @HAVE_WCSCMP@ -HAVE_WCSCOLL = @HAVE_WCSCOLL@ -HAVE_WCSCPY = @HAVE_WCSCPY@ -HAVE_WCSCSPN = @HAVE_WCSCSPN@ -HAVE_WCSDUP = @HAVE_WCSDUP@ -HAVE_WCSLEN = @HAVE_WCSLEN@ -HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ -HAVE_WCSNCAT = @HAVE_WCSNCAT@ -HAVE_WCSNCMP = @HAVE_WCSNCMP@ -HAVE_WCSNCPY = @HAVE_WCSNCPY@ -HAVE_WCSNLEN = @HAVE_WCSNLEN@ -HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ -HAVE_WCSPBRK = @HAVE_WCSPBRK@ -HAVE_WCSRCHR = @HAVE_WCSRCHR@ -HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ -HAVE_WCSSPN = @HAVE_WCSSPN@ -HAVE_WCSSTR = @HAVE_WCSSTR@ -HAVE_WCSTOK = @HAVE_WCSTOK@ -HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ -HAVE_WCSXFRM = @HAVE_WCSXFRM@ -HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ -HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ -HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ -HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ -HAVE_WINT_T = @HAVE_WINT_T@ -HAVE_WMEMCHR = @HAVE_WMEMCHR@ -HAVE_WMEMCMP = @HAVE_WMEMCMP@ -HAVE_WMEMCPY = @HAVE_WMEMCPY@ -HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ -HAVE_WMEMSET = @HAVE_WMEMSET@ -HAVE__BOOL = @HAVE__BOOL@ -HAVE__EXIT = @HAVE__EXIT@ -HELP2MAN = @HELP2MAN@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ -INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -ISNAND_LIBM = @ISNAND_LIBM@ -ISNANF_LIBM = @ISNANF_LIBM@ -ISNANL_LIBM = @ISNANL_LIBM@ -ISNAN_LIBM = @ISNAN_LIBM@ -LDEXPL_LIBM = @LDEXPL_LIBM@ -LDEXP_LIBM = @LDEXP_LIBM@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_IS_FLEX = @LEX_IS_FLEX@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBBISON_LIBDEPS = @LIBBISON_LIBDEPS@ -LIBBISON_LTLIBDEPS = @LIBBISON_LTLIBDEPS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ -LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ -LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ -LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ -LOCALE_JA = @LOCALE_JA@ -LOCALE_ZH_CN = @LOCALE_ZH_CN@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -M4 = @M4@ -M4_DEBUGFILE = @M4_DEBUGFILE@ -M4_GNU = @M4_GNU@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ -NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ -NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ -NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ -NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ -NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ -NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ -NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@ -NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ -NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ -NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ -NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ -NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ -NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ -NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ -NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ -NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ -NEXT_ERRNO_H = @NEXT_ERRNO_H@ -NEXT_FCNTL_H = @NEXT_FCNTL_H@ -NEXT_FLOAT_H = @NEXT_FLOAT_H@ -NEXT_GETOPT_H = @NEXT_GETOPT_H@ -NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ -NEXT_MATH_H = @NEXT_MATH_H@ -NEXT_SCHED_H = @NEXT_SCHED_H@ -NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ -NEXT_SPAWN_H = @NEXT_SPAWN_H@ -NEXT_STDDEF_H = @NEXT_STDDEF_H@ -NEXT_STDINT_H = @NEXT_STDINT_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STDLIB_H = @NEXT_STDLIB_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ -NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ -NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ -NEXT_TIME_H = @NEXT_TIME_H@ -NEXT_UNISTD_H = @NEXT_UNISTD_H@ -NEXT_WCHAR_H = @NEXT_WCHAR_H@ -NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_COPYRIGHT_YEAR = @PACKAGE_COPYRIGHT_YEAR@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -POSUB = @POSUB@ -PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ -PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ -PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ -RANLIB = @RANLIB@ -REPLACE_BTOWC = @REPLACE_BTOWC@ -REPLACE_CALLOC = @REPLACE_CALLOC@ -REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ -REPLACE_CBRTF = @REPLACE_CBRTF@ -REPLACE_CBRTL = @REPLACE_CBRTL@ -REPLACE_CEIL = @REPLACE_CEIL@ -REPLACE_CEILF = @REPLACE_CEILF@ -REPLACE_CEILL = @REPLACE_CEILL@ -REPLACE_CHOWN = @REPLACE_CHOWN@ -REPLACE_CLOSE = @REPLACE_CLOSE@ -REPLACE_DPRINTF = @REPLACE_DPRINTF@ -REPLACE_DUP = @REPLACE_DUP@ -REPLACE_DUP2 = @REPLACE_DUP2@ -REPLACE_EXP2 = @REPLACE_EXP2@ -REPLACE_EXP2L = @REPLACE_EXP2L@ -REPLACE_EXPM1 = @REPLACE_EXPM1@ -REPLACE_EXPM1F = @REPLACE_EXPM1F@ -REPLACE_FABSL = @REPLACE_FABSL@ -REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ -REPLACE_FCLOSE = @REPLACE_FCLOSE@ -REPLACE_FCNTL = @REPLACE_FCNTL@ -REPLACE_FDOPEN = @REPLACE_FDOPEN@ -REPLACE_FFLUSH = @REPLACE_FFLUSH@ -REPLACE_FLOOR = @REPLACE_FLOOR@ -REPLACE_FLOORF = @REPLACE_FLOORF@ -REPLACE_FLOORL = @REPLACE_FLOORL@ -REPLACE_FMA = @REPLACE_FMA@ -REPLACE_FMAF = @REPLACE_FMAF@ -REPLACE_FMAL = @REPLACE_FMAL@ -REPLACE_FMOD = @REPLACE_FMOD@ -REPLACE_FMODF = @REPLACE_FMODF@ -REPLACE_FMODL = @REPLACE_FMODL@ -REPLACE_FOPEN = @REPLACE_FOPEN@ -REPLACE_FPRINTF = @REPLACE_FPRINTF@ -REPLACE_FPURGE = @REPLACE_FPURGE@ -REPLACE_FREOPEN = @REPLACE_FREOPEN@ -REPLACE_FREXP = @REPLACE_FREXP@ -REPLACE_FREXPF = @REPLACE_FREXPF@ -REPLACE_FREXPL = @REPLACE_FREXPL@ -REPLACE_FSEEK = @REPLACE_FSEEK@ -REPLACE_FSEEKO = @REPLACE_FSEEKO@ -REPLACE_FSTAT = @REPLACE_FSTAT@ -REPLACE_FSTATAT = @REPLACE_FSTATAT@ -REPLACE_FTELL = @REPLACE_FTELL@ -REPLACE_FTELLO = @REPLACE_FTELLO@ -REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ -REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ -REPLACE_GETCWD = @REPLACE_GETCWD@ -REPLACE_GETDELIM = @REPLACE_GETDELIM@ -REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ -REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ -REPLACE_GETLINE = @REPLACE_GETLINE@ -REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ -REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ -REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ -REPLACE_HYPOT = @REPLACE_HYPOT@ -REPLACE_HYPOTF = @REPLACE_HYPOTF@ -REPLACE_HYPOTL = @REPLACE_HYPOTL@ -REPLACE_ILOGB = @REPLACE_ILOGB@ -REPLACE_ILOGBF = @REPLACE_ILOGBF@ -REPLACE_ISATTY = @REPLACE_ISATTY@ -REPLACE_ISFINITE = @REPLACE_ISFINITE@ -REPLACE_ISINF = @REPLACE_ISINF@ -REPLACE_ISNAN = @REPLACE_ISNAN@ -REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ -REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ -REPLACE_ITOLD = @REPLACE_ITOLD@ -REPLACE_LCHOWN = @REPLACE_LCHOWN@ -REPLACE_LDEXPL = @REPLACE_LDEXPL@ -REPLACE_LINK = @REPLACE_LINK@ -REPLACE_LINKAT = @REPLACE_LINKAT@ -REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ -REPLACE_LOG = @REPLACE_LOG@ -REPLACE_LOG10 = @REPLACE_LOG10@ -REPLACE_LOG10F = @REPLACE_LOG10F@ -REPLACE_LOG10L = @REPLACE_LOG10L@ -REPLACE_LOG1P = @REPLACE_LOG1P@ -REPLACE_LOG1PF = @REPLACE_LOG1PF@ -REPLACE_LOG1PL = @REPLACE_LOG1PL@ -REPLACE_LOG2 = @REPLACE_LOG2@ -REPLACE_LOG2F = @REPLACE_LOG2F@ -REPLACE_LOG2L = @REPLACE_LOG2L@ -REPLACE_LOGB = @REPLACE_LOGB@ -REPLACE_LOGBF = @REPLACE_LOGBF@ -REPLACE_LOGBL = @REPLACE_LOGBL@ -REPLACE_LOGF = @REPLACE_LOGF@ -REPLACE_LOGL = @REPLACE_LOGL@ -REPLACE_LSEEK = @REPLACE_LSEEK@ -REPLACE_LSTAT = @REPLACE_LSTAT@ -REPLACE_MALLOC = @REPLACE_MALLOC@ -REPLACE_MBRLEN = @REPLACE_MBRLEN@ -REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ -REPLACE_MBSINIT = @REPLACE_MBSINIT@ -REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ -REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ -REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ -REPLACE_MBTOWC = @REPLACE_MBTOWC@ -REPLACE_MEMCHR = @REPLACE_MEMCHR@ -REPLACE_MEMMEM = @REPLACE_MEMMEM@ -REPLACE_MKDIR = @REPLACE_MKDIR@ -REPLACE_MKFIFO = @REPLACE_MKFIFO@ -REPLACE_MKNOD = @REPLACE_MKNOD@ -REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ -REPLACE_MKTIME = @REPLACE_MKTIME@ -REPLACE_MODF = @REPLACE_MODF@ -REPLACE_MODFF = @REPLACE_MODFF@ -REPLACE_MODFL = @REPLACE_MODFL@ -REPLACE_NAN = @REPLACE_NAN@ -REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ -REPLACE_NULL = @REPLACE_NULL@ -REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ -REPLACE_OPEN = @REPLACE_OPEN@ -REPLACE_OPENAT = @REPLACE_OPENAT@ -REPLACE_PERROR = @REPLACE_PERROR@ -REPLACE_POPEN = @REPLACE_POPEN@ -REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -REPLACE_PREAD = @REPLACE_PREAD@ -REPLACE_PRINTF = @REPLACE_PRINTF@ -REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ -REPLACE_PTSNAME = @REPLACE_PTSNAME@ -REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ -REPLACE_PUTENV = @REPLACE_PUTENV@ -REPLACE_PWRITE = @REPLACE_PWRITE@ -REPLACE_RAISE = @REPLACE_RAISE@ -REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ -REPLACE_READ = @REPLACE_READ@ -REPLACE_READLINK = @REPLACE_READLINK@ -REPLACE_REALLOC = @REPLACE_REALLOC@ -REPLACE_REALPATH = @REPLACE_REALPATH@ -REPLACE_REMAINDER = @REPLACE_REMAINDER@ -REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ -REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ -REPLACE_REMOVE = @REPLACE_REMOVE@ -REPLACE_RENAME = @REPLACE_RENAME@ -REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ -REPLACE_RMDIR = @REPLACE_RMDIR@ -REPLACE_ROUND = @REPLACE_ROUND@ -REPLACE_ROUNDF = @REPLACE_ROUNDF@ -REPLACE_ROUNDL = @REPLACE_ROUNDL@ -REPLACE_SETENV = @REPLACE_SETENV@ -REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ -REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ -REPLACE_SLEEP = @REPLACE_SLEEP@ -REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ -REPLACE_SPRINTF = @REPLACE_SPRINTF@ -REPLACE_SQRTL = @REPLACE_SQRTL@ -REPLACE_STAT = @REPLACE_STAT@ -REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ -REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ -REPLACE_STPNCPY = @REPLACE_STPNCPY@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ -REPLACE_STRDUP = @REPLACE_STRDUP@ -REPLACE_STRERROR = @REPLACE_STRERROR@ -REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ -REPLACE_STRNCAT = @REPLACE_STRNCAT@ -REPLACE_STRNDUP = @REPLACE_STRNDUP@ -REPLACE_STRNLEN = @REPLACE_STRNLEN@ -REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ -REPLACE_STRSTR = @REPLACE_STRSTR@ -REPLACE_STRTOD = @REPLACE_STRTOD@ -REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ -REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ -REPLACE_SYMLINK = @REPLACE_SYMLINK@ -REPLACE_TIMEGM = @REPLACE_TIMEGM@ -REPLACE_TMPFILE = @REPLACE_TMPFILE@ -REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ -REPLACE_TRUNC = @REPLACE_TRUNC@ -REPLACE_TRUNCF = @REPLACE_TRUNCF@ -REPLACE_TRUNCL = @REPLACE_TRUNCL@ -REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ -REPLACE_UNLINK = @REPLACE_UNLINK@ -REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ -REPLACE_UNSETENV = @REPLACE_UNSETENV@ -REPLACE_USLEEP = @REPLACE_USLEEP@ -REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ -REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ -REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ -REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ -REPLACE_VPRINTF = @REPLACE_VPRINTF@ -REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ -REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ -REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ -REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ -REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ -REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ -REPLACE_WCTOB = @REPLACE_WCTOB@ -REPLACE_WCTOMB = @REPLACE_WCTOMB@ -REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ -REPLACE_WRITE = @REPLACE_WRITE@ -SCHED_H = @SCHED_H@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ -SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ -STDBOOL_H = @STDBOOL_H@ -STDDEF_H = @STDDEF_H@ -STDINT_H = @STDINT_H@ -STRIP = @STRIP@ -SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ -TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ -UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ -UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ -UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ -UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ -UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ -USE_NLS = @USE_NLS@ -VALGRIND = @VALGRIND@ -VALGRIND_PREBISON = @VALGRIND_PREBISON@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -WARN_CFLAGS_TEST = @WARN_CFLAGS_TEST@ -WARN_CXXFLAGS = @WARN_CXXFLAGS@ -WARN_CXXFLAGS_TEST = @WARN_CXXFLAGS_TEST@ -WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ -WERROR_CXXFLAGS = @WERROR_CXXFLAGS@ -WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ -WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ -WINT_T_SUFFIX = @WINT_T_SUFFIX@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -XSLTPROC = @XSLTPROC@ -YACC = @YACC@ -YACC_LIBRARY = @YACC_LIBRARY@ -YACC_SCRIPT = @YACC_SCRIPT@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -aclocaldir = @aclocaldir@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -gltests_LIBOBJS = @gltests_LIBOBJS@ -gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ -gltests_WITNESS = @gltests_WITNESS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -lispdir = @lispdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -dist_pkgdata_DATA = README bison.m4 \ - c-like.m4 \ - c-skel.m4 c.m4 yacc.c glr.c \ - c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \ - java-skel.m4 java.m4 lalr1.java - -m4sugardir = $(pkgdatadir)/m4sugar -dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4 -xsltdir = $(pkgdatadir)/xslt -dist_xslt_DATA = \ - xslt/bison.xsl \ - xslt/xml2dot.xsl \ - xslt/xml2text.xsl \ - xslt/xml2xhtml.xsl - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits data/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnits data/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-dist_m4sugarDATA: $(dist_m4sugar_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(m4sugardir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(m4sugardir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4sugardir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4sugardir)" || exit $$?; \ - done - -uninstall-dist_m4sugarDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4sugardir)'; $(am__uninstall_files_from_dir) -install-dist_pkgdataDATA: $(dist_pkgdata_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ - done - -uninstall-dist_pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) -install-dist_xsltDATA: $(dist_xslt_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xsltdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(xsltdir)" || exit $$?; \ - done - -uninstall-dist_xsltDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltdir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(xsltdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-dist_m4sugarDATA install-dist_pkgdataDATA \ - install-dist_xsltDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \ - uninstall-dist_xsltDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ - install-dist_m4sugarDATA install-dist_pkgdataDATA \ - install-dist_xsltDATA install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \ - uninstall-dist_xsltDATA - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/tools/data/README b/tools/data/README deleted file mode 100644 index d88e5aa9..00000000 --- a/tools/data/README +++ /dev/null @@ -1,70 +0,0 @@ --*- outline -*- - -This directory contains data needed by Bison. - -* Skeletons -Bison skeletons: the general shapes of the different parser kinds, -that are specialized for specific grammars by the bison program. - -Currently, the supported skeletons are: - -- yacc.c - It used to be named bison.simple: it corresponds to C Yacc - compatible LALR(1) parsers. - -- lalr1.cc - Produces a C++ parser class. - -- lalr1.java - Produces a Java parser class. - -- glr.c - A Generalized LR C parser based on Bison's LALR(1) tables. - -- glr.cc - A Generalized LR C++ parser. Actually a C++ wrapper around glr.c. - -These skeletons are the only ones supported by the Bison team. -Because the interface between skeletons and the bison program is not -finished, *we are not bound to it*. In particular, Bison is not -mature enough for us to consider that ``foreign skeletons'' are -supported. - -* m4sugar -This directory contains M4sugar, sort of an extended library for M4, -which is used by Bison to instantiate the skeletons. - -* xslt -This directory contains XSLT programs that transform Bison's XML output -into various formats. - -- bison.xsl - A library of routines used by the other XSLT programs. - -- xml2dot.xsl - Conversion into GraphViz's dot format. - -- xml2text.xsl - Conversion into text. - -- xml2xhtml.xsl - Conversion into XHTML. - ------ - -Copyright (C) 2002, 2008-2012 Free Software Foundation, Inc. - -This file is part of GNU Bison. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/tools/data/bison.m4 b/tools/data/bison.m4 deleted file mode 100644 index 102d5fbd..00000000 --- a/tools/data/bison.m4 +++ /dev/null @@ -1,610 +0,0 @@ - -*- Autoconf -*- - -# Language-independent M4 Macros for Bison. - -# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -## ---------------- ## -## Identification. ## -## ---------------- ## - -# b4_copyright(TITLE, YEARS) -# -------------------------- -m4_define([b4_copyright], -[b4_comment([A Bison parser, made by GNU Bison b4_version.]) - -b4_comment([$1 - -m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ]) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see .]) - -b4_comment([As a special exception, you may create a larger work that contains -part or all of the Bison parser skeleton and distribute that work -under terms of your choice, so long as that work isn't itself a -parser generator using the skeleton or a modified version thereof -as a parser skeleton. Alternatively, if you modify or redistribute -the parser skeleton itself, you may (at your option) remove this -special exception, which will cause the skeleton and the resulting -Bison output files to be licensed under the GNU General Public -License without this special exception. - -This special exception was added by the Free Software Foundation in -version 2.2 of Bison.])]) - - -## -------- ## -## Output. ## -## -------- ## - -# b4_output_begin(FILE) -# --------------------- -# Enable output, i.e., send to diversion 0, expand after "#", and -# generate the tag to output into FILE. Must be followed by EOL. -m4_define([b4_output_begin], -[m4_changecom() -m4_divert_push(0)dnl -@output(m4_unquote([$1])@)@dnl -]) - - -# b4_output_end() -# --------------- -# Output nothing, restore # as comment character (no expansions after #). -m4_define([b4_output_end], -[m4_divert_pop(0) -m4_changecom([#]) -]) - - -## ---------------- ## -## Error handling. ## -## ---------------- ## - -# The following error handling macros print error directives that should not -# become arguments of other macro invocations since they would likely then be -# mangled. Thus, they print to stdout directly. - -# b4_cat(TEXT) -# ------------ -# Write TEXT to stdout. Precede the final newline with an @ so that it's -# escaped. For example: -# -# b4_cat([[@complain(invalid input@)]]) -m4_define([b4_cat], -[m4_syscmd([cat <<'_m4eof' -]m4_bpatsubst(m4_dquote($1), [_m4eof], [_m4@`eof])[@ -_m4eof -])dnl -m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])]) - -# b4_error(KIND, FORMAT, [ARG1], [ARG2], ...) -# ------------------------------------------- -# Write @KIND(FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# For example: -# -# b4_error([[warn]], [[invalid value for '%s': %s]], [[foo]], [[3]]) -m4_define([b4_error], -[b4_cat([[@]$1[(]$2[]]dnl -[m4_if([$#], [2], [], - [m4_foreach([b4_arg], - m4_dquote(m4_shift(m4_shift($@))), - [[@,]b4_arg])])[@)]])]) - -# b4_error_at(KIND, START, END, FORMAT, [ARG1], [ARG2], ...) -# ---------------------------------------------------------- -# Write @KIND_at(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# For example: -# -# b4_error_at([[complain]], [[input.y:2.3]], [[input.y:5.4]], -# [[invalid %s]], [[foo]]) -m4_define([b4_error_at], -[b4_cat([[@]$1[_at(]$2[@,]$3[@,]$4[]]dnl -[m4_if([$#], [4], [], - [m4_foreach([b4_arg], - m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))), - [[@,]b4_arg])])[@)]])]) - -# b4_warn(FORMAT, [ARG1], [ARG2], ...) -# ------------------------------------ -# Write @warn(FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# For example: -# -# b4_warn([[invalid value for '%s': %s]], [[foo]], [[3]]) -# -# As a simple test suite, this: -# -# m4_divert(-1) -# m4_define([asdf], [ASDF]) -# m4_define([fsa], [FSA]) -# m4_define([fdsa], [FDSA]) -# b4_warn([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]]) -# b4_warn([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]]) -# b4_warn() -# b4_warn(1) -# b4_warn(1, 2) -# -# Should produce this without newlines: -# -# @warn([asdf), asdf]@,[fsa), fsa]@,[fdsa), fdsa]@) -# @warn(asdf), asdf@,fsa), fsa@,fdsa), fdsa@) -# @warn(@) -# @warn(1@) -# @warn(1@,2@) -m4_define([b4_warn], -[b4_error([[warn]], $@)]) - -# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...) -# --------------------------------------------------- -# Write @warn(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# For example: -# -# b4_warn_at([[input.y:2.3]], [[input.y:5.4]], [[invalid %s]], [[foo]]) -m4_define([b4_warn_at], -[b4_error_at([[warn]], $@)]) - -# b4_complain(FORMAT, [ARG1], [ARG2], ...) -# ---------------------------------------- -# Write @complain(FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# See b4_warn example. -m4_define([b4_complain], -[b4_error([[complain]], $@)]) - -# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...) -# ------------------------------------------------------- -# Write @complain(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# See b4_warn_at example. -m4_define([b4_complain_at], -[b4_error_at([[complain]], $@)]) - -# b4_fatal(FORMAT, [ARG1], [ARG2], ...) -# ------------------------------------- -# Write @fatal(FORMAT@,ARG1@,ARG2@,...@) to stdout and exit. -# -# See b4_warn example. -m4_define([b4_fatal], -[b4_error([[fatal]], $@)dnl -m4_exit(1)]) - -# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...) -# ---------------------------------------------------- -# Write @fatal(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout and exit. -# -# See b4_warn_at example. -m4_define([b4_fatal_at], -[b4_error_at([[fatal]], $@)dnl -m4_exit(1)]) - - -## ------------ ## -## Data Types. ## -## ------------ ## - -# b4_ints_in(INT1, INT2, LOW, HIGH) -# --------------------------------- -# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise. -m4_define([b4_ints_in], -[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])]) - - - -## ------------------ ## -## Decoding options. ## -## ------------------ ## - -# b4_flag_if(FLAG, IF-TRUE, IF-FALSE) -# ----------------------------------- -# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail. -m4_define([b4_flag_if], -[m4_case(b4_$1_flag, - [0], [$3], - [1], [$2], - [m4_fatal([invalid $1 value: ]$1)])]) - - -# b4_define_flag_if(FLAG) -# ----------------------- -# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the -# value of the Boolean FLAG. -m4_define([b4_define_flag_if], -[_b4_define_flag_if($[1], $[2], [$1])]) - -# _b4_define_flag_if($1, $2, FLAG) -# -------------------------------- -# Work around the impossibility to define macros inside macros, -# because issuing `[$1]' is not possible in M4. GNU M4 should provide -# $$1 a la M5/TeX. -m4_define([_b4_define_flag_if], -[m4_if([$1$2], $[1]$[2], [], - [m4_fatal([$0: Invalid arguments: $@])])dnl -m4_define([b4_$3_if], - [b4_flag_if([$3], [$1], [$2])])]) - - -# b4_FLAG_if(IF-TRUE, IF-FALSE) -# ----------------------------- -# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise. -b4_define_flag_if([defines]) # Whether headers are requested. -b4_define_flag_if([error_verbose]) # Whether error are verbose. -b4_define_flag_if([glr]) # Whether a GLR parser is requested. -b4_define_flag_if([locations]) # Whether locations are tracked. -b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled. -b4_define_flag_if([token_table]) # Whether yytoken_table is demanded. -b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated. - -# yytoken_table is needed to support verbose errors. -b4_error_verbose_if([m4_define([b4_token_table_flag], [1])]) - - - -## ----------- ## -## Synclines. ## -## ----------- ## - -# b4_basename(NAME) -# ----------------- -# Similar to POSIX basename; the differences don't matter here. -# Beware that NAME is not evaluated. -m4_define([b4_basename], -[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])]) - - -# b4_syncline(LINE, FILE) -# ----------------------- -m4_define([b4_syncline], -[b4_flag_if([synclines], -[b4_sync_end([__line__], [b4_basename(m4_quote(__file__))]) -b4_sync_start([$1], [$2])])]) - -m4_define([b4_sync_end], [b4_comment([Line $1 of $2])]) -m4_define([b4_sync_start], [b4_comment([Line $1 of $2])]) - -# b4_user_code(USER-CODE) -# ----------------------- -# Emit code from the user, ending it with synclines. -m4_define([b4_user_code], -[$1 -b4_syncline([@oline@], [@ofile@])]) - - -# b4_define_user_code(MACRO) -# -------------------------- -# From b4_MACRO, build b4_user_MACRO that includes the synclines. -m4_define([b4_define_user_code], -[m4_define([b4_user_$1], -[b4_user_code([b4_$1])])]) - - -# b4_user_actions -# b4_user_initial_action -# b4_user_post_prologue -# b4_user_pre_prologue -# b4_user_stype -# ---------------------- -# Macros that issue user code, ending with synclines. -b4_define_user_code([actions]) -b4_define_user_code([initial_action]) -b4_define_user_code([post_prologue]) -b4_define_user_code([pre_prologue]) -b4_define_user_code([stype]) - - -# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE) -# ----------------------------------------------------- -# Complain if any name of type WHAT is used by the user (as recorded in -# USER-LIST) but is not used by Bison (as recorded by macros in the -# namespace BISON-NAMESPACE). -# -# USER-LIST must expand to a list specifying all user occurrences of all names -# of type WHAT. Each item in the list must be a triplet specifying one -# occurrence: name, start boundary, and end boundary. Empty string names are -# fine. An empty list is fine. -# -# For example, to define b4_foo_user_names to be used for USER-LIST with three -# name occurrences and with correct quoting: -# -# m4_define([b4_foo_user_names], -# [[[[[[bar]], [[parser.y:1.7]], [[parser.y:1.16]]]], -# [[[[bar]], [[parser.y:5.7]], [[parser.y:5.16]]]], -# [[[[baz]], [[parser.y:8.7]], [[parser.y:8.16]]]]]]) -# -# The macro BISON-NAMESPACE(bar) must be defined iff the name bar of type WHAT -# is used by Bison (in the front-end or in the skeleton). Empty string names -# are fine, but it would be ugly for Bison to actually use one. -# -# For example, to use b4_foo_bison_names for BISON-NAMESPACE and define that -# the names bar and baz are used by Bison: -# -# m4_define([b4_foo_bison_names(bar)]) -# m4_define([b4_foo_bison_names(baz)]) -# -# To invoke b4_check_user_names with TYPE foo, with USER-LIST -# b4_foo_user_names, with BISON-NAMESPACE b4_foo_bison_names, and with correct -# quoting: -# -# b4_check_user_names([[foo]], [b4_foo_user_names], -# [[b4_foo_bison_names]]) -m4_define([b4_check_user_names], -[m4_foreach([b4_occurrence], $2, -[m4_pushdef([b4_occurrence], b4_occurrence)dnl -m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl -m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl -m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl -m4_ifndef($3[(]m4_quote(b4_user_name)[)], - [b4_complain_at([b4_start], [b4_end], - [[%s '%s' is not used]], - [$1], [b4_user_name])])[]dnl -m4_popdef([b4_occurrence])dnl -m4_popdef([b4_user_name])dnl -m4_popdef([b4_start])dnl -m4_popdef([b4_end])dnl -])]) - - - - -## --------------------- ## -## b4_percent_define_*. ## -## --------------------- ## - - -# b4_percent_define_use(VARIABLE) -# ------------------------------- -# Declare that VARIABLE was used. -m4_define([b4_percent_define_use], -[m4_define([b4_percent_define_bison_variables(]$1[)])dnl -]) - -# b4_percent_define_get(VARIABLE, [DEFAULT]) -# ------------------------------------------ -# Mimic muscle_percent_define_get in ../src/muscle-tab.h. That is, if -# the %define variable VARIABLE is defined, emit its value. Contrary -# to its C counterpart, return DEFAULT otherwise. Also, record -# Bison's usage of VARIABLE by defining -# b4_percent_define_bison_variables(VARIABLE). -# -# For example: -# -# b4_percent_define_get([[foo]]) -m4_define([b4_percent_define_get], -[b4_percent_define_use([$1])dnl -m4_ifdef([b4_percent_define(]$1[)], - [m4_indir([b4_percent_define(]$1[)])], - [$2])]) - - -# b4_percent_define_get_loc(VARIABLE) -# ----------------------------------- -# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is, -# if the %define variable VARIABLE is undefined, complain fatally since that's -# a Bison or skeleton error. Otherwise, return its definition location in a -# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or -# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no -# reason to suspect that the user-supplied value has yet influenced the output. -# -# For example: -# -# b4_complain_at(b4_percent_define_get_loc([[foo]]), [[invalid foo]]) -m4_define([b4_percent_define_get_loc], -[m4_ifdef([b4_percent_define_loc(]$1[)], - [m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl -b4_loc[]dnl -m4_popdef([b4_loc])], - [b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])]) - -# b4_percent_define_get_syncline(VARIABLE) -# ---------------------------------------- -# Mimic muscle_percent_define_get_syncline in ../src/muscle-tab.h exactly. -# That is, if the %define variable VARIABLE is undefined, complain fatally -# since that's a Bison or skeleton error. Otherwise, return its definition -# location as a b4_syncline invocation. Don't record this as a Bison usage of -# VARIABLE as there's no reason to suspect that the user-supplied value has yet -# influenced the output. -# -# For example: -# -# b4_percent_define_get_syncline([[foo]]) -m4_define([b4_percent_define_get_syncline], -[m4_ifdef([b4_percent_define_syncline(]$1[)], - [m4_indir([b4_percent_define_syncline(]$1[)])], - [b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])]) - -# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE]) -# ------------------------------------------------------ -# Mimic muscle_percent_define_ifdef in ../src/muscle-tab.h exactly. That is, -# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand -# IF-FALSE. Also, record Bison's usage of VARIABLE by defining -# b4_percent_define_bison_variables(VARIABLE). -# -# For example: -# -# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]]) -m4_define([b4_percent_define_ifdef], -[m4_ifdef([b4_percent_define(]$1[)], - [m4_define([b4_percent_define_bison_variables(]$1[)])$2], - [$3])]) - -# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE]) -# -------------------------------------------------------- -# Mimic muscle_percent_define_flag_if in ../src/muscle-tab.h exactly. That is, -# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE. -# If it is defined to "false", expand IF-FALSE. Complain if it is undefined -# (a Bison or skeleton error since the default value should have been set -# already) or defined to any other value (possibly a user error). Also, record -# Bison's usage of VARIABLE by defining -# b4_percent_define_bison_variables(VARIABLE). -# -# For example: -# -# b4_percent_define_flag_if([[foo]], [[it's true]], [[it's false]]) -m4_define([b4_percent_define_flag_if], -[b4_percent_define_ifdef([$1], - [m4_case(b4_percent_define_get([$1]), - [], [$2], [true], [$2], [false], [$3], - [m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]), - [[invalid value for %%define Boolean variable '%s']], - [$1])], - [[b4_percent_define_flag_if($1)]])])], - [b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])]) - -# b4_percent_define_default(VARIABLE, DEFAULT) -# -------------------------------------------- -# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is, -# if the %define variable VARIABLE is undefined, set its value to DEFAULT. -# Don't record this as a Bison usage of VARIABLE as there's no reason to -# suspect that the value has yet influenced the output. -# -# For example: -# -# b4_percent_define_default([[foo]], [[default value]]) -m4_define([b4_percent_define_default], -[m4_ifndef([b4_percent_define(]$1[)], - [m4_define([b4_percent_define(]$1[)], [$2])dnl - m4_define([b4_percent_define_loc(]$1[)], - [[[[:-1.-1]], - [[:-1.-1]]]])dnl - m4_define([b4_percent_define_syncline(]$1[)], [[]])])]) - -# b4_percent_define_check_values(VALUES) -# -------------------------------------- -# Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly -# except that the VALUES structure is more appropriate for M4. That is, VALUES -# is a list of sublists of strings. For each sublist, the first string is the -# name of a %define variable, and all remaining strings in that sublist are the -# valid values for that variable. Complain if such a variable is undefined (a -# Bison error since the default value should have been set already) or defined -# to any other value (possibly a user error). Don't record this as a Bison -# usage of the variable as there's no reason to suspect that the value has yet -# influenced the output. -# -# For example: -# -# b4_percent_define_check_values([[[[foo]], [[foo-value1]], [[foo-value2]]]], -# [[[[bar]], [[bar-value1]]]]) -m4_define([b4_percent_define_check_values], -[m4_foreach([b4_sublist], m4_quote($@), - [_b4_percent_define_check_values(b4_sublist)])]) - -m4_define([_b4_percent_define_check_values], -[m4_ifdef([b4_percent_define(]$1[)], - [m4_pushdef([b4_good_value], [0])dnl - m4_if($#, 1, [], - [m4_foreach([b4_value], m4_dquote(m4_shift($@)), - [m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value, - [m4_define([b4_good_value], [1])])])])dnl - m4_if(b4_good_value, [0], - [b4_complain_at(b4_percent_define_get_loc([$1]), - [[invalid value for %%define variable '%s': '%s']], - [$1], - m4_dquote(m4_indir([b4_percent_define(]$1[)]))) - m4_foreach([b4_value], m4_dquote(m4_shift($@)), - [b4_complain_at(b4_percent_define_get_loc([$1]), - [[accepted value: '%s']], - m4_dquote(b4_value))])])dnl - m4_popdef([b4_good_value])], - [b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])]) - -# b4_percent_code_get([QUALIFIER]) -# -------------------------------- -# If any %code blocks for QUALIFIER are defined, emit them beginning with a -# comment and ending with synclines and a newline. If QUALIFIER is not -# specified or empty, do this for the unqualified %code blocks. Also, record -# Bison's usage of QUALIFIER (if specified) by defining -# b4_percent_code_bison_qualifiers(QUALIFIER). -# -# For example, to emit any unqualified %code blocks followed by any %code -# blocks for the qualifier foo: -# -# b4_percent_code_get -# b4_percent_code_get([[foo]]) -m4_define([b4_percent_code_get], -[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl -m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl -m4_ifdef(b4_macro_name, -[b4_comment([m4_if([$#], [0], [[Unqualified %code]], - [["%code ]$1["]])[ blocks.]]) -b4_user_code([m4_indir(b4_macro_name)]) -])dnl -m4_popdef([b4_macro_name])]) - -# b4_percent_code_ifdef(QUALIFIER, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------- -# If any %code blocks for QUALIFIER (or unqualified %code blocks if -# QUALIFIER is empty) are defined, expand IF-TRUE, else expand IF-FALSE. -# Also, record Bison's usage of QUALIFIER (if specified) by defining -# b4_percent_code_bison_qualifiers(QUALIFIER). -m4_define([b4_percent_code_ifdef], -[m4_ifdef([b4_percent_code(]$1[)], - [m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2], - [$3])]) - - -## ----------------------------------------------------------- ## -## After processing the skeletons, check that all the user's ## -## %define variables and %code qualifiers were used by Bison. ## -## ----------------------------------------------------------- ## - -m4_define([b4_check_user_names_wrap], -[m4_ifdef([b4_percent_]$1[_user_]$2[s], - [b4_check_user_names([[%]$1 $2], - [b4_percent_]$1[_user_]$2[s], - [[b4_percent_]$1[_bison_]$2[s]])])]) - -m4_wrap_lifo([ -b4_check_user_names_wrap([[define]], [[variable]]) -b4_check_user_names_wrap([[code]], [[qualifier]]) -]) - - -## ---------------- ## -## Default values. ## -## ---------------- ## - -# m4_define_default([b4_lex_param], []) dnl breaks other skeletons -m4_define_default([b4_pre_prologue], []) -m4_define_default([b4_post_prologue], []) -m4_define_default([b4_epilogue], []) -m4_define_default([b4_parse_param], []) - -# The initial column and line. -m4_define_default([b4_location_initial_column], [1]) -m4_define_default([b4_location_initial_line], [1]) - -# Sanity checks. -b4_percent_define_ifdef([api.prefix], -[m4_ifdef([b4_prefix], -[b4_complain_at(b4_percent_define_get_loc([api.prefix]), - [['%s' and '%s' cannot be used together]], - [%name-prefix], - [%define api.prefix])])]) diff --git a/tools/data/c++-skel.m4 b/tools/data/c++-skel.m4 deleted file mode 100644 index 149e4300..00000000 --- a/tools/data/c++-skel.m4 +++ /dev/null @@ -1,26 +0,0 @@ - -*- Autoconf -*- - -# C++ skeleton dispatching for Bison. - -# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) -b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) - -m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]]) -m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) - -m4_include(b4_used_skeleton) diff --git a/tools/data/c++.m4 b/tools/data/c++.m4 deleted file mode 100644 index eac88a78..00000000 --- a/tools/data/c++.m4 +++ /dev/null @@ -1,205 +0,0 @@ - -*- Autoconf -*- - -# C++ skeleton for Bison - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_include(b4_pkgdatadir/[c.m4]) - -## ---------------- ## -## Default values. ## -## ---------------- ## - -# Default parser class name. -b4_percent_define_default([[parser_class_name]], [[parser]]) - -# Don't do that so that we remember whether we're using a user -# request, or the default value. -# -# b4_percent_define_default([[api.location.type]], [[location]]) - -b4_percent_define_default([[filename_type]], [[std::string]]) -b4_percent_define_default([[namespace]], m4_defn([b4_prefix])) -b4_percent_define_default([[global_tokens_and_yystype]], [[false]]) -b4_percent_define_default([[define_location_comparison]], - [m4_if(b4_percent_define_get([[filename_type]]), - [std::string], [[true]], [[false]])]) - - -## ----------- ## -## Namespace. ## -## ----------- ## - -m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])]) - -# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it -# would compile as an absolute reference with `parser' in the global namespace. -# b4_namespace_open would open an anonymous namespace and thus establish -# internal linkage. This would compile. However, it's cryptic, and internal -# linkage for the parser would be specified in all translation units that -# include the header, which is always generated. If we ever need to permit -# internal linkage somehow, surely we can find a cleaner approach. -m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), - [[namespace reference is empty]])]) - -# Instead of assuming the C++ compiler will do it, Bison should reject any -# invalid b4_namepsace_ref that would be converted to a valid -# b4_namespace_open. The problem is that Bison doesn't always output -# b4_namespace_ref to uncommented code but should reserve the ability to do so -# in future releases without risking breaking any existing user grammars. -# Specifically, don't allow empty names as b4_namespace_open would just convert -# those into anonymous namespaces, and that might tempt some users. -m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), - [[namespace reference has consecutive "::"]])]) -m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), - [[namespace reference has a trailing "::"]])]) - -m4_define([b4_namespace_open], -[b4_user_code([b4_percent_define_get_syncline([[namespace]]) -[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref), - [^\(.\)[ ]*::], [\1])), - [::], [ { namespace ])[ {]])]) - -m4_define([b4_namespace_close], -[b4_user_code([b4_percent_define_get_syncline([[namespace]]) -m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]), - [^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*], - [\1])), - [::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])]) - - -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- -# Output the definition of the tokens as enums. -m4_define([b4_token_enums], -[/* Tokens. */ - enum yytokentype { -m4_map_sep([ b4_token_enum], [, -], - [$@]) - }; -]) - - - - -## ----------------- ## -## Semantic Values. ## -## ----------------- ## - - -# b4_lhs_value([TYPE]) -# -------------------- -# Expansion of $$. -m4_define([b4_lhs_value], -[(yyval[]m4_ifval([$1], [.$1]))]) - - -# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) -# -------------------------------------- -# Expansion of $NUM, where the current rule has RULE-LENGTH -# symbols on RHS. -m4_define([b4_rhs_value], -[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))]) - -# b4_lhs_location() -# ----------------- -# Expansion of @$. -m4_define([b4_lhs_location], -[(yyloc)]) - - -# b4_rhs_location(RULE-LENGTH, NUM) -# --------------------------------- -# Expansion of @NUM, where the current rule has RULE-LENGTH symbols -# on RHS. -m4_define([b4_rhs_location], -[(yylocation_stack_@{($1) - ($2)@})]) - - -# b4_parse_param_decl -# ------------------- -# Extra formal arguments of the constructor. -# Change the parameter names from "foo" into "foo_yyarg", so that -# there is no collision bw the user chosen attribute name, and the -# argument name in the constructor. -m4_define([b4_parse_param_decl], -[m4_ifset([b4_parse_param], - [m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])]) - -m4_define([b4_parse_param_decl_1], -[$1_yyarg]) - - - -# b4_parse_param_cons -# ------------------- -# Extra initialisations of the constructor. -m4_define([b4_parse_param_cons], - [m4_ifset([b4_parse_param], - [ - b4_cc_constructor_calls(b4_parse_param)])]) -m4_define([b4_cc_constructor_calls], - [m4_map_sep([b4_cc_constructor_call], [, - ], [$@])]) -m4_define([b4_cc_constructor_call], - [$2 ($2_yyarg)]) - -# b4_parse_param_vars -# ------------------- -# Extra instance variables. -m4_define([b4_parse_param_vars], - [m4_ifset([b4_parse_param], - [ - /* User arguments. */ -b4_cc_var_decls(b4_parse_param)])]) -m4_define([b4_cc_var_decls], - [m4_map_sep([b4_cc_var_decl], [ -], [$@])]) -m4_define([b4_cc_var_decl], - [ $1;]) - - -## ---------## -## Values. ## -## ---------## - -# b4_yylloc_default_define -# ------------------------ -# Define YYLLOC_DEFAULT. -m4_define([b4_yylloc_default_define], -[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -# ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (/*CONSTCOND*/ false) -# endif -]]) diff --git a/tools/data/c-like.m4 b/tools/data/c-like.m4 deleted file mode 100644 index 5b96fbaf..00000000 --- a/tools/data/c-like.m4 +++ /dev/null @@ -1,44 +0,0 @@ - -*- Autoconf -*- - -# Common code for C-like languages (C, C++, Java, etc.) - -# Copyright (C) 2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD) -# ---------------------------------------------- -# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD", -# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a -# pointer. -m4_define([b4_dollar_dollar_], -[m4_if([$2], [[]], - [m4_ifval([$3], [($1.$3)], - [$1])], - [($1.$2)])]) - -# b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION) -# b4_dollar_popdef -# --------------------------------------------------------- -# Define b4_dollar_dollar for VALUE and DEFAULT-FIELD, -# and b4_at_dollar for LOCATION. -m4_define([b4_dollar_pushdef], -[m4_pushdef([b4_dollar_dollar], - [b4_dollar_dollar_([$1], m4_dquote($][1), [$2])])dnl -m4_pushdef([b4_at_dollar], [$3])dnl -]) -m4_define([b4_dollar_popdef], -[m4_popdef([b4_at_dollar])dnl -m4_popdef([b4_dollar_dollar])dnl -]) diff --git a/tools/data/c-skel.m4 b/tools/data/c-skel.m4 deleted file mode 100644 index ccd4ae16..00000000 --- a/tools/data/c-skel.m4 +++ /dev/null @@ -1,26 +0,0 @@ - -*- Autoconf -*- - -# C skeleton dispatching for Bison. - -# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) -b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) - -m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]]) -m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) - -m4_include(b4_used_skeleton) diff --git a/tools/data/c.m4 b/tools/data/c.m4 deleted file mode 100644 index b6646062..00000000 --- a/tools/data/c.m4 +++ /dev/null @@ -1,722 +0,0 @@ - -*- Autoconf -*- - -# C M4 Macros for Bison. - -# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_include(b4_pkgdatadir/[c-like.m4]) - -# b4_tocpp(STRING) -# ---------------- -# Convert STRING into a valid C macro name. -m4_define([b4_tocpp], -[m4_toupper(m4_bpatsubst(m4_quote($1), [[^a-zA-Z0-9]+], [_]))]) - - -# b4_cpp_guard(FILE) -# ------------------ -# A valid C macro name to use as a CPP header guard for FILE. -m4_define([b4_cpp_guard], -[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]]) - - -# b4_cpp_guard_open(FILE) -# b4_cpp_guard_close(FILE) -# ------------------------ -# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE. -m4_define([b4_cpp_guard_open], -[m4_ifval(m4_quote($1), -[#ifndef b4_cpp_guard([$1]) -# define b4_cpp_guard([$1])])]) - -m4_define([b4_cpp_guard_close], -[m4_ifval(m4_quote($1), -[#endif b4_comment([!b4_cpp_guard([$1])])])]) - - -## ---------------- ## -## Identification. ## -## ---------------- ## - -# b4_comment(TEXT) -# ---------------- -m4_define([b4_comment], [/* m4_bpatsubst([$1], [ -], [ - ]) */]) - -# b4_identification -# ----------------- -# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or -# b4_pull_flag if they use the values of the %define variables api.pure or -# api.push-pull. -m4_define([b4_identification], -[[/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "]b4_version[" - -/* Skeleton name. */ -#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[ - -/* Pure parsers. */ -#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[ - -/* Push parsers. */ -#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[ - -/* Pull parsers. */ -#define YYPULL ]b4_pull_flag])[ -]]) - - -## ---------------- ## -## Default values. ## -## ---------------- ## - -# b4_api_prefix, b4_api_PREFIX -# ---------------------------- -# Corresponds to %define api.prefix -b4_percent_define_default([[api.prefix]], [[yy]]) -m4_define([b4_api_prefix], -[b4_percent_define_get([[api.prefix]])]) -m4_define([b4_api_PREFIX], -[m4_toupper(b4_api_prefix)]) - - -# b4_prefix -# --------- -# If the %name-prefix is not given, it is api.prefix. -m4_define_default([b4_prefix], [b4_api_prefix]) - -# If the %union is not named, its name is YYSTYPE. -m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE]) - - -## ------------------------ ## -## Pure/impure interfaces. ## -## ------------------------ ## - -# b4_user_args -# ------------ -m4_define([b4_user_args], -[m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])]) - - -# b4_parse_param -# -------------- -# If defined, b4_parse_param arrives double quoted, but below we prefer -# it to be single quoted. -m4_define([b4_parse_param], -b4_parse_param) - - -# b4_parse_param_for(DECL, FORMAL, BODY) -# --------------------------------------- -# Iterate over the user parameters, binding the declaration to DECL, -# the formal name to FORMAL, and evaluating the BODY. -m4_define([b4_parse_param_for], -[m4_foreach([$1_$2], m4_defn([b4_parse_param]), -[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl -m4_pushdef([$2], m4_shift($1_$2))dnl -$3[]dnl -m4_popdef([$2])dnl -m4_popdef([$1])dnl -])]) - -# b4_parse_param_use -# ------------------ -# `YYUSE' all the parse-params. -m4_define([b4_parse_param_use], -[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal); -])dnl -]) - - -## ------------ ## -## Data Types. ## -## ------------ ## - -# b4_int_type(MIN, MAX) -# --------------------- -# Return the smallest int type able to handle numbers ranging from -# MIN to MAX (included). -m4_define([b4_int_type], -[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], - b4_ints_in($@, [-128], [127]), [1], [signed char], - - b4_ints_in($@, [0], [65535]), [1], [unsigned short int], - b4_ints_in($@, [-32768], [32767]), [1], [short int], - - m4_eval([0 <= $1]), [1], [unsigned int], - - [int])]) - - -# b4_int_type_for(NAME) -# --------------------- -# Return the smallest int type able to handle numbers ranging from -# `NAME_min' to `NAME_max' (included). -m4_define([b4_int_type_for], -[b4_int_type($1_min, $1_max)]) - - -# b4_table_value_equals(TABLE, VALUE, LITERAL) -# -------------------------------------------- -# Without inducing a comparison warning from the compiler, check if the -# literal value LITERAL equals VALUE from table TABLE, which must have -# TABLE_min and TABLE_max defined. YYID must be defined as an identity -# function that suppresses warnings about constant conditions. -m4_define([b4_table_value_equals], -[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min]) - || m4_indir([b4_]$1[_max]) < $3), [1], - [[YYID (0)]], - [(!!(($2) == ($3)))])]) - - -## ---------## -## Values. ## -## ---------## - - -# b4_null_define -# -------------- -# Portability issues: define a YY_NULL appropriate for the current -# language (C, C++98, or C++11). -m4_define([b4_null_define], -[# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif[]dnl -]) - - -# b4_null -# ------- -# Return a null pointer constant. -m4_define([b4_null], [YY_NULL]) - - - -## ------------------------- ## -## Assigning token numbers. ## -## ------------------------- ## - -# b4_token_define(TOKEN-NAME, TOKEN-NUMBER) -# ----------------------------------------- -# Output the definition of this token as #define. -m4_define([b4_token_define], -[#define $1 $2 -]) - - -# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ------------------------------------------------------- -# Output the definition of the tokens (if there are) as #defines. -m4_define([b4_token_defines], -[m4_if([$#$1], [1], [], -[/* Tokens. */ -m4_map([b4_token_define], [$@])]) -]) - - -# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER) -# --------------------------------------- -# Output the definition of this token as an enum. -m4_define([b4_token_enum], -[$1 = $2]) - - -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- -# Output the definition of the tokens (if there are) as enums. -m4_define([b4_token_enums], -[m4_if([$#$1], [1], [], -[[/* Tokens. */ -#ifndef ]b4_api_PREFIX[TOKENTYPE -# define ]b4_api_PREFIX[TOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum ]b4_api_prefix[tokentype { -]m4_map_sep([ b4_token_enum], [, -], - [$@])[ - }; -#endif -]])]) - - -# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ------------------------------------------------------------- -# Output the definition of the tokens (if there are any) as enums and, if POSIX -# Yacc is enabled, as #defines. -m4_define([b4_token_enums_defines], -[b4_token_enums($@)b4_yacc_if([b4_token_defines($@)], []) -]) - - - -## --------------------------------------------- ## -## Defining C functions in both K&R and ANSI-C. ## -## --------------------------------------------- ## - - -# b4_modern_c -# ----------- -# A predicate useful in #if to determine whether C is ancient or modern. -# -# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run -# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic -# reasons, but it defines __C99__FUNC__ so check that as well. -# Microsoft C normally doesn't define these macros, but it defines _MSC_VER. -# Consider a C++ compiler to be modern if it defines __cplusplus. -# -m4_define([b4_c_modern], - [[(defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER)]]) - -# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ---------------------------------------------------------- -# Declare the function NAME. -m4_define([b4_c_function_def], -[#if b4_c_modern -b4_c_ansi_function_def($@) -#else -$2 -$1 (b4_c_knr_formal_names(m4_shift2($@))) -b4_c_knr_formal_decls(m4_shift2($@)) -#endif[]dnl -]) - - -# b4_c_ansi_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# --------------------------------------------------------------- -# Declare the function NAME in ANSI. -m4_define([b4_c_ansi_function_def], -[$2 -$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl -]) - - -# b4_c_ansi_formals([DECL1, NAME1], ...) -# -------------------------------------- -# Output the arguments ANSI-C definition. -m4_define([b4_c_ansi_formals], -[m4_if([$#], [0], [void], - [$#$1], [1], [void], - [m4_map_sep([b4_c_ansi_formal], [, ], [$@])])]) - -m4_define([b4_c_ansi_formal], -[$1]) - - -# b4_c_knr_formal_names([DECL1, NAME1], ...) -# ------------------------------------------ -# Output the argument names. -m4_define([b4_c_knr_formal_names], -[m4_map_sep([b4_c_knr_formal_name], [, ], [$@])]) - -m4_define([b4_c_knr_formal_name], -[$2]) - - -# b4_c_knr_formal_decls([DECL1, NAME1], ...) -# ------------------------------------------ -# Output the K&R argument declarations. -m4_define([b4_c_knr_formal_decls], -[m4_map_sep([b4_c_knr_formal_decl], - [ -], - [$@])]) - -m4_define([b4_c_knr_formal_decl], -[ $1;]) - - - -## ------------------------------------------------------------ ## -## Declaring (prototyping) C functions in both K&R and ANSI-C. ## -## ------------------------------------------------------------ ## - - -# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ---------------------------------------------------------------- -# Declare the function NAME ANSI C style. -m4_define([b4_c_ansi_function_decl], -[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl -]) - - - -# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ----------------------------------------------------------- -# Declare the function NAME in both K&R and ANSI C. -m4_define([b4_c_function_decl], -[#if defined __STDC__ || defined __cplusplus -b4_c_ansi_function_decl($@) -#else -$2 $1 (); -#endif[]dnl -]) - - - -## --------------------- ## -## Calling C functions. ## -## --------------------- ## - - -# b4_c_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ----------------------------------------------------------- -# Call the function NAME with arguments NAME1, NAME2 etc. -m4_define([b4_c_function_call], -[$1 (b4_c_args(m4_shift2($@)))[]dnl -]) - - -# b4_c_args([DECL1, NAME1], ...) -# ------------------------------ -# Output the arguments NAME1, NAME2... -m4_define([b4_c_args], -[m4_map_sep([b4_c_arg], [, ], [$@])]) - -m4_define([b4_c_arg], -[$2]) - - -## ----------- ## -## Synclines. ## -## ----------- ## - -# b4_sync_start(LINE, FILE) -# ----------------------- -m4_define([b4_sync_start], [[#]line $1 $2]) - - -## -------------- ## -## User actions. ## -## -------------- ## - -# b4_case(LABEL, STATEMENTS) -# -------------------------- -m4_define([b4_case], -[ case $1: -$2 - break;]) - -# b4_symbol_actions(FILENAME, LINENO, -# SYMBOL-TAG, SYMBOL-NUM, -# SYMBOL-ACTION, SYMBOL-TYPENAME) -# ------------------------------------------------- -# Issue the code for a symbol action (e.g., %printer). -# -# Define b4_dollar_dollar([TYPE-NAME]), and b4_at_dollar, which are -# invoked where $$ and @$ were specified by the user. -m4_define([b4_symbol_actions], -[b4_dollar_pushdef([(*yyvaluep)], [$6], [(*yylocationp)])dnl - case $4: /* $3 */ -b4_syncline([$2], [$1]) - $5; -b4_syncline([@oline@], [@ofile@]) - break; -b4_dollar_popdef[]dnl -]) - - -# b4_yydestruct_generate(FUNCTION-DECLARATOR) -# ------------------------------------------- -# Generate the "yydestruct" function, which declaration is issued using -# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C -# or "b4_c_function_def" for K&R. -m4_define_default([b4_yydestruct_generate], -[[/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -]$1([yydestruct], - [static void], - [[const char *yymsg], [yymsg]], - [[int yytype], [yytype]], - [[YYSTYPE *yyvaluep], [yyvaluep]][]dnl -b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl -m4_ifset([b4_parse_param], [, b4_parse_param]))[ -{ - YYUSE (yyvaluep); -]b4_locations_if([ YYUSE (yylocationp); -])dnl -b4_parse_param_use[]dnl -[ - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { -]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[ - default: - break; - } -}]dnl -]) - - -# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR) -# ------------------------------------------------ -# Generate the "yy_symbol_print" function, which declaration is issued using -# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C -# or "b4_c_function_def" for K&R. -m4_define_default([b4_yy_symbol_print_generate], -[[ -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -]$1([yy_symbol_value_print], - [static void], - [[FILE *yyoutput], [yyoutput]], - [[int yytype], [yytype]], - [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl -b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl -m4_ifset([b4_parse_param], [, b4_parse_param]))[ -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -]b4_locations_if([ YYUSE (yylocationp); -])dnl -b4_parse_param_use[]dnl -[# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { -]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl -[ default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -]$1([yy_symbol_print], - [static void], - [[FILE *yyoutput], [yyoutput]], - [[int yytype], [yytype]], - [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl -b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl -m4_ifset([b4_parse_param], [, b4_parse_param]))[ -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - -]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); -])dnl -[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl -b4_locations_if([, yylocationp])[]b4_user_args[); - YYFPRINTF (yyoutput, ")"); -}]dnl -]) - -## -------------- ## -## Declarations. ## -## -------------- ## - -# b4_declare_yylstype -# ------------------- -# Declarations that might either go into the header (if --defines) or -# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc. -m4_define([b4_declare_yylstype], -[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED -]m4_ifdef([b4_stype], -[[typedef union ]b4_union_name[ -{ -]b4_user_stype[ -} ]b4_api_PREFIX[STYPE; -# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]], -[m4_if(b4_tag_seen_flag, 0, -[[typedef int ]b4_api_PREFIX[STYPE; -# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[ -# define ]b4_api_prefix[stype ]b4_api_PREFIX[STYPE /* obsolescent; will be withdrawn */ -# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1 -#endif]b4_locations_if([[ - -#if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED -typedef struct ]b4_api_PREFIX[LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -} ]b4_api_PREFIX[LTYPE; -# define ]b4_api_prefix[ltype ]b4_api_PREFIX[LTYPE /* obsolescent; will be withdrawn */ -# define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1 -# define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1 -#endif]]) - -b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval; -]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl -]) - -# b4_YYDEBUG_define -# ------------------ -m4_define([b4_YYDEBUG_define], -[[/* Enabling traces. */ -]m4_if(b4_api_prefix, [yy], -[[#ifndef YYDEBUG -# define YYDEBUG ]b4_debug_flag[ -#endif]], -[[#ifndef ]b4_api_PREFIX[DEBUG -# if defined YYDEBUG -# if YYDEBUG -# define ]b4_api_PREFIX[DEBUG 1 -# else -# define ]b4_api_PREFIX[DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define ]b4_api_PREFIX[DEBUG ]b4_debug_flag[ -# endif /* ! defined YYDEBUG */ -#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl -]) - -# b4_declare_yydebug -# ------------------ -m4_define([b4_declare_yydebug], -[b4_YYDEBUG_define[ -#if ]b4_api_PREFIX[DEBUG -extern int ]b4_prefix[debug; -#endif][]dnl -]) - -# b4_yylloc_default_define -# ------------------------ -# Define YYLLOC_DEFAULT. -m4_define([b4_yylloc_default_define], -[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif -]]) - -# b4_yy_location_print_define -# --------------------------- -# Define YY_LOCATION_PRINT. -m4_define([b4_yy_location_print_define], -[b4_locations_if([[ -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -#ifndef YY_LOCATION_PRINT -# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL - -/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ - -__attribute__((__unused__)) -]b4_c_function_def([yy_location_print_], - [static unsigned], - [[FILE *yyo], [yyo]], - [[YYLTYPE const * const yylocp], [yylocp]])[ -{ - unsigned res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) - { - res += fprintf (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); - } - if (0 <= yylocp->last_line) - { - if (yylocp->first_line < yylocp->last_line) - { - res += fprintf (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); - } - else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); - } - return res; - } - -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) - -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif]], -[[/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif]]) -]) - -# b4_yyloc_default -# ---------------- -# Expand to a possible default value for yylloc. -m4_define([b4_yyloc_default], -[[ -# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL - = { ]m4_join([, ], - m4_defn([b4_location_initial_line]), - m4_defn([b4_location_initial_column]), - m4_defn([b4_location_initial_line]), - m4_defn([b4_location_initial_column]))[ } -# endif -]]) diff --git a/tools/data/glr.c b/tools/data/glr.c deleted file mode 100644 index 02a76c21..00000000 --- a/tools/data/glr.c +++ /dev/null @@ -1,2589 +0,0 @@ - -*- C -*- - -# GLR skeleton for Bison - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# If we are loaded by glr.cc, do not override c++.m4 definitions by -# those of c.m4. -m4_if(b4_skeleton, ["glr.c"], - [m4_include(b4_pkgdatadir/[c.m4])]) - -## ---------------- ## -## Default values. ## -## ---------------- ## - -# Stack parameters. -m4_define_default([b4_stack_depth_max], [10000]) -m4_define_default([b4_stack_depth_init], [200]) - - - -## ------------------------ ## -## Pure/impure interfaces. ## -## ------------------------ ## - -b4_define_flag_if([pure]) -# If glr.cc is including this file and thus has already set b4_pure_flag, -# do not change the value of b4_pure_flag, and do not record a use of api.pure. -m4_ifndef([b4_pure_flag], -[b4_percent_define_default([[api.pure]], [[false]]) - m4_define([b4_pure_flag], - [b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])]) - -# b4_user_formals -# --------------- -# The possible parse-params formal arguments preceded by a comma. -# -# This is not shared with yacc.c in c.m4 because GLR relies on ISO C -# formal argument declarations. -m4_define([b4_user_formals], -[m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])]) - - -# b4_lex_param -# ------------ -# Accumule in b4_lex_param all the yylex arguments. -# Yes, this is quite ugly... -m4_define([b4_lex_param], -m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl -b4_locations_if([, [[YYLTYPE *], [&yylloc]]])])dnl -m4_ifdef([b4_lex_param], [, ]b4_lex_param))) - - -# b4_yyerror_args -# --------------- -# Optional effective arguments passed to yyerror: user args plus yylloc, and -# a trailing comma. -m4_define([b4_yyerror_args], -[b4_pure_if([b4_locations_if([yylocp, ])])dnl -m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) - - -# b4_lyyerror_args -# ---------------- -# Same as above, but on the lookahead, hence &yylloc instead of yylocp. -m4_define([b4_lyyerror_args], -[b4_pure_if([b4_locations_if([&yylloc, ])])dnl -m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) - - -# b4_pure_args -# ------------ -# Same as b4_yyerror_args, but with a leading comma. -m4_define([b4_pure_args], -[b4_pure_if([b4_locations_if([, yylocp])])[]b4_user_args]) - - -# b4_lpure_args -# ------------- -# Same as above, but on the lookahead, hence &yylloc instead of yylocp. -m4_define([b4_lpure_args], -[b4_pure_if([b4_locations_if([, &yylloc])])[]b4_user_args]) - - - -# b4_pure_formals -# --------------- -# Arguments passed to yyerror: user formals plus yylocp with leading comma. -m4_define([b4_pure_formals], -[b4_pure_if([b4_locations_if([, YYLTYPE *yylocp])])[]b4_user_formals]) - - -# b4_locuser_formals(LOC = yylocp) -# -------------------------------- -m4_define([b4_locuser_formals], -[b4_locations_if([, YYLTYPE *m4_default([$1], [yylocp])])[]b4_user_formals]) - - -# b4_locuser_args(LOC = yylocp) -# ----------------------------- -m4_define([b4_locuser_args], -[b4_locations_if([, m4_default([$1], [yylocp])])[]b4_user_args]) - - - -## ----------------- ## -## Semantic Values. ## -## ----------------- ## - - -# b4_lhs_value([TYPE]) -# -------------------- -# Expansion of $$. -m4_define([b4_lhs_value], -[((*yyvalp)[]m4_ifval([$1], [.$1]))]) - - -# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) -# -------------------------------------- -# Expansion of $NUM, where the current rule has RULE-LENGTH -# symbols on RHS. -m4_define([b4_rhs_value], -[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3]))]) - - - -## ----------- ## -## Locations. ## -## ----------- ## - -# b4_lhs_location() -# ----------------- -# Expansion of @$. -m4_define([b4_lhs_location], -[(*yylocp)]) - - -# b4_rhs_location(RULE-LENGTH, NUM) -# --------------------------------- -# Expansion of @NUM, where the current rule has RULE-LENGTH symbols -# on RHS. -m4_define([b4_rhs_location], -[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yyloc)]) - - -## -------------- ## -## Declarations. ## -## -------------- ## - -# b4_shared_declarations -# ---------------------- -# Declaration that might either go into the header (if --defines) -# or open coded in the parser body. -m4_define([b4_shared_declarations], -[b4_declare_yydebug[ -]b4_percent_code_get([[requires]])[ -]b4_token_enums(b4_tokens)[ -]b4_declare_yylstype[ -]b4_c_ansi_function_decl(b4_prefix[parse], [int], b4_parse_param)[ -]b4_percent_code_get([[provides]])[]dnl -]) - - -## -------------- ## -## Output files. ## -## -------------- ## - -b4_output_begin([b4_parser_file_name]) -b4_copyright([Skeleton implementation for Bison GLR parsers in C], - [2002-2012])[ - -/* C GLR parser skeleton written by Paul Hilfinger. */ - -]b4_identification - -b4_percent_code_get([[top]])[ -]m4_if(b4_api_prefix, [yy], [], -[[/* Substitute the type names. */ -#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[ -#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[ -]m4_if(b4_prefix, [yy], [], -[[/* Substitute the variable and function names. */ -#define yyparse ]b4_prefix[parse -#define yylex ]b4_prefix[lex -#define yyerror ]b4_prefix[error -#define yylval ]b4_prefix[lval -#define yychar ]b4_prefix[char -#define yydebug ]b4_prefix[debug -#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ -#define yylloc ]b4_prefix[lloc]])])[ - -/* Copy the first part of user declarations. */ -]b4_user_pre_prologue[ - -]b4_null_define[ - -]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], - [b4_shared_declarations])[ - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE ]b4_error_verbose_flag[ -#endif - -/* Default (constant) value used for initialization for null - right-hand sides. Unlike the standard yacc.c template, here we set - the default value of $$ to a zeroed-out value. Since the default - value is undefined, this behavior is technically correct. */ -static YYSTYPE yyval_default;]b4_locations_if([[ -static YYLTYPE yyloc_default][]b4_yyloc_default;])[ - -/* Copy the second part of user declarations. */ -]b4_user_post_prologue -b4_percent_code_get[]dnl - -[#include -#include -#include - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -]b4_c_function_def([YYID], [static int], [[int i], [i]])[ -{ - return i; -} -#endif - -#ifndef YYFREE -# define YYFREE free -#endif -#ifndef YYMALLOC -# define YYMALLOC malloc -#endif -#ifndef YYREALLOC -# define YYREALLOC realloc -#endif - -#define YYSIZEMAX ((size_t) -1) - -#ifdef __cplusplus - typedef bool yybool; -#else - typedef unsigned char yybool; -#endif -#define yytrue 1 -#define yyfalse 0 - -#ifndef YYSETJMP -# include -# define YYJMP_BUF jmp_buf -# define YYSETJMP(Env) setjmp (Env) -/* Pacify clang. */ -# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0)) -#endif - -/*-----------------. -| GCC extensions. | -`-----------------*/ - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -#ifndef YYASSERT -# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0))) -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL ]b4_final_state_number[ -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST ]b4_last[ - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS ]b4_tokens_number[ -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS ]b4_nterms_number[ -/* YYNRULES -- Number of rules. */ -#define YYNRULES ]b4_rules_number[ -/* YYNRULES -- Number of states. */ -#define YYNSTATES ]b4_states_number[ -/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */ -#define YYMAXRHS ]b4_r2_max[ -/* YYMAXLEFT -- Maximum number of symbols to the left of a handle - accessed by $0, $-1, etc., in any rule. */ -#define YYMAXLEFT ]b4_max_left_semantic_context[ - -/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */ -#define YYUNDEFTOK ]b4_undef_token_number[ -#define YYMAXUTOK ]b4_user_token_number_max[ - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const ]b4_int_type_for([b4_translate])[ yytranslate[] = -{ - ]b4_translate[ -}; - -#if ]b4_api_PREFIX[DEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const ]b4_int_type_for([b4_prhs])[ yyprhs[] = -{ - ]b4_prhs[ -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const ]b4_int_type_for([b4_rhs])[ yyrhs[] = -{ - ]b4_rhs[ -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const ]b4_int_type_for([b4_rline])[ yyrline[] = -{ - ]b4_rline[ -}; -#endif - -#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[ -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - ]b4_tname[ -}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const ]b4_int_type_for([b4_r1])[ yyr1[] = -{ - ]b4_r1[ -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const ]b4_int_type_for([b4_r2])[ yyr2[] = -{ - ]b4_r2[ -}; - -/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */ -static const ]b4_int_type_for([b4_dprec])[ yydprec[] = -{ - ]b4_dprec[ -}; - -/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */ -static const ]b4_int_type_for([b4_merger])[ yymerger[] = -{ - ]b4_merger[ -}; - -/* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the default - is an error. */ -static const ]b4_int_type_for([b4_defact])[ yydefact[] = -{ - ]b4_defact[ -}; - -/* YYPDEFGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] = -{ - ]b4_defgoto[ -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF ]b4_pact_ninf[ -static const ]b4_int_type_for([b4_pact])[ yypact[] = -{ - ]b4_pact[ -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] = -{ - ]b4_pgoto[ -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF ]b4_table_ninf[ -static const ]b4_int_type_for([b4_table])[ yytable[] = -{ - ]b4_table[ -}; - -/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of - list of conflicting reductions corresponding to action entry for - state STATE-NUM in yytable. 0 means no conflicts. The list in - yyconfl is terminated by a rule number of 0. */ -static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] = -{ - ]b4_conflict_list_heads[ -}; - -/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by - 0, pointed into by YYCONFLP. */ -]dnl Do not use b4_int_type_for here, since there are places where -dnl pointers onto yyconfl are taken, which type is "short int *". -dnl We probably ought to introduce a type for confl. -[static const short int yyconfl[] = -{ - ]b4_conflicting_rules[ -}; - -static const ]b4_int_type_for([b4_check])[ yycheck[] = -{ - ]b4_check[ -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const ]b4_int_type_for([b4_stos])[ yystos[] = -{ - ]b4_stos[ -}; - -/* Error token number */ -#define YYTERROR 1 - -]b4_locations_if([[ -]b4_yylloc_default_define[ -# define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) -]])[ -]b4_yy_location_print_define[ - -/* YYLEX -- calling `yylex' with the right arguments. */ -#define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[ - -]b4_pure_if( -[ -#undef yynerrs -#define yynerrs (yystackp->yyerrcnt) -#undef yychar -#define yychar (yystackp->yyrawchar) -#undef yylval -#define yylval (yystackp->yyval) -#undef yylloc -#define yylloc (yystackp->yyloc) -m4_if(b4_prefix[], [yy], [], -[#define b4_prefix[]nerrs yynerrs -#define b4_prefix[]char yychar -#define b4_prefix[]lval yylval -#define b4_prefix[]lloc yylloc])], -[YYSTYPE yylval;]b4_locations_if([[ -YYLTYPE yylloc;]])[ - -int yynerrs; -int yychar;])[ - -static const int YYEOF = 0; -static const int YYEMPTY = -2; - -typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; - -#define YYCHK(YYE) \ - do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \ - while (YYID (0)) - -#if ]b4_api_PREFIX[DEBUG - -# ifndef YYFPRINTF -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -]b4_yy_symbol_print_generate([b4_c_ansi_function_def])[ - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; - -#else /* !]b4_api_PREFIX[DEBUG */ - -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) - -#endif /* !]b4_api_PREFIX[DEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH ]b4_stack_depth_init[ -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH ]b4_stack_depth_max[ -#endif - -/* Minimum number of free items on the stack allowed after an - allocation. This is to allow allocation and initialization - to be completed by functions that call yyexpandGLRStack before the - stack is expanded, thus insuring that all necessary pointers get - properly redirected to new data. */ -#define YYHEADROOM 2 - -#ifndef YYSTACKEXPANDABLE -# if (! defined __cplusplus \ - || (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \ - && ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL)) -# define YYSTACKEXPANDABLE 1 -# else -# define YYSTACKEXPANDABLE 0 -# endif -#endif - -#if YYSTACKEXPANDABLE -# define YY_RESERVE_GLRSTACK(Yystack) \ - do { \ - if (Yystack->yyspaceLeft < YYHEADROOM) \ - yyexpandGLRStack (Yystack); \ - } while (YYID (0)) -#else -# define YY_RESERVE_GLRSTACK(Yystack) \ - do { \ - if (Yystack->yyspaceLeft < YYHEADROOM) \ - yyMemoryExhausted (Yystack); \ - } while (YYID (0)) -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static size_t -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return strlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* !YYERROR_VERBOSE */ - -/** State numbers, as in LALR(1) machine */ -typedef int yyStateNum; - -/** Rule numbers, as in LALR(1) machine */ -typedef int yyRuleNum; - -/** Grammar symbol */ -typedef short int yySymbol; - -/** Item references, as in LALR(1) machine */ -typedef short int yyItemNum; - -typedef struct yyGLRState yyGLRState; -typedef struct yyGLRStateSet yyGLRStateSet; -typedef struct yySemanticOption yySemanticOption; -typedef union yyGLRStackItem yyGLRStackItem; -typedef struct yyGLRStack yyGLRStack; - -struct yyGLRState { - /** Type tag: always true. */ - yybool yyisState; - /** Type tag for yysemantics. If true, yysval applies, otherwise - * yyfirstVal applies. */ - yybool yyresolved; - /** Number of corresponding LALR(1) machine state. */ - yyStateNum yylrState; - /** Preceding state in this stack */ - yyGLRState* yypred; - /** Source position of the first token produced by my symbol */ - size_t yyposn; - union { - /** First in a chain of alternative reductions producing the - * non-terminal corresponding to this state, threaded through - * yynext. */ - yySemanticOption* yyfirstVal; - /** Semantic value for this state. */ - YYSTYPE yysval; - } yysemantics;]b4_locations_if([[ - /** Source location for this state. */ - YYLTYPE yyloc;]])[ -}; - -struct yyGLRStateSet { - yyGLRState** yystates; - /** During nondeterministic operation, yylookaheadNeeds tracks which - * stacks have actually needed the current lookahead. During deterministic - * operation, yylookaheadNeeds[0] is not maintained since it would merely - * duplicate yychar != YYEMPTY. */ - yybool* yylookaheadNeeds; - size_t yysize, yycapacity; -}; - -struct yySemanticOption { - /** Type tag: always false. */ - yybool yyisState; - /** Rule number for this reduction */ - yyRuleNum yyrule; - /** The last RHS state in the list of states to be reduced. */ - yyGLRState* yystate; - /** The lookahead for this reduction. */ - int yyrawchar; - YYSTYPE yyval;]b4_locations_if([[ - YYLTYPE yyloc;]])[ - /** Next sibling in chain of options. To facilitate merging, - * options are chained in decreasing order by address. */ - yySemanticOption* yynext; -}; - -/** Type of the items in the GLR stack. The yyisState field - * indicates which item of the union is valid. */ -union yyGLRStackItem { - yyGLRState yystate; - yySemanticOption yyoption; -}; - -struct yyGLRStack { - int yyerrState; -]b4_locations_if([[ /* To compute the location of the error token. */ - yyGLRStackItem yyerror_range[3];]])[ -]b4_pure_if( -[ - int yyerrcnt; - int yyrawchar; - YYSTYPE yyval;]b4_locations_if([[ - YYLTYPE yyloc;]])[ -])[ - YYJMP_BUF yyexception_buffer; - yyGLRStackItem* yyitems; - yyGLRStackItem* yynextFree; - size_t yyspaceLeft; - yyGLRState* yysplitPoint; - yyGLRState* yylastDeleted; - yyGLRStateSet yytops; -}; - -#if YYSTACKEXPANDABLE -static void yyexpandGLRStack (yyGLRStack* yystackp); -#endif - -static void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) - __attribute__ ((__noreturn__)); -static void -yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) -{ - if (yymsg != YY_NULL) - yyerror (]b4_yyerror_args[yymsg); - YYLONGJMP (yystackp->yyexception_buffer, 1); -} - -static void yyMemoryExhausted (yyGLRStack* yystackp) - __attribute__ ((__noreturn__)); -static void -yyMemoryExhausted (yyGLRStack* yystackp) -{ - YYLONGJMP (yystackp->yyexception_buffer, 2); -} - -#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE -/** A printable representation of TOKEN. */ -static inline const char* -yytokenName (yySymbol yytoken) -{ - if (yytoken == YYEMPTY) - return ""; - - return yytname[yytoken]; -} -#endif - -/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting - * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred - * containing the pointer to the next state in the chain. */ -static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__)); -static void -yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) -{ - int i; - yyGLRState *s = yyvsp[yylow0].yystate.yypred; - for (i = yylow0-1; i >= yylow1; i -= 1) - { - YYASSERT (s->yyresolved); - yyvsp[i].yystate.yyresolved = yytrue; - yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;]b4_locations_if([[ - yyvsp[i].yystate.yyloc = s->yyloc;]])[ - s = yyvsp[i].yystate.yypred = s->yypred; - } -} - -/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in - * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1. - * For convenience, always return YYLOW1. */ -static inline int yyfill (yyGLRStackItem *, int *, int, yybool) - __attribute__ ((__unused__)); -static inline int -yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal) -{ - if (!yynormal && yylow1 < *yylow) - { - yyfillin (yyvsp, *yylow, yylow1); - *yylow = yylow1; - } - return yylow1; -} - -/** Perform user action for rule number YYN, with RHS length YYRHSLEN, - * and top stack item YYVSP. YYLVALP points to place to put semantic - * value ($$), and yylocp points to place for location information - * (@@$). Returns yyok for normal return, yyaccept for YYACCEPT, - * yyerr for YYERROR, yyabort for YYABORT. */ -/*ARGSUSED*/ static YYRESULTTAG -yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, - yyGLRStack* yystackp, - YYSTYPE* yyvalp]b4_locuser_formals[) -{ - yybool yynormal __attribute__ ((__unused__)) = - (yystackp->yysplitPoint == YY_NULL); - int yylow; -]b4_parse_param_use[]dnl -[# undef yyerrok -# define yyerrok (yystackp->yyerrState = 0) -# undef YYACCEPT -# define YYACCEPT return yyaccept -# undef YYABORT -# define YYABORT return yyabort -# undef YYERROR -# define YYERROR return yyerrok, yyerr -# undef YYRECOVERING -# define YYRECOVERING() (yystackp->yyerrState != 0) -# undef yyclearin -# define yyclearin (yychar = YYEMPTY) -# undef YYFILL -# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal) -# undef YYBACKUP -# define YYBACKUP(Token, Value) \ - return yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")), \ - yyerrok, yyerr - - yylow = 1; - if (yyrhslen == 0) - *yyvalp = yyval_default; - else - *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;]b4_locations_if([[ - YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen); - yystackp->yyerror_range[1].yystate.yyloc = *yylocp; -]])[ - switch (yyn) - { - ]b4_user_actions[ - default: break; - } - - return yyok; -# undef yyerrok -# undef YYABORT -# undef YYACCEPT -# undef YYERROR -# undef YYBACKUP -# undef yyclearin -# undef YYRECOVERING -} - - -/*ARGSUSED*/ static void -yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) -{ - YYUSE (yy0); - YYUSE (yy1); - - switch (yyn) - { - ]b4_mergers[ - default: break; - } -} - - /* Bison grammar-table manipulation. */ - -]b4_yydestruct_generate([b4_c_ansi_function_def])[ - -/** Number of symbols composing the right hand side of rule #RULE. */ -static inline int -yyrhsLength (yyRuleNum yyrule) -{ - return yyr2[yyrule]; -} - -static void -yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[) -{ - if (yys->yyresolved) - yydestruct (yymsg, yystos[yys->yylrState], - &yys->yysemantics.yysval]b4_locuser_args([&yys->yyloc])[); - else - { -#if ]b4_api_PREFIX[DEBUG - if (yydebug) - { - if (yys->yysemantics.yyfirstVal) - YYFPRINTF (stderr, "%s unresolved ", yymsg); - else - YYFPRINTF (stderr, "%s incomplete ", yymsg); - yy_symbol_print (stderr, yystos[yys->yylrState], - YY_NULL]b4_locuser_args([&yys->yyloc])[); - YYFPRINTF (stderr, "\n"); - } -#endif - - if (yys->yysemantics.yyfirstVal) - { - yySemanticOption *yyoption = yys->yysemantics.yyfirstVal; - yyGLRState *yyrh; - int yyn; - for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule); - yyn > 0; - yyrh = yyrh->yypred, yyn -= 1) - yydestroyGLRState (yymsg, yyrh]b4_user_args[); - } - } -} - -/** Left-hand-side symbol for rule #RULE. */ -static inline yySymbol -yylhsNonterm (yyRuleNum yyrule) -{ - return yyr1[yyrule]; -} - -#define yypact_value_is_default(Yystate) \ - ]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[ - -/** True iff LR state STATE has only a default reduction (regardless - * of token). */ -static inline yybool -yyisDefaultedState (yyStateNum yystate) -{ - return yypact_value_is_default (yypact[yystate]); -} - -/** The default reduction for STATE, assuming it has one. */ -static inline yyRuleNum -yydefaultAction (yyStateNum yystate) -{ - return yydefact[yystate]; -} - -#define yytable_value_is_error(Yytable_value) \ - ]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[ - -/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN. - * Result R means - * R < 0: Reduce on rule -R. - * R = 0: Error. - * R > 0: Shift to state R. - * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of - * conflicting reductions. - */ -static inline void -yygetLRActions (yyStateNum yystate, int yytoken, - int* yyaction, const short int** yyconflicts) -{ - int yyindex = yypact[yystate] + yytoken; - if (yypact_value_is_default (yypact[yystate]) - || yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) - { - *yyaction = -yydefact[yystate]; - *yyconflicts = yyconfl; - } - else if (! yytable_value_is_error (yytable[yyindex])) - { - *yyaction = yytable[yyindex]; - *yyconflicts = yyconfl + yyconflp[yyindex]; - } - else - { - *yyaction = 0; - *yyconflicts = yyconfl + yyconflp[yyindex]; - } -} - -static inline yyStateNum -yyLRgotoState (yyStateNum yystate, yySymbol yylhs) -{ - int yyr; - yyr = yypgoto[yylhs - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate) - return yytable[yyr]; - else - return yydefgoto[yylhs - YYNTOKENS]; -} - -static inline yybool -yyisShiftAction (int yyaction) -{ - return 0 < yyaction; -} - -static inline yybool -yyisErrorAction (int yyaction) -{ - return yyaction == 0; -} - - /* GLRStates */ - -/** Return a fresh GLRStackItem. Callers should call - * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient - * headroom. */ - -static inline yyGLRStackItem* -yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState) -{ - yyGLRStackItem* yynewItem = yystackp->yynextFree; - yystackp->yyspaceLeft -= 1; - yystackp->yynextFree += 1; - yynewItem->yystate.yyisState = yyisState; - return yynewItem; -} - -/** Add a new semantic action that will execute the action for rule - * RULENUM on the semantic values in RHS to the list of - * alternative actions for STATE. Assumes that RHS comes from - * stack #K of *STACKP. */ -static void -yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate, - yyGLRState* rhs, yyRuleNum yyrule) -{ - yySemanticOption* yynewOption = - &yynewGLRStackItem (yystackp, yyfalse)->yyoption; - yynewOption->yystate = rhs; - yynewOption->yyrule = yyrule; - if (yystackp->yytops.yylookaheadNeeds[yyk]) - { - yynewOption->yyrawchar = yychar; - yynewOption->yyval = yylval;]b4_locations_if([ - yynewOption->yyloc = yylloc;])[ - } - else - yynewOption->yyrawchar = YYEMPTY; - yynewOption->yynext = yystate->yysemantics.yyfirstVal; - yystate->yysemantics.yyfirstVal = yynewOption; - - YY_RESERVE_GLRSTACK (yystackp); -} - - /* GLRStacks */ - -/** Initialize SET to a singleton set containing an empty stack. */ -static yybool -yyinitStateSet (yyGLRStateSet* yyset) -{ - yyset->yysize = 1; - yyset->yycapacity = 16; - yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]); - if (! yyset->yystates) - return yyfalse; - yyset->yystates[0] = YY_NULL; - yyset->yylookaheadNeeds = - (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]); - if (! yyset->yylookaheadNeeds) - { - YYFREE (yyset->yystates); - return yyfalse; - } - return yytrue; -} - -static void yyfreeStateSet (yyGLRStateSet* yyset) -{ - YYFREE (yyset->yystates); - YYFREE (yyset->yylookaheadNeeds); -} - -/** Initialize STACK to a single empty stack, with total maximum - * capacity for all stacks of SIZE. */ -static yybool -yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) -{ - yystackp->yyerrState = 0; - yynerrs = 0; - yystackp->yyspaceLeft = yysize; - yystackp->yyitems = - (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]); - if (!yystackp->yyitems) - return yyfalse; - yystackp->yynextFree = yystackp->yyitems; - yystackp->yysplitPoint = YY_NULL; - yystackp->yylastDeleted = YY_NULL; - return yyinitStateSet (&yystackp->yytops); -} - - -#if YYSTACKEXPANDABLE -# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \ - &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE - -/** If STACK is expandable, extend it. WARNING: Pointers into the - stack from outside should be considered invalid after this call. - We always expand when there are 1 or fewer items left AFTER an - allocation, so that we can avoid having external pointers exist - across an allocation. */ -static void -yyexpandGLRStack (yyGLRStack* yystackp) -{ - yyGLRStackItem* yynewItems; - yyGLRStackItem* yyp0, *yyp1; - size_t yynewSize; - size_t yyn; - size_t yysize = yystackp->yynextFree - yystackp->yyitems; - if (YYMAXDEPTH - YYHEADROOM < yysize) - yyMemoryExhausted (yystackp); - yynewSize = 2*yysize; - if (YYMAXDEPTH < yynewSize) - yynewSize = YYMAXDEPTH; - yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]); - if (! yynewItems) - yyMemoryExhausted (yystackp); - for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize; - 0 < yyn; - yyn -= 1, yyp0 += 1, yyp1 += 1) - { - *yyp1 = *yyp0; - if (*(yybool *) yyp0) - { - yyGLRState* yys0 = &yyp0->yystate; - yyGLRState* yys1 = &yyp1->yystate; - if (yys0->yypred != YY_NULL) - yys1->yypred = - YYRELOC (yyp0, yyp1, yys0->yypred, yystate); - if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL) - yys1->yysemantics.yyfirstVal = - YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption); - } - else - { - yySemanticOption* yyv0 = &yyp0->yyoption; - yySemanticOption* yyv1 = &yyp1->yyoption; - if (yyv0->yystate != YY_NULL) - yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate); - if (yyv0->yynext != YY_NULL) - yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption); - } - } - if (yystackp->yysplitPoint != YY_NULL) - yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems, - yystackp->yysplitPoint, yystate); - - for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1) - if (yystackp->yytops.yystates[yyn] != YY_NULL) - yystackp->yytops.yystates[yyn] = - YYRELOC (yystackp->yyitems, yynewItems, - yystackp->yytops.yystates[yyn], yystate); - YYFREE (yystackp->yyitems); - yystackp->yyitems = yynewItems; - yystackp->yynextFree = yynewItems + yysize; - yystackp->yyspaceLeft = yynewSize - yysize; -} -#endif - -static void -yyfreeGLRStack (yyGLRStack* yystackp) -{ - YYFREE (yystackp->yyitems); - yyfreeStateSet (&yystackp->yytops); -} - -/** Assuming that S is a GLRState somewhere on STACK, update the - * splitpoint of STACK, if needed, so that it is at least as deep as - * S. */ -static inline void -yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys) -{ - if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys) - yystackp->yysplitPoint = yys; -} - -/** Invalidate stack #K in STACK. */ -static inline void -yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk) -{ - if (yystackp->yytops.yystates[yyk] != YY_NULL) - yystackp->yylastDeleted = yystackp->yytops.yystates[yyk]; - yystackp->yytops.yystates[yyk] = YY_NULL; -} - -/** Undelete the last stack that was marked as deleted. Can only be - done once after a deletion, and only when all other stacks have - been deleted. */ -static void -yyundeleteLastStack (yyGLRStack* yystackp) -{ - if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0) - return; - yystackp->yytops.yystates[0] = yystackp->yylastDeleted; - yystackp->yytops.yysize = 1; - YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n")); - yystackp->yylastDeleted = YY_NULL; -} - -static inline void -yyremoveDeletes (yyGLRStack* yystackp) -{ - size_t yyi, yyj; - yyi = yyj = 0; - while (yyj < yystackp->yytops.yysize) - { - if (yystackp->yytops.yystates[yyi] == YY_NULL) - { - if (yyi == yyj) - { - YYDPRINTF ((stderr, "Removing dead stacks.\n")); - } - yystackp->yytops.yysize -= 1; - } - else - { - yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi]; - /* In the current implementation, it's unnecessary to copy - yystackp->yytops.yylookaheadNeeds[yyi] since, after - yyremoveDeletes returns, the parser immediately either enters - deterministic operation or shifts a token. However, it doesn't - hurt, and the code might evolve to need it. */ - yystackp->yytops.yylookaheadNeeds[yyj] = - yystackp->yytops.yylookaheadNeeds[yyi]; - if (yyj != yyi) - { - YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n", - (unsigned long int) yyi, (unsigned long int) yyj)); - } - yyj += 1; - } - yyi += 1; - } -} - -/** Shift to a new state on stack #K of STACK, corresponding to LR state - * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */ -static inline void -yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, - size_t yyposn, - YYSTYPE* yyvalp]b4_locations_if([, YYLTYPE* yylocp])[) -{ - yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; - - yynewState->yylrState = yylrState; - yynewState->yyposn = yyposn; - yynewState->yyresolved = yytrue; - yynewState->yypred = yystackp->yytops.yystates[yyk]; - yynewState->yysemantics.yysval = *yyvalp;]b4_locations_if([ - yynewState->yyloc = *yylocp;])[ - yystackp->yytops.yystates[yyk] = yynewState; - - YY_RESERVE_GLRSTACK (yystackp); -} - -/** Shift stack #K of YYSTACK, to a new state corresponding to LR - * state YYLRSTATE, at input position YYPOSN, with the (unresolved) - * semantic value of YYRHS under the action for YYRULE. */ -static inline void -yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, - size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule) -{ - yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; - - yynewState->yylrState = yylrState; - yynewState->yyposn = yyposn; - yynewState->yyresolved = yyfalse; - yynewState->yypred = yystackp->yytops.yystates[yyk]; - yynewState->yysemantics.yyfirstVal = YY_NULL; - yystackp->yytops.yystates[yyk] = yynewState; - - /* Invokes YY_RESERVE_GLRSTACK. */ - yyaddDeferredAction (yystackp, yyk, yynewState, rhs, yyrule); -} - -/** Pop the symbols consumed by reduction #RULE from the top of stack - * #K of STACK, and perform the appropriate semantic action on their - * semantic values. Assumes that all ambiguities in semantic values - * have been previously resolved. Set *VALP to the resulting value, - * and *LOCP to the computed location (if any). Return value is as - * for userAction. */ -static inline YYRESULTTAG -yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, - YYSTYPE* yyvalp]b4_locuser_formals[) -{ - int yynrhs = yyrhsLength (yyrule); - - if (yystackp->yysplitPoint == YY_NULL) - { - /* Standard special case: single stack. */ - yyGLRStackItem* rhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; - YYASSERT (yyk == 0); - yystackp->yynextFree -= yynrhs; - yystackp->yyspaceLeft += yynrhs; - yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate; - return yyuserAction (yyrule, yynrhs, rhs, yystackp, - yyvalp]b4_locuser_args[); - } - else - { - /* At present, doAction is never called in nondeterministic - * mode, so this branch is never taken. It is here in - * anticipation of a future feature that will allow immediate - * evaluation of selected actions in nondeterministic mode. */ - int yyi; - yyGLRState* yys; - yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1]; - yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred - = yystackp->yytops.yystates[yyk];]b4_locations_if([[ - if (yynrhs == 0) - /* Set default location. */ - yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;]])[ - for (yyi = 0; yyi < yynrhs; yyi += 1) - { - yys = yys->yypred; - YYASSERT (yys); - } - yyupdateSplit (yystackp, yys); - yystackp->yytops.yystates[yyk] = yys; - return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, - yystackp, yyvalp]b4_locuser_args[); - } -} - -#if !]b4_api_PREFIX[DEBUG -# define YY_REDUCE_PRINT(Args) -#else -# define YY_REDUCE_PRINT(Args) \ -do { \ - if (yydebug) \ - yy_reduce_print Args; \ -} while (YYID (0)) - -/*----------------------------------------------------------. -| Report that the RULE is going to be reduced on stack #K. | -`----------------------------------------------------------*/ - -/*ARGSUSED*/ static inline void -yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, - YYSTYPE* yyvalp]b4_locuser_formals[) -{ - int yynrhs = yyrhsLength (yyrule); - yybool yynormal __attribute__ ((__unused__)) = - (yystackp->yysplitPoint == YY_NULL); - yyGLRStackItem* yyvsp = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; - int yylow = 1; - int yyi; - YYUSE (yyvalp);]b4_locations_if([ - YYUSE (yylocp);])[ -]b4_parse_param_use[]dnl -[ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n", - (unsigned long int) yyk, yyrule - 1, - (unsigned long int) yyrline[yyrule]); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &]b4_rhs_value(yynrhs, yyi + 1)[ - ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl - b4_user_args[); - YYFPRINTF (stderr, "\n"); - } -} -#endif - -/** Pop items off stack #K of STACK according to grammar rule RULE, - * and push back on the resulting nonterminal symbol. Perform the - * semantic action associated with RULE and store its value with the - * newly pushed state, if FORCEEVAL or if STACK is currently - * unambiguous. Otherwise, store the deferred semantic action with - * the new state. If the new state would have an identical input - * position, LR state, and predecessor to an existing state on the stack, - * it is identified with that existing state, eliminating stack #K from - * the STACK. In this case, the (necessarily deferred) semantic value is - * added to the options for the existing state's semantic value. - */ -static inline YYRESULTTAG -yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, - yybool yyforceEval]b4_user_formals[) -{ - size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn; - - if (yyforceEval || yystackp->yysplitPoint == YY_NULL) - { - YYSTYPE yysval;]b4_locations_if([ - YYLTYPE yyloc;])[ - - YY_REDUCE_PRINT ((yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[)); - YYCHK (yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[)); - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc); - yyglrShift (yystackp, yyk, - yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState, - yylhsNonterm (yyrule)), - yyposn, &yysval]b4_locations_if([, &yyloc])[); - } - else - { - size_t yyi; - int yyn; - yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk]; - yyStateNum yynewLRState; - - for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule); - 0 < yyn; yyn -= 1) - { - yys = yys->yypred; - YYASSERT (yys); - } - yyupdateSplit (yystackp, yys); - yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule)); - YYDPRINTF ((stderr, - "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n", - (unsigned long int) yyk, yyrule - 1, yynewLRState)); - for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) - if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL) - { - yyGLRState *yysplit = yystackp->yysplitPoint; - yyGLRState *yyp = yystackp->yytops.yystates[yyi]; - while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn) - { - if (yyp->yylrState == yynewLRState && yyp->yypred == yys) - { - yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule); - yymarkStackDeleted (yystackp, yyk); - YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n", - (unsigned long int) yyk, - (unsigned long int) yyi)); - return yyok; - } - yyp = yyp->yypred; - } - } - yystackp->yytops.yystates[yyk] = yys; - yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule); - } - return yyok; -} - -static size_t -yysplitStack (yyGLRStack* yystackp, size_t yyk) -{ - if (yystackp->yysplitPoint == YY_NULL) - { - YYASSERT (yyk == 0); - yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; - } - if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity) - { - yyGLRState** yynewStates; - yybool* yynewLookaheadNeeds; - - yynewStates = YY_NULL; - - if (yystackp->yytops.yycapacity - > (YYSIZEMAX / (2 * sizeof yynewStates[0]))) - yyMemoryExhausted (yystackp); - yystackp->yytops.yycapacity *= 2; - - yynewStates = - (yyGLRState**) YYREALLOC (yystackp->yytops.yystates, - (yystackp->yytops.yycapacity - * sizeof yynewStates[0])); - if (yynewStates == YY_NULL) - yyMemoryExhausted (yystackp); - yystackp->yytops.yystates = yynewStates; - - yynewLookaheadNeeds = - (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds, - (yystackp->yytops.yycapacity - * sizeof yynewLookaheadNeeds[0])); - if (yynewLookaheadNeeds == YY_NULL) - yyMemoryExhausted (yystackp); - yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; - } - yystackp->yytops.yystates[yystackp->yytops.yysize] - = yystackp->yytops.yystates[yyk]; - yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize] - = yystackp->yytops.yylookaheadNeeds[yyk]; - yystackp->yytops.yysize += 1; - return yystackp->yytops.yysize-1; -} - -/** True iff Y0 and Y1 represent identical options at the top level. - * That is, they represent the same rule applied to RHS symbols - * that produce the same terminal symbols. */ -static yybool -yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1) -{ - if (yyy0->yyrule == yyy1->yyrule) - { - yyGLRState *yys0, *yys1; - int yyn; - for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, - yyn = yyrhsLength (yyy0->yyrule); - yyn > 0; - yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) - if (yys0->yyposn != yys1->yyposn) - return yyfalse; - return yytrue; - } - else - return yyfalse; -} - -/** Assuming identicalOptions (Y0,Y1), destructively merge the - * alternative semantic values for the RHS-symbols of Y1 and Y0. */ -static void -yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1) -{ - yyGLRState *yys0, *yys1; - int yyn; - for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, - yyn = yyrhsLength (yyy0->yyrule); - yyn > 0; - yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) - { - if (yys0 == yys1) - break; - else if (yys0->yyresolved) - { - yys1->yyresolved = yytrue; - yys1->yysemantics.yysval = yys0->yysemantics.yysval; - } - else if (yys1->yyresolved) - { - yys0->yyresolved = yytrue; - yys0->yysemantics.yysval = yys1->yysemantics.yysval; - } - else - { - yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal; - yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal; - while (YYID (yytrue)) - { - if (yyz1 == *yyz0p || yyz1 == YY_NULL) - break; - else if (*yyz0p == YY_NULL) - { - *yyz0p = yyz1; - break; - } - else if (*yyz0p < yyz1) - { - yySemanticOption* yyz = *yyz0p; - *yyz0p = yyz1; - yyz1 = yyz1->yynext; - (*yyz0p)->yynext = yyz; - } - yyz0p = &(*yyz0p)->yynext; - } - yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal; - } - } -} - -/** Y0 and Y1 represent two possible actions to take in a given - * parsing state; return 0 if no combination is possible, - * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */ -static int -yypreference (yySemanticOption* y0, yySemanticOption* y1) -{ - yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule; - int p0 = yydprec[r0], p1 = yydprec[r1]; - - if (p0 == p1) - { - if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1]) - return 0; - else - return 1; - } - if (p0 == 0 || p1 == 0) - return 0; - if (p0 < p1) - return 3; - if (p1 < p0) - return 2; - return 0; -} - -static YYRESULTTAG yyresolveValue (yyGLRState* yys, - yyGLRStack* yystackp]b4_user_formals[); - - -/** Resolve the previous N states starting at and including state S. If result - * != yyok, some states may have been left unresolved possibly with empty - * semantic option chains. Regardless of whether result = yyok, each state - * has been left with consistent data so that yydestroyGLRState can be invoked - * if necessary. */ -static YYRESULTTAG -yyresolveStates (yyGLRState* yys, int yyn, - yyGLRStack* yystackp]b4_user_formals[) -{ - if (0 < yyn) - { - YYASSERT (yys->yypred); - YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[)); - if (! yys->yyresolved) - YYCHK (yyresolveValue (yys, yystackp]b4_user_args[)); - } - return yyok; -} - -/** Resolve the states for the RHS of OPT, perform its user action, and return - * the semantic value and location. Regardless of whether result = yyok, all - * RHS states have been destroyed (assuming the user action destroys all RHS - * semantic values if invoked). */ -static YYRESULTTAG -yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp, - YYSTYPE* yyvalp]b4_locuser_formals[) -{ - yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1]; - int yynrhs = yyrhsLength (yyopt->yyrule); - YYRESULTTAG yyflag = - yyresolveStates (yyopt->yystate, yynrhs, yystackp]b4_user_args[); - if (yyflag != yyok) - { - yyGLRState *yys; - for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1) - yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[); - return yyflag; - } - - yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;]b4_locations_if([[ - if (yynrhs == 0) - /* Set default location. */ - yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yyopt->yystate->yyloc;]])[ - { - int yychar_current = yychar; - YYSTYPE yylval_current = yylval;]b4_locations_if([ - YYLTYPE yylloc_current = yylloc;])[ - yychar = yyopt->yyrawchar; - yylval = yyopt->yyval;]b4_locations_if([ - yylloc = yyopt->yyloc;])[ - yyflag = yyuserAction (yyopt->yyrule, yynrhs, - yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, - yystackp, yyvalp]b4_locuser_args[); - yychar = yychar_current; - yylval = yylval_current;]b4_locations_if([ - yylloc = yylloc_current;])[ - } - return yyflag; -} - -#if ]b4_api_PREFIX[DEBUG -static void -yyreportTree (yySemanticOption* yyx, int yyindent) -{ - int yynrhs = yyrhsLength (yyx->yyrule); - int yyi; - yyGLRState* yys; - yyGLRState* yystates[1 + YYMAXRHS]; - yyGLRState yyleftmost_state; - - for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred) - yystates[yyi] = yys; - if (yys == YY_NULL) - { - yyleftmost_state.yyposn = 0; - yystates[0] = &yyleftmost_state; - } - else - yystates[0] = yys; - - if (yyx->yystate->yyposn < yys->yyposn + 1) - YYFPRINTF (stderr, "%*s%s -> \n", - yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), - yyx->yyrule - 1); - else - YYFPRINTF (stderr, "%*s%s -> \n", - yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), - yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1), - (unsigned long int) yyx->yystate->yyposn); - for (yyi = 1; yyi <= yynrhs; yyi += 1) - { - if (yystates[yyi]->yyresolved) - { - if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn) - YYFPRINTF (stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1])); - else - YYFPRINTF (stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]), - (unsigned long int) (yystates[yyi - 1]->yyposn + 1), - (unsigned long int) yystates[yyi]->yyposn); - } - else - yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2); - } -} -#endif - -/*ARGSUSED*/ static YYRESULTTAG -yyreportAmbiguity (yySemanticOption* yyx0, - yySemanticOption* yyx1]b4_pure_formals[) -{ - YYUSE (yyx0); - YYUSE (yyx1); - -#if ]b4_api_PREFIX[DEBUG - YYFPRINTF (stderr, "Ambiguity detected.\n"); - YYFPRINTF (stderr, "Option 1,\n"); - yyreportTree (yyx0, 2); - YYFPRINTF (stderr, "\nOption 2,\n"); - yyreportTree (yyx1, 2); - YYFPRINTF (stderr, "\n"); -#endif - - yyerror (]b4_yyerror_args[YY_("syntax is ambiguous")); - return yyabort; -}]b4_locations_if([[ - -/** Starting at and including state S1, resolve the location for each of the - * previous N1 states that is unresolved. The first semantic option of a state - * is always chosen. */ -static void -yyresolveLocations (yyGLRState* yys1, int yyn1, - yyGLRStack *yystackp]b4_user_formals[) -{ - if (0 < yyn1) - { - yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp]b4_user_args[); - if (!yys1->yyresolved) - { - yyGLRStackItem yyrhsloc[1 + YYMAXRHS]; - int yynrhs; - yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal; - YYASSERT (yyoption != YY_NULL); - yynrhs = yyrhsLength (yyoption->yyrule); - if (yynrhs > 0) - { - yyGLRState *yys; - int yyn; - yyresolveLocations (yyoption->yystate, yynrhs, - yystackp]b4_user_args[); - for (yys = yyoption->yystate, yyn = yynrhs; - yyn > 0; - yys = yys->yypred, yyn -= 1) - yyrhsloc[yyn].yystate.yyloc = yys->yyloc; - } - else - { - /* Both yyresolveAction and yyresolveLocations traverse the GSS - in reverse rightmost order. It is only necessary to invoke - yyresolveLocations on a subforest for which yyresolveAction - would have been invoked next had an ambiguity not been - detected. Thus the location of the previous state (but not - necessarily the previous state itself) is guaranteed to be - resolved already. */ - yyGLRState *yyprevious = yyoption->yystate; - yyrhsloc[0].yystate.yyloc = yyprevious->yyloc; - } - { - int yychar_current = yychar; - YYSTYPE yylval_current = yylval; - YYLTYPE yylloc_current = yylloc; - yychar = yyoption->yyrawchar; - yylval = yyoption->yyval; - yylloc = yyoption->yyloc; - YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs); - yychar = yychar_current; - yylval = yylval_current; - yylloc = yylloc_current; - } - } - } -}]])[ - -/** Resolve the ambiguity represented in state S, perform the indicated - * actions, and set the semantic value of S. If result != yyok, the chain of - * semantic options in S has been cleared instead or it has been left - * unmodified except that redundant options may have been removed. Regardless - * of whether result = yyok, S has been left with consistent data so that - * yydestroyGLRState can be invoked if necessary. */ -static YYRESULTTAG -yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) -{ - yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal; - yySemanticOption* yybest = yyoptionList; - yySemanticOption** yypp; - yybool yymerge = yyfalse; - YYSTYPE yysval; - YYRESULTTAG yyflag;]b4_locations_if([ - YYLTYPE *yylocp = &yys->yyloc;])[ - - for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; ) - { - yySemanticOption* yyp = *yypp; - - if (yyidenticalOptions (yybest, yyp)) - { - yymergeOptionSets (yybest, yyp); - *yypp = yyp->yynext; - } - else - { - switch (yypreference (yybest, yyp)) - { - case 0:]b4_locations_if([[ - yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[ - return yyreportAmbiguity (yybest, yyp]b4_pure_args[); - break; - case 1: - yymerge = yytrue; - break; - case 2: - break; - case 3: - yybest = yyp; - yymerge = yyfalse; - break; - default: - /* This cannot happen so it is not worth a YYASSERT (yyfalse), - but some compilers complain if the default case is - omitted. */ - break; - } - yypp = &yyp->yynext; - } - } - - if (yymerge) - { - yySemanticOption* yyp; - int yyprec = yydprec[yybest->yyrule]; - yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[); - if (yyflag == yyok) - for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext) - { - if (yyprec == yydprec[yyp->yyrule]) - { - YYSTYPE yysval_other;]b4_locations_if([ - YYLTYPE yydummy;])[ - yyflag = yyresolveAction (yyp, yystackp, &yysval_other]b4_locuser_args([&yydummy])[); - if (yyflag != yyok) - { - yydestruct ("Cleanup: discarding incompletely merged value for", - yystos[yys->yylrState], - &yysval]b4_locuser_args[); - break; - } - yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other); - } - } - } - else - yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args([yylocp])[); - - if (yyflag == yyok) - { - yys->yyresolved = yytrue; - yys->yysemantics.yysval = yysval; - } - else - yys->yysemantics.yyfirstVal = YY_NULL; - return yyflag; -} - -static YYRESULTTAG -yyresolveStack (yyGLRStack* yystackp]b4_user_formals[) -{ - if (yystackp->yysplitPoint != YY_NULL) - { - yyGLRState* yys; - int yyn; - - for (yyn = 0, yys = yystackp->yytops.yystates[0]; - yys != yystackp->yysplitPoint; - yys = yys->yypred, yyn += 1) - continue; - YYCHK (yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp - ]b4_user_args[)); - } - return yyok; -} - -static void -yycompressStack (yyGLRStack* yystackp) -{ - yyGLRState* yyp, *yyq, *yyr; - - if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL) - return; - - for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL; - yyp != yystackp->yysplitPoint; - yyr = yyp, yyp = yyq, yyq = yyp->yypred) - yyp->yypred = yyr; - - yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; - yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; - yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; - yystackp->yysplitPoint = YY_NULL; - yystackp->yylastDeleted = YY_NULL; - - while (yyr != YY_NULL) - { - yystackp->yynextFree->yystate = *yyr; - yyr = yyr->yypred; - yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate; - yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate; - yystackp->yynextFree += 1; - yystackp->yyspaceLeft -= 1; - } -} - -static YYRESULTTAG -yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, - size_t yyposn]b4_pure_formals[) -{ - int yyaction; - const short int* yyconflicts; - yyRuleNum yyrule; - - while (yystackp->yytops.yystates[yyk] != YY_NULL) - { - yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState; - YYDPRINTF ((stderr, "Stack %lu Entering state %d\n", - (unsigned long int) yyk, yystate)); - - YYASSERT (yystate != YYFINAL); - - if (yyisDefaultedState (yystate)) - { - yyrule = yydefaultAction (yystate); - if (yyrule == 0) - { - YYDPRINTF ((stderr, "Stack %lu dies.\n", - (unsigned long int) yyk)); - yymarkStackDeleted (yystackp, yyk); - return yyok; - } - YYCHK (yyglrReduce (yystackp, yyk, yyrule, yyfalse]b4_user_args[)); - } - else - { - yySymbol yytoken; - yystackp->yytops.yylookaheadNeeds[yyk] = yytrue; - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); - - while (*yyconflicts != 0) - { - size_t yynewStack = yysplitStack (yystackp, yyk); - YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n", - (unsigned long int) yynewStack, - (unsigned long int) yyk)); - YYCHK (yyglrReduce (yystackp, yynewStack, - *yyconflicts, yyfalse]b4_user_args[)); - YYCHK (yyprocessOneStack (yystackp, yynewStack, - yyposn]b4_pure_args[)); - yyconflicts += 1; - } - - if (yyisShiftAction (yyaction)) - break; - else if (yyisErrorAction (yyaction)) - { - YYDPRINTF ((stderr, "Stack %lu dies.\n", - (unsigned long int) yyk)); - yymarkStackDeleted (yystackp, yyk); - break; - } - else - YYCHK (yyglrReduce (yystackp, yyk, -yyaction, - yyfalse]b4_user_args[)); - } - } - return yyok; -} - -/*ARGSUSED*/ static void -yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) -{ - if (yystackp->yyerrState != 0) - return; -#if ! YYERROR_VERBOSE - yyerror (]b4_lyyerror_args[YY_("syntax error")); -#else - { - yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken)); - size_t yysize = yysize0; - yybool yysize_overflow = yyfalse; - char* yymsg = YY_NULL; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[yystackp->yytops.yystates[0]->yylrState]; - yyarg[yycount++] = yytokenName (yytoken); - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for this - state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytokenName (yyx); - { - size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx)); - yysize_overflow |= yysz < yysize; - yysize = yysz; - } - } - } - } - - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - { - size_t yysz = yysize + strlen (yyformat); - yysize_overflow |= yysz < yysize; - yysize = yysz; - } - - if (!yysize_overflow) - yymsg = (char *) YYMALLOC (yysize); - - if (yymsg) - { - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyformat)) - { - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - yyerror (]b4_lyyerror_args[yymsg); - YYFREE (yymsg); - } - else - { - yyerror (]b4_lyyerror_args[YY_("syntax error")); - yyMemoryExhausted (yystackp); - } - } -#endif /* YYERROR_VERBOSE */ - yynerrs += 1; -} - -/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP, - yylval, and yylloc are the syntactic category, semantic value, and location - of the lookahead. */ -/*ARGSUSED*/ static void -yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) -{ - size_t yyk; - int yyj; - - if (yystackp->yyerrState == 3) - /* We just shifted the error token and (perhaps) took some - reductions. Skip tokens until we can proceed. */ - while (YYID (yytrue)) - { - yySymbol yytoken; - if (yychar == YYEOF) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); - if (yychar != YYEMPTY) - {]b4_locations_if([[ - /* We throw away the lookahead, but the error range - of the shifted error token must take it into account. */ - yyGLRState *yys = yystackp->yytops.yystates[0]; - yyGLRStackItem yyerror_range[3]; - yyerror_range[1].yystate.yyloc = yys->yyloc; - yyerror_range[2].yystate.yyloc = yylloc; - YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);]])[ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Error: discarding", - yytoken, &yylval]b4_locuser_args([&yylloc])[); - } - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - yyj = yypact[yystackp->yytops.yystates[0]->yylrState]; - if (yypact_value_is_default (yyj)) - return; - yyj += yytoken; - if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken) - { - if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0) - return; - } - else if (! yytable_value_is_error (yytable[yyj])) - return; - } - - /* Reduce to one stack. */ - for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1) - if (yystackp->yytops.yystates[yyk] != YY_NULL) - break; - if (yyk >= yystackp->yytops.yysize) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); - for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1) - yymarkStackDeleted (yystackp, yyk); - yyremoveDeletes (yystackp); - yycompressStack (yystackp); - - /* Now pop stack until we find a state that shifts the error token. */ - yystackp->yyerrState = 3; - while (yystackp->yytops.yystates[0] != YY_NULL) - { - yyGLRState *yys = yystackp->yytops.yystates[0]; - yyj = yypact[yys->yylrState]; - if (! yypact_value_is_default (yyj)) - { - yyj += YYTERROR; - if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR - && yyisShiftAction (yytable[yyj])) - { - /* Shift the error token. */]b4_locations_if([[ - /* First adjust its location.*/ - YYLTYPE yyerrloc; - yystackp->yyerror_range[2].yystate.yyloc = yylloc; - YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);]])[ - YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]], - &yylval, &yyerrloc); - yyglrShift (yystackp, 0, yytable[yyj], - yys->yyposn, &yylval]b4_locations_if([, &yyerrloc])[); - yys = yystackp->yytops.yystates[0]; - break; - } - }]b4_locations_if([[ - yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[ - if (yys->yypred != YY_NULL) - yydestroyGLRState ("Error: popping", yys]b4_user_args[); - yystackp->yytops.yystates[0] = yys->yypred; - yystackp->yynextFree -= 1; - yystackp->yyspaceLeft += 1; - } - if (yystackp->yytops.yystates[0] == YY_NULL) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); -} - -#define YYCHK1(YYE) \ - do { \ - switch (YYE) { \ - case yyok: \ - break; \ - case yyabort: \ - goto yyabortlab; \ - case yyaccept: \ - goto yyacceptlab; \ - case yyerr: \ - goto yyuser_error; \ - default: \ - goto yybuglab; \ - } \ - } while (YYID (0)) - - -/*----------. -| yyparse. | -`----------*/ - -]b4_c_ansi_function_def([yyparse], [int], b4_parse_param)[ -{ - int yyresult; - yyGLRStack yystack; - yyGLRStack* const yystackp = &yystack; - size_t yyposn; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yychar = YYEMPTY; - yylval = yyval_default;]b4_locations_if([ - yylloc = yyloc_default;])[ -]m4_ifdef([b4_initial_action], [ -b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action -b4_dollar_popdef])[]dnl -[ - if (! yyinitGLRStack (yystackp, YYINITDEPTH)) - goto yyexhaustedlab; - switch (YYSETJMP (yystack.yyexception_buffer)) - { - case 0: break; - case 1: goto yyabortlab; - case 2: goto yyexhaustedlab; - default: goto yybuglab; - } - yyglrShift (&yystack, 0, 0, 0, &yylval]b4_locations_if([, &yylloc])[); - yyposn = 0; - - while (YYID (yytrue)) - { - /* For efficiency, we have two loops, the first of which is - specialized to deterministic operation (single stack, no - potential ambiguity). */ - /* Standard mode */ - while (YYID (yytrue)) - { - yyRuleNum yyrule; - int yyaction; - const short int* yyconflicts; - - yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - goto yyacceptlab; - if (yyisDefaultedState (yystate)) - { - yyrule = yydefaultAction (yystate); - if (yyrule == 0) - { -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ - yyreportSyntaxError (&yystack]b4_user_args[); - goto yyuser_error; - } - YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_user_args[)); - } - else - { - yySymbol yytoken; - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); - if (*yyconflicts != 0) - break; - if (yyisShiftAction (yyaction)) - { - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - yychar = YYEMPTY; - yyposn += 1; - yyglrShift (&yystack, 0, yyaction, yyposn, &yylval]b4_locations_if([, &yylloc])[); - if (0 < yystack.yyerrState) - yystack.yyerrState -= 1; - } - else if (yyisErrorAction (yyaction)) - { -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ - yyreportSyntaxError (&yystack]b4_user_args[); - goto yyuser_error; - } - else - YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue]b4_user_args[)); - } - } - - while (YYID (yytrue)) - { - yySymbol yytoken_to_shift; - size_t yys; - - for (yys = 0; yys < yystack.yytops.yysize; yys += 1) - yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY; - - /* yyprocessOneStack returns one of three things: - - - An error flag. If the caller is yyprocessOneStack, it - immediately returns as well. When the caller is finally - yyparse, it jumps to an error label via YYCHK1. - - - yyok, but yyprocessOneStack has invoked yymarkStackDeleted - (&yystack, yys), which sets the top state of yys to NULL. Thus, - yyparse's following invocation of yyremoveDeletes will remove - the stack. - - - yyok, when ready to shift a token. - - Except in the first case, yyparse will invoke yyremoveDeletes and - then shift the next token onto all remaining stacks. This - synchronization of the shift (that is, after all preceding - reductions on all stacks) helps prevent double destructor calls - on yylval in the event of memory exhaustion. */ - - for (yys = 0; yys < yystack.yytops.yysize; yys += 1) - YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn]b4_lpure_args[)); - yyremoveDeletes (&yystack); - if (yystack.yytops.yysize == 0) - { - yyundeleteLastStack (&yystack); - if (yystack.yytops.yysize == 0) - yyFail (&yystack][]b4_lpure_args[, YY_("syntax error")); - YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); - YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ - yyreportSyntaxError (&yystack]b4_user_args[); - goto yyuser_error; - } - - /* If any yyglrShift call fails, it will fail after shifting. Thus, - a copy of yylval will already be on stack 0 in the event of a - failure in the following loop. Thus, yychar is set to YYEMPTY - before the loop to make sure the user destructor for yylval isn't - called twice. */ - yytoken_to_shift = YYTRANSLATE (yychar); - yychar = YYEMPTY; - yyposn += 1; - for (yys = 0; yys < yystack.yytops.yysize; yys += 1) - { - int yyaction; - const short int* yyconflicts; - yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState; - yygetLRActions (yystate, yytoken_to_shift, &yyaction, - &yyconflicts); - /* Note that yyconflicts were handled by yyprocessOneStack. */ - YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys)); - YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc); - yyglrShift (&yystack, yys, yyaction, yyposn, - &yylval]b4_locations_if([, &yylloc])[); - YYDPRINTF ((stderr, "Stack %lu now in state #%d\n", - (unsigned long int) yys, - yystack.yytops.yystates[yys]->yylrState)); - } - - if (yystack.yytops.yysize == 1) - { - YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); - YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); - yycompressStack (&yystack); - break; - } - } - continue; - yyuser_error: - yyrecoverSyntaxError (&yystack]b4_user_args[); - yyposn = yystack.yytops.yystates[0]->yyposn; - } - - yyacceptlab: - yyresult = 0; - goto yyreturn; - - yybuglab: - YYASSERT (yyfalse); - goto yyabortlab; - - yyabortlab: - yyresult = 1; - goto yyreturn; - - yyexhaustedlab: - yyerror (]b4_lyyerror_args[YY_("memory exhausted")); - yyresult = 2; - goto yyreturn; - - yyreturn: - if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - YYTRANSLATE (yychar), &yylval]b4_locuser_args([&yylloc])[); - - /* If the stack is well-formed, pop the stack until it is empty, - destroying its entries as we go. But free the stack regardless - of whether it is well-formed. */ - if (yystack.yyitems) - { - yyGLRState** yystates = yystack.yytops.yystates; - if (yystates) - { - size_t yysize = yystack.yytops.yysize; - size_t yyk; - for (yyk = 0; yyk < yysize; yyk += 1) - if (yystates[yyk]) - { - while (yystates[yyk]) - { - yyGLRState *yys = yystates[yyk]; -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]] -)[ if (yys->yypred != YY_NULL) - yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[); - yystates[yyk] = yys->yypred; - yystack.yynextFree -= 1; - yystack.yyspaceLeft += 1; - } - break; - } - } - yyfreeGLRStack (&yystack); - } - - /* Make sure YYID is used. */ - return YYID (yyresult); -} - -/* DEBUGGING ONLY */ -#if ]b4_api_PREFIX[DEBUG -static void yypstack (yyGLRStack* yystackp, size_t yyk) - __attribute__ ((__unused__)); -static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__)); - -static void -yy_yypstack (yyGLRState* yys) -{ - if (yys->yypred) - { - yy_yypstack (yys->yypred); - YYFPRINTF (stderr, " -> "); - } - YYFPRINTF (stderr, "%d@@%lu", yys->yylrState, - (unsigned long int) yys->yyposn); -} - -static void -yypstates (yyGLRState* yyst) -{ - if (yyst == YY_NULL) - YYFPRINTF (stderr, ""); - else - yy_yypstack (yyst); - YYFPRINTF (stderr, "\n"); -} - -static void -yypstack (yyGLRStack* yystackp, size_t yyk) -{ - yypstates (yystackp->yytops.yystates[yyk]); -} - -#define YYINDEX(YYX) \ - ((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems) - - -static void -yypdumpstack (yyGLRStack* yystackp) -{ - yyGLRStackItem* yyp; - size_t yyi; - for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1) - { - YYFPRINTF (stderr, "%3lu. ", - (unsigned long int) (yyp - yystackp->yyitems)); - if (*(yybool *) yyp) - { - YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld", - yyp->yystate.yyresolved, yyp->yystate.yylrState, - (unsigned long int) yyp->yystate.yyposn, - (long int) YYINDEX (yyp->yystate.yypred)); - if (! yyp->yystate.yyresolved) - YYFPRINTF (stderr, ", firstVal: %ld", - (long int) YYINDEX (yyp->yystate - .yysemantics.yyfirstVal)); - } - else - { - YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld", - yyp->yyoption.yyrule - 1, - (long int) YYINDEX (yyp->yyoption.yystate), - (long int) YYINDEX (yyp->yyoption.yynext)); - } - YYFPRINTF (stderr, "\n"); - } - YYFPRINTF (stderr, "Tops:"); - for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) - YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi, - (long int) YYINDEX (yystackp->yytops.yystates[yyi])); - YYFPRINTF (stderr, "\n"); -} -#endif -]b4_epilogue[]dnl -b4_output_end() - -# glr.cc produces its own header. -m4_if(b4_skeleton, ["glr.c"], -[b4_defines_if( -[b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison GLR parsers in C], - [2002-2012])[ - -]b4_cpp_guard_open([b4_spec_defines_file])[ -]b4_shared_declarations[ -]b4_cpp_guard_close([b4_spec_defines_file])[ -]b4_output_end() -])]) diff --git a/tools/data/glr.cc b/tools/data/glr.cc deleted file mode 100644 index 378abb39..00000000 --- a/tools/data/glr.cc +++ /dev/null @@ -1,346 +0,0 @@ - -*- C -*- - -# C++ GLR skeleton for Bison - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# This skeleton produces a C++ class that encapsulates a C glr parser. -# This is in order to reduce the maintenance burden. The glr.c -# skeleton is clean and pure enough so that there are no real -# problems. The C++ interface is the same as that of lalr1.cc. In -# fact, glr.c can replace yacc.c without the user noticing any -# difference, and similarly for glr.cc replacing lalr1.cc. -# -# The passing of parse-params -# -# The additional arguments are stored as members of the parser -# object, yyparser. The C routines need to carry yyparser -# throughout the C parser; that easy: just let yyparser become an -# additional parse-param. But because the C++ skeleton needs to -# know the "real" original parse-param, we save them -# (b4_parse_param_orig). Note that b4_parse_param is overquoted -# (and c.m4 strips one level of quotes). This is a PITA, and -# explains why there are so many levels of quotes. -# -# The locations -# -# We use location.cc just like lalr1.cc, but because glr.c stores -# the locations in a (C++) union, the position and location classes -# must not have a constructor. Therefore, contrary to lalr1.cc, we -# must not define "b4_location_constructors". As a consequence the -# user must initialize the first positions (in particular the -# filename member). - -# We require a pure interface using locations. -m4_define([b4_locations_flag], [1]) -m4_define([b4_pure_flag], [1]) - -# The header is mandatory. -b4_defines_if([], - [b4_fatal([b4_skeleton[: using %%defines is mandatory]])]) - -m4_include(b4_pkgdatadir/[c++.m4]) -b4_percent_define_ifdef([[api.location.type]], [], - [m4_include(b4_pkgdatadir/[location.cc])]) - -m4_define([b4_parser_class_name], - [b4_percent_define_get([[parser_class_name]])]) - -# Save the parse parameters. -m4_define([b4_parse_param_orig], m4_defn([b4_parse_param])) - - -# b4_yy_symbol_print_generate -# --------------------------- -# Bypass the default implementation to generate the "yy_symbol_print" -# and "yy_symbol_value_print" functions. -m4_define([b4_yy_symbol_print_generate], -[[ -/*--------------------. -| Print this symbol. | -`--------------------*/ - -]b4_c_ansi_function_def([yy_symbol_print], - [static void], - [[FILE *], []], - [[int yytype], [yytype]], - [[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep], - [yyvaluep]], - [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], - b4_parse_param)[ -{ -]b4_parse_param_use[]dnl -[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[); -} -]])[ - -# Hijack the initial action to initialize the locations. -]b4_locations_if([b4_percent_define_ifdef([[api.location.type]], [], -[m4_define([b4_initial_action], -[yylloc.initialize ();]m4_ifdef([b4_initial_action], [ -m4_defn([b4_initial_action])]))])])[ - -# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT -# and declaration of yyerror. -]m4_append([b4_post_prologue], -[b4_syncline([@oline@], [@ofile@])[ -]b4_yylloc_default_define[ -#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) -]b4_c_ansi_function_decl([yyerror], - [static void], - [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], - b4_parse_param, - [[const char* msg], [msg]])]) - - -# Hijack the epilogue to define implementations (yyerror, parser member -# functions etc.). -m4_append([b4_epilogue], -[b4_syncline([@oline@], [@ofile@])[ -/*------------------. -| Report an error. | -`------------------*/ - -]b4_c_ansi_function_def([yyerror], - [static void], - [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], - b4_parse_param, - [[const char* msg], [msg]])[ -{ -]b4_parse_param_use[]dnl -[ yyparser.error (*yylocationp, msg); -} - - -]b4_namespace_open[ -]dnl In this section, the parse param are the original parse_params. -m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl -[ /// Build a parser object. - ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ - :])[ -#if ]b4_api_PREFIX[DEBUG - ]m4_ifset([b4_parse_param], [ ], [ :])[ - yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ -#endif]b4_parse_param_cons[ - { - } - - ]b4_parser_class_name::~b4_parser_class_name[ () - { - } - - int - ]b4_parser_class_name[::parse () - { - return ::yyparse (*this]b4_user_args[); - } - -#if ]b4_api_PREFIX[DEBUG - /*--------------------. - | Print this symbol. | - `--------------------*/ - - inline void - ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yyvaluep); - std::ostream& yyoutput = debug_stream (); - std::ostream& yyo = yyoutput; - YYUSE (yyo); - switch (yytype) - { - ]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl -[ default: - break; - } - } - - - void - ]b4_parser_class_name[::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp) - { - *yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm") - << ' ' << yytname[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); - *yycdebug_ << ')'; - } - - std::ostream& - ]b4_parser_class_name[::debug_stream () const - { - return *yycdebug_; - } - - void - ]b4_parser_class_name[::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - ]b4_parser_class_name[::debug_level_type - ]b4_parser_class_name[::debug_level () const - { - return yydebug; - } - - void - ]b4_parser_class_name[::set_debug_level (debug_level_type l) - { - // Actually, it is yydebug which is really used. - yydebug = l; - } - -#endif -]m4_popdef([b4_parse_param])dnl -b4_namespace_close]) - - -# Let glr.c believe that the user arguments include the parser itself. -m4_ifset([b4_parse_param], -[m4_pushdef([b4_parse_param], - [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],] -m4_defn([b4_parse_param]))], -[m4_pushdef([b4_parse_param], - [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]]) -]) -m4_include(b4_pkgdatadir/[glr.c]) -m4_popdef([b4_parse_param]) - -b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison GLR parsers in C++], - [2002-2006, 2009-2012])[ - -/* C++ GLR parser skeleton written by Akim Demaille. */ - -]b4_cpp_guard_open([b4_spec_defines_file])[ - -]b4_percent_code_get([[requires]])[ - -# include -# include -]b4_percent_define_ifdef([[api.location.type]], [], - [[# include "location.hh"]])[ - -]b4_YYDEBUG_define[ - -]b4_namespace_open[ - /// A Bison parser. - class ]b4_parser_class_name[ - { - public: - /// Symbol semantic values. -# ifndef ]b4_api_PREFIX[STYPE -]m4_ifdef([b4_stype], -[ union semantic_type - { -b4_user_stype - };], -[m4_if(b4_tag_seen_flag, 0, -[[ typedef int semantic_type;]], -[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[ -# else - typedef ]b4_api_PREFIX[STYPE semantic_type; -# endif - /// Symbol locations. - typedef ]b4_percent_define_get([[api.location.type]], - [[location]])[ location_type; - /// Tokens. - struct token - { - ]b4_token_enums(b4_tokens)[ - }; - /// Token type. - typedef token::yytokentype token_type; - - /// Build a parser object. - ]b4_parser_class_name[ (]b4_parse_param_decl[); - virtual ~]b4_parser_class_name[ (); - - /// Parse. - /// \returns 0 iff parsing succeeded. - virtual int parse (); - - /// The current debugging stream. - std::ostream& debug_stream () const; - /// Set the current debugging stream. - void set_debug_stream (std::ostream &); - - /// Type for debugging levels. - typedef int debug_level_type; - /// The current debugging level. - debug_level_type debug_level () const; - /// Set the current debugging level. - void set_debug_level (debug_level_type l); - - private: - - public: - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - private: - -# if ]b4_api_PREFIX[DEBUG - public: - /// \brief Report a symbol value on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - /// \brief Report a symbol on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - private: - /* Debugging. */ - std::ostream* yycdebug_; -# endif - -]b4_parse_param_vars[ - }; - -]dnl Redirections for glr.c. -b4_percent_define_flag_if([[global_tokens_and_yystype]], -[b4_token_defines(b4_tokens)]) -[ -#ifndef ]b4_api_PREFIX[STYPE -# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type -#endif -#ifndef ]b4_api_PREFIX[LTYPE -# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type -#endif - -]b4_namespace_close[ -]b4_percent_code_get([[provides]])[ -]b4_cpp_guard_close([b4_spec_defines_file])[ -]b4_output_end() diff --git a/tools/data/java-skel.m4 b/tools/data/java-skel.m4 deleted file mode 100644 index 171a233b..00000000 --- a/tools/data/java-skel.m4 +++ /dev/null @@ -1,26 +0,0 @@ - -*- Autoconf -*- - -# Java skeleton dispatching for Bison. - -# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -b4_glr_if( [b4_complain([%%glr-parser not supported for Java])]) -b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])]) - -m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.java]]) -m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) - -m4_include(b4_used_skeleton) diff --git a/tools/data/java.m4 b/tools/data/java.m4 deleted file mode 100644 index fe6dd528..00000000 --- a/tools/data/java.m4 +++ /dev/null @@ -1,304 +0,0 @@ - -*- Autoconf -*- - -# Java language support for Bison - -# Copyright (C) 2007-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_include(b4_pkgdatadir/[c-like.m4]) - -# b4_comment(TEXT) -# ---------------- -m4_define([b4_comment], [/* m4_bpatsubst([$1], [ -], [ - ]) */]) - - -# b4_list2(LIST1, LIST2) -# -------------------------- -# Join two lists with a comma if necessary. -m4_define([b4_list2], - [$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2]) - - -# b4_percent_define_get3(DEF, PRE, POST, NOT) -# ------------------------------------------- -# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed, -# otherwise NOT. -m4_define([b4_percent_define_get3], - [m4_ifval(m4_quote(b4_percent_define_get([$1])), - [$2[]b4_percent_define_get([$1])[]$3], [$4])]) - - - -# b4_flag_value(BOOLEAN-FLAG) -# --------------------------- -m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])]) - - -# b4_public_if(TRUE, FALSE) -# ------------------------- -b4_percent_define_default([[public]], [[false]]) -m4_define([b4_public_if], -[b4_percent_define_flag_if([public], [$1], [$2])]) - - -# b4_abstract_if(TRUE, FALSE) -# --------------------------- -b4_percent_define_default([[abstract]], [[false]]) -m4_define([b4_abstract_if], -[b4_percent_define_flag_if([abstract], [$1], [$2])]) - - -# b4_final_if(TRUE, FALSE) -# --------------------------- -b4_percent_define_default([[final]], [[false]]) -m4_define([b4_final_if], -[b4_percent_define_flag_if([final], [$1], [$2])]) - - -# b4_strictfp_if(TRUE, FALSE) -# --------------------------- -b4_percent_define_default([[strictfp]], [[false]]) -m4_define([b4_strictfp_if], -[b4_percent_define_flag_if([strictfp], [$1], [$2])]) - - -# b4_lexer_if(TRUE, FALSE) -# ------------------------ -m4_define([b4_lexer_if], -[b4_percent_code_ifdef([[lexer]], [$1], [$2])]) - - -# b4_identification -# ----------------- -m4_define([b4_identification], -[ /** Version number for the Bison executable that generated this parser. */ - public static final String bisonVersion = "b4_version"; - - /** Name of the skeleton that generated this parser. */ - public static final String bisonSkeleton = b4_skeleton; -]) - - -## ------------ ## -## Data types. ## -## ------------ ## - -# b4_int_type(MIN, MAX) -# --------------------- -# Return the smallest int type able to handle numbers ranging from -# MIN to MAX (included). -m4_define([b4_int_type], -[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte], - b4_ints_in($@, [-32768], [32767]), [1], [short], - [int])]) - -# b4_int_type_for(NAME) -# --------------------- -# Return the smallest int type able to handle numbers ranging from -# `NAME_min' to `NAME_max' (included). -m4_define([b4_int_type_for], -[b4_int_type($1_min, $1_max)]) - -# b4_null -# ------- -m4_define([b4_null], [null]) - - -## ------------------------- ## -## Assigning token numbers. ## -## ------------------------- ## - -# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER) -# --------------------------------------- -# Output the definition of this token as an enum. -m4_define([b4_token_enum], -[ /** Token number, to be returned by the scanner. */ - public static final int $1 = $2; -]) - - -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- -# Output the definition of the tokens (if there are) as enums. -m4_define([b4_token_enums], -[m4_if([$#$1], [1], [], -[/* Tokens. */ -m4_map([b4_token_enum], [$@])]) -]) - -# b4-case(ID, CODE) -# ----------------- -# We need to fool Java's stupid unreachable code detection. -m4_define([b4_case], [ case $1: - if (yyn == $1) - $2; - break; - ]) - - -## ---------------- ## -## Default values. ## -## ---------------- ## - -m4_define([b4_yystype], [b4_percent_define_get([[stype]])]) -b4_percent_define_default([[stype]], [[Object]]) - -# %name-prefix -m4_define_default([b4_prefix], [[YY]]) - -b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser]) -m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) - -b4_percent_define_default([[lex_throws]], [[java.io.IOException]]) -m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])]) - -b4_percent_define_default([[throws]], []) -m4_define([b4_throws], [b4_percent_define_get([[throws]])]) - -b4_percent_define_default([[api.location.type]], [Location]) -m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])]) - -b4_percent_define_default([[api.position.type]], [Position]) -m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])]) - - -## ----------------- ## -## Semantic Values. ## -## ----------------- ## - - -# b4_lhs_value([TYPE]) -# -------------------- -# Expansion of $$. -m4_define([b4_lhs_value], [yyval]) - - -# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) -# -------------------------------------- -# Expansion of $NUM, where the current rule has RULE-LENGTH -# symbols on RHS. -# -# In this simple implementation, %token and %type have class names -# between the angle brackets. -m4_define([b4_rhs_value], -[(m4_ifval($3, [($3)])[](yystack.valueAt ($1-($2))))]) - -# b4_lhs_location() -# ----------------- -# Expansion of @$. -m4_define([b4_lhs_location], -[(yyloc)]) - - -# b4_rhs_location(RULE-LENGTH, NUM) -# --------------------------------- -# Expansion of @NUM, where the current rule has RULE-LENGTH symbols -# on RHS. -m4_define([b4_rhs_location], -[yystack.locationAt ($1-($2))]) - - -# b4_lex_param -# b4_parse_param -# -------------- -# If defined, b4_lex_param arrives double quoted, but below we prefer -# it to be single quoted. Same for b4_parse_param. - -# TODO: should be in bison.m4 -m4_define_default([b4_lex_param], [[]]) -m4_define([b4_lex_param], b4_lex_param) -m4_define([b4_parse_param], b4_parse_param) - -# b4_lex_param_decl -# ------------------- -# Extra formal arguments of the constructor. -m4_define([b4_lex_param_decl], -[m4_ifset([b4_lex_param], - [b4_remove_comma([$1], - b4_param_decls(b4_lex_param))], - [$1])]) - -m4_define([b4_param_decls], - [m4_map([b4_param_decl], [$@])]) -m4_define([b4_param_decl], [, $1]) - -m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)]) - - - -# b4_parse_param_decl -# ------------------- -# Extra formal arguments of the constructor. -m4_define([b4_parse_param_decl], -[m4_ifset([b4_parse_param], - [b4_remove_comma([$1], - b4_param_decls(b4_parse_param))], - [$1])]) - - - -# b4_lex_param_call -# ------------------- -# Delegating the lexer parameters to the lexer constructor. -m4_define([b4_lex_param_call], - [m4_ifset([b4_lex_param], - [b4_remove_comma([$1], - b4_param_calls(b4_lex_param))], - [$1])]) -m4_define([b4_param_calls], - [m4_map([b4_param_call], [$@])]) -m4_define([b4_param_call], [, $2]) - - - -# b4_parse_param_cons -# ------------------- -# Extra initialisations of the constructor. -m4_define([b4_parse_param_cons], - [m4_ifset([b4_parse_param], - [b4_constructor_calls(b4_parse_param)])]) - -m4_define([b4_constructor_calls], - [m4_map([b4_constructor_call], [$@])]) -m4_define([b4_constructor_call], - [this.$2 = $2; - ]) - - - -# b4_parse_param_vars -# ------------------- -# Extra instance variables. -m4_define([b4_parse_param_vars], - [m4_ifset([b4_parse_param], - [ - /* User arguments. */ -b4_var_decls(b4_parse_param)])]) - -m4_define([b4_var_decls], - [m4_map_sep([b4_var_decl], [ -], [$@])]) -m4_define([b4_var_decl], - [ protected final $1;]) - - - -# b4_maybe_throws(THROWS) -# ----------------------- -# Expand to either an empty string or "throws THROWS". -m4_define([b4_maybe_throws], - [m4_ifval($1, [throws $1])]) diff --git a/tools/data/lalr1.cc b/tools/data/lalr1.cc deleted file mode 100644 index 13170154..00000000 --- a/tools/data/lalr1.cc +++ /dev/null @@ -1,1143 +0,0 @@ -# C++ skeleton for Bison - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_include(b4_pkgdatadir/[c++.m4]) - -m4_define([b4_parser_class_name], - [b4_percent_define_get([[parser_class_name]])]) - -# The header is mandatory. -b4_defines_if([], - [b4_fatal([b4_skeleton[: using %%defines is mandatory]])]) - -b4_percent_define_ifdef([[api.location.type]], [], - [# Backward compatibility. - m4_define([b4_location_constructors]) - m4_include(b4_pkgdatadir/[location.cc])]) -m4_include(b4_pkgdatadir/[stack.hh]) - -b4_defines_if( -[b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++], - [2002-2012]) -[ -/** - ** \file ]b4_spec_defines_file[ - ** Define the ]b4_namespace_ref[::parser class. - */ - -/* C++ LALR(1) parser skeleton written by Akim Demaille. */ - -]b4_cpp_guard_open([b4_spec_defines_file])[ - -]b4_percent_code_get([[requires]])[ - -#include -#include -#include "stack.hh" -]b4_percent_define_ifdef([[api.location.type]], [], - [[#include "location.hh"]])[ - -]b4_YYDEBUG_define[ - -]b4_namespace_open[ - - /// A Bison parser. - class ]b4_parser_class_name[ - { - public: - /// Symbol semantic values. -#ifndef ]b4_api_PREFIX[STYPE -]m4_ifdef([b4_stype], -[ union semantic_type - { -b4_user_stype - };], -[m4_if(b4_tag_seen_flag, 0, -[[ typedef int semantic_type;]], -[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[ -#else - typedef ]b4_api_PREFIX[STYPE semantic_type; -#endif - /// Symbol locations. - typedef ]b4_percent_define_get([[api.location.type]], - [[location]])[ location_type; - /// Tokens. - struct token - { - ]b4_token_enums(b4_tokens)[ - }; - /// Token type. - typedef token::yytokentype token_type; - - /// Build a parser object. - ]b4_parser_class_name[ (]b4_parse_param_decl[); - virtual ~]b4_parser_class_name[ (); - - /// Parse. - /// \returns 0 iff parsing succeeded. - virtual int parse (); - -#if ]b4_api_PREFIX[DEBUG - /// The current debugging stream. - std::ostream& debug_stream () const; - /// Set the current debugging stream. - void set_debug_stream (std::ostream &); - - /// Type for debugging levels. - typedef int debug_level_type; - /// The current debugging level. - debug_level_type debug_level () const; - /// Set the current debugging level. - void set_debug_level (debug_level_type l); -#endif - - private: - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - - /// Generate an error message. - /// \param state the state where the error occurred. - /// \param tok the lookahead token. - virtual std::string yysyntax_error_ (int yystate, int tok); - -#if ]b4_api_PREFIX[DEBUG - /// \brief Report a symbol value on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - /// \brief Report a symbol on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); -#endif - - - /// State numbers. - typedef int state_type; - /// State stack type. - typedef stack state_stack_type; - /// Semantic value stack type. - typedef stack semantic_stack_type; - /// location stack type. - typedef stack location_stack_type; - - /// The state stack. - state_stack_type yystate_stack_; - /// The semantic value stack. - semantic_stack_type yysemantic_stack_; - /// The location stack. - location_stack_type yylocation_stack_; - - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - - /// Internal symbol numbers. - typedef ]b4_int_type_for([b4_translate])[ token_number_type; - /* Tables. */ - /// For a state, the index in \a yytable_ of its portion. - static const ]b4_int_type_for([b4_pact])[ yypact_[]; - static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_; - - /// For a state, default reduction number. - /// Unless\a yytable_ specifies something else to do. - /// Zero means the default is an error. - static const ]b4_int_type_for([b4_defact])[ yydefact_[]; - - static const ]b4_int_type_for([b4_pgoto])[ yypgoto_[]; - static const ]b4_int_type_for([b4_defgoto])[ yydefgoto_[]; - - /// What to do in a state. - /// \a yytable_[yypact_[s]]: what to do in state \a s. - /// - if positive, shift that token. - /// - if negative, reduce the rule which number is the opposite. - /// - if zero, do what YYDEFACT says. - static const ]b4_int_type_for([b4_table])[ yytable_[]; - static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_; - - static const ]b4_int_type_for([b4_check])[ yycheck_[]; - - /// For a state, its accessing symbol. - static const ]b4_int_type_for([b4_stos])[ yystos_[]; - - /// For a rule, its LHS. - static const ]b4_int_type_for([b4_r1])[ yyr1_[]; - /// For a rule, its RHS length. - static const ]b4_int_type_for([b4_r2])[ yyr2_[]; ]b4_error_verbose_if([ - - /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n);])[ - -]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ - /// For a symbol, its name in clear. - static const char* const yytname_[]; -]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ - /// A type to store symbol numbers and -1. - typedef ]b4_int_type_for([b4_rhs])[ rhs_number_type; - /// A `-1'-separated list of the rules' RHS. - static const rhs_number_type yyrhs_[]; - /// For each rule, the index of the first RHS symbol in \a yyrhs_. - static const ]b4_int_type_for([b4_prhs])[ yyprhs_[]; - /// For each rule, its source line number. - static const ]b4_int_type_for([b4_rline])[ yyrline_[]; - /// For each scanner token number, its symbol number. - static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[]; - /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_ (int r); - /// Print the state stack on the debug stream. - virtual void yystack_print_ (); - - /* Debugging. */ - int yydebug_; - std::ostream* yycdebug_; -#endif - - /// Convert a scanner token number \a t to a symbol number. - token_number_type yytranslate_ (int t); - - /// \brief Reclaim the memory associated to a symbol. - /// \param yymsg Why this token is reclaimed. - /// If null, do not display the symbol, just free it. - /// \param yytype The symbol type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - inline void yydestruct_ (const char* yymsg, - int yytype, - semantic_type* yyvaluep, - location_type* yylocationp); - - /// Pop \a n symbols the three stacks. - inline void yypop_ (unsigned int n = 1); - - /* Constants. */ - static const int yyeof_; - /* LAST_ -- Last index in TABLE_. */ - static const int yylast_; - static const int yynnts_; - static const int yyempty_; - static const int yyfinal_; - static const int yyterror_; - static const int yyerrcode_; - static const int yyntokens_; - static const unsigned int yyuser_token_number_max_; - static const token_number_type yyundef_token_; -]b4_parse_param_vars[ - }; -]b4_namespace_close[ - -]b4_percent_define_flag_if([[global_tokens_and_yystype]], -[b4_token_defines(b4_tokens) - -#ifndef ]b4_api_PREFIX[STYPE - /* Redirection for backward compatibility. */ -# define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type -#endif -])[ -]b4_percent_code_get([[provides]])[ -]b4_cpp_guard_close([b4_spec_defines_file]) -b4_output_end() -]) - - -b4_output_begin([b4_parser_file_name]) -b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++], - [2002-2012]) -b4_percent_code_get([[top]])[]dnl -m4_if(b4_prefix, [yy], [], -[ -// Take the name prefix into account. -#define yylex b4_prefix[]lex])[ - -/* First part of user declarations. */ -]b4_user_pre_prologue[ - -]b4_defines_if([[ -#include "@basename(]b4_spec_defines_file[@)"]])[ - -/* User implementation prologue. */ -]b4_user_post_prologue[ -]b4_percent_code_get[ - -]b4_null_define[ - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* FIXME: INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -]b4_yylloc_default_define[ - -/* Suppress unused-variable warnings by "using" E. */ -#define YYUSE(e) ((void) (e)) - -/* Enable debugging if requested. */ -#if ]b4_api_PREFIX[DEBUG - -/* A pseudo ostream that takes yydebug_ into account. */ -# define YYCDEBUG if (yydebug_) (*yycdebug_) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_symbol_print_ ((Type), (Value), (Location)); \ - *yycdebug_ << std::endl; \ - } \ -} while (false) - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ -} while (false) - -# define YY_STACK_PRINT() \ -do { \ - if (yydebug_) \ - yystack_print_ (); \ -} while (false) - -#else /* !]b4_api_PREFIX[DEBUG */ - -# define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) -# define YY_REDUCE_PRINT(Rule) static_cast(0) -# define YY_STACK_PRINT() static_cast(0) - -#endif /* !]b4_api_PREFIX[DEBUG */ - -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yychar = yyempty_) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) - -]b4_namespace_open[]b4_error_verbose_if([[ - - /* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ - std::string - ]b4_parser_class_name[::yytnamerr_ (const char *yystr) - { - if (*yystr == '"') - { - std::string yyr = ""; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - yyr += *yyp; - break; - - case '"': - return yyr; - } - do_not_strip_quotes: ; - } - - return yystr; - } -]])[ - - /// Build a parser object. - ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ - :])[ -#if ]b4_api_PREFIX[DEBUG - ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), - yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ -#endif]b4_parse_param_cons[ - { - } - - ]b4_parser_class_name::~b4_parser_class_name[ () - { - } - -#if ]b4_api_PREFIX[DEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - inline void - ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yyvaluep); - std::ostream& yyo = debug_stream (); - std::ostream& yyoutput = yyo; - YYUSE (yyoutput); - switch (yytype) - { - ]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl -[ default: - break; - } - } - - - void - ]b4_parser_class_name[::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); - *yycdebug_ << ')'; - } -#endif - - void - ]b4_parser_class_name[::yydestruct_ (const char* yymsg, - int yytype, semantic_type* yyvaluep, location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yymsg); - YYUSE (yyvaluep); - - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - ]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[ - default: - break; - } - } - - void - ]b4_parser_class_name[::yypop_ (unsigned int n) - { - yystate_stack_.pop (n); - yysemantic_stack_.pop (n); - yylocation_stack_.pop (n); - } - -#if ]b4_api_PREFIX[DEBUG - std::ostream& - ]b4_parser_class_name[::debug_stream () const - { - return *yycdebug_; - } - - void - ]b4_parser_class_name[::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - ]b4_parser_class_name[::debug_level_type - ]b4_parser_class_name[::debug_level () const - { - return yydebug_; - } - - void - ]b4_parser_class_name[::set_debug_level (debug_level_type l) - { - yydebug_ = l; - } -#endif - - inline bool - ]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - inline bool - ]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - - int - ]b4_parser_class_name[::parse () - { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - - // State. - int yyn; - int yylen = 0; - int yystate = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// Semantic value of the lookahead. - static semantic_type yyval_default; - semantic_type yylval = yyval_default; - /// Location of the lookahead. - location_type yylloc; - /// The locations where the error started and ended. - location_type yyerror_range[3]; - - /// $$. - semantic_type yyval; - /// @@$. - location_type yyloc; - - int yyresult; - - // FIXME: This shoud be completely indented. It is not yet to - // avoid gratuitous conflicts when merging into the master branch. - try - { - YYCDEBUG << "Starting parse" << std::endl; - -]m4_ifdef([b4_initial_action], [ -b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action -b4_dollar_popdef])[]dnl - - [ /* Initialize the stacks. The initial state will be pushed in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystate_stack_ = state_stack_type (0); - yysemantic_stack_ = semantic_stack_type (0); - yylocation_stack_ = location_stack_type (0); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* New state. */ - yynewstate: - yystate_stack_.push (yystate); - YYCDEBUG << "Entering state " << yystate << std::endl; - - /* Accept? */ - if (yystate == yyfinal_) - goto yyacceptlab; - - goto yybackup; - - /* Backup. */ - yybackup: - - /* Try to take a decision without lookahead. */ - yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - /* Read a lookahead token. */ - if (yychar == yyempty_) - { - YYCDEBUG << "Reading a token: "; - yychar = ]b4_c_function_call([yylex], [int], - [b4_api_PREFIX[STYPE*], [&yylval]][]dnl -b4_locations_if([, [[location*], [&yylloc]]])dnl -m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; - } - - /* Convert token to internal form. */ - if (yychar <= yyeof_) - { - yychar = yytoken = yyeof_; - YYCDEBUG << "Now at end of input." << std::endl; - } - else - { - yytoken = yytranslate_ (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - goto yydefault; - - /* Reduce or error. */ - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus_) - --yyerrstatus_; - - yystate = yyn; - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. */ - if (yylen) - yyval = yysemantic_stack_[yylen - 1]; - else - yyval = yysemantic_stack_[0]; - - // Compute the default @@$. - { - slice slice (yylocation_stack_, yylen); - YYLLOC_DEFAULT (yyloc, slice, yylen); - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - ]b4_user_actions[ - default: - break; - } - - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); - - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - - yysemantic_stack_.push (yyval); - yylocation_stack_.push (yyloc); - - /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystate_stack_[0]) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ - yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus_) - { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - error (yylloc, yysyntax_error_ (yystate, yytoken)); - } - - yyerror_range[1] = yylloc; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - if (yychar <= yyeof_) - { - /* Return failure if at end of input. */ - if (yychar == yyeof_) - YYABORT; - } - else - { - yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = yyempty_; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (false) - goto yyerrorlab; - - yyerror_range[1] = yylocation_stack_[yylen - 1]; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - yystate = yystate_stack_[0]; - goto yyerrlab1; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystate_stack_.height () == 1) - YYABORT; - - yyerror_range[1] = yylocation_stack_[0]; - yydestruct_ ("Error: popping", - yystos_[yystate], - &yysemantic_stack_[0], &yylocation_stack_[0]); - yypop_ (); - yystate = yystate_stack_[0]; - YY_STACK_PRINT (); - } - - yyerror_range[2] = yylloc; - // Using YYLLOC is tempting, but would change the location of - // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yyloc); - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], - &yysemantic_stack_[0], &yylocation_stack_[0]); - - yystate = yyn; - goto yynewstate; - - /* Accept. */ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - /* Abort. */ - yyabortlab: - yyresult = 1; - goto yyreturn; - - yyreturn: - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } - - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - while (1 < yystate_stack_.height ()) - { - yydestruct_ ("Cleanup: popping", - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - - return yyresult; - } - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack" - << std::endl; - // Do not try to display the values of the reclaimed symbols, - // as their printer might throw an exception. - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See - comments at user semantic actions for why this is - necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); - } - - while (1 < yystate_stack_.height ()) - { - yydestruct_ (YY_NULL, - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - throw; - } - } - - // Generate an error message. - std::string - ]b4_parser_class_name[::yysyntax_error_ (]dnl -b4_error_verbose_if([int yystate, int yytoken], - [int, int])[) - {]b4_error_verbose_if([[ - std::string yyres; - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. - */ - if (yytoken != yyempty_) - { - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = YY_NULL; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - // Argument number. - size_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres;]], [[ - return YY_("syntax error");]])[ - } - - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class_name::yypact_ninf_ = b4_pact_ninf[; - const ]b4_int_type_for([b4_pact])[ - ]b4_parser_class_name[::yypact_[] = - { - ]b4_pact[ - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - const ]b4_int_type_for([b4_defact])[ - ]b4_parser_class_name[::yydefact_[] = - { - ]b4_defact[ - }; - - /* YYPGOTO[NTERM-NUM]. */ - const ]b4_int_type_for([b4_pgoto])[ - ]b4_parser_class_name[::yypgoto_[] = - { - ]b4_pgoto[ - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - const ]b4_int_type_for([b4_defgoto])[ - ]b4_parser_class_name[::yydefgoto_[] = - { - ]b4_defgoto[ - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ - const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[; - const ]b4_int_type_for([b4_table])[ - ]b4_parser_class_name[::yytable_[] = - { - ]b4_table[ - }; - - /* YYCHECK. */ - const ]b4_int_type_for([b4_check])[ - ]b4_parser_class_name[::yycheck_[] = - { - ]b4_check[ - }; - - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - const ]b4_int_type_for([b4_stos])[ - ]b4_parser_class_name[::yystos_[] = - { - ]b4_stos[ - }; - -#if ]b4_api_PREFIX[DEBUG - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - const ]b4_int_type_for([b4_toknum])[ - ]b4_parser_class_name[::yytoken_number_[] = - { - ]b4_toknum[ - }; -#endif - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - const ]b4_int_type_for([b4_r1])[ - ]b4_parser_class_name[::yyr1_[] = - { - ]b4_r1[ - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - const ]b4_int_type_for([b4_r2])[ - ]b4_parser_class_name[::yyr2_[] = - { - ]b4_r2[ - }; - -]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ - const char* - const ]b4_parser_class_name[::yytname_[] = - { - ]b4_tname[ - }; - -]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - const ]b4_parser_class_name[::rhs_number_type - ]b4_parser_class_name[::yyrhs_[] = - { - ]b4_rhs[ - }; - - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - const ]b4_int_type_for([b4_prhs])[ - ]b4_parser_class_name[::yyprhs_[] = - { - ]b4_prhs[ - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - const ]b4_int_type_for([b4_rline])[ - ]b4_parser_class_name[::yyrline_[] = - { - ]b4_rline[ - }; - - // Print the state stack on the debug stream. - void - ]b4_parser_class_name[::yystack_print_ () - { - *yycdebug_ << "Stack now"; - for (state_stack_type::const_iterator i = yystate_stack_.begin (); - i != yystate_stack_.end (); ++i) - *yycdebug_ << ' ' << *i; - *yycdebug_ << std::endl; - } - - // Report on the debug stream that the rule \a yyrule is going to be reduced. - void - ]b4_parser_class_name[::yy_reduce_print_ (int yyrule) - { - unsigned int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):" << std::endl; - /* The symbols being reduced. */ - for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yyrhs_[yyprhs_[yyrule] + yyi], - &]b4_rhs_value(yynrhs, yyi + 1)[, - &]b4_rhs_location(yynrhs, yyi + 1)[); - } -#endif // ]b4_api_PREFIX[DEBUG - - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - ]b4_parser_class_name[::token_number_type - ]b4_parser_class_name[::yytranslate_ (int t) - { - static - const token_number_type - translate_table[] = - { - ]b4_translate[ - }; - if ((unsigned int) t <= yyuser_token_number_max_) - return translate_table[t]; - else - return yyundef_token_; - } - - const int ]b4_parser_class_name[::yyeof_ = 0; - const int ]b4_parser_class_name[::yylast_ = ]b4_last[; - const int ]b4_parser_class_name[::yynnts_ = ]b4_nterms_number[; - const int ]b4_parser_class_name[::yyempty_ = -2; - const int ]b4_parser_class_name[::yyfinal_ = ]b4_final_state_number[; - const int ]b4_parser_class_name[::yyterror_ = 1; - const int ]b4_parser_class_name[::yyerrcode_ = 256; - const int ]b4_parser_class_name[::yyntokens_ = ]b4_tokens_number[; - - const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[; - const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[; - -]b4_namespace_close[ -]b4_epilogue[]dnl -b4_output_end() diff --git a/tools/data/lalr1.java b/tools/data/lalr1.java deleted file mode 100644 index f8c5c721..00000000 --- a/tools/data/lalr1.java +++ /dev/null @@ -1,927 +0,0 @@ -# Java skeleton for Bison -*- autoconf -*- - -# Copyright (C) 2007-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_include(b4_pkgdatadir/[java.m4]) - -b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])]) -m4_ifval(m4_defn([b4_symbol_destructors]), - [b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])], - []) - -b4_output_begin([b4_parser_file_name]) -b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java], - [2007-2012]) - -b4_percent_define_ifdef([package], [package b4_percent_define_get([package]); -])[/* First part of user declarations. */ -]b4_pre_prologue -b4_percent_code_get([[imports]]) -[/** - * A Bison parser, automatically generated from ]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[. - * - * @@author LALR (1) parser skeleton written by Paolo Bonzini. - */ -]b4_public_if([public ])dnl -b4_abstract_if([abstract ])dnl -b4_final_if([final ])dnl -b4_strictfp_if([strictfp ])dnl -[class ]b4_parser_class_name[]dnl -b4_percent_define_get3([extends], [ extends ])dnl -b4_percent_define_get3([implements], [ implements ])[ -{ - ]b4_identification[ - - /** True if verbose error messages are enabled. */ - public boolean errorVerbose = ]b4_flag_value([error_verbose]); - -b4_locations_if([[ - /** - * A class defining a pair of positions. Positions, defined by the - * ]b4_position_type[ class, denote a point in the input. - * Locations represent a part of the input through the beginning - * and ending positions. */ - public class ]b4_location_type[ { - /** The first, inclusive, position in the range. */ - public ]b4_position_type[ begin; - - /** The first position beyond the range. */ - public ]b4_position_type[ end; - - /** - * Create a ]b4_location_type[ denoting an empty range located at - * a given point. - * @@param loc The position at which the range is anchored. */ - public ]b4_location_type[ (]b4_position_type[ loc) { - this.begin = this.end = loc; - } - - /** - * Create a ]b4_location_type[ from the endpoints of the range. - * @@param begin The first position included in the range. - * @@param end The first position beyond the range. */ - public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) { - this.begin = begin; - this.end = end; - } - - /** - * Print a representation of the location. For this to be correct, - * ]b4_position_type[ should override the equals - * method. */ - public String toString () { - if (begin.equals (end)) - return begin.toString (); - else - return begin.toString () + "-" + end.toString (); - } - } - -]]) - -[ /** Token returned by the scanner to signal the end of its input. */ - public static final int EOF = 0;] - -b4_token_enums(b4_tokens) - - b4_locations_if([[ - private ]b4_location_type[ yylloc (YYStack rhs, int n) - { - if (n > 0) - return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end); - else - return new ]b4_location_type[ (rhs.locationAt (0).end); - }]])[ - - /** - * Communication interface between the scanner and the Bison-generated - * parser ]b4_parser_class_name[. - */ - public interface Lexer { - ]b4_locations_if([[/** - * Method to retrieve the beginning position of the last scanned token. - * @@return the position at which the last scanned token starts. */ - ]b4_position_type[ getStartPos (); - - /** - * Method to retrieve the ending position of the last scanned token. - * @@return the first position beyond the last scanned token. */ - ]b4_position_type[ getEndPos ();]])[ - - /** - * Method to retrieve the semantic value of the last scanned token. - * @@return the semantic value of the last scanned token. */ - ]b4_yystype[ getLVal (); - - /** - * Entry point for the scanner. Returns the token identifier corresponding - * to the next token and prepares to return the semantic value - * ]b4_locations_if([and beginning/ending positions ])[of the token. - * @@return the token identifier corresponding to the next token. */ - int yylex () ]b4_maybe_throws([b4_lex_throws])[; - - /** - * Entry point for error reporting. Emits an error - * ]b4_locations_if([referring to the given location ])[in a user-defined way. - * - * ]b4_locations_if([[@@param loc The location of the element to which the - * error message is related]])[ - * @@param s The string for the error message. */ - void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);] - } - - b4_lexer_if([[private class YYLexer implements Lexer { -]b4_percent_code_get([[lexer]])[ - } - - ]])[/** The object doing lexical analysis for us. */ - private Lexer yylexer; - ] - b4_parse_param_vars - -b4_lexer_if([[ - /** - * Instantiates the Bison-generated parser. - */ - public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) { - this.yylexer = new YYLexer(]b4_lex_param_call[); - ]b4_parse_param_cons[ - } -]]) - - /** - * Instantiates the Bison-generated parser. - * @@param yylexer The scanner that will supply tokens to the parser. - */ - b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) { - this.yylexer = yylexer; - ]b4_parse_param_cons[ - } - - private java.io.PrintStream yyDebugStream = System.err; - - /** - * Return the PrintStream on which the debugging output is - * printed. - */ - public final java.io.PrintStream getDebugStream () { return yyDebugStream; } - - /** - * Set the PrintStream on which the debug output is printed. - * @@param s The stream that is used for debugging output. - */ - public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s; } - - private int yydebug = 0; - - /** - * Answer the verbosity of the debugging output; 0 means that all kinds of - * output from the parser are suppressed. - */ - public final int getDebugLevel() { return yydebug; } - - /** - * Set the verbosity of the debugging output; 0 means that all kinds of - * output from the parser are suppressed. - * @@param level The verbosity level for debugging output. - */ - public final void setDebugLevel(int level) { yydebug = level; } - - private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{ - return yylexer.yylex (); - } - protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) { - yylexer.yyerror (]b4_locations_if([loc, ])[s); - } - - ]b4_locations_if([ - protected final void yyerror (String s) { - yylexer.yyerror ((]b4_location_type[)null, s); - } - protected final void yyerror (]b4_position_type[ loc, String s) { - yylexer.yyerror (new ]b4_location_type[ (loc), s); - }]) - - [protected final void yycdebug (String s) { - if (yydebug > 0) - yyDebugStream.println (s); - } - - private final class YYStack { - private int[] stateStack = new int[16]; - ]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[ - private ]b4_yystype[[] valueStack = new ]b4_yystype[[16]; - - public int size = 16; - public int height = -1; - - public final void push (int state, ]b4_yystype[ value]dnl - b4_locations_if([, ]b4_location_type[ loc])[) { - height++; - if (size == height) - { - int[] newStateStack = new int[size * 2]; - System.arraycopy (stateStack, 0, newStateStack, 0, height); - stateStack = newStateStack; - ]b4_locations_if([[ - ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2]; - System.arraycopy (locStack, 0, newLocStack, 0, height); - locStack = newLocStack;]]) - - b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2]; - System.arraycopy (valueStack, 0, newValueStack, 0, height); - valueStack = newValueStack; - - size *= 2; - } - - stateStack[height] = state; - ]b4_locations_if([[locStack[height] = loc;]])[ - valueStack[height] = value; - } - - public final void pop () { - pop (1); - } - - public final void pop (int num) { - // Avoid memory leaks... garbage collection is a white lie! - if (num > 0) { - java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null); - ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[ - } - height -= num; - } - - public final int stateAt (int i) { - return stateStack[height - i]; - } - - ]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) { - return locStack[height - i]; - } - - ]])[public final ]b4_yystype[ valueAt (int i) { - return valueStack[height - i]; - } - - // Print the state stack on the debug stream. - public void print (java.io.PrintStream out) - { - out.print ("Stack now"); - - for (int i = 0; i <= height; i++) - { - out.print (' '); - out.print (stateStack[i]); - } - out.println (); - } - } - - /** - * Returned by a Bison action in order to stop the parsing process and - * return success (true). */ - public static final int YYACCEPT = 0; - - /** - * Returned by a Bison action in order to stop the parsing process and - * return failure (false). */ - public static final int YYABORT = 1; - - /** - * Returned by a Bison action in order to start error recovery without - * printing an error message. */ - public static final int YYERROR = 2; - - // Internal return codes that are not supported for user semantic - // actions. - private static final int YYERRLAB = 3; - private static final int YYNEWSTATE = 4; - private static final int YYDEFAULT = 5; - private static final int YYREDUCE = 6; - private static final int YYERRLAB1 = 7; - private static final int YYRETURN = 8; - - private int yyerrstatus_ = 0; - - /** - * Return whether error recovery is being done. In this state, the parser - * reads token until it reaches a known state, and then restarts normal - * operation. */ - public final boolean recovering () - { - return yyerrstatus_ == 0; - } - - private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[ - { - ]b4_yystype[ yyval; - ]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[ - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. */ - if (yylen > 0) - yyval = yystack.valueAt (yylen - 1); - else - yyval = yystack.valueAt (0); - - yy_reduce_print (yyn, yystack); - - switch (yyn) - { - ]b4_user_actions[ - default: break; - } - - yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[); - - yystack.pop (yylen); - yylen = 0; - - /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0); - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystack.stateAt (0)) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; - - yystack.push (yystate, yyval]b4_locations_if([, yyloc])[); - return YYNEWSTATE; - } - - /* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ - private final String yytnamerr_ (String yystr) - { - if (yystr.charAt (0) == '"') - { - StringBuffer yyr = new StringBuffer (); - strip_quotes: for (int i = 1; i < yystr.length (); i++) - switch (yystr.charAt (i)) - { - case '\'': - case ',': - break strip_quotes; - - case '\\': - if (yystr.charAt(++i) != '\\') - break strip_quotes; - /* Fall through. */ - default: - yyr.append (yystr.charAt (i)); - break; - - case '"': - return yyr.toString (); - } - } - else if (yystr.equals ("$end")) - return "end of input"; - - return yystr; - } - - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - private void yy_symbol_print (String s, int yytype, - ]b4_yystype[ yyvaluep]dnl - b4_locations_if([, Object yylocationp])[) - { - if (yydebug > 0) - yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ") - + yytname_[yytype] + " ("]b4_locations_if([ - + yylocationp + ": "])[ - + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")"); - } - - /** - * Parse input from the scanner that was specified at object construction - * time. Return whether the end of the input was reached successfully. - * - * @@return true if the parsing succeeds. Note that this does not - * imply that there were no syntax errors. - */ - public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[ - { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - - /* State. */ - int yyn = 0; - int yylen = 0; - int yystate = 0; - - YYStack yystack = new YYStack (); - - /* Error handling. */ - int yynerrs_ = 0; - ]b4_locations_if([/// The location where the error started. - ]b4_location_type[ yyerrloc = null; - - /// ]b4_location_type[ of the lookahead. - ]b4_location_type[ yylloc = new ]b4_location_type[ (null, null); - - /// @@$. - ]b4_location_type[ yyloc;]) - - /// Semantic value of the lookahead. - b4_yystype[ yylval = null; - - yycdebug ("Starting parse\n"); - yyerrstatus_ = 0; - -]m4_ifdef([b4_initial_action], [ -b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action -b4_dollar_popdef])[]dnl - - [ /* Initialize the stack. */ - yystack.push (yystate, yylval]b4_locations_if([, yylloc])[); - - int label = YYNEWSTATE; - for (;;) - switch (label) - { - /* New state. Unlike in the C/C++ skeletons, the state is already - pushed when we come here. */ - case YYNEWSTATE: - yycdebug ("Entering state " + yystate + "\n"); - if (yydebug > 0) - yystack.print (yyDebugStream); - - /* Accept? */ - if (yystate == yyfinal_) - return true; - - /* Take a decision. First try without lookahead. */ - yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) - { - label = YYDEFAULT; - break; - } - - /* Read a lookahead token. */ - if (yychar == yyempty_) - { - yycdebug ("Reading a token: "); - yychar = yylex ();] - b4_locations_if([[ - yylloc = new ]b4_location_type[(yylexer.getStartPos (), - yylexer.getEndPos ());]]) - yylval = yylexer.getLVal ();[ - } - - /* Convert token to internal form. */ - if (yychar <= EOF) - { - yychar = yytoken = EOF; - yycdebug ("Now at end of input.\n"); - } - else - { - yytoken = yytranslate_ (yychar); - yy_symbol_print ("Next token is", yytoken, - yylval]b4_locations_if([, yylloc])[); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - label = YYDEFAULT; - - /* <= 0 means reduce or error. */ - else if ((yyn = yytable_[yyn]) <= 0) - { - if (yy_table_value_is_error_ (yyn)) - label = YYERRLAB; - else - { - yyn = -yyn; - label = YYREDUCE; - } - } - - else - { - /* Shift the lookahead token. */ - yy_symbol_print ("Shifting", yytoken, - yylval]b4_locations_if([, yylloc])[); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus_ > 0) - --yyerrstatus_; - - yystate = yyn; - yystack.push (yystate, yylval]b4_locations_if([, yylloc])[); - label = YYNEWSTATE; - } - break; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - case YYDEFAULT: - yyn = yydefact_[yystate]; - if (yyn == 0) - label = YYERRLAB; - else - label = YYREDUCE; - break; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ - case YYREDUCE: - yylen = yyr2_[yyn]; - label = yyaction (yyn, yystack, yylen); - yystate = yystack.stateAt (0); - break; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ - case YYERRLAB: - /* If not already recovering from an error, report this error. */ - if (yyerrstatus_ == 0) - { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken)); - } - - ]b4_locations_if([yyerrloc = yylloc;])[ - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= EOF) - { - /* Return failure if at end of input. */ - if (yychar == EOF) - return false; - } - else - yychar = yyempty_; - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - label = YYERRLAB1; - break; - - /*---------------------------------------------------. - | errorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - case YYERROR: - - ]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[ - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - yystack.pop (yylen); - yylen = 0; - yystate = yystack.stateAt (0); - label = YYERRLAB1; - break; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - case YYERRLAB1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystack.height == 0) - return false; - - ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[ - yystack.pop (); - yystate = yystack.stateAt (0); - if (yydebug > 0) - yystack.print (yyDebugStream); - } - - ]b4_locations_if([ - /* Muck with the stack to setup for yylloc. */ - yystack.push (0, null, yylloc); - yystack.push (0, null, yyerrloc); - yyloc = yylloc (yystack, 2); - yystack.pop (2);])[ - - /* Shift the error token. */ - yy_symbol_print ("Shifting", yystos_[yyn], - yylval]b4_locations_if([, yyloc])[); - - yystate = yyn; - yystack.push (yyn, yylval]b4_locations_if([, yyloc])[); - label = YYNEWSTATE; - break; - - /* Accept. */ - case YYACCEPT: - return true; - - /* Abort. */ - case YYABORT: - return false; - } - } - - // Generate an error message. - private String yysyntax_error (int yystate, int tok) - { - if (errorVerbose) - { - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. - See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, - then the only way this function was invoked is if the - default action is an error action. In that case, don't - check for expected tokens because there are none. - - The only way there can be no lookahead present (in tok) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this - state is a consistent state with a default action. There - might have been a previous inconsistent state, consistent - state with a non-default action, or user semantic action - that manipulated yychar. (However, yychar is currently out - of scope during semantic actions.) - - Of course, the expected token list depends on states to - have correct lookahead information, and it depends on the - parser not to perform extra reductions after fetching a - lookahead from the scanner and before detecting a syntax - error. Thus, state merging (from LALR or IELR) and default - reductions corrupt the expected token list. However, the - list is correct for canonical LR with one exception: it - will still contain any token that will not be accepted due - to an error action in a later state. - */ - if (tok != yyempty_) - { - // FIXME: This method of building the message is not compatible - // with internationalization. - StringBuffer res = - new StringBuffer ("syntax error, unexpected "); - res.append (yytnamerr_ (yytname_[tok])); - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative - indexes in YYCHECK. In other words, skip the first - -YYN actions for this state because they are default - actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - int count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ - && !yy_table_value_is_error_ (yytable_[x + yyn])) - ++count; - if (count < 5) - { - count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ - && !yy_table_value_is_error_ (yytable_[x + yyn])) - { - res.append (count++ == 0 ? ", expecting " : " or "); - res.append (yytnamerr_ (yytname_[x])); - } - } - } - return res.toString (); - } - } - - return "syntax error"; - } - - /** - * Whether the given yypact_ value indicates a defaulted state. - * @@param yyvalue the value to check - */ - private static boolean yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - /** - * Whether the given yytable_ value indicates a syntax error. - * @@param yyvalue the value to check - */ - private static boolean yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[; - private static final ]b4_int_type_for([b4_pact])[ yypact_[] = - { - ]b4_pact[ - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - private static final ]b4_int_type_for([b4_defact])[ yydefact_[] = - { - ]b4_defact[ - }; - - /* YYPGOTO[NTERM-NUM]. */ - private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] = - { - ]b4_pgoto[ - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - private static final ]b4_int_type_for([b4_defgoto])[ - yydefgoto_[] = - { - ]b4_defgoto[ - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ - private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[; - private static final ]b4_int_type_for([b4_table])[ - yytable_[] = - { - ]b4_table[ - }; - - /* YYCHECK. */ - private static final ]b4_int_type_for([b4_check])[ - yycheck_[] = - { - ]b4_check[ - }; - - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - private static final ]b4_int_type_for([b4_stos])[ - yystos_[] = - { - ]b4_stos[ - }; - - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - private static final ]b4_int_type_for([b4_toknum])[ - yytoken_number_[] = - { - ]b4_toknum[ - }; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - private static final ]b4_int_type_for([b4_r1])[ - yyr1_[] = - { - ]b4_r1[ - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - private static final ]b4_int_type_for([b4_r2])[ - yyr2_[] = - { - ]b4_r2[ - }; - - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ - private static final String yytname_[] = - { - ]b4_tname[ - }; - - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] = - { - ]b4_rhs[ - }; - - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - private static final ]b4_int_type_for([b4_prhs])[ yyprhs_[] = - { - ]b4_prhs[ - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - private static final ]b4_int_type_for([b4_rline])[ yyrline_[] = - { - ]b4_rline[ - }; - - // Report on the debug stream that the rule yyrule is going to be reduced. - private void yy_reduce_print (int yyrule, YYStack yystack) - { - if (yydebug == 0) - return; - - int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ - yycdebug ("Reducing stack by rule " + (yyrule - 1) - + " (line " + yylno + "), "); - - /* The symbols being reduced. */ - for (int yyi = 0; yyi < yynrhs; yyi++) - yy_symbol_print (" $" + (yyi + 1) + " =", - yyrhs_[yyprhs_[yyrule] + yyi], - ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([, - b4_rhs_location(yynrhs, yyi + 1)])[); - } - - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] = - { - ]b4_translate[ - }; - - private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t) - { - if (t >= 0 && t <= yyuser_token_number_max_) - return yytranslate_table_[t]; - else - return yyundef_token_; - } - - private static final int yylast_ = ]b4_last[; - private static final int yynnts_ = ]b4_nterms_number[; - private static final int yyempty_ = -2; - private static final int yyfinal_ = ]b4_final_state_number[; - private static final int yyterror_ = 1; - private static final int yyerrcode_ = 256; - private static final int yyntokens_ = ]b4_tokens_number[; - - private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[; - private static final int yyundef_token_ = ]b4_undef_token_number[; - -]/* User implementation code. */ -b4_percent_code_get[]dnl - -} - -b4_epilogue -b4_output_end() diff --git a/tools/data/location.cc b/tools/data/location.cc deleted file mode 100644 index 8e831241..00000000 --- a/tools/data/location.cc +++ /dev/null @@ -1,299 +0,0 @@ -# C++ skeleton for Bison - -# Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -b4_output_begin([b4_dir_prefix[]position.hh]) -b4_copyright([Positions for Bison parsers in C++], - [2002-2007, 2009-2012])[ - -/** - ** \file ]b4_dir_prefix[position.hh - ** Define the ]b4_namespace_ref[::position class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ - -# include // std::max -# include -# include - -]b4_null_define[ - -]b4_namespace_open[ - /// Abstract a position. - class position - { - public: -]m4_ifdef([b4_location_constructors], [[ - /// Construct a position. - explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) - : filename (f) - , line (l) - , column (c) - { - } - -]])[ - /// Initialization. - void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) - { - filename = fn; - line = l; - column = c; - } - - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. - void lines (int count = 1) - { - column = ]b4_location_initial_column[u; - line += count; - } - - /// (column related) Advance to the COUNT next columns. - void columns (int count = 1) - { - column = std::max (]b4_location_initial_column[u, column + count); - } - /** \} */ - - /// File name to which this position refers. - ]b4_percent_define_get([[filename_type]])[* filename; - /// Current line number. - unsigned int line; - /// Current column number. - unsigned int column; - }; - - /// Add and assign a position. - inline position& - operator+= (position& res, const int width) - { - res.columns (width); - return res; - } - - /// Add two position objects. - inline const position - operator+ (const position& begin, const int width) - { - position res = begin; - return res += width; - } - - /// Add and assign a position. - inline position& - operator-= (position& res, const int width) - { - return res += -width; - } - - /// Add two position objects. - inline const position - operator- (const position& begin, const int width) - { - return begin + -width; - } -]b4_percent_define_flag_if([[define_location_comparison]], [[ - /// Compare two position objects. - inline bool - operator== (const position& pos1, const position& pos2) - { - return (pos1.line == pos2.line - && pos1.column == pos2.column - && (pos1.filename == pos2.filename - || (pos1.filename && pos2.filename - && *pos1.filename == *pos2.filename))); - } - - /// Compare two position objects. - inline bool - operator!= (const position& pos1, const position& pos2) - { - return !(pos1 == pos2); - } -]])[ - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param pos a reference to the position to redirect - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const position& pos) - { - if (pos.filename) - ostr << *pos.filename << ':'; - return ostr << pos.line << '.' << pos.column; - } - -]b4_namespace_close[ -]b4_cpp_guard_close([b4_dir_prefix[]position.hh]) -b4_output_end() - - -b4_output_begin([b4_dir_prefix[]location.hh]) -b4_copyright([Locations for Bison parsers in C++], - [2002-2007, 2009-2012])[ - -/** - ** \file ]b4_dir_prefix[location.hh - ** Define the ]b4_namespace_ref[::location class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ - -# include "position.hh" - -]b4_namespace_open[ - - /// Abstract a location. - class location - { - public: -]m4_ifdef([b4_location_constructors], [ - /// Construct a location from \a b to \a e. - location (const position& b, const position& e) - : begin (b) - , end (e) - { - } - - /// Construct a 0-width location in \a p. - explicit location (const position& p = position ()) - : begin (p) - , end (p) - { - } - - /// Construct a 0-width location in \a f, \a l, \a c. - explicit location (]b4_percent_define_get([[filename_type]])[* f, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) - : begin (f, l, c) - , end (f, l, c) - { - } - -])[ - /// Initialization. - void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) - { - begin.initialize (f, l, c); - end = begin; - } - - /** \name Line and Column related manipulators - ** \{ */ - public: - /// Reset initial location to final location. - void step () - { - begin = end; - } - - /// Extend the current location to the COUNT next columns. - void columns (unsigned int count = 1) - { - end += count; - } - - /// Extend the current location to the COUNT next lines. - void lines (unsigned int count = 1) - { - end.lines (count); - } - /** \} */ - - - public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; - }; - - /// Join two location objects to create a location. - inline const location operator+ (const location& begin, const location& end) - { - location res = begin; - res.end = end.end; - return res; - } - - /// Add two location objects. - inline const location operator+ (const location& begin, unsigned int width) - { - location res = begin; - res.columns (width); - return res; - } - - /// Add and assign a location. - inline location& operator+= (location& res, unsigned int width) - { - res.columns (width); - return res; - } -]b4_percent_define_flag_if([[define_location_comparison]], [[ - /// Compare two location objects. - inline bool - operator== (const location& loc1, const location& loc2) - { - return loc1.begin == loc2.begin && loc1.end == loc2.end; - } - - /// Compare two location objects. - inline bool - operator!= (const location& loc1, const location& loc2) - { - return !(loc1 == loc2); - } -]])[ - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param loc a reference to the location to redirect - ** - ** Avoid duplicate information. - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const location& loc) - { - position last = loc.end - 1; - ostr << loc.begin; - if (last.filename - && (!loc.begin.filename - || *loc.begin.filename != *last.filename)) - ostr << '-' << last; - else if (loc.begin.line != last.line) - ostr << '-' << last.line << '.' << last.column; - else if (loc.begin.column != last.column) - ostr << '-' << last.column; - return ostr; - } - -]b4_namespace_close[ - -]b4_cpp_guard_close([b4_dir_prefix[]location.hh]) -b4_output_end() diff --git a/tools/data/m4sugar/foreach.m4 b/tools/data/m4sugar/foreach.m4 deleted file mode 100644 index c20c00ae..00000000 --- a/tools/data/m4sugar/foreach.m4 +++ /dev/null @@ -1,362 +0,0 @@ -# -*- Autoconf -*- -# This file is part of Autoconf. -# foreach-based replacements for recursive functions. -# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes -# GNU M4 1.6 by requiring more memory and macro expansions. -# -# Copyright (C) 2008-2012 Free Software Foundation, Inc. - -# This file is part of Autoconf. This program is free -# software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# Under Section 7 of GPL version 3, you are granted additional -# permissions described in the Autoconf Configure Script Exception, -# version 3.0, as published by the Free Software Foundation. -# -# You should have received a copy of the GNU General Public License -# and a copy of the Autoconf Configure Script Exception along with -# this program; see the files COPYINGv3 and COPYING.EXCEPTION -# respectively. If not, see . - -# Written by Eric Blake. - -# In M4 1.4.x, every byte of $@ is rescanned. This means that an -# algorithm on n arguments that recurses with one less argument each -# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In -# M4 1.6, this was fixed so that $@ is only scanned once, then -# back-references are made to information stored about the scan. -# Thus, n iterations need only scan n arguments, for O(n) time. -# Additionally, in M4 1.4.x, recursive algorithms did not clean up -# memory very well, requiring O(n^2) memory rather than O(n) for n -# iterations. -# -# This file is designed to overcome the quadratic nature of $@ -# recursion by writing a variant of m4_foreach that uses m4_for rather -# than $@ recursion to operate on the list. This involves more macro -# expansions, but avoids the need to rescan a quadratic number of -# arguments, making these replacements very attractive for M4 1.4.x. -# On the other hand, in any version of M4, expanding additional macros -# costs additional time; therefore, in M4 1.6, where $@ recursion uses -# fewer macros, these replacements actually pessimize performance. -# Additionally, the use of $10 to mean the tenth argument violates -# POSIX; although all versions of m4 1.4.x support this meaning, a -# future m4 version may switch to take it as the first argument -# concatenated with a literal 0, so the implementations in this file -# are not future-proof. Thus, this file is conditionally included as -# part of m4_init(), only when it is detected that M4 probably has -# quadratic behavior (ie. it lacks the macro __m4_version__). -# -# Please keep this file in sync with m4sugar.m4. - -# _m4_foreach(PRE, POST, IGNORED, ARG...) -# --------------------------------------- -# Form the common basis of the m4_foreach and m4_map macros. For each -# ARG, expand PRE[ARG]POST[]. The IGNORED argument makes recursion -# easier, and must be supplied rather than implicit. -# -# This version minimizes the number of times that $@ is evaluated by -# using m4_for to generate a boilerplate into _m4_f then passing $@ to -# that temporary macro. Thus, the recursion is done in m4_for without -# reparsing any user input, and is not quadratic. For an idea of how -# this works, note that m4_foreach(i,[1,2],[i]) calls -# _m4_foreach([m4_define([i],],[)i],[],[1],[2]) -# which defines _m4_f: -# $1[$4]$2[]$1[$5]$2[]_m4_popdef([_m4_f]) -# then calls _m4_f([m4_define([i],],[)i],[],[1],[2]) for a net result: -# m4_define([i],[1])i[]m4_define([i],[2])i[]_m4_popdef([_m4_f]). -m4_define([_m4_foreach], -[m4_if([$#], [3], [], - [m4_pushdef([_m4_f], _m4_for([4], [$#], [1], - [$0_([1], [2],], [)])[_m4_popdef([_m4_f])])_m4_f($@)])]) - -m4_define([_m4_foreach_], -[[$$1[$$3]$$2[]]]) - -# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT) -# ----------------------------------------------------------- -# Find the first VAL that SWITCH matches, and expand the corresponding -# IF-VAL. If there are no matches, expand DEFAULT. -# -# Use m4_for to create a temporary macro in terms of a boilerplate -# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is -# odd, then rounding the last $# up in the temporary macro is -# harmless. For example, both m4_case(1,2,3,4,5) and -# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being -# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6]) -m4_define([m4_case], -[m4_if(m4_eval([$# <= 2]), [1], [$2], -[m4_pushdef([_$0], [m4_if(]_m4_for([2], m4_eval([($# - 1) / 2 * 2]), [2], - [_$0_(], [)])[_m4_popdef( - [_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])]) - -m4_define([_m4_case_], -[$0_([1], [$1], m4_incr([$1]))]) - -m4_define([_m4_case__], -[[[$$1],[$$2],[$$3],]]) - -# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT) -# ----------------------------------------------------- -# m4 equivalent of -# -# if (SWITCH =~ RE1) -# VAL1; -# elif (SWITCH =~ RE2) -# VAL2; -# elif ... -# ... -# else -# DEFAULT -# -# We build the temporary macro _m4_b: -# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])... -# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b])) -# then invoke m4_unquote(_m4_b($@)), for concatenation with later text. -m4_define([m4_bmatch], -[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], - [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], - [$#], 2, [$2], - [m4_pushdef([_m4_b], [m4_define([_m4_b], - _m4_defn([_$0]))]_m4_for([3], m4_eval([($# + 1) / 2 * 2 - 1]), - [2], [_$0_(], [)])[_m4_b([], [],]m4_dquote([$]m4_eval( - [($# + 1) / 2 * 2]))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])]) - -m4_define([_m4_bmatch], -[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])]) - -m4_define([_m4_bmatch_], -[$0_([1], m4_decr([$1]), [$1])]) - -m4_define([_m4_bmatch__], -[[_m4_b([$$1], [$$2], [$$3])]]) - - -# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT]) -# ------------------------------------------------------------------- -# Similar to m4_if, except that each TEST is expanded when encountered. -# If the expansion of TESTn matches the string VALn, the result is IF-VALn. -# The result is DEFAULT if no tests passed. This macro allows -# short-circuiting of expensive tests, where it pays to arrange quick -# filter tests to run first. -# -# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n. -# We only have to speed up _m4_cond, by building the temporary _m4_c: -# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)], -# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)], -# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)], -# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c])) -# We invoke m4_unquote(_m4_c($@)), for concatenation with later text. -m4_define([_m4_cond], -[m4_pushdef([_m4_c], [m4_define([_m4_c], - _m4_defn([m4_unquote]))]_m4_for([2], m4_eval([$# / 3 * 3 - 1]), [3], - [$0_(], [)])[_m4_c(]m4_dquote(m4_dquote( - [$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))]) - -m4_define([_m4_cond_], -[$0_(m4_decr([$1]), [$1], m4_incr([$1]))]) - -m4_define([_m4_cond__], -[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]]) - -# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...) -# ---------------------------------------------------- -# m4 equivalent of -# -# $_ = STRING; -# s/RE1/SUBST1/g; -# s/RE2/SUBST2/g; -# ... -# -# m4_bpatsubsts already validated an odd number of arguments; we only -# need to speed up _m4_bpatsubsts. To avoid nesting, we build the -# temporary _m4_p: -# m4_define([_m4_p], [$1])m4_define([_m4_p], -# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p], -# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],... -# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote( -# _m4_defn([_m4_p])_m4_popdef([_m4_p])) -m4_define([_m4_bpatsubsts], -[m4_pushdef([_m4_p], [m4_define([_m4_p], - ]m4_dquote([$]1)[)]_m4_for([3], [$#], [2], [$0_(], - [)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)]) - -m4_define([_m4_bpatsubsts_], -[$0_(m4_decr([$1]), [$1])]) - -m4_define([_m4_bpatsubsts__], -[[m4_define([_m4_p], -m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]]) - -# m4_shiftn(N, ...) -# ----------------- -# Returns ... shifted N times. Useful for recursive "varargs" constructs. -# -# m4_shiftn already validated arguments; we only need to speed up -# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as -# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s]) -# before calling m4_shift(_m4_s($@)). -m4_define([_m4_shiftn], -[m4_if(m4_incr([$1]), [$#], [], [m4_pushdef([_m4_s], - _m4_for(m4_eval([$1 + 2]), [$#], [1], - [[,]m4_dquote($], [)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])]) - -# m4_do(STRING, ...) -# ------------------ -# This macro invokes all its arguments (in sequence, of course). It is -# useful for making your macros more structured and readable by dropping -# unnecessary dnl's and have the macros indented properly. -# -# Here, we use the temporary macro _m4_do, defined as -# $1[]$2[]...[]$n[]_m4_popdef([_m4_do]) -m4_define([m4_do], -[m4_if([$#], [0], [], - [m4_pushdef([_$0], _m4_for([1], [$#], [1], - [$], [[[]]])[_m4_popdef([_$0])])_$0($@)])]) - -# m4_dquote_elt(ARGS) -# ------------------- -# Return ARGS as an unquoted list of double-quoted arguments. -# -# _m4_foreach to the rescue. -m4_define([m4_dquote_elt], -[m4_if([$#], [0], [], [[[$1]]_m4_foreach([,m4_dquote(], [)], $@)])]) - -# m4_reverse(ARGS) -# ---------------- -# Output ARGS in reverse order. -# -# Invoke _m4_r($@) with the temporary _m4_r built as -# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r]) -m4_define([m4_reverse], -[m4_if([$#], [0], [], [$#], [1], [[$1]], -[m4_pushdef([_m4_r], [[$$#]]_m4_for(m4_decr([$#]), [1], [-1], - [[, ]m4_dquote($], [)])[_m4_popdef([_m4_r])])_m4_r($@)])]) - - -# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...) -# ------------------------------------------------------------- -# Perform a pairwise grouping of consecutive ARGs, by expanding -# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the -# final argument is expanded with END-EXPR([ARGn]). -# -# Build the temporary macro _m4_map_args_pair, with the $2([$m+1]) -# only output if $# is odd: -# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1], -# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_map_args_pair]) -m4_define([m4_map_args_pair], -[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], - [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])], - [$#], [2], [], - [$#], [3], [m4_default([$2], [$1])([$3])[]], - [m4_pushdef([_$0], _m4_for([3], - m4_eval([$# / 2 * 2 - 1]), [2], [_$0_(], [)])_$0_end( - [1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])]) - -m4_define([_m4_map_args_pair_], -[$0_([1], [$1], m4_incr([$1]))]) - -m4_define([_m4_map_args_pair__], -[[$$1([$$2], [$$3])[]]]) - -m4_define([_m4_map_args_pair_end], -[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])]) - -# m4_join(SEP, ARG1, ARG2...) -# --------------------------- -# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG -# is the empty string. No expansion is performed on SEP or ARGs. -# -# Use a self-modifying separator, since we don't know how many -# arguments might be skipped before a separator is first printed, but -# be careful if the separator contains $. _m4_foreach to the rescue. -m4_define([m4_join], -[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl -[_m4_foreach([_$0([$1],], [)], $@)_m4_popdef([_m4_sep])]) - -m4_define([_m4_join], -[m4_if([$2], [], [], [_m4_sep([$1])[$2]])]) - -# m4_joinall(SEP, ARG1, ARG2...) -# ------------------------------ -# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP. -# No expansion is performed on SEP or ARGs. -# -# A bit easier than m4_join. _m4_foreach to the rescue. -m4_define([m4_joinall], -[[$2]m4_if(m4_eval([$# <= 2]), [1], [], - [_m4_foreach([$1], [], m4_shift($@))])]) - -# m4_list_cmp(A, B) -# ----------------- -# Compare the two lists of integer expressions A and B. -# -# m4_list_cmp takes care of any side effects; we only override -# _m4_list_cmp_raw, where we can safely expand lists multiple times. -# First, insert padding so that both lists are the same length; the -# trailing +0 is necessary to handle a missing list. Next, create a -# temporary macro to perform pairwise comparisons until an inequality -# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as -# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])], -# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])], -# [0]_m4_popdef([_m4_cmp])) -# then calls _m4_cmp([1+0], [0*2], [1], [2+0]) -m4_define([_m4_list_cmp_raw], -[m4_if([$1], [$2], 0, - [_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)), - $2+0_m4_list_pad(m4_count($2), m4_count($1)))])]) - -m4_define([_m4_list_pad], -[m4_if(m4_eval($1 < $2), [1], - [_m4_for(m4_incr([$1]), [$2], [1], [,0*])])]) - -m4_define([_m4_list_cmp], -[m4_pushdef([_m4_cmp], [m4_if(]_m4_for( - [1], m4_eval([$# >> 1]), [1], [$0_(], [,]m4_eval([$# >> 1])[)])[ - [0]_m4_popdef([_m4_cmp]))])_m4_cmp($@)]) - -m4_define([_m4_list_cmp_], -[$0_([$1], m4_eval([$1 + $2]))]) - -m4_define([_m4_list_cmp__], -[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])], -]]) - -# m4_max(EXPR, ...) -# m4_min(EXPR, ...) -# ----------------- -# Return the decimal value of the maximum (or minimum) in a series of -# integer expressions. -# -# _m4_foreach to the rescue; we only need to replace _m4_minmax. Here, -# we need a temporary macro to track the best answer so far, so that -# the foreach expression is tractable. -m4_define([_m4_minmax], -[m4_pushdef([_m4_best], m4_eval([$2]))_m4_foreach( - [m4_define([_m4_best], $1(_m4_best,], [))], m4_shift($@))]dnl -[_m4_best[]_m4_popdef([_m4_best])]) - -# m4_set_add_all(SET, VALUE...) -# ----------------------------- -# Add each VALUE into SET. This is O(n) in the number of VALUEs, and -# can be faster than calling m4_set_add for each VALUE. -# -# _m4_foreach to the rescue. If no deletions have occurred, then -# avoid the speed penalty of m4_set_add. -m4_define([m4_set_add_all], -[m4_if([$#], [0], [], [$#], [1], [], - [m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1]) - + m4_len(_m4_foreach(m4_ifdef([_m4_set_cleanup($1)], - [[m4_set_add]], [[_$0]])[([$1],], [)], $@))))])]) - -m4_define([_m4_set_add_all], -[m4_ifdef([_m4_set([$1],$2)], [], - [m4_define([_m4_set([$1],$2)], - [1])m4_pushdef([_m4_set([$1])], [$2])-])]) diff --git a/tools/data/m4sugar/m4sugar.m4 b/tools/data/m4sugar/m4sugar.m4 deleted file mode 100644 index 3573537d..00000000 --- a/tools/data/m4sugar/m4sugar.m4 +++ /dev/null @@ -1,3301 +0,0 @@ -divert(-1)# -*- Autoconf -*- -# This file is part of Autoconf. -# Base M4 layer. -# Requires GNU M4. -# -# Copyright (C) 1999-2012 Free Software Foundation, Inc. - -# This file is part of Autoconf. This program is free -# software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# Under Section 7 of GPL version 3, you are granted additional -# permissions described in the Autoconf Configure Script Exception, -# version 3.0, as published by the Free Software Foundation. -# -# You should have received a copy of the GNU General Public License -# and a copy of the Autoconf Configure Script Exception along with -# this program; see the files COPYINGv3 and COPYING.EXCEPTION -# respectively. If not, see . - -# Written by Akim Demaille. - -# Set the quotes, whatever the current quoting system. -changequote() -changequote([, ]) - -# Some old m4's don't support m4exit. But they provide -# equivalent functionality by core dumping because of the -# long macros we define. -ifdef([__gnu__], , -[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or -set the M4 environment variable to its absolute file name.) -m4exit(2)]) - - -## ------------------------------- ## -## 1. Simulate --prefix-builtins. ## -## ------------------------------- ## - -# m4_define -# m4_defn -# m4_undefine -define([m4_define], defn([define])) -define([m4_defn], defn([defn])) -define([m4_undefine], defn([undefine])) - -m4_undefine([define]) -m4_undefine([defn]) -m4_undefine([undefine]) - - -# m4_copy(SRC, DST) -# ----------------- -# Define DST as the definition of SRC. -# What's the difference between: -# 1. m4_copy([from], [to]) -# 2. m4_define([to], [from($@)]) -# Well, obviously 1 is more expensive in space. Maybe 2 is more expensive -# in time, but because of the space cost of 1, it's not that obvious. -# Nevertheless, one huge difference is the handling of `$0'. If `from' -# uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2. -# The user would certainly prefer to see `to'. -# -# This definition is in effect during m4sugar initialization, when -# there are no pushdef stacks; later on, we redefine it to something -# more powerful for all other clients to use. -m4_define([m4_copy], -[m4_define([$2], m4_defn([$1]))]) - - -# m4_rename(SRC, DST) -# ------------------- -# Rename the macro SRC to DST. -m4_define([m4_rename], -[m4_copy([$1], [$2])m4_undefine([$1])]) - - -# m4_rename_m4(MACRO-NAME) -# ------------------------ -# Rename MACRO-NAME to m4_MACRO-NAME. -m4_define([m4_rename_m4], -[m4_rename([$1], [m4_$1])]) - - -# m4_copy_unm4(m4_MACRO-NAME) -# --------------------------- -# Copy m4_MACRO-NAME to MACRO-NAME. -m4_define([m4_copy_unm4], -[m4_copy([$1], m4_bpatsubst([$1], [^m4_\(.*\)], [[\1]]))]) - - -# Some m4 internals have names colliding with tokens we might use. -# Rename them a` la `m4 --prefix-builtins'. Conditionals first, since -# some subsequent renames are conditional. -m4_rename_m4([ifdef]) -m4_rename([ifelse], [m4_if]) - -m4_rename_m4([builtin]) -m4_rename_m4([changecom]) -m4_rename_m4([changequote]) -m4_ifdef([changeword],dnl conditionally available in 1.4.x -[m4_undefine([changeword])]) -m4_rename_m4([debugfile]) -m4_rename_m4([debugmode]) -m4_rename_m4([decr]) -m4_rename_m4([divnum]) -m4_rename_m4([dumpdef]) -m4_rename_m4([errprint]) -m4_rename_m4([esyscmd]) -m4_rename_m4([eval]) -m4_rename_m4([format]) -m4_undefine([include]) -m4_rename_m4([incr]) -m4_rename_m4([index]) -m4_rename_m4([indir]) -m4_rename_m4([len]) -m4_rename([m4exit], [m4_exit]) -m4_undefine([m4wrap]) -m4_ifdef([mkstemp],dnl added in M4 1.4.8 -[m4_rename_m4([mkstemp]) -m4_copy([m4_mkstemp], [m4_maketemp]) -m4_undefine([maketemp])], -[m4_rename_m4([maketemp]) -m4_copy([m4_maketemp], [m4_mkstemp])]) -m4_rename([patsubst], [m4_bpatsubst]) -m4_rename_m4([popdef]) -m4_rename_m4([pushdef]) -m4_rename([regexp], [m4_bregexp]) -m4_rename_m4([shift]) -m4_undefine([sinclude]) -m4_rename_m4([substr]) -m4_ifdef([symbols],dnl present only in alpha-quality 1.4o -[m4_rename_m4([symbols])]) -m4_rename_m4([syscmd]) -m4_rename_m4([sysval]) -m4_rename_m4([traceoff]) -m4_rename_m4([traceon]) -m4_rename_m4([translit]) - -# _m4_defn(ARG) -# ------------- -# _m4_defn is for internal use only - it bypasses the wrapper, so it -# must only be used on one argument at a time, and only on macros -# known to be defined. Make sure this still works if the user renames -# m4_defn but not _m4_defn. -m4_copy([m4_defn], [_m4_defn]) - -# _m4_divert_raw(NUM) -# ------------------- -# _m4_divert_raw is for internal use only. Use this instead of -# m4_builtin([divert], NUM), so that tracing diversion flow is easier. -m4_rename([divert], [_m4_divert_raw]) - -# _m4_popdef(ARG...) -# ------------------ -# _m4_popdef is for internal use only - it bypasses the wrapper, so it -# must only be used on macros known to be defined. Make sure this -# still works if the user renames m4_popdef but not _m4_popdef. -m4_copy([m4_popdef], [_m4_popdef]) - -# _m4_undefine(ARG...) -# -------------------- -# _m4_undefine is for internal use only - it bypasses the wrapper, so -# it must only be used on macros known to be defined. Make sure this -# still works if the user renames m4_undefine but not _m4_undefine. -m4_copy([m4_undefine], [_m4_undefine]) - -# _m4_undivert(NUM...) -# -------------------- -# _m4_undivert is for internal use only, and should always be given -# arguments. Use this instead of m4_builtin([undivert], NUM...), so -# that tracing diversion flow is easier. -m4_rename([undivert], [_m4_undivert]) - - -## ------------------- ## -## 2. Error messages. ## -## ------------------- ## - - -# m4_location -# ----------- -# Output the current file, colon, and the current line number. -m4_define([m4_location], -[__file__:__line__]) - - -# m4_errprintn(MSG) -# ----------------- -# Same as `errprint', but with the missing end of line. -m4_define([m4_errprintn], -[m4_errprint([$1 -])]) - - -# m4_warning(MSG) -# --------------- -# Warn the user. -m4_define([m4_warning], -[m4_errprintn(m4_location[: warning: $1])]) - - -# m4_fatal(MSG, [EXIT-STATUS]) -# ---------------------------- -# Fatal the user. :) -m4_define([m4_fatal], -[m4_errprintn(m4_location[: error: $1] -m4_expansion_stack)m4_exit(m4_if([$2],, 1, [$2]))]) - - -# m4_assert(EXPRESSION, [EXIT-STATUS = 1]) -# ---------------------------------------- -# This macro ensures that EXPRESSION evaluates to true, and exits if -# EXPRESSION evaluates to false. -m4_define([m4_assert], -[m4_if(m4_eval([$1]), 0, - [m4_fatal([assert failed: $1], [$2])])]) - - - -## ------------- ## -## 3. Warnings. ## -## ------------- ## - - -# _m4_warn(CATEGORY, MESSAGE, [STACK-TRACE]) -# ------------------------------------------ -# Report a MESSAGE to the user if the CATEGORY of warnings is enabled. -# This is for traces only. -# If present, STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE", -# where the last line (and no other) ends with "the top level". -# -# Within m4, the macro is a no-op. This macro really matters -# when autom4te post-processes the trace output. -m4_define([_m4_warn], []) - - -# m4_warn(CATEGORY, MESSAGE) -# -------------------------- -# Report a MESSAGE to the user if the CATEGORY of warnings is enabled. -m4_define([m4_warn], -[_m4_warn([$1], [$2], -m4_ifdef([_m4_expansion_stack], [m4_expansion_stack]))]) - - - -## ------------------- ## -## 4. File inclusion. ## -## ------------------- ## - - -# We also want to neutralize include (and sinclude for symmetry), -# but we want to extend them slightly: warn when a file is included -# several times. This is, in general, a dangerous operation, because -# too many people forget to quote the first argument of m4_define. -# -# For instance in the following case: -# m4_define(foo, [bar]) -# then a second reading will turn into -# m4_define(bar, [bar]) -# which is certainly not what was meant. - -# m4_include_unique(FILE) -# ----------------------- -# Declare that the FILE was loading; and warn if it has already -# been included. -m4_define([m4_include_unique], -[m4_ifdef([m4_include($1)], - [m4_warn([syntax], [file `$1' included several times])])dnl -m4_define([m4_include($1)])]) - - -# m4_include(FILE) -# ---------------- -# Like the builtin include, but warns against multiple inclusions. -m4_define([m4_include], -[m4_include_unique([$1])dnl -m4_builtin([include], [$1])]) - - -# m4_sinclude(FILE) -# ----------------- -# Like the builtin sinclude, but warns against multiple inclusions. -m4_define([m4_sinclude], -[m4_include_unique([$1])dnl -m4_builtin([sinclude], [$1])]) - - - -## ------------------------------------ ## -## 5. Additional branching constructs. ## -## ------------------------------------ ## - -# Both `m4_ifval' and `m4_ifset' tests against the empty string. The -# difference is that `m4_ifset' is specialized on macros. -# -# In case of arguments of macros, eg. $1, it makes little difference. -# In the case of a macro `FOO', you don't want to check `m4_ifval(FOO, -# TRUE)', because if `FOO' expands with commas, there is a shifting of -# the arguments. So you want to run `m4_ifval([FOO])', but then you just -# compare the *string* `FOO' against `', which, of course fails. -# -# So you want the variation `m4_ifset' that expects a macro name as $1. -# If this macro is both defined and defined to a non empty value, then -# it runs TRUE, etc. - - -# m4_ifblank(COND, [IF-BLANK], [IF-TEXT]) -# m4_ifnblank(COND, [IF-TEXT], [IF-BLANK]) -# ---------------------------------------- -# If COND is empty, or consists only of blanks (space, tab, newline), -# then expand IF-BLANK, otherwise expand IF-TEXT. This differs from -# m4_ifval only if COND has just whitespace, but it helps optimize in -# spite of users who mistakenly leave trailing space after what they -# thought was an empty argument: -# macro( -# [] -# ) -# -# Writing one macro in terms of the other causes extra overhead, so -# we inline both definitions. -m4_define([m4_ifblank], -[m4_if(m4_translit([[$1]], [ ][ ][ -]), [], [$2], [$3])]) - -m4_define([m4_ifnblank], -[m4_if(m4_translit([[$1]], [ ][ ][ -]), [], [$3], [$2])]) - - -# m4_ifval(COND, [IF-TRUE], [IF-FALSE]) -# ------------------------------------- -# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE. -# Comparable to m4_ifdef. -m4_define([m4_ifval], -[m4_if([$1], [], [$3], [$2])]) - - -# m4_n(TEXT) -# ---------- -# If TEXT is not empty, return TEXT and a new line, otherwise nothing. -m4_define([m4_n], -[m4_if([$1], - [], [], - [$1 -])]) - - -# m4_ifvaln(COND, [IF-TRUE], [IF-FALSE]) -# -------------------------------------- -# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE -# unless that argument is empty. -m4_define([m4_ifvaln], -[m4_if([$1], - [], [m4_n([$3])], - [m4_n([$2])])]) - - -# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE]) -# -------------------------------------- -# If MACRO has no definition, or of its definition is the empty string, -# expand IF-FALSE, otherwise IF-TRUE. -m4_define([m4_ifset], -[m4_ifdef([$1], - [m4_ifval(_m4_defn([$1]), [$2], [$3])], - [$3])]) - - -# m4_ifndef(NAME, [IF-NOT-DEFINED], [IF-DEFINED]) -# ----------------------------------------------- -m4_define([m4_ifndef], -[m4_ifdef([$1], [$3], [$2])]) - - -# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT) -# ----------------------------------------------------------- -# m4 equivalent of -# switch (SWITCH) -# { -# case VAL1: -# IF-VAL1; -# break; -# case VAL2: -# IF-VAL2; -# break; -# ... -# default: -# DEFAULT; -# break; -# }. -# All the values are optional, and the macro is robust to active -# symbols properly quoted. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_case], -[m4_if([$#], 0, [], - [$#], 1, [], - [$#], 2, [$2], - [$1], [$2], [$3], - [$0([$1], m4_shift3($@))])]) - - -# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT) -# ----------------------------------------------------- -# m4 equivalent of -# -# if (SWITCH =~ RE1) -# VAL1; -# elif (SWITCH =~ RE2) -# VAL2; -# elif ... -# ... -# else -# DEFAULT -# -# All the values are optional, and the macro is robust to active symbols -# properly quoted. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_bmatch], -[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], - [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], - [$#], 2, [$2], - [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shift3($@))], - [$3])])]) - -# m4_argn(N, ARGS...) -# ------------------- -# Extract argument N (greater than 0) from ARGS. Example: -# m4_define([b], [B]) -# m4_argn([2], [a], [b], [c]) => b -# -# Rather than using m4_car(m4_shiftn([$1], $@)), we exploit the fact that -# GNU m4 can directly reference any argument, through an indirect macro. -m4_define([m4_argn], -[m4_assert([0 < $1])]dnl -[m4_pushdef([_$0], [_m4_popdef([_$0])]m4_dquote([$]m4_incr([$1])))_$0($@)]) - - -# m4_car(ARGS...) -# m4_cdr(ARGS...) -# --------------- -# Manipulate m4 lists. m4_car returns the first argument. m4_cdr -# bundles all but the first argument into a quoted list. These two -# macros are generally used with list arguments, with quoting removed -# to break the list into multiple m4 ARGS. -m4_define([m4_car], [[$1]]) -m4_define([m4_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) - -# _m4_cdr(ARGS...) -# ---------------- -# Like m4_cdr, except include a leading comma unless only one argument -# remains. Why? Because comparing a large list against [] is more -# expensive in expansion time than comparing the number of arguments; so -# _m4_cdr can be used to reduce the number of arguments when it is time -# to end recursion. -m4_define([_m4_cdr], -[m4_if([$#], 1, [], - [, m4_dquote(m4_shift($@))])]) - - - -# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT]) -# ------------------------------------------------------------------- -# Similar to m4_if, except that each TEST is expanded when encountered. -# If the expansion of TESTn matches the string VALn, the result is IF-VALn. -# The result is DEFAULT if no tests passed. This macro allows -# short-circuiting of expensive tests, where it pays to arrange quick -# filter tests to run first. -# -# For an example, consider a previous implementation of _AS_QUOTE_IFELSE: -# -# m4_if(m4_index([$1], [\]), [-1], [$2], -# m4_eval(m4_index([$1], [\\]) >= 0), [1], [$2], -# m4_eval(m4_index([$1], [\$]) >= 0), [1], [$2], -# m4_eval(m4_index([$1], [\`]) >= 0), [1], [$3], -# m4_eval(m4_index([$1], [\"]) >= 0), [1], [$3], -# [$2]) -# -# Here, m4_index is computed 5 times, and m4_eval 4, even if $1 contains -# no backslash. It is more efficient to do: -# -# m4_cond([m4_index([$1], [\])], [-1], [$2], -# [m4_eval(m4_index([$1], [\\]) >= 0)], [1], [$2], -# [m4_eval(m4_index([$1], [\$]) >= 0)], [1], [$2], -# [m4_eval(m4_index([$1], [\`]) >= 0)], [1], [$3], -# [m4_eval(m4_index([$1], [\"]) >= 0)], [1], [$3], -# [$2]) -# -# In the common case of $1 with no backslash, only one m4_index expansion -# occurs, and m4_eval is avoided altogether. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_cond], -[m4_if([$#], [0], [m4_fatal([$0: cannot be called without arguments])], - [$#], [1], [$1], - m4_eval([$# % 3]), [2], [m4_fatal([$0: missing an argument])], - [_$0($@)])]) - -m4_define([_m4_cond], -[m4_if(($1), [($2)], [$3], - [$#], [3], [], - [$#], [4], [$4], - [$0(m4_shift3($@))])]) - - -## ---------------------------------------- ## -## 6. Enhanced version of some primitives. ## -## ---------------------------------------- ## - -# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...) -# ---------------------------------------------------- -# m4 equivalent of -# -# $_ = STRING; -# s/RE1/SUBST1/g; -# s/RE2/SUBST2/g; -# ... -# -# All the values are optional, and the macro is robust to active symbols -# properly quoted. -# -# I would have liked to name this macro `m4_bpatsubst', unfortunately, -# due to quotation problems, I need to double quote $1 below, therefore -# the anchors are broken :( I can't let users be trapped by that. -# -# Recall that m4_shift3 always results in an argument. Hence, we need -# to distinguish between a final deletion vs. ending recursion. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_bpatsubsts], -[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], - [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])], - [$#], 2, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2]))], - [$#], 3, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2], [$3]))], - [_$0($@m4_if(m4_eval($# & 1), 0, [,]))])]) -m4_define([_m4_bpatsubsts], -[m4_if([$#], 2, [$1], - [$0(m4_builtin([patsubst], [[$1]], [$2], [$3]), - m4_shift3($@))])]) - - -# m4_copy(SRC, DST) -# ----------------- -# Define the pushdef stack DST as a copy of the pushdef stack SRC; -# give an error if DST is already defined. This is particularly nice -# for copying self-modifying pushdef stacks, where the top definition -# includes one-shot initialization that is later popped to the normal -# definition. This version intentionally does nothing if SRC is -# undefined. -# -# Some macros simply can't be renamed with this method: namely, anything -# involved in the implementation of m4_stack_foreach_sep. -m4_define([m4_copy], -[m4_ifdef([$2], [m4_fatal([$0: won't overwrite defined macro: $2])], - [m4_stack_foreach_sep([$1], [m4_pushdef([$2],], [)])])]dnl -[m4_ifdef([m4_location($1)], [m4_define([m4_location($2)], m4_location)])]) - - -# m4_copy_force(SRC, DST) -# m4_rename_force(SRC, DST) -# ------------------------- -# Like m4_copy/m4_rename, except blindly overwrite any existing DST. -# Note that m4_copy_force tolerates undefined SRC, while m4_rename_force -# does not. -m4_define([m4_copy_force], -[m4_ifdef([$2], [_m4_undefine([$2])])m4_copy($@)]) - -m4_define([m4_rename_force], -[m4_ifdef([$2], [_m4_undefine([$2])])m4_rename($@)]) - - -# m4_define_default(MACRO, VALUE) -# ------------------------------- -# If MACRO is undefined, set it to VALUE. -m4_define([m4_define_default], -[m4_ifndef([$1], [m4_define($@)])]) - - -# m4_default(EXP1, EXP2) -# m4_default_nblank(EXP1, EXP2) -# ----------------------------- -# Returns EXP1 if not empty/blank, otherwise EXP2. Expand the result. -# -# m4_default is called on hot paths, so inline the contents of m4_ifval, -# for one less round of expansion. -m4_define([m4_default], -[m4_if([$1], [], [$2], [$1])]) - -m4_define([m4_default_nblank], -[m4_ifblank([$1], [$2], [$1])]) - - -# m4_default_quoted(EXP1, EXP2) -# m4_default_nblank_quoted(EXP1, EXP2) -# ------------------------------------ -# Returns EXP1 if non empty/blank, otherwise EXP2. Leave the result quoted. -# -# For comparison: -# m4_define([active], [ACTIVE]) -# m4_default([active], [default]) => ACTIVE -# m4_default([], [active]) => ACTIVE -# -m4_default([ ], [active])- => - - -# -m4_default_nblank([ ], [active])- => -ACTIVE- -# m4_default_quoted([active], [default]) => active -# m4_default_quoted([], [active]) => active -# -m4_default_quoted([ ], [active])- => - - -# -m4_default_nblank_quoted([ ], [active])- => -active- -# -# m4_default macro is called on hot paths, so inline the contents of m4_ifval, -# for one less round of expansion. -m4_define([m4_default_quoted], -[m4_if([$1], [], [[$2]], [[$1]])]) - -m4_define([m4_default_nblank_quoted], -[m4_ifblank([$1], [[$2]], [[$1]])]) - - -# m4_defn(NAME) -# ------------- -# Like the original, except guarantee a warning when using something which is -# undefined (unlike M4 1.4.x). This replacement is not a full-featured -# replacement: if any of the defined macros contain unbalanced quoting, but -# when pasted together result in a well-quoted string, then only native m4 -# support is able to get it correct. But that's where quadrigraphs come in -# handy, if you really need unbalanced quotes inside your macros. -# -# This macro is called frequently, so minimize the amount of additional -# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, -# (added in M4 1.6), then let m4 do the job for us (see m4_init). -m4_define([m4_defn], -[m4_if([$#], [0], [[$0]], - [$#], [1], [m4_ifdef([$1], [_m4_defn([$1])], - [m4_fatal([$0: undefined macro: $1])])], - [m4_map_args([$0], $@)])]) - - -# m4_dumpdef(NAME...) -# ------------------- -# In m4 1.4.x, dumpdef writes to the current debugfile, rather than -# stderr. This in turn royally confuses autom4te; so we follow the -# lead of newer m4 and always dump to stderr. Unlike the original, -# this version requires an argument, since there is no convenient way -# in m4 1.4.x to grab the names of all defined macros. Newer m4 -# always dumps to stderr, regardless of the current debugfile; it also -# provides m4symbols as a way to grab all current macro names. But -# dumpdefs is not frequently called, so we don't need to worry about -# conditionally using these newer features. Also, this version -# doesn't sort multiple arguments. -# -# If we detect m4 1.6 or newer, then provide an alternate definition, -# installed during m4_init, that allows builtins through. -# Unfortunately, there is no nice way in m4 1.4.x to dump builtins. -m4_define([m4_dumpdef], -[m4_if([$#], [0], [m4_fatal([$0: missing argument])], - [$#], [1], [m4_ifdef([$1], [m4_errprintn( - [$1: ]m4_dquote(_m4_defn([$1])))], [m4_fatal([$0: undefined macro: $1])])], - [m4_map_args([$0], $@)])]) - -m4_define([_m4_dumpdef], -[m4_if([$#], [0], [m4_fatal([$0: missing argument])], - [$#], [1], [m4_builtin([dumpdef], [$1])], - [m4_map_args_sep([m4_builtin([dumpdef],], [)], [], $@)])]) - - -# m4_dumpdefs(NAME...) -# -------------------- -# Similar to `m4_dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its -# value stack (most recent displayed first). Also, this version silently -# ignores undefined macros, rather than erroring out. -# -# This macro cheats, because it relies on the current definition of NAME -# while the second argument of m4_stack_foreach_lifo is evaluated (which -# would be undefined according to the API). -m4_define([m4_dumpdefs], -[m4_if([$#], [0], [m4_fatal([$0: missing argument])], - [$#], [1], [m4_stack_foreach_lifo([$1], [m4_dumpdef([$1])m4_ignore])], - [m4_map_args([$0], $@)])]) - -# m4_esyscmd_s(COMMAND) -# --------------------- -# Like m4_esyscmd, except strip any trailing newlines, thus behaving -# more like shell command substitution. -m4_define([m4_esyscmd_s], -[m4_chomp_all(m4_esyscmd([$1]))]) - - -# m4_popdef(NAME) -# --------------- -# Like the original, except guarantee a warning when using something which is -# undefined (unlike M4 1.4.x). -# -# This macro is called frequently, so minimize the amount of additional -# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, -# (added in M4 1.6), then let m4 do the job for us (see m4_init). -m4_define([m4_popdef], -[m4_if([$#], [0], [[$0]], - [$#], [1], [m4_ifdef([$1], [_m4_popdef([$1])], - [m4_fatal([$0: undefined macro: $1])])], - [m4_map_args([$0], $@)])]) - - -# m4_shiftn(N, ...) -# ----------------- -# Returns ... shifted N times. Useful for recursive "varargs" constructs. -# -# Autoconf does not use this macro, because it is inherently slower than -# calling the common cases of m4_shift2 or m4_shift3 directly. But it -# might as well be fast for other clients, such as Libtool. One way to -# do this is to expand $@ only once in _m4_shiftn (otherwise, for long -# lists, the expansion of m4_if takes twice as much memory as what the -# list itself occupies, only to throw away the unused branch). The end -# result is strictly equivalent to -# m4_if([$1], 1, [m4_shift(,m4_shift(m4_shift($@)))], -# [_m4_shiftn(m4_decr([$1]), m4_shift(m4_shift($@)))]) -# but with the final `m4_shift(m4_shift($@)))' shared between the two -# paths. The first leg uses a no-op m4_shift(,$@) to balance out the (). -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_shiftn], -[m4_assert(0 < $1 && $1 < $#)_$0($@)]) - -m4_define([_m4_shiftn], -[m4_if([$1], 1, [m4_shift(], - [$0(m4_decr([$1])]), m4_shift(m4_shift($@)))]) - -# m4_shift2(...) -# m4_shift3(...) -# -------------- -# Returns ... shifted twice, and three times. Faster than m4_shiftn. -m4_define([m4_shift2], [m4_shift(m4_shift($@))]) -m4_define([m4_shift3], [m4_shift(m4_shift(m4_shift($@)))]) - -# _m4_shift2(...) -# _m4_shift3(...) -# --------------- -# Like m4_shift2 or m4_shift3, except include a leading comma unless shifting -# consumes all arguments. Why? Because in recursion, it is nice to -# distinguish between 1 element left and 0 elements left, based on how many -# arguments this shift expands to. -m4_define([_m4_shift2], -[m4_if([$#], [2], [], - [, m4_shift(m4_shift($@))])]) -m4_define([_m4_shift3], -[m4_if([$#], [3], [], - [, m4_shift(m4_shift(m4_shift($@)))])]) - - -# m4_undefine(NAME) -# ----------------- -# Like the original, except guarantee a warning when using something which is -# undefined (unlike M4 1.4.x). -# -# This macro is called frequently, so minimize the amount of additional -# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists, -# (added in M4 1.6), then let m4 do the job for us (see m4_init). -m4_define([m4_undefine], -[m4_if([$#], [0], [[$0]], - [$#], [1], [m4_ifdef([$1], [_m4_undefine([$1])], - [m4_fatal([$0: undefined macro: $1])])], - [m4_map_args([$0], $@)])]) - -# _m4_wrap(PRE, POST) -# ------------------- -# Helper macro for m4_wrap and m4_wrap_lifo. Allows nested calls to -# m4_wrap within wrapped text. Use _m4_defn and _m4_popdef for speed. -m4_define([_m4_wrap], -[m4_ifdef([$0_text], - [m4_define([$0_text], [$1]_m4_defn([$0_text])[$2])], - [m4_builtin([m4wrap], [m4_unquote( - _m4_defn([$0_text])_m4_popdef([$0_text]))])m4_define([$0_text], [$1$2])])]) - -# m4_wrap(TEXT) -# ------------- -# Append TEXT to the list of hooks to be executed at the end of input. -# Whereas the order of the original may be LIFO in the underlying m4, -# this version is always FIFO. -m4_define([m4_wrap], -[_m4_wrap([], [$1[]])]) - -# m4_wrap_lifo(TEXT) -# ------------------ -# Prepend TEXT to the list of hooks to be executed at the end of input. -# Whereas the order of m4_wrap may be FIFO in the underlying m4, this -# version is always LIFO. -m4_define([m4_wrap_lifo], -[_m4_wrap([$1[]])]) - -## ------------------------- ## -## 7. Quoting manipulation. ## -## ------------------------- ## - - -# m4_apply(MACRO, LIST) -# --------------------- -# Invoke MACRO, with arguments provided from the quoted list of -# comma-separated quoted arguments. If LIST is empty, invoke MACRO -# without arguments. The expansion will not be concatenated with -# subsequent text. -m4_define([m4_apply], -[m4_if([$2], [], [$1], [$1($2)])[]]) - -# _m4_apply(MACRO, LIST) -# ---------------------- -# Like m4_apply, except do nothing if LIST is empty. -m4_define([_m4_apply], -[m4_if([$2], [], [], [$1($2)[]])]) - - -# m4_count(ARGS) -# -------------- -# Return a count of how many ARGS are present. -m4_define([m4_count], [$#]) - - -# m4_curry(MACRO, ARG...) -# ----------------------- -# Perform argument currying. The expansion of this macro is another -# macro that takes exactly one argument, appends it to the end of the -# original ARG list, then invokes MACRO. For example: -# m4_curry([m4_curry], [m4_reverse], [1])([2])([3]) => 3, 2, 1 -# Not quite as practical as m4_incr, but you could also do: -# m4_define([add], [m4_eval(([$1]) + ([$2]))]) -# m4_define([add_one], [m4_curry([add], [1])]) -# add_one()([2]) => 3 -m4_define([m4_curry], [$1(m4_shift($@,)_$0]) -m4_define([_m4_curry], [[$1])]) - - -# m4_do(STRING, ...) -# ------------------ -# This macro invokes all its arguments (in sequence, of course). It is -# useful for making your macros more structured and readable by dropping -# unnecessary dnl's and have the macros indented properly. No concatenation -# occurs after a STRING; use m4_unquote(m4_join(,STRING)) for that. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_do], -[m4_if([$#], 0, [], - [$#], 1, [$1[]], - [$1[]$0(m4_shift($@))])]) - - -# m4_dquote(ARGS) -# --------------- -# Return ARGS as a quoted list of quoted arguments. -m4_define([m4_dquote], [[$@]]) - - -# m4_dquote_elt(ARGS) -# ------------------- -# Return ARGS as an unquoted list of double-quoted arguments. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_dquote_elt], -[m4_if([$#], [0], [], - [$#], [1], [[[$1]]], - [[[$1]],$0(m4_shift($@))])]) - - -# m4_echo(ARGS) -# ------------- -# Return the ARGS, with the same level of quoting. Whitespace after -# unquoted commas are consumed. -m4_define([m4_echo], [$@]) - - -# m4_expand(ARG) -# _m4_expand(ARG) -# --------------- -# Return the expansion of ARG as a single string. Unlike -# m4_quote($1), this preserves whitespace following single-quoted -# commas that appear within ARG. It also deals with shell case -# statements. -# -# m4_define([active], [ACT, IVE]) -# m4_define([active2], [[ACT, IVE]]) -# m4_quote(active, active2) -# => ACT,IVE,ACT, IVE -# m4_expand([active, active2]) -# => ACT, IVE, ACT, IVE -# -# Unfortunately, due to limitations in m4, ARG must expand to -# something with balanced quotes (use quadrigraphs to get around -# this), and should not contain the unlikely delimiters -=<{( or -# )}>=-. It is possible to have unbalanced quoted `(' or `)', as well -# as unbalanced unquoted `)'. m4_expand can handle unterminated -# comments or dnl on the final line, at the expense of speed; it also -# aids in detecting attempts to incorrectly change the current -# diversion inside ARG. Meanwhile, _m4_expand is faster but must be -# given a terminated expansion, and has no safety checks for -# mis-diverted text. -# -# Exploit that extra unquoted () will group unquoted commas and the -# following whitespace. m4_bpatsubst can't handle newlines inside $1, -# and m4_substr strips quoting. So we (ab)use m4_changequote, using -# temporary quotes to remove the delimiters that conveniently included -# the unquoted () that were added prior to the changequote. -# -# Thanks to shell case statements, too many people are prone to pass -# underquoted `)', so we try to detect that by passing a marker as a -# fourth argument; if the marker is not present, then we assume that -# we encountered an early `)', and re-expand the first argument, but -# this time with one more `(' in the second argument and in the -# open-quote delimiter. We must also ignore the slop from the -# previous try. The final macro is thus half line-noise, half art. -m4_define([m4_expand], -[m4_pushdef([m4_divert], _m4_defn([_m4_divert_unsafe]))]dnl -[m4_pushdef([m4_divert_push], _m4_defn([_m4_divert_unsafe]))]dnl -[m4_chomp(_$0([$1 -]))_m4_popdef([m4_divert], [m4_divert_push])]) - -m4_define([_m4_expand], [$0_([$1], [(], -=<{($1)}>=-, [}>=-])]) - -m4_define([_m4_expand_], -[m4_if([$4], [}>=-], - [m4_changequote([-=<{$2], [)}>=-])$3m4_changequote([, ])], - [$0([$1], [($2], -=<{($2$1)}>=-, [}>=-])m4_ignore$2])]) - - -# m4_ignore(ARGS) -# --------------- -# Expands to nothing. Useful for conditionally ignoring an arbitrary -# number of arguments (see _m4_list_cmp for an example). -m4_define([m4_ignore]) - - -# m4_make_list(ARGS) -# ------------------ -# Similar to m4_dquote, this creates a quoted list of quoted ARGS. This -# version is less efficient than m4_dquote, but separates each argument -# with a comma and newline, rather than just comma, for readability. -# When developing an m4sugar algorithm, you could temporarily use -# m4_pushdef([m4_dquote],m4_defn([m4_make_list])) -# around your code to make debugging easier. -m4_define([m4_make_list], [m4_join([, -], m4_dquote_elt($@))]) - - -# m4_noquote(STRING) -# ------------------ -# Return the result of ignoring all quotes in STRING and invoking the -# macros it contains. Among other things, this is useful for enabling -# macro invocations inside strings with [] blocks (for instance regexps -# and help-strings). On the other hand, since all quotes are disabled, -# any macro expanded during this time that relies on nested [] quoting -# will likely crash and burn. This macro is seldom useful; consider -# m4_unquote or m4_expand instead. -m4_define([m4_noquote], -[m4_changequote([-=<{(],[)}>=-])$1-=<{()}>=-m4_changequote([,])]) - - -# m4_quote(ARGS) -# -------------- -# Return ARGS as a single argument. Any whitespace after unquoted commas -# is stripped. There is always output, even when there were no arguments. -# -# It is important to realize the difference between `m4_quote(exp)' and -# `[exp]': in the first case you obtain the quoted *result* of the -# expansion of EXP, while in the latter you just obtain the string -# `exp'. -m4_define([m4_quote], [[$*]]) - - -# _m4_quote(ARGS) -# --------------- -# Like m4_quote, except that when there are no arguments, there is no -# output. For conditional scenarios (such as passing _m4_quote as the -# macro name in m4_mapall), this feature can be used to distinguish between -# one argument of the empty string vs. no arguments. However, in the -# normal case with arguments present, this is less efficient than m4_quote. -m4_define([_m4_quote], -[m4_if([$#], [0], [], [[$*]])]) - - -# m4_reverse(ARGS) -# ---------------- -# Output ARGS in reverse order. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_reverse], -[m4_if([$#], [0], [], [$#], [1], [[$1]], - [$0(m4_shift($@)), [$1]])]) - - -# m4_unquote(ARGS) -# ---------------- -# Remove one layer of quotes from each ARG, performing one level of -# expansion. For one argument, m4_unquote([arg]) is more efficient than -# m4_do([arg]), but for multiple arguments, the difference is that -# m4_unquote separates arguments with commas while m4_do concatenates. -# Follow this macro with [] if concatenation with subsequent text is -# undesired. -m4_define([m4_unquote], [$*]) - - -## -------------------------- ## -## 8. Implementing m4 loops. ## -## -------------------------- ## - - -# m4_for(VARIABLE, FIRST, LAST, [STEP = +/-1], EXPRESSION) -# -------------------------------------------------------- -# Expand EXPRESSION defining VARIABLE to FROM, FROM + 1, ..., TO with -# increments of STEP. Both limits are included, and bounds are -# checked for consistency. The algorithm is robust to indirect -# VARIABLE names. Changing VARIABLE inside EXPRESSION will not impact -# the number of iterations. -# -# Uses _m4_defn for speed, and avoid dnl in the macro body. Factor -# the _m4_for call so that EXPRESSION is only parsed once. -m4_define([m4_for], -[m4_pushdef([$1], m4_eval([$2]))]dnl -[m4_cond([m4_eval(([$3]) > ([$2]))], 1, - [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4], - 1)))m4_assert(_m4_step > 0)_$0(_m4_defn([$1]), - m4_eval((([$3]) - ([$2])) / _m4_step * _m4_step + ([$2])), _m4_step,], - [m4_eval(([$3]) < ([$2]))], 1, - [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4], - -1)))m4_assert(_m4_step < 0)_$0(_m4_defn([$1]), - m4_eval((([$2]) - ([$3])) / -(_m4_step) * _m4_step + ([$2])), _m4_step,], - [m4_pushdef([_m4_step])_$0(_m4_defn([$1]), _m4_defn([$1]), 0,])]dnl -[[m4_define([$1],], [)$5])m4_popdef([_m4_step], [$1])]) - -# _m4_for(COUNT, LAST, STEP, PRE, POST) -# ------------------------------------- -# Core of the loop, no consistency checks, all arguments are plain -# numbers. Expand PRE[COUNT]POST, then alter COUNT by STEP and -# iterate if COUNT is not LAST. -m4_define([_m4_for], -[$4[$1]$5[]m4_if([$1], [$2], [], - [$0(m4_eval([$1 + $3]), [$2], [$3], [$4], [$5])])]) - - -# Implementing `foreach' loops in m4 is much more tricky than it may -# seem. For example, the old M4 1.4.4 manual had an incorrect example, -# which looked like this (when translated to m4sugar): -# -# | # foreach(VAR, (LIST), STMT) -# | m4_define([foreach], -# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])]) -# | m4_define([_arg1], [$1]) -# | m4_define([_foreach], -# | [m4_if([$2], [()], , -# | [m4_define([$1], _arg1$2)$3[]_foreach([$1], (m4_shift$2), [$3])])]) -# -# But then if you run -# -# | m4_define(a, 1) -# | m4_define(b, 2) -# | m4_define(c, 3) -# | foreach([f], [([a], [(b], [c)])], [echo f -# | ]) -# -# it gives -# -# => echo 1 -# => echo (2,3) -# -# which is not what is expected. -# -# Of course the problem is that many quotes are missing. So you add -# plenty of quotes at random places, until you reach the expected -# result. Alternatively, if you are a quoting wizard, you directly -# reach the following implementation (but if you really did, then -# apply to the maintenance of m4sugar!). -# -# | # foreach(VAR, (LIST), STMT) -# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])]) -# | m4_define([_arg1], [[$1]]) -# | m4_define([_foreach], -# | [m4_if($2, [()], , -# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1], [(m4_shift$2)], [$3])])]) -# -# which this time answers -# -# => echo a -# => echo (b -# => echo c) -# -# Bingo! -# -# Well, not quite. -# -# With a better look, you realize that the parens are more a pain than -# a help: since anyway you need to quote properly the list, you end up -# with always using an outermost pair of parens and an outermost pair -# of quotes. Rejecting the parens both eases the implementation, and -# simplifies the use: -# -# | # foreach(VAR, (LIST), STMT) -# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])]) -# | m4_define([_arg1], [$1]) -# | m4_define([_foreach], -# | [m4_if($2, [], , -# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1], [m4_shift($2)], [$3])])]) -# -# -# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if' -# to improve robustness, and you come up with a nice implementation -# that doesn't require extra parentheses in the user's LIST. -# -# But wait - now the algorithm is quadratic, because every recursion of -# the algorithm keeps the entire LIST and merely adds another m4_shift to -# the quoted text. If the user has a lot of elements in LIST, you can -# bring the system to its knees with the memory m4 then requires, or trip -# the m4 --nesting-limit recursion factor. The only way to avoid -# quadratic growth is ensure m4_shift is expanded prior to the recursion. -# Hence the design below. -# -# The M4 manual now includes a chapter devoted to this issue, with -# the lessons learned from m4sugar. And still, this design is only -# optimal for M4 1.6; see foreach.m4 for yet more comments on why -# M4 1.4.x uses yet another implementation. - - -# m4_foreach(VARIABLE, LIST, EXPRESSION) -# -------------------------------------- -# -# Expand EXPRESSION assigning each value of the LIST to VARIABLE. -# LIST should have the form `item_1, item_2, ..., item_n', i.e. the -# whole list must *quoted*. Quote members too if you don't want them -# to be expanded. -# -# This macro is robust to active symbols: -# | m4_define(active, [ACT, IVE]) -# | m4_foreach(Var, [active, active], [-Var-]) -# => -ACT--IVE--ACT--IVE- -# -# | m4_foreach(Var, [[active], [active]], [-Var-]) -# => -ACT, IVE--ACT, IVE- -# -# | m4_foreach(Var, [[[active]], [[active]]], [-Var-]) -# => -active--active- -# -# This macro is called frequently, so avoid extra expansions such as -# m4_ifval and dnl. Also, since $2 might be quite large, try to use it -# as little as possible in _m4_foreach; each extra use requires that much -# more memory for expansion. So, rather than directly compare $2 against -# [] and use m4_car/m4_cdr for recursion, we instead unbox the list (which -# requires swapping the argument order in the helper), insert an ignored -# third argument, and use m4_shift3 to detect when recursion is complete, -# at which point this looks very much like m4_map_args. -m4_define([m4_foreach], -[m4_if([$2], [], [], - [m4_pushdef([$1])_$0([m4_define([$1],], [)$3], [], - $2)m4_popdef([$1])])]) - -# _m4_foreach(PRE, POST, IGNORED, ARG...) -# --------------------------------------- -# Form the common basis of the m4_foreach and m4_map macros. For each -# ARG, expand PRE[ARG]POST[]. The IGNORED argument makes recursion -# easier, and must be supplied rather than implicit. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([_m4_foreach], -[m4_if([$#], [3], [], - [$1[$4]$2[]$0([$1], [$2], m4_shift3($@))])]) - - -# m4_foreach_w(VARIABLE, LIST, EXPRESSION) -# ---------------------------------------- -# Like m4_foreach, but the list is whitespace separated. Depending on -# EXPRESSION, it may be more efficient to use m4_map_args_w. -# -# This macro is robust to active symbols: -# m4_foreach_w([Var], [ active -# b act\ -# ive ], [-Var-])end -# => -active--b--active-end -# -# This used to use a slower implementation based on m4_foreach: -# m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3]) -m4_define([m4_foreach_w], -[m4_pushdef([$1])m4_map_args_w([$2], - [m4_define([$1],], [)$3])m4_popdef([$1])]) - - -# m4_map(MACRO, LIST) -# m4_mapall(MACRO, LIST) -# ---------------------- -# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements of -# LIST. $1, $2... must in turn be lists, appropriate for m4_apply. -# If LIST contains an empty sublist, m4_map skips the expansion of -# MACRO, while m4_mapall expands MACRO with no arguments. -# -# Since LIST may be quite large, we want to minimize how often it -# appears in the expansion. Rather than use m4_car/m4_cdr iteration, -# we unbox the list, and use _m4_foreach for iteration. For m4_map, -# an empty list behaves like an empty sublist and gets ignored; for -# m4_mapall, we must special-case the empty list. -m4_define([m4_map], -[_m4_foreach([_m4_apply([$1],], [)], [], $2)]) - -m4_define([m4_mapall], -[m4_if([$2], [], [], - [_m4_foreach([m4_apply([$1],], [)], [], $2)])]) - - -# m4_map_sep(MACRO, [SEPARATOR], LIST) -# m4_mapall_sep(MACRO, [SEPARATOR], LIST) -# --------------------------------------- -# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1, -# $2... $N are the elements of LIST, and are in turn lists appropriate -# for m4_apply. SEPARATOR is expanded, in order to allow the creation -# of a list of arguments by using a single-quoted comma as the -# separator. For each empty sublist, m4_map_sep skips the expansion -# of MACRO and SEPARATOR, while m4_mapall_sep expands MACRO with no -# arguments. -# -# For m4_mapall_sep, merely expand the first iteration without the -# separator, then include separator as part of subsequent recursion; -# but avoid extra expansion of LIST's side-effects via a helper macro. -# For m4_map_sep, things are trickier - we don't know if the first -# list element is an empty sublist, so we must define a self-modifying -# helper macro and use that as the separator instead. -m4_define([m4_map_sep], -[m4_pushdef([m4_Sep], [m4_define([m4_Sep], _m4_defn([m4_unquote]))])]dnl -[_m4_foreach([_m4_apply([m4_Sep([$2])[]$1],], [)], [], $3)m4_popdef([m4_Sep])]) - -m4_define([m4_mapall_sep], -[m4_if([$3], [], [], [_$0([$1], [$2], $3)])]) - -m4_define([_m4_mapall_sep], -[m4_apply([$1], [$3])_m4_foreach([m4_apply([$2[]$1],], [)], m4_shift2($@))]) - -# m4_map_args(EXPRESSION, ARG...) -# ------------------------------- -# Expand EXPRESSION([ARG]) for each argument. More efficient than -# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))]) -# Shorthand for m4_map_args_sep([EXPRESSION(], [)], [], ARG...). -m4_define([m4_map_args], -[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], - [$#], [1], [], - [$#], [2], [$1([$2])[]], - [_m4_foreach([$1(], [)], $@)])]) - - -# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...) -# ------------------------------------------------------------- -# Perform a pairwise grouping of consecutive ARGs, by expanding -# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the -# final argument is expanded with END-EXPR([ARGn]). -# -# For example: -# m4_define([show], [($*)m4_newline])dnl -# m4_map_args_pair([show], [], [a], [b], [c], [d], [e])dnl -# => (a,b) -# => (c,d) -# => (e) -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_map_args_pair], -[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], - [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])], - [$#], [2], [], - [$#], [3], [m4_default([$2], [$1])([$3])[]], - [$#], [4], [$1([$3], [$4])[]], - [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])]) - - -# m4_map_args_sep([PRE], [POST], [SEP], ARG...) -# --------------------------------------------- -# Expand PRE[ARG]POST for each argument, with SEP between arguments. -m4_define([m4_map_args_sep], -[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], - [$#], [1], [], - [$#], [2], [], - [$#], [3], [], - [$#], [4], [$1[$4]$2[]], - [$1[$4]$2[]_m4_foreach([$3[]$1], [$2], m4_shift3($@))])]) - - -# m4_map_args_w(STRING, [PRE], [POST], [SEP]) -# ------------------------------------------- -# Perform the expansion of PRE[word]POST[] for each word in STRING -# separated by whitespace. More efficient than: -# m4_foreach_w([var], [STRING], [PRE[]m4_defn([var])POST]) -# Additionally, expand SEP between words. -# -# As long as we have to use m4_bpatsubst to split the string, we might -# as well make it also apply PRE and POST; this avoids iteration -# altogether. But we must be careful of any \ in PRE or POST. -# _m4_strip returns a quoted string, but that's okay, since it also -# supplies an empty leading and trailing argument due to our -# intentional whitespace around STRING. We use m4_substr to strip the -# empty elements and remove the extra layer of quoting. -m4_define([m4_map_args_w], -[_$0(_m4_split([ ]m4_flatten([$1])[ ], [[ ]+], - m4_if(m4_index([$2$3$4], [\]), [-1], [[$3[]$4[]$2]], - [m4_bpatsubst([[$3[]$4[]$2]], [\\], [\\\\])])), - m4_len([[]$3[]$4]), m4_len([$4[]$2[]]))]) - -m4_define([_m4_map_args_w], -[m4_substr([$1], [$2], m4_eval(m4_len([$1]) - [$2] - [$3]))]) - - -# m4_stack_foreach(MACRO, FUNC) -# m4_stack_foreach_lifo(MACRO, FUNC) -# ---------------------------------- -# Pass each stacked definition of MACRO to the one-argument macro FUNC. -# m4_stack_foreach proceeds in FIFO order, while m4_stack_foreach_lifo -# processes the topmost definitions first. In addition, FUNC should -# not push or pop definitions of MACRO, and should not expect anything about -# the active definition of MACRO (it will not be the topmost, and may not -# be the one passed to FUNC either). -# -# Some macros simply can't be examined with this method: namely, -# anything involved in the implementation of _m4_stack_reverse. -m4_define([m4_stack_foreach], -[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl -[_m4_stack_reverse([m4_tmp-$1], [$1], [$2(_m4_defn([m4_tmp-$1]))])]) - -m4_define([m4_stack_foreach_lifo], -[_m4_stack_reverse([$1], [m4_tmp-$1], [$2(_m4_defn([m4_tmp-$1]))])]dnl -[_m4_stack_reverse([m4_tmp-$1], [$1])]) - -# m4_stack_foreach_sep(MACRO, [PRE], [POST], [SEP]) -# m4_stack_foreach_sep_lifo(MACRO, [PRE], [POST], [SEP]) -# ------------------------------------------------------ -# Similar to m4_stack_foreach and m4_stack_foreach_lifo, in that every -# definition of a pushdef stack will be visited. But rather than -# passing the definition as a single argument to a macro, this variant -# expands the concatenation of PRE[]definition[]POST, and expands SEP -# between consecutive expansions. Note that m4_stack_foreach([a], [b]) -# is equivalent to m4_stack_foreach_sep([a], [b(], [)]). -m4_define([m4_stack_foreach_sep], -[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl -[_m4_stack_reverse([m4_tmp-$1], [$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]) - -m4_define([m4_stack_foreach_sep_lifo], -[_m4_stack_reverse([$1], [m4_tmp-$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]dnl -[_m4_stack_reverse([m4_tmp-$1], [$1])]) - - -# _m4_stack_reverse(OLD, NEW, [ACTION], [SEP]) -# -------------------------------------------- -# A recursive worker for pushdef stack manipulation. Destructively -# copy the OLD stack into the NEW, and expanding ACTION for each -# iteration. After the first iteration, SEP is promoted to the front -# of ACTION (note that SEP should include a trailing [] if it is to -# avoid interfering with ACTION). The current definition is examined -# after the NEW has been pushed but before OLD has been popped; this -# order is important, as ACTION is permitted to operate on either -# _m4_defn([OLD]) or _m4_defn([NEW]). Since the operation is -# destructive, this macro is generally used twice, with a temporary -# macro name holding the swapped copy. -m4_define([_m4_stack_reverse], -[m4_ifdef([$1], [m4_pushdef([$2], - _m4_defn([$1]))$3[]_m4_popdef([$1])$0([$1], [$2], [$4$3])])]) - - - -## --------------------------- ## -## 9. More diversion support. ## -## --------------------------- ## - - -# m4_cleardivert(DIVERSION-NAME...) -# --------------------------------- -# Discard any text in DIVERSION-NAME. -# -# This works even inside m4_expand. -m4_define([m4_cleardivert], -[m4_if([$#], [0], [m4_fatal([$0: missing argument])], - [_m4_divert_raw([-1])m4_undivert($@)_m4_divert_raw( - _m4_divert(_m4_defn([_m4_divert_diversion]), [-]))])]) - - -# _m4_divert(DIVERSION-NAME or NUMBER, [NOWARN]) -# ---------------------------------------------- -# If DIVERSION-NAME is the name of a diversion, return its number, -# otherwise if it is a NUMBER return it. Issue a warning about -# the use of a number instead of a name, unless NOWARN is provided. -m4_define([_m4_divert], -[m4_ifdef([_m4_divert($1)], - [m4_indir([_m4_divert($1)])], - [m4_if([$2], [], [m4_warn([syntax], - [prefer named diversions])])$1])]) - -# KILL is only used to suppress output. -m4_define([_m4_divert(KILL)], -1) - -# The empty diversion name is a synonym for 0. -m4_define([_m4_divert()], 0) - - -# m4_divert_stack -# --------------- -# Print the diversion stack, if it's nonempty. The caller is -# responsible for any leading or trailing newline. -m4_define([m4_divert_stack], -[m4_stack_foreach_sep_lifo([_m4_divert_stack], [], [], [ -])]) - - -# m4_divert_stack_push(MACRO-NAME, DIVERSION-NAME) -# ------------------------------------------------ -# Form an entry of the diversion stack from caller MACRO-NAME and -# entering DIVERSION-NAME and push it. -m4_define([m4_divert_stack_push], -[m4_pushdef([_m4_divert_stack], m4_location[: $1: $2])]) - - -# m4_divert(DIVERSION-NAME) -# ------------------------- -# Change the diversion stream to DIVERSION-NAME. -m4_define([m4_divert], -[m4_popdef([_m4_divert_stack])]dnl -[m4_define([_m4_divert_diversion], [$1])]dnl -[m4_divert_stack_push([$0], [$1])]dnl -[_m4_divert_raw(_m4_divert([$1]))]) - - -# m4_divert_push(DIVERSION-NAME, [NOWARN]) -# ---------------------------------------- -# Change the diversion stream to DIVERSION-NAME, while stacking old values. -# For internal use only: if NOWARN is not empty, DIVERSION-NAME can be a -# number instead of a name. -m4_define([m4_divert_push], -[m4_divert_stack_push([$0], [$1])]dnl -[m4_pushdef([_m4_divert_diversion], [$1])]dnl -[_m4_divert_raw(_m4_divert([$1], [$2]))]) - - -# m4_divert_pop([DIVERSION-NAME]) -# ------------------------------- -# Change the diversion stream to its previous value, unstacking it. -# If specified, verify we left DIVERSION-NAME. -# When we pop the last value from the stack, we divert to -1. -m4_define([m4_divert_pop], -[m4_if([$1], [], [], - [$1], _m4_defn([_m4_divert_diversion]), [], - [m4_fatal([$0($1): diversion mismatch: -]m4_divert_stack)])]dnl -[_m4_popdef([_m4_divert_stack], [_m4_divert_diversion])]dnl -[m4_ifdef([_m4_divert_diversion], [], - [m4_fatal([too many m4_divert_pop])])]dnl -[_m4_divert_raw(_m4_divert(_m4_defn([_m4_divert_diversion]), [-]))]) - - -# m4_divert_text(DIVERSION-NAME, CONTENT) -# --------------------------------------- -# Output CONTENT into DIVERSION-NAME (which may be a number actually). -# An end of line is appended for free to CONTENT. -m4_define([m4_divert_text], -[m4_divert_push([$1])$2 -m4_divert_pop([$1])]) - - -# m4_divert_once(DIVERSION-NAME, CONTENT) -# --------------------------------------- -# Output CONTENT into DIVERSION-NAME once, if not already there. -# An end of line is appended for free to CONTENT. -m4_define([m4_divert_once], -[m4_expand_once([m4_divert_text([$1], [$2])])]) - - -# _m4_divert_unsafe(DIVERSION-NAME) -# --------------------------------- -# Issue a warning that the attempt to change the current diversion to -# DIVERSION-NAME is unsafe, because this macro is being expanded -# during argument collection of m4_expand. -m4_define([_m4_divert_unsafe], -[m4_fatal([$0: cannot change diversion to `$1' inside m4_expand])]) - - -# m4_undivert(DIVERSION-NAME...) -# ------------------------------ -# Undivert DIVERSION-NAME. Unlike the M4 version, this requires at -# least one DIVERSION-NAME; also, due to support for named diversions, -# this should not be used to undivert files. -m4_define([m4_undivert], -[m4_if([$#], [0], [m4_fatal([$0: missing argument])], - [$#], [1], [_m4_undivert(_m4_divert([$1]))], - [m4_map_args([$0], $@)])]) - - -## --------------------------------------------- ## -## 10. Defining macros with bells and whistles. ## -## --------------------------------------------- ## - -# `m4_defun' is basically `m4_define' but it equips the macro with the -# needed machinery for `m4_require'. A macro must be m4_defun'd if -# either it is m4_require'd, or it m4_require's. -# -# Two things deserve attention and are detailed below: -# 1. Implementation of m4_require -# 2. Keeping track of the expansion stack -# -# 1. Implementation of m4_require -# =============================== -# -# Of course m4_defun calls m4_provide, so that a macro which has -# been expanded is not expanded again when m4_require'd, but the -# difficult part is the proper expansion of macros when they are -# m4_require'd. -# -# The implementation is based on three ideas, (i) using diversions to -# prepare the expansion of the macro and its dependencies (by Franc,ois -# Pinard), (ii) expand the most recently m4_require'd macros _after_ -# the previous macros (by Axel Thimm), and (iii) track instances of -# provide before require (by Eric Blake). -# -# -# The first idea: why use diversions? -# ----------------------------------- -# -# When a macro requires another, the other macro is expanded in new -# diversion, GROW. When the outer macro is fully expanded, we first -# undivert the most nested diversions (GROW - 1...), and finally -# undivert GROW. To understand why we need several diversions, -# consider the following example: -# -# | m4_defun([TEST1], [Test...m4_require([TEST2])1]) -# | m4_defun([TEST2], [Test...m4_require([TEST3])2]) -# | m4_defun([TEST3], [Test...3]) -# -# Because m4_require is not required to be first in the outer macros, we -# must keep the expansions of the various levels of m4_require separated. -# Right before executing the epilogue of TEST1, we have: -# -# GROW - 2: Test...3 -# GROW - 1: Test...2 -# GROW: Test...1 -# BODY: -# -# Finally the epilogue of TEST1 undiverts GROW - 2, GROW - 1, and -# GROW into the regular flow, BODY. -# -# GROW - 2: -# GROW - 1: -# GROW: -# BODY: Test...3; Test...2; Test...1 -# -# (The semicolons are here for clarification, but of course are not -# emitted.) This is what Autoconf 2.0 (I think) to 2.13 (I'm sure) -# implement. -# -# -# The second idea: first required first out -# ----------------------------------------- -# -# The natural implementation of the idea above is buggy and produces -# very surprising results in some situations. Let's consider the -# following example to explain the bug: -# -# | m4_defun([TEST1], [m4_require([TEST2a])m4_require([TEST2b])]) -# | m4_defun([TEST2a], []) -# | m4_defun([TEST2b], [m4_require([TEST3])]) -# | m4_defun([TEST3], [m4_require([TEST2a])]) -# | -# | AC_INIT -# | TEST1 -# -# The dependencies between the macros are: -# -# 3 --- 2b -# / \ is m4_require'd by -# / \ left -------------------- right -# 2a ------------ 1 -# -# If you strictly apply the rules given in the previous section you get: -# -# GROW - 2: TEST3 -# GROW - 1: TEST2a; TEST2b -# GROW: TEST1 -# BODY: -# -# (TEST2a, although required by TEST3 is not expanded in GROW - 3 -# because is has already been expanded before in GROW - 1, so it has -# been AC_PROVIDE'd, so it is not expanded again) so when you undivert -# the stack of diversions, you get: -# -# GROW - 2: -# GROW - 1: -# GROW: -# BODY: TEST3; TEST2a; TEST2b; TEST1 -# -# i.e., TEST2a is expanded after TEST3 although the latter required the -# former. -# -# Starting from 2.50, we use an implementation provided by Axel Thimm. -# The idea is simple: the order in which macros are emitted must be the -# same as the one in which macros are expanded. (The bug above can -# indeed be described as: a macro has been m4_provide'd before its -# dependent, but it is emitted after: the lack of correlation between -# emission and expansion order is guilty). -# -# How to do that? You keep the stack of diversions to elaborate the -# macros, but each time a macro is fully expanded, emit it immediately. -# -# In the example above, when TEST2a is expanded, but it's epilogue is -# not run yet, you have: -# -# GROW - 2: -# GROW - 1: TEST2a -# GROW: Elaboration of TEST1 -# BODY: -# -# The epilogue of TEST2a emits it immediately: -# -# GROW - 2: -# GROW - 1: -# GROW: Elaboration of TEST1 -# BODY: TEST2a -# -# TEST2b then requires TEST3, so right before the epilogue of TEST3, you -# have: -# -# GROW - 2: TEST3 -# GROW - 1: Elaboration of TEST2b -# GROW: Elaboration of TEST1 -# BODY: TEST2a -# -# The epilogue of TEST3 emits it: -# -# GROW - 2: -# GROW - 1: Elaboration of TEST2b -# GROW: Elaboration of TEST1 -# BODY: TEST2a; TEST3 -# -# TEST2b is now completely expanded, and emitted: -# -# GROW - 2: -# GROW - 1: -# GROW: Elaboration of TEST1 -# BODY: TEST2a; TEST3; TEST2b -# -# and finally, TEST1 is finished and emitted: -# -# GROW - 2: -# GROW - 1: -# GROW: -# BODY: TEST2a; TEST3; TEST2b: TEST1 -# -# The idea is simple, but the implementation is a bit involved. If -# you are like me, you will want to see the actual functioning of this -# implementation to be convinced. The next section gives the full -# details. -# -# -# The Axel Thimm implementation at work -# ------------------------------------- -# -# We consider the macros above, and this configure.ac: -# -# AC_INIT -# TEST1 -# -# You should keep the definitions of _m4_defun_pro, _m4_defun_epi, and -# m4_require at hand to follow the steps. -# -# This implementation tries not to assume that the current diversion is -# BODY, so as soon as a macro (m4_defun'd) is expanded, we first -# record the current diversion under the name _m4_divert_dump (denoted -# DUMP below for short). This introduces an important difference with -# the previous versions of Autoconf: you cannot use m4_require if you -# are not inside an m4_defun'd macro, and especially, you cannot -# m4_require directly from the top level. -# -# We have not tried to simulate the old behavior (better yet, we -# diagnose it), because it is too dangerous: a macro m4_require'd from -# the top level is expanded before the body of `configure', i.e., before -# any other test was run. I let you imagine the result of requiring -# AC_STDC_HEADERS for instance, before AC_PROG_CC was actually run.... -# -# After AC_INIT was run, the current diversion is BODY. -# * AC_INIT was run -# DUMP: undefined -# diversion stack: BODY |- -# -# * TEST1 is expanded -# The prologue of TEST1 sets _m4_divert_dump, which is the diversion -# where the current elaboration will be dumped, to the current -# diversion. It also m4_divert_push to GROW, where the full -# expansion of TEST1 and its dependencies will be elaborated. -# DUMP: BODY -# BODY: empty -# diversions: GROW, BODY |- -# -# * TEST1 requires TEST2a -# _m4_require_call m4_divert_pushes another temporary diversion, -# GROW - 1, and expands TEST2a in there. -# DUMP: BODY -# BODY: empty -# GROW - 1: TEST2a -# diversions: GROW - 1, GROW, BODY |- -# Then the content of the temporary diversion is moved to DUMP and the -# temporary diversion is popped. -# DUMP: BODY -# BODY: TEST2a -# diversions: GROW, BODY |- -# -# * TEST1 requires TEST2b -# Again, _m4_require_call pushes GROW - 1 and heads to expand TEST2b. -# DUMP: BODY -# BODY: TEST2a -# diversions: GROW - 1, GROW, BODY |- -# -# * TEST2b requires TEST3 -# _m4_require_call pushes GROW - 2 and expands TEST3 here. -# (TEST3 requires TEST2a, but TEST2a has already been m4_provide'd, so -# nothing happens.) -# DUMP: BODY -# BODY: TEST2a -# GROW - 2: TEST3 -# diversions: GROW - 2, GROW - 1, GROW, BODY |- -# Then the diversion is appended to DUMP, and popped. -# DUMP: BODY -# BODY: TEST2a; TEST3 -# diversions: GROW - 1, GROW, BODY |- -# -# * TEST1 requires TEST2b (contd.) -# The content of TEST2b is expanded... -# DUMP: BODY -# BODY: TEST2a; TEST3 -# GROW - 1: TEST2b, -# diversions: GROW - 1, GROW, BODY |- -# ... and moved to DUMP. -# DUMP: BODY -# BODY: TEST2a; TEST3; TEST2b -# diversions: GROW, BODY |- -# -# * TEST1 is expanded: epilogue -# TEST1's own content is in GROW... -# DUMP: BODY -# BODY: TEST2a; TEST3; TEST2b -# GROW: TEST1 -# diversions: BODY |- -# ... and it's epilogue moves it to DUMP and then undefines DUMP. -# DUMP: undefined -# BODY: TEST2a; TEST3; TEST2b; TEST1 -# diversions: BODY |- -# -# -# The third idea: track macros provided before they were required -# --------------------------------------------------------------- -# -# Using just the first two ideas, Autoconf 2.50 through 2.63 still had -# a subtle bug for more than seven years. Let's consider the -# following example to explain the bug: -# -# | m4_defun([TEST1], [1]) -# | m4_defun([TEST2], [2[]m4_require([TEST1])]) -# | m4_defun([TEST3], [3 TEST1 m4_require([TEST2])]) -# | TEST3 -# -# After the prologue of TEST3, we are collecting text in GROW with the -# intent of dumping it in BODY during the epilogue. Next, we -# encounter the direct invocation of TEST1, which provides the macro -# in place in GROW. From there, we encounter a requirement for TEST2, -# which must be collected in a new diversion. While expanding TEST2, -# we encounter a requirement for TEST1, but since it has already been -# expanded, the Axel Thimm algorithm states that we can treat it as a -# no-op. But that would lead to an end result of `2 3 1', meaning -# that we have once again output a macro (TEST2) prior to its -# requirements (TEST1). -# -# The problem can only occur if a single defun'd macro first provides, -# then later indirectly requires, the same macro. Note that directly -# expanding then requiring a macro is okay: because the dependency was -# met, the require phase can be a no-op. For that matter, the outer -# macro can even require two helpers, where the first helper expands -# the macro, and the second helper indirectly requires the macro. -# Out-of-order expansion is only present if the inner macro is -# required by something that will be hoisted in front of where the -# direct expansion occurred. In other words, we must be careful not -# to warn on: -# -# | m4_defun([TEST4], [4]) -# | m4_defun([TEST5], [5 TEST4 m4_require([TEST4])]) -# | TEST5 => 5 4 -# -# or even the more complex: -# -# | m4_defun([TEST6], [6]) -# | m4_defun([TEST7], [7 TEST6]) -# | m4_defun([TEST8], [8 m4_require([TEST6])]) -# | m4_defun([TEST9], [9 m4_require([TEST8])]) -# | m4_defun([TEST10], [10 m4_require([TEST7]) m4_require([TEST9])]) -# | TEST10 => 7 6 8 9 10 -# -# So, to detect whether a require was direct or indirect, m4_defun and -# m4_require track the name of the macro that caused a diversion to be -# created (using the stack _m4_diverting, coupled with an O(1) lookup -# _m4_diverting([NAME])), and m4_provide stores the name associated -# with the diversion at which a macro was provided. A require call is -# direct if it occurs within the same diversion where the macro was -# provided, or if the diversion associated with the providing context -# has been collected. -# -# The implementation of the warning involves tracking the set of -# macros which have been provided since the start of the outermost -# defun'd macro (the set is named _m4_provide). When starting an -# outermost macro, the set is emptied; when a macro is provided, it is -# added to the set; when require expands the body of a macro, it is -# removed from the set; and when a macro is indirectly required, the -# set is checked. If a macro is in the set, then it has been provided -# before it was required, and we satisfy dependencies by expanding the -# macro as if it had never been provided; in the example given above, -# this means we now output `1 2 3 1'. Meanwhile, a warning is issued -# to inform the user that her macros trigger the bug in older autoconf -# versions, and that her output file now contains redundant contents -# (and possibly new problems, if the repeated macro was not -# idempotent). Meanwhile, macros defined by m4_defun_once instead of -# m4_defun are idempotent, avoiding any warning or duplicate output. -# -# -# 2. Keeping track of the expansion stack -# ======================================= -# -# When M4 expansion goes wrong it is often extremely hard to find the -# path amongst macros that drove to the failure. What is needed is -# the stack of macro `calls'. One could imagine that GNU M4 would -# maintain a stack of macro expansions, unfortunately it doesn't, so -# we do it by hand. This is of course extremely costly, but the help -# this stack provides is worth it. Nevertheless to limit the -# performance penalty this is implemented only for m4_defun'd macros, -# not for define'd macros. -# -# Each time we enter an m4_defun'd macros, we add a definition in -# _m4_expansion_stack, and when we exit the macro, we remove it (thanks -# to pushdef/popdef). m4_stack_foreach is used to print the expansion -# stack in the rare cases when it's needed. -# -# In addition, we want to detect circular m4_require dependencies. -# Each time we expand a macro FOO we define _m4_expanding(FOO); and -# m4_require(BAR) simply checks whether _m4_expanding(BAR) is defined. - - -# m4_expansion_stack -# ------------------ -# Expands to the entire contents of the expansion stack. The caller -# must supply a trailing newline. This macro always prints a -# location; check whether _m4_expansion_stack is defined to filter out -# the case when no defun'd macro is in force. -m4_define([m4_expansion_stack], -[m4_stack_foreach_sep_lifo([_$0], [_$0_entry(], [) -])m4_location[: the top level]]) - -# _m4_expansion_stack_entry(MACRO) -# -------------------------------- -# Format an entry for MACRO found on the expansion stack. -m4_define([_m4_expansion_stack_entry], -[_m4_defn([m4_location($1)])[: $1 is expanded from...]]) - -# m4_expansion_stack_push(MACRO) -# ------------------------------ -# Form an entry of the expansion stack on entry to MACRO and push it. -m4_define([m4_expansion_stack_push], -[m4_pushdef([_m4_expansion_stack], [$1])]) - - -# _m4_divert(GROW) -# ---------------- -# This diversion is used by the m4_defun/m4_require machinery. It is -# important to keep room before GROW because for each nested -# AC_REQUIRE we use an additional diversion (i.e., two m4_require's -# will use GROW - 2. More than 3 levels has never seemed to be -# needed.) -# -# ... -# - GROW - 2 -# m4_require'd code, 2 level deep -# - GROW - 1 -# m4_require'd code, 1 level deep -# - GROW -# m4_defun'd macros are elaborated here. - -m4_define([_m4_divert(GROW)], 10000) - - -# _m4_defun_pro(MACRO-NAME) -# ------------------------- -# The prologue for Autoconf macros. -# -# This is called frequently, so minimize the number of macro invocations -# by avoiding dnl and m4_defn overhead. -m4_define([_m4_defun_pro], -[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_pro_outer([$1])])]dnl -[m4_expansion_stack_push([$1])m4_pushdef([_m4_expanding($1)])]) - -m4_define([_m4_defun_pro_outer], -[m4_set_delete([_m4_provide])]dnl -[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl -[m4_pushdef([_m4_divert_dump], m4_divnum)m4_divert_push([GROW])]) - -# _m4_defun_epi(MACRO-NAME) -# ------------------------- -# The Epilogue for Autoconf macros. MACRO-NAME only helps tracing -# the PRO/EPI pairs. -# -# This is called frequently, so minimize the number of macro invocations -# by avoiding dnl and m4_popdef overhead. -m4_define([_m4_defun_epi], -[_m4_popdef([_m4_expanding($1)], [_m4_expansion_stack])]dnl -[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_epi_outer([$1])])]dnl -[m4_provide([$1])]) - -m4_define([_m4_defun_epi_outer], -[_m4_popdef([_m4_divert_dump], [_m4_diverting([$1])], [_m4_diverting])]dnl -[m4_divert_pop([GROW])m4_undivert([GROW])]) - - -# _m4_divert_dump -# --------------- -# If blank, we are outside of any defun'd macro. Otherwise, expands -# to the diversion number (not name) where require'd macros should be -# moved once completed. -m4_define([_m4_divert_dump]) - - -# m4_divert_require(DIVERSION, NAME-TO-CHECK, [BODY-TO-EXPAND]) -# ------------------------------------------------------------- -# Same as m4_require, but BODY-TO-EXPAND goes into the named DIVERSION; -# requirements still go in the current diversion though. -# -m4_define([m4_divert_require], -[m4_ifdef([_m4_expanding($2)], - [m4_fatal([$0: circular dependency of $2])])]dnl -[m4_if(_m4_divert_dump, [], - [m4_fatal([$0($2): cannot be used outside of an m4_defun'd macro])])]dnl -[m4_provide_if([$2], [], - [_m4_require_call([$2], [$3], _m4_divert([$1], [-]))])]) - - -# m4_defun(NAME, EXPANSION, [MACRO = m4_define]) -# ---------------------------------------------- -# Define a macro NAME which automatically provides itself. Add -# machinery so the macro automatically switches expansion to the -# diversion stack if it is not already using it, prior to EXPANSION. -# In this case, once finished, it will bring back all the code -# accumulated in the diversion stack. This, combined with m4_require, -# achieves the topological ordering of macros. We don't use this -# macro to define some frequently called macros that are not involved -# in ordering constraints, to save m4 processing. -# -# MACRO is an undocumented argument; when set to m4_pushdef, and NAME -# is already defined, the new definition is added to the pushdef -# stack, rather than overwriting the current definition. It can thus -# be used to write self-modifying macros, which pop themselves to a -# previously m4_define'd definition so that subsequent use of the -# macro is faster. -m4_define([m4_defun], -[m4_define([m4_location($1)], m4_location)]dnl -[m4_default([$3], [m4_define])([$1], - [_m4_defun_pro(]m4_dquote($[0])[)$2[]_m4_defun_epi(]m4_dquote($[0])[)])]) - - -# m4_defun_init(NAME, INIT, COMMON) -# --------------------------------- -# Like m4_defun, but split EXPANSION into two portions: INIT which is -# done only the first time NAME is invoked, and COMMON which is -# expanded every time. -# -# For now, the COMMON definition is always m4_define'd, giving an even -# lighter-weight definition. m4_defun allows self-providing, but once -# a macro is provided, m4_require no longer cares if it is m4_define'd -# or m4_defun'd. m4_defun also provides location tracking to identify -# dependency bugs, but once the INIT has been expanded, we know there -# are no dependency bugs. However, if a future use needs COMMON to be -# m4_defun'd, we can add a parameter, similar to the third parameter -# to m4_defun. -m4_define([m4_defun_init], -[m4_define([$1], [$3[]])m4_defun([$1], - [$2[]_m4_popdef(]m4_dquote($[0])[)m4_indir(]m4_dquote($[0])dnl -[m4_if(]m4_dquote($[#])[, [0], [], ]m4_dquote([,$]@)[))], [m4_pushdef])]) - - -# m4_defun_once(NAME, EXPANSION) -# ------------------------------ -# Like m4_defun, but guarantee that EXPANSION only happens once -# (thereafter, using NAME is a no-op). -# -# If _m4_divert_dump is empty, we are called at the top level; -# otherwise, we must ensure that we are required in front of the -# current defun'd macro. Use a helper macro so that EXPANSION need -# only occur once in the definition of NAME, since it might be large. -m4_define([m4_defun_once], -[m4_define([m4_location($1)], m4_location)]dnl -[m4_define([$1], [_m4_defun_once([$1], [$2], m4_if(_m4_divert_dump, [], - [[_m4_defun_pro([$1])m4_unquote(], [)_m4_defun_epi([$1])]], -m4_ifdef([_m4_diverting([$1])], [-]), [-], [[m4_unquote(], [)]], - [[_m4_require_call([$1],], [, _m4_divert_dump)]]))])]) - -m4_define([_m4_defun_once], -[m4_pushdef([$1])$3[$2[]m4_provide([$1])]$4]) - - -# m4_pattern_forbid(ERE, [WHY]) -# ----------------------------- -# Declare that no token matching the forbidden extended regular -# expression ERE should be seen in the output unless... -m4_define([m4_pattern_forbid], []) - - -# m4_pattern_allow(ERE) -# --------------------- -# ... that token also matches the allowed extended regular expression ERE. -# Both used via traces. -m4_define([m4_pattern_allow], []) - - -## --------------------------------- ## -## 11. Dependencies between macros. ## -## --------------------------------- ## - - -# m4_before(THIS-MACRO-NAME, CALLED-MACRO-NAME) -# --------------------------------------------- -# Issue a warning if CALLED-MACRO-NAME was called before THIS-MACRO-NAME. -m4_define([m4_before], -[m4_provide_if([$2], - [m4_warn([syntax], [$2 was called before $1])])]) - - -# m4_require(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK]) -# ----------------------------------------------------------- -# If NAME-TO-CHECK has never been expanded (actually, if it is not -# m4_provide'd), expand BODY-TO-EXPAND *before* the current macro -# expansion; follow the expansion with a newline. Once expanded, emit -# it in _m4_divert_dump. Keep track of the m4_require chain in -# _m4_expansion_stack. -# -# The normal cases are: -# -# - NAME-TO-CHECK == BODY-TO-EXPAND -# Which you can use for regular macros with or without arguments, e.g., -# m4_require([AC_PROG_CC], [AC_PROG_CC]) -# m4_require([AC_CHECK_HEADERS(threads.h)], [AC_CHECK_HEADERS(threads.h)]) -# which is just the same as -# m4_require([AC_PROG_CC]) -# m4_require([AC_CHECK_HEADERS(threads.h)]) -# -# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK]) -# In the case of macros with irregular names. For instance: -# m4_require([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])]) -# which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are -# part of the name, it is not an argument) has not been run, then -# call it.' -# Had you used -# m4_require([AC_LANG_COMPILER(C)], [AC_LANG_COMPILER(C)]) -# then m4_require would have tried to expand `AC_LANG_COMPILER(C)', i.e., -# call the macro `AC_LANG_COMPILER' with `C' as argument. -# -# You could argue that `AC_LANG_COMPILER', when it receives an argument -# such as `C' should dispatch the call to `AC_LANG_COMPILER(C)'. But this -# `extension' prevents `AC_LANG_COMPILER' from having actual arguments that -# it passes to `AC_LANG_COMPILER(C)'. -# -# This is called frequently, so minimize the number of macro invocations -# by avoiding dnl and other overhead on the common path. -m4_define([m4_require], -[m4_ifdef([_m4_expanding($1)], - [m4_fatal([$0: circular dependency of $1])])]dnl -[m4_if(_m4_divert_dump, [], - [m4_fatal([$0($1): cannot be used outside of an ]dnl -m4_if([$0], [m4_require], [[m4_defun]], [[AC_DEFUN]])['d macro])])]dnl -[m4_provide_if([$1], [m4_set_contains([_m4_provide], [$1], - [_m4_require_check([$1], _m4_defn([m4_provide($1)]), [$0])], [m4_ignore])], - [_m4_require_call])([$1], [$2], _m4_divert_dump)]) - - -# _m4_require_call(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK], -# DIVERSION-NUMBER) -# ----------------------------------------------------------------- -# If m4_require decides to expand the body, it calls this macro. The -# expansion is placed in DIVERSION-NUMBER. -# -# This is called frequently, so minimize the number of macro invocations -# by avoiding dnl and other overhead on the common path. -m4_define([_m4_require_call], -[m4_pushdef([_m4_divert_grow], m4_decr(_m4_divert_grow))]dnl -[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl -[m4_divert_push(_m4_divert_grow, [-])]dnl -[m4_if([$2], [], [$1], [$2]) -m4_provide_if([$1], [m4_set_remove([_m4_provide], [$1])], - [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])]dnl -[_m4_divert_raw($3)_m4_undivert(_m4_divert_grow)]dnl -[m4_divert_pop(_m4_divert_grow)_m4_popdef([_m4_divert_grow], -[_m4_diverting([$1])], [_m4_diverting])]) - - -# _m4_require_check(NAME-TO-CHECK, OWNER, CALLER) -# ----------------------------------------------- -# NAME-TO-CHECK has been identified as previously expanded in the -# diversion owned by OWNER. If this is a problem, warn on behalf of -# CALLER and return _m4_require_call; otherwise return m4_ignore. -m4_define([_m4_require_check], -[m4_if(_m4_defn([_m4_diverting]), [$2], [m4_ignore], - m4_ifdef([_m4_diverting([$2])], [-]), [-], [m4_warn([syntax], - [$3: `$1' was expanded before it was required -http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required])_m4_require_call], - [m4_ignore])]) - - -# _m4_divert_grow -# --------------- -# The counter for _m4_require_call. -m4_define([_m4_divert_grow], _m4_divert([GROW])) - - -# m4_expand_once(TEXT, [WITNESS = TEXT]) -# -------------------------------------- -# If TEXT has never been expanded, expand it *here*. Use WITNESS as -# as a memory that TEXT has already been expanded. -m4_define([m4_expand_once], -[m4_provide_if(m4_default_quoted([$2], [$1]), - [], - [m4_provide(m4_default_quoted([$2], [$1]))[]$1])]) - - -# m4_provide(MACRO-NAME) -# ---------------------- -m4_define([m4_provide], -[m4_ifdef([m4_provide($1)], [], -[m4_set_add([_m4_provide], [$1], [m4_define([m4_provide($1)], - m4_ifdef([_m4_diverting], [_m4_defn([_m4_diverting])]))])])]) - - -# m4_provide_if(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ------------------------------------------------------- -# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. -# The purpose of this macro is to provide the user with a means to -# check macros which are provided without letting her know how the -# information is coded. -m4_define([m4_provide_if], -[m4_ifdef([m4_provide($1)], - [$2], [$3])]) - - -## --------------------- ## -## 12. Text processing. ## -## --------------------- ## - - -# m4_cr_letters -# m4_cr_LETTERS -# m4_cr_Letters -# ------------- -m4_define([m4_cr_letters], [abcdefghijklmnopqrstuvwxyz]) -m4_define([m4_cr_LETTERS], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]) -m4_define([m4_cr_Letters], -m4_defn([m4_cr_letters])dnl -m4_defn([m4_cr_LETTERS])dnl -) - - -# m4_cr_digits -# ------------ -m4_define([m4_cr_digits], [0123456789]) - - -# m4_cr_alnum -# ----------- -m4_define([m4_cr_alnum], -m4_defn([m4_cr_Letters])dnl -m4_defn([m4_cr_digits])dnl -) - - -# m4_cr_symbols1 -# m4_cr_symbols2 -# -------------- -m4_define([m4_cr_symbols1], -m4_defn([m4_cr_Letters])dnl -_) - -m4_define([m4_cr_symbols2], -m4_defn([m4_cr_symbols1])dnl -m4_defn([m4_cr_digits])dnl -) - -# m4_cr_all -# --------- -# The character range representing everything, with `-' as the last -# character, since it is special to m4_translit. Use with care, because -# it contains characters special to M4 (fortunately, both ASCII and EBCDIC -# have [] in order, so m4_defn([m4_cr_all]) remains a valid string). It -# also contains characters special to terminals, so it should never be -# displayed in an error message. Also, attempts to map [ and ] to other -# characters via m4_translit must deal with the fact that m4_translit does -# not add quotes to the output. -# -# In EBCDIC, $ is immediately followed by *, which leads to problems -# if m4_cr_all is inlined into a macro definition; so swap them. -# -# It is mainly useful in generating inverted character range maps, for use -# in places where m4_translit is faster than an equivalent m4_bpatsubst; -# the regex `[^a-z]' is equivalent to: -# m4_translit(m4_dquote(m4_defn([m4_cr_all])), [a-z]) -m4_define([m4_cr_all], -m4_translit(m4_dquote(m4_format(m4_dquote(m4_for( - ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [$*-], [*$])-) - - -# _m4_define_cr_not(CATEGORY) -# --------------------------- -# Define m4_cr_not_CATEGORY as the inverse of m4_cr_CATEGORY. -m4_define([_m4_define_cr_not], -[m4_define([m4_cr_not_$1], - m4_translit(m4_dquote(m4_defn([m4_cr_all])), - m4_defn([m4_cr_$1])))]) - - -# m4_cr_not_letters -# m4_cr_not_LETTERS -# m4_cr_not_Letters -# m4_cr_not_digits -# m4_cr_not_alnum -# m4_cr_not_symbols1 -# m4_cr_not_symbols2 -# ------------------ -# Inverse character sets -_m4_define_cr_not([letters]) -_m4_define_cr_not([LETTERS]) -_m4_define_cr_not([Letters]) -_m4_define_cr_not([digits]) -_m4_define_cr_not([alnum]) -_m4_define_cr_not([symbols1]) -_m4_define_cr_not([symbols2]) - - -# m4_newline([STRING]) -# -------------------- -# Expands to a newline, possibly followed by STRING. Exists mostly for -# formatting reasons. -m4_define([m4_newline], [ -$1]) - - -# m4_re_escape(STRING) -# -------------------- -# Escape RE active characters in STRING. -m4_define([m4_re_escape], -[m4_bpatsubst([$1], - [[][*+.?\^$]], [\\\&])]) - - -# m4_re_string -# ------------ -# Regexp for `[a-zA-Z_0-9]*' -# m4_dquote provides literal [] for the character class. -m4_define([m4_re_string], -m4_dquote(m4_defn([m4_cr_symbols2]))dnl -[*]dnl -) - - -# m4_re_word -# ---------- -# Regexp for `[a-zA-Z_][a-zA-Z_0-9]*' -m4_define([m4_re_word], -m4_dquote(m4_defn([m4_cr_symbols1]))dnl -m4_defn([m4_re_string])dnl -) - - -# m4_tolower(STRING) -# m4_toupper(STRING) -# ------------------ -# These macros convert STRING to lowercase or uppercase. -# -# Rather than expand the m4_defn each time, we inline them up front. -m4_define([m4_tolower], -[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[, - ]m4_dquote(m4_defn([m4_cr_letters]))[)]) -m4_define([m4_toupper], -[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_letters]))[, - ]m4_dquote(m4_defn([m4_cr_LETTERS]))[)]) - - -# m4_split(STRING, [REGEXP]) -# -------------------------- -# Split STRING into an m4 list of quoted elements. The elements are -# quoted with [ and ]. Beginning spaces and end spaces *are kept*. -# Use m4_strip to remove them. -# -# REGEXP specifies where to split. Default is [\t ]+. -# -# If STRING is empty, the result is an empty list. -# -# Pay attention to the m4_changequotes. When m4 reads the definition of -# m4_split, it still has quotes set to [ and ]. Luckily, these are matched -# in the macro body, so the definition is stored correctly. Use the same -# alternate quotes as m4_noquote; it must be unlikely to appear in $1. -# -# Also, notice that $1 is quoted twice, since we want the result to -# be quoted. Then you should understand that the argument of -# patsubst is -=<{(STRING)}>=- (i.e., with additional -=<{( and )}>=-). -# -# This macro is safe on active symbols, i.e.: -# m4_define(active, ACTIVE) -# m4_split([active active ])end -# => [active], [active], []end -# -# Optimize on regex of ` ' (space), since m4_foreach_w already guarantees -# that the list contains single space separators, and a common case is -# splitting a single-element list. This macro is called frequently, -# so avoid unnecessary dnl inside the definition. -m4_define([m4_split], -[m4_if([$1], [], [], - [$2], [ ], [m4_if(m4_index([$1], [ ]), [-1], [[[$1]]], - [_$0([$1], [$2], [, ])])], - [$2], [], [_$0([$1], [[ ]+], [, ])], - [_$0([$1], [$2], [, ])])]) - -m4_define([_m4_split], -[m4_changequote([-=<{(],[)}>=-])]dnl -[[m4_bpatsubst(-=<{(-=<{($1)}>=-)}>=-, -=<{($2)}>=-, - -=<{(]$3[)}>=-)]m4_changequote([, ])]) - - -# m4_chomp(STRING) -# m4_chomp_all(STRING) -# -------------------- -# Return STRING quoted, but without a trailing newline. m4_chomp -# removes at most one newline, while m4_chomp_all removes all -# consecutive trailing newlines. Embedded newlines are not touched, -# and a trailing backslash-newline leaves just a trailing backslash. -# -# m4_bregexp is slower than m4_index, and we don't always want to -# remove all newlines; hence the two variants. We massage characters -# to give a nicer pattern to match, particularly since m4_bregexp is -# line-oriented. Both versions must guarantee a match, to avoid bugs -# with precision -1 in m4_format in older m4. -m4_define([m4_chomp], -[m4_format([[%.*s]], m4_index(m4_translit([[$1]], [ -/.], [/ ])[./.], [/.]), [$1])]) - -m4_define([m4_chomp_all], -[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [ -/], [/ ]), [/*$]), [$1])]) - - -# m4_flatten(STRING) -# ------------------ -# If STRING contains end of lines, replace them with spaces. If there -# are backslashed end of lines, remove them. This macro is safe with -# active symbols. -# m4_define(active, ACTIVE) -# m4_flatten([active -# act\ -# ive])end -# => active activeend -# -# In m4, m4_bpatsubst is expensive, so first check for a newline. -m4_define([m4_flatten], -[m4_if(m4_index([$1], [ -]), [-1], [[$1]], - [m4_translit(m4_bpatsubst([[[$1]]], [\\ -]), [ -], [ ])])]) - - -# m4_strip(STRING) -# ---------------- -# Expands into STRING with tabs and spaces singled out into a single -# space, and removing leading and trailing spaces. -# -# This macro is robust to active symbols. -# m4_define(active, ACTIVE) -# m4_strip([ active active ])end -# => active activeend -# -# First, notice that we guarantee trailing space. Why? Because regular -# expressions are greedy, and `.* ?' would always group the space into the -# .* portion. The algorithm is simpler by avoiding `?' at the end. The -# algorithm correctly strips everything if STRING is just ` '. -# -# Then notice the second pattern: it is in charge of removing the -# leading/trailing spaces. Why not just `[^ ]'? Because they are -# applied to over-quoted strings, i.e. more or less [STRING], due -# to the limitations of m4_bpatsubsts. So the leading space in STRING -# is the *second* character; equally for the trailing space. -m4_define([m4_strip], -[m4_bpatsubsts([$1 ], - [[ ]+], [ ], - [^. ?\(.*\) .$], [[[\1]]])]) - - -# m4_normalize(STRING) -# -------------------- -# Apply m4_flatten and m4_strip to STRING. -# -# The argument is quoted, so that the macro is robust to active symbols: -# -# m4_define(active, ACTIVE) -# m4_normalize([ act\ -# ive -# active ])end -# => active activeend - -m4_define([m4_normalize], -[m4_strip(m4_flatten([$1]))]) - - - -# m4_join(SEP, ARG1, ARG2...) -# --------------------------- -# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG -# is the empty string. No expansion is performed on SEP or ARGs. -# -# Since the number of arguments to join can be arbitrarily long, we -# want to avoid having more than one $@ in the macro definition; -# otherwise, the expansion would require twice the memory of the already -# long list. Hence, m4_join merely looks for the first non-empty element, -# and outputs just that element; while _m4_join looks for all non-empty -# elements, and outputs them following a separator. The final trick to -# note is that we decide between recursing with $0 or _$0 based on the -# nested m4_if ending with `_'. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift2($@))])]) -m4_define([_m4_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift2($@))])]) - -# m4_joinall(SEP, ARG1, ARG2...) -# ------------------------------ -# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP. -# No expansion is performed on SEP or ARGs. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_joinall], [[$2]_$0([$1], m4_shift($@))]) -m4_define([_m4_joinall], -[m4_if([$#], [2], [], [[$1$3]$0([$1], m4_shift2($@))])]) - -# m4_combine([SEPARATOR], PREFIX-LIST, [INFIX], SUFFIX...) -# -------------------------------------------------------- -# Produce the pairwise combination of every element in the quoted, -# comma-separated PREFIX-LIST with every element from the SUFFIX arguments. -# Each pair is joined with INFIX, and pairs are separated by SEPARATOR. -# No expansion occurs on SEPARATOR, INFIX, or elements of either list. -# -# For example: -# m4_combine([, ], [[a], [b], [c]], [-], [1], [2], [3]) -# => a-1, a-2, a-3, b-1, b-2, b-3, c-1, c-2, c-3 -# -# This definition is a bit hairy; the thing to realize is that we want -# to construct m4_map_args_sep([[prefix$3]], [], [[$1]], m4_shift3($@)) -# as the inner loop, using each prefix generated by the outer loop, -# and without recalculating m4_shift3 every outer iteration. -m4_define([m4_combine], -[m4_if([$2], [], [], m4_eval([$# > 3]), [1], -[m4_map_args_sep([m4_map_args_sep(m4_dquote(], [)[[$3]], [], [[$1]],]]]dnl -[m4_dquote(m4_dquote(m4_shift3($@)))[[)], [[$1]], $2)])]) - - -# m4_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR`'STRING' -# at the end. It is valid to use this macro with MACRO-NAME undefined, -# in which case no SEPARATOR is added. Be aware that the criterion is -# `not being defined', and not `not being empty'. -# -# Note that neither STRING nor SEPARATOR are expanded here; rather, when -# you expand MACRO-NAME, they will be expanded at that point in time. -# -# This macro is robust to active symbols. It can be used to grow -# strings. -# -# | m4_define(active, ACTIVE)dnl -# | m4_append([sentence], [This is an])dnl -# | m4_append([sentence], [ active ])dnl -# | m4_append([sentence], [symbol.])dnl -# | sentence -# | m4_undefine([active])dnl -# | sentence -# => This is an ACTIVE symbol. -# => This is an active symbol. -# -# It can be used to define hooks. -# -# | m4_define(active, ACTIVE)dnl -# | m4_append([hooks], [m4_define([act1], [act2])])dnl -# | m4_append([hooks], [m4_define([act2], [active])])dnl -# | m4_undefine([active])dnl -# | act1 -# | hooks -# | act1 -# => act1 -# => -# => active -# -# It can also be used to create lists, although this particular usage was -# broken prior to autoconf 2.62. -# | m4_append([list], [one], [, ])dnl -# | m4_append([list], [two], [, ])dnl -# | m4_append([list], [three], [, ])dnl -# | list -# | m4_dquote(list) -# => one, two, three -# => [one],[two],[three] -# -# Note that m4_append can benefit from amortized O(n) m4 behavior, if -# the underlying m4 implementation is smart enough to avoid copying existing -# contents when enlarging a macro's definition into any pre-allocated storage -# (m4 1.4.x unfortunately does not implement this optimization). We do -# not implement m4_prepend, since it is inherently O(n^2) (pre-allocated -# storage only occurs at the end of a macro, so the existing contents must -# always be moved). -# -# Use _m4_defn for speed. -m4_define([m4_append], -[m4_define([$1], m4_ifdef([$1], [_m4_defn([$1])[$3]])[$2])]) - - -# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR], [IF-UNIQ], [IF-DUP]) -# -------------------------------------------------------------------- -# Like `m4_append', but append only if not yet present. Additionally, -# expand IF-UNIQ if STRING was appended, or IF-DUP if STRING was already -# present. Also, warn if SEPARATOR is not empty and occurs within STRING, -# as the algorithm no longer guarantees uniqueness. -# -# Note that while m4_append can be O(n) (depending on the quality of the -# underlying M4 implementation), m4_append_uniq is inherently O(n^2) -# because each append operation searches the entire string. -m4_define([m4_append_uniq], -[m4_ifval([$3], [m4_if(m4_index([$2], [$3]), [-1], [], - [m4_warn([syntax], - [$0: `$2' contains `$3'])])])_$0($@)]) -m4_define([_m4_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]_m4_defn([$1])[$3], [$3$2$3]), [-1], - [m4_append([$1], [$2], [$3])$4], [$5])], - [m4_define([$1], [$2])$4])]) - -# m4_append_uniq_w(MACRO-NAME, STRINGS) -# ------------------------------------- -# For each of the words in the whitespace separated list STRINGS, append -# only the unique strings to the definition of MACRO-NAME. -# -# Use _m4_defn for speed. -m4_define([m4_append_uniq_w], -[m4_map_args_w([$2], [_m4_append_uniq([$1],], [, [ ])])]) - - -# m4_escape(STRING) -# ----------------- -# Output quoted STRING, but with embedded #, $, [ and ] turned into -# quadrigraphs. -# -# It is faster to check if STRING is already good using m4_translit -# than to blindly perform four m4_bpatsubst. -# -# Because the translit is stripping quotes, it must also neutralize -# anything that might be in a macro name, as well as comments, commas, -# and parentheses. All the problem characters are unified so that a -# single m4_index can scan the result. -# -# Rather than expand m4_defn every time m4_escape is expanded, we -# inline its expansion up front. -m4_define([m4_escape], -[m4_if(m4_index(m4_translit([$1], - [[]#,()]]m4_dquote(m4_defn([m4_cr_symbols2]))[, [$$$]), [$]), - [-1], [m4_echo], [_$0])([$1])]) - -m4_define([_m4_escape], -[m4_changequote([-=<{(],[)}>=-])]dnl -[m4_bpatsubst(m4_bpatsubst(m4_bpatsubst(m4_bpatsubst( - -=<{(-=<{(-=<{(-=<{(-=<{($1)}>=-)}>=-)}>=-)}>=-)}>=-, - -=<{(#)}>=-, -=<{(@%:@)}>=-), - -=<{(\[)}>=-, -=<{(@<:@)}>=-), - -=<{(\])}>=-, -=<{(@:>@)}>=-), - -=<{(\$)}>=-, -=<{(@S|@)}>=-)m4_changequote([,])]) - - -# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH]) -# ------------------------------------------------------- -# Expands into STRING wrapped to hold in WIDTH columns (default = 79). -# If PREFIX is given, each line is prefixed with it. If FIRST-PREFIX is -# specified, then the first line is prefixed with it. As a special case, -# if the length of FIRST-PREFIX is greater than that of PREFIX, then -# FIRST-PREFIX will be left alone on the first line. -# -# No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX, -# although quadrigraphs are correctly recognized. More precisely, -# you may redefine m4_qlen to recognize whatever escape sequences that -# you will post-process. -# -# Typical outputs are: -# -# m4_text_wrap([Short string */], [ ], [/* ], 20) -# => /* Short string */ -# -# m4_text_wrap([Much longer string */], [ ], [/* ], 20) -# => /* Much longer -# => string */ -# -# m4_text_wrap([Short doc.], [ ], [ --short ], 30) -# => --short Short doc. -# -# m4_text_wrap([Short doc.], [ ], [ --too-wide ], 30) -# => --too-wide -# => Short doc. -# -# m4_text_wrap([Super long documentation.], [ ], [ --too-wide ], 30) -# => --too-wide -# => Super long -# => documentation. -# -# FIXME: there is no checking of a longer PREFIX than WIDTH, but do -# we really want to bother with people trying each single corner -# of a software? -# -# This macro does not leave a trailing space behind the last word of a line, -# which complicates it a bit. The algorithm is otherwise stupid and simple: -# all the words are preceded by m4_Separator which is defined to empty for -# the first word, and then ` ' (single space) for all the others. -# -# The algorithm uses a helper that uses $2 through $4 directly, rather than -# using local variables, to avoid m4_defn overhead, or expansion swallowing -# any $. It also bypasses m4_popdef overhead with _m4_popdef since no user -# macro expansion occurs in the meantime. Also, the definition is written -# with m4_do, to avoid time wasted on dnl during expansion (since this is -# already a time-consuming macro). -m4_define([m4_text_wrap], -[_$0(m4_escape([$1]), [$2], m4_default_quoted([$3], [$2]), - m4_default_quoted([$4], [79]))]) - -m4_define([_m4_text_wrap], -m4_do(dnl set up local variables, to avoid repeated calculations -[[m4_pushdef([m4_Indent], m4_qlen([$2]))]], -[[m4_pushdef([m4_Cursor], m4_qlen([$3]))]], -[[m4_pushdef([m4_Separator], [m4_define([m4_Separator], [ ])])]], -dnl expand the first prefix, then check its length vs. regular prefix -dnl same length: nothing special -dnl prefix1 longer: output on line by itself, and reset cursor -dnl prefix1 shorter: pad to length of prefix, and reset cursor -[[[$3]m4_cond([m4_Cursor], m4_Indent, [], - [m4_eval(m4_Cursor > m4_Indent)], [1], [ -[$2]m4_define([m4_Cursor], m4_Indent)], - [m4_format([%*s], m4_max([0], - m4_eval(m4_Indent - m4_Cursor)), [])m4_define([m4_Cursor], m4_Indent)])]], -dnl now, for each word, compute the cursor after the word is output, then -dnl check if the cursor would exceed the wrap column -dnl if so, reset cursor, and insert newline and prefix -dnl if not, insert the separator (usually a space) -dnl either way, insert the word -[[m4_map_args_w([$1], [$0_word(], [, [$2], [$4])])]], -dnl finally, clean up the local variables -[[_m4_popdef([m4_Separator], [m4_Cursor], [m4_Indent])]])) - -m4_define([_m4_text_wrap_word], -[m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_qlen([$1]) + 1))]dnl -[m4_if(m4_eval(m4_Cursor > ([$3])), - [1], [m4_define([m4_Cursor], m4_eval(m4_Indent + m4_qlen([$1]) + 1)) -[$2]], - [m4_Separator[]])[$1]]) - -# m4_text_box(MESSAGE, [FRAME-CHARACTER = `-']) -# --------------------------------------------- -# Turn MESSAGE into: -# ## ------- ## -# ## MESSAGE ## -# ## ------- ## -# using FRAME-CHARACTER in the border. -# -# Quadrigraphs are correctly recognized. More precisely, you may -# redefine m4_qlen to recognize whatever escape sequences that you -# will post-process. -m4_define([m4_text_box], -[m4_pushdef([m4_Border], - m4_translit(m4_format([[[%*s]]], m4_decr(m4_qlen(_m4_expand([$1 -]))), []), [ ], m4_default_quoted([$2], [-])))]dnl -[[##] _m4_defn([m4_Border]) [##] -[##] $1 [##] -[##] _m4_defn([m4_Border]) [##]_m4_popdef([m4_Border])]) - - -# m4_qlen(STRING) -# --------------- -# Expands to the length of STRING after autom4te converts all quadrigraphs. -# -# If you use some other means of post-processing m4 output rather than -# autom4te, then you may redefine this macro to recognize whatever -# escape sequences your post-processor will handle. For that matter, -# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't -# do any post-processing. -# -# Avoid bpatsubsts for the common case of no quadrigraphs. Cache -# results, as configure scripts tend to ask about lengths of common -# strings like `/*' and `*/' rather frequently. Minimize the number -# of times that $1 occurs in m4_qlen, so there is less text to parse -# on a cache hit. -m4_define([m4_qlen], -[m4_ifdef([$0-$1], [_m4_defn([$0-]], [_$0(])[$1])]) -m4_define([_m4_qlen], -[m4_define([m4_qlen-$1], -m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])], - [m4_len(m4_bpatsubst([[$1]], - [@\(\(<:\|:>\|S|\|%:\|\{:\|:\}\)\(@\)\|&t@\)], - [\3]))]))_m4_defn([m4_qlen-$1])]) - -# m4_copyright_condense(TEXT) -# --------------------------- -# Condense the copyright notice in TEXT to only display the final -# year, wrapping the results to fit in 80 columns. -m4_define([m4_copyright_condense], -[m4_text_wrap(m4_bpatsubst(m4_flatten([[$1]]), -[(C)[- ,0-9]*\([1-9][0-9][0-9][0-9]\)], [(C) \1]))]) - -## ----------------------- ## -## 13. Number processing. ## -## ----------------------- ## - -# m4_cmp(A, B) -# ------------ -# Compare two integer expressions. -# A < B -> -1 -# A = B -> 0 -# A > B -> 1 -m4_define([m4_cmp], -[m4_eval((([$1]) > ([$2])) - (([$1]) < ([$2])))]) - - -# m4_list_cmp(A, B) -# ----------------- -# -# Compare the two lists of integer expressions A and B. For instance: -# m4_list_cmp([1, 0], [1]) -> 0 -# m4_list_cmp([1, 0], [1, 0]) -> 0 -# m4_list_cmp([1, 2], [1, 0]) -> 1 -# m4_list_cmp([1, 2, 3], [1, 2]) -> 1 -# m4_list_cmp([1, 2, -3], [1, 2]) -> -1 -# m4_list_cmp([1, 0], [1, 2]) -> -1 -# m4_list_cmp([1], [1, 2]) -> -1 -# m4_define([xa], [oops])dnl -# m4_list_cmp([[0xa]], [5+5]) -> 0 -# -# Rather than face the overhead of m4_case, we use a helper function whose -# expansion includes the name of the macro to invoke on the tail, either -# m4_ignore or m4_unquote. This is particularly useful when comparing -# long lists, since less text is being expanded for deciding when to end -# recursion. The recursion is between a pair of macros that alternate -# which list is trimmed by one element; this is more efficient than -# calling m4_cdr on both lists from a single macro. Guarantee exactly -# one expansion of both lists' side effects. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_list_cmp], -[_$0_raw(m4_dquote($1), m4_dquote($2))]) - -m4_define([_m4_list_cmp_raw], -[m4_if([$1], [$2], [0], [_m4_list_cmp_1([$1], $2)])]) - -m4_define([_m4_list_cmp], -[m4_if([$1], [], [0m4_ignore], [$2], [0], [m4_unquote], [$2m4_ignore])]) - -m4_define([_m4_list_cmp_1], -[_m4_list_cmp_2([$2], [m4_shift2($@)], $1)]) - -m4_define([_m4_list_cmp_2], -[_m4_list_cmp([$1$3], m4_cmp([$3+0], [$1+0]))( - [_m4_list_cmp_1(m4_dquote(m4_shift3($@)), $2)])]) - -# m4_max(EXPR, ...) -# m4_min(EXPR, ...) -# ----------------- -# Return the decimal value of the maximum (or minimum) in a series of -# integer expressions. -# -# M4 1.4.x doesn't provide ?:. Hence this huge m4_eval. Avoid m4_eval -# if both arguments are identical, but be aware of m4_max(0xa, 10) (hence -# the use of <=, not just <, in the second multiply). -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_max], -[m4_if([$#], [0], [m4_fatal([too few arguments to $0])], - [$#], [1], [m4_eval([$1])], - [$#$1], [2$2], [m4_eval([$1])], - [$#], [2], [_$0($@)], - [_m4_minmax([_$0], $@)])]) - -m4_define([_m4_max], -[m4_eval((([$1]) > ([$2])) * ([$1]) + (([$1]) <= ([$2])) * ([$2]))]) - -m4_define([m4_min], -[m4_if([$#], [0], [m4_fatal([too few arguments to $0])], - [$#], [1], [m4_eval([$1])], - [$#$1], [2$2], [m4_eval([$1])], - [$#], [2], [_$0($@)], - [_m4_minmax([_$0], $@)])]) - -m4_define([_m4_min], -[m4_eval((([$1]) < ([$2])) * ([$1]) + (([$1]) >= ([$2])) * ([$2]))]) - -# _m4_minmax(METHOD, ARG1, ARG2...) -# --------------------------------- -# Common recursion code for m4_max and m4_min. METHOD must be _m4_max -# or _m4_min, and there must be at least two arguments to combine. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([_m4_minmax], -[m4_if([$#], [3], [$1([$2], [$3])], - [$0([$1], $1([$2], [$3]), m4_shift3($@))])]) - - -# m4_sign(A) -# ---------- -# The sign of the integer expression A. -m4_define([m4_sign], -[m4_eval((([$1]) > 0) - (([$1]) < 0))]) - - - -## ------------------------ ## -## 14. Version processing. ## -## ------------------------ ## - - -# m4_version_unletter(VERSION) -# ---------------------------- -# Normalize beta version numbers with letters to numeric expressions, which -# can then be handed to m4_eval for the purpose of comparison. -# -# Nl -> (N+1).-1.(l#) -# -# for example: -# [2.14a] -> [0,2,14+1,-1,[0r36:a]] -> 2.15.-1.10 -# [2.14b] -> [0,2,15+1,-1,[0r36:b]] -> 2.15.-1.11 -# [2.61aa.b] -> [0,2.61,1,-1,[0r36:aa],+1,-1,[0r36:b]] -> 2.62.-1.370.1.-1.11 -# [08] -> [0,[0r10:0]8] -> 8 -# -# This macro expects reasonable version numbers, but can handle double -# letters and does not expand any macros. Original version strings can -# use both `.' and `-' separators. -# -# Inline constant expansions, to avoid m4_defn overhead. -# _m4_version_unletter is the real workhorse used by m4_version_compare, -# but since [0r36:a] and commas are less readable than 10 and dots, we -# provide a wrapper for human use. -m4_define([m4_version_unletter], -[m4_substr(m4_map_args([.m4_eval], m4_unquote(_$0([$1]))), [3])]) -m4_define([_m4_version_unletter], -[m4_bpatsubst(m4_bpatsubst(m4_translit([[[[0,$1]]]], [.-], [,,]),]dnl -m4_dquote(m4_dquote(m4_defn([m4_cr_Letters])))[[+], - [+1,-1,[0r36:\&]]), [,0], [,[0r10:0]])]) - - -# m4_version_compare(VERSION-1, VERSION-2) -# ---------------------------------------- -# Compare the two version numbers and expand into -# -1 if VERSION-1 < VERSION-2 -# 0 if = -# 1 if > -# -# Since _m4_version_unletter does not output side effects, we can -# safely bypass the overhead of m4_version_cmp. -m4_define([m4_version_compare], -[_m4_list_cmp_raw(_m4_version_unletter([$1]), _m4_version_unletter([$2]))]) - - -# m4_PACKAGE_NAME -# m4_PACKAGE_TARNAME -# m4_PACKAGE_VERSION -# m4_PACKAGE_STRING -# m4_PACKAGE_BUGREPORT -# -------------------- -# If m4sugar/version.m4 is present, then define version strings. This -# file is optional, provided by Autoconf but absent in Bison. -m4_sinclude([m4sugar/version.m4]) - - -# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL]) -# ---------------------------------------------------- -# Check this Autoconf version against VERSION. -m4_define([m4_version_prereq], -m4_ifdef([m4_PACKAGE_VERSION], -[[m4_if(m4_version_compare(]m4_dquote(m4_defn([m4_PACKAGE_VERSION]))[, [$1]), - [-1], - [m4_default([$3], - [m4_fatal([Autoconf version $1 or higher is required], - [63])])], - [$2])]], -[[m4_fatal([m4sugar/version.m4 not found])]])) - - -## ------------------ ## -## 15. Set handling. ## -## ------------------ ## - -# Autoconf likes to create arbitrarily large sets; for example, as of -# this writing, the configure.ac for coreutils tracks a set of more -# than 400 AC_SUBST. How do we track all of these set members, -# without introducing duplicates? We could use m4_append_uniq, with -# the set NAME residing in the contents of the macro NAME. -# Unfortunately, m4_append_uniq is quadratic for set creation, because -# it costs O(n) to search the string for each of O(n) insertions; not -# to mention that with m4 1.4.x, even using m4_append is slow, costing -# O(n) rather than O(1) per insertion. Other set operations, not used -# by Autoconf but still possible by manipulation of the definition -# tracked in macro NAME, include O(n) deletion of one element and O(n) -# computation of set size. Because the set is exposed to the user via -# the definition of a single macro, we cannot cache any data about the -# set without risking the cache being invalidated by the user -# redefining NAME. -# -# Can we do better? Yes, because m4 gives us an O(1) search function -# for free: ifdef. Additionally, even m4 1.4.x gives us an O(1) -# insert operation for free: pushdef. But to use these, we must -# represent the set via a group of macros; to keep the set consistent, -# we must hide the set so that the user can only manipulate it through -# accessor macros. The contents of the set are maintained through two -# access points; _m4_set([name]) is a pushdef stack of values in the -# set, useful for O(n) traversal of the set contents; while the -# existence of _m4_set([name],value) with no particular value is -# useful for O(1) querying of set membership. And since the user -# cannot externally manipulate the set, we are free to add additional -# caching macros for other performance improvements. Deletion can be -# O(1) per element rather than O(n), by reworking the definition of -# _m4_set([name],value) to be 0 or 1 based on current membership, and -# adding _m4_set_cleanup(name) to defer the O(n) cleanup of -# _m4_set([name]) until we have another reason to do an O(n) -# traversal. The existence of _m4_set_cleanup(name) can then be used -# elsewhere to determine if we must dereference _m4_set([name],value), -# or assume that definition implies set membership. Finally, size can -# be tracked in an O(1) fashion with _m4_set_size(name). -# -# The quoting in _m4_set([name],value) is chosen so that there is no -# ambiguity with a set whose name contains a comma, and so that we can -# supply the value via _m4_defn([_m4_set([name])]) without needing any -# quote manipulation. - -# m4_set_add(SET, VALUE, [IF-UNIQ], [IF-DUP]) -# ------------------------------------------- -# Add VALUE as an element of SET. Expand IF-UNIQ on the first -# addition, and IF-DUP if it is already in the set. Addition of one -# element is O(1), such that overall set creation is O(n). -# -# We do not want to add a duplicate for a previously deleted but -# unpruned element, but it is just as easy to check existence directly -# as it is to query _m4_set_cleanup($1). -m4_define([m4_set_add], -[m4_ifdef([_m4_set([$1],$2)], - [m4_if(m4_indir([_m4_set([$1],$2)]), [0], - [m4_define([_m4_set([$1],$2)], - [1])_m4_set_size([$1], [m4_incr])$3], [$4])], - [m4_define([_m4_set([$1],$2)], - [1])m4_pushdef([_m4_set([$1])], - [$2])_m4_set_size([$1], [m4_incr])$3])]) - -# m4_set_add_all(SET, VALUE...) -# ----------------------------- -# Add each VALUE into SET. This is O(n) in the number of VALUEs, and -# can be faster than calling m4_set_add for each VALUE. -# -# Implement two recursion helpers; the check variant is slower but -# handles the case where an element has previously been removed but -# not pruned. The recursion helpers ignore their second argument, so -# that we can use the faster m4_shift2 and 2 arguments, rather than -# _m4_shift2 and one argument, as the signal to end recursion. -# -# Please keep foreach.m4 in sync with any adjustments made here. -m4_define([m4_set_add_all], -[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1]) - + m4_len(m4_ifdef([_m4_set_cleanup($1)], [_$0_check], [_$0])([$1], $@))))]) - -m4_define([_m4_set_add_all], -[m4_if([$#], [2], [], - [m4_ifdef([_m4_set([$1],$3)], [], - [m4_define([_m4_set([$1],$3)], [1])m4_pushdef([_m4_set([$1])], - [$3])-])$0([$1], m4_shift2($@))])]) - -m4_define([_m4_set_add_all_check], -[m4_if([$#], [2], [], - [m4_set_add([$1], [$3])$0([$1], m4_shift2($@))])]) - -# m4_set_contains(SET, VALUE, [IF-PRESENT], [IF-ABSENT]) -# ------------------------------------------------------ -# Expand IF-PRESENT if SET contains VALUE, otherwise expand IF-ABSENT. -# This is always O(1). -m4_define([m4_set_contains], -[m4_ifdef([_m4_set_cleanup($1)], - [m4_if(m4_ifdef([_m4_set([$1],$2)], - [m4_indir([_m4_set([$1],$2)])], [0]), [1], [$3], [$4])], - [m4_ifdef([_m4_set([$1],$2)], [$3], [$4])])]) - -# m4_set_contents(SET, [SEP]) -# --------------------------- -# Expand to a single string containing all the elements in SET, -# separated by SEP, without modifying SET. No provision is made for -# disambiguating set elements that contain non-empty SEP as a -# sub-string, or for recognizing a set that contains only the empty -# string. Order of the output is not guaranteed. If any elements -# have been previously removed from the set, this action will prune -# the unused memory. This is O(n) in the size of the set before -# pruning. -# -# Use _m4_popdef for speed. The existence of _m4_set_cleanup($1) -# determines which version of _1 helper we use. -m4_define([m4_set_contents], -[m4_set_map_sep([$1], [], [], [[$2]])]) - -# _m4_set_contents_1(SET) -# _m4_set_contents_1c(SET) -# _m4_set_contents_2(SET, [PRE], [POST], [SEP]) -# --------------------------------------------- -# Expand to a list of quoted elements currently in the set, each -# surrounded by PRE and POST, and moving SEP in front of PRE on -# recursion. To avoid nesting limit restrictions, the algorithm must -# be broken into two parts; _1 destructively copies the stack in -# reverse into _m4_set_($1), producing no output; then _2 -# destructively copies _m4_set_($1) back into the stack in reverse. -# If no elements were deleted, then this visits the set in the order -# that elements were inserted. Behavior is undefined if PRE/POST/SEP -# tries to recursively list or modify SET in any way other than -# calling m4_set_remove on the current element. Use _1 if all entries -# in the stack are guaranteed to be in the set, and _1c to prune -# removed entries. Uses _m4_defn and _m4_popdef for speed. -m4_define([_m4_set_contents_1], -[_m4_stack_reverse([_m4_set([$1])], [_m4_set_($1)])]) - -m4_define([_m4_set_contents_1c], -[m4_ifdef([_m4_set([$1])], - [m4_set_contains([$1], _m4_defn([_m4_set([$1])]), - [m4_pushdef([_m4_set_($1)], _m4_defn([_m4_set([$1])]))], - [_m4_popdef([_m4_set([$1],]_m4_defn( - [_m4_set([$1])])[)])])_m4_popdef([_m4_set([$1])])$0([$1])], - [_m4_popdef([_m4_set_cleanup($1)])])]) - -m4_define([_m4_set_contents_2], -[_m4_stack_reverse([_m4_set_($1)], [_m4_set([$1])], - [$2[]_m4_defn([_m4_set_($1)])$3], [$4[]])]) - -# m4_set_delete(SET) -# ------------------ -# Delete all elements in SET, and reclaim any memory occupied by the -# set. This is O(n) in the set size. -# -# Use _m4_defn and _m4_popdef for speed. -m4_define([m4_set_delete], -[m4_ifdef([_m4_set([$1])], - [_m4_popdef([_m4_set([$1],]_m4_defn([_m4_set([$1])])[)], - [_m4_set([$1])])$0([$1])], - [m4_ifdef([_m4_set_cleanup($1)], - [_m4_popdef([_m4_set_cleanup($1)])])m4_ifdef( - [_m4_set_size($1)], - [_m4_popdef([_m4_set_size($1)])])])]) - -# m4_set_difference(SET1, SET2) -# ----------------------------- -# Produce a LIST of quoted elements that occur in SET1 but not SET2. -# Output a comma prior to any elements, to distinguish the empty -# string from no elements. This can be directly used as a series of -# arguments, such as for m4_join, or wrapped inside quotes for use in -# m4_foreach. Order of the output is not guaranteed. -# -# Short-circuit the idempotence relation. -m4_define([m4_set_difference], -[m4_if([$1], [$2], [], [m4_set_map_sep([$1], [_$0([$2],], [)])])]) - -m4_define([_m4_set_difference], -[m4_set_contains([$1], [$2], [], [,[$2]])]) - -# m4_set_dump(SET, [SEP]) -# ----------------------- -# Expand to a single string containing all the elements in SET, -# separated by SEP, then delete SET. In general, if you only need to -# list the contents once, this is faster than m4_set_contents. No -# provision is made for disambiguating set elements that contain -# non-empty SEP as a sub-string. Order of the output is not -# guaranteed. This is O(n) in the size of the set before pruning. -# -# Use _m4_popdef for speed. Use existence of _m4_set_cleanup($1) to -# decide if more expensive recursion is needed. -m4_define([m4_set_dump], -[m4_ifdef([_m4_set_size($1)], - [_m4_popdef([_m4_set_size($1)])])m4_ifdef([_m4_set_cleanup($1)], - [_$0_check], [_$0])([$1], [], [$2])]) - -# _m4_set_dump(SET, [SEP], [PREP]) -# _m4_set_dump_check(SET, [SEP], [PREP]) -# -------------------------------------- -# Print SEP and the current element, then delete the element and -# recurse with empty SEP changed to PREP. The check variant checks -# whether the element has been previously removed. Use _m4_defn and -# _m4_popdef for speed. -m4_define([_m4_set_dump], -[m4_ifdef([_m4_set([$1])], - [[$2]_m4_defn([_m4_set([$1])])_m4_popdef([_m4_set([$1],]_m4_defn( - [_m4_set([$1])])[)], [_m4_set([$1])])$0([$1], [$2$3])])]) - -m4_define([_m4_set_dump_check], -[m4_ifdef([_m4_set([$1])], - [m4_set_contains([$1], _m4_defn([_m4_set([$1])]), - [[$2]_m4_defn([_m4_set([$1])])])_m4_popdef( - [_m4_set([$1],]_m4_defn([_m4_set([$1])])[)], - [_m4_set([$1])])$0([$1], [$2$3])], - [_m4_popdef([_m4_set_cleanup($1)])])]) - -# m4_set_empty(SET, [IF-EMPTY], [IF-ELEMENTS]) -# -------------------------------------------- -# Expand IF-EMPTY if SET has no elements, otherwise IF-ELEMENTS. -m4_define([m4_set_empty], -[m4_ifdef([_m4_set_size($1)], - [m4_if(m4_indir([_m4_set_size($1)]), [0], [$2], [$3])], [$2])]) - -# m4_set_foreach(SET, VAR, ACTION) -# -------------------------------- -# For each element of SET, define VAR to the element and expand -# ACTION. ACTION should not recursively list SET's contents, add -# elements to SET, nor delete any element from SET except the one -# currently in VAR. The order that the elements are visited in is not -# guaranteed. This is faster than the corresponding m4_foreach([VAR], -# m4_indir([m4_dquote]m4_set_listc([SET])), [ACTION]) -m4_define([m4_set_foreach], -[m4_pushdef([$2])m4_set_map_sep([$1], [m4_define([$2],], [)$3])]) - -# m4_set_intersection(SET1, SET2) -# ------------------------------- -# Produce a LIST of quoted elements that occur in both SET1 or SET2. -# Output a comma prior to any elements, to distinguish the empty -# string from no elements. This can be directly used as a series of -# arguments, such as for m4_join, or wrapped inside quotes for use in -# m4_foreach. Order of the output is not guaranteed. -# -# Iterate over the smaller set, and short-circuit the idempotence -# relation. -m4_define([m4_set_intersection], -[m4_if([$1], [$2], [m4_set_listc([$1])], - m4_eval(m4_set_size([$2]) < m4_set_size([$1])), [1], [$0([$2], [$1])], - [m4_set_map_sep([$1], [_$0([$2],], [)])])]) - -m4_define([_m4_set_intersection], -[m4_set_contains([$1], [$2], [,[$2]])]) - -# m4_set_list(SET) -# m4_set_listc(SET) -# ----------------- -# Produce a LIST of quoted elements of SET. This can be directly used -# as a series of arguments, such as for m4_join or m4_set_add_all, or -# wrapped inside quotes for use in m4_foreach or m4_map. With -# m4_set_list, there is no way to distinguish an empty set from a set -# containing only the empty string; with m4_set_listc, a leading comma -# is output if there are any elements. -m4_define([m4_set_list], -[m4_set_map_sep([$1], [], [], [,])]) - -m4_define([m4_set_listc], -[m4_set_map_sep([$1], [,])]) - -# m4_set_map(SET, ACTION) -# ----------------------- -# For each element of SET, expand ACTION with a single argument of the -# current element. ACTION should not recursively list SET's contents, -# add elements to SET, nor delete any element from SET except the one -# passed as an argument. The order that the elements are visited in -# is not guaranteed. This is faster than either of the corresponding -# m4_map_args([ACTION]m4_set_listc([SET])) -# m4_set_foreach([SET], [VAR], [ACTION(m4_defn([VAR]))]) -m4_define([m4_set_map], -[m4_set_map_sep([$1], [$2(], [)])]) - -# m4_set_map_sep(SET, [PRE], [POST], [SEP]) -# ----------------------------------------- -# For each element of SET, expand PRE[value]POST[], and expand SEP -# between elements. -m4_define([m4_set_map_sep], -[m4_ifdef([_m4_set_cleanup($1)], [_m4_set_contents_1c], - [_m4_set_contents_1])([$1])_m4_set_contents_2($@)]) - -# m4_set_remove(SET, VALUE, [IF-PRESENT], [IF-ABSENT]) -# ---------------------------------------------------- -# If VALUE is an element of SET, delete it and expand IF-PRESENT. -# Otherwise expand IF-ABSENT. Deleting a single value is O(1), -# although it leaves memory occupied until the next O(n) traversal of -# the set which will compact the set. -# -# Optimize if the element being removed is the most recently added, -# since defining _m4_set_cleanup($1) slows down so many other macros. -# In particular, this plays well with m4_set_foreach and m4_set_map. -m4_define([m4_set_remove], -[m4_set_contains([$1], [$2], [_m4_set_size([$1], - [m4_decr])m4_if(_m4_defn([_m4_set([$1])]), [$2], - [_m4_popdef([_m4_set([$1],$2)], [_m4_set([$1])])], - [m4_define([_m4_set_cleanup($1)])m4_define( - [_m4_set([$1],$2)], [0])])$3], [$4])]) - -# m4_set_size(SET) -# ---------------- -# Expand to the number of elements currently in SET. This operation -# is O(1), and thus more efficient than m4_count(m4_set_list([SET])). -m4_define([m4_set_size], -[m4_ifdef([_m4_set_size($1)], [m4_indir([_m4_set_size($1)])], [0])]) - -# _m4_set_size(SET, ACTION) -# ------------------------- -# ACTION must be either m4_incr or m4_decr, and the size of SET is -# changed accordingly. If the set is empty, ACTION must not be -# m4_decr. -m4_define([_m4_set_size], -[m4_define([_m4_set_size($1)], - m4_ifdef([_m4_set_size($1)], [$2(m4_indir([_m4_set_size($1)]))], - [1]))]) - -# m4_set_union(SET1, SET2) -# ------------------------ -# Produce a LIST of double quoted elements that occur in either SET1 -# or SET2, without duplicates. Output a comma prior to any elements, -# to distinguish the empty string from no elements. This can be -# directly used as a series of arguments, such as for m4_join, or -# wrapped inside quotes for use in m4_foreach. Order of the output is -# not guaranteed. -# -# We can rely on the fact that m4_set_listc prunes SET1, so we don't -# need to check _m4_set([$1],element) for 0. Short-circuit the -# idempotence relation. -m4_define([m4_set_union], -[m4_set_listc([$1])m4_if([$1], [$2], [], - [m4_set_map_sep([$2], [_$0([$1],], [)])])]) - -m4_define([_m4_set_union], -[m4_ifdef([_m4_set([$1],$2)], [], [,[$2]])]) - - -## ------------------- ## -## 16. File handling. ## -## ------------------- ## - - -# It is a real pity that M4 comes with no macros to bind a diversion -# to a file. So we have to deal without, which makes us a lot more -# fragile than we should. - - -# m4_file_append(FILE-NAME, CONTENT) -# ---------------------------------- -m4_define([m4_file_append], -[m4_syscmd([cat >>$1 <<_m4eof -$2 -_m4eof -]) -m4_if(m4_sysval, [0], [], - [m4_fatal([$0: cannot write: $1])])]) - - - -## ------------------------ ## -## 17. Setting M4sugar up. ## -## ------------------------ ## - -# _m4_divert_diversion should be defined. -m4_divert_push([KILL]) - -# m4_init -# ------- -# Initialize the m4sugar language. -m4_define([m4_init], -[# All the M4sugar macros start with `m4_', except `dnl' kept as is -# for sake of simplicity. -m4_pattern_forbid([^_?m4_]) -m4_pattern_forbid([^dnl$]) - -# If __m4_version__ is defined, we assume that we are being run by M4 -# 1.6 or newer, thus $@ recursion is linear, and debugmode(+do) -# is available for faster checks of dereferencing undefined macros -# and forcing dumpdef to print to stderr regardless of debugfile. -# But if it is missing, we assume we are being run by M4 1.4.x, that -# $@ recursion is quadratic, and that we need foreach-based -# replacement macros. Also, m4 prior to 1.4.8 loses track of location -# during m4wrap text; __line__ should never be 0. -# -# Use the raw builtin to avoid tripping up include tracing. -# Meanwhile, avoid m4_copy, since it temporarily undefines m4_defn. -m4_ifdef([__m4_version__], -[m4_debugmode([+do]) -m4_define([m4_defn], _m4_defn([_m4_defn])) -m4_define([m4_dumpdef], _m4_defn([_m4_dumpdef])) -m4_define([m4_popdef], _m4_defn([_m4_popdef])) -m4_define([m4_undefine], _m4_defn([_m4_undefine]))], -[m4_builtin([include], [m4sugar/foreach.m4]) -m4_wrap_lifo([m4_if(__line__, [0], [m4_pushdef([m4_location], -]]m4_dquote(m4_dquote(m4_dquote(__file__:__line__)))[[)])])]) - -# Rewrite the first entry of the diversion stack. -m4_divert([KILL]) - -# Check the divert push/pop perfect balance. -# Some users are prone to also use m4_wrap to register last-minute -# m4_divert_text; so after our diversion cleanups, we restore -# KILL as the bottom of the diversion stack. -m4_wrap([m4_popdef([_m4_divert_diversion])m4_ifdef( - [_m4_divert_diversion], [m4_fatal([$0: unbalanced m4_divert_push: -]m4_divert_stack)])_m4_popdef([_m4_divert_stack])m4_divert_push([KILL])]) -]) diff --git a/tools/data/stack.hh b/tools/data/stack.hh deleted file mode 100644 index e4e8df0a..00000000 --- a/tools/data/stack.hh +++ /dev/null @@ -1,121 +0,0 @@ -# C++ skeleton for Bison - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_pushdef([b4_copyright_years], - [2002-2012]) - -b4_output_begin([b4_dir_prefix[]stack.hh]) -b4_copyright([Stack handling for Bison parsers in C++], - [2002-2012])[ - -/** - ** \file ]b4_dir_prefix[stack.hh - ** Define the ]b4_namespace_ref[::stack class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[ - -# include - -]b4_namespace_open[ - template > - class stack - { - public: - // Hide our reversed order. - typedef typename S::reverse_iterator iterator; - typedef typename S::const_reverse_iterator const_iterator; - - stack () : seq_ () - { - } - - stack (unsigned int n) : seq_ (n) - { - } - - inline - T& - operator [] (unsigned int i) - { - return seq_[i]; - } - - inline - const T& - operator [] (unsigned int i) const - { - return seq_[i]; - } - - inline - void - push (const T& t) - { - seq_.push_front (t); - } - - inline - void - pop (unsigned int n = 1) - { - for (; n; --n) - seq_.pop_front (); - } - - inline - unsigned int - height () const - { - return seq_.size (); - } - - inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { return seq_.rend (); } - - private: - S seq_; - }; - - /// Present a slice of the top of a stack. - template > - class slice - { - public: - slice (const S& stack, unsigned int range) - : stack_ (stack) - , range_ (range) - { - } - - inline - const T& - operator [] (unsigned int i) const - { - return stack_[range_ - i]; - } - - private: - const S& stack_; - unsigned int range_; - }; -]b4_namespace_close[ - -]b4_cpp_guard_close([b4_dir_prefix[]stack.hh]) -b4_output_end() - -m4_popdef([b4_copyright_years]) diff --git a/tools/data/xslt/bison.xsl b/tools/data/xslt/bison.xsl deleted file mode 100644 index e661b3f5..00000000 --- a/tools/data/xslt/bison.xsl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - s - - - r - - - - - - , - - - - - 0 - - - - - - - - - - - diff --git a/tools/data/xslt/xml2dot.xsl b/tools/data/xslt/xml2dot.xsl deleted file mode 100644 index 87d4e07c..00000000 --- a/tools/data/xslt/xml2dot.xsl +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - - - - - - - - - - // Generated by GNU Bison - - . - // Report bugs to < - - >. - // Home page: < - - >. - - - - - - - - digraph " - - - - " { - node [fontname = courier, shape = box, colorscheme = paired6] - edge [fontname = courier] - - - - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - label="[ - - - - - - , - - - ]", - - - - style=solid] - - - - - - - - - 3 - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - . - - - - - . - - - - - - - - - - - - - [ - - ] - - - - - - , - - - - - - - - - - - -> " - - R - - - d - - " [ - - - - - - - - " - - R - - - d - - " [label=" - - - Acc", fillcolor=1 - - - R - - ", fillcolor= - - - - , shape=diamond, style=filled] - - - - - - - - - - dotted - - - solid - - - dashed - - - - - - - - - - - - - - - - - [label=" - State - - \n - - - - \l"] - - - - - - - - - - -> - - [style= - - - label=" - - - - " - - ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/data/xslt/xml2text.xsl b/tools/data/xslt/xml2text.xsl deleted file mode 100644 index 5af94613..00000000 --- a/tools/data/xslt/xml2text.xsl +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Nonterminals useless in grammar - - - - - - - - - - - - Terminals unused in grammar - - - - - - - - - - - - - - Rules useless in grammar - - - - - - - - - - - Rules useless in parser due to conflicts - - - - - - - - - Grammar - - - - - - - - - - - - - - - - - - - - - - - - - Terminals, with rules where they appear - - - - - - Nonterminals, with rules where they appear - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - on@left: - - - - - - - , - - on@right: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - State - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - . - - - - - - - - - . - - - - - - - - - - - - - - - - /* empty */ - - - - [ - - ] - - - - - - , - - - - - - - - - - - - - shift, and go to state - - - - go to state - - - - - - - - - - - - - - error - ( - - ) - - - - - - - - - - - - [ - - - - accept - - - reduce using rule - - ( - - ) - - - - ] - - - - - - - - - - - - - Conflict between rule - - and token - - resolved as - - an - - - ( - - ). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/data/xslt/xml2xhtml.xsl b/tools/data/xslt/xml2xhtml.xsl deleted file mode 100644 index 22033c61..00000000 --- a/tools/data/xslt/xml2xhtml.xsl +++ /dev/null @@ -1,745 +0,0 @@ - - - - - - - - - - - - - - - <xsl:value-of select="bison-xml-report/filename"/> - <xsl:text> - GNU Bison XML Automaton Report</xsl:text> - - - - - - - - - - - - -

GNU Bison XML Automaton Report

-

- input grammar: -

- - -

Table of Contents

- - - - - - -
- - -

- - Reductions -

- - - -
- - -

- - Nonterminals useless in grammar -

- - -

- - - - - - -

-
- - - -

- - Terminals unused in grammar -

- - -

- - - - - - - -

-
- - - -

- - Rules useless in grammar -

- - - -

- - - - -

-
- - - - - -

- - Rules useless in parser due to conflicts -

- -

- - - -

- - - - - -

- - Grammar -

- -

- - - -

- - - - - - - - - - - - - - - - - - - - - -

- - Conflicts -

- - - - - -

- - -

-
- - - - - - - - - -
- - - - - - conflicts: - - - - - - - - - - - - - - -

- - Terminals, with rules where they appear -

- -

- -

- -
- - -

- - Nonterminals, with rules where they appear -

- -

- -

- - - - - - - - - - - - - - - - - on left: - - - - - - - - - on right: - - - - - - - - - -
- - - - - - - - -

- - Automaton -

- - - -
- - - - -

- - - - - - state - -

- -

- - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - ε - - - - [ - - ] - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - ( - - ) - - - - - - - - - - - - [ - - - - accept - - - - - - - - - ( - - ) - - - - ] - - - - - - - - - - - - - Conflict between - - - - - - - and token - - resolved as - - an - - - ( - - ). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - -
diff --git a/tools/data/yacc.c b/tools/data/yacc.c deleted file mode 100644 index b34549f1..00000000 --- a/tools/data/yacc.c +++ /dev/null @@ -1,2065 +0,0 @@ - -*- C -*- - -# Yacc compatible skeleton for Bison - -# Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, -# Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check the value of %define api.push-pull. -b4_percent_define_default([[api.push-pull]], [[pull]]) -b4_percent_define_check_values([[[[api.push-pull]], - [[pull]], [[push]], [[both]]]]) -b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]]) -b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]]) -m4_case(b4_percent_define_get([[api.push-pull]]), - [pull], [m4_define([b4_push_flag], [[0]])], - [push], [m4_define([b4_pull_flag], [[0]])]) - -# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing -# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the -# behavior of Bison at all when push parsing is already requested. -b4_define_flag_if([use_push_for_pull]) -b4_use_push_for_pull_if([ - b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])], - [m4_define([b4_push_flag], [[1]])])]) - -# Check the value of %define parse.lac and friends, where LAC stands for -# lookahead correction. -b4_percent_define_default([[parse.lac]], [[none]]) -b4_percent_define_default([[parse.lac.es-capacity-initial]], [[20]]) -b4_percent_define_default([[parse.lac.memory-trace]], [[failures]]) -b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]], - [[[[parse.lac.memory-trace]], - [[failures]], [[full]]]]) -b4_define_flag_if([lac]) -m4_define([b4_lac_flag], - [m4_if(b4_percent_define_get([[parse.lac]]), - [none], [[0]], [[1]])]) - -m4_include(b4_pkgdatadir/[c.m4]) - -## ---------------- ## -## Default values. ## -## ---------------- ## - -# Stack parameters. -m4_define_default([b4_stack_depth_max], [10000]) -m4_define_default([b4_stack_depth_init], [200]) - - -## ------------------------ ## -## Pure/impure interfaces. ## -## ------------------------ ## - -b4_percent_define_default([[api.pure]], [[false]]) -b4_percent_define_check_values([[[[api.pure]], - [[false]], [[true]], [[]], [[full]]]]) - -m4_define([b4_pure_flag], [[0]]) -m4_case(b4_percent_define_get([[api.pure]]), - [false], [m4_define([b4_pure_flag], [[0]])], - [true], [m4_define([b4_pure_flag], [[1]])], - [], [m4_define([b4_pure_flag], [[1]])], - [full], [m4_define([b4_pure_flag], [[2]])]) - -m4_define([b4_pure_if], -[m4_case(b4_pure_flag, - [0], [$2], - [1], [$1], - [2], [$1])]) - [m4_fatal([invalid api.pure value: ]$1)])]) - -# b4_yyerror_arg_loc_if(ARG) -# -------------------------- -# Expand ARG iff yyerror is to be given a location as argument. -m4_define([b4_yyerror_arg_loc_if], -[b4_locations_if([m4_case(b4_pure_flag, - [1], [m4_ifset([b4_parse_param], [$1])], - [2], [$1])])]) - -# b4_yyerror_args -# --------------- -# Arguments passed to yyerror: user args plus yylloc. -m4_define([b4_yyerror_args], -[b4_yyerror_arg_loc_if([&yylloc, ])dnl -m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) - - -# b4_lex_param -# ------------ -# Accumulate in b4_lex_param all the yylex arguments. -# b4_lex_param arrives quoted twice, but we want to keep only one level. -m4_define([b4_lex_param], -m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl -b4_locations_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl -m4_ifdef([b4_lex_param], b4_lex_param))) - - -## ------------ ## -## Data Types. ## -## ------------ ## - -# b4_int_type(MIN, MAX) -# --------------------- -# Return the smallest int type able to handle numbers ranging from -# MIN to MAX (included). Overwrite the version from c.m4, which -# uses only C89 types, so that the user can override the shorter -# types, and so that pre-C89 compilers are handled correctly. -m4_define([b4_int_type], -[m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8], - b4_ints_in($@, [-128], [127]), [1], [yytype_int8], - - b4_ints_in($@, [0], [65535]), [1], [yytype_uint16], - b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16], - - m4_eval([0 <= $1]), [1], [unsigned int], - - [int])]) - - -## ----------------- ## -## Semantic Values. ## -## ----------------- ## - - -# b4_lhs_value([TYPE]) -# -------------------- -# Expansion of $$. -m4_define([b4_lhs_value], -[(yyval[]m4_ifval([$1], [.$1]))]) - - -# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) -# -------------------------------------- -# Expansion of $NUM, where the current rule has RULE-LENGTH -# symbols on RHS. -m4_define([b4_rhs_value], -[(yyvsp@{($2) - ($1)@}m4_ifval([$3], [.$3]))]) - - - -## ----------- ## -## Locations. ## -## ----------- ## - -# b4_lhs_location() -# ----------------- -# Expansion of @$. -m4_define([b4_lhs_location], -[(yyloc)]) - - -# b4_rhs_location(RULE-LENGTH, NUM) -# --------------------------------- -# Expansion of @NUM, where the current rule has RULE-LENGTH symbols -# on RHS. -m4_define([b4_rhs_location], -[(yylsp@{($2) - ($1)@})]) - - -## -------------- ## -## Declarations. ## -## -------------- ## - -# b4_declare_scanner_communication_variables -# ------------------------------------------ -# Declare the variables that are global, or local to YYPARSE if -# pure-parser. -m4_define([b4_declare_scanner_communication_variables], [[ -/* The lookahead symbol. */ -int yychar; - -]b4_pure_if([[ -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif]b4_locations_if([[ -static YYLTYPE yyloc_default][]b4_yyloc_default[;]])])[ -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);]b4_locations_if([[ - -/* Location data for the lookahead symbol. */ -YYLTYPE yylloc]b4_pure_if([ = yyloc_default], [b4_yyloc_default])[; -]])b4_pure_if([], [[ - -/* Number of syntax errors so far. */ -int yynerrs;]])]) - - -# b4_declare_parser_state_variables -# --------------------------------- -# Declare all the variables that are needed to maintain the parser state -# between calls to yypush_parse. -m4_define([b4_declare_parser_state_variables], [b4_pure_if([[ - /* Number of syntax errors so far. */ - int yynerrs; -]])[ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values.]b4_locations_if([[ - `yyls': related to locations.]])[ - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp;]b4_locations_if([[ - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3];]])[ - - YYSIZE_T yystacksize;]b4_lac_if([[ - - yytype_int16 yyesa@{]b4_percent_define_get([[parse.lac.es-capacity-initial]])[@}; - yytype_int16 *yyes; - YYSIZE_T yyes_capacity;]])]) - - -# b4_declare_yyparse_push_ -# ------------------------ -# Declaration of yyparse (and dependencies) when using the push parser -# (including in pull mode). -m4_define([b4_declare_yyparse_push_], -[[#ifndef YYPUSH_MORE_DEFINED -# define YYPUSH_MORE_DEFINED -enum { YYPUSH_MORE = 4 }; -#endif - -typedef struct ]b4_prefix[pstate ]b4_prefix[pstate; - -]b4_pull_if([b4_c_function_decl([b4_prefix[parse]], [[int]], b4_parse_param) -])b4_c_function_decl([b4_prefix[push_parse]], [[int]], - [[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([, - [[[int pushed_char]], [[pushed_char]]], - [[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([, - [[b4_api_PREFIX[LTYPE *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [, - b4_parse_param])) -b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]], - [[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [, - b4_parse_param]))]) -b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]], - [[[void]], []]) -b4_c_function_decl([b4_prefix[pstate_delete]], [[void]], - [[b4_prefix[pstate *ps]], [[ps]]])dnl -]) - -# b4_declare_yyparse_ -# ------------------- -# When not the push parser. -m4_define([b4_declare_yyparse_], -[[#ifdef YYPARSE_PARAM -]b4_c_function_decl(b4_prefix[parse], [int], - [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[ -#else /* ! YYPARSE_PARAM */ -]b4_c_function_decl(b4_prefix[parse], [int], b4_parse_param)[ -#endif /* ! YYPARSE_PARAM */]dnl -]) - - -# b4_declare_yyparse -# ------------------ -m4_define([b4_declare_yyparse], -[b4_push_if([b4_declare_yyparse_push_], - [b4_declare_yyparse_])[]dnl -]) - - -# b4_shared_declarations -# ---------------------- -# Declaration that might either go into the header (if --defines) -# or open coded in the parser body. -m4_define([b4_shared_declarations], -[b4_cpp_guard_open([b4_spec_defines_file])[ -]b4_declare_yydebug[ -]b4_percent_code_get([[requires]])[ -]b4_token_enums_defines(b4_tokens)[ -]b4_declare_yylstype[ -]b4_declare_yyparse[ -]b4_percent_code_get([[provides]])[ -]b4_cpp_guard_close([b4_spec_defines_file])[]dnl -]) - - -## -------------- ## -## Output files. ## -## -------------- ## - -b4_output_begin([b4_parser_file_name]) -b4_copyright([Bison implementation for Yacc-like parsers in C], - [1984, 1989-1990, 2000-2012])[ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -]b4_identification -b4_percent_code_get([[top]])[]dnl -m4_if(b4_api_prefix, [yy], [], -[[/* Substitute the type names. */ -#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[ -#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[ -]m4_if(b4_prefix, [yy], [], -[[/* Substitute the variable and function names. */]b4_pull_if([[ -#define yyparse ]b4_prefix[parse]])b4_push_if([[ -#define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[ -#define yypull_parse ]b4_prefix[pull_parse]])[ -#define yypstate_new ]b4_prefix[pstate_new -#define yypstate_delete ]b4_prefix[pstate_delete -#define yypstate ]b4_prefix[pstate]])[ -#define yylex ]b4_prefix[lex -#define yyerror ]b4_prefix[error -#define yylval ]b4_prefix[lval -#define yychar ]b4_prefix[char -#define yydebug ]b4_prefix[debug -#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ -#define yylloc ]b4_prefix[lloc]])])[ - -/* Copy the first part of user declarations. */ -]b4_user_pre_prologue[ - -]b4_null_define[ - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE ]b4_error_verbose_flag[ -#endif - -]m4_ifval(m4_quote(b4_spec_defines_file), -[[/* In a future release of Bison, this section will be replaced - by #include "@basename(]b4_spec_defines_file[@)". */ -]])dnl -b4_shared_declarations[ - -/* Copy the second part of user declarations. */ -]b4_user_post_prologue -b4_percent_code_get[]dnl - -[#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif ]b4_c_modern[ -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && ]b4_c_modern[ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -]b4_c_function_def([YYID], [static int], [[int yyi], [yyi]])[ -{ - return yyi; -} -#endif - -#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[ - -/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl -b4_push_if([], [b4_lac_if([], [[ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && ]b4_c_modern[ -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif]])])[ - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && ]b4_c_modern[ -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && ]b4_c_modern[ -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif]b4_lac_if([[ -# define YYCOPY_NEEDED 1]])[ -#endif]b4_lac_if([], [[ /* ! defined yyoverflow || YYERROR_VERBOSE */]])[ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \ - && ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc;]b4_locations_if([ - YYLTYPE yyls_alloc;])[ -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -]b4_locations_if( -[# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM)], -[# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM)])[ - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL ]b4_final_state_number[ -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST ]b4_last[ - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS ]b4_tokens_number[ -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS ]b4_nterms_number[ -/* YYNRULES -- Number of rules. */ -#define YYNRULES ]b4_rules_number[ -/* YYNRULES -- Number of states. */ -#define YYNSTATES ]b4_states_number[ - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK ]b4_undef_token_number[ -#define YYMAXUTOK ]b4_user_token_number_max[ - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const ]b4_int_type_for([b4_translate])[ yytranslate[] = -{ - ]b4_translate[ -}; - -#if ]b4_api_PREFIX[DEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const ]b4_int_type_for([b4_prhs])[ yyprhs[] = -{ - ]b4_prhs[ -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const ]b4_int_type_for([b4_rhs])[ yyrhs[] = -{ - ]b4_rhs[ -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const ]b4_int_type_for([b4_rline])[ yyrline[] = -{ - ]b4_rline[ -}; -#endif - -#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[ -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - ]b4_tname[ -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const ]b4_int_type_for([b4_toknum])[ yytoknum[] = -{ - ]b4_toknum[ -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const ]b4_int_type_for([b4_r1])[ yyr1[] = -{ - ]b4_r1[ -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const ]b4_int_type_for([b4_r2])[ yyr2[] = -{ - ]b4_r2[ -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const ]b4_int_type_for([b4_defact])[ yydefact[] = -{ - ]b4_defact[ -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] = -{ - ]b4_defgoto[ -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF ]b4_pact_ninf[ -static const ]b4_int_type_for([b4_pact])[ yypact[] = -{ - ]b4_pact[ -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] = -{ - ]b4_pgoto[ -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF ]b4_table_ninf[ -static const ]b4_int_type_for([b4_table])[ yytable[] = -{ - ]b4_table[ -}; - -#define yypact_value_is_default(Yystate) \ - ]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[ - -#define yytable_value_is_error(Yytable_value) \ - ]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[ - -static const ]b4_int_type_for([b4_check])[ yycheck[] = -{ - ]b4_check[ -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const ]b4_int_type_for([b4_stos])[ yystos[] = -{ - ]b4_stos[ -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \]b4_lac_if([[ - YY_LAC_DISCARD ("YYBACKUP"); \]])[ - goto yybackup; \ - } \ - else \ - { \ - yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - -]b4_locations_if([[ -]b4_yylloc_default_define[ -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -]])[ -]b4_yy_location_print_define[ - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM) -#else -# define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[ -#endif - -/* Enable debugging if requested. */ -#if ]b4_api_PREFIX[DEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value]b4_locations_if([, Location])[]b4_user_args[); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - -]b4_yy_symbol_print_generate([b4_c_function_def])[ - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -]b4_c_function_def([yy_stack_print], [static void], - [[yytype_int16 *yybottom], [yybottom]], - [[yytype_int16 *yytop], [yytop]])[ -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -]b4_c_function_def([yy_reduce_print], [static void], - [[YYSTYPE *yyvsp], [yyvsp]], - b4_locations_if([[[YYLTYPE *yylsp], [yylsp]], - ])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [, - b4_parse_param]))[ -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &]b4_rhs_value(yynrhs, yyi + 1)[ - ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl - b4_user_args[); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !]b4_api_PREFIX[DEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !]b4_api_PREFIX[DEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH ]b4_stack_depth_init[ -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH ]b4_stack_depth_max[ -#endif]b4_lac_if([[ - -/* Given a state stack such that *YYBOTTOM is its bottom, such that - *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty - stack, and such that *YYCAPACITY is the maximum number of elements it - can hold without a reallocation, make sure there is enough room to - store YYADD more elements. If not, allocate a new stack using - YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM, - *YYTOP, and *YYCAPACITY to reflect the new capacity and memory - location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack - using YYSTACK_FREE. Return 0 if successful or if no reallocation is - required. Return 1 if memory is exhausted. */ -static int -yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd, -#if ]b4_api_PREFIX[DEBUG - char const *yydebug_prefix, - char const *yydebug_suffix, -#endif - yytype_int16 **yybottom, - yytype_int16 *yybottom_no_free, - yytype_int16 **yytop, yytype_int16 *yytop_empty) -{ - YYSIZE_T yysize_old = - *yytop == yytop_empty ? 0 : *yytop - *yybottom + 1; - YYSIZE_T yysize_new = yysize_old + yyadd; - if (*yycapacity < yysize_new) - { - YYSIZE_T yyalloc = 2 * yysize_new; - yytype_int16 *yybottom_new; - /* Use YYMAXDEPTH for maximum stack size given that the stack - should never need to grow larger than the main state stack - needs to grow without LAC. */ - if (YYMAXDEPTH < yysize_new) - { - YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix, - yydebug_suffix)); - return 1; - } - if (YYMAXDEPTH < yyalloc) - yyalloc = YYMAXDEPTH; - yybottom_new = - (yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new); - if (!yybottom_new) - { - YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix, - yydebug_suffix)); - return 1; - } - if (*yytop != yytop_empty) - { - YYCOPY (yybottom_new, *yybottom, yysize_old); - *yytop = yybottom_new + (yysize_old - 1); - } - if (*yybottom != yybottom_no_free) - YYSTACK_FREE (*yybottom); - *yybottom = yybottom_new; - *yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]), - [full], [[ - YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix, - (unsigned long int) yyalloc, yydebug_suffix));]])[ - } - return 0; -} - -/* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - YY_LAC_ESTABLISH should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). Iff there is a - lookahead token, it should also be invoked before reporting a syntax - error. This latter case is for the sake of the debugging output. - - For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. - Report a syntax error if it cannot. */ -#define YY_LAC_ESTABLISH \ -do { \ - if (!yy_lac_established) \ - { \ - YYDPRINTF ((stderr, \ - "LAC: initial context established for %s\n", \ - yytname[yytoken])); \ - yy_lac_established = 1; \ - { \ - int yy_lac_status = \ - yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \ - if (yy_lac_status == 2) \ - goto yyexhaustedlab; \ - if (yy_lac_status == 1) \ - goto yyerrlab; \ - } \ - } \ -} while (YYID (0)) - -/* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ -#if ]b4_api_PREFIX[DEBUG -# define YY_LAC_DISCARD(Event) \ -do { \ - if (yy_lac_established) \ - { \ - if (yydebug) \ - YYFPRINTF (stderr, "LAC: initial context discarded due to " \ - Event "\n"); \ - yy_lac_established = 0; \ - } \ -} while (YYID (0)) -#else -# define YY_LAC_DISCARD(Event) yy_lac_established = 0 -#endif - -/* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can - eventually (after perhaps some reductions) be shifted, return 1 if - not, or return 2 if memory is exhausted. As preconditions and - postconditions: *YYES_CAPACITY is the allocated size of the array to - which *YYES points, and either *YYES = YYESA or *YYES points to an - array allocated with YYSTACK_ALLOC. yy_lac may overwrite the - contents of either array, alter *YYES and *YYES_CAPACITY, and free - any old *YYES other than YYESA. */ -static int -yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, - YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) -{ - yytype_int16 *yyes_prev = yyssp; - yytype_int16 *yyesp = yyes_prev; - YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken])); - if (yytoken == YYUNDEFTOK) - { - YYDPRINTF ((stderr, " Always Err\n")); - return 1; - } - while (1) - { - int yyrule = yypact[*yyesp]; - if (yypact_value_is_default (yyrule) - || (yyrule += yytoken) < 0 || YYLAST < yyrule - || yycheck[yyrule] != yytoken) - { - yyrule = yydefact[*yyesp]; - if (yyrule == 0) - { - YYDPRINTF ((stderr, " Err\n")); - return 1; - } - } - else - { - yyrule = yytable[yyrule]; - if (yytable_value_is_error (yyrule)) - { - YYDPRINTF ((stderr, " Err\n")); - return 1; - } - if (0 < yyrule) - { - YYDPRINTF ((stderr, " S%d\n", yyrule)); - return 0; - } - yyrule = -yyrule; - } - { - YYSIZE_T yylen = yyr2[yyrule]; - YYDPRINTF ((stderr, " R%d", yyrule - 1)); - if (yyesp != yyes_prev) - { - YYSIZE_T yysize = yyesp - *yyes + 1; - if (yylen < yysize) - { - yyesp -= yylen; - yylen = 0; - } - else - { - yylen -= yysize; - yyesp = yyes_prev; - } - } - if (yylen) - yyesp = yyes_prev -= yylen; - } - { - int yystate; - { - int yylhs = yyr1[yyrule] - YYNTOKENS; - yystate = yypgoto[yylhs] + *yyesp; - if (yystate < 0 || YYLAST < yystate - || yycheck[yystate] != *yyesp) - yystate = yydefgoto[yylhs]; - else - yystate = yytable[yystate]; - } - if (yyesp == yyes_prev) - { - yyesp = *yyes; - *yyesp = yystate; - } - else - { - if (yy_lac_stack_realloc (yyes_capacity, 1, -#if ]b4_api_PREFIX[DEBUG - " (", ")", -#endif - yyes, yyesa, &yyesp, yyes_prev)) - { - YYDPRINTF ((stderr, "\n")); - return 2; - } - *++yyesp = yystate; - } - YYDPRINTF ((stderr, " G%d", yystate)); - } - } -}]])[ - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -]b4_c_function_def([yystrlen], [static YYSIZE_T], - [[const char *yystr], [yystr]])[ -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -]b4_c_function_def([yystpcpy], [static char *], - [[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[ -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP.]b4_lac_if([[ In order to see if a particular token T is a - valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).]])[ - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store]b4_lac_if([[ or if - yy_lac returned 2]])[. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - ]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes, - YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar.]b4_lac_if([[ - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when yy_lac - was invoked. However, at that time, there might have been a - different syntax error that discarded a different initial context - during error recovery, leaving behind the current lookahead.]], [[ - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state.]])[ - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp];]b4_lac_if([[ - YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[ - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - {]b4_lac_if([], [[ - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;]])[ - int yyx;]b4_lac_if([[ - - for (yyx = 0; yyx < YYNTOKENS; ++yyx) - if (yyx != YYTERROR && yyx != YYUNDEFTOK) - { - { - int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity, - yyssp, yyx); - if (yy_lac_status == 2) - return 2; - if (yy_lac_status == 1) - continue; - }]], [[ - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - {]])[ - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - }]b4_lac_if([[ -# if ]b4_api_PREFIX[DEBUG - else if (yydebug) - YYFPRINTF (stderr, "No expected tokens.\n"); -# endif]])[ - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -]b4_yydestruct_generate([b4_c_function_def])[ - -]b4_pure_if([], [ - -b4_declare_scanner_communication_variables])[]b4_push_if([[ - -struct yypstate - {]b4_declare_parser_state_variables[ - /* Used to determine if this is the first time this instance has - been used. */ - int yynew; - };]b4_pure_if([], [[ - -static char yypstate_allocated = 0;]])b4_pull_if([ - -b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[ -{ - return yypull_parse (YY_NULL]m4_ifset([b4_parse_param], - [[, ]b4_c_args(b4_parse_param)])[); -} - -]b4_c_function_def([[yypull_parse]], [[int]], - [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [, - b4_parse_param]))[ -{ - int yystatus; - yypstate *yyps_local;]b4_pure_if([[ - int yychar; - YYSTYPE yylval;]b4_locations_if([[ - static YYLTYPE yyloc_default][]b4_yyloc_default[; - YYLTYPE yylloc = yyloc_default;]])])[ - if (yyps) - yyps_local = yyps; - else - { - yyps_local = yypstate_new (); - if (!yyps_local) - {]b4_pure_if([[ - yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[ - if (!yypstate_allocated) - yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[ - return 2; - } - } - do { - yychar = YYLEX; - yystatus = - yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])[); - } while (yystatus == YYPUSH_MORE); - if (!yyps) - yypstate_delete (yyps_local); - return yystatus; -}]])[ - -/* Initialize the parser data structure. */ -]b4_c_function_def([[yypstate_new]], [[yypstate *]])[ -{ - yypstate *yyps;]b4_pure_if([], [[ - if (yypstate_allocated) - return YY_NULL;]])[ - yyps = (yypstate *) malloc (sizeof *yyps); - if (!yyps) - return YY_NULL; - yyps->yynew = 1;]b4_pure_if([], [[ - yypstate_allocated = 1;]])[ - return yyps; -} - -]b4_c_function_def([[yypstate_delete]], [[void]], - [[[yypstate *yyps]], [[yyps]]])[ -{ -#ifndef yyoverflow - /* If the stack was reallocated but the parse did not complete, then the - stack still needs to be freed. */ - if (!yyps->yynew && yyps->yyss != yyps->yyssa) - YYSTACK_FREE (yyps->yyss); -#endif]b4_lac_if([[ - if (!yyps->yynew && yyps->yyes != yyps->yyesa) - YYSTACK_FREE (yyps->yyes);]])[ - free (yyps);]b4_pure_if([], [[ - yypstate_allocated = 0;]])[ -} -]b4_pure_if([[ -#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[ -#define yystate yyps->yystate -#define yyerrstatus yyps->yyerrstatus -#define yyssa yyps->yyssa -#define yyss yyps->yyss -#define yyssp yyps->yyssp -#define yyvsa yyps->yyvsa -#define yyvs yyps->yyvs -#define yyvsp yyps->yyvsp]b4_locations_if([[ -#define yylsa yyps->yylsa -#define yyls yyps->yyls -#define yylsp yyps->yylsp -#define yyerror_range yyps->yyerror_range]])[ -#define yystacksize yyps->yystacksize]b4_lac_if([[ -#define yyesa yyps->yyesa -#define yyes yyps->yyes -#define yyes_capacity yyps->yyes_capacity]])[ - - -/*---------------. -| yypush_parse. | -`---------------*/ - -]b4_c_function_def([[yypush_parse]], [[int]], - [[[yypstate *yyps]], [[yyps]]]b4_pure_if([, - [[[int yypushed_char]], [[yypushed_char]]], - [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([, - [[[YYLTYPE *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [, - b4_parse_param]))], [[ - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -]b4_c_function_def([yyparse], [int], - [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[ -#else /* ! YYPARSE_PARAM */ -]b4_c_function_def([yyparse], [int], b4_parse_param)[ -#endif]])[ -{]b4_pure_if([b4_declare_scanner_communication_variables -])b4_push_if([b4_pure_if([], [[ - int yypushed_char = yychar; - YYSTYPE yypushed_val = yylval;]b4_locations_if([[ - YYLTYPE yypushed_loc = yylloc;]]) -])], - [b4_declare_parser_state_variables -])b4_lac_if([[ - int yy_lac_established = 0;]])[ - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval;]b4_locations_if([[ - YYLTYPE yyloc;]])[ - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0;]b4_push_if([[ - - if (!yyps->yynew) - { - yyn = yypact[yystate]; - goto yyread_pushed_token; - }]])[ - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa;]b4_locations_if([[ - yylsp = yyls = yylsa;]])[ - yystacksize = YYINITDEPTH;]b4_lac_if([[ - - yyes = yyesa; - yyes_capacity = sizeof yyesa / sizeof *yyes; - if (YYMAXDEPTH < yyes_capacity) - yyes_capacity = YYMAXDEPTH;]])[ - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ -]m4_ifdef([b4_initial_action], [ -b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [], - [b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl -/* User initialization code. */ -b4_user_initial_action -b4_dollar_popdef[]dnl -m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval; -]])])dnl -b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])[; -]])dnl -[ goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss;]b4_locations_if([ - YYLTYPE *yyls1 = yyls;])[ - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([ - &yyls1, yysize * sizeof (*yylsp),])[ - &yystacksize); -]b4_locations_if([ - yyls = yyls1;])[ - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([ - YYSTACK_RELOCATE (yyls_alloc, yyls);])[ -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1;]b4_locations_if([ - yylsp = yyls + yysize - 1;])[ - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - {]b4_push_if([[ - if (!yyps->yynew) - {]b4_use_push_for_pull_if([], [[ - YYDPRINTF ((stderr, "Return for a new token:\n"));]])[ - yyresult = YYPUSH_MORE; - goto yypushreturn; - } - yyps->yynew = 0;]b4_pure_if([], [[ - /* Restoring the pushed token is only necessary for the first - yypush_parse invocation since subsequent invocations don't overwrite - it before jumping to yyread_pushed_token. */ - yychar = yypushed_char; - yylval = yypushed_val;]b4_locations_if([[ - yylloc = yypushed_loc;]])])[ -yyread_pushed_token:]])[ - YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[ - yychar = yypushed_char; - if (yypushed_val) - yylval = *yypushed_val;]b4_locations_if([[ - if (yypushed_loc) - yylloc = *yypushed_loc;]])])], [[ - yychar = YYLEX;]])[ - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)]b4_lac_if([[ - { - YY_LAC_ESTABLISH; - goto yydefault; - }]], [[ - goto yydefault;]])[ - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab;]b4_lac_if([[ - YY_LAC_ESTABLISH;]])[ - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY;]b4_lac_if([[ - YY_LAC_DISCARD ("shift");]])[ - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END -]b4_locations_if([ *++yylsp = yylloc;])[ - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - -]b4_locations_if( -[[ /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[ - YY_REDUCE_PRINT (yyn);]b4_lac_if([[ - { - int yychar_backup = yychar; - switch (yyn) - { - ]b4_user_actions[ - default: break; - } - if (yychar_backup != yychar) - YY_LAC_DISCARD ("yychar change"); - }]], [[ - switch (yyn) - { - ]b4_user_actions[ - default: break; - }]])[ - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval;]b4_locations_if([ - *++yylsp = yyloc;])[ - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (]b4_yyerror_args[YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \]b4_lac_if([[ - yyesa, &yyes, &yyes_capacity, \]])[ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status;]b4_lac_if([[ - if (yychar != YYEMPTY) - YY_LAC_ESTABLISH;]])[ - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (]b4_yyerror_args[yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - -]b4_locations_if([[ yyerror_range[1] = yylloc;]])[ - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - -]b4_locations_if([[ yyerror_range[1] = yylsp[1-yylen]; -]])[ /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - -]b4_locations_if([[ yyerror_range[1] = *yylsp;]])[ - yydestruct ("Error: popping", - yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - }]b4_lac_if([[ - - /* If the stack popping above didn't lose the initial context for the - current lookahead token, the shift below will for sure. */ - YY_LAC_DISCARD ("error recovery");]])[ - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END -]b4_locations_if([[ - yyerror_range[2] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - *++yylsp = yyloc;]])[ - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[ -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (]b4_yyerror_args[YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif]b4_lac_if([[ - if (yyes != yyesa) - YYSTACK_FREE (yyes);]])b4_push_if([[ - yyps->yynew = 1; - -yypushreturn:]])[ -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -]b4_epilogue[]dnl -b4_output_end() - -b4_defines_if( -[b4_output_begin([b4_spec_defines_file])[ -]b4_copyright([Bison interface for Yacc-like parsers in C], - [1984, 1989-1990, 2000-2012])[ - -]b4_shared_declarations[ -]b4_output_end() -])