diff --git a/CMakeLists.txt b/CMakeLists.txt index c5f9970cf..d32c13b28 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1297,9 +1297,7 @@ set(LOVE_SRC_3P_GLSLANG_GLSLANG_MACHINEINDEPENDENT_PREPROCESSOR src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h - src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp - src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h ) diff --git a/platform/xcode/liblove.xcodeproj/project.pbxproj b/platform/xcode/liblove.xcodeproj/project.pbxproj index 1d94be244..772b2ab21 100644 --- a/platform/xcode/liblove.xcodeproj/project.pbxproj +++ b/platform/xcode/liblove.xcodeproj/project.pbxproj @@ -1095,12 +1095,8 @@ FAF1408E1E20934C00F898D2 /* PpContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FED1E20934C00F898D2 /* PpContext.cpp */; }; FAF1408F1E20934C00F898D2 /* PpContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FED1E20934C00F898D2 /* PpContext.cpp */; }; FAF140901E20934C00F898D2 /* PpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FEE1E20934C00F898D2 /* PpContext.h */; }; - FAF140911E20934C00F898D2 /* PpMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FEF1E20934C00F898D2 /* PpMemory.cpp */; }; - FAF140921E20934C00F898D2 /* PpMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FEF1E20934C00F898D2 /* PpMemory.cpp */; }; FAF140931E20934C00F898D2 /* PpScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF01E20934C00F898D2 /* PpScanner.cpp */; }; FAF140941E20934C00F898D2 /* PpScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF01E20934C00F898D2 /* PpScanner.cpp */; }; - FAF140951E20934C00F898D2 /* PpSymbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF11E20934C00F898D2 /* PpSymbols.cpp */; }; - FAF140961E20934C00F898D2 /* PpSymbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF11E20934C00F898D2 /* PpSymbols.cpp */; }; FAF140971E20934C00F898D2 /* PpTokens.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF21E20934C00F898D2 /* PpTokens.cpp */; }; FAF140981E20934C00F898D2 /* PpTokens.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FF21E20934C00F898D2 /* PpTokens.cpp */; }; FAF140991E20934C00F898D2 /* PpTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FF31E20934C00F898D2 /* PpTokens.h */; }; @@ -1914,9 +1910,7 @@ FAF13FEC1E20934C00F898D2 /* PpAtom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpAtom.cpp; sourceTree = ""; }; FAF13FED1E20934C00F898D2 /* PpContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpContext.cpp; sourceTree = ""; }; FAF13FEE1E20934C00F898D2 /* PpContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PpContext.h; sourceTree = ""; }; - FAF13FEF1E20934C00F898D2 /* PpMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpMemory.cpp; sourceTree = ""; }; FAF13FF01E20934C00F898D2 /* PpScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpScanner.cpp; sourceTree = ""; }; - FAF13FF11E20934C00F898D2 /* PpSymbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpSymbols.cpp; sourceTree = ""; }; FAF13FF21E20934C00F898D2 /* PpTokens.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PpTokens.cpp; sourceTree = ""; }; FAF13FF31E20934C00F898D2 /* PpTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PpTokens.h; sourceTree = ""; }; FAF13FF41E20934C00F898D2 /* propagateNoContraction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = propagateNoContraction.cpp; sourceTree = ""; }; @@ -3471,9 +3465,7 @@ FAF13FEC1E20934C00F898D2 /* PpAtom.cpp */, FAF13FED1E20934C00F898D2 /* PpContext.cpp */, FAF13FEE1E20934C00F898D2 /* PpContext.h */, - FAF13FEF1E20934C00F898D2 /* PpMemory.cpp */, FAF13FF01E20934C00F898D2 /* PpScanner.cpp */, - FAF13FF11E20934C00F898D2 /* PpSymbols.cpp */, FAF13FF21E20934C00F898D2 /* PpTokens.cpp */, FAF13FF31E20934C00F898D2 /* PpTokens.h */, ); @@ -4079,7 +4071,6 @@ FAF140AA1E20934C00F898D2 /* SymbolTable.cpp in Sources */, FA0B7A8D1A958EA3000E1D17 /* b2DistanceJoint.cpp in Sources */, FA0B7A841A958EA3000E1D17 /* b2EdgeAndPolygonContact.cpp in Sources */, - FAF140921E20934C00F898D2 /* PpMemory.cpp in Sources */, FA0B7E191A95902C000E1D17 /* MotorJoint.cpp in Sources */, FAF1406F1E20934C00F898D2 /* Initialize.cpp in Sources */, FA0B7E4F1A95902C000E1D17 /* wrap_Fixture.cpp in Sources */, @@ -4256,7 +4247,6 @@ FA0B7CE31A95902C000E1D17 /* wrap_Audio.cpp in Sources */, FA0B7B381A958EA3000E1D17 /* wuff_internal.c in Sources */, FA0B7DF81A95902C000E1D17 /* Body.cpp in Sources */, - FAF140961E20934C00F898D2 /* PpSymbols.cpp in Sources */, FA4F2BB41DE1E4BD00CA37D7 /* RecordingDevice.cpp in Sources */, FA0B7DF51A95902C000E1D17 /* wrap_Mouse.cpp in Sources */, FA0B7E861A95902C000E1D17 /* CoreAudioDecoder.cpp in Sources */, @@ -4440,7 +4430,6 @@ FAF140A91E20934C00F898D2 /* SymbolTable.cpp in Sources */, FA0B7E181A95902C000E1D17 /* MotorJoint.cpp in Sources */, FA0B7E4E1A95902C000E1D17 /* wrap_Fixture.cpp in Sources */, - FAF140911E20934C00F898D2 /* PpMemory.cpp in Sources */, FA0B7EBE1A95902C000E1D17 /* Thread.cpp in Sources */, FAF1406E1E20934C00F898D2 /* Initialize.cpp in Sources */, FA0B7EB81A95902C000E1D17 /* Channel.cpp in Sources */, @@ -4617,7 +4606,6 @@ FA0B7DF41A95902C000E1D17 /* wrap_Mouse.cpp in Sources */, FA0B7E851A95902C000E1D17 /* CoreAudioDecoder.cpp in Sources */, FA0B7E751A95902C000E1D17 /* wrap_WeldJoint.cpp in Sources */, - FAF140951E20934C00F898D2 /* PpSymbols.cpp in Sources */, FA0B7D551A95902C000E1D17 /* Buffer.cpp in Sources */, FA57FB981AE1993600F2AD6D /* noise1234.cpp in Sources */, FA0B7E211A95902C000E1D17 /* PolygonShape.cpp in Sources */, diff --git a/src/libraries/glslang/glslang/Include/BaseTypes.h b/src/libraries/glslang/glslang/Include/BaseTypes.h index f0e3c3781..46392d050 100755 --- a/src/libraries/glslang/glslang/Include/BaseTypes.h +++ b/src/libraries/glslang/glslang/Include/BaseTypes.h @@ -53,6 +53,10 @@ enum TBasicType { EbtUint, EbtInt64, EbtUint64, +#ifdef AMD_EXTENSIONS + EbtInt16, + EbtUint16, +#endif EbtBool, EbtAtomicUint, EbtSampler, @@ -203,6 +207,9 @@ enum TBuiltInVariable { EbvBaryCoordPullModel, #endif + EbvViewIndex, + EbvDeviceIndex, + #ifdef NV_EXTENSIONS EbvViewportMaskNV, EbvSecondaryPositionNV, @@ -210,10 +217,22 @@ enum TBuiltInVariable { EbvPositionPerViewNV, EbvViewportMaskPerViewNV, #endif + // HLSL built-ins that live only temporarily, until they get remapped // to one of the above. EbvFragDepthGreater, EbvFragDepthLesser, + EbvStencilRef, + EbvGsOutputStream, + EbvOutputPatch, + EbvInputPatch, + + // structbuffer types + EbvAppendConsume, // no need to differentiate append and consume + EbvRWStructuredBuffer, + EbvStructuredBuffer, + EbvByteAddressBuffer, + EbvRWByteAddressBuffer, EbvLast }; @@ -323,6 +342,10 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample"; case EbvBaryCoordPullModel: return "BaryCoordPullModel"; #endif + + case EbvViewIndex: return "ViewIndex"; + case EbvDeviceIndex: return "DeviceIndex"; + #ifdef NV_EXTENSIONS case EbvViewportMaskNV: return "ViewportMaskNV"; case EbvSecondaryPositionNV: return "SecondaryPositionNV"; diff --git a/src/libraries/glslang/glslang/Include/Types.h b/src/libraries/glslang/glslang/Include/Types.h index 4a14843dc..16d893208 100755 --- a/src/libraries/glslang/glslang/Include/Types.h +++ b/src/libraries/glslang/glslang/Include/Types.h @@ -43,6 +43,8 @@ #include "../Public/ShaderLang.h" #include "arrays.h" +#include + namespace glslang { const int GlslangMaxTypeLength = 200; // TODO: need to print block/struct one member per line, so this can stay bounded @@ -396,11 +398,13 @@ public: invariant = false; noContraction = false; makeTemporary(); + declaredBuiltIn = EbvNone; } // drop qualifiers that don't belong in a temporary variable void makeTemporary() { + semanticName = nullptr; storage = EvqTemporary; builtIn = EbvNone; clearInterstage(); @@ -449,8 +453,10 @@ public: specConstant = false; } + const char* semanticName; TStorageQualifier storage : 6; TBuiltInVariable builtIn : 8; + TBuiltInVariable declaredBuiltIn : 8; TPrecisionQualifier precision : 3; bool invariant : 1; // require canonical treatment for cross-shader invariance bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects @@ -1302,6 +1308,7 @@ public: virtual TBasicType getBasicType() const { return basicType; } virtual const TSampler& getSampler() const { return sampler; } + virtual TSampler& getSampler() { return sampler; } virtual TQualifier& getQualifier() { return qualifier; } virtual const TQualifier& getQualifier() const { return qualifier; } @@ -1378,127 +1385,84 @@ public: return !isPerVertexAndBuiltIn(language); } + // return true if this type contains any subtype which satisfies the given predicate. + template + bool contains(P predicate) const + { + if (predicate(this)) + return true; + + const auto hasa = [predicate](const TTypeLoc& tl) { return tl.type->contains(predicate); }; + + return structure && std::any_of(structure->begin(), structure->end(), hasa); + } + // Recursively checks if the type contains the given basic type virtual bool containsBasicType(TBasicType checkType) const { - if (basicType == checkType) - return true; - if (! structure) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsBasicType(checkType)) - return true; - } - return false; + return contains([checkType](const TType* t) { return t->basicType == checkType; } ); } // Recursively check the structure for any arrays, needed for some error checks virtual bool containsArray() const { - if (isArray()) - return true; - if (structure == nullptr) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsArray()) - return true; - } - return false; + return contains([](const TType* t) { return t->isArray(); } ); } // Check the structure for any structures, needed for some error checks virtual bool containsStructure() const { - if (structure == nullptr) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->structure) - return true; - } - return false; + return contains([this](const TType* t) { return t != this && t->isStruct(); } ); } // Recursively check the structure for any implicitly-sized arrays, needed for triggering a copyUp(). virtual bool containsImplicitlySizedArray() const { - if (isImplicitlySizedArray()) - return true; - if (structure == nullptr) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsImplicitlySizedArray()) - return true; - } - return false; + return contains([](const TType* t) { return t->isImplicitlySizedArray(); } ); } virtual bool containsOpaque() const { - if (isOpaque()) - return true; - if (! structure) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsOpaque()) - return true; - } - return false; + return contains([](const TType* t) { return t->isOpaque(); } ); } // Recursively checks if the type contains an interstage IO builtin virtual bool containsBuiltInInterstageIO(EShLanguage language) const { - if (isBuiltInInterstageIO(language)) - return true; - - if (! structure) - return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsBuiltInInterstageIO(language)) - return true; - } - return false; + return contains([language](const TType* t) { return t->isBuiltInInterstageIO(language); } ); } virtual bool containsNonOpaque() const { - // list all non-opaque types - switch (basicType) { - case EbtVoid: - case EbtFloat: - case EbtDouble: + const auto nonOpaque = [](const TType* t) { + switch (t->basicType) { + case EbtVoid: + case EbtFloat: + case EbtDouble: #ifdef AMD_EXTENSIONS - case EbtFloat16: + case EbtFloat16: #endif - case EbtInt: - case EbtUint: - case EbtInt64: - case EbtUint64: - case EbtBool: + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif + case EbtBool: return true; - default: - break; - } - if (! structure) + default: return false; - for (unsigned int i = 0; i < structure->size(); ++i) { - if ((*structure)[i].type->containsNonOpaque()) - return true; - } - return false; + } + }; + + return contains(nonOpaque); } 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; + return contains([](const TType* t) { return t->isArray() && t->arraySizes->isOuterSpecialization(); } ); } // Array editing methods. Array descriptors can be shared across @@ -1569,6 +1533,10 @@ public: case EbtUint: return "uint"; case EbtInt64: return "int64_t"; case EbtUint64: return "uint64_t"; +#ifdef AMD_EXTENSIONS + case EbtInt16: return "int16_t"; + case EbtUint16: return "uint16_t"; +#endif case EbtBool: return "bool"; case EbtAtomicUint: return "atomic_uint"; case EbtSampler: return "sampler/image"; @@ -1580,10 +1548,11 @@ public: TString getCompleteString() const { - const int maxSize = GlslangMaxTypeLength; - char buf[maxSize]; - char* p = &buf[0]; - char* end = &buf[maxSize]; + TString typeString; + + const auto appendStr = [&](const char* s) { typeString.append(s); }; + const auto appendUint = [&](unsigned int u) { typeString.append(std::to_string(u).c_str()); }; + const auto appendInt = [&](int i) { typeString.append(std::to_string(i).c_str()); }; if (qualifier.hasLayout()) { // To reduce noise, skip this if the only layout is an xfb_buffer @@ -1591,137 +1560,175 @@ public: TQualifier noXfbBuffer = qualifier; noXfbBuffer.layoutXfbBuffer = TQualifier::layoutXfbBufferEnd; if (noXfbBuffer.hasLayout()) { - p += snprintf(p, end - p, "layout("); + appendStr("layout("); if (qualifier.hasAnyLocation()) { - p += snprintf(p, end - p, "location=%d ", qualifier.layoutLocation); - if (qualifier.hasComponent()) - p += snprintf(p, end - p, "component=%d ", qualifier.layoutComponent); - if (qualifier.hasIndex()) - p += snprintf(p, end - p, "index=%d ", qualifier.layoutIndex); + appendStr(" location="); + appendUint(qualifier.layoutLocation); + if (qualifier.hasComponent()) { + appendStr(" component="); + appendUint(qualifier.layoutComponent); + } + if (qualifier.hasIndex()) { + appendStr(" index="); + appendUint(qualifier.layoutIndex); + } + } + if (qualifier.hasSet()) { + appendStr(" set="); + appendUint(qualifier.layoutSet); + } + if (qualifier.hasBinding()) { + appendStr(" binding="); + appendUint(qualifier.layoutBinding); + } + if (qualifier.hasStream()) { + appendStr(" stream="); + appendUint(qualifier.layoutStream); + } + if (qualifier.hasMatrix()) { + appendStr(" "); + appendStr(TQualifier::getLayoutMatrixString(qualifier.layoutMatrix)); + } + if (qualifier.hasPacking()) { + appendStr(" "); + appendStr(TQualifier::getLayoutPackingString(qualifier.layoutPacking)); + } + if (qualifier.hasOffset()) { + appendStr(" offset="); + appendInt(qualifier.layoutOffset); + } + if (qualifier.hasAlign()) { + appendStr(" align="); + appendInt(qualifier.layoutAlign); + } + if (qualifier.hasFormat()) { + appendStr(" "); + appendStr(TQualifier::getLayoutFormatString(qualifier.layoutFormat)); + } + if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) { + appendStr(" xfb_buffer="); + appendUint(qualifier.layoutXfbBuffer); + } + if (qualifier.hasXfbOffset()) { + appendStr(" xfb_offset="); + appendUint(qualifier.layoutXfbOffset); + } + if (qualifier.hasXfbStride()) { + appendStr(" xfb_stride="); + appendUint(qualifier.layoutXfbStride); + } + if (qualifier.hasAttachment()) { + appendStr(" input_attachment_index="); + appendUint(qualifier.layoutAttachment); + } + if (qualifier.hasSpecConstantId()) { + appendStr(" constant_id="); + appendUint(qualifier.layoutSpecConstantId); } - if (qualifier.hasSet()) - p += snprintf(p, end - p, "set=%d ", qualifier.layoutSet); - if (qualifier.hasBinding()) - p += snprintf(p, end - p, "binding=%d ", qualifier.layoutBinding); - if (qualifier.hasStream()) - p += snprintf(p, end - p, "stream=%d ", qualifier.layoutStream); - if (qualifier.hasMatrix()) - p += snprintf(p, end - p, "%s ", TQualifier::getLayoutMatrixString(qualifier.layoutMatrix)); - if (qualifier.hasPacking()) - p += snprintf(p, end - p, "%s ", TQualifier::getLayoutPackingString(qualifier.layoutPacking)); - if (qualifier.hasOffset()) - p += snprintf(p, end - p, "offset=%d ", qualifier.layoutOffset); - if (qualifier.hasAlign()) - p += snprintf(p, end - p, "align=%d ", qualifier.layoutAlign); - if (qualifier.hasFormat()) - p += snprintf(p, end - p, "%s ", TQualifier::getLayoutFormatString(qualifier.layoutFormat)); - if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) - p += snprintf(p, end - p, "xfb_buffer=%d ", qualifier.layoutXfbBuffer); - if (qualifier.hasXfbOffset()) - 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 "); + appendStr(" push_constant"); #ifdef NV_EXTENSIONS if (qualifier.layoutPassthrough) - p += snprintf(p, end - p, "passthrough "); + appendStr(" passthrough"); if (qualifier.layoutViewportRelative) - p += snprintf(p, end - p, "layoutViewportRelative "); - if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) - p += snprintf(p, end - p, "layoutSecondaryViewportRelativeOffset=%d ", qualifier.layoutSecondaryViewportRelativeOffset); + appendStr(" layoutViewportRelative"); + if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) { + appendStr(" layoutSecondaryViewportRelativeOffset="); + appendInt(qualifier.layoutSecondaryViewportRelativeOffset); + } #endif - p += snprintf(p, end - p, ") "); + appendStr(")"); } } if (qualifier.invariant) - p += snprintf(p, end - p, "invariant "); + appendStr(" invariant"); if (qualifier.noContraction) - p += snprintf(p, end - p, "noContraction "); + appendStr(" noContraction"); if (qualifier.centroid) - p += snprintf(p, end - p, "centroid "); + appendStr(" centroid"); if (qualifier.smooth) - p += snprintf(p, end - p, "smooth "); + appendStr(" smooth"); if (qualifier.flat) - p += snprintf(p, end - p, "flat "); + appendStr(" flat"); if (qualifier.nopersp) - p += snprintf(p, end - p, "noperspective "); + appendStr(" noperspective"); #ifdef AMD_EXTENSIONS if (qualifier.explicitInterp) - p += snprintf(p, end - p, "__explicitInterpAMD "); + appendStr(" __explicitInterpAMD"); #endif if (qualifier.patch) - p += snprintf(p, end - p, "patch "); + appendStr(" patch"); if (qualifier.sample) - p += snprintf(p, end - p, "sample "); + appendStr(" sample"); if (qualifier.coherent) - p += snprintf(p, end - p, "coherent "); + appendStr(" coherent"); if (qualifier.volatil) - p += snprintf(p, end - p, "volatile "); + appendStr(" volatile"); if (qualifier.restrict) - p += snprintf(p, end - p, "restrict "); + appendStr(" restrict"); if (qualifier.readonly) - p += snprintf(p, end - p, "readonly "); + appendStr(" readonly"); if (qualifier.writeonly) - p += snprintf(p, end - p, "writeonly "); + appendStr(" writeonly"); if (qualifier.specConstant) - p += snprintf(p, end - p, "specialization-constant "); - p += snprintf(p, end - p, "%s ", getStorageQualifierString()); + appendStr(" specialization-constant"); + appendStr(" "); + appendStr(getStorageQualifierString()); if (isArray()) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { int size = arraySizes->getDimSize(i); if (size == 0) - p += snprintf(p, end - p, "implicitly-sized array of "); - else - p += snprintf(p, end - p, "%d-element array of ", arraySizes->getDimSize(i)); + appendStr(" implicitly-sized array of"); + else { + appendStr(" "); + appendInt(arraySizes->getDimSize(i)); + appendStr("-element array of"); + } } } - if (qualifier.precision != EpqNone) - p += snprintf(p, end - p, "%s ", getPrecisionQualifierString()); - if (isMatrix()) - p += snprintf(p, end - p, "%dX%d matrix of ", matrixCols, matrixRows); - else if (isVector()) - p += snprintf(p, end - p, "%d-component vector of ", vectorSize); + if (qualifier.precision != EpqNone) { + appendStr(" "); + appendStr(getPrecisionQualifierString()); + } + if (isMatrix()) { + appendStr(" "); + appendInt(matrixCols); + appendStr("X"); + appendInt(matrixRows); + appendStr(" matrix of"); + } else if (isVector()) { + appendStr(" "); + appendInt(vectorSize); + appendStr("-component vector of"); + } - *p = 0; - TString s(buf); - s.append(getBasicTypeString()); + appendStr(" "); + typeString.append(getBasicTypeString()); if (qualifier.builtIn != EbvNone) { - s.append(" "); - s.append(getBuiltInVariableString()); + appendStr(" "); + appendStr(getBuiltInVariableString()); } // Add struct/block members if (structure) { - s.append("{"); + appendStr("{"); for (size_t i = 0; i < structure->size(); ++i) { - if (s.size() > 3 * GlslangMaxTypeLength) { - // If we are getting too long, cut it short, - // just need to draw the line somewhere, as there is no limit to - // how large a struct/block type can get. - s.append("..."); - break; - } if (! (*structure)[i].type->hiddenMember()) { - s.append((*structure)[i].type->getCompleteString()); - s.append(" "); - s.append((*structure)[i].type->getFieldName()); + typeString.append((*structure)[i].type->getCompleteString()); + typeString.append(" "); + typeString.append((*structure)[i].type->getFieldName()); if (i < structure->size() - 1) - s.append(", "); + appendStr(", "); } } - s.append("}"); + appendStr("}"); } - return s; + return typeString; } TString getBasicTypeString() const @@ -1759,7 +1766,7 @@ public: } // append this type's mangled name to the passed in 'name' - void appendMangledName(TString& name) + void appendMangledName(TString& name) const { buildMangledName(name); name += ';' ; @@ -1883,7 +1890,7 @@ protected: } - void buildMangledName(TString&); + void buildMangledName(TString&) const; TBasicType basicType : 8; int vectorSize : 4; // 1 means either scalar or 1-component vector; see vector1 to disambiguate. diff --git a/src/libraries/glslang/glslang/Include/arrays.h b/src/libraries/glslang/glslang/Include/arrays.h index b6b5e479d..bc21c6c5e 100755 --- a/src/libraries/glslang/glslang/Include/arrays.h +++ b/src/libraries/glslang/glslang/Include/arrays.h @@ -264,6 +264,20 @@ struct TArraySizes { return false; } + bool isInnerSpecialization() const + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimNode(d) != nullptr) + return true; + } + + return false; + } + bool isOuterSpecialization() + { + return sizes.getDimNode(0) != nullptr; + } + bool isImplicit() const { return getOuterSize() == UnsizedArraySize || isInnerImplicit(); } void addOuterSizes(const TArraySizes& s) { sizes.push_front(s.sizes); } void dereference() { sizes.pop_front(); } @@ -288,18 +302,6 @@ struct TArraySizes { 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/src/libraries/glslang/glslang/Include/intermediate.h b/src/libraries/glslang/glslang/Include/intermediate.h index dc87ba905..98cc5546e 100755 --- a/src/libraries/glslang/glslang/Include/intermediate.h +++ b/src/libraries/glslang/glslang/Include/intermediate.h @@ -141,6 +141,42 @@ enum TOperator { EOpConvFloat16ToDouble, EOpConvFloat16ToInt64, EOpConvFloat16ToUint64, + + EOpConvBoolToInt16, + EOpConvIntToInt16, + EOpConvUintToInt16, + EOpConvFloatToInt16, + EOpConvDoubleToInt16, + EOpConvFloat16ToInt16, + EOpConvInt64ToInt16, + EOpConvUint64ToInt16, + EOpConvUint16ToInt16, + EOpConvInt16ToBool, + EOpConvInt16ToInt, + EOpConvInt16ToUint, + EOpConvInt16ToFloat, + EOpConvInt16ToDouble, + EOpConvInt16ToFloat16, + EOpConvInt16ToInt64, + EOpConvInt16ToUint64, + + EOpConvBoolToUint16, + EOpConvIntToUint16, + EOpConvUintToUint16, + EOpConvFloatToUint16, + EOpConvDoubleToUint16, + EOpConvFloat16ToUint16, + EOpConvInt64ToUint16, + EOpConvUint64ToUint16, + EOpConvInt16ToUint16, + EOpConvUint16ToBool, + EOpConvUint16ToInt, + EOpConvUint16ToUint, + EOpConvUint16ToFloat, + EOpConvUint16ToDouble, + EOpConvUint16ToFloat16, + EOpConvUint16ToInt64, + EOpConvUint16ToUint64, #endif // @@ -183,6 +219,7 @@ enum TOperator { EOpVectorSwizzle, EOpMethod, + EOpScoping, // // Built-in functions mapped to operators @@ -243,6 +280,12 @@ enum TOperator { EOpDoubleBitsToUint64, EOpInt64BitsToDouble, EOpUint64BitsToDouble, +#ifdef AMD_EXTENSIONS + EOpFloat16BitsToInt16, + EOpFloat16BitsToUint16, + EOpInt16BitsToFloat16, + EOpUint16BitsToFloat16, +#endif EOpPackSnorm2x16, EOpUnpackSnorm2x16, EOpPackUnorm2x16, @@ -262,6 +305,14 @@ enum TOperator { #ifdef AMD_EXTENSIONS EOpPackFloat2x16, EOpUnpackFloat2x16, + EOpPackInt2x16, + EOpUnpackInt2x16, + EOpPackUint2x16, + EOpUnpackUint2x16, + EOpPackInt4x16, + EOpUnpackInt4x16, + EOpPackUint4x16, + EOpUnpackUint4x16, #endif EOpLength, @@ -393,15 +444,27 @@ enum TOperator { EOpConstructUint, EOpConstructInt64, EOpConstructUint64, +#ifdef AMD_EXTENSIONS + EOpConstructInt16, + EOpConstructUint16, +#endif EOpConstructBool, EOpConstructFloat, EOpConstructDouble, +#ifdef AMD_EXTENSIONS + EOpConstructFloat16, +#endif EOpConstructVec2, EOpConstructVec3, EOpConstructVec4, EOpConstructDVec2, EOpConstructDVec3, EOpConstructDVec4, +#ifdef AMD_EXTENSIONS + EOpConstructF16Vec2, + EOpConstructF16Vec3, + EOpConstructF16Vec4, +#endif EOpConstructBVec2, EOpConstructBVec3, EOpConstructBVec4, @@ -417,6 +480,14 @@ enum TOperator { EOpConstructU64Vec2, EOpConstructU64Vec3, EOpConstructU64Vec4, +#ifdef AMD_EXTENSIONS + EOpConstructI16Vec2, + EOpConstructI16Vec3, + EOpConstructI16Vec4, + EOpConstructU16Vec2, + EOpConstructU16Vec3, + EOpConstructU16Vec4, +#endif EOpConstructMat2x2, EOpConstructMat2x3, EOpConstructMat2x4, @@ -435,11 +506,34 @@ enum TOperator { EOpConstructDMat4x2, EOpConstructDMat4x3, EOpConstructDMat4x4, + EOpConstructIMat2x2, + EOpConstructIMat2x3, + EOpConstructIMat2x4, + EOpConstructIMat3x2, + EOpConstructIMat3x3, + EOpConstructIMat3x4, + EOpConstructIMat4x2, + EOpConstructIMat4x3, + EOpConstructIMat4x4, + EOpConstructUMat2x2, + EOpConstructUMat2x3, + EOpConstructUMat2x4, + EOpConstructUMat3x2, + EOpConstructUMat3x3, + EOpConstructUMat3x4, + EOpConstructUMat4x2, + EOpConstructUMat4x3, + EOpConstructUMat4x4, + EOpConstructBMat2x2, + EOpConstructBMat2x3, + EOpConstructBMat2x4, + EOpConstructBMat3x2, + EOpConstructBMat3x3, + EOpConstructBMat3x4, + EOpConstructBMat4x2, + EOpConstructBMat4x3, + EOpConstructBMat4x4, #ifdef AMD_EXTENSIONS - EOpConstructFloat16, - EOpConstructF16Vec2, - EOpConstructF16Vec3, - EOpConstructF16Vec4, EOpConstructF16Mat2x2, EOpConstructF16Mat2x3, EOpConstructF16Mat2x4, @@ -539,6 +633,11 @@ enum TOperator { EOpTextureOffsetClamp, EOpTextureGradClamp, EOpTextureGradOffsetClamp, +#ifdef AMD_EXTENSIONS + EOpTextureGatherLod, + EOpTextureGatherLodOffset, + EOpTextureGatherLodOffsets, +#endif EOpSparseTextureGuardBegin, @@ -558,6 +657,11 @@ enum TOperator { EOpSparseTextureOffsetClamp, EOpSparseTextureGradClamp, EOpSparseTextureGradOffsetClamp, +#ifdef AMD_EXTENSIONS + EOpSparseTextureGatherLod, + EOpSparseTextureGatherLodOffset, + EOpSparseTextureGatherLodOffsets, +#endif EOpSparseTextureGuardEnd, EOpSamplingGuardEnd, @@ -624,6 +728,19 @@ enum TOperator { EOpMethodCalculateLevelOfDetail, // ... EOpMethodCalculateLevelOfDetailUnclamped, // ... + // Load already defined above for textures + EOpMethodLoad2, // Structure buffer object methods. These are translated to existing + EOpMethodLoad3, // AST methods, and exist to represent HLSL semantics until that + EOpMethodLoad4, // translation is performed. See HlslParseContext::decomposeSampleMethods(). + EOpMethodStore, // ... + EOpMethodStore2, // ... + EOpMethodStore3, // ... + EOpMethodStore4, // ... + EOpMethodIncrementCounter, // ... + EOpMethodDecrementCounter, // ... + // EOpMethodAppend is defined for geo shaders below + EOpMethodConsume, + // SM5 texture methods EOpMethodGatherRed, // These are covered under the above EOpMethodSample comment about EOpMethodGatherGreen, // translation to existing AST opcodes. They exist temporarily @@ -744,6 +861,15 @@ protected: TType type; }; +// +// Loop control hints +// +enum TLoopControl { + ELoopControlNone, + ELoopControlUnroll, + ELoopControlDontUnroll, +}; + // // Handle for, do-while, and while loops. // @@ -753,17 +879,25 @@ public: body(aBody), test(aTest), terminal(aTerminal), - first(testFirst) { } + first(testFirst), + control(ELoopControlNone) + { } + virtual void traverse(TIntermTraverser*); TIntermNode* getBody() const { return body; } TIntermTyped* getTest() const { return test; } TIntermTyped* getTerminal() const { return terminal; } bool testFirst() const { return first; } + + void setLoopControl(TLoopControl c) { control = c; } + TLoopControl getLoopControl() const { return control; } + protected: TIntermNode* body; // code to loop over TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops TIntermTyped* terminal; // exists for for-loops bool first; // true for while and for, not for do-while + TLoopControl control; // loop control hint }; // @@ -1017,6 +1151,25 @@ public: cracked.gather = true; cracked.offsets = true; break; +#ifdef AMD_EXTENSIONS + case EOpTextureGatherLod: + case EOpSparseTextureGatherLod: + cracked.gather = true; + cracked.lod = true; + break; + case EOpTextureGatherLodOffset: + case EOpSparseTextureGatherLodOffset: + cracked.gather = true; + cracked.offset = true; + cracked.lod = true; + break; + case EOpTextureGatherLodOffsets: + case EOpSparseTextureGatherLodOffsets: + cracked.gather = true; + cracked.offsets = true; + cracked.lod = true; + break; +#endif case EOpSubpassLoad: case EOpSubpassLoadMS: cracked.subpass = true; diff --git a/src/libraries/glslang/glslang/Include/revision.h b/src/libraries/glslang/glslang/Include/revision.h index 50deb6445..218f8b67f 100755 --- a/src/libraries/glslang/glslang/Include/revision.h +++ b/src/libraries/glslang/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 "Overload400-PrecQual.1843" -#define GLSLANG_DATE "18-Feb-2017" +#define GLSLANG_REVISION "Overload400-PrecQual.2000" +#define GLSLANG_DATE "12-Apr-2017" diff --git a/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp b/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp index fff8fd26d..625b8e940 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp @@ -193,7 +193,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right case EbtUint: if (rightUnionArray[i] == 0) { - newConstArray[i].setUConst(0xFFFFFFFF); + newConstArray[i].setUConst(0xFFFFFFFFu); } else newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); break; @@ -213,6 +213,23 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right } else newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); break; +#ifdef AMD_EXTENSIONS + case EbtInt16: + if (rightUnionArray[i] == 0) + newConstArray[i].setIConst(0x7FFF); + else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x8000) + newConstArray[i].setIConst(0x8000); + else + newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); + break; + + case EbtUint16: + if (rightUnionArray[i] == 0) { + newConstArray[i].setUConst(0xFFFFu); + } else + newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); + break; +#endif default: return 0; } @@ -457,10 +474,16 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EbtFloat16: #endif case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; +#ifdef AMD_EXTENSIONS + case EbtInt16: +#endif case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break; +#ifdef AMD_EXTENSIONS + case EbtUint16: +#endif case EbtUint: newConstArray[i].setUConst(static_cast(-static_cast(unionArray[i].getUConst()))); break; case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break; - case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; + case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; default: return 0; } @@ -610,6 +633,14 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpUintBitsToFloat: case EOpDoubleBitsToInt64: case EOpDoubleBitsToUint64: + case EOpInt64BitsToDouble: + case EOpUint64BitsToDouble: +#ifdef AMD_EXTENSIONS + case EOpFloat16BitsToInt16: + case EOpFloat16BitsToUint16: + case EOpInt16BitsToFloat16: + case EOpUint16BitsToFloat16: +#endif default: return 0; @@ -702,6 +733,9 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) #endif children[0]->getAsTyped()->getBasicType() == EbtDouble; bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt || +#ifdef AMD_EXTENSIONS + children[0]->getAsTyped()->getBasicType() == EbtInt16 || +#endif children[0]->getAsTyped()->getBasicType() == EbtInt64; bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 || children[0]->getAsTyped()->getBasicType() == EbtUint64; diff --git a/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp b/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp index 05f698028..dcc935759 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp @@ -103,6 +103,7 @@ TBuiltIns::~TBuiltIns() { } + // // Add all context-independent built-in functions and variables that are present // for the given version and profile. Share common ones across stages, otherwise @@ -2615,6 +2616,157 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + + // GL_AMD_gpu_shader_int16 + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "int16_t abs(int16_t);" + "i16vec2 abs(i16vec2);" + "i16vec3 abs(i16vec3);" + "i16vec4 abs(i16vec4);" + + "int16_t sign(int16_t);" + "i16vec2 sign(i16vec2);" + "i16vec3 sign(i16vec3);" + "i16vec4 sign(i16vec4);" + + "int16_t min(int16_t, int16_t);" + "i16vec2 min(i16vec2, int16_t);" + "i16vec3 min(i16vec3, int16_t);" + "i16vec4 min(i16vec4, int16_t);" + "i16vec2 min(i16vec2, i16vec2);" + "i16vec3 min(i16vec3, i16vec3);" + "i16vec4 min(i16vec4, i16vec4);" + "uint16_t min(uint16_t, uint16_t);" + "u16vec2 min(u16vec2, uint16_t);" + "u16vec3 min(u16vec3, uint16_t);" + "u16vec4 min(u16vec4, uint16_t);" + "u16vec2 min(u16vec2, u16vec2);" + "u16vec3 min(u16vec3, u16vec3);" + "u16vec4 min(u16vec4, u16vec4);" + + "int16_t max(int16_t, int16_t);" + "i16vec2 max(i16vec2, int16_t);" + "i16vec3 max(i16vec3, int16_t);" + "i16vec4 max(i16vec4, int16_t);" + "i16vec2 max(i16vec2, i16vec2);" + "i16vec3 max(i16vec3, i16vec3);" + "i16vec4 max(i16vec4, i16vec4);" + "uint16_t max(uint16_t, uint16_t);" + "u16vec2 max(u16vec2, uint16_t);" + "u16vec3 max(u16vec3, uint16_t);" + "u16vec4 max(u16vec4, uint16_t);" + "u16vec2 max(u16vec2, u16vec2);" + "u16vec3 max(u16vec3, u16vec3);" + "u16vec4 max(u16vec4, u16vec4);" + + "int16_t clamp(int16_t, int16_t, int16_t);" + "i16vec2 clamp(i16vec2, int16_t, int16_t);" + "i16vec3 clamp(i16vec3, int16_t, int16_t);" + "i16vec4 clamp(i16vec4, int16_t, int16_t);" + "i16vec2 clamp(i16vec2, i16vec2, i16vec2);" + "i16vec3 clamp(i16vec3, i16vec3, i16vec3);" + "i16vec4 clamp(i16vec4, i16vec4, i16vec4);" + "uint16_t clamp(uint16_t, uint16_t, uint16_t);" + "u16vec2 clamp(u16vec2, uint16_t, uint16_t);" + "u16vec3 clamp(u16vec3, uint16_t, uint16_t);" + "u16vec4 clamp(u16vec4, uint16_t, uint16_t);" + "u16vec2 clamp(u16vec2, u16vec2, u16vec2);" + "u16vec3 clamp(u16vec3, u16vec3, u16vec3);" + "u16vec4 clamp(u16vec4, u16vec4, u16vec4);" + + "int16_t mix(int16_t, int16_t, bool);" + "i16vec2 mix(i16vec2, i16vec2, bvec2);" + "i16vec3 mix(i16vec3, i16vec3, bvec3);" + "i16vec4 mix(i16vec4, i16vec4, bvec4);" + "uint16_t mix(uint16_t, uint16_t, bool);" + "u16vec2 mix(u16vec2, u16vec2, bvec2);" + "u16vec3 mix(u16vec3, u16vec3, bvec3);" + "u16vec4 mix(u16vec4, u16vec4, bvec4);" + + "float16_t frexp(float16_t, out int16_t);" + "f16vec2 frexp(f16vec2, out i16vec2);" + "f16vec3 frexp(f16vec3, out i16vec3);" + "f16vec4 frexp(f16vec4, out i16vec4);" + + "float16_t ldexp(float16_t, int16_t);" + "f16vec2 ldexp(f16vec2, i16vec2);" + "f16vec3 ldexp(f16vec3, i16vec3);" + "f16vec4 ldexp(f16vec4, i16vec4);" + + "int16_t float16BitsToInt16(float16_t);" + "i16vec2 float16BitsToInt16(f16vec2);" + "i16vec3 float16BitsToInt16(f16vec3);" + "i16vec4 float16BitsToInt16(f16vec4);" + + "uint16_t float16BitsToUint16(float16_t);" + "u16vec2 float16BitsToUint16(f16vec2);" + "u16vec3 float16BitsToUint16(f16vec3);" + "u16vec4 float16BitsToUint16(f16vec4);" + + "float16_t int16BitsToFloat16(int16_t);" + "f16vec2 int16BitsToFloat16(i16vec2);" + "f16vec3 int16BitsToFloat16(i16vec3);" + "f16vec4 int16BitsToFloat16(i16vec4);" + + "float16_t uint16BitsToFloat16(uint16_t);" + "f16vec2 uint16BitsToFloat16(u16vec2);" + "f16vec3 uint16BitsToFloat16(u16vec3);" + "f16vec4 uint16BitsToFloat16(u16vec4);" + + "int packInt2x16(i16vec2);" + "uint packUint2x16(u16vec2);" + "int64_t packInt4x16(i16vec4);" + "uint64_t packUint4x16(u16vec4);" + "i16vec2 unpackInt2x16(int);" + "u16vec2 unpackUint2x16(uint);" + "i16vec4 unpackInt4x16(int64_t);" + "u16vec4 unpackUint4x16(uint64_t);" + + "bvec2 lessThan(i16vec2, i16vec2);" + "bvec3 lessThan(i16vec3, i16vec3);" + "bvec4 lessThan(i16vec4, i16vec4);" + "bvec2 lessThan(u16vec2, u16vec2);" + "bvec3 lessThan(u16vec3, u16vec3);" + "bvec4 lessThan(u16vec4, u16vec4);" + + "bvec2 lessThanEqual(i16vec2, i16vec2);" + "bvec3 lessThanEqual(i16vec3, i16vec3);" + "bvec4 lessThanEqual(i16vec4, i16vec4);" + "bvec2 lessThanEqual(u16vec2, u16vec2);" + "bvec3 lessThanEqual(u16vec3, u16vec3);" + "bvec4 lessThanEqual(u16vec4, u16vec4);" + + "bvec2 greaterThan(i16vec2, i16vec2);" + "bvec3 greaterThan(i16vec3, i16vec3);" + "bvec4 greaterThan(i16vec4, i16vec4);" + "bvec2 greaterThan(u16vec2, u16vec2);" + "bvec3 greaterThan(u16vec3, u16vec3);" + "bvec4 greaterThan(u16vec4, u16vec4);" + + "bvec2 greaterThanEqual(i16vec2, i16vec2);" + "bvec3 greaterThanEqual(i16vec3, i16vec3);" + "bvec4 greaterThanEqual(i16vec4, i16vec4);" + "bvec2 greaterThanEqual(u16vec2, u16vec2);" + "bvec3 greaterThanEqual(u16vec3, u16vec3);" + "bvec4 greaterThanEqual(u16vec4, u16vec4);" + + "bvec2 equal(i16vec2, i16vec2);" + "bvec3 equal(i16vec3, i16vec3);" + "bvec4 equal(i16vec4, i16vec4);" + "bvec2 equal(u16vec2, u16vec2);" + "bvec3 equal(u16vec3, u16vec3);" + "bvec4 equal(u16vec4, u16vec4);" + + "bvec2 notEqual(i16vec2, i16vec2);" + "bvec3 notEqual(i16vec3, i16vec3);" + "bvec4 notEqual(i16vec4, i16vec4);" + "bvec2 notEqual(u16vec2, u16vec2);" + "bvec3 notEqual(u16vec3, u16vec3);" + "bvec4 notEqual(u16vec4, u16vec4);" + + "\n"); + } #endif //============================================================================ @@ -3137,6 +3289,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangCompute].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "\n"); + } + //============================================================================ // // Define the interface to the vertex shader. @@ -3261,11 +3420,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangVertex].append( "out int gl_ViewportIndex;" "out int gl_Layer;" - "out int gl_ViewportMask[];" - "out int gl_SecondaryViewportMaskNV[];" - "out vec4 gl_SecondaryPositionNV;" - "out vec4 gl_PositionPerViewNV[];" - "out int gl_ViewportMaskPerViewNV[];" + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes ); #endif @@ -3302,6 +3461,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangVertex].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + + //============================================================================ // // Define the interface to the geometry shader. @@ -3329,8 +3497,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangGeometry].append( "float gl_CullDistance[];" #ifdef NV_EXTENSIONS - "vec4 gl_SecondaryPositionNV;" - "vec4 gl_PositionPerViewNV[];" + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes #endif ); stageBuiltins[EShLangGeometry].append( @@ -3380,11 +3548,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV #ifdef NV_EXTENSIONS if (version >= 450) stageBuiltins[EShLangGeometry].append( - "out int gl_ViewportMask[];" - "out int gl_SecondaryViewportMaskNV[];" - "out vec4 gl_SecondaryPositionNV;" - "out vec4 gl_PositionPerViewNV[];" - "out int gl_ViewportMaskPerViewNV[];" + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes ); #endif @@ -3410,6 +3578,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ); } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangGeometry].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + //============================================================================ // // Define the interface to the tessellation control shader. @@ -3446,11 +3622,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV #ifdef NV_EXTENSIONS "int gl_ViewportIndex;" "int gl_Layer;" - "int gl_ViewportMask[];" - "vec4 gl_SecondaryPositionNV;" - "int gl_SecondaryViewportMaskNV[];" - "vec4 gl_PositionPerViewNV[];" - "int gl_ViewportMaskPerViewNV[];" + "int gl_ViewportMask[];" // GL_NV_viewport_array2 + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes #endif ); stageBuiltins[EShLangTessControl].append( @@ -3481,6 +3657,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangTessControl].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + //============================================================================ // // Define the interface to the tessellation evaluation shader. @@ -3527,11 +3711,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangTessEvaluation].append( "out int gl_ViewportIndex;" "out int gl_Layer;" - "out int gl_ViewportMask[];" - "out vec4 gl_SecondaryPositionNV;" - "out int gl_SecondaryViewportMaskNV[];" - "out vec4 gl_PositionPerViewNV[];" - "out int gl_ViewportMaskPerViewNV[];" + "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering + "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes + "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes ); #endif @@ -3556,6 +3740,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangTessEvaluation].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + //============================================================================ // // Define the interface to the fragment shader. @@ -3713,6 +3905,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + stageBuiltins[EShLangFragment].append( + "flat in highp int gl_DeviceIndex;" // GL_EXT_device_group + "flat in highp int gl_ViewIndex;" // GL_EXT_multiview + "\n"); + } + // printf("%s\n", commonBuiltins.c_str()); // printf("%s\n", stageBuiltins[EShLangFragment].c_str()); } @@ -3808,6 +4008,17 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c else { addSamplingFunctions(sampler, typeName, version, profile); addGatherFunctions(sampler, typeName, version, profile); + + if (spvVersion.vulkan > 0 && sampler.dim == EsdBuffer && sampler.isCombined()) { + // Vulkan wants a textureBuffer to allow texelFetch() -- + // a sampled image with no sampler. + // So, add sampling functions for both the + // samplerBuffer and textureBuffer types. + sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, + sampler.ms); + TString textureTypeName = sampler.getString(); + addSamplingFunctions(sampler, textureTypeName, version, profile); + } } } } @@ -3831,7 +4042,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c // // Add all the query functions for the given type. // -void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { if (sampler.image && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 430))) return; @@ -3908,7 +4119,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi // // Add all the image access functions for the given type. // -void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { int dims = dimMap[sampler.dim]; // most things with an array add a dimension, except for cubemaps @@ -4001,7 +4212,7 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi // // Add all the subpass access functions for the given type. // -void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, int /*version*/, EProfile /*profile*/) { stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); @@ -4018,7 +4229,7 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*ve // // 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, const TString& typeName, int version, EProfile profile) { // // texturing @@ -4248,7 +4459,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int ve // // 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, const TString& typeName, int version, EProfile profile) { switch (sampler.dim) { case Esd2D: @@ -4303,6 +4514,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers default: break; } + if (sparse) s.append("ARB"); s.append("("); @@ -4342,6 +4554,116 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers } } } + +#ifdef AMD_EXTENSIONS + if (sampler.dim == EsdRect || sampler.shadow) + return; + + if (profile == EEsProfile || version < 450) + return; + + for (int bias = 0; bias < 2; ++bias) { // loop over presence of bias argument + + for (int lod = 0; lod < 2; ++lod) { // loop over presence of lod argument + + if ((lod && bias) || (lod == 0 && bias == 0)) + continue; + + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets + + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + + if (comp == 0 && bias) + continue; + + if (offset > 0 && sampler.dim == EsdCube) + continue; + + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; + + TString s; + + // 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"); + + if (lod) + s.append("Lod"); + + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } + + if (lod) + s.append("AMD"); + else 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]); + + // lod argument + if (lod) + 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"); + + // bias argument + if (bias) + s.append(",float"); + + s.append(");\n"); + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); + } + } + } + } + } +#endif } // @@ -4469,8 +4791,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf "highp vec4 gl_Position;" "highp float gl_PointSize;" #ifdef NV_EXTENSIONS - "highp vec4 gl_SecondaryPositionNV;" - "highp vec4 gl_PositionPerViewNV[];" + "highp vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "highp vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes #endif "} gl_in[gl_MaxPatchVertices];" "\n"); @@ -4659,8 +4981,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append( "float gl_CullDistance[];" #ifdef NV_EXTENSIONS - "vec4 gl_SecondaryPositionNV;" - "vec4 gl_PositionPerViewNV[];" + "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering + "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes #endif ); s.append( @@ -5127,13 +5449,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); //} + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + } + break; case EShLangFragment: SpecialQualifier("gl_FrontFacing", EvqFace, EbvFace, symbolTable); SpecialQualifier("gl_FragCoord", EvqFragCoord, EbvFragCoord, symbolTable); SpecialQualifier("gl_PointCoord", EvqPointCoord, EbvPointCoord, symbolTable); - SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable); + if (spvVersion.spv == 0) + SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable); + else { + TSymbol* symbol = symbolTable.find("gl_FragColor"); + if (symbol) { + symbol->getWritableType().getQualifier().storage = EvqVaryingOut; + symbol->getWritableType().getQualifier().layoutLocation = 0; + } + } SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable); SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable); SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable); @@ -5325,6 +5663,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_BaryCoordSmoothSampleAMD", EbvBaryCoordSmoothSample, symbolTable); BuiltInVariable("gl_BaryCoordPullModelAMD", EbvBaryCoordPullModel, symbolTable); } + + // E_GL_AMD_texture_gather_bias_lod + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("textureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("textureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("textureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); + } #endif symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); @@ -5344,6 +5692,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic); symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); } + + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); break; case EShLangCompute: @@ -5377,6 +5730,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_ARB_compute_shader); symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); + BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); + } + break; default: @@ -5462,6 +5824,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); +#ifdef AMD_EXTENSIONS + symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16); + symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16); + symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16); + symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16); +#endif symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16); symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16); @@ -5485,6 +5853,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); #ifdef AMD_EXTENSIONS + symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16); + symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16); + symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16); + symbolTable.relateToOperator("unpackUint2x16", EOpUnpackUint2x16); + + symbolTable.relateToOperator("packInt4x16", EOpPackInt4x16); + symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16); + symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16); + symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16); + symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16); symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16); #endif @@ -5706,6 +6084,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("cubeFaceIndexAMD", EOpCubeFaceIndex); symbolTable.relateToOperator("cubeFaceCoordAMD", EOpCubeFaceCoord); symbolTable.relateToOperator("timeAMD", EOpTime); + + symbolTable.relateToOperator("textureGatherLodAMD", EOpTextureGatherLod); + symbolTable.relateToOperator("textureGatherLodOffsetAMD", EOpTextureGatherLodOffset); + symbolTable.relateToOperator("textureGatherLodOffsetsAMD", EOpTextureGatherLodOffsets); + symbolTable.relateToOperator("sparseTextureGatherLodAMD", EOpSparseTextureGatherLod); + symbolTable.relateToOperator("sparseTextureGatherLodOffsetAMD", EOpSparseTextureGatherLodOffset); + symbolTable.relateToOperator("sparseTextureGatherLodOffsetsAMD", EOpSparseTextureGatherLodOffsets); #endif } } diff --git a/src/libraries/glslang/glslang/MachineIndependent/Initialize.h b/src/libraries/glslang/glslang/MachineIndependent/Initialize.h index 45b439562..6b54c4da6 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Initialize.h +++ b/src/libraries/glslang/glslang/MachineIndependent/Initialize.h @@ -94,11 +94,11 @@ public: protected: void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion); - 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); - void addGatherFunctions(TSampler, TString& typeName, int version, EProfile profile); + void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile); + void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addImageFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addSamplingFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addGatherFunctions(TSampler, const TString& typeName, int version, EProfile profile); // Helpers for making textual representations of the permutations // of texturing/imaging functions. diff --git a/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp b/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp index 2ebd741ee..c07dab9d3 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -130,8 +130,9 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn } // Convert the children's type shape to be compatible. - right = addShapeConversion(op, left->getType(), right); - left = addShapeConversion(op, right->getType(), left); + addBiShapeConversion(op, left, right); + if (left == nullptr || right == nullptr) + return nullptr; // // Need a new node holding things together. Make @@ -147,8 +148,8 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn // 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(); + TIntermConstantUnion *leftTempConstant = node->getLeft()->getAsConstantUnion(); + TIntermConstantUnion *rightTempConstant = node->getRight()->getAsConstantUnion(); if (leftTempConstant && rightTempConstant) { TIntermTyped* folded = leftTempConstant->fold(node->getOp(), rightTempConstant); if (folded) @@ -157,7 +158,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn // If can propagate spec-constantness and if the operation is an allowed // specialization-constant operation, make a spec-constant. - if (specConstantPropagates(*left, *right) && isSpecializationOperation(*node)) + if (specConstantPropagates(*node->getLeft(), *node->getRight()) && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); return node; @@ -238,7 +239,7 @@ TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TInterm return nullptr; // convert shape - right = addShapeConversion(op, left->getType(), right); + right = addUniShapeConversion(op, left->getType(), right); // build the node TIntermBinary* node = addBinaryNode(op, left, right, loc); @@ -307,6 +308,10 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo case EOpConstructUint: newType = EbtUint; break; case EOpConstructInt64: newType = EbtInt64; break; case EOpConstructUint64: newType = EbtUint64; break; +#ifdef AMD_EXTENSIONS + case EOpConstructInt16: newType = EbtInt16; break; + case EOpConstructUint16: newType = EbtUint16; break; +#endif case EOpConstructBool: newType = EbtBool; break; case EOpConstructFloat: newType = EbtFloat; break; case EOpConstructDouble: newType = EbtDouble; break; @@ -335,6 +340,10 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: +#ifdef AMD_EXTENSIONS + case EOpConstructInt16: + case EOpConstructUint16: +#endif case EOpConstructBool: case EOpConstructFloat: case EOpConstructDouble: @@ -356,12 +365,12 @@ 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 (node->getOperand()->getAsConstantUnion()) + return node->getOperand()->getAsConstantUnion()->fold(op, node->getType()); // If it's a specialization constant, the result is too, // if the operation is allowed for specialization constants. - if (child->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) + if (node->getOperand()->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); return node; @@ -527,6 +536,14 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpConstructUint64: promoteTo = EbtUint64; break; +#ifdef AMD_EXTENSIONS + case EOpConstructInt16: + promoteTo = EbtInt16; + break; + case EOpConstructUint16: + promoteTo = EbtUint16; + break; +#endif // // List all the binary ops that can implicitly convert one operand to the other's type; @@ -615,15 +632,26 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpRightShiftAssign: if ((type.getBasicType() == EbtInt || type.getBasicType() == EbtUint || +#ifdef AMD_EXTENSIONS + type.getBasicType() == EbtInt16 || + type.getBasicType() == EbtUint16 || +#endif type.getBasicType() == EbtInt64 || type.getBasicType() == EbtUint64) && (node->getType().getBasicType() == EbtInt || node->getType().getBasicType() == EbtUint || +#ifdef AMD_EXTENSIONS + node->getType().getBasicType() == EbtInt16 || + node->getType().getBasicType() == EbtUint16 || +#endif node->getType().getBasicType() == EbtInt64 || node->getType().getBasicType() == EbtUint64)) return node; - else + else if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) { + promoteTo = type.getBasicType(); + break; + } else return nullptr; default: @@ -659,6 +687,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToDouble; break; case EbtUint64: newOp = EOpConvUint64ToDouble; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToDouble; break; + case EbtUint16: newOp = EOpConvUint16ToDouble; break; +#endif default: return nullptr; } @@ -674,6 +706,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToFloat; break; case EbtUint64: newOp = EOpConvUint64ToFloat; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToFloat; break; + case EbtUint16: newOp = EOpConvUint16ToFloat; break; +#endif default: return nullptr; } @@ -688,6 +724,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtDouble: newOp = EOpConvDoubleToFloat16; break; case EbtInt64: newOp = EOpConvInt64ToFloat16; break; case EbtUint64: newOp = EOpConvUint64ToFloat16; break; + case EbtInt16: newOp = EOpConvInt16ToFloat16; break; + case EbtUint16: newOp = EOpConvUint16ToFloat16; break; default: return nullptr; } @@ -704,6 +742,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToBool; break; case EbtUint64: newOp = EOpConvUint64ToBool; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToBool; break; + case EbtUint16: newOp = EOpConvUint16ToBool; break; +#endif default: return nullptr; } @@ -719,6 +761,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToInt; break; case EbtUint64: newOp = EOpConvUint64ToInt; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToInt; break; + case EbtUint16: newOp = EOpConvUint16ToInt; break; +#endif default: return nullptr; } @@ -734,6 +780,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToUint; break; case EbtUint64: newOp = EOpConvUint64ToUint; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToUint; break; + case EbtUint16: newOp = EOpConvUint16ToUint; break; +#endif default: return nullptr; } @@ -749,6 +799,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; #endif case EbtUint64: newOp = EOpConvUint64ToInt64; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToInt64; break; + case EbtUint16: newOp = EOpConvUint16ToInt64; break; +#endif default: return nullptr; } @@ -764,10 +818,46 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; #endif case EbtInt64: newOp = EOpConvInt64ToUint64; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: newOp = EOpConvInt16ToUint64; break; + case EbtUint16: newOp = EOpConvUint16ToUint64; break; +#endif default: return nullptr; } break; +#ifdef AMD_EXTENSIONS + case EbtInt16: + switch (node->getBasicType()) { + case EbtInt: newOp = EOpConvIntToInt16; break; + case EbtUint: newOp = EOpConvUintToInt16; break; + case EbtBool: newOp = EOpConvBoolToInt16; break; + case EbtFloat: newOp = EOpConvFloatToInt16; break; + case EbtDouble: newOp = EOpConvDoubleToInt16; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt16; break; + case EbtInt64: newOp = EOpConvInt64ToInt16; break; + case EbtUint64: newOp = EOpConvUint64ToInt16; break; + case EbtUint16: newOp = EOpConvUint16ToInt16; break; + default: + return nullptr; + } + break; + case EbtUint16: + switch (node->getBasicType()) { + case EbtInt: newOp = EOpConvIntToUint16; break; + case EbtUint: newOp = EOpConvUintToUint16; break; + case EbtBool: newOp = EOpConvBoolToUint16; break; + case EbtFloat: newOp = EOpConvFloatToUint16; break; + case EbtDouble: newOp = EOpConvDoubleToUint16; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint16; break; + case EbtInt64: newOp = EOpConvInt64ToUint16; break; + case EbtUint64: newOp = EOpConvUint64ToUint16; break; + case EbtInt16: newOp = EOpConvInt16ToUint16; break; + default: + return nullptr; + } + break; +#endif default: return nullptr; } @@ -785,7 +875,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt } // Convert the node's shape of type for the given type, as allowed by the -// operation involved: 'op'. +// operation involved: 'op'. This is for situations where there is only one +// direction to consider doing the shape conversion. +// +// This implements policy, it call addShapeConversion() for the mechanism. // // Generally, the AST represents allowed GLSL shapes, so this isn't needed // for GLSL. Bad shapes are caught in conversion or promotion. @@ -793,7 +886,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // Return 'node' if no conversion was done. Promotion handles final shape // checking. // -TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type, TIntermTyped* node) +TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& type, TIntermTyped* node) { // some source languages don't do this switch (source) { @@ -806,23 +899,142 @@ TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type, // some operations don't do this switch (op) { + case EOpFunctionCall: + case EOpReturn: + break; + + case EOpMulAssign: + // want to support vector *= scalar native ops in AST and lower, not smear, similarly for + // matrix *= scalar, etc. + + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + if (node->getVectorSize() == 1) + return node; + break; + case EOpAssign: + break; + + case EOpMix: + break; + + default: + return node; + } + + return addShapeConversion(type, node); +} + +// Convert the nodes' shapes to be compatible for the operation 'op'. +// +// This implements policy, it call addShapeConversion() for the mechanism. +// +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. +// +void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode) +{ + // some source languages don't do this + switch (source) { + case EShSourceHlsl: + break; + case EShSourceGlsl: + default: + return; + } + + // some operations don't do this + // 'break' will mean attempt bidirectional conversion + switch (op) { + case EOpMulAssign: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpDivAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + case EOpRightShiftAssign: + case EOpLeftShiftAssign: + // switch to unidirectional conversion (the lhs can't change) + rhsNode = addUniShapeConversion(op, lhsNode->getType(), rhsNode); + return; + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + // want to support vector * scalar native ops in AST and lower, not smear, similarly for + // matrix * vector, etc. + if (lhsNode->getVectorSize() == 1 || rhsNode->getVectorSize() == 1) + return; + break; + + case EOpRightShift: + case EOpLeftShift: + // can natively support the right operand being a scalar and the left a vector, + // but not the reverse + if (rhsNode->getVectorSize() == 1) + return; + break; + case EOpLessThan: case EOpGreaterThan: case EOpLessThanEqual: case EOpGreaterThanEqual: + case EOpEqual: case EOpNotEqual: - case EOpFunctionCall: - case EOpReturn: + case EOpLogicalAnd: case EOpLogicalOr: case EOpLogicalXor: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpMix: break; + default: - return node; + return; } + // Do bidirectional conversions + if (lhsNode->getType().isScalarOrVec1() || rhsNode->getType().isScalarOrVec1()) { + if (lhsNode->getType().isScalarOrVec1()) + lhsNode = addShapeConversion(rhsNode->getType(), lhsNode); + else + rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); + } + lhsNode = addShapeConversion(rhsNode->getType(), lhsNode); + rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); +} + +// Convert the node's shape of type for the given type. It's not necessarily +// an error if they are different and not converted, as some operations accept +// mixed types. Promotion will do final shape checking. +// +// If there is a chance of two nodes, with conversions possible in each direction, +// the policy for what to ask for must be in the caller; this will do what is asked. +// +// Return 'node' if no conversion was done. Promotion handles final shape +// checking. +// +TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* node) +{ + // no conversion needed + if (node->getType() == type) + return node; + // structures and arrays don't change shape, either to or from if (node->getType().isStruct() || node->getType().isArray() || type.isStruct() || type.isArray()) @@ -831,12 +1043,12 @@ TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type, // The new node that handles the conversion TOperator constructorOp = mapTypeToConstructorOp(type); - // scalar -> smeared -> vector, or - // vec1 -> scalar, or - // bigger vector -> smaller vector or scalar - if ((type.isVector() && node->getType().isScalar()) || - (node->getType().isVector() && node->getVectorSize() == 1 && type.isScalar()) || - (node->getVectorSize() > type.getVectorSize() && type.isVector())) + // scalar -> vector or vec1 -> vector or + // vector -> scalar or + // bigger vector -> smaller vector + if ((node->getType().isScalarOrVec1() && type.isVector()) || + (node->getType().isVector() && type.isScalar()) || + (node->isVector() && type.isVector() && node->getVectorSize() > type.getVectorSize())) return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); return node; @@ -894,6 +1106,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtUint: case EbtInt64: case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif case EbtFloat: case EbtDouble: #ifdef AMD_EXTENSIONS @@ -907,6 +1123,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat switch (from) { case EbtInt: case EbtUint: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif case EbtFloat: #ifdef AMD_EXTENSIONS case EbtFloat16: @@ -920,8 +1140,12 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtUint: switch (from) { case EbtInt: - return version >= 400; + return version >= 400 || (source == EShSourceHlsl); case EbtUint: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif return true; case EbtBool: return (source == EShSourceHlsl); @@ -931,6 +1155,9 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtInt: switch (from) { case EbtInt: +#ifdef AMD_EXTENSIONS + case EbtInt16: +#endif return true; case EbtBool: return (source == EShSourceHlsl); @@ -943,6 +1170,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtUint: case EbtInt64: case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif return true; default: return false; @@ -951,10 +1182,32 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat switch (from) { case EbtInt: case EbtInt64: +#ifdef AMD_EXTENSIONS + case EbtInt16: +#endif return true; default: return false; } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch (from) { + case EbtInt16: + case EbtUint16: + case EbtFloat16: + return true; + default: + return false; + } + case EbtUint16: + switch (from) { + case EbtInt16: + case EbtUint16: + return true; + default: + return false; + } +#endif default: return false; } @@ -1094,21 +1347,79 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const break; #endif case EbtInt: - switch(type.getVectorSize()) { - case 1: op = EOpConstructInt; break; - case 2: op = EOpConstructIVec2; break; - case 3: op = EOpConstructIVec3; break; - case 4: op = EOpConstructIVec4; break; - default: break; // some compilers want this + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat2x2; break; + case 3: op = EOpConstructIMat2x3; break; + case 4: op = EOpConstructIMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat3x2; break; + case 3: op = EOpConstructIMat3x3; break; + case 4: op = EOpConstructIMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructIMat4x2; break; + case 3: op = EOpConstructIMat4x3; break; + case 4: op = EOpConstructIMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt; break; + case 2: op = EOpConstructIVec2; break; + case 3: op = EOpConstructIVec3; break; + case 4: op = EOpConstructIVec4; break; + default: break; // some compilers want this + } } break; case EbtUint: - switch(type.getVectorSize()) { - case 1: op = EOpConstructUint; break; - case 2: op = EOpConstructUVec2; break; - case 3: op = EOpConstructUVec3; break; - case 4: op = EOpConstructUVec4; break; - default: break; // some compilers want this + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat2x2; break; + case 3: op = EOpConstructUMat2x3; break; + case 4: op = EOpConstructUMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat3x2; break; + case 3: op = EOpConstructUMat3x3; break; + case 4: op = EOpConstructUMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructUMat4x2; break; + case 3: op = EOpConstructUMat4x3; break; + case 4: op = EOpConstructUMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint; break; + case 2: op = EOpConstructUVec2; break; + case 3: op = EOpConstructUVec3; break; + case 4: op = EOpConstructUVec4; break; + default: break; // some compilers want this + } } break; case EbtInt64: @@ -1129,15 +1440,64 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const default: break; // some compilers want this } break; - case EbtBool: +#ifdef AMD_EXTENSIONS + case EbtInt16: switch(type.getVectorSize()) { - case 1: op = EOpConstructBool; break; - case 2: op = EOpConstructBVec2; break; - case 3: op = EOpConstructBVec3; break; - case 4: op = EOpConstructBVec4; break; + case 1: op = EOpConstructInt16; break; + case 2: op = EOpConstructI16Vec2; break; + case 3: op = EOpConstructI16Vec3; break; + case 4: op = EOpConstructI16Vec4; break; default: break; // some compilers want this } break; + case EbtUint16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint16; break; + case 2: op = EOpConstructU16Vec2; break; + case 3: op = EOpConstructU16Vec3; break; + case 4: op = EOpConstructU16Vec4; break; + default: break; // some compilers want this + } + break; +#endif + case EbtBool: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat2x2; break; + case 3: op = EOpConstructBMat2x3; break; + case 4: op = EOpConstructBMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat3x2; break; + case 3: op = EOpConstructBMat3x3; break; + case 4: op = EOpConstructBMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructBMat4x2; break; + case 3: op = EOpConstructBMat4x3; break; + case 4: op = EOpConstructBMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch(type.getVectorSize()) { + case 1: op = EOpConstructBool; break; + case 2: op = EOpConstructBVec2; break; + case 3: op = EOpConstructBVec3; break; + case 4: op = EOpConstructBVec4; break; + default: break; // some compilers want this + } + } + break; default: break; } @@ -1158,15 +1518,15 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r return nullptr; TIntermAggregate* aggNode = nullptr; - if (left) + if (left != nullptr) aggNode = left->getAsAggregate(); - if (! aggNode || aggNode->getOp() != EOpNull) { + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { aggNode = new TIntermAggregate; - if (left) + if (left != nullptr) aggNode->getSequence().push_back(left); } - if (right) + if (right != nullptr) aggNode->getSequence().push_back(right); return aggNode; @@ -1271,7 +1631,8 @@ TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, // // For "?:" test nodes. There are three children; a condition, // a true path, and a false path. The two paths are specified -// as separate parameters. +// as separate parameters. For vector 'cond', the true and false +// are not paths, but vectors to mix. // // Specialization constant operations include // - The ternary operator ( ? : ) @@ -1300,14 +1661,39 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true return nullptr; } + // Handle a vector condition as a mix + if (!cond->getType().isScalarOrVec1()) { + TType targetVectorType(trueBlock->getType().getBasicType(), EvqTemporary, + cond->getType().getVectorSize()); + // smear true/false operands as needed + trueBlock = addUniShapeConversion(EOpMix, targetVectorType, trueBlock); + falseBlock = addUniShapeConversion(EOpMix, targetVectorType, falseBlock); + + // After conversion, types have to match. + if (falseBlock->getType() != trueBlock->getType()) + return nullptr; + + // make the mix operation + TIntermAggregate* mix = makeAggregate(loc); + mix = growAggregate(mix, falseBlock); + mix = growAggregate(mix, trueBlock); + mix = growAggregate(mix, cond); + mix->setType(targetVectorType); + mix->setOp(EOpMix); + + return mix; + } + + // Now have a scalar condition... + + // Convert true and false expressions to matching types + addBiShapeConversion(EOpMix, trueBlock, falseBlock); + // After conversion, types have to match. if (falseBlock->getType() != trueBlock->getType()) return nullptr; - // - // See if all the operands are constant, then fold it otherwise not. - // - + // Eliminate the selection when the condition is a scalar and all operands are constant. if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) { if (cond->getAsConstantUnion()->getConstArray()[0].getBConst()) return trueBlock; @@ -1381,6 +1767,24 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, co return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal); } +#ifdef AMD_EXTENSIONS +TIntermConstantUnion* TIntermediate::addConstantUnion(short i16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setIConst(i16); + + return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setUConst(u16); + + return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); +} +#endif + TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const { TConstUnionArray unionArray(1); @@ -1478,10 +1882,11 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool // // Create while and do-while loop nodes. // -TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc) +TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) { TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); + node->setLoopControl(control); return node; } @@ -1489,13 +1894,19 @@ TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TInte // // Create a for-loop sequence. // -TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc) +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) { TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); + node->setLoopControl(control); - // make a sequence of the initializer and statement - TIntermAggregate* loopSequence = makeAggregate(initializer, loc); + // make a sequence of the initializer and statement, but try to reuse the + // aggregate already created for whatever is in the initializer, if there is one + TIntermAggregate* loopSequence = (initializer == nullptr || + initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc) + : initializer->getAsAggregate(); + if (loopSequence != nullptr && loopSequence->getOp() == EOpSequence) + loopSequence->setOp(EOpNull); loopSequence = growAggregate(loopSequence, node); loopSequence->setOperator(EOpSequence); @@ -1535,6 +1946,14 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) // Propagate 'noContraction' label in backward from 'precise' variables. glslang::PropagateNoContraction(*this); + switch (textureSamplerTransformMode) { + case EShTexSampTransKeep: + break; + case EShTexSampTransUpgradeTextureRemoveSampler: + performTextureUpgradeAndSamplerRemovalTransformation(root); + break; + } + return true; } @@ -1725,6 +2144,30 @@ bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const case EOpConvUintToInt64: case EOpConvUint64ToInt: case EOpConvIntToUint64: +#ifdef AMD_EXTENSIONS + case EOpConvInt16ToBool: + case EOpConvBoolToInt16: + case EOpConvInt16ToInt: + case EOpConvIntToInt16: + case EOpConvInt16ToUint: + case EOpConvUintToInt16: + case EOpConvInt16ToInt64: + case EOpConvInt64ToInt16: + case EOpConvInt16ToUint64: + case EOpConvUint64ToInt16: + case EOpConvUint16ToBool: + case EOpConvBoolToUint16: + case EOpConvUint16ToInt: + case EOpConvIntToUint16: + case EOpConvUint16ToUint: + case EOpConvUintToUint16: + case EOpConvUint16ToInt64: + case EOpConvInt64ToUint16: + case EOpConvUint16ToUint64: + case EOpConvUint64ToUint16: + case EOpConvInt16ToUint16: + case EOpConvUint16ToInt16: +#endif // unary operations case EOpNegative: @@ -1853,6 +2296,10 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) case EOpBitwiseNot: if (operand->getBasicType() != EbtInt && operand->getBasicType() != EbtUint && +#ifdef AMD_EXTENSIONS + operand->getBasicType() != EbtInt16 && + operand->getBasicType() != EbtUint16 && +#endif operand->getBasicType() != EbtInt64 && operand->getBasicType() != EbtUint64) @@ -1867,6 +2314,10 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) operand->getBasicType() != EbtUint && operand->getBasicType() != EbtInt64 && operand->getBasicType() != EbtUint64 && +#ifdef AMD_EXTENSIONS + operand->getBasicType() != EbtInt16 && + operand->getBasicType() != EbtUint16 && +#endif operand->getBasicType() != EbtFloat && #ifdef AMD_EXTENSIONS operand->getBasicType() != EbtFloat16 && @@ -1967,6 +2418,42 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) // We now have only scalars, vectors, and matrices to worry about. // + // HLSL implicitly promotes bool -> int for numeric operations. + // (Implicit conversions to make the operands match each other's types were already done.) + if (getSource() == EShSourceHlsl && + (left->getBasicType() == EbtBool || right->getBasicType() == EbtBool)) { + switch (op) { + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + + case EOpRightShift: + case EOpLeftShift: + + case EOpMod: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpAdd: + case EOpSub: + case EOpDiv: + case EOpMul: + left = addConversion(op, TType(EbtInt, EvqTemporary, left->getVectorSize()), left); + right = addConversion(op, TType(EbtInt, EvqTemporary, right->getVectorSize()), right); + if (left == nullptr || right == nullptr) + return false; + node.setLeft(left); + node.setRight(right); + break; + + default: + break; + } + } + // Do general type checks against individual operands (comparing left and right is coming up, checking mixed shapes after that) switch (op) { case EOpLessThan: @@ -2037,8 +2524,14 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) // Check for integer-only operands. if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint && - left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) || +#ifdef AMD_EXTENSIONS + left->getBasicType() != EbtInt16 && left->getBasicType() != EbtUint16 && +#endif + left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) || (right->getBasicType() != EbtInt && right->getBasicType() != EbtUint && +#ifdef AMD_EXTENSIONS + right->getBasicType() != EbtInt16 && right->getBasicType() != EbtUint16 && +#endif right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64)) return false; if (left->isMatrix() || right->isMatrix()) @@ -2079,8 +2572,6 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpLogicalXor: return left->getType() == right->getType(); - // no shifts: they can mix types (scalar int can shift a vector uint, etc.) - case EOpMod: case EOpModAssign: @@ -2094,6 +2585,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpAdd: case EOpSub: case EOpDiv: + case EOpAddAssign: case EOpSubAssign: case EOpDivAssign: @@ -2118,7 +2610,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) return true; // Finish handling the case, for all ops, where there are two vectors of different sizes - if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize()) + if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize() && right->getVectorSize() > 1) return false; // @@ -2667,4 +3159,41 @@ bool TIntermediate::specConstantPropagates(const TIntermTyped& node1, const TInt (node2.getType().getQualifier().isSpecConstant() && node1.getType().getQualifier().isConstant()); } +struct TextureUpgradeAndSamplerRemovalTransform : public TIntermTraverser { + bool visitAggregate(TVisit, TIntermAggregate* ag) override { + using namespace std; + TIntermSequence& seq = ag->getSequence(); + // remove pure sampler variables + TIntermSequence::iterator newEnd = remove_if(seq.begin(), seq.end(), [](TIntermNode* node) { + TIntermSymbol* symbol = node->getAsSymbolNode(); + if (!symbol) + return false; + + return (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isPureSampler()); + }); + seq.erase(newEnd, seq.end()); + // replace constructors with sampler/textures + // update textures into sampled textures + for_each(seq.begin(), seq.end(), [](TIntermNode*& node) { + TIntermSymbol* symbol = node->getAsSymbolNode(); + if (!symbol) { + TIntermAggregate *constructor = node->getAsAggregate(); + if (constructor && constructor->getOp() == EOpConstructTextureSampler) { + if (!constructor->getSequence().empty()) + node = constructor->getSequence()[0]; + } + } else if (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isTexture()) { + symbol->getWritableType().getSampler().combined = true; + } + }); + return true; + } +}; + +void TIntermediate::performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root) +{ + TextureUpgradeAndSamplerRemovalTransform transform; + root->traverse(&transform); +} + } // end namespace glslang diff --git a/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h b/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h index 029c24a82..7333bc964 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h +++ b/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h @@ -33,6 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // +#pragma once + #include "../Include/Common.h" #include "reflection.h" #include "localintermediate.h" diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 946eb715b..44fc0b47b 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -226,7 +226,8 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, // Add 'symbol' to the list of deferred linkage symbols, which // are later processed in finish(), at which point the symbol // must still be valid. -// It is okay if the symbol's type will be subsequently edited. +// It is okay if the symbol's type will be subsequently edited; +// the modifications will be tracked. void TParseContextBase::trackLinkage(TSymbol& symbol) { if (!parsingBuiltins) @@ -530,21 +531,20 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin // Make the passed-in variable information become a member of the // global uniform block. If this doesn't exist yet, make it. // -void TParseContextBase::growGlobalUniformBlock(TSourceLoc& loc, TType& memberType, TString& memberName, TTypeList* typeList) +void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) { - // make the global block, if not yet made + // Make the global block, if not yet made. if (globalUniformBlock == nullptr) { - TString& blockName = *NewPoolTString(getGlobalUniformBlockName()); TQualifier blockQualifier; blockQualifier.clear(); blockQualifier.storage = EvqUniform; - TType blockType(new TTypeList, blockName, blockQualifier); - TString* instanceName = NewPoolTString(""); - globalUniformBlock = new TVariable(instanceName, blockType, true); + TType blockType(new TTypeList, *NewPoolTString(getGlobalUniformBlockName()), blockQualifier); + setUniformBlockDefaults(blockType); + globalUniformBlock = new TVariable(NewPoolTString(""), blockType, true); firstNewMember = 0; } - // add the requested member as a member to the block + // Add the requested member as a member to the global block. TType* type = new TType; type->shallowCopy(memberType); type->setFieldName(memberName); @@ -552,36 +552,20 @@ void TParseContextBase::growGlobalUniformBlock(TSourceLoc& loc, TType& memberTyp type->setStruct(typeList); TTypeLoc typeLoc = {type, loc}; globalUniformBlock->getType().getWritableStruct()->push_back(typeLoc); -} -// -// Insert into the symbol table the global uniform block created in -// growGlobalUniformBlock(). The variables added as members won't be -// found unless this is done. -// -bool TParseContextBase::insertGlobalUniformBlock() -{ - if (globalUniformBlock == nullptr) - return true; - - int numMembers = (int)globalUniformBlock->getType().getStruct()->size(); - bool inserted = false; + // Insert into the symbol table. if (firstNewMember == 0) { // This is the first request; we need a normal symbol table insert - inserted = symbolTable.insert(*globalUniformBlock); - if (inserted) + if (symbolTable.insert(*globalUniformBlock)) trackLinkage(*globalUniformBlock); - } else if (firstNewMember <= numMembers) { + else + error(loc, "failed to insert the global constant buffer", "uniform", ""); + } else { // This is a follow-on request; we need to amend the first insert - inserted = symbolTable.amend(*globalUniformBlock, firstNewMember); + symbolTable.amend(*globalUniformBlock, firstNewMember); } - if (inserted) { - finalizeGlobalUniformBlockLayout(*globalUniformBlock); - firstNewMember = numMembers; - } - - return inserted; + ++firstNewMember; } void TParseContextBase::finish() diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp index db77b41d5..12dbd1646 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -51,8 +51,8 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), - contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), - inMain(false), postMainReturn(false), currentFunctionType(nullptr), blockName(nullptr), + inMain(false), + blockName(nullptr), limits(resources.limits), atomicUintOffsets(nullptr), anyIndexLimits(false) { @@ -255,6 +255,10 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& error(loc, "\")\" expected to end 'debug' pragma", "#pragma", ""); return; } + } else if (spvVersion.spv > 0 && tokens[0].compare("use_storage_buffer") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setUseStorageBuffer(); } } @@ -342,10 +346,8 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn TIntermTyped* result = nullptr; int indexValue = 0; - if (index->getQualifier().isFrontEndConstant()) { + if (index->getQualifier().isFrontEndConstant()) indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); - checkIndex(loc, base->getType(), indexValue); - } variableCheck(base); if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) { @@ -353,10 +355,12 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), ""); else error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); - } else if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) + } else if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) { + // both base and index are front-end constants + checkIndex(loc, base->getType(), indexValue); return intermediate.foldDereference(base, indexValue, loc); - else { - // at least one of base and index is variable... + } else { + // at least one of base and index is not a front-end constant variable... if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) handleIoResizeArrayAccess(loc, base); @@ -364,6 +368,8 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn if (index->getQualifier().isFrontEndConstant()) { if (base->getType().isImplicitlySizedArray()) updateImplicitArraySize(loc, base, indexValue); + else + checkIndex(loc, base->getType(), indexValue); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); } else { if (base->getType().isImplicitlySizedArray()) { @@ -906,7 +912,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, loopNestingLevel = 0; statementNestingLevel = 0; controlFlowNestingLevel = 0; - postMainReturn = false; + postEntryPointReturn = false; return paramNodes; } @@ -1187,7 +1193,7 @@ void TParseContext::checkLocation(const TSourceLoc& loc, TOperator op) error(loc, "tessellation control barrier() cannot be placed within flow control", "", ""); if (! inMain) error(loc, "tessellation control barrier() must be in main()", "", ""); - else if (postMainReturn) + else if (postEntryPointReturn) error(loc, "tessellation control barrier() cannot be placed after a return from main()", "", ""); } break; @@ -1436,9 +1442,56 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan error(loc, "must be a compile-time constant:", feature, "component argument"); } +#ifdef AMD_EXTENSIONS + bool bias = false; + if (callNode.getOp() == EOpTextureGather) + bias = fnCandidate.getParamCount() > 3; + else if (callNode.getOp() == EOpTextureGatherOffset || + callNode.getOp() == EOpTextureGatherOffsets) + bias = fnCandidate.getParamCount() > 4; + + if (bias) { + TString biasFeatureString = fnCandidate.getName() + "with bias argument"; + const char* feature = biasFeatureString.c_str(); + profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); + } +#endif + break; } +#ifdef AMD_EXTENSIONS + case EOpSparseTextureGather: + case EOpSparseTextureGatherOffset: + case EOpSparseTextureGatherOffsets: + { + bool bias = false; + if (callNode.getOp() == EOpSparseTextureGather) + bias = fnCandidate.getParamCount() > 4; + else if (callNode.getOp() == EOpSparseTextureGatherOffset || + callNode.getOp() == EOpSparseTextureGatherOffsets) + bias = fnCandidate.getParamCount() > 5; + + if (bias) { + TString featureString = fnCandidate.getName() + "with bias argument"; + const char* feature = featureString.c_str(); + profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); + } + + break; + } + + case EOpSparseTextureGatherLod: + case EOpSparseTextureGatherLodOffset: + case EOpSparseTextureGatherLodOffsets: + { + requireExtensions(loc, 1, &E_GL_ARB_sparse_texture2, fnCandidate.getName().c_str()); + break; + } +#endif + case EOpTextureOffset: case EOpTextureFetchOffset: case EOpTextureProjOffset: @@ -2096,6 +2149,17 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructDMat4x2: case EOpConstructDMat4x3: case EOpConstructDMat4x4: +#ifdef AMD_EXTENSIONS + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: +#endif constructingMatrix = true; break; default: @@ -2156,6 +2220,10 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: +#ifdef AMD_EXTENSIONS + case EOpConstructInt16: + case EOpConstructUint16: +#endif case EOpConstructBool: case EOpConstructBVec2: case EOpConstructBVec3: @@ -2172,6 +2240,14 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: +#ifdef AMD_EXTENSIONS + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: +#endif // This was the list of valid ones, if they aren't converting from float // and aren't making an array. makeSpecConst = ! floatArgument && ! type.isArray(); @@ -2464,6 +2540,9 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali } if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || +#ifdef AMD_EXTENSIONS + publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || +#endif publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || publicType.basicType == EbtDouble) profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); @@ -2474,6 +2553,9 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (!qualifier.flat) { #endif if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || +#ifdef AMD_EXTENSIONS + publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || +#endif publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || publicType.basicType == EbtDouble || (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) || @@ -2894,7 +2976,7 @@ void TParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& typ } } -void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer, bool lastMember) +void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer, bool lastMember) { assert(arraySizes); @@ -2906,10 +2988,13 @@ void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& q if (initializer) return; - // No environment lets any non-outer-dimension that's to be implicitly sized + // No environment allows any non-outer-dimension to be implicitly sized if (arraySizes->isInnerImplicit()) error(loc, "only outermost dimension of an array of arrays can be implicitly sized", "[]", ""); + if (arraySizes->isInnerSpecialization()) + error(loc, "only outermost dimension of an array of arrays can be a specialization constant", "[]", ""); + // desktop always allows outer-dimension-unsized variable arrays, if (profile != EEsProfile) return; @@ -2990,7 +3075,7 @@ void TParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) // Do all the semantic checking for declaring or redeclaring an array, with and // without a size, and make the right changes to the symbol table. // -void TParseContext::declareArray(const TSourceLoc& loc, TString& identifier, const TType& type, TSymbol*& symbol) +void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type, TSymbol*& symbol) { if (symbol == nullptr) { bool currentScope; @@ -4196,6 +4281,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi if (id.compare(0, 11, "local_size_") == 0) { profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); + if (id.size() == 12 && value == 0) { + error(loc, "must be at least 1", id.c_str(), ""); + return; + } if (id == "local_size_x") { publicType.shaderQualifiers.localSize[0] = value; return; @@ -4246,7 +4335,6 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi // This is also true for overriding layout-qualifier-names, where one // overrides the other (e.g., row_major vs. column_major); only the last // occurrence has any effect." -// void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) { if (src.hasMatrix()) @@ -4328,6 +4416,25 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb } } + // user-variable location check, which are required for SPIR-V in/out: + // - variables have it directly, + // - blocks have it on each member (already enforced), so check first one + if (spvVersion.spv > 0 && !parsingBuiltins && qualifier.builtIn == EbvNone && + !qualifier.hasLocation() && !intermediate.getAutoMapLocations()) { + + switch (qualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + if (type.getBasicType() != EbtBlock || + (!(*type.getStruct())[0].type->getQualifier().hasLocation() && + (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone)) + error(loc, "SPIR-V requires location for user input/output", "location", ""); + break; + default: + break; + } + } + // Check packing and matrix if (qualifier.hasUniformLayout()) { switch (qualifier.storage) { @@ -4355,6 +4462,22 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb } } +// "For some blocks declared as arrays, the location can only be applied at the block level: +// When a block is declared as an array where additional locations are needed for each member +// for each block array element, it is a compile-time error to specify locations on the block +// members. That is, when locations would be under specified by applying them on block members, +// they are not allowed on block members. For arrayed interfaces (those generally having an +// extra level of arrayness due to interface expansion), the outer array is stripped before +// applying this rule." +void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, TArraySizes* arraySizes) +{ + if (memberWithLocation && arraySizes != nullptr) { + if (arraySizes->getNumDims() > (currentBlockQualifier.isArrayedIo(language) ? 1 : 0)) + error(loc, "cannot use in a block array where new locations are needed for each block element", + "location", ""); + } +} + // Do layout error checking with respect to a type. void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) { @@ -4500,7 +4623,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) } } } else if (type.isImage() && ! qualifier.writeonly) { - const char *explanation = "image variables declared 'writeonly' without a format layout qualifier"; + const char *explanation = "image variables not declared 'writeonly' and without a format layout qualifier"; requireProfile(loc, ECoreProfile | ECompatibilityProfile, explanation); profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation); } @@ -4529,6 +4652,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EbtUint: case EbtInt64: case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif case EbtBool: case EbtFloat: case EbtDouble: @@ -4692,12 +4819,8 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol) if (symbol.getType().isExplicitlySizedArray()) numOffsets *= symbol.getType().getCumulativeArraySize(); else { - // TODO: functionality: implicitly-sized atomic_uint arrays. - // We don't know the full size until later. This might - // be a specification problem, will report to Khronos. For the - // cases that is not true, the rest of the checking would need - // to be done at link time instead of compile time. - warn(loc, "implicitly sized atomic_uint array treated as having one element for tracking the default offset", "atomic_uint", ""); + // "It is a compile-time error to declare an unsized array of atomic_uint." + error(loc, "array must be explicitly sized", "atomic_uint", ""); } } int repeated = intermediate.addUsedOffsets(qualifier.layoutBinding, offset, numOffsets); @@ -4983,7 +5106,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden arrayDimMerge(type, arraySizes); // Check that implicit sizing is only where allowed. - arrayUnsizedCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr, false); + arraySizesCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr, false); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol); @@ -5016,6 +5139,8 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // look for errors in layout qualifier use layoutObjectCheck(loc, *symbol); + + // fix up fixOffset(loc, *symbol); return initNode; @@ -5053,7 +5178,7 @@ TVariable* TParseContext::makeInternalVariable(const char* name, const TType& ty // // Return the successfully declared variable. // -TVariable* TParseContext::declareNonArray(const TSourceLoc& loc, TString& identifier, TType& type) +TVariable* TParseContext::declareNonArray(const TSourceLoc& loc, const TString& identifier, const TType& type) { // make a new variable TVariable* variable = new TVariable(&identifier, type); @@ -5477,6 +5602,22 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructUint64; break; +#ifdef AMD_EXTENSIONS + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; +#endif + case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: @@ -5533,7 +5674,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con blockStageIoCheck(loc, currentBlockQualifier); blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); if (arraySizes) { - arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes, false, false); + arraySizesCheck(loc, currentBlockQualifier, arraySizes, false, false); arrayDimCheck(loc, arraySizes, 0); if (arraySizes->getNumDims() > 1) requireProfile(loc, ~EEsProfile, "array-of-array of block"); @@ -5551,7 +5692,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); if (memberType.isArray()) - arrayUnsizedCheck(memberLoc, currentBlockQualifier, &memberType.getArraySizes(), false, member == typeList.size() - 1); + arraySizesCheck(memberLoc, currentBlockQualifier, &memberType.getArraySizes(), false, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { if (spvVersion.spv == 0) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); @@ -5597,11 +5738,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); - // "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts." // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." - if (currentBlockQualifier.hasAlign() || currentBlockQualifier.hasAlign()) { + if (currentBlockQualifier.hasAlign()) { if (defaultQualification.layoutPacking != ElpStd140 && defaultQualification.layoutPacking != ElpStd430) { - error(loc, "can only be used with std140 or std430 layout packing", "offset/align", ""); + error(loc, "can only be used with std140 or std430 layout packing", "align", ""); defaultQualification.layoutAlign = -1; } } @@ -5643,9 +5783,12 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con } } else memberWithoutLocation = true; - if (memberQualifier.hasAlign()) { + + // "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts." + // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." + if (memberQualifier.hasAlign() || memberQualifier.hasOffset()) { if (defaultQualification.layoutPacking != ElpStd140 && defaultQualification.layoutPacking != ElpStd430) - error(memberLoc, "can only be used with std140 or std430 layout packing", "align", ""); + error(memberLoc, "can only be used with std140 or std430 layout packing", "offset/align", ""); } TQualifier newMemberQualification = defaultQualification; @@ -5653,6 +5796,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con memberQualifier = newMemberQualification; } + layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes); + // Process the members fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation); fixBlockXfbOffsets(currentBlockQualifier, typeList); @@ -5720,6 +5865,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // Check for general layout qualifier errors layoutObjectCheck(loc, variable); + // fix up if (isIoResizeArray(blockType)) { ioArraySymbolResizeList.push_back(&variable); checkIoArraysConsistency(loc, true); @@ -5768,7 +5914,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q } // Do all block-declaration checking regarding its qualifiers. -void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool instanceName) +void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool /*instanceName*/) { // The 4.5 specification says: // @@ -5795,11 +5941,8 @@ 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) { + if (qualifier.layoutPushConstant) intermediate.addPushConstantCount(); - if (! instanceName) - error(loc, "requires an instance name", "push_constant", ""); - } } // @@ -5837,7 +5980,7 @@ void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifi if (nextLocation >= (int)TQualifier::layoutLocationEnd) error(memberLoc, "location is too large", "location", ""); memberQualifier.layoutLocation = nextLocation; - memberQualifier.layoutComponent = 0; + memberQualifier.layoutComponent = TQualifier::layoutComponentEnd; } nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type); } diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h index ff4a3945b..4c5045c9b 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h @@ -77,6 +77,10 @@ public: TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), symbolTable(symbolTable), + statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), + postEntryPointReturn(false), + contextPragma(true, false), + limits(resources.limits), parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr), globalUniformBlock(nullptr) { } @@ -133,18 +137,31 @@ public: extensionCallback(line, extension, behavior); } - TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile - // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) - // TODO: This could perhaps get its own object, but the current design doesn't work - // yet when new uniform variables are declared between function definitions, so - // this is pending getting a fully functional design. - virtual void growGlobalUniformBlock(TSourceLoc&, TType&, TString& memberName, TTypeList* typeList = nullptr); - virtual bool insertGlobalUniformBlock(); + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr); virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); + const char* const scopeMangler = "::"; + + // Basic parsing state, easily accessible to the grammar + + TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile + int statementNestingLevel; // 0 if outside all flow control or compound statements + int loopNestingLevel; // 0 if outside all loops + int structNestingLevel; // 0 if outside blocks and structures + int controlFlowNestingLevel; // 0 if outside all flow control + const TType* currentFunctionType; // the return type of the function that's currently being parsed + bool functionReturnsValue; // true if a non-void function has a return + // if inside a function, true if the function is the entry point and this is after a return statement + bool postEntryPointReturn; + // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting + TList switchSequenceStack; + // the statementNestingLevel the current switch statement is at, which must match the level of its case statements + TList switchLevel; + struct TPragma contextPragma; + protected: TParseContextBase(TParseContextBase&); TParseContextBase& operator=(TParseContextBase&); @@ -153,6 +170,8 @@ protected: TVector linkageSymbols; // these need to be transferred to 'linkage', after all editing is done TScanContext* scanContext; TPpContext* ppContext; + TBuiltInResource resources; + TLimits& limits; // These, if set, will be called when a line, pragma ... is preprocessed. // They will be called with any parameters to the original directive. @@ -175,7 +194,8 @@ protected: TVariable* globalUniformBlock; // the actual block, inserted into the symbol table int firstNewMember; // the index of the first member not yet inserted into the symbol table // override this to set the language-specific name - virtual const char* getGlobalUniformBlockName() { return ""; } + virtual const char* getGlobalUniformBlockName() const { return ""; } + virtual void setUniformBlockDefaults(TType&) const { } virtual void finalizeGlobalUniformBlockLayout(TVariable&) { } virtual void outputMessage(const TSourceLoc&, const char* szReason, const char* szToken, const char* szExtraInfoFormat, TPrefixType prefix, @@ -297,7 +317,7 @@ public: bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arrayUnsizedCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer, bool lastMember); + void arraySizesCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer, bool lastMember); void arrayOfArrayVersionCheck(const TSourceLoc&); void arrayDimCheck(const TSourceLoc&, const TArraySizes* sizes1, const TArraySizes* sizes2); void arrayDimCheck(const TSourceLoc&, const TType*, const TArraySizes*); @@ -339,6 +359,7 @@ public: void setLayoutQualifier(const TSourceLoc&, TPublicType&, TString&, const TIntermTyped*); void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); void layoutObjectCheck(const TSourceLoc&, const TSymbol&); + void layoutMemberLocationArrayCheck(const TSourceLoc&, bool memberWithLocation, TArraySizes* arraySizes); void layoutTypeCheck(const TSourceLoc&, const TType&); void layoutQualifierCheck(const TSourceLoc&, const TQualifier&); void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); @@ -372,8 +393,8 @@ protected: void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); void inheritGlobalDefaults(TQualifier& dst) const; TVariable* makeInternalVariable(const char* name, const TType&) const; - TVariable* declareNonArray(const TSourceLoc&, TString& identifier, TType&); - void declareArray(const TSourceLoc&, TString& identifier, const TType&, TSymbol*&); + TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&); + void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&); TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); void finish() override; @@ -384,17 +405,7 @@ public: // // Current state of parsing - struct TPragma contextPragma; - int loopNestingLevel; // 0 if outside all loops - int structNestingLevel; // 0 if outside blocks and structures - int controlFlowNestingLevel; // 0 if outside all flow control - int statementNestingLevel; // 0 if outside all flow control or compound statements - TList switchSequenceStack; // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting - TList switchLevel; // the statementNestingLevel the current switch statement is at, which must match the level of its case statements bool inMain; // if inside a function, true if the function is main - bool postMainReturn; // if inside a function, true if the function is main and this is after a return statement - const TType* currentFunctionType; // the return type of the function that's currently being parsed - bool functionReturnsValue; // true if a non-void function has a return const TString* blockName; TQualifier currentBlockQualifier; TPrecisionQualifier defaultPrecision[EbtNumTypes]; diff --git a/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.h b/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.h index 507307e44..1ed015626 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.h +++ b/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.h @@ -32,6 +32,8 @@ // POSSIBILITY OF SUCH DAMAGE. // +#pragma once + namespace glslang { void RemoveAllTreeNodes(TIntermNode*); diff --git a/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp b/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp index c73f30d63..fcd6328ee 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp @@ -175,7 +175,7 @@ bool TInputScanner::scanVersion(int& version, EProfile& profile, bool& notFirstT bool versionNotFirst = false; // means not first WRT comments and white space, nothing more notFirstToken = false; // means not first WRT to real tokens - version = 0; // means not found + version = 0; // means not found profile = ENoProfile; bool foundNonSpaceTab = false; @@ -464,6 +464,15 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["u64vec4"] = U64VEC4; #ifdef AMD_EXTENSIONS + (*KeywordMap)["int16_t"] = INT16_T; + (*KeywordMap)["uint16_t"] = UINT16_T; + (*KeywordMap)["i16vec2"] = I16VEC2; + (*KeywordMap)["i16vec3"] = I16VEC3; + (*KeywordMap)["i16vec4"] = I16VEC4; + (*KeywordMap)["u16vec2"] = U16VEC2; + (*KeywordMap)["u16vec3"] = U16VEC3; + (*KeywordMap)["u16vec4"] = U16VEC4; + (*KeywordMap)["float16_t"] = FLOAT16_T; (*KeywordMap)["f16vec2"] = F16VEC2; (*KeywordMap)["f16vec3"] = F16VEC3; @@ -701,10 +710,18 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case PpAtomDecrement: return DEC_OP; case PpAtomIncrement: return INC_OP; + case PpAtomColonColon: + parseContext.error(loc, "not supported", "::", ""); + break; + case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; + case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; +#endif case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; #ifdef AMD_EXTENSIONS @@ -969,6 +986,21 @@ int TScanContext::tokenizeIdentifier() return identifierOrType(); #ifdef AMD_EXTENSIONS + case INT16_T: + case UINT16_T: + case I16VEC2: + case I16VEC3: + case I16VEC4: + case U16VEC2: + case U16VEC3: + case U16VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); + case FLOAT16_T: case F16VEC2: case F16VEC3: diff --git a/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h b/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h index 1d86348eb..608ae067e 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h +++ b/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h @@ -38,6 +38,8 @@ // sits between the preprocessor scanner and parser. // +#pragma once + #include "ParseHelper.h" namespace glslang { diff --git a/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp b/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp index b0e55132a..bb3f4f736 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -442,7 +442,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo bool correct = true; if (source == EShSourceHlsl) { - version = 450; // TODO: GLSL parser is still used for builtins. + version = 500; // shader model; currently a characteristic of glslang, not the input profile = ECoreProfile; // allow doubles in prototype parsing return correct; } @@ -566,41 +566,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo } } - // A meta check on the condition of the compiler itself... - switch (version) { - - // ES versions - case 100: - case 300: - // versions are complete - break; - - // Desktop versions - case 110: - case 120: - case 130: - case 140: - case 150: - case 330: - // versions are complete - break; - - case 310: - case 400: - case 410: - case 420: - case 430: - case 440: - case 450: - infoSink.info << "Warning, version " << version << " is not yet complete; most version-specific features are present, but some are missing.\n"; - break; - - default: - infoSink.info << "Warning, version " << version << " is unknown.\n"; - break; - - } - return correct; } @@ -679,13 +644,13 @@ bool ProcessDeferred( // First, without using the preprocessor or parser, find the #version, so we know what // symbol tables, processing rules, etc. to set up. This does not need the extra strings // outlined above, just the user shader. - int version; - EProfile profile; glslang::TInputScanner userInput(numStrings, &strings[numPre], &lengths[numPre]); // no preamble - bool versionNotFirstToken; - bool versionNotFirst = userInput.scanVersion(version, profile, versionNotFirstToken); + int version = 0; + EProfile profile = ENoProfile; + bool versionNotFirstToken = false; + bool versionNotFirst = (messages & EShMsgReadHlsl) ? true : userInput.scanVersion(version, profile, versionNotFirstToken); bool versionNotFound = version == 0; - if (forceDefaultVersionAndProfile) { + if (forceDefaultVersionAndProfile && (messages & EShMsgReadHlsl) == 0) { if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound && (version != defaultVersion || profile != defaultProfile)) { compiler->infoSink.info << "Warning, (version, profile) forced to be (" @@ -726,6 +691,13 @@ bool ProcessDeferred( intermediate.setSpv(spvVersion); if (spvVersion.vulkan >= 100) intermediate.setOriginUpperLeft(); + if ((messages & EShMsgHlslOffsets) || (messages & EShMsgReadHlsl)) + intermediate.setHlslOffsets(); + if (messages & EShMsgDebugInfo) { + intermediate.setSourceFile(names[numPre]); + for (int s = 0; s < numStrings; ++s) + intermediate.addSourceText(strings[numPre]); + } SetupBuiltinSymbolTable(version, profile, spvVersion, source); TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] @@ -1553,13 +1525,30 @@ void TShader::setSourceEntryPoint(const char* name) sourceEntryPointName = name; } +// Set binding base for sampler types void TShader::setShiftSamplerBinding(unsigned int base) { intermediate->setShiftSamplerBinding(base); } +// Set binding base for texture types (SRV) void TShader::setShiftTextureBinding(unsigned int base) { intermediate->setShiftTextureBinding(base); } +// Set binding base for image types void TShader::setShiftImageBinding(unsigned int base) { intermediate->setShiftImageBinding(base); } +// Set binding base for uniform buffer objects (CBV) void TShader::setShiftUboBinding(unsigned int base) { intermediate->setShiftUboBinding(base); } +// Synonym for setShiftUboBinding, to match HLSL language. +void TShader::setShiftCbufferBinding(unsigned int base) { intermediate->setShiftUboBinding(base); } +// Set binding base for UAV (unordered access view) +void TShader::setShiftUavBinding(unsigned int base) { intermediate->setShiftUavBinding(base); } +// Set binding base for SSBOs +void TShader::setShiftSsboBinding(unsigned int base) { intermediate->setShiftSsboBinding(base); } +// Enables binding automapping using TIoMapper void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } +// Fragile: currently within one stage: simple auto-assignment of location +void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } +// See comment above TDefaultHlslIoMapper in iomapper.cpp: +void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); } void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); } +void TShader::setResourceSetBinding(const std::vector& base) { intermediate->setResourceSetBinding(base); } +void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); } // // Turn the shader strings into a parse tree in the TIntermediate. @@ -1583,11 +1572,6 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion forwardCompatible, messages, *intermediate, includer, sourceEntryPointName); } -bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages) -{ - return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages); -} - // Fill in a string with the result of preprocessing ShaderStrings // Returns true if all extensions, pragmas and version strings were valid. bool TShader::preprocess(const TBuiltInResource* builtInResources, @@ -1775,6 +1759,7 @@ const char* TProgram::getUniformBlockName(int index) const { return reflection int TProgram::getUniformBlockSize(int index) const { return reflection->getUniformBlock(index).size; } int TProgram::getUniformIndex(const char* name) const { return reflection->getIndex(name); } int TProgram::getUniformBlockIndex(int index) const { return reflection->getUniform(index).index; } +int TProgram::getUniformBlockCounterIndex(int index) const { return reflection->getUniformBlock(index).counterIndex; } int TProgram::getUniformType(int index) const { return reflection->getUniform(index).glDefineType; } int TProgram::getUniformBufferOffset(int index) const { return reflection->getUniform(index).offset; } int TProgram::getUniformArraySize(int index) const { return reflection->getUniform(index).size; } @@ -1784,6 +1769,7 @@ int TProgram::getAttributeType(int index) const { return reflection const TType* TProgram::getAttributeTType(int index) const { return reflection->getAttribute(index).getType(); } const TType* TProgram::getUniformTType(int index) const { return reflection->getUniform(index).getType(); } const TType* TProgram::getUniformBlockTType(int index) const { return reflection->getUniformBlock(index).getType(); } +unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); } void TProgram::dumpReflection() { reflection->dump(); } diff --git a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp index 080a5e0f4..d7f9e1d99 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -50,7 +50,7 @@ namespace glslang { // // Recursively generate mangled names. // -void TType::buildMangledName(TString& mangledName) +void TType::buildMangledName(TString& mangledName) const { if (isMatrix()) mangledName += 'm'; @@ -67,6 +67,10 @@ void TType::buildMangledName(TString& mangledName) case EbtUint: mangledName += 'u'; break; case EbtInt64: mangledName += "i64"; break; case EbtUint64: mangledName += "u64"; break; +#ifdef AMD_EXTENSIONS + case EbtInt16: mangledName += "i16"; break; + case EbtUint16: mangledName += "u16"; break; +#endif case EbtBool: mangledName += 'b'; break; case EbtAtomicUint: mangledName += "au"; break; case EbtSampler: @@ -99,11 +103,23 @@ void TType::buildMangledName(TString& mangledName) case EsdSubpass: mangledName += "P"; break; default: break; // some compilers want this } + + switch (sampler.vectorSize) { + case 1: mangledName += "1"; break; + case 2: mangledName += "2"; break; + case 3: mangledName += "3"; break; + case 4: break; // default to prior name mangle behavior + } + if (sampler.ms) mangledName += "M"; break; case EbtStruct: - mangledName += "struct-"; + case EbtBlock: + if (basicType == EbtStruct) + mangledName += "struct-"; + else + mangledName += "block-"; if (typeName) mangledName += *typeName; for (unsigned int i = 0; i < structure->size(); ++i) { @@ -295,6 +311,8 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf) op = copyOf.op; defined = copyOf.defined; prototyped = copyOf.prototyped; + implicitThis = copyOf.implicitThis; + illegalImplicitThis = copyOf.illegalImplicitThis; defaultParamCount = copyOf.defaultParamCount; } @@ -319,6 +337,7 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const { TSymbolTableLevel *symTableLevel = new TSymbolTableLevel(); symTableLevel->anonId = anonId; + symTableLevel->thisLevel = thisLevel; std::vector containerCopied(anonId, false); tLevel::const_iterator iter; for (iter = level.begin(); iter != level.end(); ++iter) { diff --git a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h index 29ee40e15..f928b7aed 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h @@ -198,7 +198,6 @@ struct TParameter { TString *name; TType* type; TIntermTyped* defaultValue; - TBuiltInVariable declaredBuiltIn; void copyParam(const TParameter& param) { if (param.name) @@ -207,8 +206,8 @@ struct TParameter { name = 0; type = param.type->clone(); defaultValue = param.defaultValue; - declaredBuiltIn = param.declaredBuiltIn; } + TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; } }; // @@ -219,48 +218,70 @@ public: explicit TFunction(TOperator o) : TSymbol(0), op(o), - defined(false), prototyped(false), defaultParamCount(0) { } + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { } TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) : TSymbol(name), mangledName(*name + '('), op(tOp), - defined(false), prototyped(false), defaultParamCount(0) + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { returnType.shallowCopy(retType); declaredBuiltIn = retType.getQualifier().builtIn; } - virtual TFunction* clone() const; + virtual TFunction* clone() const override; virtual ~TFunction(); - virtual TFunction* getAsFunction() { return this; } - virtual const TFunction* getAsFunction() const { return this; } + virtual TFunction* getAsFunction() override { return this; } + virtual const TFunction* getAsFunction() const override { return this; } + // Install 'p' as the (non-'this') last parameter. + // Non-'this' parameters are reflected in both the list of parameters and the + // mangled name. virtual void addParameter(TParameter& p) { assert(writable); - p.declaredBuiltIn = p.type->getQualifier().builtIn; parameters.push_back(p); p.type->appendMangledName(mangledName); if (p.defaultValue != nullptr) defaultParamCount++; } + + // Install 'this' as the first parameter. + // 'this' is reflected in the list of parameters, but not the mangled name. + virtual void addThisParameter(TType& type, const char* name) + { + TParameter p = { NewPoolTString(name), new TType, nullptr }; + p.type->shallowCopy(type); + parameters.insert(parameters.begin(), p); + } + virtual void addPrefix(const char* prefix) override { TSymbol::addPrefix(prefix); mangledName.insert(0, prefix); } - virtual const TString& getMangledName() const { return mangledName; } - virtual const TType& getType() const { return returnType; } + virtual void removePrefix(const TString& prefix) + { + assert(mangledName.compare(0, prefix.size(), prefix) == 0); + mangledName.erase(0, prefix.size()); + } + + virtual const TString& getMangledName() const override { return mangledName; } + virtual const TType& getType() const override { return returnType; } virtual TBuiltInVariable getDeclaredBuiltInType() const { return declaredBuiltIn; } - virtual TType& getWritableType() { return returnType; } + virtual TType& getWritableType() override { return returnType; } virtual void relateToOperator(TOperator o) { assert(writable); op = o; } virtual TOperator getBuiltInOp() const { return op; } virtual void setDefined() { assert(writable); defined = true; } virtual bool isDefined() const { return defined; } virtual void setPrototyped() { assert(writable); prototyped = true; } virtual bool isPrototyped() const { return prototyped; } + virtual void setImplicitThis() { assert(writable); implicitThis = true; } + virtual bool hasImplicitThis() const { return implicitThis; } + virtual void setIllegalImplicitThis() { assert(writable); illegalImplicitThis = true; } + virtual bool hasIllegalImplicitThis() const { return illegalImplicitThis; } // Return total number of parameters virtual int getParamCount() const { return static_cast(parameters.size()); } @@ -272,7 +293,7 @@ public: virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; } virtual const TParameter& operator[](int i) const { return parameters[i]; } - virtual void dump(TInfoSink &infoSink) const; + virtual void dump(TInfoSink &infoSink) const override; protected: explicit TFunction(const TFunction&); @@ -287,6 +308,11 @@ protected: TOperator op; bool defined; bool prototyped; + bool implicitThis; // True if this function is allowed to see all members of 'this' + bool illegalImplicitThis; // True if this function is not supposed to have access to dynamic members of 'this', + // even if it finds member variables in the symbol table. + // This is important for a static member function that has member variables in scope, + // but is not allowed to use them, or see hidden symbols instead. int defaultParamCount; }; @@ -334,7 +360,7 @@ protected: class TSymbolTableLevel { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSymbolTableLevel() : defaultPrecision(0), anonId(0) { } + TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { } ~TSymbolTableLevel(); bool insert(TSymbol& symbol, bool separateNameSpaces) @@ -492,6 +518,9 @@ public: TSymbolTableLevel* clone() const; void readOnly(); + void setThisLevel() { thisLevel = true; } + bool isThisLevel() const { return thisLevel; } + protected: explicit TSymbolTableLevel(TSymbolTableLevel&); TSymbolTableLevel& operator=(TSymbolTableLevel&); @@ -503,6 +532,8 @@ protected: tLevel level; // named mappings TPrecisionQualifier *defaultPrecision; int anonId; + bool thisLevel; // True if this level of the symbol table is a structure scope containing member function + // that are supposed to see anonymous access to member variables. }; class TSymbolTable { @@ -559,6 +590,20 @@ public: table.push_back(new TSymbolTableLevel); } + // Make a new symbol-table level to represent the scope introduced by a structure + // containing member functions, such that the member functions can find anonymous + // references to member variables. + // + // 'thisSymbol' should have a name of "" to trigger anonymous structure-member + // symbol finds. + void pushThis(TSymbol& thisSymbol) + { + assert(thisSymbol.getName().size() == 0); + table.push_back(new TSymbolTableLevel); + table.back()->setThisLevel(); + insert(thisSymbol); + } + void pop(TPrecisionQualifier *p) { table[currentLevel()]->getPreviousDefaultPrecisions(p); @@ -645,19 +690,50 @@ public: } } - TSymbol* find(const TString& name, bool* builtIn = 0, bool *currentScope = 0) + // Normal find of a symbol, that can optionally say whether the symbol was found + // at a built-in level or the current top-scope level. + TSymbol* find(const TString& name, bool* builtIn = 0, bool* currentScope = 0, int* thisDepthP = 0) { int level = currentLevel(); TSymbol* symbol; + int thisDepth = 0; do { + if (table[level]->isThisLevel()) + ++thisDepth; symbol = table[level]->find(name); --level; - } while (symbol == 0 && level >= 0); + } while (symbol == nullptr && level >= 0); level++; if (builtIn) *builtIn = isBuiltInLevel(level); if (currentScope) *currentScope = isGlobalLevel(currentLevel()) || level == currentLevel(); // consider shared levels as "current scope" WRT user globals + if (thisDepthP != nullptr) { + if (! table[level]->isThisLevel()) + thisDepth = 0; + *thisDepthP = thisDepth; + } + + return symbol; + } + + // Find of a symbol that returns how many layers deep of nested + // structures-with-member-functions ('this' scopes) deep the symbol was + // found in. + TSymbol* find(const TString& name, int& thisDepth) + { + int level = currentLevel(); + TSymbol* symbol; + thisDepth = 0; + do { + if (table[level]->isThisLevel()) + ++thisDepth; + symbol = table[level]->find(name); + --level; + } while (symbol == 0 && level >= 0); + + if (! table[level + 1]->isThisLevel()) + thisDepth = 0; return symbol; } diff --git a/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp b/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp index 339b0baa6..dda5fa8cf 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp @@ -195,6 +195,8 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_AMD_shader_explicit_vertex_parameter] = EBhDisable; extensionBehavior[E_GL_AMD_gcn_shader] = EBhDisable; extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable; + extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable; #endif #ifdef NV_EXTENSIONS @@ -233,6 +235,10 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_OES_tessellation_point_size] = EBhDisable; extensionBehavior[E_GL_OES_texture_buffer] = EBhDisable; extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisable; + + // EXT extensions + extensionBehavior[E_GL_EXT_device_group] = EBhDisable; + extensionBehavior[E_GL_EXT_multiview] = EBhDisable; } // Get code that is not part of a shared symbol table, is specific to this shader, @@ -315,6 +321,8 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_AMD_shader_explicit_vertex_parameter 1\n" "#define GL_AMD_gcn_shader 1\n" "#define GL_AMD_gpu_shader_half_float 1\n" + "#define GL_AMD_texture_gather_bias_lod 1\n" + "#define GL_AMD_gpu_shader_int16 1\n" #endif #ifdef NV_EXTENSIONS @@ -323,6 +331,22 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_viewport_array2 1\n" #endif ; + + if (version >= 150) { + // define GL_core_profile and GL_compatibility_profile + preamble += "#define GL_core_profile 1\n"; + + if (profile == ECompatibilityProfile) + preamble += "#define GL_compatibility_profile 1\n"; + } + } + + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + preamble += + "#define GL_EXT_device_group 1\n" + "#define GL_EXT_multiview 1\n" + ; } // #line and #include @@ -481,6 +505,11 @@ void TParseVersions::requireNotRemoved(const TSourceLoc& loc, int profileMask, i } } +void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc) +{ + error(loc, "feature not yet implemented", featureDesc, ""); +} + // Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false. // Warns appropriately if the requested behavior of an extension is "warn". bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) @@ -686,10 +715,21 @@ void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) } #ifdef AMD_EXTENSIONS +// Call for any operation needing GLSL 16-bit integer data-type support. +void TParseVersions::int16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_int16, "shader int16"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + // Call for any operation needing GLSL float16 data-type support. void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) { - if (!builtIn) { + if (! builtIn) { requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, "shader half float"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); diff --git a/src/libraries/glslang/glslang/MachineIndependent/Versions.h b/src/libraries/glslang/glslang/MachineIndependent/Versions.h index 0498deffa..a89ba0914 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/Versions.h +++ b/src/libraries/glslang/glslang/MachineIndependent/Versions.h @@ -133,6 +133,10 @@ const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; +// EXT extensions +const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; +const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; + // #line and #include const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive"; const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive"; @@ -143,7 +147,10 @@ const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter"; const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader"; const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float"; +const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; +const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; #endif + #ifdef NV_EXTENSIONS const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage"; diff --git a/src/libraries/glslang/glslang/MachineIndependent/gl_types.h b/src/libraries/glslang/glslang/MachineIndependent/gl_types.h index d7cb31fe3..ae00ae57e 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/gl_types.h +++ b/src/libraries/glslang/glslang/MachineIndependent/gl_types.h @@ -21,6 +21,8 @@ ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ +#pragma once + #define GL_FLOAT 0x1406 #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 diff --git a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp index 3507c04e6..54a927cc9 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 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 . */ @@ -26,7 +26,7 @@ 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. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,8 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 41 "glslang.y" +#line 41 "MachineIndependent/glslang.y" /* yacc.c:339 */ /* Based on: @@ -88,14 +87,13 @@ Jutta Degener, 1995 using namespace glslang; -/* Line 371 of yacc.c */ -#line 93 "glslang_tab.cpp" +#line 91 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -104,14 +102,14 @@ using namespace glslang; # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else -# define YYERROR_VERBOSE 0 +# define YYERROR_VERBOSE 1 #endif /* In a future release of Bison, this section will be replaced by #include "glslang_tab.cpp.h". */ -#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED -/* Enabling traces. */ +#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -119,306 +117,315 @@ using namespace glslang; extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #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, - INT64_T = 266, - UINT64_T = 267, - FLOAT16_T = 268, - BREAK = 269, - CONTINUE = 270, - DO = 271, - ELSE = 272, - FOR = 273, - IF = 274, - DISCARD = 275, - RETURN = 276, - SWITCH = 277, - CASE = 278, - DEFAULT = 279, - SUBROUTINE = 280, - BVEC2 = 281, - BVEC3 = 282, - BVEC4 = 283, - IVEC2 = 284, - IVEC3 = 285, - IVEC4 = 286, - I64VEC2 = 287, - I64VEC3 = 288, - I64VEC4 = 289, - UVEC2 = 290, - UVEC3 = 291, - UVEC4 = 292, - U64VEC2 = 293, - U64VEC3 = 294, - U64VEC4 = 295, - VEC2 = 296, - VEC3 = 297, - VEC4 = 298, - MAT2 = 299, - MAT3 = 300, - MAT4 = 301, - CENTROID = 302, - IN = 303, - OUT = 304, - INOUT = 305, - UNIFORM = 306, - PATCH = 307, - SAMPLE = 308, - BUFFER = 309, - SHARED = 310, - COHERENT = 311, - VOLATILE = 312, - RESTRICT = 313, - READONLY = 314, - WRITEONLY = 315, - DVEC2 = 316, - DVEC3 = 317, - DVEC4 = 318, - DMAT2 = 319, - DMAT3 = 320, - DMAT4 = 321, - F16VEC2 = 322, - F16VEC3 = 323, - F16VEC4 = 324, - F16MAT2 = 325, - F16MAT3 = 326, - F16MAT4 = 327, - NOPERSPECTIVE = 328, - FLAT = 329, - SMOOTH = 330, - LAYOUT = 331, - __EXPLICITINTERPAMD = 332, - MAT2X2 = 333, - MAT2X3 = 334, - MAT2X4 = 335, - MAT3X2 = 336, - MAT3X3 = 337, - MAT3X4 = 338, - MAT4X2 = 339, - MAT4X3 = 340, - MAT4X4 = 341, - DMAT2X2 = 342, - DMAT2X3 = 343, - DMAT2X4 = 344, - DMAT3X2 = 345, - DMAT3X3 = 346, - DMAT3X4 = 347, - DMAT4X2 = 348, - DMAT4X3 = 349, - DMAT4X4 = 350, - F16MAT2X2 = 351, - F16MAT2X3 = 352, - F16MAT2X4 = 353, - F16MAT3X2 = 354, - F16MAT3X3 = 355, - F16MAT3X4 = 356, - F16MAT4X2 = 357, - F16MAT4X3 = 358, - F16MAT4X4 = 359, - ATOMIC_UINT = 360, - SAMPLER1D = 361, - SAMPLER2D = 362, - SAMPLER3D = 363, - SAMPLERCUBE = 364, - SAMPLER1DSHADOW = 365, - SAMPLER2DSHADOW = 366, - SAMPLERCUBESHADOW = 367, - SAMPLER1DARRAY = 368, - SAMPLER2DARRAY = 369, - SAMPLER1DARRAYSHADOW = 370, - SAMPLER2DARRAYSHADOW = 371, - ISAMPLER1D = 372, - ISAMPLER2D = 373, - ISAMPLER3D = 374, - ISAMPLERCUBE = 375, - ISAMPLER1DARRAY = 376, - ISAMPLER2DARRAY = 377, - USAMPLER1D = 378, - USAMPLER2D = 379, - USAMPLER3D = 380, - USAMPLERCUBE = 381, - USAMPLER1DARRAY = 382, - USAMPLER2DARRAY = 383, - SAMPLER2DRECT = 384, - SAMPLER2DRECTSHADOW = 385, - ISAMPLER2DRECT = 386, - USAMPLER2DRECT = 387, - SAMPLERBUFFER = 388, - ISAMPLERBUFFER = 389, - USAMPLERBUFFER = 390, - SAMPLERCUBEARRAY = 391, - SAMPLERCUBEARRAYSHADOW = 392, - ISAMPLERCUBEARRAY = 393, - USAMPLERCUBEARRAY = 394, - SAMPLER2DMS = 395, - ISAMPLER2DMS = 396, - USAMPLER2DMS = 397, - SAMPLER2DMSARRAY = 398, - ISAMPLER2DMSARRAY = 399, - USAMPLER2DMSARRAY = 400, - SAMPLEREXTERNALOES = 401, - SAMPLER = 402, - SAMPLERSHADOW = 403, - TEXTURE1D = 404, - TEXTURE2D = 405, - TEXTURE3D = 406, - TEXTURECUBE = 407, - TEXTURE1DARRAY = 408, - TEXTURE2DARRAY = 409, - ITEXTURE1D = 410, - ITEXTURE2D = 411, - ITEXTURE3D = 412, - ITEXTURECUBE = 413, - ITEXTURE1DARRAY = 414, - ITEXTURE2DARRAY = 415, - UTEXTURE1D = 416, - UTEXTURE2D = 417, - UTEXTURE3D = 418, - UTEXTURECUBE = 419, - UTEXTURE1DARRAY = 420, - UTEXTURE2DARRAY = 421, - TEXTURE2DRECT = 422, - ITEXTURE2DRECT = 423, - UTEXTURE2DRECT = 424, - TEXTUREBUFFER = 425, - ITEXTUREBUFFER = 426, - UTEXTUREBUFFER = 427, - TEXTURECUBEARRAY = 428, - ITEXTURECUBEARRAY = 429, - UTEXTURECUBEARRAY = 430, - TEXTURE2DMS = 431, - ITEXTURE2DMS = 432, - UTEXTURE2DMS = 433, - TEXTURE2DMSARRAY = 434, - ITEXTURE2DMSARRAY = 435, - UTEXTURE2DMSARRAY = 436, - SUBPASSINPUT = 437, - SUBPASSINPUTMS = 438, - ISUBPASSINPUT = 439, - ISUBPASSINPUTMS = 440, - USUBPASSINPUT = 441, - USUBPASSINPUTMS = 442, - IMAGE1D = 443, - IIMAGE1D = 444, - UIMAGE1D = 445, - IMAGE2D = 446, - IIMAGE2D = 447, - UIMAGE2D = 448, - IMAGE3D = 449, - IIMAGE3D = 450, - UIMAGE3D = 451, - IMAGE2DRECT = 452, - IIMAGE2DRECT = 453, - UIMAGE2DRECT = 454, - IMAGECUBE = 455, - IIMAGECUBE = 456, - UIMAGECUBE = 457, - IMAGEBUFFER = 458, - IIMAGEBUFFER = 459, - UIMAGEBUFFER = 460, - IMAGE1DARRAY = 461, - IIMAGE1DARRAY = 462, - UIMAGE1DARRAY = 463, - IMAGE2DARRAY = 464, - IIMAGE2DARRAY = 465, - UIMAGE2DARRAY = 466, - IMAGECUBEARRAY = 467, - IIMAGECUBEARRAY = 468, - UIMAGECUBEARRAY = 469, - IMAGE2DMS = 470, - IIMAGE2DMS = 471, - UIMAGE2DMS = 472, - IMAGE2DMSARRAY = 473, - IIMAGE2DMSARRAY = 474, - UIMAGE2DMSARRAY = 475, - STRUCT = 476, - VOID = 477, - WHILE = 478, - IDENTIFIER = 479, - TYPE_NAME = 480, - FLOATCONSTANT = 481, - DOUBLECONSTANT = 482, - INTCONSTANT = 483, - UINTCONSTANT = 484, - INT64CONSTANT = 485, - UINT64CONSTANT = 486, - BOOLCONSTANT = 487, - FLOAT16CONSTANT = 488, - LEFT_OP = 489, - RIGHT_OP = 490, - INC_OP = 491, - DEC_OP = 492, - LE_OP = 493, - GE_OP = 494, - EQ_OP = 495, - NE_OP = 496, - AND_OP = 497, - OR_OP = 498, - XOR_OP = 499, - MUL_ASSIGN = 500, - DIV_ASSIGN = 501, - ADD_ASSIGN = 502, - MOD_ASSIGN = 503, - LEFT_ASSIGN = 504, - RIGHT_ASSIGN = 505, - AND_ASSIGN = 506, - XOR_ASSIGN = 507, - OR_ASSIGN = 508, - SUB_ASSIGN = 509, - LEFT_PAREN = 510, - RIGHT_PAREN = 511, - LEFT_BRACKET = 512, - RIGHT_BRACKET = 513, - LEFT_BRACE = 514, - RIGHT_BRACE = 515, - DOT = 516, - COMMA = 517, - COLON = 518, - EQUAL = 519, - SEMICOLON = 520, - BANG = 521, - DASH = 522, - TILDE = 523, - PLUS = 524, - STAR = 525, - SLASH = 526, - PERCENT = 527, - LEFT_ANGLE = 528, - RIGHT_ANGLE = 529, - VERTICAL_BAR = 530, - CARET = 531, - AMPERSAND = 532, - QUESTION = 533, - INVARIANT = 534, - PRECISE = 535, - HIGH_PRECISION = 536, - MEDIUM_PRECISION = 537, - LOW_PRECISION = 538, - PRECISION = 539, - PACKED = 540, - RESOURCE = 541, - SUPERP = 542 - }; + enum yytokentype + { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + INT64_T = 266, + UINT64_T = 267, + INT16_T = 268, + UINT16_T = 269, + FLOAT16_T = 270, + BREAK = 271, + CONTINUE = 272, + DO = 273, + ELSE = 274, + FOR = 275, + IF = 276, + DISCARD = 277, + RETURN = 278, + SWITCH = 279, + CASE = 280, + DEFAULT = 281, + SUBROUTINE = 282, + BVEC2 = 283, + BVEC3 = 284, + BVEC4 = 285, + IVEC2 = 286, + IVEC3 = 287, + IVEC4 = 288, + I64VEC2 = 289, + I64VEC3 = 290, + I64VEC4 = 291, + UVEC2 = 292, + UVEC3 = 293, + UVEC4 = 294, + U64VEC2 = 295, + U64VEC3 = 296, + U64VEC4 = 297, + VEC2 = 298, + VEC3 = 299, + VEC4 = 300, + MAT2 = 301, + MAT3 = 302, + MAT4 = 303, + CENTROID = 304, + IN = 305, + OUT = 306, + INOUT = 307, + UNIFORM = 308, + PATCH = 309, + SAMPLE = 310, + BUFFER = 311, + SHARED = 312, + COHERENT = 313, + VOLATILE = 314, + RESTRICT = 315, + READONLY = 316, + WRITEONLY = 317, + DVEC2 = 318, + DVEC3 = 319, + DVEC4 = 320, + DMAT2 = 321, + DMAT3 = 322, + DMAT4 = 323, + F16VEC2 = 324, + F16VEC3 = 325, + F16VEC4 = 326, + F16MAT2 = 327, + F16MAT3 = 328, + F16MAT4 = 329, + I16VEC2 = 330, + I16VEC3 = 331, + I16VEC4 = 332, + U16VEC2 = 333, + U16VEC3 = 334, + U16VEC4 = 335, + NOPERSPECTIVE = 336, + FLAT = 337, + SMOOTH = 338, + LAYOUT = 339, + __EXPLICITINTERPAMD = 340, + MAT2X2 = 341, + MAT2X3 = 342, + MAT2X4 = 343, + MAT3X2 = 344, + MAT3X3 = 345, + MAT3X4 = 346, + MAT4X2 = 347, + MAT4X3 = 348, + MAT4X4 = 349, + DMAT2X2 = 350, + DMAT2X3 = 351, + DMAT2X4 = 352, + DMAT3X2 = 353, + DMAT3X3 = 354, + DMAT3X4 = 355, + DMAT4X2 = 356, + DMAT4X3 = 357, + DMAT4X4 = 358, + F16MAT2X2 = 359, + F16MAT2X3 = 360, + F16MAT2X4 = 361, + F16MAT3X2 = 362, + F16MAT3X3 = 363, + F16MAT3X4 = 364, + F16MAT4X2 = 365, + F16MAT4X3 = 366, + F16MAT4X4 = 367, + ATOMIC_UINT = 368, + SAMPLER1D = 369, + SAMPLER2D = 370, + SAMPLER3D = 371, + SAMPLERCUBE = 372, + SAMPLER1DSHADOW = 373, + SAMPLER2DSHADOW = 374, + SAMPLERCUBESHADOW = 375, + SAMPLER1DARRAY = 376, + SAMPLER2DARRAY = 377, + SAMPLER1DARRAYSHADOW = 378, + SAMPLER2DARRAYSHADOW = 379, + ISAMPLER1D = 380, + ISAMPLER2D = 381, + ISAMPLER3D = 382, + ISAMPLERCUBE = 383, + ISAMPLER1DARRAY = 384, + ISAMPLER2DARRAY = 385, + USAMPLER1D = 386, + USAMPLER2D = 387, + USAMPLER3D = 388, + USAMPLERCUBE = 389, + USAMPLER1DARRAY = 390, + USAMPLER2DARRAY = 391, + SAMPLER2DRECT = 392, + SAMPLER2DRECTSHADOW = 393, + ISAMPLER2DRECT = 394, + USAMPLER2DRECT = 395, + SAMPLERBUFFER = 396, + ISAMPLERBUFFER = 397, + USAMPLERBUFFER = 398, + SAMPLERCUBEARRAY = 399, + SAMPLERCUBEARRAYSHADOW = 400, + ISAMPLERCUBEARRAY = 401, + USAMPLERCUBEARRAY = 402, + SAMPLER2DMS = 403, + ISAMPLER2DMS = 404, + USAMPLER2DMS = 405, + SAMPLER2DMSARRAY = 406, + ISAMPLER2DMSARRAY = 407, + USAMPLER2DMSARRAY = 408, + SAMPLEREXTERNALOES = 409, + SAMPLER = 410, + SAMPLERSHADOW = 411, + TEXTURE1D = 412, + TEXTURE2D = 413, + TEXTURE3D = 414, + TEXTURECUBE = 415, + TEXTURE1DARRAY = 416, + TEXTURE2DARRAY = 417, + ITEXTURE1D = 418, + ITEXTURE2D = 419, + ITEXTURE3D = 420, + ITEXTURECUBE = 421, + ITEXTURE1DARRAY = 422, + ITEXTURE2DARRAY = 423, + UTEXTURE1D = 424, + UTEXTURE2D = 425, + UTEXTURE3D = 426, + UTEXTURECUBE = 427, + UTEXTURE1DARRAY = 428, + UTEXTURE2DARRAY = 429, + TEXTURE2DRECT = 430, + ITEXTURE2DRECT = 431, + UTEXTURE2DRECT = 432, + TEXTUREBUFFER = 433, + ITEXTUREBUFFER = 434, + UTEXTUREBUFFER = 435, + TEXTURECUBEARRAY = 436, + ITEXTURECUBEARRAY = 437, + UTEXTURECUBEARRAY = 438, + TEXTURE2DMS = 439, + ITEXTURE2DMS = 440, + UTEXTURE2DMS = 441, + TEXTURE2DMSARRAY = 442, + ITEXTURE2DMSARRAY = 443, + UTEXTURE2DMSARRAY = 444, + SUBPASSINPUT = 445, + SUBPASSINPUTMS = 446, + ISUBPASSINPUT = 447, + ISUBPASSINPUTMS = 448, + USUBPASSINPUT = 449, + USUBPASSINPUTMS = 450, + IMAGE1D = 451, + IIMAGE1D = 452, + UIMAGE1D = 453, + IMAGE2D = 454, + IIMAGE2D = 455, + UIMAGE2D = 456, + IMAGE3D = 457, + IIMAGE3D = 458, + UIMAGE3D = 459, + IMAGE2DRECT = 460, + IIMAGE2DRECT = 461, + UIMAGE2DRECT = 462, + IMAGECUBE = 463, + IIMAGECUBE = 464, + UIMAGECUBE = 465, + IMAGEBUFFER = 466, + IIMAGEBUFFER = 467, + UIMAGEBUFFER = 468, + IMAGE1DARRAY = 469, + IIMAGE1DARRAY = 470, + UIMAGE1DARRAY = 471, + IMAGE2DARRAY = 472, + IIMAGE2DARRAY = 473, + UIMAGE2DARRAY = 474, + IMAGECUBEARRAY = 475, + IIMAGECUBEARRAY = 476, + UIMAGECUBEARRAY = 477, + IMAGE2DMS = 478, + IIMAGE2DMS = 479, + UIMAGE2DMS = 480, + IMAGE2DMSARRAY = 481, + IIMAGE2DMSARRAY = 482, + UIMAGE2DMSARRAY = 483, + STRUCT = 484, + VOID = 485, + WHILE = 486, + IDENTIFIER = 487, + TYPE_NAME = 488, + FLOATCONSTANT = 489, + DOUBLECONSTANT = 490, + INTCONSTANT = 491, + UINTCONSTANT = 492, + INT64CONSTANT = 493, + UINT64CONSTANT = 494, + INT16CONSTANT = 495, + UINT16CONSTANT = 496, + BOOLCONSTANT = 497, + FLOAT16CONSTANT = 498, + LEFT_OP = 499, + RIGHT_OP = 500, + INC_OP = 501, + DEC_OP = 502, + LE_OP = 503, + GE_OP = 504, + EQ_OP = 505, + NE_OP = 506, + AND_OP = 507, + OR_OP = 508, + XOR_OP = 509, + MUL_ASSIGN = 510, + DIV_ASSIGN = 511, + ADD_ASSIGN = 512, + MOD_ASSIGN = 513, + LEFT_ASSIGN = 514, + RIGHT_ASSIGN = 515, + AND_ASSIGN = 516, + XOR_ASSIGN = 517, + OR_ASSIGN = 518, + SUB_ASSIGN = 519, + LEFT_PAREN = 520, + RIGHT_PAREN = 521, + LEFT_BRACKET = 522, + RIGHT_BRACKET = 523, + LEFT_BRACE = 524, + RIGHT_BRACE = 525, + DOT = 526, + COMMA = 527, + COLON = 528, + EQUAL = 529, + SEMICOLON = 530, + BANG = 531, + DASH = 532, + TILDE = 533, + PLUS = 534, + STAR = 535, + SLASH = 536, + PERCENT = 537, + LEFT_ANGLE = 538, + RIGHT_ANGLE = 539, + VERTICAL_BAR = 540, + CARET = 541, + AMPERSAND = 542, + QUESTION = 543, + INVARIANT = 544, + PRECISE = 545, + HIGH_PRECISION = 546, + MEDIUM_PRECISION = 547, + LOW_PRECISION = 548, + PRECISION = 549, + PACKED = 550, + RESOURCE = 551, + SUPERP = 552 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 66 "glslang.y" +#line 68 "MachineIndependent/glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -452,35 +459,22 @@ typedef union YYSTYPE }; } interm; +#line 463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 458 "glslang_tab.cpp" -} YYSTYPE; +typedef union YYSTYPE 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_GLSLANG_TAB_CPP_H_INCLUDED */ +int yyparse (glslang::TParseContext* pParseContext); + +#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 100 "glslang.y" +#line 102 "MachineIndependent/glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -496,8 +490,7 @@ int yyparse (); extern int yylex(YYSTYPE*, TParseContext&); -/* Line 390 of yacc.c */ -#line 501 "glslang_tab.cpp" +#line 494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -511,11 +504,8 @@ typedef unsigned char yytype_uint8; #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; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -535,8 +525,7 @@ typedef short int yytype_int16; # 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) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -558,6 +547,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -565,23 +581,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#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 -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#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 + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -600,8 +618,7 @@ YYID (yyi) # 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) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -613,8 +630,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (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 @@ -630,7 +647,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -638,15 +655,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS 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) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -656,7 +671,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -681,16 +696,16 @@ union yyalloc 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)) +# 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 (0) #endif @@ -709,33 +724,35 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 265 +#define YYFINAL 273 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 6373 +#define YYLAST 6608 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 288 +#define YYNTOKENS 298 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 100 /* YYNRULES -- Number of rules. */ -#define YYNRULES 439 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 571 +#define YYNRULES 449 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 581 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 542 +#define YYMAXUTOK 552 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -792,259 +809,97 @@ static const yytype_uint16 yytranslate[] = 255, 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 + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297 }; #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, - 19, 21, 23, 27, 29, 34, 36, 40, 43, 46, - 48, 50, 52, 55, 58, 61, 63, 66, 70, 73, - 75, 77, 79, 82, 85, 88, 90, 92, 94, 96, - 98, 102, 106, 110, 112, 116, 120, 122, 126, 130, - 132, 136, 140, 144, 148, 150, 154, 158, 160, 164, - 166, 170, 172, 176, 178, 182, 184, 188, 190, 194, - 196, 197, 204, 206, 210, 212, 214, 216, 218, 220, - 222, 224, 226, 228, 230, 232, 234, 238, 240, 243, - 246, 251, 254, 258, 263, 266, 270, 275, 276, 283, - 286, 290, 293, 295, 297, 300, 304, 308, 311, 315, - 318, 320, 323, 325, 327, 329, 333, 338, 345, 351, - 353, 356, 360, 366, 371, 373, 376, 378, 380, 382, - 384, 386, 391, 393, 397, 399, 403, 405, 407, 409, - 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, - 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, - 452, 454, 456, 458, 460, 465, 467, 471, 473, 476, - 479, 483, 487, 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, 818, 820, 822, 824, - 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, - 846, 848, 850, 852, 854, 856, 858, 860, 862, 864, - 866, 868, 870, 872, 873, 880, 881, 887, 889, 892, - 896, 901, 903, 907, 909, 912, 914, 918, 923, 925, - 929, 931, 933, 935, 937, 939, 941, 943, 945, 947, - 949, 952, 953, 954, 960, 962, 964, 965, 968, 969, - 972, 975, 979, 981, 984, 986, 989, 995, 999, 1001, - 1003, 1008, 1009, 1018, 1019, 1021, 1025, 1028, 1029, 1036, - 1037, 1046, 1047, 1055, 1057, 1059, 1061, 1062, 1065, 1069, - 1072, 1075, 1078, 1082, 1085, 1087, 1090, 1092, 1094, 1095 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 384, 0, -1, 224, -1, 289, -1, 228, -1, 229, - -1, 230, -1, 231, -1, 226, -1, 227, -1, 233, - -1, 232, -1, 255, 317, 256, -1, 290, -1, 291, - 257, 292, 258, -1, 293, -1, 291, 261, 224, -1, - 291, 236, -1, 291, 237, -1, 317, -1, 294, -1, - 295, -1, 297, 256, -1, 296, 256, -1, 298, 222, - -1, 298, -1, 298, 315, -1, 297, 262, 315, -1, - 299, 255, -1, 343, -1, 291, -1, 291, -1, 236, - 300, -1, 237, 300, -1, 301, 300, -1, 269, -1, - 267, -1, 266, -1, 268, -1, 300, -1, 302, 270, - 300, -1, 302, 271, 300, -1, 302, 272, 300, -1, - 302, -1, 303, 269, 302, -1, 303, 267, 302, -1, - 303, -1, 304, 234, 303, -1, 304, 235, 303, -1, - 304, -1, 305, 273, 304, -1, 305, 274, 304, -1, - 305, 238, 304, -1, 305, 239, 304, -1, 305, -1, - 306, 240, 305, -1, 306, 241, 305, -1, 306, -1, - 307, 277, 306, -1, 307, -1, 308, 276, 307, -1, - 308, -1, 309, 275, 308, -1, 309, -1, 310, 242, - 309, -1, 310, -1, 311, 244, 310, -1, 311, -1, - 312, 243, 311, -1, 312, -1, -1, 312, 278, 314, - 317, 263, 315, -1, 313, -1, 300, 316, 315, -1, - 264, -1, 245, -1, 246, -1, 248, -1, 247, -1, - 254, -1, 249, -1, 250, -1, 251, -1, 252, -1, - 253, -1, 315, -1, 317, 262, 315, -1, 313, -1, - 323, 265, -1, 330, 265, -1, 284, 346, 343, 265, - -1, 320, 265, -1, 320, 224, 265, -1, 320, 224, - 344, 265, -1, 339, 265, -1, 339, 224, 265, -1, - 339, 224, 322, 265, -1, -1, 339, 224, 259, 321, - 350, 260, -1, 262, 224, -1, 322, 262, 224, -1, - 324, 256, -1, 326, -1, 325, -1, 326, 328, -1, - 325, 262, 328, -1, 332, 224, 255, -1, 343, 224, - -1, 343, 224, 344, -1, 339, 327, -1, 327, -1, - 339, 329, -1, 329, -1, 343, -1, 331, -1, 330, - 262, 224, -1, 330, 262, 224, 344, -1, 330, 262, - 224, 344, 264, 354, -1, 330, 262, 224, 264, 354, - -1, 332, -1, 332, 224, -1, 332, 224, 344, -1, - 332, 224, 344, 264, 354, -1, 332, 224, 264, 354, - -1, 343, -1, 339, 343, -1, 279, -1, 75, -1, - 74, -1, 73, -1, 77, -1, 76, 255, 336, 256, - -1, 337, -1, 336, 262, 337, -1, 224, -1, 224, - 264, 318, -1, 55, -1, 280, -1, 340, -1, 339, - 340, -1, 341, -1, 335, -1, 346, -1, 334, -1, - 333, -1, 338, -1, 5, -1, 3, -1, 4, -1, - 50, -1, 48, -1, 49, -1, 47, -1, 52, -1, - 53, -1, 51, -1, 54, -1, 55, -1, 56, -1, - 57, -1, 58, -1, 59, -1, 60, -1, 25, -1, - 25, 255, 342, 256, -1, 225, -1, 342, 262, 225, - -1, 345, -1, 345, 344, -1, 257, 258, -1, 257, - 313, 258, -1, 344, 257, 258, -1, 344, 257, 313, - 258, -1, 222, -1, 7, -1, 8, -1, 13, -1, - 9, -1, 10, -1, 11, -1, 12, -1, 6, -1, - 41, -1, 42, -1, 43, -1, 61, -1, 62, -1, - 63, -1, 67, -1, 68, -1, 69, -1, 26, -1, - 27, -1, 28, -1, 29, -1, 30, -1, 31, -1, - 32, -1, 33, -1, 34, -1, 35, -1, 36, -1, - 37, -1, 38, -1, 39, -1, 40, -1, 44, -1, - 45, -1, 46, -1, 78, -1, 79, -1, 80, -1, - 81, -1, 82, -1, 83, -1, 84, -1, 85, -1, - 86, -1, 64, -1, 65, -1, 66, -1, 87, -1, - 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, - 93, -1, 94, -1, 95, -1, 70, -1, 71, -1, - 72, -1, 96, -1, 97, -1, 98, -1, 99, -1, - 100, -1, 101, -1, 102, -1, 103, -1, 104, -1, - 105, -1, 106, -1, 107, -1, 108, -1, 109, -1, - 110, -1, 111, -1, 112, -1, 113, -1, 114, -1, - 115, -1, 116, -1, 136, -1, 137, -1, 117, -1, - 118, -1, 119, -1, 120, -1, 121, -1, 122, -1, - 138, -1, 123, -1, 124, -1, 125, -1, 126, -1, - 127, -1, 128, -1, 139, -1, 129, -1, 130, -1, - 131, -1, 132, -1, 133, -1, 134, -1, 135, -1, - 140, -1, 141, -1, 142, -1, 143, -1, 144, -1, - 145, -1, 147, -1, 148, -1, 149, -1, 150, -1, - 151, -1, 152, -1, 153, -1, 154, -1, 173, -1, - 155, -1, 156, -1, 157, -1, 158, -1, 159, -1, - 160, -1, 174, -1, 161, -1, 162, -1, 163, -1, - 164, -1, 165, -1, 166, -1, 175, -1, 167, -1, - 168, -1, 169, -1, 170, -1, 171, -1, 172, -1, - 176, -1, 177, -1, 178, -1, 179, -1, 180, -1, - 181, -1, 188, -1, 189, -1, 190, -1, 191, -1, - 192, -1, 193, -1, 194, -1, 195, -1, 196, -1, - 197, -1, 198, -1, 199, -1, 200, -1, 201, -1, - 202, -1, 203, -1, 204, -1, 205, -1, 206, -1, - 207, -1, 208, -1, 209, -1, 210, -1, 211, -1, - 212, -1, 213, -1, 214, -1, 215, -1, 216, -1, - 217, -1, 218, -1, 219, -1, 220, -1, 146, -1, - 182, -1, 183, -1, 184, -1, 185, -1, 186, -1, - 187, -1, 347, -1, 225, -1, 281, -1, 282, -1, - 283, -1, -1, 221, 224, 259, 348, 350, 260, -1, - -1, 221, 259, 349, 350, 260, -1, 351, -1, 350, - 351, -1, 343, 352, 265, -1, 339, 343, 352, 265, - -1, 353, -1, 352, 262, 353, -1, 224, -1, 224, - 344, -1, 315, -1, 259, 355, 260, -1, 259, 355, - 262, 260, -1, 354, -1, 355, 262, 354, -1, 319, - -1, 359, -1, 358, -1, 356, -1, 368, -1, 369, - -1, 372, -1, 375, -1, 376, -1, 383, -1, 259, - 260, -1, -1, -1, 259, 360, 367, 361, 260, -1, - 366, -1, 358, -1, -1, 364, 359, -1, -1, 365, - 358, -1, 259, 260, -1, 259, 367, 260, -1, 357, - -1, 367, 357, -1, 265, -1, 317, 265, -1, 19, - 255, 317, 256, 370, -1, 363, 17, 363, -1, 363, - -1, 317, -1, 332, 224, 264, 354, -1, -1, 22, - 255, 317, 256, 373, 259, 374, 260, -1, -1, 367, - -1, 23, 317, 263, -1, 24, 263, -1, -1, 223, - 255, 377, 371, 256, 362, -1, -1, 16, 378, 357, - 223, 255, 317, 256, 265, -1, -1, 18, 255, 379, - 380, 382, 256, 362, -1, 368, -1, 356, -1, 371, - -1, -1, 381, 265, -1, 381, 265, 317, -1, 15, - 265, -1, 14, 265, -1, 21, 265, -1, 21, 317, - 265, -1, 20, 265, -1, 385, -1, 384, 385, -1, - 386, -1, 319, -1, -1, 323, 387, 366, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 250, 250, 256, 259, 262, 266, 270, 274, 277, - 281, 287, 290, 298, 301, 304, 307, 310, 315, 323, - 330, 337, 343, 347, 354, 357, 363, 370, 380, 388, - 393, 423, 429, 433, 437, 457, 458, 459, 460, 466, - 467, 472, 477, 486, 487, 492, 500, 501, 507, 516, - 517, 522, 527, 532, 540, 541, 549, 560, 561, 570, - 571, 580, 581, 590, 591, 599, 600, 608, 609, 617, - 618, 618, 636, 637, 652, 656, 660, 664, 669, 673, - 677, 681, 685, 689, 693, 700, 703, 714, 721, 726, - 731, 739, 743, 747, 751, 756, 761, 770, 770, 781, - 785, 792, 799, 802, 809, 817, 837, 855, 870, 893, - 904, 914, 924, 934, 943, 946, 950, 954, 959, 967, - 972, 977, 982, 987, 996, 1007, 1034, 1043, 1050, 1057, - 1064, 1076, 1082, 1085, 1092, 1096, 1100, 1108, 1117, 1120, - 1131, 1134, 1137, 1141, 1145, 1149, 1156, 1160, 1172, 1186, - 1191, 1197, 1203, 1210, 1216, 1221, 1226, 1231, 1238, 1242, - 1246, 1250, 1254, 1258, 1264, 1276, 1279, 1284, 1288, 1297, - 1302, 1310, 1314, 1324, 1328, 1332, 1337, 1344, 1348, 1353, - 1358, 1363, 1367, 1372, 1377, 1382, 1388, 1394, 1400, 1408, - 1416, 1424, 1429, 1434, 1439, 1444, 1449, 1454, 1460, 1466, - 1472, 1478, 1484, 1490, 1496, 1502, 1508, 1513, 1518, 1523, - 1528, 1533, 1538, 1543, 1548, 1553, 1558, 1563, 1568, 1574, - 1580, 1586, 1592, 1598, 1604, 1610, 1616, 1622, 1628, 1634, - 1640, 1648, 1656, 1664, 1672, 1680, 1688, 1696, 1704, 1712, - 1720, 1728, 1736, 1741, 1746, 1751, 1756, 1761, 1766, 1771, - 1776, 1781, 1786, 1791, 1796, 1801, 1806, 1811, 1816, 1821, - 1826, 1831, 1836, 1841, 1846, 1851, 1856, 1861, 1866, 1871, - 1876, 1881, 1886, 1891, 1896, 1901, 1906, 1911, 1916, 1921, - 1926, 1931, 1936, 1941, 1946, 1951, 1956, 1961, 1966, 1971, - 1976, 1981, 1986, 1991, 1996, 2001, 2006, 2011, 2016, 2021, - 2026, 2031, 2036, 2041, 2046, 2051, 2056, 2061, 2066, 2071, - 2076, 2081, 2086, 2091, 2096, 2101, 2106, 2111, 2116, 2121, - 2126, 2131, 2136, 2141, 2146, 2151, 2156, 2161, 2166, 2171, - 2176, 2181, 2186, 2191, 2196, 2201, 2206, 2211, 2216, 2221, - 2226, 2231, 2236, 2241, 2246, 2251, 2256, 2261, 2266, 2271, - 2276, 2281, 2287, 2293, 2299, 2305, 2311, 2317, 2323, 2328, - 2344, 2349, 2354, 2362, 2362, 2373, 2373, 2383, 2386, 2399, - 2417, 2441, 2445, 2451, 2456, 2467, 2470, 2476, 2485, 2488, - 2494, 2498, 2499, 2505, 2506, 2507, 2508, 2509, 2510, 2511, - 2515, 2516, 2520, 2516, 2532, 2533, 2537, 2537, 2544, 2544, - 2558, 2561, 2569, 2577, 2588, 2589, 2593, 2600, 2604, 2612, - 2616, 2629, 2629, 2649, 2652, 2658, 2670, 2682, 2682, 2697, - 2697, 2713, 2713, 2734, 2737, 2743, 2746, 2752, 2756, 2763, - 2768, 2773, 2780, 2783, 2792, 2796, 2803, 2806, 2812, 2812 + 0, 253, 253, 259, 262, 265, 269, 273, 277, 283, + 289, 292, 296, 302, 305, 313, 316, 319, 322, 325, + 330, 338, 345, 352, 358, 362, 369, 372, 378, 385, + 395, 403, 408, 438, 444, 448, 452, 472, 473, 474, + 475, 481, 482, 487, 492, 501, 502, 507, 515, 516, + 522, 531, 532, 537, 542, 547, 555, 556, 564, 575, + 576, 585, 586, 595, 596, 605, 606, 614, 615, 623, + 624, 632, 633, 633, 651, 652, 667, 671, 675, 679, + 684, 688, 692, 696, 700, 704, 708, 715, 718, 729, + 736, 741, 746, 754, 758, 762, 766, 771, 776, 785, + 785, 796, 800, 807, 814, 817, 824, 832, 852, 870, + 885, 908, 919, 929, 939, 949, 958, 961, 965, 969, + 974, 982, 987, 992, 997, 1002, 1011, 1022, 1049, 1058, + 1065, 1072, 1079, 1091, 1097, 1100, 1107, 1111, 1115, 1123, + 1132, 1135, 1146, 1149, 1152, 1156, 1160, 1164, 1171, 1175, + 1187, 1201, 1206, 1212, 1218, 1225, 1231, 1236, 1241, 1246, + 1254, 1258, 1262, 1266, 1270, 1274, 1280, 1289, 1292, 1300, + 1304, 1313, 1318, 1326, 1330, 1340, 1344, 1348, 1353, 1360, + 1364, 1369, 1374, 1379, 1386, 1393, 1397, 1402, 1407, 1412, + 1418, 1424, 1430, 1438, 1446, 1454, 1459, 1464, 1469, 1474, + 1479, 1484, 1490, 1496, 1502, 1510, 1518, 1526, 1532, 1538, + 1544, 1550, 1556, 1562, 1570, 1578, 1586, 1591, 1596, 1601, + 1606, 1611, 1616, 1621, 1626, 1631, 1636, 1641, 1646, 1652, + 1658, 1664, 1670, 1676, 1682, 1688, 1694, 1700, 1706, 1712, + 1718, 1726, 1734, 1742, 1750, 1758, 1766, 1774, 1782, 1790, + 1798, 1806, 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, 2079, 2084, 2089, 2094, 2099, + 2104, 2109, 2114, 2119, 2124, 2129, 2134, 2139, 2144, 2149, + 2154, 2159, 2164, 2169, 2174, 2179, 2184, 2189, 2194, 2199, + 2204, 2209, 2214, 2219, 2224, 2229, 2234, 2239, 2244, 2249, + 2254, 2259, 2264, 2269, 2274, 2279, 2284, 2289, 2294, 2299, + 2304, 2309, 2314, 2319, 2324, 2329, 2334, 2339, 2344, 2349, + 2354, 2359, 2365, 2371, 2377, 2383, 2389, 2395, 2401, 2406, + 2422, 2427, 2432, 2440, 2440, 2451, 2451, 2461, 2464, 2477, + 2495, 2519, 2523, 2529, 2534, 2545, 2548, 2554, 2563, 2566, + 2572, 2576, 2577, 2583, 2584, 2585, 2586, 2587, 2588, 2589, + 2593, 2594, 2598, 2594, 2610, 2611, 2615, 2615, 2622, 2622, + 2636, 2639, 2647, 2655, 2666, 2667, 2671, 2678, 2682, 2690, + 2694, 2707, 2707, 2727, 2730, 2736, 2748, 2760, 2760, 2775, + 2775, 2791, 2791, 2812, 2815, 2821, 2824, 2830, 2834, 2841, + 2846, 2851, 2858, 2861, 2870, 2874, 2881, 2884, 2890, 2890 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +#if YYDEBUG || YYERROR_VERBOSE || 1 /* 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", "INT64_T", "UINT64_T", "FLOAT16_T", - "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", - "SWITCH", "CASE", "DEFAULT", "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", - "IVEC2", "IVEC3", "IVEC4", "I64VEC2", "I64VEC3", "I64VEC4", "UVEC2", - "UVEC3", "UVEC4", "U64VEC2", "U64VEC3", "U64VEC4", "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", "F16VEC2", "F16VEC3", "F16VEC4", "F16MAT2", "F16MAT3", - "F16MAT4", "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", - "__EXPLICITINTERPAMD", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", - "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", "DMAT2X4", - "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", "DMAT4X4", - "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", "F16MAT3X3", - "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", "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", + "FLOAT", "DOUBLE", "INT", "UINT", "INT64_T", "UINT64_T", "INT16_T", + "UINT16_T", "FLOAT16_T", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", + "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "SUBROUTINE", "BVEC2", + "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "I64VEC2", "I64VEC3", + "I64VEC4", "UVEC2", "UVEC3", "UVEC4", "U64VEC2", "U64VEC3", "U64VEC4", + "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", "F16VEC2", "F16VEC3", "F16VEC4", + "F16MAT2", "F16MAT3", "F16MAT4", "I16VEC2", "I16VEC3", "I16VEC4", + "U16VEC2", "U16VEC3", "U16VEC4", "NOPERSPECTIVE", "FLAT", "SMOOTH", + "LAYOUT", "__EXPLICITINTERPAMD", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", + "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", + "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", + "DMAT4X4", "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", + "F16MAT3X3", "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", + "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", @@ -1063,20 +918,20 @@ static const char *const yytname[] = "UIMAGE2DMS", "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", "STRUCT", "VOID", "WHILE", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "DOUBLECONSTANT", "INTCONSTANT", "UINTCONSTANT", "INT64CONSTANT", - "UINT64CONSTANT", "BOOLCONSTANT", "FLOAT16CONSTANT", "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", + "UINT64CONSTANT", "INT16CONSTANT", "UINT16CONSTANT", "BOOLCONSTANT", + "FLOAT16CONSTANT", "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", @@ -1106,13 +961,13 @@ static const char *const yytname[] = "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 + "external_declaration", "function_definition", "$@13", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1143,80 +998,1652 @@ static const yytype_uint16 yytoknum[] = 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542 + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = +#define YYPACT_NINF -522 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-522))) + +#define YYTABLE_NINF -407 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 288, 289, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 291, 291, 291, 291, 291, 291, 292, - 293, 294, 295, 295, 296, 296, 297, 297, 298, 299, - 299, 300, 300, 300, 300, 301, 301, 301, 301, 302, - 302, 302, 302, 303, 303, 303, 304, 304, 304, 305, - 305, 305, 305, 305, 306, 306, 306, 307, 307, 308, - 308, 309, 309, 310, 310, 311, 311, 312, 312, 313, - 314, 313, 315, 315, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 317, 317, 318, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 321, 320, 322, - 322, 323, 324, 324, 325, 325, 326, 327, 327, 328, - 328, 328, 328, 329, 330, 330, 330, 330, 330, 331, - 331, 331, 331, 331, 332, 332, 333, 334, 334, 334, - 334, 335, 336, 336, 337, 337, 337, 338, 339, 339, - 340, 340, 340, 340, 340, 340, 341, 341, 341, 341, - 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, - 341, 341, 341, 341, 341, 342, 342, 343, 343, 344, - 344, 344, 344, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - 346, 346, 346, 348, 347, 349, 347, 350, 350, 351, - 351, 352, 352, 353, 353, 354, 354, 354, 355, 355, - 356, 357, 357, 358, 358, 358, 358, 358, 358, 358, - 359, 360, 361, 359, 362, 362, 364, 363, 365, 363, - 366, 366, 367, 367, 368, 368, 369, 370, 370, 371, - 371, 373, 372, 374, 374, 375, 375, 377, 376, 378, - 376, 379, 376, 380, 380, 381, 381, 382, 382, 383, - 383, 383, 383, 383, 384, 384, 385, 385, 387, 386 + 2618, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -224, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -217, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -214, -522, -522, -522, + -522, -522, -522, -522, -261, -522, -215, -213, -184, -182, + 4254, -196, -522, -122, -522, -522, -522, -522, 3177, -522, + -522, -522, -129, -522, -522, 574, -522, -522, -90, -48, + -125, -522, 6375, -232, -522, -522, -117, -522, 4254, -522, + -522, -522, 4254, -75, -74, -522, -240, -183, -522, -522, + -522, 4759, -108, -522, -522, -522, -179, -522, -114, -175, + -522, -522, 4254, -113, -522, -216, 866, -522, -522, -522, + -522, -129, -222, -522, 5033, -193, -522, -71, -522, -158, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, 5855, 5855, 5855, -522, -522, -522, -522, -522, -522, + -522, -227, -522, -522, -522, -102, -164, 6115, -100, -522, + 5855, -145, -199, -195, -226, -128, -124, -120, -116, -82, + -83, -225, -96, -522, 5307, -522, -59, 5855, -522, -48, + 4254, 4254, -58, 3450, -522, -522, -522, -99, -98, -522, + -87, -86, -95, 5581, -84, 5855, -88, -79, -80, -522, + -522, -191, -522, -522, -156, -522, -213, -78, -522, -522, + -522, -522, 1158, -522, -522, -522, -522, -522, -522, -108, + 5033, -190, 5033, -522, -522, 5033, 4254, -522, -57, -522, + -522, -522, -163, -522, -522, 5855, -41, -522, -522, 5855, + -73, -522, -522, -522, 5855, 5855, 5855, 5855, 5855, 5855, + 5855, 5855, 5855, 5855, 5855, 5855, 5855, 5855, 5855, 5855, + 5855, 5855, 5855, -522, -522, -522, -76, -522, -522, -522, + -522, 3718, -58, -129, -143, -522, -522, -522, -522, -522, + 1450, -522, 5855, -522, -522, -142, 5855, -178, -522, -522, + -522, 1450, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, 5855, 5855, -522, -522, -522, -522, 5033, + -522, -131, -522, 3986, -522, -522, -72, -77, -522, -522, + -522, -522, -522, -145, -145, -199, -199, -195, -195, -195, + -195, -226, -226, -128, -124, -120, -116, -82, -83, 5855, + -522, -522, -141, -108, -58, -522, -37, 2326, -161, -522, + -160, -522, 2886, 1450, -522, -522, -522, -522, 4485, -522, + -522, -127, -522, -522, -68, -522, -522, 2886, -70, -522, + -77, -30, 4254, -63, -66, -522, -522, 5855, 5855, -522, + -69, -61, 188, -55, 2034, -522, -54, -64, 1742, -522, + -522, -159, 5855, 1742, -70, -522, -522, 1450, 5033, -522, + -522, -522, -56, -77, -522, -522, 1450, -53, -522, -522, + -522 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 0, 149, 150, 148, 185, 176, 177, 179, 180, 181, + 182, 183, 184, 178, 165, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 207, 208, 209, 210, 211, 212, + 186, 187, 188, 216, 217, 218, 154, 152, 153, 151, + 157, 155, 156, 158, 159, 160, 161, 162, 163, 164, + 189, 190, 191, 228, 229, 230, 192, 193, 194, 240, + 241, 242, 204, 205, 206, 213, 214, 215, 131, 130, + 129, 0, 132, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 266, 267, 268, 269, 270, 271, 273, 274, + 275, 276, 277, 278, 280, 281, 282, 283, 284, 285, + 286, 264, 265, 272, 279, 287, 288, 289, 290, 291, + 292, 361, 293, 294, 295, 296, 297, 298, 299, 300, + 302, 303, 304, 305, 306, 307, 309, 310, 311, 312, + 313, 314, 316, 317, 318, 319, 320, 321, 301, 308, + 315, 322, 323, 324, 325, 326, 327, 362, 363, 364, + 365, 366, 367, 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, 0, 175, 369, 128, + 139, 370, 371, 372, 0, 447, 0, 448, 0, 105, + 104, 0, 116, 121, 146, 145, 143, 147, 0, 140, + 142, 126, 169, 144, 368, 0, 444, 446, 0, 0, + 0, 375, 0, 0, 93, 90, 0, 103, 0, 112, + 106, 114, 0, 115, 0, 91, 122, 0, 96, 141, + 127, 0, 170, 1, 445, 167, 0, 138, 136, 0, + 134, 373, 0, 0, 94, 0, 0, 449, 107, 111, + 113, 109, 117, 108, 0, 123, 99, 0, 97, 0, + 2, 10, 11, 4, 5, 6, 7, 8, 9, 13, + 12, 0, 0, 0, 171, 39, 38, 40, 37, 3, + 15, 33, 17, 22, 23, 0, 0, 27, 0, 41, + 0, 45, 48, 51, 56, 59, 61, 63, 65, 67, + 69, 71, 0, 31, 0, 166, 0, 0, 133, 0, + 0, 0, 0, 0, 377, 92, 95, 0, 0, 429, + 0, 0, 0, 0, 0, 0, 0, 0, 401, 410, + 414, 41, 74, 87, 0, 390, 0, 126, 393, 412, + 392, 391, 0, 394, 395, 396, 397, 398, 399, 110, + 0, 118, 0, 385, 125, 0, 0, 101, 0, 98, + 34, 35, 0, 19, 20, 0, 0, 25, 24, 0, + 175, 28, 30, 36, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 72, 172, 173, 0, 168, 89, 137, + 135, 0, 0, 383, 0, 381, 376, 378, 440, 439, + 0, 431, 0, 443, 441, 0, 0, 0, 426, 427, + 400, 0, 77, 78, 80, 79, 82, 83, 84, 85, + 86, 81, 76, 0, 0, 415, 411, 413, 120, 0, + 388, 0, 124, 0, 102, 14, 0, 21, 18, 29, + 42, 43, 44, 47, 46, 49, 50, 54, 55, 52, + 53, 57, 58, 60, 62, 64, 66, 68, 70, 0, + 174, 374, 0, 384, 0, 379, 0, 0, 0, 442, + 0, 425, 0, 402, 75, 88, 119, 386, 0, 100, + 16, 0, 380, 382, 0, 434, 433, 436, 408, 421, + 419, 0, 0, 0, 0, 387, 389, 0, 0, 435, + 0, 0, 418, 0, 0, 416, 0, 0, 0, 403, + 73, 0, 437, 0, 408, 407, 409, 423, 0, 405, + 428, 404, 0, 438, 432, 417, 424, 0, 420, 430, + 422 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -103, -522, -267, -266, -296, -270, -211, -210, + -218, -209, -208, -212, -522, -259, -522, -291, -522, -309, + -522, 5, -522, -522, -522, 6, -522, -522, -522, -40, + -34, -36, -522, -522, -498, -522, -522, -522, -522, -118, + -522, -229, -236, -522, -522, 0, -245, -522, 1, -522, + -522, -522, -335, -343, -207, -285, -379, -522, -284, -375, + -521, -321, -522, -522, -329, -328, -522, -522, -16, -447, + -275, -522, -522, -294, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, 2, -522, -522 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 319, 320, 321, 486, 322, 323, 324, 325, 326, + 327, 328, 371, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 372, 509, 373, 473, 374, + 439, 375, 226, 396, 299, 376, 228, 229, 230, 259, + 260, 261, 231, 232, 233, 234, 235, 236, 279, 280, + 237, 238, 239, 240, 276, 343, 272, 242, 243, 244, + 350, 282, 353, 354, 444, 445, 394, 481, 378, 379, + 380, 381, 461, 544, 570, 552, 553, 554, 571, 382, + 383, 384, 555, 543, 385, 556, 577, 386, 387, 522, + 450, 517, 537, 550, 551, 388, 245, 246, 247, 256 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 241, 262, 269, 393, 402, 225, 227, 477, 285, 277, + 447, 478, 342, 480, 523, 441, 482, 253, 250, 403, + 404, 295, 421, 422, 541, 293, 269, 271, 432, 262, + 221, 222, 223, 566, 294, 271, 411, 569, -32, 541, + 405, 248, 569, 284, 406, 271, 389, 391, 249, 419, + 420, 344, 390, 351, 455, 251, 457, 423, 424, 356, + 254, 483, 255, 433, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 344, 516, 264, 344, 417, 265, + 418, 395, 257, 472, 479, 436, 296, 345, 438, 297, + 258, 348, 298, 346, 474, 521, 487, 349, 447, 393, + 526, 393, 408, 485, 393, 538, 539, 572, 409, 474, + 266, 474, 474, 474, 398, 269, 474, 399, 489, 475, + 576, 351, 425, 426, 351, 497, 498, 499, 500, 514, + 474, 514, 515, 519, 532, 414, 415, 416, 271, 527, + 447, 528, 275, 518, 281, 474, 547, 520, 477, 546, + 493, 494, 286, 495, 496, 501, 502, 291, 292, 344, + 347, 397, 355, 427, 407, 412, 428, 351, 329, 429, + 430, 431, 434, 437, 443, 484, 448, 449, 451, 452, + 453, 456, 524, 525, 278, 458, 459, -31, 393, 578, + 460, 488, 510, -26, 534, 474, 530, 548, 513, -406, + 531, 477, 557, 558, 559, 563, 562, 564, 400, 401, + 568, 505, 351, 540, 368, 567, 503, 580, 504, 579, + 508, 506, 289, 507, 288, 252, 290, 413, 540, 533, + 263, 440, 565, 535, 574, 512, 575, 393, 270, 561, + 287, 329, 536, 549, 329, 241, 0, 274, 0, 0, + 225, 227, 283, 573, 351, 0, 560, 0, 263, 0, + 0, 0, 263, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, + 0, 0, 352, 0, 0, 0, 377, 0, 0, 0, + 0, 0, 0, 542, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 269, 0, 542, 0, + 0, 490, 491, 492, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 352, 442, 0, 352, 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, 377, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 352, 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, 352, 0, 0, 0, 0, 0, 0, 0, 0, + 377, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 377, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 352, 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, 377, 0, 0, + 0, 0, 377, 377, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 377, 0, 0, + 0, 0, 270, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 377, 0, 0, 0, 377, 0, + 0, 0, 0, 377, 0, 0, 0, 377, 0, 0, + 0, 0, 0, 0, 273, 0, 377, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 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, 0, 0, 218, 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, 0, 0, + 0, 0, 0, 219, 220, 221, 222, 223, 224, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 357, 358, 359, 0, 360, 361, 362, 363, + 364, 365, 366, 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, 367, 300, 218, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 0, 0, 311, 312, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 313, 0, 0, 0, 368, 369, 0, 0, 0, + 0, 370, 315, 316, 317, 318, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 219, 220, 221, 222, 223, + 224, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 357, 358, 359, 0, 360, 361, + 362, 363, 364, 365, 366, 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, 367, + 300, 218, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 0, 0, 311, 312, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 313, 0, 0, 0, 368, 476, 0, + 0, 0, 0, 370, 315, 316, 317, 318, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 219, 220, 221, + 222, 223, 224, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 357, 358, 359, 0, + 360, 361, 362, 363, 364, 365, 366, 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, 367, 300, 218, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 0, 0, 311, 312, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 313, 0, 0, 0, 368, + 0, 0, 0, 0, 0, 370, 315, 316, 317, 318, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, + 220, 221, 222, 223, 224, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 357, 358, + 359, 0, 360, 361, 362, 363, 364, 365, 366, 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, 367, 300, 218, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 0, 0, 311, 312, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 313, 0, 0, + 0, 286, 0, 0, 0, 0, 0, 370, 315, 316, + 317, 318, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 219, 220, 221, 222, 223, 224, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 357, 358, 359, 0, 360, 361, 362, 363, 364, 365, + 366, 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, 367, 300, 218, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 0, 0, + 311, 312, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, + 315, 316, 317, 318, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 219, 220, 221, 222, 223, 224, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 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, 0, 300, 218, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 0, 0, 311, 312, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 313, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 370, 315, 316, 317, 318, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 219, 220, 221, 222, 223, + 224, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 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, 0, + 0, 218, 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, 9, 10, 11, + 12, 13, 0, 0, 0, 0, 0, 219, 220, 221, + 222, 223, 224, 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, 0, 300, 218, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 0, 0, 311, 312, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 313, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 315, 316, 317, 318, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 219, 220, 221, 222, 223, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 267, + 218, 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, 268, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 219, 220, 221, 222, + 223, 0, 0, 0, 0, 0, 0, 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, 0, 0, 218, 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, + 446, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 0, 0, 0, 0, 0, 219, + 220, 221, 222, 223, 0, 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, 0, + 0, 218, 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, 511, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0, 0, 0, 0, 0, 219, 220, 221, + 222, 223, 0, 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, 0, 0, 218, + 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, 529, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 0, 0, 0, 0, 0, 219, 220, 221, 222, 223, + 0, 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, 0, 0, 218, 0, 0, + 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 219, 220, 221, 222, 223, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 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, 0, 300, 218, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 0, + 0, 311, 312, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 313, 0, 0, 0, 392, 545, 0, 0, 0, 0, + 0, 315, 316, 317, 318, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 0, 0, 0, 0, 0, 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, + 0, 300, 218, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 0, 0, 311, 312, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 313, 0, 0, 314, 0, 0, + 0, 0, 0, 0, 0, 315, 316, 317, 318, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 0, 0, 0, 0, 0, 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, 0, 300, 218, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 0, 0, 311, + 312, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 313, 0, + 0, 0, 392, 0, 0, 0, 0, 0, 0, 315, + 316, 317, 318, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, + 0, 0, 0, 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, 0, 300, + 218, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 0, 0, 311, 312, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 313, 0, 0, 435, 0, 0, 0, 0, + 0, 0, 0, 315, 316, 317, 318, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 0, 0, 0, 0, 0, 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, 0, 300, 218, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 0, 0, 311, 312, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 313, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 454, 315, 316, 317, + 318, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 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, 0, 300, 218, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 0, + 0, 311, 312, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 313, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 315, 316, 317, 318, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 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, 410, 0, 300, 218, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 0, + 0, 311, 312, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 313, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 315, 316, 317, 318, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 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, 0, 0, 218 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 230, 238, 294, 313, 0, 0, 382, 253, 57, + 353, 390, 271, 392, 461, 350, 395, 232, 232, 246, + 247, 266, 248, 249, 522, 265, 262, 267, 253, 258, + 291, 292, 293, 554, 274, 267, 327, 558, 265, 537, + 267, 265, 563, 275, 271, 267, 291, 292, 265, 244, + 245, 267, 274, 282, 363, 269, 365, 283, 284, 275, + 275, 396, 275, 288, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 267, 450, 272, 267, 277, 275, + 279, 274, 266, 274, 274, 344, 269, 266, 347, 272, + 272, 266, 275, 272, 272, 273, 405, 272, 441, 390, + 479, 392, 266, 266, 395, 266, 266, 266, 272, 272, + 232, 272, 272, 272, 272, 351, 272, 275, 409, 275, + 567, 350, 250, 251, 353, 421, 422, 423, 424, 272, + 272, 272, 275, 275, 275, 280, 281, 282, 267, 270, + 483, 272, 232, 452, 269, 272, 273, 456, 523, 528, + 417, 418, 269, 419, 420, 425, 426, 232, 232, 267, + 274, 232, 275, 287, 266, 265, 286, 396, 271, 285, + 252, 254, 268, 232, 232, 232, 275, 275, 265, 265, + 275, 265, 473, 474, 232, 273, 265, 265, 479, 568, + 270, 232, 268, 266, 231, 272, 268, 265, 443, 269, + 509, 576, 232, 266, 270, 266, 275, 19, 311, 312, + 274, 429, 441, 522, 269, 269, 427, 270, 428, 275, + 432, 430, 262, 431, 258, 224, 262, 330, 537, 514, + 230, 349, 553, 517, 563, 442, 564, 528, 238, 548, + 256, 344, 517, 537, 347, 245, -1, 245, -1, -1, + 245, 245, 252, 562, 483, -1, 547, -1, 258, -1, + -1, -1, 262, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 568, -1, -1, + -1, -1, 282, -1, -1, -1, 286, -1, -1, -1, + -1, -1, -1, 522, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 542, -1, 537, -1, + -1, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 350, 351, -1, 353, -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, 382, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 396, -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, 441, -1, -1, -1, -1, -1, -1, -1, -1, + 450, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 461, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 483, -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, 517, -1, -1, + -1, -1, 522, 523, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 537, -1, -1, + -1, -1, 542, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 554, -1, -1, -1, 558, -1, + -1, -1, -1, 563, -1, -1, -1, 567, -1, -1, + -1, -1, -1, -1, 0, -1, 576, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 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, -1, -1, 233, -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, 289, 290, 291, 292, 293, 294, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, -1, 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, + -1, -1, 246, 247, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 265, -1, -1, -1, 269, 270, -1, -1, -1, + -1, 275, 276, 277, 278, 279, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, + 294, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, -1, 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, -1, -1, 246, 247, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 265, -1, -1, -1, 269, 270, -1, + -1, -1, -1, 275, 276, 277, 278, 279, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 289, 290, 291, + 292, 293, 294, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, + 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, -1, -1, 246, 247, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 265, -1, -1, -1, 269, + -1, -1, -1, -1, -1, 275, 276, 277, 278, 279, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 289, + 290, 291, 292, 293, 294, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, -1, 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, -1, -1, 246, 247, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 265, -1, -1, + -1, 269, -1, -1, -1, -1, -1, 275, 276, 277, + 278, 279, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 289, 290, 291, 292, 293, 294, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, -1, 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, -1, -1, + 246, 247, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 265, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, + 276, 277, 278, 279, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, 293, 294, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 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, -1, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + -1, -1, 246, 247, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 265, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 275, 276, 277, 278, 279, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, + 294, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 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, -1, + -1, 233, -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, 11, 12, 13, + 14, 15, -1, -1, -1, -1, -1, 289, 290, 291, + 292, 293, 294, 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, -1, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + -1, -1, 246, 247, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 265, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 276, 277, 278, 279, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 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, -1, 232, + 233, -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, 275, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 289, 290, 291, 292, + 293, -1, -1, -1, -1, -1, -1, 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, -1, -1, 233, -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, + 270, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, -1, -1, -1, -1, -1, 289, + 290, 291, 292, 293, -1, 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, -1, + -1, 233, -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, 270, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, -1, -1, -1, -1, -1, 289, 290, 291, + 292, 293, -1, 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, -1, -1, 233, + -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, 270, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, + -1, 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, -1, -1, 233, -1, -1, + -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, 293, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 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, -1, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, + -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 265, -1, -1, -1, 269, 270, -1, -1, -1, -1, + -1, 276, 277, 278, 279, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + -1, -1, -1, -1, -1, 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, + -1, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, -1, -1, 246, 247, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 265, -1, -1, 268, -1, -1, + -1, -1, -1, -1, -1, 276, 277, 278, 279, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, -1, -1, -1, -1, -1, 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, -1, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, -1, -1, 246, + 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, + -1, -1, 269, -1, -1, -1, -1, -1, -1, 276, + 277, 278, 279, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, + -1, -1, -1, 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, -1, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 265, -1, -1, 268, -1, -1, -1, -1, + -1, -1, -1, 276, 277, 278, 279, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, -1, -1, -1, -1, -1, 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, -1, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 275, 276, 277, 278, + 279, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 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, -1, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, + -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 265, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 276, 277, 278, 279, -1, -1, -1, -1, -1, + -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 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, -1, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, + -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 265, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 276, 277, 278, 279, -1, -1, -1, -1, -1, + -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 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, -1, -1, 233 +}; + + /* 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, 11, + 12, 13, 14, 15, 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, 233, 289, + 290, 291, 292, 293, 294, 329, 330, 333, 334, 335, + 336, 340, 341, 342, 343, 344, 345, 348, 349, 350, + 351, 353, 355, 356, 357, 394, 395, 396, 265, 265, + 232, 269, 356, 232, 275, 275, 397, 266, 272, 337, + 338, 339, 349, 353, 272, 275, 232, 232, 275, 350, + 353, 267, 354, 0, 395, 232, 352, 57, 232, 346, + 347, 269, 359, 353, 275, 354, 269, 376, 338, 337, + 339, 232, 232, 265, 274, 354, 269, 272, 275, 332, + 232, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 246, 247, 265, 268, 276, 277, 278, 279, 299, + 300, 301, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 353, 267, 266, 272, 274, 266, 272, + 358, 349, 353, 360, 361, 275, 275, 16, 17, 18, + 20, 21, 22, 23, 24, 25, 26, 231, 269, 270, + 275, 310, 323, 325, 327, 329, 333, 353, 366, 367, + 368, 369, 377, 378, 379, 382, 385, 386, 393, 354, + 274, 354, 269, 325, 364, 274, 331, 232, 272, 275, + 310, 310, 327, 246, 247, 267, 271, 266, 266, 272, + 230, 325, 265, 310, 280, 281, 282, 277, 279, 244, + 245, 248, 249, 283, 284, 250, 251, 287, 286, 285, + 252, 254, 253, 288, 268, 268, 323, 232, 323, 328, + 347, 360, 353, 232, 362, 363, 270, 361, 275, 275, + 388, 265, 265, 275, 275, 327, 265, 327, 273, 265, + 270, 370, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 274, 326, 272, 275, 270, 367, 364, 274, + 364, 365, 364, 360, 232, 266, 302, 327, 232, 325, + 310, 310, 310, 312, 312, 313, 313, 314, 314, 314, + 314, 315, 315, 316, 317, 318, 319, 320, 321, 324, + 268, 270, 362, 354, 272, 275, 367, 389, 327, 275, + 327, 273, 387, 377, 325, 325, 364, 270, 272, 270, + 268, 327, 275, 363, 231, 366, 378, 390, 266, 266, + 327, 342, 349, 381, 371, 270, 364, 273, 265, 381, + 391, 392, 373, 374, 375, 380, 383, 232, 266, 270, + 325, 327, 275, 266, 19, 369, 368, 269, 274, 368, + 372, 376, 266, 327, 372, 373, 377, 384, 364, 275, + 270 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 298, 299, 300, 300, 300, 300, 300, 300, 300, + 300, 300, 300, 300, 300, 301, 301, 301, 301, 301, + 301, 302, 303, 304, 305, 305, 306, 306, 307, 307, + 308, 309, 309, 310, 310, 310, 310, 311, 311, 311, + 311, 312, 312, 312, 312, 313, 313, 313, 314, 314, + 314, 315, 315, 315, 315, 315, 316, 316, 316, 317, + 317, 318, 318, 319, 319, 320, 320, 321, 321, 322, + 322, 323, 324, 323, 325, 325, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 327, 327, 328, + 329, 329, 329, 329, 329, 329, 329, 329, 329, 331, + 330, 332, 332, 333, 334, 334, 335, 335, 336, 337, + 337, 338, 338, 338, 338, 339, 340, 340, 340, 340, + 340, 341, 341, 341, 341, 341, 342, 342, 343, 344, + 344, 344, 344, 345, 346, 346, 347, 347, 347, 348, + 349, 349, 350, 350, 350, 350, 350, 350, 351, 351, + 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + 351, 351, 351, 351, 351, 351, 351, 352, 352, 353, + 353, 354, 354, 354, 354, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 356, 356, 356, 358, 357, 359, 357, 360, 360, 361, + 361, 362, 362, 363, 363, 364, 364, 364, 365, 365, + 366, 367, 367, 368, 368, 368, 368, 368, 368, 368, + 369, 370, 371, 369, 372, 372, 374, 373, 375, 373, + 376, 376, 377, 377, 378, 378, 379, 380, 380, 381, + 381, 383, 382, 384, 384, 385, 385, 387, 386, 388, + 386, 389, 386, 390, 390, 391, 391, 392, 392, 393, + 393, 393, 393, 393, 394, 394, 395, 395, 397, 396 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 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, + 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, - 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, - 1, 4, 1, 3, 1, 3, 1, 1, 1, 2, + 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, 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, 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, @@ -1245,1548 +2672,16 @@ static const yytype_uint8 yyr2[] = 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, 147, 148, 146, 181, 174, 175, 177, 178, 179, - 180, 176, 163, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 182, 183, - 184, 206, 207, 208, 152, 150, 151, 149, 155, 153, - 154, 156, 157, 158, 159, 160, 161, 162, 185, 186, - 187, 218, 219, 220, 188, 189, 190, 230, 231, 232, - 129, 128, 127, 0, 130, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 256, 257, 258, 259, 260, 261, - 263, 264, 265, 266, 267, 268, 270, 271, 272, 273, - 274, 275, 276, 254, 255, 262, 269, 277, 278, 279, - 280, 281, 282, 351, 283, 284, 285, 286, 287, 288, - 289, 290, 292, 293, 294, 295, 296, 297, 299, 300, - 301, 302, 303, 304, 306, 307, 308, 309, 310, 311, - 291, 298, 305, 312, 313, 314, 315, 316, 317, 352, - 353, 354, 355, 356, 357, 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, 0, 173, - 359, 126, 137, 360, 361, 362, 0, 437, 0, 438, - 0, 103, 102, 0, 114, 119, 144, 143, 141, 145, - 0, 138, 140, 124, 167, 142, 358, 0, 434, 436, - 0, 0, 0, 365, 0, 0, 91, 88, 0, 101, - 0, 110, 104, 112, 0, 113, 0, 89, 120, 0, - 94, 139, 125, 0, 168, 1, 435, 165, 0, 136, - 134, 0, 132, 363, 0, 0, 92, 0, 0, 439, - 105, 109, 111, 107, 115, 106, 0, 121, 97, 0, - 95, 0, 2, 8, 9, 4, 5, 6, 7, 11, - 10, 0, 0, 0, 169, 37, 36, 38, 35, 3, - 13, 31, 15, 20, 21, 0, 0, 25, 0, 39, - 0, 43, 46, 49, 54, 57, 59, 61, 63, 65, - 67, 69, 0, 29, 0, 164, 0, 0, 131, 0, - 0, 0, 0, 0, 367, 90, 93, 0, 0, 419, - 0, 0, 0, 0, 0, 0, 0, 0, 391, 400, - 404, 39, 72, 85, 0, 380, 0, 124, 383, 402, - 382, 381, 0, 384, 385, 386, 387, 388, 389, 108, - 0, 116, 0, 375, 123, 0, 0, 99, 0, 96, - 32, 33, 0, 17, 18, 0, 0, 23, 22, 0, - 173, 26, 28, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 70, 170, 171, 0, 166, 87, 135, - 133, 0, 0, 373, 0, 371, 366, 368, 430, 429, - 0, 421, 0, 433, 431, 0, 0, 0, 416, 417, - 390, 0, 75, 76, 78, 77, 80, 81, 82, 83, - 84, 79, 74, 0, 0, 405, 401, 403, 118, 0, - 378, 0, 122, 0, 100, 12, 0, 19, 16, 27, - 40, 41, 42, 45, 44, 47, 48, 52, 53, 50, - 51, 55, 56, 58, 60, 62, 64, 66, 68, 0, - 172, 364, 0, 374, 0, 369, 0, 0, 0, 432, - 0, 415, 0, 392, 73, 86, 117, 376, 0, 98, - 14, 0, 370, 372, 0, 424, 423, 426, 398, 411, - 409, 0, 0, 0, 0, 377, 379, 0, 0, 425, - 0, 0, 408, 0, 0, 406, 0, 0, 0, 393, - 71, 0, 427, 0, 398, 397, 399, 413, 0, 395, - 418, 394, 0, 428, 422, 407, 414, 0, 410, 420, - 412 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 309, 310, 311, 476, 312, 313, 314, 315, 316, - 317, 318, 361, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 362, 499, 363, 463, 364, - 429, 365, 218, 386, 291, 366, 220, 221, 222, 251, - 252, 253, 223, 224, 225, 226, 227, 228, 271, 272, - 229, 230, 231, 232, 268, 333, 264, 234, 235, 236, - 340, 274, 343, 344, 434, 435, 384, 471, 368, 369, - 370, 371, 451, 534, 560, 542, 543, 544, 561, 372, - 373, 374, 545, 533, 375, 546, 567, 376, 377, 512, - 440, 507, 527, 540, 541, 378, 237, 238, 239, 248 -}; +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -512 -static const yytype_int16 yypact[] = -{ - 2538, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -235, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -201, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, -512, -203, -512, - -512, -512, -512, -512, -512, -512, -153, -512, -210, -220, - -152, -189, 4119, -160, -512, -128, -512, -512, -512, -512, - 3079, -512, -512, -512, -122, -512, -512, 564, -512, -512, - -72, -46, -105, -512, 6148, -216, -512, -512, -102, -512, - 4119, -512, -512, -512, 4119, -68, -66, -512, -225, -187, - -512, -512, -512, 4606, -98, -512, -512, -512, -179, -512, - -104, -172, -512, -512, 4119, -101, -512, -186, 846, -512, - -512, -512, -512, -122, -233, -512, 4870, -217, -512, -63, - -512, -151, -512, -512, -512, -512, -512, -512, -512, -512, - -512, 5648, 5648, 5648, -512, -512, -512, -512, -512, -512, - -512, -209, -512, -512, -512, -94, -170, 5898, -92, -512, - 5648, -139, -133, -109, -223, -103, -111, -108, -106, -71, - -74, -218, -86, -512, 5134, -512, -52, 5648, -512, -46, - 4119, 4119, -50, 3342, -512, -512, -512, -90, -89, -512, - -78, -76, -85, 5398, -70, 5648, -80, -69, -64, -512, - -512, -184, -512, -512, -150, -512, -220, -67, -512, -512, - -512, -512, 1128, -512, -512, -512, -512, -512, -512, -98, - 4870, -183, 4870, -512, -512, 4870, 4119, -512, -40, -512, - -512, -512, -169, -512, -512, 5648, -35, -512, -512, 5648, - -65, -512, -512, -512, 5648, 5648, 5648, 5648, 5648, 5648, - 5648, 5648, 5648, 5648, 5648, 5648, 5648, 5648, 5648, 5648, - 5648, 5648, 5648, -512, -512, -512, -61, -512, -512, -512, - -512, 3601, -50, -122, -144, -512, -512, -512, -512, -512, - 1410, -512, 5648, -512, -512, -142, 5648, -123, -512, -512, - -512, 1410, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -512, 5648, 5648, -512, -512, -512, -512, 4870, - -512, -226, -512, 3860, -512, -512, -60, -62, -512, -512, - -512, -512, -512, -139, -139, -133, -133, -109, -109, -109, - -109, -223, -223, -103, -111, -108, -106, -71, -74, 5648, - -512, -512, -138, -98, -50, -512, -33, 2256, -168, -512, - -167, -512, 2798, 1410, -512, -512, -512, -512, 4342, -512, - -512, -121, -512, -512, -56, -512, -512, 2798, -58, -512, - -62, -32, 4119, -49, -51, -512, -512, 5648, 5648, -512, - -57, -45, 177, -55, 1974, -512, -47, -44, 1692, -512, - -512, -165, 5648, 1692, -58, -512, -512, 1410, 4870, -512, - -512, -512, -48, -62, -512, -512, 1410, -42, -512, -512, - -512 -}; +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, - -512, -512, -96, -512, -263, -262, -304, -264, -204, -199, - -205, -197, -206, -196, -512, -252, -512, -282, -512, -296, - -512, 3, -512, -512, -512, 6, -512, -512, -512, -29, - -23, -26, -512, -512, -489, -512, -512, -512, -512, -118, - -512, -221, -228, -512, -512, 0, -240, -512, 13, -512, - -512, -512, -328, -330, -200, -271, -363, -512, -273, -364, - -511, -308, -512, -512, -314, -309, -512, -512, -2, -441, - -260, -512, -512, -279, -512, -512, -512, -512, -512, -512, - -512, -512, -512, -512, -512, -512, -512, 12, -512, -512 -}; - -/* 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 -397 -static const yytype_int16 yytable[] = -{ - 233, 254, 261, 217, 383, 277, 219, 392, 467, 269, - 513, 332, 431, 437, 245, 411, 412, 468, 287, 470, - 240, 242, 472, 531, 263, 422, 261, 393, 394, 254, - 285, 380, 263, 556, 517, 401, 518, 559, 531, 286, - 334, 263, 559, 379, 381, 247, -30, 385, 395, 276, - 413, 414, 396, 341, 241, 246, 243, 445, 473, 447, - 423, 452, 453, 454, 455, 456, 457, 458, 459, 460, - 461, 334, 288, 250, 334, 289, 506, 335, 290, 346, - 462, 469, 426, 336, 338, 428, 398, 475, 528, 529, - 339, 562, 399, 464, 464, 464, 258, 464, 383, 477, - 383, 437, 256, 383, 249, 257, 516, 487, 488, 489, - 490, 388, 464, 261, 389, 465, 566, 479, 504, 341, - 464, 505, 341, 509, 504, 409, 410, 522, 213, 214, - 215, 404, 405, 406, 407, 263, 408, 415, 416, 464, - 511, 464, 537, 437, 483, 484, 508, 485, 486, 467, - 510, 491, 492, 267, 273, 536, 283, 278, 284, 334, - 337, 387, 397, 402, 345, 341, 417, 319, 418, 419, - 421, 420, 424, 427, 433, 438, 439, 441, 270, 442, - 443, 514, 515, 448, 474, 446, 449, 383, -29, 478, - 524, -24, 547, 503, 554, 568, 450, 500, 520, 538, - 464, -396, 467, 521, 358, 390, 391, 548, 552, 549, - 341, 553, 557, 493, 495, 497, 530, 569, 570, 494, - 558, 430, 255, 496, 403, 281, 498, 280, 282, 244, - 262, 530, 502, 523, 525, 555, 383, 233, 319, 564, - 217, 319, 551, 219, 275, 565, 279, 526, 539, 266, - 255, 0, 341, 0, 255, 550, 563, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 342, 0, 383, 0, 367, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 532, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 261, 0, 532, 0, 480, 481, - 482, 319, 319, 319, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 319, 319, 319, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 342, 432, 0, 342, 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, 367, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 342, 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, 342, 0, 0, 0, 0, 0, 0, 0, 0, - 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 367, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 342, 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, 367, 0, 0, - 0, 0, 367, 367, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 367, 0, 0, - 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 367, 0, 0, 0, 367, 0, - 0, 0, 0, 367, 0, 0, 0, 367, 0, 0, - 0, 0, 0, 0, 265, 0, 367, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 210, - 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, - 0, 0, 0, 211, 212, 213, 214, 215, 216, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 347, 348, 349, 0, 350, 351, 352, 353, 354, 355, - 356, 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, 357, - 292, 210, 293, 294, 295, 296, 297, 298, 299, 300, - 0, 0, 301, 302, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 303, 0, 0, 0, 358, 359, 0, 0, 0, - 0, 360, 305, 306, 307, 308, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, - 216, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 347, 348, 349, 0, 350, 351, 352, 353, - 354, 355, 356, 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, 357, 292, 210, 293, 294, 295, 296, 297, 298, - 299, 300, 0, 0, 301, 302, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 303, 0, 0, 0, 358, 466, 0, - 0, 0, 0, 360, 305, 306, 307, 308, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, - 214, 215, 216, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 347, 348, 349, 0, 350, 351, - 352, 353, 354, 355, 356, 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, 357, 292, 210, 293, 294, 295, 296, - 297, 298, 299, 300, 0, 0, 301, 302, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 303, 0, 0, 0, 358, - 0, 0, 0, 0, 0, 360, 305, 306, 307, 308, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, - 212, 213, 214, 215, 216, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 347, 348, 349, 0, - 350, 351, 352, 353, 354, 355, 356, 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, 357, 292, 210, 293, 294, - 295, 296, 297, 298, 299, 300, 0, 0, 301, 302, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, - 0, 278, 0, 0, 0, 0, 0, 360, 305, 306, - 307, 308, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 211, 212, 213, 214, 215, 216, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 347, 348, - 349, 0, 350, 351, 352, 353, 354, 355, 356, 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, 357, 292, 210, - 293, 294, 295, 296, 297, 298, 299, 300, 0, 0, - 301, 302, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 360, - 305, 306, 307, 308, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 211, 212, 213, 214, 215, 216, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 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, 0, - 292, 210, 293, 294, 295, 296, 297, 298, 299, 300, - 0, 0, 301, 302, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 303, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 305, 306, 307, 308, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, - 216, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 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, 0, 0, 210, 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, 9, - 10, 11, 0, 0, 0, 0, 0, 211, 212, 213, - 214, 215, 216, 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, 0, 292, 210, 293, 294, 295, 296, 297, 298, - 299, 300, 0, 0, 301, 302, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 303, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 305, 306, 307, 308, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, - 214, 215, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 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, 0, 259, 210, 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, 260, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 0, 0, 211, 212, - 213, 214, 215, 0, 0, 0, 0, 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, 0, 0, 210, 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, 436, 0, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, - 0, 211, 212, 213, 214, 215, 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, 0, 0, 210, 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, 501, 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, - 211, 212, 213, 214, 215, 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, 0, 0, 210, 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, - 519, 0, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 0, 0, 0, 0, 0, 0, 211, - 212, 213, 214, 215, 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, 0, 0, 210, 0, 0, 0, 4, 5, - 6, 7, 8, 9, 10, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, - 213, 214, 215, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, - 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, 0, 292, 210, 293, 294, - 295, 296, 297, 298, 299, 300, 0, 0, 301, 302, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, - 0, 382, 535, 0, 0, 0, 0, 0, 305, 306, - 307, 308, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, - 0, 0, 0, 0, 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, 0, - 292, 210, 293, 294, 295, 296, 297, 298, 299, 300, - 0, 0, 301, 302, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 303, 0, 0, 304, 0, 0, 0, 0, 0, - 0, 0, 305, 306, 307, 308, 4, 5, 6, 7, - 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 0, 0, 0, 0, 0, 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, 0, 292, 210, 293, 294, 295, 296, - 297, 298, 299, 300, 0, 0, 301, 302, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 303, 0, 0, 0, 382, - 0, 0, 0, 0, 0, 0, 305, 306, 307, 308, - 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, - 0, 0, 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, 0, 292, 210, - 293, 294, 295, 296, 297, 298, 299, 300, 0, 0, - 301, 302, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, - 0, 0, 425, 0, 0, 0, 0, 0, 0, 0, - 305, 306, 307, 308, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 0, 0, 0, 0, 0, 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, 0, 292, 210, 293, 294, 295, 296, 297, 298, - 299, 300, 0, 0, 301, 302, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 303, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 444, 305, 306, 307, 308, 0, 0, - 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 0, 0, 0, 0, 0, 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, 0, 292, 210, 293, 294, 295, 296, 297, 298, - 299, 300, 0, 0, 301, 302, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 303, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 305, 306, 307, 308, 0, 0, - 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 0, 0, 0, 0, 0, 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, - 400, 0, 292, 210, 293, 294, 295, 296, 297, 298, - 299, 300, 0, 0, 301, 302, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 303, 4, 5, 6, 7, 8, 9, - 10, 11, 0, 0, 305, 306, 307, 308, 0, 0, - 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 0, 0, 0, 0, 0, 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, 0, 0, 210 -}; - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-512))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_int16 yycheck[] = -{ - 0, 222, 230, 0, 286, 245, 0, 303, 372, 55, - 451, 263, 340, 343, 224, 238, 239, 380, 258, 382, - 255, 224, 385, 512, 257, 243, 254, 236, 237, 250, - 255, 264, 257, 544, 260, 317, 262, 548, 527, 264, - 257, 257, 553, 283, 284, 265, 255, 264, 257, 265, - 273, 274, 261, 274, 255, 265, 259, 353, 386, 355, - 278, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 257, 259, 262, 257, 262, 440, 256, 265, 265, - 264, 264, 334, 262, 256, 337, 256, 256, 256, 256, - 262, 256, 262, 262, 262, 262, 224, 262, 380, 395, - 382, 431, 262, 385, 256, 265, 469, 411, 412, 413, - 414, 262, 262, 341, 265, 265, 557, 399, 262, 340, - 262, 265, 343, 265, 262, 234, 235, 265, 281, 282, - 283, 270, 271, 272, 267, 257, 269, 240, 241, 262, - 263, 262, 263, 473, 407, 408, 442, 409, 410, 513, - 446, 415, 416, 225, 259, 518, 224, 259, 224, 257, - 264, 224, 256, 255, 265, 386, 277, 263, 276, 275, - 244, 242, 258, 225, 224, 265, 265, 255, 224, 255, - 265, 463, 464, 263, 224, 255, 255, 469, 255, 224, - 223, 256, 224, 433, 17, 558, 260, 258, 258, 255, - 262, 259, 566, 499, 259, 301, 302, 256, 265, 260, - 431, 256, 259, 417, 419, 421, 512, 265, 260, 418, - 264, 339, 222, 420, 320, 254, 422, 250, 254, 216, - 230, 527, 432, 504, 507, 543, 518, 237, 334, 553, - 237, 337, 538, 237, 244, 554, 248, 507, 527, 237, - 250, -1, 473, -1, 254, 537, 552, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 274, -1, 558, -1, 278, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 512, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 532, -1, 527, -1, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 421, 422, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 340, 341, -1, 343, -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, 372, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 386, -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, 431, -1, -1, -1, -1, -1, -1, -1, -1, - 440, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 451, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 473, -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, 507, -1, -1, - -1, -1, 512, 513, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 527, -1, -1, - -1, -1, 532, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 544, -1, -1, -1, 548, -1, - -1, -1, -1, 553, -1, -1, -1, 557, -1, -1, - -1, -1, -1, -1, 0, -1, 566, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, -1, 225, - -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, 279, 280, 281, 282, 283, 284, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, -1, 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, - -1, -1, 236, 237, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 255, -1, -1, -1, 259, 260, -1, -1, -1, - -1, 265, 266, 267, 268, 269, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 279, 280, 281, 282, 283, - 284, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, -1, 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, -1, -1, 236, 237, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 255, -1, -1, -1, 259, 260, -1, - -1, -1, -1, 265, 266, 267, 268, 269, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 279, 280, 281, - 282, 283, 284, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, -1, 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, -1, -1, 236, 237, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 255, -1, -1, -1, 259, - -1, -1, -1, -1, -1, 265, 266, 267, 268, 269, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 279, - 280, 281, 282, 283, 284, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, - 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, -1, -1, 236, 237, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, - -1, 259, -1, -1, -1, -1, -1, 265, 266, 267, - 268, 269, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 279, 280, 281, 282, 283, 284, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, -1, 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, -1, -1, - 236, 237, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 265, - 266, 267, 268, 269, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 279, 280, 281, 282, 283, 284, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 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, -1, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - -1, -1, 236, 237, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 265, 266, 267, 268, 269, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 279, 280, 281, 282, 283, - 284, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 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, -1, -1, 225, -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, 11, - 12, 13, -1, -1, -1, -1, -1, 279, 280, 281, - 282, 283, 284, 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, -1, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, -1, -1, 236, 237, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 266, 267, 268, 269, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 279, 280, 281, - 282, 283, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 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, -1, 224, 225, -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, 265, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, -1, -1, 279, 280, - 281, 282, 283, -1, -1, -1, -1, 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, -1, -1, 225, -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, 260, -1, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, -1, -1, -1, -1, -1, - -1, 279, 280, 281, 282, 283, 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, -1, -1, 225, -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, 260, -1, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, - 279, 280, 281, 282, 283, 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, -1, -1, 225, -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, - 260, -1, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, -1, -1, -1, -1, -1, -1, 279, - 280, 281, 282, 283, 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, -1, -1, 225, -1, -1, -1, 6, 7, - 8, 9, 10, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 279, 280, - 281, 282, 283, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, - 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, -1, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, -1, -1, 236, 237, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, - -1, 259, 260, -1, -1, -1, -1, -1, 266, 267, - 268, 269, 6, 7, 8, 9, 10, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, - -1, -1, -1, -1, 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, -1, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - -1, -1, 236, 237, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 255, -1, -1, 258, -1, -1, -1, -1, -1, - -1, -1, 266, 267, 268, 269, 6, 7, 8, 9, - 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, -1, -1, -1, -1, -1, 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, -1, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, -1, -1, 236, 237, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 255, -1, -1, -1, 259, - -1, -1, -1, -1, -1, -1, 266, 267, 268, 269, - 6, 7, 8, 9, 10, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, - -1, -1, 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, -1, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, -1, -1, - 236, 237, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, - -1, -1, 258, -1, -1, -1, -1, -1, -1, -1, - 266, 267, 268, 269, 6, 7, 8, 9, 10, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, -1, -1, -1, -1, -1, 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, -1, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, -1, -1, 236, 237, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 255, 6, 7, 8, 9, 10, 11, - 12, 13, -1, 265, 266, 267, 268, 269, -1, -1, - -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, -1, -1, -1, -1, -1, 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, -1, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, -1, -1, 236, 237, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 255, 6, 7, 8, 9, 10, 11, - 12, 13, -1, -1, 266, 267, 268, 269, -1, -1, - -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, -1, -1, -1, -1, -1, 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, -1, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, -1, -1, 236, 237, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 255, 6, 7, 8, 9, 10, 11, - 12, 13, -1, -1, 266, 267, 268, 269, -1, -1, - -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, -1, -1, -1, -1, -1, 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, -1, -1, 225 -}; - -/* 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, 11, - 12, 13, 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, - 225, 279, 280, 281, 282, 283, 284, 319, 320, 323, - 324, 325, 326, 330, 331, 332, 333, 334, 335, 338, - 339, 340, 341, 343, 345, 346, 347, 384, 385, 386, - 255, 255, 224, 259, 346, 224, 265, 265, 387, 256, - 262, 327, 328, 329, 339, 343, 262, 265, 224, 224, - 265, 340, 343, 257, 344, 0, 385, 225, 342, 55, - 224, 336, 337, 259, 349, 343, 265, 344, 259, 366, - 328, 327, 329, 224, 224, 255, 264, 344, 259, 262, - 265, 322, 224, 226, 227, 228, 229, 230, 231, 232, - 233, 236, 237, 255, 258, 266, 267, 268, 269, 289, - 290, 291, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 343, 257, 256, 262, 264, 256, 262, - 348, 339, 343, 350, 351, 265, 265, 14, 15, 16, - 18, 19, 20, 21, 22, 23, 24, 223, 259, 260, - 265, 300, 313, 315, 317, 319, 323, 343, 356, 357, - 358, 359, 367, 368, 369, 372, 375, 376, 383, 344, - 264, 344, 259, 315, 354, 264, 321, 224, 262, 265, - 300, 300, 317, 236, 237, 257, 261, 256, 256, 262, - 222, 315, 255, 300, 270, 271, 272, 267, 269, 234, - 235, 238, 239, 273, 274, 240, 241, 277, 276, 275, - 242, 244, 243, 278, 258, 258, 313, 225, 313, 318, - 337, 350, 343, 224, 352, 353, 260, 351, 265, 265, - 378, 255, 255, 265, 265, 317, 255, 317, 263, 255, - 260, 360, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 264, 316, 262, 265, 260, 357, 354, 264, - 354, 355, 354, 350, 224, 256, 292, 317, 224, 315, - 300, 300, 300, 302, 302, 303, 303, 304, 304, 304, - 304, 305, 305, 306, 307, 308, 309, 310, 311, 314, - 258, 260, 352, 344, 262, 265, 357, 379, 317, 265, - 317, 263, 377, 367, 315, 315, 354, 260, 262, 260, - 258, 317, 265, 353, 223, 356, 368, 380, 256, 256, - 317, 332, 339, 371, 361, 260, 354, 263, 255, 371, - 381, 382, 363, 364, 365, 370, 373, 224, 256, 260, - 315, 317, 265, 256, 17, 359, 358, 259, 264, 358, - 362, 366, 256, 317, 362, 363, 367, 374, 354, 265, - 260 -}; - -#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) @@ -2803,27 +2698,15 @@ do \ else \ { \ yyerror (pParseContext, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#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 @@ -2833,58 +2716,47 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (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)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# 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 (0) + + +/*----------------------------------------. +| Print this symbol's value 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); + YYUSE (pParseContext); if (!yyvaluep) return; - YYUSE (pParseContext); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -2892,23 +2764,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext) | 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]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); YYFPRINTF (yyoutput, ")"); @@ -2919,16 +2779,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, pParseContext) | 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++) @@ -2939,50 +2791,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (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 +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) { + unsigned long int yylno = yyrline[yyrule]; 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); + 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); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(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)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2996,7 +2840,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -3019,15 +2863,8 @@ int yydebug; # 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++) @@ -3043,16 +2880,8 @@ yystrlen (yystr) # 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; @@ -3082,27 +2911,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + 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 (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -3125,11 +2954,11 @@ 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 yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -3137,10 +2966,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 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 @@ -3190,7 +3015,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -3257,33 +3082,18 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | 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; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -3293,56 +3103,18 @@ yydestruct (yymsg, yytype, yyvaluep, pParseContext) | 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 +/* The semantic value of the lookahead symbol. */ /* 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); +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -3352,8 +3124,8 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -3421,23 +3193,23 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); #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; + /* 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); + /* 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; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -3445,22 +3217,22 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + 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); + 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); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -3469,10 +3241,10 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -3501,7 +3273,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, parseContext); } if (yychar <= YYEOF) @@ -3566,7 +3338,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -3580,259 +3352,280 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 250 "glslang.y" +#line 253 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[(1) - (1)].lex).loc, (yyvsp[(1) - (1)].lex).symbol, (yyvsp[(1) - (1)].lex).string); + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } +#line 3360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 256 "glslang.y" +#line 259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3368 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 4: -/* Line 1792 of yacc.c */ -#line 259 "glslang.y" +#line 262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).i, (yyvsp[(1) - (1)].lex).loc, true); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } +#line 3376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 5: -/* Line 1792 of yacc.c */ -#line 262 "glslang.y" +#line 265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } +#line 3385 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 6: -/* Line 1792 of yacc.c */ -#line 266 "glslang.y" +#line 269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).i64, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } +#line 3394 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 7: -/* Line 1792 of yacc.c */ -#line 270 "glslang.y" +#line 273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit unsigned integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).u64, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } +#line 3403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 8: -/* Line 1792 of yacc.c */ -#line 274 "glslang.y" +#line 277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtFloat, (yyvsp[(1) - (1)].lex).loc, true); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); +#endif } +#line 3414 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 9: -/* Line 1792 of yacc.c */ -#line 277 "glslang.y" +#line 283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); +#endif } +#line 3425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 10: -/* Line 1792 of yacc.c */ -#line 281 "glslang.y" +#line 289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtFloat16, (yyvsp[(1) - (1)].lex).loc, true); -#endif + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } +#line 3433 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 11: -/* Line 1792 of yacc.c */ -#line 287 "glslang.y" +#line 292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).b, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } +#line 3442 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 12: -/* Line 1792 of yacc.c */ -#line 290 "glslang.y" +#line 296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); +#ifdef AMD_EXTENSIONS + parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); +#endif } +#line 3453 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 298 "glslang.y" +#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } +#line 3461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 301 "glslang.y" +#line 305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } +#line 3471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 304 "glslang.y" +#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 307 "glslang.y" +#line 316 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[(3) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode), *(yyvsp[(3) - (3)].lex).string); + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } +#line 3487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 310 "glslang.y" +#line 319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3495 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 315 "glslang.y" +#line 322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } +#line 3503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 323 "glslang.y" +#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.integerCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } +#line 3513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 330 "glslang.y" +#line 330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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; + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } +#line 3523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 337 "glslang.y" +#line 338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 343 "glslang.y" +#line 345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); + delete (yyvsp[0].interm).function; } +#line 3541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 347 "glslang.y" +#line 352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm) = (yyvsp[0].interm); } +#line 3549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 354 "glslang.y" +#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 3558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 357 "glslang.y" +#line 362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 3567 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 363 "glslang.y" +#line 369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm) = (yyvsp[-1].interm); } +#line 3575 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 370 "glslang.y" +#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm) = (yyvsp[0].interm); } +#line 3583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 380 "glslang.y" +#line 378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } +#line 3595 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 388 "glslang.y" +#line 385 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Constructor - (yyval.interm).intermNode = 0; - (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type)); + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } +#line 3607 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 393 "glslang.y" +#line 395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 3615 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 31: +#line 403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 3625 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -3840,18 +3633,18 @@ yyreduce: (yyval.interm).function = 0; (yyval.interm).intermNode = 0; - TIntermMethod* method = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsMethodNode(); + TIntermMethod* method = (yyvsp[0].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(); + TIntermSymbol* symbol = (yyvsp[0].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", "", ""); + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); } if ((yyval.interm).function == 0) { @@ -3860,3916 +3653,4019 @@ yyreduce: (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } - break; - - case 31: -/* Line 1792 of yacc.c */ -#line 423 "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 32: -/* Line 1792 of yacc.c */ -#line 429 "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)); - } +#line 3657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 433 "glslang.y" +#line 438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } +#line 3668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 437 "glslang.y" +#line 444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (2)].interm).op != EOpNull) { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 3677 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 35: +#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 3686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 36: +#line 452 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; - switch((yyvsp[(1) - (2)].interm).op) { + switch((yyvsp[-1].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)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); } else { - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } - break; - - case 35: -/* Line 1792 of yacc.c */ -#line 457 "glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNull; } - break; - - case 36: -/* Line 1792 of yacc.c */ -#line 458 "glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNegative; } +#line 3707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 459 "glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 3713 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 460 "glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpBitwiseNot; - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise not"); } +#line 473 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 3719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 466 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 3725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 467 "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); - } +#line 475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 3732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 472 "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); - } +#line 481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 477 "glslang.y" +#line 482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3748 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 486 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 487 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 487 "glslang.y" +#line 492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "+", EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 492 "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); - } +#line 501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 500 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 501 "glslang.y" +#line 507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 507 "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); - } +#line 515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3801 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 49: -/* Line 1792 of yacc.c */ -#line 516 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3812 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 50: -/* Line 1792 of yacc.c */ -#line 517 "glslang.y" +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<", EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 522 "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); - } +#line 531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3829 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 527 "glslang.y" +#line 532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<=", EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3839 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 532 "glslang.y" +#line 537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3849 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 540 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 542 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 3859 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 541 "glslang.y" +#line 547 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3869 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 56: -/* Line 1792 of yacc.c */ -#line 549 "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); - } +#line 555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 560 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 3888 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 561 "glslang.y" +#line 564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 59: -/* Line 1792 of yacc.c */ -#line 570 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 60: -/* Line 1792 of yacc.c */ -#line 571 "glslang.y" +#line 576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 580 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 581 "glslang.y" +#line 586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 63: -/* Line 1792 of yacc.c */ -#line 590 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3941 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 64: -/* Line 1792 of yacc.c */ -#line 591 "glslang.y" +#line 596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "&&", EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 599 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 600 "glslang.y" +#line 606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "^^", EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 608 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3974 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 609 "glslang.y" +#line 615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "||", EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 69: -/* Line 1792 of yacc.c */ -#line 617 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 70: -/* Line 1792 of yacc.c */ -#line 618 "glslang.y" +#line 624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - ++parseContext.controlFlowNestingLevel; + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 4000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 71: -/* Line 1792 of yacc.c */ -#line 621 "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); - } - } +#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 72: -/* Line 1792 of yacc.c */ -#line 636 "glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + ++parseContext.controlFlowNestingLevel; + } +#line 4014 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 637 "glslang.y" +#line 636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).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); + parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } +#line 4031 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 652 "glslang.y" - { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpAssign; - } +#line 651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4037 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 656 "glslang.y" +#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpMulAssign; + parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } } +#line 4054 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 660 "glslang.y" +#line 667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpDivAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAssign; } +#line 4063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 77: -/* Line 1792 of yacc.c */ -#line 664 "glslang.y" +#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "%="); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpModAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpMulAssign; } +#line 4072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 669 "glslang.y" +#line 675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpAddAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpDivAssign; } +#line 4081 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 673 "glslang.y" +#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpSubAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpModAssign; } +#line 4091 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 80: -/* Line 1792 of yacc.c */ -#line 677 "glslang.y" +#line 684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift left assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAddAssign; } +#line 4100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 681 "glslang.y" +#line 688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift right assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpSubAssign; } +#line 4109 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 685 "glslang.y" +#line 692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-and assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpAndAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } +#line 4118 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 689 "glslang.y" +#line 696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-xor assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } +#line 4127 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 693 "glslang.y" +#line 700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-or assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } +#line 4136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 700 "glslang.y" +#line 704 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } +#line 4145 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 703 "glslang.y" +#line 708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.samplerConstructorLocationCheck((yyvsp[(2) - (3)].lex).loc, ",", (yyvsp[(3) - (3)].interm.intermTypedNode)); - (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); - } + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } +#line 4154 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 87: -/* Line 1792 of yacc.c */ -#line 714 "glslang.y" +#line 715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.constantValueCheck((yyvsp[(1) - (1)].interm.intermTypedNode), ""); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 88: -/* Line 1792 of yacc.c */ -#line 721 "glslang.y" +#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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 + parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } } +#line 4175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 89: -/* Line 1792 of yacc.c */ -#line 726 "glslang.y" +#line 729 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4184 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 90: -/* Line 1792 of yacc.c */ -#line 731 "glslang.y" +#line 736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } +#line 4194 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 91: -/* Line 1792 of yacc.c */ -#line 739 "glslang.y" +#line 741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (2)].interm).loc, *(yyvsp[(1) - (2)].interm).typeList); - (yyval.interm.intermNode) = 0; + if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) + (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } +#line 4204 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 92: -/* Line 1792 of yacc.c */ -#line 743 "glslang.y" +#line 746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (3)].interm).loc, *(yyvsp[(1) - (3)].interm).typeList, (yyvsp[(2) - (3)].lex).string); + parseContext.profileRequires((yyvsp[-3].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[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } +#line 4217 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 93: -/* Line 1792 of yacc.c */ -#line 747 "glslang.y" +#line 754 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (4)].interm).loc, *(yyvsp[(1) - (4)].interm).typeList, (yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].interm).arraySizes); + parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } +#line 4226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 94: -/* Line 1792 of yacc.c */ -#line 751 "glslang.y" +#line 758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } +#line 4235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 95: -/* Line 1792 of yacc.c */ -#line 756 "glslang.y" +#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } +#line 4244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 96: -/* Line 1792 of yacc.c */ -#line 761 "glslang.y" +#line 766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } +#line 4254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 97: -/* Line 1792 of yacc.c */ -#line 770 "glslang.y" - { parseContext.nestedBlockCheck((yyvsp[(1) - (3)].interm.type).loc); } +#line 771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; + } +#line 4264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 98: -/* Line 1792 of yacc.c */ -#line 770 "glslang.y" +#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --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); + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); + parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + (yyval.interm.intermNode) = 0; } +#line 4275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 99: -/* Line 1792 of yacc.c */ -#line 781 "glslang.y" - { - (yyval.interm.identifierList) = new TIdentifierList; - (yyval.interm.identifierList)->push_back((yyvsp[(2) - (2)].lex).string); - } +#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 4281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 100: -/* Line 1792 of yacc.c */ -#line 785 "glslang.y" +#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = (yyvsp[(1) - (3)].interm.identifierList); - (yyval.interm.identifierList)->push_back((yyvsp[(3) - (3)].lex).string); + --parseContext.structNestingLevel; + parseContext.blockName = (yyvsp[-4].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[-5].interm.type).loc; + (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } +#line 4295 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 101: -/* Line 1792 of yacc.c */ -#line 792 "glslang.y" +#line 796 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } +#line 4304 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 102: -/* Line 1792 of yacc.c */ -#line 799 "glslang.y" +#line 800 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } +#line 4313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 103: -/* Line 1792 of yacc.c */ -#line 802 "glslang.y" +#line 807 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + (yyval.interm).function = (yyvsp[-1].interm.function); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 4322 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 104: -/* Line 1792 of yacc.c */ -#line 809 "glslang.y" +#line 814 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // 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; + (yyval.interm.function) = (yyvsp[0].interm.function); } +#line 4330 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 105: -/* Line 1792 of yacc.c */ -#line 817 "glslang.y" +#line 817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.function) = (yyvsp[0].interm.function); + } +#line 4338 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 106: +#line 824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Add the parameter + (yyval.interm.function) = (yyvsp[-1].interm.function); + if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + delete (yyvsp[0].interm).param.type; + } +#line 4351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 107: +#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // 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) { + if ((yyvsp[0].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; + parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[0].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); + (yyval.interm.function) = (yyvsp[-2].interm.function); + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } - break; - - case 106: -/* Line 1792 of yacc.c */ -#line 837 "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 107: -/* Line 1792 of yacc.c */ -#line 855 "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; - } +#line 4373 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 108: -/* Line 1792 of yacc.c */ -#line 870 "glslang.y" +#line 852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); } - parseContext.arrayDimCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.type).arraySizes, (yyvsp[(3) - (3)].interm).arraySizes); + if ((yyvsp[-2].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).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; + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[-2].interm.type)); + function = new TFunction((yyvsp[-1].lex).string, type); + (yyval.interm.function) = function; } +#line 4392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 109: -/* Line 1792 of yacc.c */ -#line 893 "glslang.y" +#line 870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + if ((yyvsp[-1].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); + } + if ((yyvsp[-1].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).param = param; } +#line 4412 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 110: -/* Line 1792 of yacc.c */ -#line 904 "glslang.y" +#line 885 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.type).arraySizes, (yyvsp[0].interm).arraySizes); - 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()); + parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); + + (yyvsp[-2].interm.type).arraySizes = (yyvsp[0].interm).arraySizes; + + TParameter param = { (yyvsp[-1].lex).string, new TType((yyvsp[-2].interm.type))}; + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).param = param; } +#line 4434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 111: -/* Line 1792 of yacc.c */ -#line 914 "glslang.y" +#line 908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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()); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); - 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); } +#line 4450 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 112: -/* Line 1792 of yacc.c */ -#line 924 "glslang.y" +#line 919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[0].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.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } +#line 4462 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 113: -/* Line 1792 of yacc.c */ -#line 934 "glslang.y" +#line 929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } +#line 4477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 114: -/* Line 1792 of yacc.c */ -#line 943 "glslang.y" +#line 939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } +#line 4489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 115: -/* Line 1792 of yacc.c */ -#line 946 "glslang.y" +#line 949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (3)].interm); - parseContext.declareVariable((yyvsp[(3) - (3)].lex).loc, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm).type); + TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; + (yyval.interm).param = param; + if ((yyvsp[0].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } +#line 4500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 116: -/* Line 1792 of yacc.c */ -#line 950 "glslang.y" +#line 958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm) = (yyvsp[0].interm); } +#line 4508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 117: -/* Line 1792 of yacc.c */ -#line 954 "glslang.y" +#line 961 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm) = (yyvsp[-2].interm); + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } +#line 4517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 118: -/* Line 1792 of yacc.c */ -#line 959 "glslang.y" +#line 965 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm) = (yyvsp[-3].interm); + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } +#line 4526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 119: -/* Line 1792 of yacc.c */ -#line 967 "glslang.y" +#line 969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + (yyval.interm).type = (yyvsp[-5].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } +#line 4536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 120: -/* Line 1792 of yacc.c */ -#line 972 "glslang.y" +#line 974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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)); + (yyval.interm).type = (yyvsp[-4].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } +#line 4546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 121: -/* Line 1792 of yacc.c */ -#line 977 "glslang.y" +#line 982 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (3)].interm.type); + (yyval.interm).type = (yyvsp[0].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); + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } +#line 4556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 122: -/* Line 1792 of yacc.c */ -#line 982 "glslang.y" +#line 987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm).type = (yyvsp[-1].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } +#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 123: -/* Line 1792 of yacc.c */ -#line 987 "glslang.y" +#line 992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm).type = (yyvsp[-2].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } +#line 4576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 124: -/* Line 1792 of yacc.c */ -#line 996 "glslang.y" +#line 997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm).type = (yyvsp[-4].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + } +#line 4586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - 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"); + case 125: +#line 1002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).type = (yyvsp[-3].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + } +#line 4596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 126: +#line 1011 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + + parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } +#line 4612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 125: -/* Line 1792 of yacc.c */ -#line 1007 "glslang.y" + case 127: +#line 1022 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].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[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].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; + if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) + (yyvsp[0].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); + parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); - (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); + (yyval.interm.type) = (yyvsp[0].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 126: -/* Line 1792 of yacc.c */ -#line 1034 "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 127: -/* Line 1792 of yacc.c */ -#line 1043 "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; - } +#line 4641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 128: -/* Line 1792 of yacc.c */ -#line 1050 "glslang.y" +#line 1049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.invariant = true; } +#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 129: -/* Line 1792 of yacc.c */ -#line 1057 "glslang.y" +#line 1058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.smooth = true; } +#line 4664 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 130: -/* Line 1792 of yacc.c */ -#line 1064 "glslang.y" +#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "__explicitInterpAMD"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.explicitInterp = true; -#endif + parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.flat = true; } +#line 4676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 131: -/* Line 1792 of yacc.c */ -#line 1076 "glslang.y" +#line 1072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(3) - (4)].interm.type); + parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); + parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; } +#line 4688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 132: -/* Line 1792 of yacc.c */ -#line 1082 "glslang.y" +#line 1079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); +#ifdef AMD_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.explicitInterp = true; +#endif } +#line 4702 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 133: -/* Line 1792 of yacc.c */ -#line 1085 "glslang.y" +#line 1091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm.type) = (yyvsp[-1].interm.type); } +#line 4710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 134: -/* Line 1792 of yacc.c */ -#line 1092 "glslang.y" +#line 1097 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - parseContext.setLayoutQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type), *(yyvsp[(1) - (1)].lex).string); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 135: -/* Line 1792 of yacc.c */ -#line 1096 "glslang.y" +#line 1100 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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)); + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } +#line 4728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 136: -/* Line 1792 of yacc.c */ -#line 1100 "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); +#line 1107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } +#line 4737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 137: -/* Line 1792 of yacc.c */ -#line 1108 "glslang.y" +#line 1111 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.noContraction = true; + (yyval.interm.type).init((yyvsp[-2].lex).loc); + parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } +#line 4746 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 138: -/* Line 1792 of yacc.c */ -#line 1117 "glslang.y" - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); +#line 1115 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[0].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } +#line 4756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 139: -/* Line 1792 of yacc.c */ -#line 1120 "glslang.y" +#line 1123 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.noContraction = true; } +#line 4767 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 140: -/* Line 1792 of yacc.c */ -#line 1131 "glslang.y" +#line 1132 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 141: -/* Line 1792 of yacc.c */ -#line 1134 "glslang.y" +#line 1135 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[-1].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } +#line 4788 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 142: -/* Line 1792 of yacc.c */ -#line 1137 "glslang.y" +#line 1146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkPrecisionQualifier((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type).qualifier.precision); - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 143: -/* Line 1792 of yacc.c */ -#line 1141 "glslang.y" +#line 1149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 144: -/* Line 1792 of yacc.c */ -#line 1145 "glslang.y" +#line 1152 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 145: -/* Line 1792 of yacc.c */ -#line 1149 "glslang.y" +#line 1156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4822 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 146: -/* Line 1792 of yacc.c */ -#line 1156 "glslang.y" +#line 1160 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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 + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 147: -/* Line 1792 of yacc.c */ -#line 1160 "glslang.y" +#line 1164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 148: -/* Line 1792 of yacc.c */ -#line 1172 "glslang.y" +#line 1171 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } +#line 4849 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "varying"); + case 149: +#line 1175 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } +#line 4866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 150: +#line 1187 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); if (parseContext.language == EShLangVertex) (yyval.interm.type).qualifier.storage = EvqVaryingOut; else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } - break; - - case 149: -/* Line 1792 of yacc.c */ -#line 1186 "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 150: -/* Line 1792 of yacc.c */ -#line 1191 "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; - } +#line 4885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 151: -/* Line 1792 of yacc.c */ -#line 1197 "glslang.y" +#line 1201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; } +#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 152: -/* Line 1792 of yacc.c */ -#line 1203 "glslang.y" +#line 1206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.globalCheck((yyvsp[0].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[0].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; } +#line 4906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 153: -/* Line 1792 of yacc.c */ -#line 1210 "glslang.y" +#line 1212 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + parseContext.globalCheck((yyvsp[0].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[0].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; } +#line 4917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 154: -/* Line 1792 of yacc.c */ -#line 1216 "glslang.y" +#line 1218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "sample"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.sample = true; + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.centroid = true; } +#line 4929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 155: -/* Line 1792 of yacc.c */ -#line 1221 "glslang.y" +#line 1225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "uniform"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqUniform; + parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.patch = true; } +#line 4940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 156: -/* Line 1792 of yacc.c */ -#line 1226 "glslang.y" +#line 1231 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "buffer"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqBuffer; + parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.sample = true; } +#line 4950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 157: -/* Line 1792 of yacc.c */ -#line 1231 "glslang.y" +#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "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; + parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; } +#line 4960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 158: -/* Line 1792 of yacc.c */ -#line 1238 "glslang.y" +#line 1241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.coherent = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; } +#line 4970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 159: -/* Line 1792 of yacc.c */ -#line 1242 "glslang.y" +#line 1246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.volatil = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; } +#line 4983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 160: -/* Line 1792 of yacc.c */ -#line 1246 "glslang.y" +#line 1254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.restrict = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.coherent = true; } +#line 4992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 161: -/* Line 1792 of yacc.c */ -#line 1250 "glslang.y" +#line 1258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.readonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.volatil = true; } +#line 5001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 162: -/* Line 1792 of yacc.c */ -#line 1254 "glslang.y" +#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.writeonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.restrict = true; } +#line 5010 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 163: -/* Line 1792 of yacc.c */ -#line 1258 "glslang.y" +#line 1266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.readonly = true; } +#line 5019 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 164: -/* Line 1792 of yacc.c */ -#line 1264 "glslang.y" +#line 1270 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; + } +#line 5028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 165: +#line 1274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + } +#line 5039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 166: +#line 1280 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[-3].lex).loc); + } +#line 5050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 167: +#line 1289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // TODO + } +#line 5058 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 168: +#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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 165: -/* Line 1792 of yacc.c */ -#line 1276 "glslang.y" - { - // TODO: 4.0 functionality: subroutine type to list - } - break; - - case 166: -/* Line 1792 of yacc.c */ -#line 1279 "glslang.y" - { - } - break; - - case 167: -/* Line 1792 of yacc.c */ -#line 1284 "glslang.y" - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); - } - break; - - case 168: -/* Line 1792 of yacc.c */ -#line 1288 "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; - } +#line 5068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 169: -/* Line 1792 of yacc.c */ -#line 1297 "glslang.y" +#line 1300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (2)].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - (yyval.interm).arraySizes->addInnerSize(); + (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } +#line 5077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 170: -/* Line 1792 of yacc.c */ -#line 1302 "glslang.y" +#line 1304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + parseContext.arrayDimCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes, 0); + (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } +#line 5088 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 171: -/* Line 1792 of yacc.c */ -#line 1310 "glslang.y" +#line 1313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (3)].interm); + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } +#line 5098 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 172: -/* Line 1792 of yacc.c */ -#line 1314 "glslang.y" +#line 1318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (4)].interm); + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; TArraySize size; - parseContext.arraySizeCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLoc(), (yyvsp[(3) - (4)].interm.intermTypedNode), size); + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } +#line 5111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 173: -/* Line 1792 of yacc.c */ -#line 1324 "glslang.y" +#line 1326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtVoid; + (yyval.interm) = (yyvsp[-2].interm); + (yyval.interm).arraySizes->addInnerSize(); } +#line 5120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 174: -/* Line 1792 of yacc.c */ -#line 1328 "glslang.y" +#line 1330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; + (yyval.interm) = (yyvsp[-3].interm); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } +#line 5132 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 175: -/* Line 1792 of yacc.c */ -#line 1332 "glslang.y" +#line 1340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; } +#line 5141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 176: -/* Line 1792 of yacc.c */ -#line 1337 "glslang.y" +#line 1344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; -#endif + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } +#line 5150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 177: -/* Line 1792 of yacc.c */ -#line 1344 "glslang.y" +#line 1348 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } +#line 5160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 178: -/* Line 1792 of yacc.c */ -#line 1348 "glslang.y" +#line 1353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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; +#ifdef AMD_EXTENSIONS + parseContext.float16Check((yyvsp[0].lex).loc, "half float", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; +#endif } +#line 5172 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 179: -/* Line 1792 of yacc.c */ -#line 1353 "glslang.y" +#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } +#line 5181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 180: -/* Line 1792 of yacc.c */ -#line 1358 "glslang.y" +#line 1364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } +#line 5191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 181: -/* Line 1792 of yacc.c */ -#line 1363 "glslang.y" +#line 1369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; } +#line 5201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 182: -/* Line 1792 of yacc.c */ -#line 1367 "glslang.y" +#line 1374 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; } +#line 5211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 183: -/* Line 1792 of yacc.c */ -#line 1372 "glslang.y" +#line 1379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; +#endif } +#line 5223 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 184: -/* Line 1792 of yacc.c */ -#line 1377 "glslang.y" +#line 1386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; +#endif } +#line 5235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 185: -/* Line 1792 of yacc.c */ -#line 1382 "glslang.y" +#line 1393 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; } +#line 5244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 186: -/* Line 1792 of yacc.c */ -#line 1388 "glslang.y" +#line 1397 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } +#line 5254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 187: -/* Line 1792 of yacc.c */ -#line 1394 "glslang.y" +#line 1402 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } +#line 5264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 188: -/* Line 1792 of yacc.c */ -#line 1400 "glslang.y" +#line 1407 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } +#line 5274 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 189: -/* Line 1792 of yacc.c */ -#line 1408 "glslang.y" +#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); -#endif + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } +#line 5285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 190: -/* Line 1792 of yacc.c */ -#line 1416 "glslang.y" +#line 1418 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(4); -#endif + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } +#line 5296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 191: -/* Line 1792 of yacc.c */ -#line 1424 "glslang.y" +#line 1424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } +#line 5307 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 192: -/* Line 1792 of yacc.c */ -#line 1429 "glslang.y" +#line 1430 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); +#ifdef AMD_EXTENSIONS + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); +#endif } +#line 5320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 193: -/* Line 1792 of yacc.c */ -#line 1434 "glslang.y" +#line 1438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); +#ifdef AMD_EXTENSIONS + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); +#endif } +#line 5333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 194: -/* Line 1792 of yacc.c */ -#line 1439 "glslang.y" +#line 1446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); +#ifdef AMD_EXTENSIONS + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); +#endif } +#line 5346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 195: -/* Line 1792 of yacc.c */ -#line 1444 "glslang.y" +#line 1454 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); } +#line 5356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 196: -/* Line 1792 of yacc.c */ -#line 1449 "glslang.y" +#line 1459 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); } +#line 5366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 197: -/* Line 1792 of yacc.c */ -#line 1454 "glslang.y" +#line 1464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); } +#line 5376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 198: -/* Line 1792 of yacc.c */ -#line 1460 "glslang.y" +#line 1469 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } +#line 5386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 199: -/* Line 1792 of yacc.c */ -#line 1466 "glslang.y" +#line 1474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } +#line 5396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 200: -/* Line 1792 of yacc.c */ -#line 1472 "glslang.y" +#line 1479 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } +#line 5406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 201: -/* Line 1792 of yacc.c */ -#line 1478 "glslang.y" +#line 1484 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); } +#line 5417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 202: -/* Line 1792 of yacc.c */ -#line 1484 "glslang.y" +#line 1490 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); } +#line 5428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 203: -/* Line 1792 of yacc.c */ -#line 1490 "glslang.y" +#line 1496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(2); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); } +#line 5439 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 204: -/* Line 1792 of yacc.c */ -#line 1496 "glslang.y" +#line 1502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(3); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); +#endif } +#line 5452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 205: -/* Line 1792 of yacc.c */ -#line 1502 "glslang.y" +#line 1510 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[(1) - (1)].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(4); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); +#endif } +#line 5465 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 206: -/* Line 1792 of yacc.c */ -#line 1508 "glslang.y" +#line 1518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); +#endif } +#line 5478 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 207: -/* Line 1792 of yacc.c */ -#line 1513 "glslang.y" +#line 1526 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } +#line 5489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 208: -/* Line 1792 of yacc.c */ -#line 1518 "glslang.y" +#line 1532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } +#line 5500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 209: -/* Line 1792 of yacc.c */ -#line 1523 "glslang.y" +#line 1538 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } +#line 5511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 210: -/* Line 1792 of yacc.c */ -#line 1528 "glslang.y" +#line 1544 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); } +#line 5522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 211: -/* Line 1792 of yacc.c */ -#line 1533 "glslang.y" +#line 1550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(3); } +#line 5533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 212: -/* Line 1792 of yacc.c */ -#line 1538 "glslang.y" +#line 1556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 2); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(4); } +#line 5544 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 213: -/* Line 1792 of yacc.c */ -#line 1543 "glslang.y" +#line 1562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); +#endif } +#line 5557 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 214: -/* Line 1792 of yacc.c */ -#line 1548 "glslang.y" +#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 4); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); +#endif } +#line 5570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 215: -/* Line 1792 of yacc.c */ -#line 1553 "glslang.y" +#line 1578 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 2); +#ifdef AMD_EXTENSIONS + parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); +#endif } +#line 5583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 216: -/* Line 1792 of yacc.c */ -#line 1558 "glslang.y" +#line 1586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } +#line 5593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 217: -/* Line 1792 of yacc.c */ -#line 1563 "glslang.y" +#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } +#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 218: -/* Line 1792 of yacc.c */ -#line 1568 "glslang.y" +#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } +#line 5613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 219: -/* Line 1792 of yacc.c */ -#line 1574 "glslang.y" +#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } +#line 5623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 220: -/* Line 1792 of yacc.c */ -#line 1580 "glslang.y" +#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); } +#line 5633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 221: -/* Line 1792 of yacc.c */ -#line 1586 "glslang.y" +#line 1611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); } +#line 5643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 222: -/* Line 1792 of yacc.c */ -#line 1592 "glslang.y" +#line 1616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); } +#line 5653 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 223: -/* Line 1792 of yacc.c */ -#line 1598 "glslang.y" +#line 1621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } +#line 5663 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 224: -/* Line 1792 of yacc.c */ -#line 1604 "glslang.y" +#line 1626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); } +#line 5673 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 225: -/* Line 1792 of yacc.c */ -#line 1610 "glslang.y" +#line 1631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); } +#line 5683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 226: -/* Line 1792 of yacc.c */ -#line 1616 "glslang.y" +#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); } +#line 5693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 227: -/* Line 1792 of yacc.c */ -#line 1622 "glslang.y" +#line 1641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } +#line 5703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 228: -/* Line 1792 of yacc.c */ -#line 1628 "glslang.y" +#line 1646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } +#line 5714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 229: -/* Line 1792 of yacc.c */ -#line 1634 "glslang.y" +#line 1652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } +#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 230: -/* Line 1792 of yacc.c */ -#line 1640 "glslang.y" +#line 1658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 231: +#line 1664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 5747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 232: +#line 1670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); + } +#line 5758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 233: +#line 1676 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); + } +#line 5769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 234: +#line 1682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); + } +#line 5780 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 235: +#line 1688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 5791 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 236: +#line 1694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); + } +#line 5802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 237: +#line 1700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); + } +#line 5813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 238: +#line 1706 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); + } +#line 5824 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 239: +#line 1712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 5835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 240: +#line 1718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); #endif } +#line 5848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 231: -/* Line 1792 of yacc.c */ -#line 1648 "glslang.y" + case 241: +#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); #endif } +#line 5861 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 232: -/* Line 1792 of yacc.c */ -#line 1656 "glslang.y" + case 242: +#line 1734 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); #endif } +#line 5874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 233: -/* Line 1792 of yacc.c */ -#line 1664 "glslang.y" + case 243: +#line 1742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); #endif } +#line 5887 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 234: -/* Line 1792 of yacc.c */ -#line 1672 "glslang.y" + case 244: +#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); #endif } +#line 5900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 235: -/* Line 1792 of yacc.c */ -#line 1680 "glslang.y" + case 245: +#line 1758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); #endif } +#line 5913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 236: -/* Line 1792 of yacc.c */ -#line 1688 "glslang.y" + case 246: +#line 1766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); #endif } +#line 5926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 237: -/* Line 1792 of yacc.c */ -#line 1696 "glslang.y" + case 247: +#line 1774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); #endif } +#line 5939 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 238: -/* Line 1792 of yacc.c */ -#line 1704 "glslang.y" + case 248: +#line 1782 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); #endif } +#line 5952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 239: -/* Line 1792 of yacc.c */ -#line 1712 "glslang.y" + case 249: +#line 1790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); #endif } +#line 5965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 240: -/* Line 1792 of yacc.c */ -#line 1720 "glslang.y" + case 250: +#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); #endif } +#line 5978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 241: -/* Line 1792 of yacc.c */ -#line 1728 "glslang.y" + case 251: +#line 1806 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[(1) - (1)].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); #endif } - break; - - case 242: -/* Line 1792 of yacc.c */ -#line 1736 "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 243: -/* Line 1792 of yacc.c */ -#line 1741 "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 244: -/* Line 1792 of yacc.c */ -#line 1746 "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 245: -/* Line 1792 of yacc.c */ -#line 1751 "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 246: -/* Line 1792 of yacc.c */ -#line 1756 "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 247: -/* Line 1792 of yacc.c */ -#line 1761 "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 248: -/* Line 1792 of yacc.c */ -#line 1766 "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 249: -/* Line 1792 of yacc.c */ -#line 1771 "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 250: -/* Line 1792 of yacc.c */ -#line 1776 "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 251: -/* Line 1792 of yacc.c */ -#line 1781 "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); - } +#line 5991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 252: -/* Line 1792 of yacc.c */ -#line 1786 "glslang.y" +#line 1814 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAtomicUint; } +#line 6001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 253: -/* Line 1792 of yacc.c */ -#line 1791 "glslang.y" +#line 1819 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } +#line 6011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 254: -/* Line 1792 of yacc.c */ -#line 1796 "glslang.y" +#line 1824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } +#line 6021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 255: -/* Line 1792 of yacc.c */ -#line 1801 "glslang.y" +#line 1829 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } +#line 6031 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 256: -/* Line 1792 of yacc.c */ -#line 1806 "glslang.y" +#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } +#line 6041 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 257: -/* Line 1792 of yacc.c */ -#line 1811 "glslang.y" +#line 1839 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } +#line 6051 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 258: -/* Line 1792 of yacc.c */ -#line 1816 "glslang.y" +#line 1844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } +#line 6061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 259: -/* Line 1792 of yacc.c */ -#line 1821 "glslang.y" +#line 1849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } +#line 6071 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 260: -/* Line 1792 of yacc.c */ -#line 1826 "glslang.y" +#line 1854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } +#line 6081 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 261: -/* Line 1792 of yacc.c */ -#line 1831 "glslang.y" +#line 1859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } +#line 6091 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 262: -/* Line 1792 of yacc.c */ -#line 1836 "glslang.y" +#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } +#line 6101 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 263: -/* Line 1792 of yacc.c */ -#line 1841 "glslang.y" +#line 1869 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } +#line 6111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 264: -/* Line 1792 of yacc.c */ -#line 1846 "glslang.y" +#line 1874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } +#line 6121 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 265: -/* Line 1792 of yacc.c */ -#line 1851 "glslang.y" +#line 1879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } +#line 6131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 266: -/* Line 1792 of yacc.c */ -#line 1856 "glslang.y" +#line 1884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd1D); } +#line 6141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 267: -/* Line 1792 of yacc.c */ -#line 1861 "glslang.y" +#line 1889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D); } +#line 6151 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 268: -/* Line 1792 of yacc.c */ -#line 1866 "glslang.y" +#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.set(EbtInt, Esd3D); } +#line 6161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 269: -/* Line 1792 of yacc.c */ -#line 1871 "glslang.y" +#line 1899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.set(EbtInt, EsdCube); } +#line 6171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 270: -/* Line 1792 of yacc.c */ -#line 1876 "glslang.y" +#line 1904 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } +#line 6181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 271: -/* Line 1792 of yacc.c */ -#line 1881 "glslang.y" +#line 1909 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } +#line 6191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 272: -/* Line 1792 of yacc.c */ -#line 1886 "glslang.y" +#line 1914 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdRect); + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } +#line 6201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 273: -/* Line 1792 of yacc.c */ -#line 1891 "glslang.y" +#line 1919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdRect); + (yyval.interm.type).sampler.set(EbtUint, Esd1D); } +#line 6211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 274: -/* Line 1792 of yacc.c */ -#line 1896 "glslang.y" +#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, Esd2D); } +#line 6221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 275: -/* Line 1792 of yacc.c */ -#line 1901 "glslang.y" +#line 1929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, Esd3D); } +#line 6231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 276: -/* Line 1792 of yacc.c */ -#line 1906 "glslang.y" +#line 1934 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, EsdCube); } +#line 6241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 277: -/* Line 1792 of yacc.c */ -#line 1911 "glslang.y" +#line 1939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } +#line 6251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 278: -/* Line 1792 of yacc.c */ -#line 1916 "glslang.y" +#line 1944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } +#line 6261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 279: -/* Line 1792 of yacc.c */ -#line 1921 "glslang.y" +#line 1949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } +#line 6271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 280: -/* Line 1792 of yacc.c */ -#line 1926 "glslang.y" +#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } +#line 6281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 281: -/* Line 1792 of yacc.c */ -#line 1931 "glslang.y" +#line 1959 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } +#line 6291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 282: -/* Line 1792 of yacc.c */ -#line 1936 "glslang.y" +#line 1964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtInt, EsdRect); } +#line 6301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 283: -/* Line 1792 of yacc.c */ -#line 1941 "glslang.y" +#line 1969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(false); + (yyval.interm.type).sampler.set(EbtUint, EsdRect); } +#line 6311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 284: -/* Line 1792 of yacc.c */ -#line 1946 "glslang.y" +#line 1974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(true); + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } +#line 6321 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 285: -/* Line 1792 of yacc.c */ -#line 1951 "glslang.y" +#line 1979 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } +#line 6331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 286: -/* Line 1792 of yacc.c */ -#line 1956 "glslang.y" +#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } +#line 6341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 287: -/* Line 1792 of yacc.c */ -#line 1961 "glslang.y" +#line 1989 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } +#line 6351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 288: -/* Line 1792 of yacc.c */ -#line 1966 "glslang.y" +#line 1994 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } +#line 6361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 289: -/* Line 1792 of yacc.c */ -#line 1971 "glslang.y" +#line 1999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } +#line 6371 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 290: -/* Line 1792 of yacc.c */ -#line 1976 "glslang.y" +#line 2004 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } +#line 6381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 291: -/* Line 1792 of yacc.c */ -#line 1981 "glslang.y" +#line 2009 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } +#line 6391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 292: -/* Line 1792 of yacc.c */ -#line 1986 "glslang.y" +#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } +#line 6401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 293: -/* Line 1792 of yacc.c */ -#line 1991 "glslang.y" +#line 2019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); + (yyval.interm.type).sampler.setPureSampler(false); } +#line 6411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 294: -/* Line 1792 of yacc.c */ -#line 1996 "glslang.y" +#line 2024 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); + (yyval.interm.type).sampler.setPureSampler(true); } +#line 6421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 295: -/* Line 1792 of yacc.c */ -#line 2001 "glslang.y" +#line 2029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } +#line 6431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 296: -/* Line 1792 of yacc.c */ -#line 2006 "glslang.y" +#line 2034 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } +#line 6441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 297: -/* Line 1792 of yacc.c */ -#line 2011 "glslang.y" +#line 2039 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } +#line 6451 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 298: -/* Line 1792 of yacc.c */ -#line 2016 "glslang.y" +#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } +#line 6461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 299: -/* Line 1792 of yacc.c */ -#line 2021 "glslang.y" +#line 2049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } +#line 6471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 300: -/* Line 1792 of yacc.c */ -#line 2026 "glslang.y" +#line 2054 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } +#line 6481 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 301: -/* Line 1792 of yacc.c */ -#line 2031 "glslang.y" +#line 2059 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } +#line 6491 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 302: -/* Line 1792 of yacc.c */ -#line 2036 "glslang.y" +#line 2064 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } +#line 6501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 303: -/* Line 1792 of yacc.c */ -#line 2041 "glslang.y" +#line 2069 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } +#line 6511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 304: -/* Line 1792 of yacc.c */ -#line 2046 "glslang.y" +#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } +#line 6521 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 305: -/* Line 1792 of yacc.c */ -#line 2051 "glslang.y" +#line 2079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } +#line 6531 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 306: -/* Line 1792 of yacc.c */ -#line 2056 "glslang.y" +#line 2084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } +#line 6541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 307: -/* Line 1792 of yacc.c */ -#line 2061 "glslang.y" +#line 2089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } +#line 6551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 308: -/* Line 1792 of yacc.c */ -#line 2066 "glslang.y" +#line 2094 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } +#line 6561 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 309: -/* Line 1792 of yacc.c */ -#line 2071 "glslang.y" +#line 2099 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } +#line 6571 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 310: -/* Line 1792 of yacc.c */ -#line 2076 "glslang.y" +#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } +#line 6581 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 311: -/* Line 1792 of yacc.c */ -#line 2081 "glslang.y" +#line 2109 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } +#line 6591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 312: -/* Line 1792 of yacc.c */ -#line 2086 "glslang.y" +#line 2114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } +#line 6601 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 313: -/* Line 1792 of yacc.c */ -#line 2091 "glslang.y" +#line 2119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } +#line 6611 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 314: -/* Line 1792 of yacc.c */ -#line 2096 "glslang.y" +#line 2124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } +#line 6621 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 315: -/* Line 1792 of yacc.c */ -#line 2101 "glslang.y" +#line 2129 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } +#line 6631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 316: -/* Line 1792 of yacc.c */ -#line 2106 "glslang.y" +#line 2134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } +#line 6641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 317: -/* Line 1792 of yacc.c */ -#line 2111 "glslang.y" +#line 2139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } +#line 6651 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 318: -/* Line 1792 of yacc.c */ -#line 2116 "glslang.y" +#line 2144 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } +#line 6661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 319: -/* Line 1792 of yacc.c */ -#line 2121 "glslang.y" +#line 2149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } +#line 6671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 320: -/* Line 1792 of yacc.c */ -#line 2126 "glslang.y" +#line 2154 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } +#line 6681 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 321: -/* Line 1792 of yacc.c */ -#line 2131 "glslang.y" +#line 2159 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } +#line 6691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 322: -/* Line 1792 of yacc.c */ -#line 2136 "glslang.y" +#line 2164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } +#line 6701 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 323: -/* Line 1792 of yacc.c */ -#line 2141 "glslang.y" +#line 2169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } +#line 6711 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 324: -/* Line 1792 of yacc.c */ -#line 2146 "glslang.y" +#line 2174 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } +#line 6721 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 325: -/* Line 1792 of yacc.c */ -#line 2151 "glslang.y" +#line 2179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } +#line 6731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 326: -/* Line 1792 of yacc.c */ -#line 2156 "glslang.y" +#line 2184 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } +#line 6741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 327: -/* Line 1792 of yacc.c */ -#line 2161 "glslang.y" +#line 2189 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } +#line 6751 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 328: -/* Line 1792 of yacc.c */ -#line 2166 "glslang.y" +#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } +#line 6761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 329: -/* Line 1792 of yacc.c */ -#line 2171 "glslang.y" +#line 2199 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } +#line 6771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 330: -/* Line 1792 of yacc.c */ -#line 2176 "glslang.y" +#line 2204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } +#line 6781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 331: -/* Line 1792 of yacc.c */ -#line 2181 "glslang.y" +#line 2209 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } +#line 6791 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 332: -/* Line 1792 of yacc.c */ -#line 2186 "glslang.y" +#line 2214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } +#line 6801 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 333: -/* Line 1792 of yacc.c */ -#line 2191 "glslang.y" +#line 2219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } +#line 6811 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 334: -/* Line 1792 of yacc.c */ -#line 2196 "glslang.y" +#line 2224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } +#line 6821 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 335: -/* Line 1792 of yacc.c */ -#line 2201 "glslang.y" +#line 2229 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } +#line 6831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 336: -/* Line 1792 of yacc.c */ -#line 2206 "glslang.y" +#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } +#line 6841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 337: -/* Line 1792 of yacc.c */ -#line 2211 "glslang.y" +#line 2239 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } +#line 6851 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 338: -/* Line 1792 of yacc.c */ -#line 2216 "glslang.y" +#line 2244 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } +#line 6861 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 339: -/* Line 1792 of yacc.c */ -#line 2221 "glslang.y" +#line 2249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } +#line 6871 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 340: -/* Line 1792 of yacc.c */ -#line 2226 "glslang.y" +#line 2254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } +#line 6881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 341: -/* Line 1792 of yacc.c */ -#line 2231 "glslang.y" +#line 2259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } +#line 6891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 342: -/* Line 1792 of yacc.c */ -#line 2236 "glslang.y" +#line 2264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } +#line 6901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 343: -/* Line 1792 of yacc.c */ -#line 2241 "glslang.y" +#line 2269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } +#line 6911 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 344: -/* Line 1792 of yacc.c */ -#line 2246 "glslang.y" +#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } +#line 6921 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 345: -/* Line 1792 of yacc.c */ -#line 2251 "glslang.y" +#line 2279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } +#line 6931 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 346: -/* Line 1792 of yacc.c */ -#line 2256 "glslang.y" +#line 2284 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } +#line 6941 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 347: -/* Line 1792 of yacc.c */ -#line 2261 "glslang.y" +#line 2289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } +#line 6951 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 348: -/* Line 1792 of yacc.c */ -#line 2266 "glslang.y" +#line 2294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } +#line 6961 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 349: -/* Line 1792 of yacc.c */ -#line 2271 "glslang.y" +#line 2299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } +#line 6971 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 350: -/* Line 1792 of yacc.c */ -#line 2276 "glslang.y" +#line 2304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } +#line 6981 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 351: -/* Line 1792 of yacc.c */ -#line 2281 "glslang.y" +#line 2309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + } +#line 6991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 352: +#line 2314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + } +#line 7001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 353: +#line 2319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + } +#line 7011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 354: +#line 2324 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + } +#line 7021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 355: +#line 2329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + } +#line 7031 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 356: +#line 2334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + } +#line 7041 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 357: +#line 2339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + } +#line 7051 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 358: +#line 2344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + } +#line 7061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 359: +#line 2349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + } +#line 7071 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 360: +#line 2354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + } +#line 7081 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 361: +#line 2359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } +#line 7092 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 352: -/* Line 1792 of yacc.c */ -#line 2287 "glslang.y" + case 362: +#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } +#line 7103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 353: -/* Line 1792 of yacc.c */ -#line 2293 "glslang.y" + case 363: +#line 2371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } +#line 7114 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 354: -/* Line 1792 of yacc.c */ -#line 2299 "glslang.y" + case 364: +#line 2377 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } +#line 7125 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 355: -/* Line 1792 of yacc.c */ -#line 2305 "glslang.y" + case 365: +#line 2383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } +#line 7136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 356: -/* Line 1792 of yacc.c */ -#line 2311 "glslang.y" + case 366: +#line 2389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } +#line 7147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 357: -/* Line 1792 of yacc.c */ -#line 2317 "glslang.y" + case 367: +#line 2395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } +#line 7158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 358: -/* Line 1792 of yacc.c */ -#line 2323 "glslang.y" + case 368: +#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } +#line 7168 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 359: -/* Line 1792 of yacc.c */ -#line 2328 "glslang.y" + case 369: +#line 2406 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the // type. // - if (const TVariable* variable = ((yyvsp[(1) - (1)].lex).symbol)->getAsVariable()) { + if (const TVariable* variable = ((yyvsp[0].lex).symbol)->getAsVariable()) { const TType& structure = variable->getType(); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].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 360: -/* Line 1792 of yacc.c */ -#line 2344 "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()); - parseContext.handlePrecisionQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type).qualifier, EpqHigh); - } - break; - - case 361: -/* Line 1792 of yacc.c */ -#line 2349 "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()); - parseContext.handlePrecisionQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type).qualifier, EpqMedium); - } - break; - - case 362: -/* Line 1792 of yacc.c */ -#line 2354 "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()); - parseContext.handlePrecisionQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type).qualifier, EpqLow); - } - break; - - case 363: -/* Line 1792 of yacc.c */ -#line 2362 "glslang.y" - { parseContext.nestedStructCheck((yyvsp[(1) - (3)].lex).loc); } - break; - - case 364: -/* Line 1792 of yacc.c */ -#line 2362 "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 365: -/* Line 1792 of yacc.c */ -#line 2373 "glslang.y" - { parseContext.nestedStructCheck((yyvsp[(1) - (2)].lex).loc); } - break; - - case 366: -/* Line 1792 of yacc.c */ -#line 2373 "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 367: -/* Line 1792 of yacc.c */ -#line 2383 "glslang.y" - { - (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList); - } - break; - - case 368: -/* Line 1792 of yacc.c */ -#line 2386 "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 369: -/* Line 1792 of yacc.c */ -#line 2399 "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)); - } + parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } +#line 7186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 370: -/* Line 1792 of yacc.c */ -#line 2417 "glslang.y" +#line 2422 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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)); - } + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } +#line 7196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 371: -/* Line 1792 of yacc.c */ -#line 2441 "glslang.y" +#line 2427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.typeList) = new TTypeList; - (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine)); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } +#line 7206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 372: -/* Line 1792 of yacc.c */ -#line 2445 "glslang.y" +#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine)); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } +#line 7216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 373: -/* Line 1792 of yacc.c */ -#line 2451 "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); - } +#line 2440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } +#line 7222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 374: -/* Line 1792 of yacc.c */ -#line 2456 "glslang.y" +#line 2440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); + parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); + TVariable* userTypeDef = new TVariable((yyvsp[-4].lex).string, *structure, true); + if (! parseContext.symbolTable.insert(*userTypeDef)) + parseContext.error((yyvsp[-4].lex).loc, "redefinition", (yyvsp[-4].lex).string->c_str(), "struct"); + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; } +#line 7238 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 375: -/* Line 1792 of yacc.c */ -#line 2467 "glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } +#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } +#line 7244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 376: -/* Line 1792 of yacc.c */ -#line 2470 "glslang.y" +#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); + (yyval.interm.type).init((yyvsp[-4].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; } +#line 7256 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 377: -/* Line 1792 of yacc.c */ -#line 2476 "glslang.y" +#line 2461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } +#line 7264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 378: -/* Line 1792 of yacc.c */ -#line 2485 "glslang.y" +#line 2464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[(1) - (1)].interm.intermTypedNode), (yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc()); + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[0].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[0].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[0].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); + } } +#line 7279 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 379: -/* Line 1792 of yacc.c */ -#line 2488 "glslang.y" +#line 2477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[-2].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + } } +#line 7302 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 380: -/* Line 1792 of yacc.c */ -#line 2494 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalQualifierFixCheck((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[-3].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + } + } +#line 7328 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 381: -/* Line 1792 of yacc.c */ -#line 2498 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeList) = new TTypeList; + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 7337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 382: -/* Line 1792 of yacc.c */ -#line 2499 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 7345 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 383: -/* Line 1792 of yacc.c */ -#line 2505 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); + } +#line 7355 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 384: -/* Line 1792 of yacc.c */ -#line 2506 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes, 0); + + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[-1].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); + (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[0].interm).arraySizes); + } +#line 7368 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 385: -/* Line 1792 of yacc.c */ -#line 2507 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 7376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 386: -/* Line 1792 of yacc.c */ -#line 2508 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + } +#line 7387 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 387: -/* Line 1792 of yacc.c */ -#line 2509 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 7398 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 388: -/* Line 1792 of yacc.c */ -#line 2510 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); + } +#line 7406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 389: -/* Line 1792 of yacc.c */ -#line 2511 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 7414 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 390: -/* Line 1792 of yacc.c */ -#line 2515 "glslang.y" - { (yyval.interm.intermNode) = 0; } +#line 2572 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7420 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 391: -/* Line 1792 of yacc.c */ -#line 2516 "glslang.y" - { - parseContext.symbolTable.push(); - ++parseContext.statementNestingLevel; - } +#line 2576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 392: -/* Line 1792 of yacc.c */ -#line 2520 "glslang.y" +#line 2577 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7432 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 393: +#line 2583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7438 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 394: +#line 2584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 395: +#line 2585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7450 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 396: +#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 397: +#line 2587 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7462 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 398: +#line 2588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 399: +#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 400: +#line 2593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = 0; } +#line 7480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 401: +#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } +#line 7489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 402: +#line 2598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } +#line 7498 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -/* Line 1792 of yacc.c */ -#line 2524 "glslang.y" + case 403: +#line 2602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - 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); + if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } +#line 7508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -/* Line 1792 of yacc.c */ -#line 2532 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + case 404: +#line 2610 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7514 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 395: -/* Line 1792 of yacc.c */ -#line 2533 "glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + case 405: +#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 396: -/* Line 1792 of yacc.c */ -#line 2537 "glslang.y" + case 406: +#line 2615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } +#line 7528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 397: -/* Line 1792 of yacc.c */ -#line 2540 "glslang.y" + case 407: +#line 2618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; - (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 398: -/* Line 1792 of yacc.c */ -#line 2544 "glslang.y" + case 408: +#line 2622 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 399: -/* Line 1792 of yacc.c */ -#line 2549 "glslang.y" + case 409: +#line 2627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; - (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); - } - break; - - case 400: -/* Line 1792 of yacc.c */ -#line 2558 "glslang.y" - { - (yyval.interm.intermNode) = 0; - } - break; - - case 401: -/* Line 1792 of yacc.c */ -#line 2561 "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 402: -/* Line 1792 of yacc.c */ -#line 2569 "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 403: -/* Line 1792 of yacc.c */ -#line 2577 "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 404: -/* Line 1792 of yacc.c */ -#line 2588 "glslang.y" - { (yyval.interm.intermNode) = 0; } - break; - - case 405: -/* Line 1792 of yacc.c */ -#line 2589 "glslang.y" - { (yyval.interm.intermNode) = static_cast((yyvsp[(1) - (2)].interm.intermTypedNode)); } - break; - - case 406: -/* Line 1792 of yacc.c */ -#line 2593 "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 407: -/* Line 1792 of yacc.c */ -#line 2600 "glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode); - } - break; - - case 408: -/* Line 1792 of yacc.c */ -#line 2604 "glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 409: -/* Line 1792 of yacc.c */ -#line 2612 "glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - parseContext.boolCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), (yyvsp[(1) - (1)].interm.intermTypedNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 410: -/* Line 1792 of yacc.c */ -#line 2616 "glslang.y" +#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.boolCheck((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.type)); + (yyval.interm.intermNode) = 0; + } +#line 7566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - 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)); + case 411: +#line 2639 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) + (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); + } +#line 7576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 412: +#line 2647 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence(0, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } + } +#line 7589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 413: +#line 2655 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence((yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0, (yyvsp[0].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].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 7602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 414: +#line 2666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = 0; } +#line 7608 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 415: +#line 2667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } +#line 7614 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 416: +#line 2671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); + (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); + } +#line 7623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 417: +#line 2678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); + } +#line 7632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 418: +#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); + (yyval.interm.nodePair).node2 = 0; + } +#line 7641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 419: +#line 2690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); + } +#line 7650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 420: +#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); + + TType type((yyvsp[-3].interm.type)); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); if (initNode) (yyval.interm.intermTypedNode) = initNode->getAsTyped(); else (yyval.interm.intermTypedNode) = 0; } +#line 7665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 411: -/* Line 1792 of yacc.c */ -#line 2629 "glslang.y" + case 421: +#line 2707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -7778,13 +7674,13 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } +#line 7678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 412: -/* Line 1792 of yacc.c */ -#line 2637 "glslang.y" + case 422: +#line 2715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); parseContext.switchSequenceStack.pop_back(); parseContext.switchLevel.pop_back(); @@ -7792,287 +7688,287 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7692 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 413: -/* Line 1792 of yacc.c */ -#line 2649 "glslang.y" + case 423: +#line 2727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } +#line 7700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 414: -/* Line 1792 of yacc.c */ -#line 2652 "glslang.y" + case 424: +#line 2730 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7708 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 415: -/* Line 1792 of yacc.c */ -#line 2658 "glslang.y" + case 425: +#line 2736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) - parseContext.error((yyvsp[(1) - (3)].lex).loc, "cannot appear outside switch statement", "case", ""); + parseContext.error((yyvsp[-2].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", ""); + parseContext.error((yyvsp[-2].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); + parseContext.constantValueCheck((yyvsp[-1].interm.intermTypedNode), "case"); + parseContext.integerCheck((yyvsp[-1].interm.intermTypedNode), "case"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } +#line 7725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 416: -/* Line 1792 of yacc.c */ -#line 2670 "glslang.y" + case 426: +#line 2748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "cannot appear outside switch statement", "default", ""); + parseContext.error((yyvsp[-1].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", ""); + parseContext.error((yyvsp[-1].lex).loc, "cannot be nested inside control flow", "default", ""); else - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[(1) - (2)].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } +#line 7739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 417: -/* Line 1792 of yacc.c */ -#line 2682 "glslang.y" + case 427: +#line 2760 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "while loops not available", "limitation", ""); + parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 418: -/* Line 1792 of yacc.c */ -#line 2690 "glslang.y" + case 428: +#line 2768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { 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); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 419: -/* Line 1792 of yacc.c */ -#line 2697 "glslang.y" + case 429: +#line 2775 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 420: -/* Line 1792 of yacc.c */ -#line 2702 "glslang.y" + case 430: +#line 2780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) - parseContext.error((yyvsp[(1) - (8)].lex).loc, "do-while loops not available", "limitation", ""); + parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); - parseContext.boolCheck((yyvsp[(8) - (8)].lex).loc, (yyvsp[(6) - (8)].interm.intermTypedNode)); + parseContext.boolCheck((yyvsp[0].lex).loc, (yyvsp[-2].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); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, false, (yyvsp[-4].lex).loc); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7790 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 421: -/* Line 1792 of yacc.c */ -#line 2713 "glslang.y" + case 431: +#line 2791 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7801 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 422: -/* Line 1792 of yacc.c */ -#line 2719 "glslang.y" + case 432: +#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { 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); + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); + TIntermLoop* forLoop = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), reinterpret_cast((yyvsp[-2].interm.nodePair).node1), reinterpret_cast((yyvsp[-2].interm.nodePair).node2), true, (yyvsp[-6].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); + parseContext.inductiveLoopCheck((yyvsp[-6].lex).loc, (yyvsp[-3].interm.intermNode), forLoop); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[-6].lex).loc); (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } - break; - - case 423: -/* Line 1792 of yacc.c */ -#line 2734 "glslang.y" - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 424: -/* Line 1792 of yacc.c */ -#line 2737 "glslang.y" - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 425: -/* Line 1792 of yacc.c */ -#line 2743 "glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 426: -/* Line 1792 of yacc.c */ -#line 2746 "glslang.y" - { - (yyval.interm.intermTypedNode) = 0; - } - break; - - case 427: -/* Line 1792 of yacc.c */ -#line 2752 "glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 428: -/* Line 1792 of yacc.c */ -#line 2756 "glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode); - } - break; - - case 429: -/* Line 1792 of yacc.c */ -#line 2763 "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 430: -/* Line 1792 of yacc.c */ -#line 2768 "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 431: -/* Line 1792 of yacc.c */ -#line 2773 "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 432: -/* Line 1792 of yacc.c */ -#line 2780 "glslang.y" - { - (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[(1) - (3)].lex).loc, (yyvsp[(2) - (3)].interm.intermTypedNode)); - } +#line 7818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 433: -/* Line 1792 of yacc.c */ -#line 2783 "glslang.y" +#line 2812 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (2)].lex).loc, EShLangFragment, "discard"); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).loc); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 434: -/* Line 1792 of yacc.c */ -#line 2792 "glslang.y" +#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7834 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 435: -/* Line 1792 of yacc.c */ -#line 2796 "glslang.y" +#line 2821 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode)); - parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 7842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 436: -/* Line 1792 of yacc.c */ -#line 2803 "glslang.y" +#line 2824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.intermTypedNode) = 0; } +#line 7850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 437: -/* Line 1792 of yacc.c */ -#line 2806 "glslang.y" +#line 2830 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = 0; } +#line 7859 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 438: -/* Line 1792 of yacc.c */ -#line 2812 "glslang.y" +#line 2834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (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); + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } +#line 7868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 439: -/* Line 1792 of yacc.c */ -#line 2816 "glslang.y" +#line 2841 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if (parseContext.loopNestingLevel <= 0) + parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); + } +#line 7878 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 440: +#line 2846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) + parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); + } +#line 7888 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 441: +#line 2851 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); + if (parseContext.currentFunctionType->getBasicType() != EbtVoid) + parseContext.error((yyvsp[-1].lex).loc, "non-void function must return a value", "return", ""); + if (parseContext.inMain) + parseContext.postEntryPointReturn = true; + } +#line 7900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 442: +#line 2858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); + } +#line 7908 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 443: +#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); + } +#line 7917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 444: +#line 2870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } +#line 7926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 445: +#line 2874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } +#line 7935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 446: +#line 2881 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 7943 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 447: +#line 2884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 7951 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 448: +#line 2890 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); + (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); + } +#line 7960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 449: +#line 2894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // 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.error((yyvsp[-2].interm).loc, "function does not return a value:", "", (yyvsp[-2].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()); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermNode)); + parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[-2].interm).function->getType(), (yyvsp[-2].interm).loc); + (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].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 @@ -8080,11 +7976,11 @@ yyreduce: (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); } +#line 7980 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 8088 "glslang_tab.cpp" +#line 7984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -8106,7 +8002,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* 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. */ @@ -8121,9 +8017,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -8174,20 +8070,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, pParseContext); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, pParseContext); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -8206,7 +8102,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -8219,29 +8115,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + 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; - } - } + { + 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; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp, pParseContext); + yystos[yystate], yyvsp, pParseContext); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -8292,14 +8188,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, pParseContext); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, pParseContext); + yystos[*yyssp], yyvsp, pParseContext); YYPOPSTACK (1); } #ifndef yyoverflow @@ -8310,11 +8206,7 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2055 of yacc.c */ -#line 2833 "glslang.y" +#line 2911 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff --git a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index b6d27993c..b8e78d6c9 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 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 . */ @@ -26,13 +26,13 @@ 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_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED -/* Enabling traces. */ +#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -40,306 +40,315 @@ extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #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, - INT64_T = 266, - UINT64_T = 267, - FLOAT16_T = 268, - BREAK = 269, - CONTINUE = 270, - DO = 271, - ELSE = 272, - FOR = 273, - IF = 274, - DISCARD = 275, - RETURN = 276, - SWITCH = 277, - CASE = 278, - DEFAULT = 279, - SUBROUTINE = 280, - BVEC2 = 281, - BVEC3 = 282, - BVEC4 = 283, - IVEC2 = 284, - IVEC3 = 285, - IVEC4 = 286, - I64VEC2 = 287, - I64VEC3 = 288, - I64VEC4 = 289, - UVEC2 = 290, - UVEC3 = 291, - UVEC4 = 292, - U64VEC2 = 293, - U64VEC3 = 294, - U64VEC4 = 295, - VEC2 = 296, - VEC3 = 297, - VEC4 = 298, - MAT2 = 299, - MAT3 = 300, - MAT4 = 301, - CENTROID = 302, - IN = 303, - OUT = 304, - INOUT = 305, - UNIFORM = 306, - PATCH = 307, - SAMPLE = 308, - BUFFER = 309, - SHARED = 310, - COHERENT = 311, - VOLATILE = 312, - RESTRICT = 313, - READONLY = 314, - WRITEONLY = 315, - DVEC2 = 316, - DVEC3 = 317, - DVEC4 = 318, - DMAT2 = 319, - DMAT3 = 320, - DMAT4 = 321, - F16VEC2 = 322, - F16VEC3 = 323, - F16VEC4 = 324, - F16MAT2 = 325, - F16MAT3 = 326, - F16MAT4 = 327, - NOPERSPECTIVE = 328, - FLAT = 329, - SMOOTH = 330, - LAYOUT = 331, - __EXPLICITINTERPAMD = 332, - MAT2X2 = 333, - MAT2X3 = 334, - MAT2X4 = 335, - MAT3X2 = 336, - MAT3X3 = 337, - MAT3X4 = 338, - MAT4X2 = 339, - MAT4X3 = 340, - MAT4X4 = 341, - DMAT2X2 = 342, - DMAT2X3 = 343, - DMAT2X4 = 344, - DMAT3X2 = 345, - DMAT3X3 = 346, - DMAT3X4 = 347, - DMAT4X2 = 348, - DMAT4X3 = 349, - DMAT4X4 = 350, - F16MAT2X2 = 351, - F16MAT2X3 = 352, - F16MAT2X4 = 353, - F16MAT3X2 = 354, - F16MAT3X3 = 355, - F16MAT3X4 = 356, - F16MAT4X2 = 357, - F16MAT4X3 = 358, - F16MAT4X4 = 359, - ATOMIC_UINT = 360, - SAMPLER1D = 361, - SAMPLER2D = 362, - SAMPLER3D = 363, - SAMPLERCUBE = 364, - SAMPLER1DSHADOW = 365, - SAMPLER2DSHADOW = 366, - SAMPLERCUBESHADOW = 367, - SAMPLER1DARRAY = 368, - SAMPLER2DARRAY = 369, - SAMPLER1DARRAYSHADOW = 370, - SAMPLER2DARRAYSHADOW = 371, - ISAMPLER1D = 372, - ISAMPLER2D = 373, - ISAMPLER3D = 374, - ISAMPLERCUBE = 375, - ISAMPLER1DARRAY = 376, - ISAMPLER2DARRAY = 377, - USAMPLER1D = 378, - USAMPLER2D = 379, - USAMPLER3D = 380, - USAMPLERCUBE = 381, - USAMPLER1DARRAY = 382, - USAMPLER2DARRAY = 383, - SAMPLER2DRECT = 384, - SAMPLER2DRECTSHADOW = 385, - ISAMPLER2DRECT = 386, - USAMPLER2DRECT = 387, - SAMPLERBUFFER = 388, - ISAMPLERBUFFER = 389, - USAMPLERBUFFER = 390, - SAMPLERCUBEARRAY = 391, - SAMPLERCUBEARRAYSHADOW = 392, - ISAMPLERCUBEARRAY = 393, - USAMPLERCUBEARRAY = 394, - SAMPLER2DMS = 395, - ISAMPLER2DMS = 396, - USAMPLER2DMS = 397, - SAMPLER2DMSARRAY = 398, - ISAMPLER2DMSARRAY = 399, - USAMPLER2DMSARRAY = 400, - SAMPLEREXTERNALOES = 401, - SAMPLER = 402, - SAMPLERSHADOW = 403, - TEXTURE1D = 404, - TEXTURE2D = 405, - TEXTURE3D = 406, - TEXTURECUBE = 407, - TEXTURE1DARRAY = 408, - TEXTURE2DARRAY = 409, - ITEXTURE1D = 410, - ITEXTURE2D = 411, - ITEXTURE3D = 412, - ITEXTURECUBE = 413, - ITEXTURE1DARRAY = 414, - ITEXTURE2DARRAY = 415, - UTEXTURE1D = 416, - UTEXTURE2D = 417, - UTEXTURE3D = 418, - UTEXTURECUBE = 419, - UTEXTURE1DARRAY = 420, - UTEXTURE2DARRAY = 421, - TEXTURE2DRECT = 422, - ITEXTURE2DRECT = 423, - UTEXTURE2DRECT = 424, - TEXTUREBUFFER = 425, - ITEXTUREBUFFER = 426, - UTEXTUREBUFFER = 427, - TEXTURECUBEARRAY = 428, - ITEXTURECUBEARRAY = 429, - UTEXTURECUBEARRAY = 430, - TEXTURE2DMS = 431, - ITEXTURE2DMS = 432, - UTEXTURE2DMS = 433, - TEXTURE2DMSARRAY = 434, - ITEXTURE2DMSARRAY = 435, - UTEXTURE2DMSARRAY = 436, - SUBPASSINPUT = 437, - SUBPASSINPUTMS = 438, - ISUBPASSINPUT = 439, - ISUBPASSINPUTMS = 440, - USUBPASSINPUT = 441, - USUBPASSINPUTMS = 442, - IMAGE1D = 443, - IIMAGE1D = 444, - UIMAGE1D = 445, - IMAGE2D = 446, - IIMAGE2D = 447, - UIMAGE2D = 448, - IMAGE3D = 449, - IIMAGE3D = 450, - UIMAGE3D = 451, - IMAGE2DRECT = 452, - IIMAGE2DRECT = 453, - UIMAGE2DRECT = 454, - IMAGECUBE = 455, - IIMAGECUBE = 456, - UIMAGECUBE = 457, - IMAGEBUFFER = 458, - IIMAGEBUFFER = 459, - UIMAGEBUFFER = 460, - IMAGE1DARRAY = 461, - IIMAGE1DARRAY = 462, - UIMAGE1DARRAY = 463, - IMAGE2DARRAY = 464, - IIMAGE2DARRAY = 465, - UIMAGE2DARRAY = 466, - IMAGECUBEARRAY = 467, - IIMAGECUBEARRAY = 468, - UIMAGECUBEARRAY = 469, - IMAGE2DMS = 470, - IIMAGE2DMS = 471, - UIMAGE2DMS = 472, - IMAGE2DMSARRAY = 473, - IIMAGE2DMSARRAY = 474, - UIMAGE2DMSARRAY = 475, - STRUCT = 476, - VOID = 477, - WHILE = 478, - IDENTIFIER = 479, - TYPE_NAME = 480, - FLOATCONSTANT = 481, - DOUBLECONSTANT = 482, - INTCONSTANT = 483, - UINTCONSTANT = 484, - INT64CONSTANT = 485, - UINT64CONSTANT = 486, - BOOLCONSTANT = 487, - FLOAT16CONSTANT = 488, - LEFT_OP = 489, - RIGHT_OP = 490, - INC_OP = 491, - DEC_OP = 492, - LE_OP = 493, - GE_OP = 494, - EQ_OP = 495, - NE_OP = 496, - AND_OP = 497, - OR_OP = 498, - XOR_OP = 499, - MUL_ASSIGN = 500, - DIV_ASSIGN = 501, - ADD_ASSIGN = 502, - MOD_ASSIGN = 503, - LEFT_ASSIGN = 504, - RIGHT_ASSIGN = 505, - AND_ASSIGN = 506, - XOR_ASSIGN = 507, - OR_ASSIGN = 508, - SUB_ASSIGN = 509, - LEFT_PAREN = 510, - RIGHT_PAREN = 511, - LEFT_BRACKET = 512, - RIGHT_BRACKET = 513, - LEFT_BRACE = 514, - RIGHT_BRACE = 515, - DOT = 516, - COMMA = 517, - COLON = 518, - EQUAL = 519, - SEMICOLON = 520, - BANG = 521, - DASH = 522, - TILDE = 523, - PLUS = 524, - STAR = 525, - SLASH = 526, - PERCENT = 527, - LEFT_ANGLE = 528, - RIGHT_ANGLE = 529, - VERTICAL_BAR = 530, - CARET = 531, - AMPERSAND = 532, - QUESTION = 533, - INVARIANT = 534, - PRECISE = 535, - HIGH_PRECISION = 536, - MEDIUM_PRECISION = 537, - LOW_PRECISION = 538, - PRECISION = 539, - PACKED = 540, - RESOURCE = 541, - SUPERP = 542 - }; + enum yytokentype + { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + INT64_T = 266, + UINT64_T = 267, + INT16_T = 268, + UINT16_T = 269, + FLOAT16_T = 270, + BREAK = 271, + CONTINUE = 272, + DO = 273, + ELSE = 274, + FOR = 275, + IF = 276, + DISCARD = 277, + RETURN = 278, + SWITCH = 279, + CASE = 280, + DEFAULT = 281, + SUBROUTINE = 282, + BVEC2 = 283, + BVEC3 = 284, + BVEC4 = 285, + IVEC2 = 286, + IVEC3 = 287, + IVEC4 = 288, + I64VEC2 = 289, + I64VEC3 = 290, + I64VEC4 = 291, + UVEC2 = 292, + UVEC3 = 293, + UVEC4 = 294, + U64VEC2 = 295, + U64VEC3 = 296, + U64VEC4 = 297, + VEC2 = 298, + VEC3 = 299, + VEC4 = 300, + MAT2 = 301, + MAT3 = 302, + MAT4 = 303, + CENTROID = 304, + IN = 305, + OUT = 306, + INOUT = 307, + UNIFORM = 308, + PATCH = 309, + SAMPLE = 310, + BUFFER = 311, + SHARED = 312, + COHERENT = 313, + VOLATILE = 314, + RESTRICT = 315, + READONLY = 316, + WRITEONLY = 317, + DVEC2 = 318, + DVEC3 = 319, + DVEC4 = 320, + DMAT2 = 321, + DMAT3 = 322, + DMAT4 = 323, + F16VEC2 = 324, + F16VEC3 = 325, + F16VEC4 = 326, + F16MAT2 = 327, + F16MAT3 = 328, + F16MAT4 = 329, + I16VEC2 = 330, + I16VEC3 = 331, + I16VEC4 = 332, + U16VEC2 = 333, + U16VEC3 = 334, + U16VEC4 = 335, + NOPERSPECTIVE = 336, + FLAT = 337, + SMOOTH = 338, + LAYOUT = 339, + __EXPLICITINTERPAMD = 340, + MAT2X2 = 341, + MAT2X3 = 342, + MAT2X4 = 343, + MAT3X2 = 344, + MAT3X3 = 345, + MAT3X4 = 346, + MAT4X2 = 347, + MAT4X3 = 348, + MAT4X4 = 349, + DMAT2X2 = 350, + DMAT2X3 = 351, + DMAT2X4 = 352, + DMAT3X2 = 353, + DMAT3X3 = 354, + DMAT3X4 = 355, + DMAT4X2 = 356, + DMAT4X3 = 357, + DMAT4X4 = 358, + F16MAT2X2 = 359, + F16MAT2X3 = 360, + F16MAT2X4 = 361, + F16MAT3X2 = 362, + F16MAT3X3 = 363, + F16MAT3X4 = 364, + F16MAT4X2 = 365, + F16MAT4X3 = 366, + F16MAT4X4 = 367, + ATOMIC_UINT = 368, + SAMPLER1D = 369, + SAMPLER2D = 370, + SAMPLER3D = 371, + SAMPLERCUBE = 372, + SAMPLER1DSHADOW = 373, + SAMPLER2DSHADOW = 374, + SAMPLERCUBESHADOW = 375, + SAMPLER1DARRAY = 376, + SAMPLER2DARRAY = 377, + SAMPLER1DARRAYSHADOW = 378, + SAMPLER2DARRAYSHADOW = 379, + ISAMPLER1D = 380, + ISAMPLER2D = 381, + ISAMPLER3D = 382, + ISAMPLERCUBE = 383, + ISAMPLER1DARRAY = 384, + ISAMPLER2DARRAY = 385, + USAMPLER1D = 386, + USAMPLER2D = 387, + USAMPLER3D = 388, + USAMPLERCUBE = 389, + USAMPLER1DARRAY = 390, + USAMPLER2DARRAY = 391, + SAMPLER2DRECT = 392, + SAMPLER2DRECTSHADOW = 393, + ISAMPLER2DRECT = 394, + USAMPLER2DRECT = 395, + SAMPLERBUFFER = 396, + ISAMPLERBUFFER = 397, + USAMPLERBUFFER = 398, + SAMPLERCUBEARRAY = 399, + SAMPLERCUBEARRAYSHADOW = 400, + ISAMPLERCUBEARRAY = 401, + USAMPLERCUBEARRAY = 402, + SAMPLER2DMS = 403, + ISAMPLER2DMS = 404, + USAMPLER2DMS = 405, + SAMPLER2DMSARRAY = 406, + ISAMPLER2DMSARRAY = 407, + USAMPLER2DMSARRAY = 408, + SAMPLEREXTERNALOES = 409, + SAMPLER = 410, + SAMPLERSHADOW = 411, + TEXTURE1D = 412, + TEXTURE2D = 413, + TEXTURE3D = 414, + TEXTURECUBE = 415, + TEXTURE1DARRAY = 416, + TEXTURE2DARRAY = 417, + ITEXTURE1D = 418, + ITEXTURE2D = 419, + ITEXTURE3D = 420, + ITEXTURECUBE = 421, + ITEXTURE1DARRAY = 422, + ITEXTURE2DARRAY = 423, + UTEXTURE1D = 424, + UTEXTURE2D = 425, + UTEXTURE3D = 426, + UTEXTURECUBE = 427, + UTEXTURE1DARRAY = 428, + UTEXTURE2DARRAY = 429, + TEXTURE2DRECT = 430, + ITEXTURE2DRECT = 431, + UTEXTURE2DRECT = 432, + TEXTUREBUFFER = 433, + ITEXTUREBUFFER = 434, + UTEXTUREBUFFER = 435, + TEXTURECUBEARRAY = 436, + ITEXTURECUBEARRAY = 437, + UTEXTURECUBEARRAY = 438, + TEXTURE2DMS = 439, + ITEXTURE2DMS = 440, + UTEXTURE2DMS = 441, + TEXTURE2DMSARRAY = 442, + ITEXTURE2DMSARRAY = 443, + UTEXTURE2DMSARRAY = 444, + SUBPASSINPUT = 445, + SUBPASSINPUTMS = 446, + ISUBPASSINPUT = 447, + ISUBPASSINPUTMS = 448, + USUBPASSINPUT = 449, + USUBPASSINPUTMS = 450, + IMAGE1D = 451, + IIMAGE1D = 452, + UIMAGE1D = 453, + IMAGE2D = 454, + IIMAGE2D = 455, + UIMAGE2D = 456, + IMAGE3D = 457, + IIMAGE3D = 458, + UIMAGE3D = 459, + IMAGE2DRECT = 460, + IIMAGE2DRECT = 461, + UIMAGE2DRECT = 462, + IMAGECUBE = 463, + IIMAGECUBE = 464, + UIMAGECUBE = 465, + IMAGEBUFFER = 466, + IIMAGEBUFFER = 467, + UIMAGEBUFFER = 468, + IMAGE1DARRAY = 469, + IIMAGE1DARRAY = 470, + UIMAGE1DARRAY = 471, + IMAGE2DARRAY = 472, + IIMAGE2DARRAY = 473, + UIMAGE2DARRAY = 474, + IMAGECUBEARRAY = 475, + IIMAGECUBEARRAY = 476, + UIMAGECUBEARRAY = 477, + IMAGE2DMS = 478, + IIMAGE2DMS = 479, + UIMAGE2DMS = 480, + IMAGE2DMSARRAY = 481, + IIMAGE2DMSARRAY = 482, + UIMAGE2DMSARRAY = 483, + STRUCT = 484, + VOID = 485, + WHILE = 486, + IDENTIFIER = 487, + TYPE_NAME = 488, + FLOATCONSTANT = 489, + DOUBLECONSTANT = 490, + INTCONSTANT = 491, + UINTCONSTANT = 492, + INT64CONSTANT = 493, + UINT64CONSTANT = 494, + INT16CONSTANT = 495, + UINT16CONSTANT = 496, + BOOLCONSTANT = 497, + FLOAT16CONSTANT = 498, + LEFT_OP = 499, + RIGHT_OP = 500, + INC_OP = 501, + DEC_OP = 502, + LE_OP = 503, + GE_OP = 504, + EQ_OP = 505, + NE_OP = 506, + AND_OP = 507, + OR_OP = 508, + XOR_OP = 509, + MUL_ASSIGN = 510, + DIV_ASSIGN = 511, + ADD_ASSIGN = 512, + MOD_ASSIGN = 513, + LEFT_ASSIGN = 514, + RIGHT_ASSIGN = 515, + AND_ASSIGN = 516, + XOR_ASSIGN = 517, + OR_ASSIGN = 518, + SUB_ASSIGN = 519, + LEFT_PAREN = 520, + RIGHT_PAREN = 521, + LEFT_BRACKET = 522, + RIGHT_BRACKET = 523, + LEFT_BRACE = 524, + RIGHT_BRACE = 525, + DOT = 526, + COMMA = 527, + COLON = 528, + EQUAL = 529, + SEMICOLON = 530, + BANG = 531, + DASH = 532, + TILDE = 533, + PLUS = 534, + STAR = 535, + SLASH = 536, + PERCENT = 537, + LEFT_ANGLE = 538, + RIGHT_ANGLE = 539, + VERTICAL_BAR = 540, + CARET = 541, + AMPERSAND = 542, + QUESTION = 543, + INVARIANT = 544, + PRECISE = 545, + HIGH_PRECISION = 546, + MEDIUM_PRECISION = 547, + LOW_PRECISION = 548, + PRECISION = 549, + PACKED = 550, + RESOURCE = 551, + SUPERP = 552 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 66 "glslang.y" +#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -373,28 +382,16 @@ typedef union YYSTYPE }; } interm; +#line 386 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 379 "glslang_tab.cpp.h" -} YYSTYPE; +typedef union YYSTYPE 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_GLSLANG_TAB_CPP_H_INCLUDED */ +int yyparse (glslang::TParseContext* pParseContext); + +#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ diff --git a/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp b/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp index b8a6969d1..7d0f1554a 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp @@ -45,11 +45,31 @@ namespace { -bool is_positive_infinity(double x) { +bool IsInfinity(double x) { #ifdef _MSC_VER - return _fpclass(x) == _FPCLASS_PINF; + switch (_fpclass(x)) { + case _FPCLASS_NINF: + case _FPCLASS_PINF: + return true; + default: + return false; + } #else - return std::isinf(x) && (x >= 0); + return std::isinf(x); +#endif +} + +bool IsNan(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_SNAN: + case _FPCLASS_QNAN: + return true; + default: + return false; + } +#else + return std::isnan(x); #endif } @@ -288,6 +308,13 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break; case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break; case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break; +#ifdef AMD_EXTENSIONS + case EOpFloat16BitsToInt16: out.debug << "float16BitsToInt16"; break; + case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break; + case EOpInt16BitsToFloat16: out.debug << "int16BitsToFloat16"; break; + case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break; +#endif + case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break; case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break; case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break; @@ -308,6 +335,16 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break; #ifdef AMD_EXTENSIONS + case EOpPackInt2x16: out.debug << "packInt2x16"; break; + case EOpUnpackInt2x16: out.debug << "unpackInt2x16"; break; + case EOpPackUint2x16: out.debug << "packUint2x16"; break; + case EOpUnpackUint2x16: out.debug << "unpackUint2x16"; break; + + case EOpPackInt4x16: out.debug << "packInt4x16"; break; + case EOpUnpackInt4x16: out.debug << "unpackInt4x16"; break; + case EOpPackUint4x16: out.debug << "packUint4x16"; break; + case EOpUnpackUint4x16: out.debug << "unpackUint4x16"; break; + case EOpPackFloat2x16: out.debug << "packFloat2x16"; break; case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break; #endif @@ -370,6 +407,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpRcp: out.debug << "rcp"; break; case EOpSaturate: out.debug << "saturate"; break; + case EOpSparseTexelsResident: out.debug << "sparseTexelsResident"; break; + #ifdef AMD_EXTENSIONS case EOpMinInvocations: out.debug << "minInvocations"; break; case EOpMaxInvocations: out.debug << "maxInvocations"; break; @@ -411,6 +450,42 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpConvFloat16ToDouble: out.debug << "Convert float16 to double"; break; case EOpConvFloat16ToInt64: out.debug << "Convert float16 to int64"; break; case EOpConvFloat16ToUint64: out.debug << "Convert float16 to uint64"; break; + + case EOpConvBoolToInt16: out.debug << "Convert bool to int16"; break; + case EOpConvIntToInt16: out.debug << "Convert int to int16"; break; + case EOpConvUintToInt16: out.debug << "Convert uint to int16"; break; + case EOpConvFloatToInt16: out.debug << "Convert float to int16"; break; + case EOpConvDoubleToInt16: out.debug << "Convert double to int16"; break; + case EOpConvFloat16ToInt16: out.debug << "Convert float16 to int16"; break; + case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16"; break; + case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16"; break; + case EOpConvUint16ToInt16: out.debug << "Convert uint16 to int16"; break; + case EOpConvInt16ToBool: out.debug << "Convert int16 to bool"; break; + case EOpConvInt16ToInt: out.debug << "Convert int16 to int"; break; + case EOpConvInt16ToUint: out.debug << "Convert int16 to uint"; break; + case EOpConvInt16ToFloat: out.debug << "Convert int16 to float"; break; + case EOpConvInt16ToDouble: out.debug << "Convert int16 to double"; break; + case EOpConvInt16ToFloat16: out.debug << "Convert int16 to float16"; break; + case EOpConvInt16ToInt64: out.debug << "Convert int16 to int64"; break; + case EOpConvInt16ToUint64: out.debug << "Convert int16 to uint64"; break; + + case EOpConvBoolToUint16: out.debug << "Convert bool to uint16"; break; + case EOpConvIntToUint16: out.debug << "Convert int to uint16"; break; + case EOpConvUintToUint16: out.debug << "Convert uint to uint16"; break; + case EOpConvFloatToUint16: out.debug << "Convert float to uint16"; break; + case EOpConvDoubleToUint16: out.debug << "Convert double to uint16"; break; + case EOpConvFloat16ToUint16: out.debug << "Convert float16 to uint16"; break; + case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16"; break; + case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break; + case EOpConvInt16ToUint16: out.debug << "Convert int16 to uint16"; break; + case EOpConvUint16ToBool: out.debug << "Convert uint16 to bool"; break; + case EOpConvUint16ToInt: out.debug << "Convert uint16 to int"; break; + case EOpConvUint16ToUint: out.debug << "Convert uint16 to uint"; break; + case EOpConvUint16ToFloat: out.debug << "Convert uint16 to float"; break; + case EOpConvUint16ToDouble: out.debug << "Convert uint16 to double"; break; + case EOpConvUint16ToFloat16: out.debug << "Convert uint16 to float16"; break; + case EOpConvUint16ToInt64: out.debug << "Convert uint16 to int64"; break; + case EOpConvUint16ToUint64: out.debug << "Convert uint16 to uint64"; break; #endif default: out.debug.message(EPrefixError, "Bad unary op"); @@ -444,9 +519,13 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructFloat: out.debug << "Construct float"; break; case EOpConstructDouble:out.debug << "Construct double"; break; + case EOpConstructVec2: out.debug << "Construct vec2"; break; case EOpConstructVec3: out.debug << "Construct vec3"; break; case EOpConstructVec4: out.debug << "Construct vec4"; break; + case EOpConstructDVec2: out.debug << "Construct dvec2"; break; + case EOpConstructDVec3: out.debug << "Construct dvec3"; break; + case EOpConstructDVec4: out.debug << "Construct dvec4"; break; case EOpConstructBool: out.debug << "Construct bool"; break; case EOpConstructBVec2: out.debug << "Construct bvec2"; break; case EOpConstructBVec3: out.debug << "Construct bvec3"; break; @@ -467,6 +546,16 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break; case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break; case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break; +#ifdef AMD_EXTENSIONS + case EOpConstructInt16: out.debug << "Construct int16_t"; break; + case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break; + case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break; + case EOpConstructI16Vec4: out.debug << "Construct i16vec4"; break; + case EOpConstructUint16: out.debug << "Construct uint16_t"; break; + case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break; + case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break; + case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break; +#endif case EOpConstructMat2x2: out.debug << "Construct mat2"; break; case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break; case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break; @@ -485,6 +574,33 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructDMat4x2: out.debug << "Construct dmat4x2"; break; case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break; case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; + case EOpConstructIMat2x2: out.debug << "Construct imat2"; break; + case EOpConstructIMat2x3: out.debug << "Construct imat2x3"; break; + case EOpConstructIMat2x4: out.debug << "Construct imat2x4"; break; + case EOpConstructIMat3x2: out.debug << "Construct imat3x2"; break; + case EOpConstructIMat3x3: out.debug << "Construct imat3"; break; + case EOpConstructIMat3x4: out.debug << "Construct imat3x4"; break; + case EOpConstructIMat4x2: out.debug << "Construct imat4x2"; break; + case EOpConstructIMat4x3: out.debug << "Construct imat4x3"; break; + case EOpConstructIMat4x4: out.debug << "Construct imat4"; break; + case EOpConstructUMat2x2: out.debug << "Construct umat2"; break; + case EOpConstructUMat2x3: out.debug << "Construct umat2x3"; break; + case EOpConstructUMat2x4: out.debug << "Construct umat2x4"; break; + case EOpConstructUMat3x2: out.debug << "Construct umat3x2"; break; + case EOpConstructUMat3x3: out.debug << "Construct umat3"; break; + case EOpConstructUMat3x4: out.debug << "Construct umat3x4"; break; + case EOpConstructUMat4x2: out.debug << "Construct umat4x2"; break; + case EOpConstructUMat4x3: out.debug << "Construct umat4x3"; break; + case EOpConstructUMat4x4: out.debug << "Construct umat4"; break; + case EOpConstructBMat2x2: out.debug << "Construct bmat2"; break; + case EOpConstructBMat2x3: out.debug << "Construct bmat2x3"; break; + case EOpConstructBMat2x4: out.debug << "Construct bmat2x4"; break; + case EOpConstructBMat3x2: out.debug << "Construct bmat3x2"; break; + case EOpConstructBMat3x3: out.debug << "Construct bmat3"; break; + case EOpConstructBMat3x4: out.debug << "Construct bmat3x4"; break; + case EOpConstructBMat4x2: out.debug << "Construct bmat4x2"; break; + case EOpConstructBMat4x3: out.debug << "Construct bmat4x3"; break; + case EOpConstructBMat4x4: out.debug << "Construct bmat4"; break; #ifdef AMD_EXTENSIONS case EOpConstructFloat16: out.debug << "Construct float16_t"; break; case EOpConstructF16Vec2: out.debug << "Construct f16vec2"; break; @@ -600,6 +716,37 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpTextureGather: out.debug << "textureGather"; break; case EOpTextureGatherOffset: out.debug << "textureGatherOffset"; break; case EOpTextureGatherOffsets: out.debug << "textureGatherOffsets"; break; + case EOpTextureClamp: out.debug << "textureClamp"; break; + case EOpTextureOffsetClamp: out.debug << "textureOffsetClamp"; break; + case EOpTextureGradClamp: out.debug << "textureGradClamp"; break; + case EOpTextureGradOffsetClamp: out.debug << "textureGradOffsetClamp"; break; +#ifdef AMD_EXTENSIONS + case EOpTextureGatherLod: out.debug << "textureGatherLod"; break; + case EOpTextureGatherLodOffset: out.debug << "textureGatherLodOffset"; break; + case EOpTextureGatherLodOffsets: out.debug << "textureGatherLodOffsets"; break; +#endif + + case EOpSparseTexture: out.debug << "sparseTexture"; break; + case EOpSparseTextureOffset: out.debug << "sparseTextureOffset"; break; + case EOpSparseTextureLod: out.debug << "sparseTextureLod"; break; + case EOpSparseTextureLodOffset: out.debug << "sparseTextureLodOffset"; break; + case EOpSparseTextureFetch: out.debug << "sparseTexelFetch"; break; + case EOpSparseTextureFetchOffset: out.debug << "sparseTexelFetchOffset"; break; + case EOpSparseTextureGrad: out.debug << "sparseTextureGrad"; break; + case EOpSparseTextureGradOffset: out.debug << "sparseTextureGradOffset"; break; + case EOpSparseTextureGather: out.debug << "sparseTextureGather"; break; + case EOpSparseTextureGatherOffset: out.debug << "sparseTextureGatherOffset"; break; + case EOpSparseTextureGatherOffsets: out.debug << "sparseTextureGatherOffsets"; break; + case EOpSparseImageLoad: out.debug << "sparseImageLoad"; break; + case EOpSparseTextureClamp: out.debug << "sparseTextureClamp"; break; + case EOpSparseTextureOffsetClamp: out.debug << "sparseTextureOffsetClamp"; break; + case EOpSparseTextureGradClamp: out.debug << "sparseTextureGradClamp"; break; + case EOpSparseTextureGradOffsetClamp: out.debug << "sparseTextureGradOffsetClam"; break; +#ifdef AMD_EXTENSIONS + case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break; + case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break; + case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break; +#endif case EOpAddCarry: out.debug << "addCarry"; break; case EOpSubBorrow: out.debug << "subBorrow"; break; @@ -694,11 +841,14 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const #endif { const double value = constUnion[i].getDConst(); - // Print infinity in a portable way, for test stability. - // Other cases may be needed in the future: negative infinity, - // and NaNs. - if (is_positive_infinity(value)) - out.debug << "inf\n"; + // Print infinities and NaNs in a portable way. + if (IsInfinity(value)) { + if (value < 0) + out.debug << "-1.#INF\n"; + else + out.debug << "+1.#INF\n"; + } else if (IsNan(value)) + out.debug << "1.#IND\n"; else { const int maxSize = 300; char buf[maxSize]; @@ -744,6 +894,26 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const out.debug << buf << "\n"; } break; +#ifdef AMD_EXTENSIONS + case EbtInt16: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int16_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint16: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint16_t"); + + out.debug << buf << "\n"; + } + break; +#endif default: out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc()); break; @@ -884,6 +1054,13 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) case EShLangTessControl: infoSink.debug << "vertices = " << vertices << "\n"; + + if (inputPrimitive != ElgNone) + infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n"; + if (vertexSpacing != EvsNone) + infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n"; + if (vertexOrder != EvoNone) + infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n"; break; case EShLangTessEvaluation: diff --git a/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp b/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp index 04868f16a..40a0e4168 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016-2017 LunarG, Inc. // // All rights reserved. // @@ -66,11 +66,14 @@ namespace glslang { struct TVarEntryInfo { - int id; - TIntermSymbol* symbol; - bool live; - int newBinding; - int newSet; + int id; + TIntermSymbol* symbol; + bool live; + int newBinding; + int newSet; + int newLocation; + int newComponent; + int newIndex; struct TOrderById { @@ -113,70 +116,143 @@ typedef std::vector TVarLiveMap; class TVarGatherTraverser : public TLiveTraverser { public: - TVarGatherTraverser(const TIntermediate& i, TVarLiveMap& vars, bool traverseDeadCode) + TVarGatherTraverser(const TIntermediate& i, bool traverseDeadCode, TVarLiveMap& inList, TVarLiveMap& outList, TVarLiveMap& uniformList) : TLiveTraverser(i, traverseDeadCode, true, true, false) - , varLiveList(vars) + , inputList(inList) + , outputList(outList) + , uniformList(uniformList) { } virtual void visitSymbol(TIntermSymbol* base) { - if (base->getQualifier().storage == EvqUniform) { + TVarLiveMap* target = nullptr; + if (base->getQualifier().storage == EvqVaryingIn) + target = &inputList; + else if (base->getQualifier().storage == EvqVaryingOut) + target = &outputList; + else if (base->getQualifier().isUniformOrBuffer()) + target = &uniformList; + + if (target) { TVarEntryInfo ent = { base->getId(), base, !traverseAll }; - TVarLiveMap::iterator at = std::lower_bound(varLiveList.begin(), varLiveList.end(), ent, TVarEntryInfo::TOrderById()); - if (at != varLiveList.end() && at->id == ent.id) + TVarLiveMap::iterator at = std::lower_bound(target->begin(), target->end(), ent, TVarEntryInfo::TOrderById()); + if (at != target->end() && at->id == ent.id) at->live = at->live || !traverseAll; // update live state else - varLiveList.insert(at, ent); + target->insert(at, ent); } } private: - TVarLiveMap& varLiveList; + TVarLiveMap& inputList; + TVarLiveMap& outputList; + TVarLiveMap& uniformList; }; class TVarSetTraverser : public TLiveTraverser { public: - TVarSetTraverser(const TIntermediate& i, const TVarLiveMap& vars) + TVarSetTraverser(const TIntermediate& i, const TVarLiveMap& inList, const TVarLiveMap& outList, const TVarLiveMap& uniformList) : TLiveTraverser(i, true, true, true, false) - , varLiveList(vars) + , inputList(inList) + , outputList(outList) + , uniformList(uniformList) { } virtual void visitSymbol(TIntermSymbol* base) { - TVarEntryInfo ent = { base->getId() }; - TVarLiveMap::const_iterator at = std::lower_bound(varLiveList.begin(), varLiveList.end(), ent, TVarEntryInfo::TOrderById()); - if (at == varLiveList.end()) + const TVarLiveMap* source; + if (base->getQualifier().storage == EvqVaryingIn) + source = &inputList; + else if (base->getQualifier().storage == EvqVaryingOut) + source = &outputList; + else if (base->getQualifier().isUniformOrBuffer()) + source = &uniformList; + else return; - if (!(at->id == ent.id)) + + TVarEntryInfo ent = { base->getId() }; + TVarLiveMap::const_iterator at = std::lower_bound(source->begin(), source->end(), ent, TVarEntryInfo::TOrderById()); + if (at == source->end()) + return; + + if (at->id != ent.id) return; if (at->newBinding != -1) base->getWritableType().getQualifier().layoutBinding = at->newBinding; if (at->newSet != -1) base->getWritableType().getQualifier().layoutSet = at->newSet; + if (at->newLocation != -1) + base->getWritableType().getQualifier().layoutLocation = at->newLocation; + if (at->newComponent != -1) + base->getWritableType().getQualifier().layoutComponent = at->newComponent; + if (at->newIndex != -1) + base->getWritableType().getQualifier().layoutIndex = at->newIndex; } private: - const TVarLiveMap& varLiveList; + const TVarLiveMap& inputList; + const TVarLiveMap& outputList; + const TVarLiveMap& uniformList; }; -struct TResolverAdaptor +struct TNotifyUniformAdaptor { - TResolverAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e) + EShLanguage stage; + TIoMapResolver& resolver; + inline TNotifyUniformAdaptor(EShLanguage s, TIoMapResolver& r) + : stage(s) + , resolver(r) + { + } + inline void operator()(TVarEntryInfo& ent) + { + resolver.notifyBinding(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live); + } +private: + TNotifyUniformAdaptor& operator=(TNotifyUniformAdaptor&); +}; + +struct TNotifyInOutAdaptor +{ + EShLanguage stage; + TIoMapResolver& resolver; + inline TNotifyInOutAdaptor(EShLanguage s, TIoMapResolver& r) + : stage(s) + , resolver(r) + { + } + inline void operator()(TVarEntryInfo& ent) + { + resolver.notifyInOut(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live); + } +private: + TNotifyInOutAdaptor& operator=(TNotifyInOutAdaptor&); +}; + +struct TResolverUniformAdaptor +{ + TResolverUniformAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e, TIntermediate& interm) : stage(s) , resolver(r) , infoSink(i) , error(e) + , intermediate(interm) { } inline void operator()(TVarEntryInfo& ent) { + ent.newLocation = -1; + ent.newComponent = -1; + ent.newBinding = -1; + ent.newSet = -1; + ent.newIndex = -1; const bool isValid = resolver.validateBinding(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live); if (isValid) { ent.newBinding = resolver.resolveBinding(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live); @@ -209,25 +285,77 @@ struct TResolverAdaptor TIoMapResolver& resolver; TInfoSink& infoSink; bool& error; + TIntermediate& intermediate; private: - TResolverAdaptor& operator=(TResolverAdaptor&); + TResolverUniformAdaptor& operator=(TResolverUniformAdaptor&); }; -/* - * Basic implementation of glslang::TIoMapResolver that replaces the - * previous offset behaviour. - * It does the same, uses the offsets for th corresponding uniform - * types. Also respects the EOptionAutoMapBindings flag and binds - * them if needed. - */ -struct TDefaultIoResolver : public glslang::TIoMapResolver +struct TResolverInOutAdaptor +{ + TResolverInOutAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e, TIntermediate& interm) + : stage(s) + , resolver(r) + , infoSink(i) + , error(e) + , intermediate(interm) + { + } + + inline void operator()(TVarEntryInfo& ent) + { + ent.newLocation = -1; + ent.newComponent = -1; + ent.newBinding = -1; + ent.newSet = -1; + ent.newIndex = -1; + const bool isValid = resolver.validateInOut(stage, + ent.symbol->getName().c_str(), + ent.symbol->getType(), + ent.live); + if (isValid) { + ent.newLocation = resolver.resolveInOutLocation(stage, + ent.symbol->getName().c_str(), + ent.symbol->getType(), + ent.live); + ent.newComponent = resolver.resolveInOutComponent(stage, + ent.symbol->getName().c_str(), + ent.symbol->getType(), + ent.live); + ent.newIndex = resolver.resolveInOutIndex(stage, + ent.symbol->getName().c_str(), + ent.symbol->getType(), + ent.live); + } else { + TString errorMsg = "Invalid shader In/Out variable semantic: "; + errorMsg += ent.symbol->getType().getQualifier().semanticName; + infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + error = true; + } + } + + EShLanguage stage; + TIoMapResolver& resolver; + TInfoSink& infoSink; + bool& error; + TIntermediate& intermediate; + +private: + TResolverInOutAdaptor& operator=(TResolverInOutAdaptor&); +}; + +// Base class for shared TIoMapResolver services, used by several derivations. +struct TDefaultIoResolverBase : public glslang::TIoMapResolver { int baseSamplerBinding; int baseTextureBinding; int baseImageBinding; int baseUboBinding; - bool doAutoMapping; + int baseSsboBinding; + int baseUavBinding; + std::vector baseResourceSetBinding; + bool doAutoBindingMapping; + bool doAutoLocationMapping; typedef std::vector TSlotSet; typedef std::unordered_map TSlotSetMap; TSlotSetMap slots; @@ -246,7 +374,12 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver int reserveSlot(int set, int slot) { TSlotSet::iterator at = findSlot(set, slot); - slots[set].insert(at, slot); + + // tolerate aliasing, by not double-recording aliases + // (policy about appropriateness of the alias is higher up) + if (at == slots[set].end() || *at != slot) + slots[set].insert(at, slot); + return slot; } @@ -263,74 +396,9 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver return reserveSlot(set, base); } - bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override - { - if (type.getQualifier().hasBinding()) { - int set; - if (type.getQualifier().hasSet()) - set = type.getQualifier().layoutSet; - else - set = 0; + virtual bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override = 0; - if (type.getBasicType() == glslang::EbtSampler) { - const glslang::TSampler& sampler = type.getSampler(); - if (sampler.isPureSampler()) - return checkEmpty(set, baseSamplerBinding + type.getQualifier().layoutBinding); - - if (sampler.isTexture()) - return checkEmpty(set, baseTextureBinding + type.getQualifier().layoutBinding); - } - - if (type.getQualifier().isUniformOrBuffer()) - return checkEmpty(set, baseUboBinding + type.getQualifier().layoutBinding); - } - return true; - } - - int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override - { - int set; - if (type.getQualifier().hasSet()) - set = type.getQualifier().layoutSet; - else - set = 0; - - if (type.getQualifier().hasBinding()) { - if (type.getBasicType() == glslang::EbtSampler) { - const glslang::TSampler& sampler = type.getSampler(); - if (sampler.isImage()) - return reserveSlot(set, baseImageBinding + type.getQualifier().layoutBinding); - - if (sampler.isPureSampler()) - return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding); - - if (sampler.isTexture()) - return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding); - } - - if (type.getQualifier().isUniformOrBuffer()) - return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding); - } else if (is_live && doAutoMapping) { - // find free slot, the caller did make sure it passes all vars with binding - // first and now all are passed that do not have a binding and needs one - if (type.getBasicType() == glslang::EbtSampler) { - const glslang::TSampler& sampler = type.getSampler(); - if (sampler.isImage()) - return getFreeSlot(set, baseImageBinding); - - if (sampler.isPureSampler()) - return getFreeSlot(set, baseSamplerBinding); - - if (sampler.isTexture()) - return getFreeSlot(set, baseTextureBinding); - } - - if (type.getQualifier().isUniformOrBuffer()) - return getFreeSlot(set, baseUboBinding); - } - - return -1; - } + virtual int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override = 0; int resolveSet(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override { @@ -338,8 +406,231 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver return type.getQualifier().layoutSet; return 0; } + + bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override + { + return true; + } + int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& type, bool /*is_live*/) override + { + if (!doAutoLocationMapping || type.getQualifier().hasLocation()) + return -1; + + // Placeholder. + // TODO: It would be nice to flesh this out using + // intermediate->computeTypeLocationSize(type), or functions that call it like + // intermediate->addUsedLocation() + // These in turn would want the intermediate, which is not available here, but + // is available in many places, and a lot of copying from it could be saved if + // it were just available. + return 0; + } + int resolveInOutComponent(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override + { + return -1; + } + int resolveInOutIndex(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override + { + return -1; + } + + void notifyBinding(EShLanguage, const char* /*name*/, const TType&, bool /*is_live*/) override {} + void notifyInOut(EShLanguage, const char* /*name*/, const TType&, bool /*is_live*/) override {} + void endNotifications() override {} + +protected: + static int getLayoutSet(const glslang::TType& type) { + if (type.getQualifier().hasSet()) + return type.getQualifier().layoutSet; + else + return 0; + } + + static bool isSamplerType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isPureSampler(); + } + + static bool isTextureType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isTexture(); + } + + static bool isUboType(const glslang::TType& type) { + return type.getQualifier().storage == EvqUniform; + } }; +/* + * Basic implementation of glslang::TIoMapResolver that replaces the + * previous offset behavior. + * It does the same, uses the offsets for the corresponding uniform + * types. Also respects the EOptionAutoMapBindings flag and binds + * them if needed. + */ +/* + * Default resolver + */ +struct TDefaultIoResolver : public TDefaultIoResolverBase +{ + bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& /*type*/, bool /*is_live*/) override + { + return true; + } + + int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override + { + const int set = getLayoutSet(type); + + if (type.getQualifier().hasBinding()) { + if (isImageType(type)) + return reserveSlot(set, baseImageBinding + type.getQualifier().layoutBinding); + + if (isTextureType(type)) + return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding); + + if (isSsboType(type)) + return reserveSlot(set, baseSsboBinding + type.getQualifier().layoutBinding); + + if (isSamplerType(type)) + return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding); + + if (isUboType(type)) + return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding); + } else if (is_live && doAutoBindingMapping) { + // find free slot, the caller did make sure it passes all vars with binding + // first and now all are passed that do not have a binding and needs one + + if (isImageType(type)) + return getFreeSlot(set, baseImageBinding); + + if (isTextureType(type)) + return getFreeSlot(set, baseTextureBinding); + + if (isSsboType(type)) + return getFreeSlot(set, baseSsboBinding); + + if (isSamplerType(type)) + return getFreeSlot(set, baseSamplerBinding); + + if (isUboType(type)) + return getFreeSlot(set, baseUboBinding); + } + + return -1; + } + +protected: + static bool isImageType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage(); + } + + static bool isSsboType(const glslang::TType& type) { + return type.getQualifier().storage == EvqBuffer; + } +}; + +/******************************************************************************** +The following IO resolver maps types in HLSL register space, as follows: + +t – for shader resource views (SRV) + TEXTURE1D + TEXTURE1DARRAY + TEXTURE2D + TEXTURE2DARRAY + TEXTURE3D + TEXTURECUBE + TEXTURECUBEARRAY + TEXTURE2DMS + TEXTURE2DMSARRAY + STRUCTUREDBUFFER + BYTEADDRESSBUFFER + BUFFER + TBUFFER + +s – for samplers + SAMPLER + SAMPLER1D + SAMPLER2D + SAMPLER3D + SAMPLERCUBE + SAMPLERSTATE + SAMPLERCOMPARISONSTATE + +u – for unordered access views (UAV) + RWBYTEADDRESSBUFFER + RWSTRUCTUREDBUFFER + APPENDSTRUCTUREDBUFFER + CONSUMESTRUCTUREDBUFFER + RWBUFFER + RWTEXTURE1D + RWTEXTURE1DARRAY + RWTEXTURE2D + RWTEXTURE2DARRAY + RWTEXTURE3D + +b – for constant buffer views (CBV) + CBUFFER + CONSTANTBUFFER + ********************************************************************************/ +struct TDefaultHlslIoResolver : public TDefaultIoResolverBase +{ + bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& /*type*/, bool /*is_live*/) override + { + return true; + } + + int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override + { + const int set = getLayoutSet(type); + + if (type.getQualifier().hasBinding()) { + if (isUavType(type)) + return reserveSlot(set, baseUavBinding + type.getQualifier().layoutBinding); + + if (isSrvType(type)) + return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding); + + if (isSamplerType(type)) + return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding); + + if (isUboType(type)) + return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding); + } else if (is_live && doAutoBindingMapping) { + // find free slot, the caller did make sure it passes all vars with binding + // first and now all are passed that do not have a binding and needs one + + if (isUavType(type)) + return getFreeSlot(set, baseUavBinding); + + if (isSrvType(type)) + return getFreeSlot(set, baseTextureBinding); + + if (isSamplerType(type)) + return getFreeSlot(set, baseSamplerBinding); + + if (isUboType(type)) + return getFreeSlot(set, baseUboBinding); + } + + return -1; + } + +protected: + // Return true if this is a SRV (shader resource view) type: + static bool isSrvType(const glslang::TType& type) { + return isTextureType(type) || type.getQualifier().storage == EvqBuffer; + } + + // Return true if this is a UAV (unordered access view) type: + static bool isUavType(const glslang::TType& type) { + if (type.getQualifier().readonly) + return false; + + return (type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage()) || + (type.getQualifier().storage == EvqBuffer); + } +}; + + // Map I/O variables to provided offsets, and make bindings for // unbound but live variables. // @@ -351,7 +642,11 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi intermediate.getShiftTextureBinding() == 0 && intermediate.getShiftImageBinding() == 0 && intermediate.getShiftUboBinding() == 0 && + intermediate.getShiftSsboBinding() == 0 && + intermediate.getShiftUavBinding() == 0 && + intermediate.getResourceSetBinding().empty() && intermediate.getAutoMapBindings() == false && + intermediate.getAutoMapLocations() == false && resolver == nullptr) return true; @@ -364,19 +659,33 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi // if no resolver is provided, use the default resolver with the given shifts and auto map settings TDefaultIoResolver defaultResolver; - if (resolver == nullptr) { - defaultResolver.baseSamplerBinding = intermediate.getShiftSamplerBinding(); - defaultResolver.baseTextureBinding = intermediate.getShiftTextureBinding(); - defaultResolver.baseImageBinding = intermediate.getShiftImageBinding(); - defaultResolver.baseUboBinding = intermediate.getShiftUboBinding(); - defaultResolver.doAutoMapping = intermediate.getAutoMapBindings(); + TDefaultHlslIoResolver defaultHlslResolver; - resolver = &defaultResolver; + if (resolver == nullptr) { + TDefaultIoResolverBase* resolverBase; + + // TODO: use a passed in IO mapper for this + if (intermediate.usingHlslIoMapping()) + resolverBase = &defaultHlslResolver; + else + resolverBase = &defaultResolver; + + resolverBase->baseSamplerBinding = intermediate.getShiftSamplerBinding(); + resolverBase->baseTextureBinding = intermediate.getShiftTextureBinding(); + resolverBase->baseImageBinding = intermediate.getShiftImageBinding(); + resolverBase->baseUboBinding = intermediate.getShiftUboBinding(); + resolverBase->baseSsboBinding = intermediate.getShiftSsboBinding(); + resolverBase->baseUavBinding = intermediate.getShiftUavBinding(); + resolverBase->baseResourceSetBinding = intermediate.getResourceSetBinding(); + resolverBase->doAutoBindingMapping = intermediate.getAutoMapBindings(); + resolverBase->doAutoLocationMapping = intermediate.getAutoMapLocations(); + + resolver = resolverBase; } - TVarLiveMap varMap; - TVarGatherTraverser iter_binding_all(intermediate, varMap, true); - TVarGatherTraverser iter_binding_live(intermediate, varMap, false); + TVarLiveMap inVarMap, outVarMap, uniformVarMap; + TVarGatherTraverser iter_binding_all(intermediate, true, inVarMap, outVarMap, uniformVarMap); + TVarGatherTraverser iter_binding_live(intermediate, false, inVarMap, outVarMap, uniformVarMap); root->traverse(&iter_binding_all); iter_binding_live.pushFunction(intermediate.getEntryPointMangledName().c_str()); @@ -388,16 +697,25 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi } // sort entries by priority. see TVarEntryInfo::TOrderByPriority for info. - std::sort(varMap.begin(), varMap.end(), TVarEntryInfo::TOrderByPriority()); + std::sort(uniformVarMap.begin(), uniformVarMap.end(), TVarEntryInfo::TOrderByPriority()); bool hadError = false; - TResolverAdaptor doResolve(stage, *resolver, infoSink, hadError); - std::for_each(varMap.begin(), varMap.end(), doResolve); + TNotifyInOutAdaptor inOutNotify(stage, *resolver); + TNotifyUniformAdaptor uniformNotify(stage, *resolver); + TResolverUniformAdaptor uniformResolve(stage, *resolver, infoSink, hadError, intermediate); + TResolverInOutAdaptor inOutResolve(stage, *resolver, infoSink, hadError, intermediate); + std::for_each(inVarMap.begin(), inVarMap.end(), inOutNotify); + std::for_each(outVarMap.begin(), outVarMap.end(), inOutNotify); + std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformNotify); + resolver->endNotifications(); + std::for_each(inVarMap.begin(), inVarMap.end(), inOutResolve); + std::for_each(outVarMap.begin(), outVarMap.end(), inOutResolve); + std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformResolve); if (!hadError) { // sort by id again, so we can use lower bound to find entries - std::sort(varMap.begin(), varMap.end(), TVarEntryInfo::TOrderById()); - TVarSetTraverser iter_iomap(intermediate, varMap); + std::sort(uniformVarMap.begin(), uniformVarMap.end(), TVarEntryInfo::TOrderById()); + TVarSetTraverser iter_iomap(intermediate, inVarMap, outVarMap, uniformVarMap); root->traverse(&iter_iomap); } diff --git a/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp b/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp index 761cb4164..4a91a252d 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -461,10 +461,12 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) case EShLangTessEvaluation: if (inputPrimitive == ElgNone) error(infoSink, "At least one shader must specify an input layout primitive"); - if (vertexSpacing == EvsNone) - vertexSpacing = EvsEqual; - if (vertexOrder == EvoNone) - vertexOrder = EvoCcw; + if (source == EShSourceGlsl) { + if (vertexSpacing == EvsNone) + vertexSpacing = EvsEqual; + if (vertexOrder == EvoNone) + vertexOrder = EvoCcw; + } break; case EShLangGeometry: if (inputPrimitive == ElgNone) @@ -858,7 +860,7 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp return -1; // no collision } -// Accumulate locations used for inputs, outputs, and uniforms, and check for collisions +// Accumulate bindings and offsets, and check for collisions // as the accumulation is done. // // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. @@ -1045,9 +1047,9 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains const int baseAlignmentVec4Std140 = 16; -// Return the size and alignment of a scalar. +// Return the size and alignment of a component of the given type. // The size is returned in the 'size' parameter -// Return value is the alignment of the type. +// Return value is the alignment.. int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) { switch (type.getBasicType()) { @@ -1055,6 +1057,8 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) case EbtUint64: case EbtDouble: size = 8; return 8; #ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: case EbtFloat16: size = 2; return 2; #endif default: size = 4; return 4; @@ -1217,4 +1221,14 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b return baseAlignmentVec4Std140; } +// To aid the basic HLSL rule about crossing vec4 boundaries. +bool TIntermediate::improperStraddle(const TType& type, int size, int offset) +{ + if (! type.isVector() || type.isArray()) + return false; + + return size <= 16 ? offset / 16 != (offset + size - 1) / 16 + : offset % 16 != 0; +} + } // end namespace glslang diff --git a/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h b/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h index 14193f56a..f93182b75 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h +++ b/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h @@ -174,9 +174,16 @@ public: shiftTextureBinding(0), shiftImageBinding(0), shiftUboBinding(0), + shiftSsboBinding(0), + shiftUavBinding(0), autoMapBindings(false), + autoMapLocations(false), flattenUniformArrays(false), - useUnknownFormat(false) + useUnknownFormat(false), + hlslOffsets(false), + useStorageBuffer(false), + hlslIoMapping(false), + textureSamplerTransformMode(EShTexSampTransKeep) { localSize[0] = 1; localSize[1] = 1; @@ -207,12 +214,27 @@ public: unsigned int getShiftImageBinding() const { return shiftImageBinding; } void setShiftUboBinding(unsigned int shift) { shiftUboBinding = shift; } unsigned int getShiftUboBinding() const { return shiftUboBinding; } - void setAutoMapBindings(bool map) { autoMapBindings = map; } + void setShiftSsboBinding(unsigned int shift) { shiftSsboBinding = shift; } + unsigned int getShiftSsboBinding() const { return shiftSsboBinding; } + void setShiftUavBinding(unsigned int shift) { shiftUavBinding = shift; } + unsigned int getShiftUavBinding() const { return shiftUavBinding; } + void setResourceSetBinding(const std::vector& shift) { resourceSetBinding = shift; } + const std::vector& getResourceSetBinding() const { return resourceSetBinding; } + void setAutoMapBindings(bool map) { autoMapBindings = map; } bool getAutoMapBindings() const { return autoMapBindings; } - void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; } + void setAutoMapLocations(bool map) { autoMapLocations = map; } + bool getAutoMapLocations() const { return autoMapLocations; } + void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; } bool getFlattenUniformArrays() const { return flattenUniformArrays; } void setNoStorageFormat(bool b) { useUnknownFormat = b; } bool getNoStorageFormat() const { return useUnknownFormat; } + void setHlslOffsets() { hlslOffsets = true; } + bool usingHlslOFfsets() const { return hlslOffsets; } + void setUseStorageBuffer() { useStorageBuffer = true; } + bool usingStorageBuffer() const { return useStorageBuffer; } + void setHlslIoMapping(bool b) { hlslIoMapping = b; } + bool usingHlslIoMapping() { return hlslIoMapping; } + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } void setVersion(int v) { version = v; } int getVersion() const { return version; } @@ -237,7 +259,9 @@ public: TIntermSymbol* addSymbol(const TType&, const TSourceLoc&); TIntermSymbol* addSymbol(const TIntermSymbol&); TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const; - TIntermTyped* addShapeConversion(TOperator, const TType&, TIntermTyped*); + TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*); + void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode); + TIntermTyped* addShapeConversion(const TType&, TIntermTyped*); TIntermTyped* addBinaryMath(TOperator, TIntermTyped* left, TIntermTyped* right, TSourceLoc); TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc); TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc); @@ -261,13 +285,18 @@ public: TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const; +#ifdef AMD_EXTENSIONS + TIntermConstantUnion* addConstantUnion(short, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; + +#endif TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const; TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); - TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); - TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); TIntermBranch* addBranch(TOperator, const TSourceLoc&); TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); template TIntermTyped* addSwizzle(TSwizzleSelectors&, const TSourceLoc&); @@ -410,7 +439,9 @@ public: } int addXfbBufferOffset(const TType&); unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const; + static int getBaseAlignmentScalar(const TType&, int& size); static int getBaseAlignment(const TType&, int& size, int& stride, bool std140, bool rowMajor); + static bool improperStraddle(const TType& type, int size, int offset); bool promote(TIntermOperator*); #ifdef NV_EXTENSIONS @@ -420,6 +451,18 @@ public: bool getGeoPassthroughEXT() const { return geoPassthroughEXT; } #endif + const char* addSemanticName(const TString& name) + { + return semanticNameSet.insert(name).first->c_str(); + } + + void setSourceFile(const char* file) { sourceFile = file; } + const std::string& getSourceFile() const { return sourceFile; } + void addSourceText(const char* text) { sourceText = sourceText + text; } + const std::string& getSourceText() const { return sourceText; } + + const char* const implicitThisName = "@this"; + protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); void error(TInfoSink& infoSink, const char*); @@ -433,7 +476,6 @@ protected: void inOutLocationCheck(TInfoSink&); TIntermSequence& findLinkerObjects() const; bool userOutputUsed() const; - static int getBaseAlignmentScalar(const TType&, int& size); bool isSpecializationOperation(const TIntermOperator&) const; bool promoteUnary(TIntermUnary&); bool promoteBinary(TIntermBinary&); @@ -442,6 +484,7 @@ protected: void pushSelector(TIntermSequence&, const TVectorSelector&, const TSourceLoc&); void pushSelector(TIntermSequence&, const TMatrixSelector&, const TSourceLoc&); bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&); + void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root); const EShLanguage language; // stage, known at construction time EShSource source; // source language, known a bit later @@ -485,9 +528,16 @@ protected: unsigned int shiftTextureBinding; unsigned int shiftImageBinding; unsigned int shiftUboBinding; + unsigned int shiftSsboBinding; + unsigned int shiftUavBinding; + std::vector resourceSetBinding; bool autoMapBindings; + bool autoMapLocations; bool flattenUniformArrays; bool useUnknownFormat; + bool hlslOffsets; + bool useStorageBuffer; + bool hlslIoMapping; typedef std::list TGraph; TGraph callGraph; @@ -497,6 +547,13 @@ protected: 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 + std::set semanticNameSet; + + EShTextureSamplerTransformMode textureSamplerTransformMode; + + // source code of shader, useful as part of debug information + std::string sourceFile; + std::string sourceText; private: void operator=(TIntermediate&); // prevent assignments diff --git a/src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp b/src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp index 22b55516a..1a8e6d998 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp @@ -76,12 +76,6 @@ bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) return false; } - if (node->getSequence().size() == 0) { - error = true; - - return false; - } - bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion(); if (flag) { singleConstantParam = true; diff --git a/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h b/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h index 0c85f8a19..5f26b4371 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h +++ b/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h @@ -68,6 +68,7 @@ public: virtual void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc); virtual void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc); virtual void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc); + virtual void unimplemented(const TSourceLoc&, const char* featureDesc); virtual void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); virtual TExtensionBehavior getExtensionBehavior(const char*); @@ -77,6 +78,7 @@ public: virtual void fullIntegerCheck(const TSourceLoc&, const char* op); virtual void doubleCheck(const TSourceLoc&, const char* op); #ifdef AMD_EXTENSIONS + virtual void int16Check(const TSourceLoc& loc, const char* op, bool builtIn = false); virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false); #endif virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false); diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index ef8e83e17..92423507e 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include @@ -391,6 +393,14 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo TSourceLoc loc = ppToken->loc; // because we sometimes read the newline before reporting the error if (token == PpAtomIdentifier) { if (strcmp("defined", ppToken->name) == 0) { + if (! parseContext.isReadingHLSL() && isMacroInput()) { + if (parseContext.relaxedErrors()) + parseContext.ppWarn(ppToken->loc, "nonportable when expanded from macros for preprocessor expression", + "defined", ""); + else + parseContext.ppError(ppToken->loc, "cannot use in preprocessor expression when expanded from macros", + "defined", ""); + } bool needclose = 0; token = scanToken(ppToken); if (token == '(') { @@ -611,14 +621,14 @@ int TPpContext::CPPinclude(TPpToken* ppToken) TShader::Includer::IncludeResult* res = nullptr; if (startWithLocalSearch) res = includer.includeLocal(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); - if (! res || res->headerName.empty()) { + if (res == nullptr || res->headerName.empty()) { includer.releaseInclude(res); res = includer.includeSystem(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); } // Process the results - if (res && !res->headerName.empty()) { - if (res->headerData && res->headerLength) { + if (res != nullptr && !res->headerName.empty()) { + if (res->headerData != nullptr && res->headerLength > 0) { // path for processing one or more tokens from an included header, hand off 'res' const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); std::ostringstream prologue; @@ -636,8 +646,8 @@ int TPpContext::CPPinclude(TPpToken* ppToken) } else { // error path, clean up std::string message = - res ? std::string(res->headerData, res->headerLength) - : std::string("Could not process include directive"); + res != nullptr ? std::string(res->headerData, res->headerLength) + : std::string("Could not process include directive"); parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str()); includer.releaseInclude(res); } @@ -714,6 +724,7 @@ int TPpContext::CPPerror(TPpToken* ppToken) if (token == PpAtomConstInt || token == PpAtomConstUint || token == PpAtomConstInt64 || token == PpAtomConstUint64 || #ifdef AMD_EXTENSIONS + token == PpAtomConstInt16 || token == PpAtomConstUint16 || token == PpAtomConstFloat16 || #endif token == PpAtomConstFloat || token == PpAtomConstDouble) { @@ -748,6 +759,10 @@ int TPpContext::CPPpragma(TPpToken* ppToken) case PpAtomConstUint: case PpAtomConstInt64: case PpAtomConstUint64: +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: +#endif case PpAtomConstFloat: case PpAtomConstDouble: #ifdef AMD_EXTENSIONS @@ -776,8 +791,12 @@ int TPpContext::CPPversion(TPpToken* ppToken) { int token = scanToken(ppToken); - if (errorOnVersion || versionSeen) - parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", ""); + if (errorOnVersion || versionSeen) { + if (parseContext.isReadingHLSL()) + parseContext.ppError(ppToken->loc, "invalid preprocessor command", "#version", ""); + else + parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", ""); + } versionSeen = true; if (token == '\n') { @@ -986,6 +1005,8 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* int token; while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) { token = tokenPaste(token, *ppToken); + if (token == tMarkerInput::marker || token == EndOfInput) + break; if (token == PpAtomIdentifier && MacroExpand(ppToken, false, newLineOkay) != 0) continue; expandedArg->putToken(token, ppToken); @@ -1050,7 +1071,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken) // TODO: preprocessor: properly handle whitespace (or lack of it) between tokens when expanding if (token == PpAtomIdentifier) { int i; - for (i = mac->args.size() - 1; i >= 0; i--) + for (i = (int)mac->args.size() - 1; i >= 0; i--) if (strcmp(pp->atomStrings.getString(mac->args[i]), ppToken->name) == 0) break; if (i >= 0) { diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp index c4904033a..06c2333ef 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include @@ -120,6 +122,8 @@ const struct { { PpAtomDecrement, "--" }, { PpAtomIncrement, "++" }, + { PpAtomColonColon, "::" }, + { PpAtomDefine, "define" }, { PpAtomUndef, "undef" }, { PpAtomIf, "if" }, diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index f7b352200..de48e2794 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -92,7 +92,7 @@ namespace glslang { class TPpToken { public: - TPpToken() : space(false), ival(0), dval(0.0), i64val(0) + TPpToken() : space(false), i64val(0) { loc.init(); name[0] = 0; @@ -108,10 +108,14 @@ public: bool operator!=(const TPpToken& right) { return ! operator==(right); } TSourceLoc loc; - bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned - int ival; - double dval; - long long i64val; + bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned + + union { + int ival; + double dval; + long long i64val; + }; + char name[MaxTokenLength + 1]; }; @@ -196,6 +200,7 @@ public: virtual void ungetch() = 0; virtual bool peekPasting() { return false; } // true when about to see ## virtual bool endOfReplacementList() { return false; } // true when at the end of a macro replacement list (RHS of #define) + virtual bool isMacroInput() { return false; } // Will be called when we start reading tokens from this instance virtual void notifyActivated() {} @@ -236,7 +241,7 @@ public: void reset() { current = 0; } protected: - void putSubtoken(int); + void putSubtoken(char); int getSubtoken(); void ungetSubtoken(); @@ -302,6 +307,7 @@ protected: void ungetChar() { inputStack.back()->ungetch(); } bool peekPasting() { return !inputStack.empty() && inputStack.back()->peekPasting(); } bool endOfReplacementList() { return inputStack.empty() || inputStack.back()->endOfReplacementList(); } + bool isMacroInput() { return inputStack.size() > 0 && inputStack.back()->isMacroInput(); } static const int maxIfNesting = 64; @@ -325,6 +331,7 @@ protected: virtual void ungetch() override { assert(0); } bool peekPasting() override { return prepaste; } bool endOfReplacementList() override { return mac->body.atEnd(); } + bool isMacroInput() override { return true; } MacroSymbol *mac; TVector args; @@ -584,6 +591,7 @@ protected: int ScanFromString(char* s); void missingEndifCheck(); int lFloatConst(int len, int ch, TPpToken* ppToken); + int characterLiteral(TPpToken* ppToken); void push_include(TShader::Includer::IncludeResult* result) { diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp deleted file mode 100755 index e30db7f6d..000000000 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// Copyright (C) 2013 LunarG, 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. -// -/****************************************************************************\ -Copyright (c) 2002, NVIDIA Corporation. - -NVIDIA Corporation("NVIDIA") supplies this software to you in -consideration of your agreement to the following terms, and your use, -installation, modification or redistribution of this NVIDIA software -constitutes acceptance of these terms. If you do not agree with these -terms, please do not use, install, modify or redistribute this NVIDIA -software. - -In consideration of your agreement to abide by the following terms, and -subject to these terms, NVIDIA grants you a personal, non-exclusive -license, under NVIDIA's copyrights in this original NVIDIA software (the -"NVIDIA Software"), to use, reproduce, modify and redistribute the -NVIDIA Software, with or without modifications, in source and/or binary -forms; provided that if you redistribute the NVIDIA Software, you must -retain the copyright notice of NVIDIA, this notice and the following -text and disclaimers in all such redistributions of the NVIDIA Software. -Neither the name, trademarks, service marks nor logos of NVIDIA -Corporation may be used to endorse or promote products derived from the -NVIDIA Software without specific prior written permission from NVIDIA. -Except as expressly stated in this notice, no other rights or licenses -express or implied, are granted by NVIDIA herein, including but not -limited to any patent rights that may be infringed by your derivative -works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. - -THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, -INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER -PRODUCTS. - -IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, -INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY -OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE -NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, -TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF -NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\****************************************************************************/ - -namespace glslang { - -} // end namespace glslang diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index a30442400..fa01549df 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -76,7 +76,9 @@ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include #include @@ -101,9 +103,16 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) { bool HasDecimalOrExponent = false; int isDouble = 0; + bool generateFloat16 = false; + bool acceptFloat16 = parseContext.intermediate.getSource() == EShSourceHlsl; + bool isFloat16 = false; + bool requireHF = false; #ifdef AMD_EXTENSIONS - int isFloat16 = 0; - bool enableFloat16 = parseContext.version >= 450 && parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float); + if (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) { + acceptFloat16 = true; + generateFloat16 = true; + requireHF = true; + } #endif const auto saveName = [&](int ch) { @@ -117,6 +126,35 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) HasDecimalOrExponent = true; saveName(ch); ch = getChar(); + + // 1.#INF or -1.#INF + if (ch == '#') { + if ((len < 2) || + (len == 2 && ppToken->name[0] != '1') || + (len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) || + (len > 3)) + parseContext.ppError(ppToken->loc, "unexpected use of", "#", ""); + else { + // we have 1.# or -1.# or +1.#, check for 'INF' + if ((ch = getChar()) != 'I' || + (ch = getChar()) != 'N' || + (ch = getChar()) != 'F') + parseContext.ppError(ppToken->loc, "expected 'INF'", "#", ""); + else { + // we have [+-].#INF, and we are targeting IEEE 754, so wrap it up: + saveName('I'); + saveName('N'); + saveName('F'); + ppToken->name[len] = '\0'; + if (ppToken->name[0] == '-') + ppToken->i64val = 0xfff0000000000000; // -Infinity + else + ppToken->i64val = 0x7ff0000000000000; // +Infinity + return PpAtomConstFloat; + } + } + } + while (ch >= '0' && ch <= '9') { saveName(ch); ch = getChar(); @@ -158,21 +196,27 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) saveName(ch2); isDouble = 1; } + } else if (acceptFloat16 && (ch == 'h' || ch == 'H')) { #ifdef AMD_EXTENSIONS - } else if (enableFloat16 && (ch == 'h' || ch == 'H')) { - parseContext.float16Check(ppToken->loc, "half floating-point suffix"); + if (generateFloat16) + parseContext.float16Check(ppToken->loc, "half floating-point suffix"); +#endif if (!HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); - int ch2 = getChar(); - if (ch2 != 'f' && ch2 != 'F') { - ungetChar(); - ungetChar(); + if (requireHF) { + int ch2 = getChar(); + if (ch2 != 'f' && ch2 != 'F') { + ungetChar(); + ungetChar(); + } else { + saveName(ch); + saveName(ch2); + isFloat16 = generateFloat16; + } } else { saveName(ch); - saveName(ch2); - isFloat16 = 1; + isFloat16 = generateFloat16; } -#endif } else if (ch == 'f' || ch == 'F') { parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); if (! parseContext.relaxedErrors()) @@ -197,14 +241,88 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) // Return the right token type if (isDouble) return PpAtomConstDouble; -#ifdef AMD_EXTENSIONS else if (isFloat16) return PpAtomConstFloat16; -#endif else return PpAtomConstFloat; } +// Recognize a character literal. +// +// The first ' has already been accepted, read the rest, through the closing '. +// +// Always returns PpAtomConstInt. +// +int TPpContext::characterLiteral(TPpToken* ppToken) +{ + ppToken->name[0] = 0; + ppToken->ival = 0; + + if (parseContext.intermediate.getSource() != EShSourceHlsl) { + // illegal, except in macro definition, for which case we report the character + return '\''; + } + + int ch = getChar(); + switch (ch) { + case '\'': + // As empty sequence: '' + parseContext.ppError(ppToken->loc, "unexpected", "\'", ""); + return PpAtomConstInt; + case '\\': + // As escape sequence: '\XXX' + switch (ch = getChar()) { + case 'a': + ppToken->ival = 7; + break; + case 'b': + ppToken->ival = 8; + break; + case 't': + ppToken->ival = 9; + break; + case 'n': + ppToken->ival = 10; + break; + case 'v': + ppToken->ival = 11; + break; + case 'f': + ppToken->ival = 12; + break; + case 'r': + ppToken->ival = 13; + break; + case 'x': + case '0': + parseContext.ppError(ppToken->loc, "octal and hex sequences not supported", "\\", ""); + break; + default: + // This catches '\'', '\"', '\?', etc. + // Also, things like '\C' mean the same thing as 'C' + // (after the above cases are filtered out). + ppToken->ival = ch; + break; + } + break; + default: + ppToken->ival = ch; + break; + } + ppToken->name[0] = (char)ppToken->ival; + ppToken->name[1] = '\0'; + ch = getChar(); + if (ch != '\'') { + parseContext.ppError(ppToken->loc, "expected", "\'", ""); + // Look ahead for a closing ' + do { + ch = getChar(); + } while (ch != '\'' && ch != EndOfInput && ch != '\n'); + } + + return PpAtomConstInt; +} + // // Scanner used to tokenize source stream. // @@ -216,6 +334,18 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) int ii = 0; unsigned long long ival = 0; bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64); +#ifdef AMD_EXTENSIONS + bool enableInt16 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16); +#endif + bool acceptHalf = pp->parseContext.intermediate.getSource() == EShSourceHlsl; +#ifdef AMD_EXTENSIONS + if (pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) + acceptHalf = true; +#endif + + const auto floatingPointChar = [&](int ch) { return ch == '.' || ch == 'e' || ch == 'E' || + ch == 'f' || ch == 'F' || + (acceptHalf && (ch == 'h' || ch == 'H')); }; ppToken->ival = 0; ppToken->i64val = 0; @@ -279,6 +409,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) bool isUnsigned = false; bool isInt64 = false; +#ifdef AMD_EXTENSIONS + bool isInt16 = false; +#endif ppToken->name[len++] = (char)ch; ch = getch(); if ((ch >= '0' && ch <= '9') || @@ -287,7 +420,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = 0; do { - if (ival <= 0x0fffffff || (enableInt64 && ival <= 0x0fffffffffffffffull)) { + if (ival <= 0x0fffffffu || (enableInt64 && ival <= 0x0fffffffffffffffull)) { ppToken->name[len++] = (char)ch; if (ch >= '0' && ch <= '9') { ii = ch - '0'; @@ -326,11 +459,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) } else ungetch(); } - } - else if (enableInt64 && (ch == 'l' || ch == 'L')) { + +#ifdef AMD_EXTENSIONS + if (enableInt16) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } +#endif + } else if (enableInt64 && (ch == 'l' || ch == 'L')) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; +#ifdef AMD_EXTENSIONS + } else if (enableInt16 && (ch == 's' || ch == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; +#endif } else ungetch(); ppToken->name[len] = '\0'; @@ -338,6 +488,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (isInt64) { ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; +#ifdef AMD_EXTENSIONS + } else if (isInt16) { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; +#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -347,6 +502,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) bool isUnsigned = false; bool isInt64 = false; +#ifdef AMD_EXTENSIONS + bool isInt16 = false; +#endif bool octalOverflow = false; bool nonOctal = false; ival = 0; @@ -359,7 +517,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); AlreadyComplained = 1; } - if (ival <= 0x1fffffff || (enableInt64 && ival <= 0x1fffffffffffffffull)) { + if (ival <= 0x1fffffffu || (enableInt64 && ival <= 0x1fffffffffffffffull)) { ii = ch - '0'; ival = (ival << 3) | ii; } else @@ -380,7 +538,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ch = getch(); } while (ch >= '0' && ch <= '9'); } - if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F') + if (floatingPointChar(ch)) return pp->lFloatConst(len, ch, ppToken); // wasn't a float, so must be octal... @@ -401,11 +559,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) } else ungetch(); } - } - else if (enableInt64 && (ch == 'l' || ch == 'L')) { + +#ifdef AMD_EXTENSIONS + if (enableInt16) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } +#endif + } else if (enableInt64 && (ch == 'l' || ch == 'L')) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; +#ifdef AMD_EXTENSIONS + } else if (enableInt16 && (ch == 's' || ch == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; +#endif } else ungetch(); ppToken->name[len] = '\0'; @@ -416,6 +591,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (isInt64) { ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; +#ifdef AMD_EXTENSIONS + } else if (isInt16) { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; +#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -435,13 +615,16 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) } ch = getch(); } while (ch >= '0' && ch <= '9'); - if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F') { + if (floatingPointChar(ch)) return pp->lFloatConst(len, ch, ppToken); - } else { + else { // Finish handling signed and unsigned integers int numericLen = len; bool isUnsigned = false; bool isInt64 = false; +#ifdef AMD_EXTENSIONS + bool isInt16 = false; +#endif if (ch == 'u' || ch == 'U') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; @@ -456,10 +639,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) } else ungetch(); } + +#ifdef AMD_EXTENSIONS + if (enableInt16) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); + } +#endif } else if (enableInt64 && (ch == 'l' || ch == 'L')) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; +#ifdef AMD_EXTENSIONS + } else if (enableInt16 && (ch == 's' || ch == 'S')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt16 = true; +#endif } else ungetch(); @@ -469,10 +670,22 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt; const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10; const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64; +#ifdef AMD_EXTENSIONS + const unsigned short oneTenthMaxInt16 = 0xFFFFu / 10; + const unsigned short remainderMaxInt16 = 0xFFFFu - 10 * oneTenthMaxInt16; +#endif for (int i = 0; i < numericLen; i++) { ch = ppToken->name[i] - '0'; - if ((enableInt64 == false && ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt))) || - (enableInt64 && ((ival > oneTenthMaxInt64) || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)))) { + bool overflow = false; + if (isInt64) + overflow = (ival > oneTenthMaxInt64 || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)); +#ifdef AMD_EXTENSIONS + else if (isInt16) + overflow = (ival > oneTenthMaxInt16 || (ival == oneTenthMaxInt16 && (unsigned short)ch > remainderMaxInt16)); +#endif + else + overflow = (ival > oneTenthMaxInt || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)); + if (overflow) { pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", ""); ival = 0xFFFFFFFFFFFFFFFFull; break; @@ -483,6 +696,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (isInt64) { ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; +#ifdef AMD_EXTENSIONS + } else if (isInt16) { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; +#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -652,6 +870,8 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) return '/'; } break; + case '\'': + return pp->characterLiteral(ppToken); case '"': // TODO: If this gets enhanced to handle escape sequences, or // anything that is different than what #include needs, then @@ -671,6 +891,12 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", ""); } return PpAtomConstString; + case ':': + ch = getch(); + if (ch == ':') + return PpAtomColonColon; + ungetch(); + return ':'; } ch = getch(); @@ -724,6 +950,10 @@ int TPpContext::tokenize(TPpToken& ppToken) case PpAtomConstFloat: case PpAtomConstInt64: case PpAtomConstUint64: +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: +#endif case PpAtomConstDouble: #ifdef AMD_EXTENSIONS case PpAtomConstFloat16: @@ -773,6 +1003,7 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken) token = scanToken(&pastedPpToken); assert(token == PpAtomPaste); + // This covers end of macro expansion if (endOfReplacementList()) { parseContext.ppError(ppToken.loc, "unexpected location; end of replacement list", "##", ""); break; @@ -781,6 +1012,12 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken) // get the token after the ## token = scanToken(&pastedPpToken); + // This covers end of argument expansion + if (token == tMarkerInput::marker) { + parseContext.ppError(ppToken.loc, "unexpected location; end of argument", "##", ""); + break; + } + // get the token text switch (resultToken) { case PpAtomIdentifier: diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp deleted file mode 100755 index 700d82e2f..000000000 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// Copyright (C) 2013 LunarG, 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. -// -/****************************************************************************\ -Copyright (c) 2002, NVIDIA Corporation. - -NVIDIA Corporation("NVIDIA") supplies this software to you in -consideration of your agreement to the following terms, and your use, -installation, modification or redistribution of this NVIDIA software -constitutes acceptance of these terms. If you do not agree with these -terms, please do not use, install, modify or redistribute this NVIDIA -software. - -In consideration of your agreement to abide by the following terms, and -subject to these terms, NVIDIA grants you a personal, non-exclusive -license, under NVIDIA's copyrights in this original NVIDIA software (the -"NVIDIA Software"), to use, reproduce, modify and redistribute the -NVIDIA Software, with or without modifications, in source and/or binary -forms; provided that if you redistribute the NVIDIA Software, you must -retain the copyright notice of NVIDIA, this notice and the following -text and disclaimers in all such redistributions of the NVIDIA Software. -Neither the name, trademarks, service marks nor logos of NVIDIA -Corporation may be used to endorse or promote products derived from the -NVIDIA Software without specific prior written permission from NVIDIA. -Except as expressly stated in this notice, no other rights or licenses -express or implied, are granted by NVIDIA herein, including but not -limited to any patent rights that may be infringed by your derivative -works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. - -THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, -INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER -PRODUCTS. - -IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, -INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY -OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE -NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, -TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF -NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\****************************************************************************/ diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 32d2b0b74..bc145e251 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -80,8 +80,10 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // For recording and playing back the stream of tokens in a macro definition. // -#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif +#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) #define snprintf sprintf_s #endif @@ -96,9 +98,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { // push onto back of stream -void TPpContext::TokenStream::putSubtoken(int subtoken) +void TPpContext::TokenStream::putSubtoken(char subtoken) { - assert((subtoken & ~0xff) == 0); data.push_back(static_cast(subtoken)); } @@ -125,7 +126,8 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken) const char* s; char* str = NULL; - putSubtoken(token); + assert((token & ~0xff) == 0); + putSubtoken(static_cast(token)); switch (token) { case PpAtomIdentifier: @@ -139,6 +141,10 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken) case PpAtomConstUint: case PpAtomConstInt64: case PpAtomConstUint64: +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: +#endif case PpAtomConstFloat: case PpAtomConstDouble: #ifdef AMD_EXTENSIONS @@ -188,6 +194,10 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken case PpAtomConstUint: case PpAtomConstInt64: case PpAtomConstUint64: +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: +#endif len = 0; ch = getSubtoken(); while (ch != 0 && ch != EndOfInput) { @@ -215,6 +225,9 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken ppToken->dval = atof(ppToken->name); break; case PpAtomConstInt: +#ifdef AMD_EXTENSIONS + case PpAtomConstInt16: +#endif if (len > 0 && ppToken->name[0] == '0') { if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) ppToken->ival = (int)strtol(ppToken->name, 0, 16); @@ -224,6 +237,9 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken ppToken->ival = atoi(ppToken->name); break; case PpAtomConstUint: +#ifdef AMD_EXTENSIONS + case PpAtomConstUint16: +#endif if (len > 0 && ppToken->name[0] == '0') { if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) ppToken->ival = (int)strtoul(ppToken->name, 0, 16); diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h index 9695c2fcc..d56df5765 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h @@ -117,6 +117,8 @@ enum EFixedAtoms { PpAtomDecrement, PpAtomIncrement, + PpAtomColonColon, + PpAtomPaste, // Constants @@ -125,11 +127,13 @@ enum EFixedAtoms { PpAtomConstUint, PpAtomConstInt64, PpAtomConstUint64, +#ifdef AMD_EXTENSIONS + PpAtomConstInt16, + PpAtomConstUint16, +#endif PpAtomConstFloat, PpAtomConstDouble, -#ifdef AMD_EXTENSIONS PpAtomConstFloat16, -#endif PpAtomConstString, // Identifiers diff --git a/src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.h b/src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.h index 3412c85dc..8521ad7d6 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.h +++ b/src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.h @@ -37,6 +37,8 @@ // propagate 'noContraction' qualifier. // +#pragma once + #include "../Include/intermediate.h" namespace glslang { diff --git a/src/libraries/glslang/glslang/MachineIndependent/reflection.cpp b/src/libraries/glslang/glslang/MachineIndependent/reflection.cpp index 688827da9..f0566c648 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/reflection.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/reflection.cpp @@ -696,14 +696,40 @@ void TReflectionTraverser::visitSymbol(TIntermSymbol* base) // Implement TReflection methods. // +// Track any required attribute reflection, such as compute shader numthreads. +// +void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediate& intermediate) +{ + if (stage == EShLangCompute) { + // Remember thread dimensions + for (int dim=0; dim<3; ++dim) + localSize[dim] = intermediate.getLocalSize(dim); + } +} + +// build counter block index associations for buffers +void TReflection::buildCounterIndices() +{ + // search for ones that have counters + for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { + const TString counterName(indexToUniformBlock[i].name + "@count"); + const int index = getIndex(counterName); + + if (index >= 0) + indexToUniformBlock[i].counterIndex = index; + } +} + // Merge live symbols from 'intermediate' into the existing reflection database. // // Returns false if the input is too malformed to do this. -bool TReflection::addStage(EShLanguage, const TIntermediate& intermediate) +bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate) { if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) return false; + buildAttributeReflection(stage, intermediate); + TReflectionTraverser it(intermediate, *this); // put the entry point on the list of functions to process @@ -716,6 +742,8 @@ bool TReflection::addStage(EShLanguage, const TIntermediate& intermediate) function->traverse(&it); } + buildCounterIndices(); + return true; } @@ -736,6 +764,16 @@ void TReflection::dump() indexToAttribute[i].dump(); printf("\n"); + if (getLocalSize(0) > 1) { + static const char* axis[] = { "X", "Y", "Z" }; + + for (int dim=0; dim<3; ++dim) + if (getLocalSize(dim) > 1) + printf("Local size %s: %d\n", axis[dim], getLocalSize(dim)); + + printf("\n"); + } + // printf("Live names\n"); // for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it) // printf("%s: %d\n", it->first.c_str(), it->second); diff --git a/src/libraries/glslang/glslang/MachineIndependent/reflection.h b/src/libraries/glslang/glslang/MachineIndependent/reflection.h index bae131cfd..7a1cc8ed8 100755 --- a/src/libraries/glslang/glslang/MachineIndependent/reflection.h +++ b/src/libraries/glslang/glslang/MachineIndependent/reflection.h @@ -57,11 +57,16 @@ class TObjectReflection { public: TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : name(pName), offset(pOffset), - glDefineType(pGLDefineType), size(pSize), index(pIndex), type(pType.clone()) { } + glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()) { } void dump() const { - printf("%s: offset %d, type %x, size %d, index %d, binding %d\n", + printf("%s: offset %d, type %x, size %d, index %d, binding %d", name.c_str(), offset, glDefineType, size, index, getBinding() ); + + if (counterIndex != -1) + printf(", counter %d", counterIndex); + + printf("\n"); } const TType* const getType() const { return type; } @@ -71,6 +76,7 @@ public: int glDefineType; int size; // data size in bytes for a block, array size for a (non-block) object that's an array int index; + int counterIndex; static TObjectReflection badReflection() { return TObjectReflection(); } @@ -89,7 +95,12 @@ protected: // The full reflection database class TReflection { public: - TReflection() : badReflection(TObjectReflection::badReflection()) { } + TReflection() : badReflection(TObjectReflection::badReflection()) + { + for (int dim=0; dim<3; ++dim) + localSize[dim] = 0; + } + virtual ~TReflection() {} // grow the reflection stage by stage @@ -135,11 +146,20 @@ public: return it->second; } + // see getIndex(const char*) + int getIndex(const TString& name) const { return getIndex(name.c_str()); } + + // Thread local size + unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; } + void dump(); protected: friend class glslang::TReflectionTraverser; + void buildCounterIndices(); + void buildAttributeReflection(EShLanguage, const TIntermediate&); + // Need a TString hash: typedef std::unordered_map TNameToIndex; typedef std::map TNameToIndex; typedef std::vector TMapIndexToReflection; @@ -149,6 +169,8 @@ protected: TMapIndexToReflection indexToUniform; TMapIndexToReflection indexToUniformBlock; TMapIndexToReflection indexToAttribute; + + unsigned int localSize[3]; }; } // end namespace glslang diff --git a/src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp b/src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp index 4f8098b75..24b77e162 100755 --- a/src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -184,20 +184,6 @@ void ReleaseGlobalLock() pthread_mutex_unlock(&gMutex); } -// TODO: non-windows: if we need these on linux, flesh them out -void* OS_CreateThread(TThreadEntrypoint /*entry*/) -{ - return 0; -} - -void OS_WaitForAllThreads(void* /*threads*/, int /*numThreads*/) -{ -} - -void OS_Sleep(int /*milliseconds*/) -{ -} - void OS_DumpMemoryCounters() { } diff --git a/src/libraries/glslang/glslang/OSDependent/Windows/ossource.cpp b/src/libraries/glslang/glslang/OSDependent/Windows/ossource.cpp index 73ae0ca71..870840c56 100755 --- a/src/libraries/glslang/glslang/OSDependent/Windows/ossource.cpp +++ b/src/libraries/glslang/glslang/OSDependent/Windows/ossource.cpp @@ -131,21 +131,6 @@ unsigned int __stdcall EnterGenericThread (void* entry) return ((TThreadEntrypoint)entry)(0); } -void* OS_CreateThread(TThreadEntrypoint entry) -{ - return (void*)_beginthreadex(0, 0, EnterGenericThread, (void*)entry, 0, 0); -} - -void OS_WaitForAllThreads(void* threads, int numThreads) -{ - WaitForMultipleObjects(numThreads, (HANDLE*)threads, true, INFINITE); -} - -void OS_Sleep(int milliseconds) -{ - Sleep(milliseconds); -} - //#define DUMP_COUNTERS void OS_DumpMemoryCounters() diff --git a/src/libraries/glslang/glslang/OSDependent/osinclude.h b/src/libraries/glslang/glslang/OSDependent/osinclude.h index e8325268e..218abe4f2 100755 --- a/src/libraries/glslang/glslang/OSDependent/osinclude.h +++ b/src/libraries/glslang/glslang/OSDependent/osinclude.h @@ -53,11 +53,8 @@ void GetGlobalLock(); void ReleaseGlobalLock(); 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/src/libraries/glslang/glslang/Public/ShaderLang.h b/src/libraries/glslang/glslang/Public/ShaderLang.h index d2f4e1b5c..b2a4deacd 100755 --- a/src/libraries/glslang/glslang/Public/ShaderLang.h +++ b/src/libraries/glslang/glslang/Public/ShaderLang.h @@ -40,6 +40,7 @@ #include "../MachineIndependent/Versions.h" #include +#include #ifdef _WIN32 #define C_DECL __cdecl @@ -133,6 +134,14 @@ typedef enum { EShOptFull, // Optimizations that will take more time } EShOptimizationLevel; +// +// Texture and Sampler transformation mode. +// +typedef enum { + EShTexSampTransKeep, // keep textures and samplers as is (default) + EShTexSampTransUpgradeTextureRemoveSampler, // change texture w/o embeded sampler into sampled texture and throw away all samplers +} EShTextureSamplerTransformMode; + // // Message choices for what errors and warnings are given. // @@ -147,6 +156,8 @@ enum EShMessages { EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions + EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules + EShMsgDebugInfo = (1 << 10), // save debug information }; // @@ -203,14 +214,6 @@ SH_IMPORT_EXPORT int ShCompile( EShMessages messages = EShMsgDefault // warnings and errors ); -SH_IMPORT_EXPORT int ShLink( - const ShHandle, // linker object - const ShHandle h[], // compiler objects to link together - const int numHandles, - ShHandle uniformMap, // updated with new uniforms - short int** uniformsAccessed, // returned with indexes of uniforms accessed - int* numUniformsAccessed); - SH_IMPORT_EXPORT int ShLinkExt( const ShHandle, // linker object const ShHandle h[], // compiler objects to link together @@ -310,9 +313,16 @@ public: void setShiftTextureBinding(unsigned int base); void setShiftImageBinding(unsigned int base); void setShiftUboBinding(unsigned int base); + void setShiftUavBinding(unsigned int base); + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); + void setResourceSetBinding(const std::vector& base); void setAutoMapBindings(bool map); + void setAutoMapLocations(bool map); + void setHlslIoMapping(bool hlslIoMap); void setFlattenUniformArrays(bool flatten); void setNoStorageFormat(bool useUnknownFormat); + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); // Interface to #include handlers. // @@ -397,6 +407,9 @@ public: virtual void releaseInclude(IncludeResult*) override { } }; + bool parse(const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages, Includer&); + bool parse(const TBuiltInResource* res, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages messages) { @@ -404,12 +417,18 @@ public: return parse(res, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, forwardCompatible, messages, includer); } - bool parse(const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, - bool forwardCompatible, EShMessages, Includer&); - // Equivalent to parse() without a default profile and without forcing defaults. - // Provided for backwards compatibility. - bool parse(const TBuiltInResource*, int defaultVersion, bool forwardCompatible, EShMessages); + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages); + } + + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages, + Includer& includer) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages, includer); + } + bool preprocess(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages message, std::string* outputString, @@ -459,10 +478,19 @@ class TIoMapper; // and resolveSet are invoked to resolve the binding and descriptor // set index respectively. // Invocations happen in a particular order: -// 1) var with binding and set already defined -// 2) var with binding but no set defined -// 3) var with set but no binding defined -// 4) var with no binding and no set defined +// 1) all shader inputs +// 2) all shader outputs +// 3) all uniforms with binding and set already defined +// 4) all uniforms with binding but no set defined +// 5) all uniforms with set but no binding defined +// 6) all uniforms with no binding and no set defined +// +// mapIO will use this resolver in two phases. The first +// phase is a notification phase, calling the corresponging +// notifiy callbacks, this phase ends with a call to endNotifications. +// Phase two starts directly after the call to endNotifications +// and calls all other callbacks to validate and to get the +// bindings, sets, locations, component and color indices. // // NOTE: that still limit checks are applied to bindings and sets // and may result in an error. @@ -471,15 +499,33 @@ class TIoMapResolver public: virtual ~TIoMapResolver() {} - // Should return true if the resulting/current binding would be ok. + // Should return true if the resulting/current binding would be okay. // Basic idea is to do aliasing binding checks with this. virtual bool validateBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; // Should return a value >= 0 if the current binding should be overridden. // Return -1 if the current binding (including no binding) should be kept. virtual int resolveBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; - // Should return a value >= 0 if the current set should be overriden. + // Should return a value >= 0 if the current set should be overridden. // Return -1 if the current set (including no set) should be kept. virtual int resolveSet(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Should return true if the resulting/current setup would be okay. + // Basic idea is to do aliasing checks and reject invalid semantic names. + virtual bool validateInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveInOutLocation(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Should return a value >= 0 if the current component index should be overridden. + // Return -1 if the current component index (including no index) should be kept. + virtual int resolveInOutComponent(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Should return a value >= 0 if the current color index should be overridden. + // Return -1 if the current color index (including no index) should be kept. + virtual int resolveInOutIndex(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Notification of a uniform variable + virtual void notifyBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Notification of a in or out variable + virtual void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0; + // Called by mapIO when it has finished the notify pass + virtual void endNotifications() = 0; }; // Make one TProgram per set of shaders that will get linked together. Add all @@ -510,10 +556,12 @@ public: int getUniformBlockSize(int blockIndex) const; // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) int getUniformIndex(const char* name) const; // can be used for glGetUniformIndices() int getUniformBlockIndex(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) + int getUniformBlockCounterIndex(int index) const; // returns block index of associated counter. int getUniformType(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) int getUniformBufferOffset(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) int getUniformArraySize(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) int getNumLiveAttributes() const; // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) + unsigned getLocalSize(int dim) const; // return dim'th local size const char *getAttributeName(int index) const; // can be used for glGetActiveAttrib() int getAttributeType(int index) const; // can be used for glGetActiveAttrib() const TType* getUniformTType(int index) const; // returns a TType*