Implement support for GL_KHR_cooperative_matrix extension

This commit is contained in:
Boris Zanin 2023-03-16 13:01:01 +01:00 committed by arcady-lunarg
parent 91a97b4c69
commit 808c7ed17c
40 changed files with 8227 additions and 5733 deletions

View file

@ -66,6 +66,7 @@ enum TBasicType {
EbtReference,
EbtRayQuery,
EbtHitObjectNV,
EbtCoopmat,
#ifndef GLSLANG_WEB
// SPIR-V type defined by spirv_type
EbtSpirvType,

View file

@ -1541,6 +1541,19 @@ struct TShaderQualifiers {
}
};
class TTypeParameters {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
TTypeParameters() : basicType(EbtVoid), arraySizes(nullptr) {}
TBasicType basicType;
TArraySizes *arraySizes;
bool operator==(const TTypeParameters& rhs) const { return basicType == rhs.basicType && *arraySizes == *rhs.arraySizes; }
bool operator!=(const TTypeParameters& rhs) const { return basicType != rhs.basicType || *arraySizes != *rhs.arraySizes; }
};
//
// TPublicType is just temporarily used while parsing and not quite the same
// information kept per node in TType. Due to the bison stack, it can't have
@ -1555,14 +1568,15 @@ public:
TSampler sampler;
TQualifier qualifier;
TShaderQualifiers shaderQualifiers;
int vectorSize : 4;
int matrixCols : 4;
int matrixRows : 4;
bool coopmat : 1;
int vectorSize : 4;
int matrixCols : 4;
int matrixRows : 4;
bool coopmatNV : 1;
bool coopmatKHR : 1;
TArraySizes* arraySizes;
const TType* userDef;
TSourceLoc loc;
TArraySizes* typeParameters;
TTypeParameters* typeParameters;
#ifndef GLSLANG_WEB
// SPIR-V type defined by spirv_type directive
TSpirvType* spirvType;
@ -1570,8 +1584,12 @@ public:
#ifdef GLSLANG_WEB
bool isCoopmat() const { return false; }
bool isCoopmatNV() const { return false; }
bool isCoopmatKHR() const { return false; }
#else
bool isCoopmat() const { return coopmat; }
bool isCoopmat() const { return coopmatNV || coopmatKHR; }
bool isCoopmatNV() const { return coopmatNV; }
bool isCoopmatKHR() const { return coopmatKHR; }
#endif
void initType(const TSourceLoc& l)
@ -1584,7 +1602,8 @@ public:
userDef = nullptr;
loc = l;
typeParameters = nullptr;
coopmat = false;
coopmatNV = false;
coopmatKHR = false;
#ifndef GLSLANG_WEB
spirvType = nullptr;
#endif
@ -1645,7 +1664,7 @@ public:
// for "empty" type (no args) or simple scalar/vector/matrix
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1659,7 +1678,7 @@ public:
// for explicit precision qualifier
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1675,7 +1694,7 @@ public:
// for turning a TPublicType into a TType, using a shallow copy
explicit TType(const TPublicType& p) :
basicType(p.basicType),
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmat(p.coopmat),
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(-1),
arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters)
#ifndef GLSLANG_WEB
, spirvType(p.spirvType)
@ -1695,23 +1714,37 @@ public:
}
typeName = NewPoolTString(p.userDef->getTypeName().c_str());
}
if (p.isCoopmat() && p.typeParameters && p.typeParameters->getNumDims() > 0) {
int numBits = p.typeParameters->getDimSize(0);
if (p.isCoopmatNV() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) {
int numBits = p.typeParameters->arraySizes->getDimSize(0);
if (p.basicType == EbtFloat && numBits == 16) {
basicType = EbtFloat16;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtUint && numBits == 8) {
basicType = EbtUint8;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtUint && numBits == 16) {
basicType = EbtUint16;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtInt && numBits == 8) {
basicType = EbtInt8;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtInt && numBits == 16) {
basicType = EbtInt16;
qualifier.precision = EpqNone;
}
}
if (p.isCoopmatKHR() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) {
basicType = p.typeParameters->basicType;
if (p.typeParameters->arraySizes->getNumDims() == 4) {
coopmatKHRuse = p.typeParameters->arraySizes->getDimSize(3);
p.typeParameters->arraySizes->removeLastSize();
}
}
}
// for construction of sampler types
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
sampler(sampler), typeParameters(nullptr)
#ifndef GLSLANG_WEB
@ -1758,14 +1791,16 @@ public:
vectorSize = 1;
vector1 = false;
} else if (isCoopMat()) {
coopmat = false;
coopmatNV = false;
coopmatKHR = false;
coopmatKHRuse = -1;
typeParameters = nullptr;
}
}
}
// for making structures, ...
TType(TTypeList* userDef, const TString& n) :
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1777,7 +1812,7 @@ public:
}
// For interface blocks
TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1788,7 +1823,7 @@ public:
}
// for block reference (first parameter must be EbtReference)
explicit TType(TBasicType t, const TType &p, const TString& n) :
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1827,7 +1862,9 @@ public:
#ifndef GLSLANG_WEB
spirvType = copyOf.spirvType;
#endif
coopmat = copyOf.isCoopMat();
coopmatNV = copyOf.isCoopMatNV();
coopmatKHR = copyOf.isCoopMatKHR();
coopmatKHRuse = copyOf.coopmatKHRuse;
}
// Make complete copy of the whole type graph rooted at 'copyOf'.
@ -1912,8 +1949,8 @@ public:
virtual const TArraySizes* getArraySizes() const { return arraySizes; }
virtual TArraySizes* getArraySizes() { return arraySizes; }
virtual TType* getReferentType() const { return referentType; }
virtual const TArraySizes* getTypeParameters() const { return typeParameters; }
virtual TArraySizes* getTypeParameters() { return typeParameters; }
virtual const TTypeParameters* getTypeParameters() const { return typeParameters; }
virtual TTypeParameters* getTypeParameters() { return typeParameters; }
virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); }
virtual bool isScalarOrVec1() const { return isScalar() || vector1; }
@ -1968,14 +2005,19 @@ public:
#ifdef GLSLANG_WEB
bool isAtomic() const { return false; }
bool isCoopMat() const { return false; }
bool isCoopMatNV() const { return false; }
bool isCoopMatKHR() const { return false; }
bool isReference() const { return false; }
bool isSpirvType() const { return false; }
#else
bool isAtomic() const { return basicType == EbtAtomicUint; }
bool isCoopMat() const { return coopmat; }
bool isCoopMat() const { return coopmatNV || coopmatKHR; }
bool isCoopMatNV() const { return coopmatNV; }
bool isCoopMatKHR() const { return coopmatKHR; }
bool isReference() const { return getBasicType() == EbtReference; }
bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
#endif
int getCoopMatKHRuse() const { return coopmatKHRuse; }
// return true if this type contains any subtype which satisfies the given predicate.
template <typename P>
@ -2092,7 +2134,7 @@ public:
}
bool containsCoopMat() const
{
return contains([](const TType* t) { return t->coopmat; } );
return contains([](const TType* t) { return t->coopmatNV || t->coopmatKHR; } );
}
bool containsReference() const
{
@ -2174,43 +2216,12 @@ public:
}
}
void updateTypeParameters(const TType& type)
{
// For when we may already be sharing existing array descriptors,
// keeping the pointers the same, just updating the contents.
assert(typeParameters != nullptr);
assert(type.typeParameters != nullptr);
*typeParameters = *type.typeParameters;
}
void copyTypeParameters(const TArraySizes& s)
void copyTypeParameters(const TTypeParameters& s)
{
// For setting a fresh new set of type parameters, not yet worrying about sharing.
typeParameters = new TArraySizes;
typeParameters = new TTypeParameters;
*typeParameters = s;
}
void transferTypeParameters(TArraySizes* s)
{
// For setting an already allocated set of sizes that this type can use
// (no copy made).
typeParameters = s;
}
void clearTypeParameters()
{
typeParameters = nullptr;
}
// Add inner array sizes, to any existing sizes, via copy; the
// sizes passed in can still be reused for other purposes.
void copyTypeParametersInnerSizes(const TArraySizes* s)
{
if (s != nullptr) {
if (typeParameters == nullptr)
copyTypeParameters(*s);
else
typeParameters->addInnerSizes(*s);
}
}
const char* getBasicString() const
{
@ -2243,6 +2254,7 @@ public:
case EbtReference: return "reference";
case EbtString: return "string";
case EbtSpirvType: return "spirv_type";
case EbtCoopmat: return "coopmat";
#endif
default: return "unknown type";
}
@ -2553,12 +2565,21 @@ public:
}
}
if (isParameterized()) {
if (isCoopMatKHR()) {
appendStr(" ");
appendStr("coopmat");
}
appendStr("<");
for (int i = 0; i < (int)typeParameters->getNumDims(); ++i) {
appendInt(typeParameters->getDimSize(i));
if (i != (int)typeParameters->getNumDims() - 1)
for (int i = 0; i < (int)typeParameters->arraySizes->getNumDims(); ++i) {
appendInt(typeParameters->arraySizes->getDimSize(i));
if (i != (int)typeParameters->arraySizes->getNumDims() - 1)
appendStr(", ");
}
if (coopmatKHRuse != -1) {
appendStr(", ");
appendInt(coopmatKHRuse);
}
appendStr(">");
}
if (getPrecision && qualifier.precision != EpqNone) {
@ -2835,7 +2856,8 @@ public:
matrixCols == right.matrixCols &&
matrixRows == right.matrixRows &&
vector1 == right.vector1 &&
isCoopMat() == right.isCoopMat() &&
isCoopMatNV() == right.isCoopMatNV() &&
isCoopMatKHR() == right.isCoopMatKHR() &&
sameStructType(right, lpidx, rpidx) &&
sameReferenceType(right);
}
@ -2844,29 +2866,70 @@ public:
// an OK function parameter
bool coopMatParameterOK(const TType& right) const
{
return isCoopMat() && right.isCoopMat() && (getBasicType() == right.getBasicType()) &&
typeParameters == nullptr && right.typeParameters != nullptr;
if (isCoopMatNV()) {
return right.isCoopMatNV() && (getBasicType() == right.getBasicType()) && typeParameters == nullptr &&
right.typeParameters != nullptr;
}
if (isCoopMatKHR() && right.isCoopMatKHR()) {
return ((getBasicType() == right.getBasicType()) || (getBasicType() == EbtCoopmat) ||
(right.getBasicType() == EbtCoopmat)) &&
typeParameters == nullptr && right.typeParameters != nullptr;
}
return false;
}
bool sameCoopMatBaseType(const TType &right) const {
bool rv = coopmat && right.coopmat;
if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16)
rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8;
else
rv = false;
bool rv = false;
if (isCoopMatNV()) {
rv = isCoopMatNV() && right.isCoopMatNV();
if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16)
rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16;
else
rv = false;
} else if (isCoopMatKHR() && right.isCoopMatKHR()) {
if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16)
rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16 || right.getBasicType() == EbtCoopmat;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16 || right.getBasicType() == EbtCoopmat;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16 || right.getBasicType() == EbtCoopmat;
else
rv = false;
}
return rv;
}
bool sameCoopMatUse(const TType &right) const {
return coopmatKHRuse == right.coopmatKHRuse;
}
bool sameCoopMatShapeAndUse(const TType &right) const
{
if (!isCoopMat() || !right.isCoopMat() || isCoopMatKHR() != right.isCoopMatKHR())
return false;
if (coopmatKHRuse != right.coopmatKHRuse)
return false;
// Skip bit width type parameter (first array size) for coopmatNV
int firstArrayDimToCompare = isCoopMatNV() ? 1 : 0;
for (int i = firstArrayDimToCompare; i < typeParameters->arraySizes->getNumDims(); ++i) {
if (typeParameters->arraySizes->getDimSize(i) != right.typeParameters->arraySizes->getDimSize(i))
return false;
}
return true;
}
// See if two types match in all ways (just the actual type, not qualification)
bool operator==(const TType& right) const
{
#ifndef GLSLANG_WEB
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameSpirvType(right);
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameCoopMatUse(right) && sameSpirvType(right);
#else
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right);
#endif
@ -2923,8 +2986,10 @@ protected:
}
if (copyOf.typeParameters) {
typeParameters = new TArraySizes;
*typeParameters = *copyOf.typeParameters;
typeParameters = new TTypeParameters;
typeParameters->arraySizes = new TArraySizes;
*typeParameters->arraySizes = *copyOf.typeParameters->arraySizes;
typeParameters->basicType = copyOf.basicType;
}
if (copyOf.isStruct() && copyOf.structure) {
@ -2962,7 +3027,9 @@ protected:
// functionality is added.
// HLSL does have a 1-component vectors, so this will be true to disambiguate
// from a scalar.
bool coopmat : 1;
bool coopmatNV : 1;
bool coopmatKHR : 1;
int coopmatKHRuse : 4; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator)
TQualifier qualifier;
TArraySizes* arraySizes; // nullptr unless an array; can be shared across types
@ -2975,7 +3042,7 @@ protected:
TString *fieldName; // for structure field names
TString *typeName; // for structure type name
TSampler sampler;
TArraySizes* typeParameters;// nullptr unless a parameterized type; can be shared across types
TTypeParameters *typeParameters;// nullptr unless a parameterized type; can be shared across types
#ifndef GLSLANG_WEB
TSpirvType* spirvType; // SPIR-V type defined by spirv_type directive
#endif

View file

@ -147,6 +147,15 @@ struct TSmallArrayVector {
sizes->erase(sizes->begin());
}
void pop_back()
{
assert(sizes != nullptr && sizes->size() > 0);
if (sizes->size() == 1)
dealloc();
else
sizes->resize(sizes->size() - 1);
}
// 'this' should currently not be holding anything, and copyNonFront
// will make it hold a copy of all but the first element of rhs.
// (This would be useful for making a type that is dereferenced by
@ -306,6 +315,7 @@ struct TArraySizes {
bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; }
void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; }
void dereference() { sizes.pop_front(); }
void removeLastSize() { sizes.pop_back(); }
void copyDereferenced(const TArraySizes& rhs)
{
assert(sizes.size() == 0);

View file

@ -629,6 +629,9 @@ enum TOperator {
EOpCooperativeMatrixLoad,
EOpCooperativeMatrixStore,
EOpCooperativeMatrixMulAdd,
EOpCooperativeMatrixLoadNV,
EOpCooperativeMatrixStoreNV,
EOpCooperativeMatrixMulAddNV,
EOpBeginInvocationInterlock, // Fragment only
EOpEndInvocationInterlock, // Fragment only
@ -766,7 +769,8 @@ enum TOperator {
EOpConstructTextureSampler,
EOpConstructNonuniform, // expected to be transformed away, not present in final AST
EOpConstructReference,
EOpConstructCooperativeMatrix,
EOpConstructCooperativeMatrixNV,
EOpConstructCooperativeMatrixKHR,
EOpConstructAccStruct,
EOpConstructGuardEnd,

View file

@ -4397,6 +4397,94 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"icoopmatNV coopMatMulAddNV(icoopmatNV A, icoopmatNV B, icoopmatNV C);\n"
"ucoopmatNV coopMatMulAddNV(ucoopmatNV A, ucoopmatNV B, ucoopmatNV C);\n"
);
std::string cooperativeMatrixFuncs =
"void coopMatLoad(out coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C);\n"
"coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C, int matrixOperands);\n";
commonBuiltins.append(cooperativeMatrixFuncs.c_str());
commonBuiltins.append(
"const int gl_MatrixUseA = 0;\n"
"const int gl_MatrixUseB = 1;\n"
"const int gl_MatrixUseAccumulator = 2;\n"
"const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n"
"const int gl_CooperativeMatrixLayoutRowMajor = 0;\n"
"const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n"
"\n"
);
}
//============================================================================
@ -8897,6 +8985,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("coopMatMulAddNV", 2, coopExt);
}
{
symbolTable.setFunctionExtensions("coopMatLoad", 1, &E_GL_KHR_cooperative_matrix);
symbolTable.setFunctionExtensions("coopMatStore", 1, &E_GL_KHR_cooperative_matrix);
symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix);
}
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives);
symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives);
@ -10005,9 +10099,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse);
symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse);
}
symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoad);
symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStore);
symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAdd);
symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoadNV);
symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStoreNV);
symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAddNV);
symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad);
symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore);
symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd);
break;
case EShLangRayGen:

View file

@ -1049,6 +1049,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
if (type.isArray() || node->getType().isArray())
return nullptr;
// Reject implicit conversions to cooperative matrix types
if (node->getType().isCoopMat() &&
op != EOpConstructCooperativeMatrixNV &&
op != EOpConstructCooperativeMatrixKHR)
return nullptr;
// Note: callers are responsible for other aspects of shape,
// like vector and matrix sizes.
@ -1117,7 +1123,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
case EOpSequence:
case EOpConstructStruct:
case EOpConstructCooperativeMatrix:
case EOpConstructCooperativeMatrixNV:
case EOpConstructCooperativeMatrixKHR:
if (type.isReference() || node->getType().isReference()) {
// types must match to assign a reference
@ -2008,8 +2015,11 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
if (type.getQualifier().isNonUniform())
return EOpConstructNonuniform;
if (type.isCoopMat())
return EOpConstructCooperativeMatrix;
if (type.isCoopMatNV())
return EOpConstructCooperativeMatrixNV;
if (type.isCoopMatKHR())
return EOpConstructCooperativeMatrixKHR;
switch (type.getBasicType()) {
case EbtStruct:
@ -3526,20 +3536,28 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
}
if (left->getType().isCoopMat() || right->getType().isCoopMat()) {
// Operations on two cooperative matrices must have identical types
if (left->getType().isCoopMat() && right->getType().isCoopMat() &&
*left->getType().getTypeParameters() != *right->getType().getTypeParameters()) {
left->getType() != right->getType()) {
return false;
}
switch (op) {
case EOpMul:
case EOpMulAssign:
if (left->getType().isCoopMat() && right->getType().isCoopMat()) {
// Mul not supported in NV_cooperative_matrix
if (left->getType().isCoopMatNV() && right->getType().isCoopMatNV()) {
return false;
}
if (op == EOpMulAssign && right->getType().isCoopMat()) {
// NV_cooperative_matrix supports MulAssign is for mat*=scalar only.
// KHR_cooperative_matrix supports it for mat*=mat as well.
if (op == EOpMulAssign && right->getType().isCoopMatNV()) {
return false;
}
node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar);
// Use MatrixTimesScalar if either operand is not a matrix. Otherwise use Mul.
if (!left->getType().isCoopMat() || !right->getType().isCoopMat()) {
node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar);
}
// In case of scalar*matrix, take the result type from the matrix.
if (right->getType().isCoopMat()) {
node.setType(right->getType());
}

View file

@ -1501,7 +1501,8 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
if (result->getAsTyped()->getType().isCoopMat() &&
!result->getAsTyped()->getType().isParameterized()) {
assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd);
assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd ||
fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV);
result->setType(result->getAsAggregate()->getSequence()[2]->getAsTyped()->getType());
}
@ -3642,6 +3643,12 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
}
TIntermTyped* typed = node->getAsTyped();
if (type.isCoopMat() && typed->getType().isCoopMat() &&
!type.sameCoopMatShapeAndUse(typed->getType())) {
error(loc, "Cooperative matrix type parameters mismatch", constructorString.c_str(), "");
return true;
}
if (typed == nullptr) {
error(loc, "constructor argument does not have a type", constructorString.c_str(), "");
return true;
@ -4302,7 +4309,7 @@ TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType)
return defaultPrecision[publicType.basicType];
}
void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier)
void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool isCoopMat)
{
// Built-in symbols are allowed some ambiguous precisions, to be pinned down
// later by context.
@ -4314,6 +4321,9 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
error(loc, "atomic counters can only be highp", "atomic_uint", "");
#endif
if (isCoopMat)
return;
if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) {
if (qualifier.precision == EpqNone) {
if (relaxedErrors())
@ -4358,7 +4368,8 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas
//
// Do size checking for an array type's size.
//
void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair, const char *sizeType)
void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair,
const char* sizeType, const bool allowZero)
{
bool isConst = false;
sizePair.node = nullptr;
@ -4378,9 +4389,8 @@ void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TA
TIntermSymbol* symbol = expr->getAsSymbolNode();
if (symbol && symbol->getConstArray().size() > 0)
size = symbol->getConstArray()[0].getIConst();
} else if (expr->getAsUnaryNode() &&
expr->getAsUnaryNode()->getOp() == glslang::EOpArrayLength &&
expr->getAsUnaryNode()->getOperand()->getType().isCoopMat()) {
} else if (expr->getAsUnaryNode() && expr->getAsUnaryNode()->getOp() == glslang::EOpArrayLength &&
expr->getAsUnaryNode()->getOperand()->getType().isCoopMatNV()) {
isConst = true;
size = 1;
sizePair.node = expr->getAsUnaryNode();
@ -4394,9 +4404,16 @@ void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TA
return;
}
if (size <= 0) {
error(loc, sizeType, "", "must be a positive integer");
return;
if (allowZero) {
if (size < 0) {
error(loc, sizeType, "", "must be a non-negative integer");
return;
}
} else {
if (size <= 0) {
error(loc, sizeType, "", "must be a positive integer");
return;
}
}
}
@ -7371,6 +7388,43 @@ void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType
#endif
}
void TParseContext::coopMatTypeParametersCheck(const TSourceLoc& loc, const TPublicType& publicType)
{
#ifndef GLSLANG_WEB
if (parsingBuiltins)
return;
if (publicType.isCoopmatKHR()) {
if (publicType.typeParameters == nullptr) {
error(loc, "coopmat missing type parameters", "", "");
return;
}
switch (publicType.typeParameters->basicType) {
case EbtFloat:
case EbtFloat16:
case EbtInt:
case EbtInt8:
case EbtInt16:
case EbtUint:
case EbtUint8:
case EbtUint16:
break;
default:
error(loc, "coopmat invalid basic type", TType::getBasicString(publicType.typeParameters->basicType), "");
break;
}
if (publicType.typeParameters->arraySizes->getNumDims() != 4) {
error(loc, "coopmat incorrect number of type parameters", "", "");
return;
}
int use = publicType.typeParameters->arraySizes->getDimSize(3);
if (use < 0 || use > 2) {
error(loc, "coopmat invalid matrix Use", "", "");
return;
}
}
#endif
}
bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType&,
TArraySizes*, TIntermTyped* initializer, TType& type)
{
@ -7486,29 +7540,43 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
}
if (type.isCoopMat()) {
if (type.isCoopMatKHR()) {
intermediate.setUseVulkanMemoryModel();
intermediate.setUseStorageBuffer();
if (!publicType.typeParameters || publicType.typeParameters->getNumDims() != 4) {
if (!publicType.typeParameters || !publicType.typeParameters->arraySizes ||
publicType.typeParameters->arraySizes->getNumDims() != 3) {
error(loc, "unexpected number type parameters", identifier.c_str(), "");
}
if (publicType.typeParameters) {
if (!isTypeFloat(publicType.typeParameters->basicType) && !isTypeInt(publicType.typeParameters->basicType)) {
error(loc, "expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type", identifier.c_str(), "");
}
}
}
else if (type.isCoopMatNV()) {
intermediate.setUseVulkanMemoryModel();
intermediate.setUseStorageBuffer();
if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() != 4) {
error(loc, "expected four type parameters", identifier.c_str(), "");
}
if (publicType.typeParameters) {
if (isTypeFloat(publicType.basicType) &&
publicType.typeParameters->getDimSize(0) != 16 &&
publicType.typeParameters->getDimSize(0) != 32 &&
publicType.typeParameters->getDimSize(0) != 64) {
publicType.typeParameters->arraySizes->getDimSize(0) != 16 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 32 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 64) {
error(loc, "expected 16, 32, or 64 bits for first type parameter", identifier.c_str(), "");
}
if (isTypeInt(publicType.basicType) &&
publicType.typeParameters->getDimSize(0) != 8 &&
publicType.typeParameters->getDimSize(0) != 32) {
error(loc, "expected 8 or 32 bits for first type parameter", identifier.c_str(), "");
publicType.typeParameters->arraySizes->getDimSize(0) != 8 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 16 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 32) {
error(loc, "expected 8, 16, or 32 bits for first type parameter", identifier.c_str(), "");
}
}
} else {
if (publicType.typeParameters && publicType.typeParameters->getNumDims() != 0) {
if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) {
error(loc, "unexpected type parameters", identifier.c_str(), "");
}
}
@ -8336,14 +8404,18 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
return nullptr;
}
case EOpConstructCooperativeMatrix:
case EOpConstructCooperativeMatrixNV:
case EOpConstructCooperativeMatrixKHR:
if (node->getType() == type) {
return node;
}
if (!node->getType().isCoopMat()) {
if (type.getBasicType() != node->getType().getBasicType()) {
node = intermediate.addConversion(type.getBasicType(), node);
if (node == nullptr)
return nullptr;
}
node = intermediate.setAggregateOperator(node, EOpConstructCooperativeMatrix, type, node->getLoc());
node = intermediate.setAggregateOperator(node, op, type, node->getLoc());
} else {
TOperator op = EOpNull;
switch (type.getBasicType()) {
@ -8356,6 +8428,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToInt; break;
case EbtUint8: op = EOpConvUint8ToInt; break;
case EbtInt8: op = EOpConvInt8ToInt; break;
case EbtUint16: op = EOpConvUint16ToInt; break;
case EbtInt16: op = EOpConvInt16ToInt; break;
case EbtUint: op = EOpConvUintToInt; break;
default: assert(0);
}
@ -8366,8 +8440,33 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToUint; break;
case EbtUint8: op = EOpConvUint8ToUint; break;
case EbtInt8: op = EOpConvInt8ToUint; break;
case EbtUint16: op = EOpConvUint16ToUint; break;
case EbtInt16: op = EOpConvInt16ToUint; break;
case EbtInt: op = EOpConvIntToUint; break;
case EbtUint: op = EOpConvUintToInt8; break;
default: assert(0);
}
break;
case EbtInt16:
switch (node->getType().getBasicType()) {
case EbtFloat: op = EOpConvFloatToInt16; break;
case EbtFloat16: op = EOpConvFloat16ToInt16; break;
case EbtUint8: op = EOpConvUint8ToInt16; break;
case EbtInt8: op = EOpConvInt8ToInt16; break;
case EbtUint16: op = EOpConvUint16ToInt16; break;
case EbtInt: op = EOpConvIntToInt16; break;
case EbtUint: op = EOpConvUintToInt16; break;
default: assert(0);
}
break;
case EbtUint16:
switch (node->getType().getBasicType()) {
case EbtFloat: op = EOpConvFloatToUint16; break;
case EbtFloat16: op = EOpConvFloat16ToUint16; break;
case EbtUint8: op = EOpConvUint8ToUint16; break;
case EbtInt8: op = EOpConvInt8ToUint16; break;
case EbtInt16: op = EOpConvInt16ToUint16; break;
case EbtInt: op = EOpConvIntToUint16; break;
case EbtUint: op = EOpConvUintToUint16; break;
default: assert(0);
}
break;
@ -8376,6 +8475,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToInt8; break;
case EbtFloat16: op = EOpConvFloat16ToInt8; break;
case EbtUint8: op = EOpConvUint8ToInt8; break;
case EbtInt16: op = EOpConvInt16ToInt8; break;
case EbtUint16: op = EOpConvUint16ToInt8; break;
case EbtInt: op = EOpConvIntToInt8; break;
case EbtUint: op = EOpConvUintToInt8; break;
default: assert(0);
@ -8386,6 +8487,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToUint8; break;
case EbtFloat16: op = EOpConvFloat16ToUint8; break;
case EbtInt8: op = EOpConvInt8ToUint8; break;
case EbtInt16: op = EOpConvInt16ToUint8; break;
case EbtUint16: op = EOpConvUint16ToUint8; break;
case EbtInt: op = EOpConvIntToUint8; break;
case EbtUint: op = EOpConvUintToUint8; break;
default: assert(0);
@ -8396,6 +8499,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToFloat; break;
case EbtInt8: op = EOpConvInt8ToFloat; break;
case EbtUint8: op = EOpConvUint8ToFloat; break;
case EbtInt16: op = EOpConvInt16ToFloat; break;
case EbtUint16: op = EOpConvUint16ToFloat; break;
case EbtInt: op = EOpConvIntToFloat; break;
case EbtUint: op = EOpConvUintToFloat; break;
default: assert(0);
@ -8406,6 +8511,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToFloat16; break;
case EbtInt8: op = EOpConvInt8ToFloat16; break;
case EbtUint8: op = EOpConvUint8ToFloat16; break;
case EbtInt16: op = EOpConvInt16ToFloat16; break;
case EbtUint16: op = EOpConvUint16ToFloat16; break;
case EbtInt: op = EOpConvIntToFloat16; break;
case EbtUint: op = EOpConvUintToFloat16; break;
default: assert(0);

View file

@ -382,7 +382,7 @@ public:
void globalCheck(const TSourceLoc&, const char* token);
bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&);
bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&);
void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType);
void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType, const bool allowZero = false);
bool arrayQualifierError(const TSourceLoc&, const TQualifier&);
bool arrayError(const TSourceLoc&, const TType&);
void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&);
@ -404,7 +404,7 @@ public:
void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier);
int computeSamplerTypeIndex(TSampler&);
TPrecisionQualifier getDefaultPrecision(TPublicType&);
void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&);
void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool isCoopMat);
void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type);
bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&);
@ -422,6 +422,7 @@ public:
void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop);
void arrayLimitCheck(const TSourceLoc&, const TString&, int size);
void limitCheck(const TSourceLoc&, int value, const char* limit, const char* feature);
void coopMatTypeParametersCheck(const TSourceLoc&, const TPublicType&);
void inductiveLoopBodyCheck(TIntermNode*, long long loopIndexId, TSymbolTable&);
void constantIndexExpressionCheck(TIntermNode*);

View file

@ -770,6 +770,8 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["icoopmatNV"] = ICOOPMATNV;
(*KeywordMap)["ucoopmatNV"] = UCOOPMATNV;
(*KeywordMap)["coopmat"] = COOPMAT;
(*KeywordMap)["hitObjectNV"] = HITOBJECTNV;
(*KeywordMap)["hitObjectAttributeNV"] = HITOBJECTATTRNV;
@ -1781,6 +1783,13 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
case COOPMAT:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix))
return keyword;
return identifierOrType();
case DEMOTE:
if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation))
return keyword;

View file

@ -263,6 +263,8 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable;
extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable;
// #line and #include
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable;
@ -517,6 +519,8 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_KHR_shader_subgroup_clustered 1\n"
"#define GL_KHR_shader_subgroup_quad 1\n"
"#define GL_KHR_cooperative_matrix 1\n"
"#define GL_EXT_shader_image_int64 1\n"
"#define GL_EXT_shader_atomic_int64 1\n"
"#define GL_EXT_shader_realtime_clock 1\n"
@ -1335,7 +1339,7 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil
}
}
void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
void TParseVersions::fcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_NV_cooperative_matrix};
@ -1343,13 +1347,21 @@ void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool b
}
}
void TParseVersions::intcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
void TParseVersions::intcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
}
}
void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_KHR_cooperative_matrix};
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
}
}
#endif // GLSLANG_WEB
// Call for any operation removed because SPIR-V is in use.
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)

View file

@ -174,6 +174,7 @@ const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_sub
const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered";
const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad";
const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics";
const char* const E_GL_KHR_cooperative_matrix = "GL_KHR_cooperative_matrix";
const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64";

View file

@ -129,7 +129,7 @@ using namespace glslang;
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
}
@ -211,6 +211,7 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> ACCSTRUCTEXT
%token <lex> RAYQUERYEXT
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
%token <lex> COOPMAT
%token <lex> HITOBJECTNV HITOBJECTATTRNV
// combined image/sampler
@ -1108,7 +1109,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1120,7 +1121,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
//
// Without name
@ -1129,7 +1130,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1140,7 +1141,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
;
@ -1217,7 +1218,7 @@ fully_specified_type
parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
}
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmat());
}
| type_qualifier type_specifier {
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@ -1234,7 +1235,7 @@ fully_specified_type
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
$2.shaderQualifiers.merge($1.shaderQualifiers);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
$$ = $2;
@ -1716,6 +1717,8 @@ type_specifier
$$ = $1;
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
| type_specifier_nonarray type_parameter_specifier_opt array_specifier {
parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
@ -1723,6 +1726,7 @@ type_specifier
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
$$.arraySizes = $3.arraySizes;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
;
@ -1769,19 +1773,25 @@ type_parameter_specifier
;
type_parameter_specifier_list
: unary_expression {
$$ = new TArraySizes;
: type_specifier {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
$$->basicType = $1.basicType;
}
| unary_expression {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
TArraySize size;
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
| type_parameter_specifier_list COMMA unary_expression {
$$ = $1;
TArraySize size;
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
;
@ -3521,22 +3531,32 @@ GLSLANG_WEB_EXCLUDE_ON
$$.sampler.setSubpass(EbtUint, true);
}
| FCOOPMATNV {
parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| ICOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| UCOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| COOPMAT {
parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtCoopmat;
$$.coopmatNV = false;
$$.coopmatKHR = true;
}
| spirv_type_specifier {
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
@ -3634,7 +3654,7 @@ struct_declaration
$$ = $2;
parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($1);
@ -3658,7 +3678,7 @@ struct_declaration
parseContext.memberQualifierCheck($1);
parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($2);

View file

@ -129,7 +129,7 @@ using namespace glslang;
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
}
@ -211,6 +211,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> ACCSTRUCTEXT
%token <lex> RAYQUERYEXT
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
%token <lex> COOPMAT
%token <lex> HITOBJECTNV HITOBJECTATTRNV
// combined image/sampler
@ -1108,7 +1109,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1120,7 +1121,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
//
// Without name
@ -1129,7 +1130,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1140,7 +1141,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
;
@ -1217,7 +1218,7 @@ fully_specified_type
parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
}
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmat());
}
| type_qualifier type_specifier {
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@ -1234,7 +1235,7 @@ fully_specified_type
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
$2.shaderQualifiers.merge($1.shaderQualifiers);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
$$ = $2;
@ -1716,6 +1717,8 @@ type_specifier
$$ = $1;
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
| type_specifier_nonarray type_parameter_specifier_opt array_specifier {
parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
@ -1723,6 +1726,7 @@ type_specifier
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
$$.arraySizes = $3.arraySizes;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
;
@ -1769,19 +1773,25 @@ type_parameter_specifier
;
type_parameter_specifier_list
: unary_expression {
$$ = new TArraySizes;
: type_specifier {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
$$->basicType = $1.basicType;
}
| unary_expression {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
TArraySize size;
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
| type_parameter_specifier_list COMMA unary_expression {
$$ = $1;
TArraySize size;
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
;
@ -3521,22 +3531,32 @@ type_specifier_nonarray
$$.sampler.setSubpass(EbtUint, true);
}
| FCOOPMATNV {
parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| ICOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| UCOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| COOPMAT {
parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtCoopmat;
$$.coopmatNV = false;
$$.coopmatKHR = true;
}
| spirv_type_specifier {
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
@ -3634,7 +3654,7 @@ struct_declaration
$$ = $2;
parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($1);
@ -3658,7 +3678,7 @@ struct_declaration
parseContext.memberQualifierCheck($1);
parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($2);

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@ -16,7 +16,7 @@
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 <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -217,304 +217,305 @@ extern int yydebug;
FCOOPMATNV = 418, /* FCOOPMATNV */
ICOOPMATNV = 419, /* ICOOPMATNV */
UCOOPMATNV = 420, /* UCOOPMATNV */
HITOBJECTNV = 421, /* HITOBJECTNV */
HITOBJECTATTRNV = 422, /* HITOBJECTATTRNV */
SAMPLERCUBEARRAY = 423, /* SAMPLERCUBEARRAY */
SAMPLERCUBEARRAYSHADOW = 424, /* SAMPLERCUBEARRAYSHADOW */
ISAMPLERCUBEARRAY = 425, /* ISAMPLERCUBEARRAY */
USAMPLERCUBEARRAY = 426, /* USAMPLERCUBEARRAY */
SAMPLER1D = 427, /* SAMPLER1D */
SAMPLER1DARRAY = 428, /* SAMPLER1DARRAY */
SAMPLER1DARRAYSHADOW = 429, /* SAMPLER1DARRAYSHADOW */
ISAMPLER1D = 430, /* ISAMPLER1D */
SAMPLER1DSHADOW = 431, /* SAMPLER1DSHADOW */
SAMPLER2DRECT = 432, /* SAMPLER2DRECT */
SAMPLER2DRECTSHADOW = 433, /* SAMPLER2DRECTSHADOW */
ISAMPLER2DRECT = 434, /* ISAMPLER2DRECT */
USAMPLER2DRECT = 435, /* USAMPLER2DRECT */
SAMPLERBUFFER = 436, /* SAMPLERBUFFER */
ISAMPLERBUFFER = 437, /* ISAMPLERBUFFER */
USAMPLERBUFFER = 438, /* USAMPLERBUFFER */
SAMPLER2DMS = 439, /* SAMPLER2DMS */
ISAMPLER2DMS = 440, /* ISAMPLER2DMS */
USAMPLER2DMS = 441, /* USAMPLER2DMS */
SAMPLER2DMSARRAY = 442, /* SAMPLER2DMSARRAY */
ISAMPLER2DMSARRAY = 443, /* ISAMPLER2DMSARRAY */
USAMPLER2DMSARRAY = 444, /* USAMPLER2DMSARRAY */
SAMPLEREXTERNALOES = 445, /* SAMPLEREXTERNALOES */
SAMPLEREXTERNAL2DY2YEXT = 446, /* SAMPLEREXTERNAL2DY2YEXT */
ISAMPLER1DARRAY = 447, /* ISAMPLER1DARRAY */
USAMPLER1D = 448, /* USAMPLER1D */
USAMPLER1DARRAY = 449, /* USAMPLER1DARRAY */
F16SAMPLER1D = 450, /* F16SAMPLER1D */
F16SAMPLER2D = 451, /* F16SAMPLER2D */
F16SAMPLER3D = 452, /* F16SAMPLER3D */
F16SAMPLER2DRECT = 453, /* F16SAMPLER2DRECT */
F16SAMPLERCUBE = 454, /* F16SAMPLERCUBE */
F16SAMPLER1DARRAY = 455, /* F16SAMPLER1DARRAY */
F16SAMPLER2DARRAY = 456, /* F16SAMPLER2DARRAY */
F16SAMPLERCUBEARRAY = 457, /* F16SAMPLERCUBEARRAY */
F16SAMPLERBUFFER = 458, /* F16SAMPLERBUFFER */
F16SAMPLER2DMS = 459, /* F16SAMPLER2DMS */
F16SAMPLER2DMSARRAY = 460, /* F16SAMPLER2DMSARRAY */
F16SAMPLER1DSHADOW = 461, /* F16SAMPLER1DSHADOW */
F16SAMPLER2DSHADOW = 462, /* F16SAMPLER2DSHADOW */
F16SAMPLER1DARRAYSHADOW = 463, /* F16SAMPLER1DARRAYSHADOW */
F16SAMPLER2DARRAYSHADOW = 464, /* F16SAMPLER2DARRAYSHADOW */
F16SAMPLER2DRECTSHADOW = 465, /* F16SAMPLER2DRECTSHADOW */
F16SAMPLERCUBESHADOW = 466, /* F16SAMPLERCUBESHADOW */
F16SAMPLERCUBEARRAYSHADOW = 467, /* F16SAMPLERCUBEARRAYSHADOW */
IMAGE1D = 468, /* IMAGE1D */
IIMAGE1D = 469, /* IIMAGE1D */
UIMAGE1D = 470, /* UIMAGE1D */
IMAGE2D = 471, /* IMAGE2D */
IIMAGE2D = 472, /* IIMAGE2D */
UIMAGE2D = 473, /* UIMAGE2D */
IMAGE3D = 474, /* IMAGE3D */
IIMAGE3D = 475, /* IIMAGE3D */
UIMAGE3D = 476, /* UIMAGE3D */
IMAGE2DRECT = 477, /* IMAGE2DRECT */
IIMAGE2DRECT = 478, /* IIMAGE2DRECT */
UIMAGE2DRECT = 479, /* UIMAGE2DRECT */
IMAGECUBE = 480, /* IMAGECUBE */
IIMAGECUBE = 481, /* IIMAGECUBE */
UIMAGECUBE = 482, /* UIMAGECUBE */
IMAGEBUFFER = 483, /* IMAGEBUFFER */
IIMAGEBUFFER = 484, /* IIMAGEBUFFER */
UIMAGEBUFFER = 485, /* UIMAGEBUFFER */
IMAGE1DARRAY = 486, /* IMAGE1DARRAY */
IIMAGE1DARRAY = 487, /* IIMAGE1DARRAY */
UIMAGE1DARRAY = 488, /* UIMAGE1DARRAY */
IMAGE2DARRAY = 489, /* IMAGE2DARRAY */
IIMAGE2DARRAY = 490, /* IIMAGE2DARRAY */
UIMAGE2DARRAY = 491, /* UIMAGE2DARRAY */
IMAGECUBEARRAY = 492, /* IMAGECUBEARRAY */
IIMAGECUBEARRAY = 493, /* IIMAGECUBEARRAY */
UIMAGECUBEARRAY = 494, /* UIMAGECUBEARRAY */
IMAGE2DMS = 495, /* IMAGE2DMS */
IIMAGE2DMS = 496, /* IIMAGE2DMS */
UIMAGE2DMS = 497, /* UIMAGE2DMS */
IMAGE2DMSARRAY = 498, /* IMAGE2DMSARRAY */
IIMAGE2DMSARRAY = 499, /* IIMAGE2DMSARRAY */
UIMAGE2DMSARRAY = 500, /* UIMAGE2DMSARRAY */
F16IMAGE1D = 501, /* F16IMAGE1D */
F16IMAGE2D = 502, /* F16IMAGE2D */
F16IMAGE3D = 503, /* F16IMAGE3D */
F16IMAGE2DRECT = 504, /* F16IMAGE2DRECT */
F16IMAGECUBE = 505, /* F16IMAGECUBE */
F16IMAGE1DARRAY = 506, /* F16IMAGE1DARRAY */
F16IMAGE2DARRAY = 507, /* F16IMAGE2DARRAY */
F16IMAGECUBEARRAY = 508, /* F16IMAGECUBEARRAY */
F16IMAGEBUFFER = 509, /* F16IMAGEBUFFER */
F16IMAGE2DMS = 510, /* F16IMAGE2DMS */
F16IMAGE2DMSARRAY = 511, /* F16IMAGE2DMSARRAY */
I64IMAGE1D = 512, /* I64IMAGE1D */
U64IMAGE1D = 513, /* U64IMAGE1D */
I64IMAGE2D = 514, /* I64IMAGE2D */
U64IMAGE2D = 515, /* U64IMAGE2D */
I64IMAGE3D = 516, /* I64IMAGE3D */
U64IMAGE3D = 517, /* U64IMAGE3D */
I64IMAGE2DRECT = 518, /* I64IMAGE2DRECT */
U64IMAGE2DRECT = 519, /* U64IMAGE2DRECT */
I64IMAGECUBE = 520, /* I64IMAGECUBE */
U64IMAGECUBE = 521, /* U64IMAGECUBE */
I64IMAGEBUFFER = 522, /* I64IMAGEBUFFER */
U64IMAGEBUFFER = 523, /* U64IMAGEBUFFER */
I64IMAGE1DARRAY = 524, /* I64IMAGE1DARRAY */
U64IMAGE1DARRAY = 525, /* U64IMAGE1DARRAY */
I64IMAGE2DARRAY = 526, /* I64IMAGE2DARRAY */
U64IMAGE2DARRAY = 527, /* U64IMAGE2DARRAY */
I64IMAGECUBEARRAY = 528, /* I64IMAGECUBEARRAY */
U64IMAGECUBEARRAY = 529, /* U64IMAGECUBEARRAY */
I64IMAGE2DMS = 530, /* I64IMAGE2DMS */
U64IMAGE2DMS = 531, /* U64IMAGE2DMS */
I64IMAGE2DMSARRAY = 532, /* I64IMAGE2DMSARRAY */
U64IMAGE2DMSARRAY = 533, /* U64IMAGE2DMSARRAY */
TEXTURECUBEARRAY = 534, /* TEXTURECUBEARRAY */
ITEXTURECUBEARRAY = 535, /* ITEXTURECUBEARRAY */
UTEXTURECUBEARRAY = 536, /* UTEXTURECUBEARRAY */
TEXTURE1D = 537, /* TEXTURE1D */
ITEXTURE1D = 538, /* ITEXTURE1D */
UTEXTURE1D = 539, /* UTEXTURE1D */
TEXTURE1DARRAY = 540, /* TEXTURE1DARRAY */
ITEXTURE1DARRAY = 541, /* ITEXTURE1DARRAY */
UTEXTURE1DARRAY = 542, /* UTEXTURE1DARRAY */
TEXTURE2DRECT = 543, /* TEXTURE2DRECT */
ITEXTURE2DRECT = 544, /* ITEXTURE2DRECT */
UTEXTURE2DRECT = 545, /* UTEXTURE2DRECT */
TEXTUREBUFFER = 546, /* TEXTUREBUFFER */
ITEXTUREBUFFER = 547, /* ITEXTUREBUFFER */
UTEXTUREBUFFER = 548, /* UTEXTUREBUFFER */
TEXTURE2DMS = 549, /* TEXTURE2DMS */
ITEXTURE2DMS = 550, /* ITEXTURE2DMS */
UTEXTURE2DMS = 551, /* UTEXTURE2DMS */
TEXTURE2DMSARRAY = 552, /* TEXTURE2DMSARRAY */
ITEXTURE2DMSARRAY = 553, /* ITEXTURE2DMSARRAY */
UTEXTURE2DMSARRAY = 554, /* UTEXTURE2DMSARRAY */
F16TEXTURE1D = 555, /* F16TEXTURE1D */
F16TEXTURE2D = 556, /* F16TEXTURE2D */
F16TEXTURE3D = 557, /* F16TEXTURE3D */
F16TEXTURE2DRECT = 558, /* F16TEXTURE2DRECT */
F16TEXTURECUBE = 559, /* F16TEXTURECUBE */
F16TEXTURE1DARRAY = 560, /* F16TEXTURE1DARRAY */
F16TEXTURE2DARRAY = 561, /* F16TEXTURE2DARRAY */
F16TEXTURECUBEARRAY = 562, /* F16TEXTURECUBEARRAY */
F16TEXTUREBUFFER = 563, /* F16TEXTUREBUFFER */
F16TEXTURE2DMS = 564, /* F16TEXTURE2DMS */
F16TEXTURE2DMSARRAY = 565, /* F16TEXTURE2DMSARRAY */
SUBPASSINPUT = 566, /* SUBPASSINPUT */
SUBPASSINPUTMS = 567, /* SUBPASSINPUTMS */
ISUBPASSINPUT = 568, /* ISUBPASSINPUT */
ISUBPASSINPUTMS = 569, /* ISUBPASSINPUTMS */
USUBPASSINPUT = 570, /* USUBPASSINPUT */
USUBPASSINPUTMS = 571, /* USUBPASSINPUTMS */
F16SUBPASSINPUT = 572, /* F16SUBPASSINPUT */
F16SUBPASSINPUTMS = 573, /* F16SUBPASSINPUTMS */
SPIRV_INSTRUCTION = 574, /* SPIRV_INSTRUCTION */
SPIRV_EXECUTION_MODE = 575, /* SPIRV_EXECUTION_MODE */
SPIRV_EXECUTION_MODE_ID = 576, /* SPIRV_EXECUTION_MODE_ID */
SPIRV_DECORATE = 577, /* SPIRV_DECORATE */
SPIRV_DECORATE_ID = 578, /* SPIRV_DECORATE_ID */
SPIRV_DECORATE_STRING = 579, /* SPIRV_DECORATE_STRING */
SPIRV_TYPE = 580, /* SPIRV_TYPE */
SPIRV_STORAGE_CLASS = 581, /* SPIRV_STORAGE_CLASS */
SPIRV_BY_REFERENCE = 582, /* SPIRV_BY_REFERENCE */
SPIRV_LITERAL = 583, /* SPIRV_LITERAL */
ATTACHMENTEXT = 584, /* ATTACHMENTEXT */
IATTACHMENTEXT = 585, /* IATTACHMENTEXT */
UATTACHMENTEXT = 586, /* UATTACHMENTEXT */
LEFT_OP = 587, /* LEFT_OP */
RIGHT_OP = 588, /* RIGHT_OP */
INC_OP = 589, /* INC_OP */
DEC_OP = 590, /* DEC_OP */
LE_OP = 591, /* LE_OP */
GE_OP = 592, /* GE_OP */
EQ_OP = 593, /* EQ_OP */
NE_OP = 594, /* NE_OP */
AND_OP = 595, /* AND_OP */
OR_OP = 596, /* OR_OP */
XOR_OP = 597, /* XOR_OP */
MUL_ASSIGN = 598, /* MUL_ASSIGN */
DIV_ASSIGN = 599, /* DIV_ASSIGN */
ADD_ASSIGN = 600, /* ADD_ASSIGN */
MOD_ASSIGN = 601, /* MOD_ASSIGN */
LEFT_ASSIGN = 602, /* LEFT_ASSIGN */
RIGHT_ASSIGN = 603, /* RIGHT_ASSIGN */
AND_ASSIGN = 604, /* AND_ASSIGN */
XOR_ASSIGN = 605, /* XOR_ASSIGN */
OR_ASSIGN = 606, /* OR_ASSIGN */
SUB_ASSIGN = 607, /* SUB_ASSIGN */
STRING_LITERAL = 608, /* STRING_LITERAL */
LEFT_PAREN = 609, /* LEFT_PAREN */
RIGHT_PAREN = 610, /* RIGHT_PAREN */
LEFT_BRACKET = 611, /* LEFT_BRACKET */
RIGHT_BRACKET = 612, /* RIGHT_BRACKET */
LEFT_BRACE = 613, /* LEFT_BRACE */
RIGHT_BRACE = 614, /* RIGHT_BRACE */
DOT = 615, /* DOT */
COMMA = 616, /* COMMA */
COLON = 617, /* COLON */
EQUAL = 618, /* EQUAL */
SEMICOLON = 619, /* SEMICOLON */
BANG = 620, /* BANG */
DASH = 621, /* DASH */
TILDE = 622, /* TILDE */
PLUS = 623, /* PLUS */
STAR = 624, /* STAR */
SLASH = 625, /* SLASH */
PERCENT = 626, /* PERCENT */
LEFT_ANGLE = 627, /* LEFT_ANGLE */
RIGHT_ANGLE = 628, /* RIGHT_ANGLE */
VERTICAL_BAR = 629, /* VERTICAL_BAR */
CARET = 630, /* CARET */
AMPERSAND = 631, /* AMPERSAND */
QUESTION = 632, /* QUESTION */
INVARIANT = 633, /* INVARIANT */
HIGH_PRECISION = 634, /* HIGH_PRECISION */
MEDIUM_PRECISION = 635, /* MEDIUM_PRECISION */
LOW_PRECISION = 636, /* LOW_PRECISION */
PRECISION = 637, /* PRECISION */
PACKED = 638, /* PACKED */
RESOURCE = 639, /* RESOURCE */
SUPERP = 640, /* SUPERP */
FLOATCONSTANT = 641, /* FLOATCONSTANT */
INTCONSTANT = 642, /* INTCONSTANT */
UINTCONSTANT = 643, /* UINTCONSTANT */
BOOLCONSTANT = 644, /* BOOLCONSTANT */
IDENTIFIER = 645, /* IDENTIFIER */
TYPE_NAME = 646, /* TYPE_NAME */
CENTROID = 647, /* CENTROID */
IN = 648, /* IN */
OUT = 649, /* OUT */
INOUT = 650, /* INOUT */
STRUCT = 651, /* STRUCT */
VOID = 652, /* VOID */
WHILE = 653, /* WHILE */
BREAK = 654, /* BREAK */
CONTINUE = 655, /* CONTINUE */
DO = 656, /* DO */
ELSE = 657, /* ELSE */
FOR = 658, /* FOR */
IF = 659, /* IF */
DISCARD = 660, /* DISCARD */
RETURN = 661, /* RETURN */
SWITCH = 662, /* SWITCH */
CASE = 663, /* CASE */
DEFAULT = 664, /* DEFAULT */
TERMINATE_INVOCATION = 665, /* TERMINATE_INVOCATION */
TERMINATE_RAY = 666, /* TERMINATE_RAY */
IGNORE_INTERSECTION = 667, /* IGNORE_INTERSECTION */
UNIFORM = 668, /* UNIFORM */
SHARED = 669, /* SHARED */
BUFFER = 670, /* BUFFER */
TILEIMAGEEXT = 671, /* TILEIMAGEEXT */
FLAT = 672, /* FLAT */
SMOOTH = 673, /* SMOOTH */
LAYOUT = 674, /* LAYOUT */
DOUBLECONSTANT = 675, /* DOUBLECONSTANT */
INT16CONSTANT = 676, /* INT16CONSTANT */
UINT16CONSTANT = 677, /* UINT16CONSTANT */
FLOAT16CONSTANT = 678, /* FLOAT16CONSTANT */
INT32CONSTANT = 679, /* INT32CONSTANT */
UINT32CONSTANT = 680, /* UINT32CONSTANT */
INT64CONSTANT = 681, /* INT64CONSTANT */
UINT64CONSTANT = 682, /* UINT64CONSTANT */
SUBROUTINE = 683, /* SUBROUTINE */
DEMOTE = 684, /* DEMOTE */
PAYLOADNV = 685, /* PAYLOADNV */
PAYLOADINNV = 686, /* PAYLOADINNV */
HITATTRNV = 687, /* HITATTRNV */
CALLDATANV = 688, /* CALLDATANV */
CALLDATAINNV = 689, /* CALLDATAINNV */
PAYLOADEXT = 690, /* PAYLOADEXT */
PAYLOADINEXT = 691, /* PAYLOADINEXT */
HITATTREXT = 692, /* HITATTREXT */
CALLDATAEXT = 693, /* CALLDATAEXT */
CALLDATAINEXT = 694, /* CALLDATAINEXT */
PATCH = 695, /* PATCH */
SAMPLE = 696, /* SAMPLE */
NONUNIFORM = 697, /* NONUNIFORM */
COHERENT = 698, /* COHERENT */
VOLATILE = 699, /* VOLATILE */
RESTRICT = 700, /* RESTRICT */
READONLY = 701, /* READONLY */
WRITEONLY = 702, /* WRITEONLY */
DEVICECOHERENT = 703, /* DEVICECOHERENT */
QUEUEFAMILYCOHERENT = 704, /* QUEUEFAMILYCOHERENT */
WORKGROUPCOHERENT = 705, /* WORKGROUPCOHERENT */
SUBGROUPCOHERENT = 706, /* SUBGROUPCOHERENT */
NONPRIVATE = 707, /* NONPRIVATE */
SHADERCALLCOHERENT = 708, /* SHADERCALLCOHERENT */
NOPERSPECTIVE = 709, /* NOPERSPECTIVE */
EXPLICITINTERPAMD = 710, /* EXPLICITINTERPAMD */
PERVERTEXEXT = 711, /* PERVERTEXEXT */
PERVERTEXNV = 712, /* PERVERTEXNV */
PERPRIMITIVENV = 713, /* PERPRIMITIVENV */
PERVIEWNV = 714, /* PERVIEWNV */
PERTASKNV = 715, /* PERTASKNV */
PERPRIMITIVEEXT = 716, /* PERPRIMITIVEEXT */
TASKPAYLOADWORKGROUPEXT = 717, /* TASKPAYLOADWORKGROUPEXT */
PRECISE = 718 /* PRECISE */
COOPMAT = 421, /* COOPMAT */
HITOBJECTNV = 422, /* HITOBJECTNV */
HITOBJECTATTRNV = 423, /* HITOBJECTATTRNV */
SAMPLERCUBEARRAY = 424, /* SAMPLERCUBEARRAY */
SAMPLERCUBEARRAYSHADOW = 425, /* SAMPLERCUBEARRAYSHADOW */
ISAMPLERCUBEARRAY = 426, /* ISAMPLERCUBEARRAY */
USAMPLERCUBEARRAY = 427, /* USAMPLERCUBEARRAY */
SAMPLER1D = 428, /* SAMPLER1D */
SAMPLER1DARRAY = 429, /* SAMPLER1DARRAY */
SAMPLER1DARRAYSHADOW = 430, /* SAMPLER1DARRAYSHADOW */
ISAMPLER1D = 431, /* ISAMPLER1D */
SAMPLER1DSHADOW = 432, /* SAMPLER1DSHADOW */
SAMPLER2DRECT = 433, /* SAMPLER2DRECT */
SAMPLER2DRECTSHADOW = 434, /* SAMPLER2DRECTSHADOW */
ISAMPLER2DRECT = 435, /* ISAMPLER2DRECT */
USAMPLER2DRECT = 436, /* USAMPLER2DRECT */
SAMPLERBUFFER = 437, /* SAMPLERBUFFER */
ISAMPLERBUFFER = 438, /* ISAMPLERBUFFER */
USAMPLERBUFFER = 439, /* USAMPLERBUFFER */
SAMPLER2DMS = 440, /* SAMPLER2DMS */
ISAMPLER2DMS = 441, /* ISAMPLER2DMS */
USAMPLER2DMS = 442, /* USAMPLER2DMS */
SAMPLER2DMSARRAY = 443, /* SAMPLER2DMSARRAY */
ISAMPLER2DMSARRAY = 444, /* ISAMPLER2DMSARRAY */
USAMPLER2DMSARRAY = 445, /* USAMPLER2DMSARRAY */
SAMPLEREXTERNALOES = 446, /* SAMPLEREXTERNALOES */
SAMPLEREXTERNAL2DY2YEXT = 447, /* SAMPLEREXTERNAL2DY2YEXT */
ISAMPLER1DARRAY = 448, /* ISAMPLER1DARRAY */
USAMPLER1D = 449, /* USAMPLER1D */
USAMPLER1DARRAY = 450, /* USAMPLER1DARRAY */
F16SAMPLER1D = 451, /* F16SAMPLER1D */
F16SAMPLER2D = 452, /* F16SAMPLER2D */
F16SAMPLER3D = 453, /* F16SAMPLER3D */
F16SAMPLER2DRECT = 454, /* F16SAMPLER2DRECT */
F16SAMPLERCUBE = 455, /* F16SAMPLERCUBE */
F16SAMPLER1DARRAY = 456, /* F16SAMPLER1DARRAY */
F16SAMPLER2DARRAY = 457, /* F16SAMPLER2DARRAY */
F16SAMPLERCUBEARRAY = 458, /* F16SAMPLERCUBEARRAY */
F16SAMPLERBUFFER = 459, /* F16SAMPLERBUFFER */
F16SAMPLER2DMS = 460, /* F16SAMPLER2DMS */
F16SAMPLER2DMSARRAY = 461, /* F16SAMPLER2DMSARRAY */
F16SAMPLER1DSHADOW = 462, /* F16SAMPLER1DSHADOW */
F16SAMPLER2DSHADOW = 463, /* F16SAMPLER2DSHADOW */
F16SAMPLER1DARRAYSHADOW = 464, /* F16SAMPLER1DARRAYSHADOW */
F16SAMPLER2DARRAYSHADOW = 465, /* F16SAMPLER2DARRAYSHADOW */
F16SAMPLER2DRECTSHADOW = 466, /* F16SAMPLER2DRECTSHADOW */
F16SAMPLERCUBESHADOW = 467, /* F16SAMPLERCUBESHADOW */
F16SAMPLERCUBEARRAYSHADOW = 468, /* F16SAMPLERCUBEARRAYSHADOW */
IMAGE1D = 469, /* IMAGE1D */
IIMAGE1D = 470, /* IIMAGE1D */
UIMAGE1D = 471, /* UIMAGE1D */
IMAGE2D = 472, /* IMAGE2D */
IIMAGE2D = 473, /* IIMAGE2D */
UIMAGE2D = 474, /* UIMAGE2D */
IMAGE3D = 475, /* IMAGE3D */
IIMAGE3D = 476, /* IIMAGE3D */
UIMAGE3D = 477, /* UIMAGE3D */
IMAGE2DRECT = 478, /* IMAGE2DRECT */
IIMAGE2DRECT = 479, /* IIMAGE2DRECT */
UIMAGE2DRECT = 480, /* UIMAGE2DRECT */
IMAGECUBE = 481, /* IMAGECUBE */
IIMAGECUBE = 482, /* IIMAGECUBE */
UIMAGECUBE = 483, /* UIMAGECUBE */
IMAGEBUFFER = 484, /* IMAGEBUFFER */
IIMAGEBUFFER = 485, /* IIMAGEBUFFER */
UIMAGEBUFFER = 486, /* UIMAGEBUFFER */
IMAGE1DARRAY = 487, /* IMAGE1DARRAY */
IIMAGE1DARRAY = 488, /* IIMAGE1DARRAY */
UIMAGE1DARRAY = 489, /* UIMAGE1DARRAY */
IMAGE2DARRAY = 490, /* IMAGE2DARRAY */
IIMAGE2DARRAY = 491, /* IIMAGE2DARRAY */
UIMAGE2DARRAY = 492, /* UIMAGE2DARRAY */
IMAGECUBEARRAY = 493, /* IMAGECUBEARRAY */
IIMAGECUBEARRAY = 494, /* IIMAGECUBEARRAY */
UIMAGECUBEARRAY = 495, /* UIMAGECUBEARRAY */
IMAGE2DMS = 496, /* IMAGE2DMS */
IIMAGE2DMS = 497, /* IIMAGE2DMS */
UIMAGE2DMS = 498, /* UIMAGE2DMS */
IMAGE2DMSARRAY = 499, /* IMAGE2DMSARRAY */
IIMAGE2DMSARRAY = 500, /* IIMAGE2DMSARRAY */
UIMAGE2DMSARRAY = 501, /* UIMAGE2DMSARRAY */
F16IMAGE1D = 502, /* F16IMAGE1D */
F16IMAGE2D = 503, /* F16IMAGE2D */
F16IMAGE3D = 504, /* F16IMAGE3D */
F16IMAGE2DRECT = 505, /* F16IMAGE2DRECT */
F16IMAGECUBE = 506, /* F16IMAGECUBE */
F16IMAGE1DARRAY = 507, /* F16IMAGE1DARRAY */
F16IMAGE2DARRAY = 508, /* F16IMAGE2DARRAY */
F16IMAGECUBEARRAY = 509, /* F16IMAGECUBEARRAY */
F16IMAGEBUFFER = 510, /* F16IMAGEBUFFER */
F16IMAGE2DMS = 511, /* F16IMAGE2DMS */
F16IMAGE2DMSARRAY = 512, /* F16IMAGE2DMSARRAY */
I64IMAGE1D = 513, /* I64IMAGE1D */
U64IMAGE1D = 514, /* U64IMAGE1D */
I64IMAGE2D = 515, /* I64IMAGE2D */
U64IMAGE2D = 516, /* U64IMAGE2D */
I64IMAGE3D = 517, /* I64IMAGE3D */
U64IMAGE3D = 518, /* U64IMAGE3D */
I64IMAGE2DRECT = 519, /* I64IMAGE2DRECT */
U64IMAGE2DRECT = 520, /* U64IMAGE2DRECT */
I64IMAGECUBE = 521, /* I64IMAGECUBE */
U64IMAGECUBE = 522, /* U64IMAGECUBE */
I64IMAGEBUFFER = 523, /* I64IMAGEBUFFER */
U64IMAGEBUFFER = 524, /* U64IMAGEBUFFER */
I64IMAGE1DARRAY = 525, /* I64IMAGE1DARRAY */
U64IMAGE1DARRAY = 526, /* U64IMAGE1DARRAY */
I64IMAGE2DARRAY = 527, /* I64IMAGE2DARRAY */
U64IMAGE2DARRAY = 528, /* U64IMAGE2DARRAY */
I64IMAGECUBEARRAY = 529, /* I64IMAGECUBEARRAY */
U64IMAGECUBEARRAY = 530, /* U64IMAGECUBEARRAY */
I64IMAGE2DMS = 531, /* I64IMAGE2DMS */
U64IMAGE2DMS = 532, /* U64IMAGE2DMS */
I64IMAGE2DMSARRAY = 533, /* I64IMAGE2DMSARRAY */
U64IMAGE2DMSARRAY = 534, /* U64IMAGE2DMSARRAY */
TEXTURECUBEARRAY = 535, /* TEXTURECUBEARRAY */
ITEXTURECUBEARRAY = 536, /* ITEXTURECUBEARRAY */
UTEXTURECUBEARRAY = 537, /* UTEXTURECUBEARRAY */
TEXTURE1D = 538, /* TEXTURE1D */
ITEXTURE1D = 539, /* ITEXTURE1D */
UTEXTURE1D = 540, /* UTEXTURE1D */
TEXTURE1DARRAY = 541, /* TEXTURE1DARRAY */
ITEXTURE1DARRAY = 542, /* ITEXTURE1DARRAY */
UTEXTURE1DARRAY = 543, /* UTEXTURE1DARRAY */
TEXTURE2DRECT = 544, /* TEXTURE2DRECT */
ITEXTURE2DRECT = 545, /* ITEXTURE2DRECT */
UTEXTURE2DRECT = 546, /* UTEXTURE2DRECT */
TEXTUREBUFFER = 547, /* TEXTUREBUFFER */
ITEXTUREBUFFER = 548, /* ITEXTUREBUFFER */
UTEXTUREBUFFER = 549, /* UTEXTUREBUFFER */
TEXTURE2DMS = 550, /* TEXTURE2DMS */
ITEXTURE2DMS = 551, /* ITEXTURE2DMS */
UTEXTURE2DMS = 552, /* UTEXTURE2DMS */
TEXTURE2DMSARRAY = 553, /* TEXTURE2DMSARRAY */
ITEXTURE2DMSARRAY = 554, /* ITEXTURE2DMSARRAY */
UTEXTURE2DMSARRAY = 555, /* UTEXTURE2DMSARRAY */
F16TEXTURE1D = 556, /* F16TEXTURE1D */
F16TEXTURE2D = 557, /* F16TEXTURE2D */
F16TEXTURE3D = 558, /* F16TEXTURE3D */
F16TEXTURE2DRECT = 559, /* F16TEXTURE2DRECT */
F16TEXTURECUBE = 560, /* F16TEXTURECUBE */
F16TEXTURE1DARRAY = 561, /* F16TEXTURE1DARRAY */
F16TEXTURE2DARRAY = 562, /* F16TEXTURE2DARRAY */
F16TEXTURECUBEARRAY = 563, /* F16TEXTURECUBEARRAY */
F16TEXTUREBUFFER = 564, /* F16TEXTUREBUFFER */
F16TEXTURE2DMS = 565, /* F16TEXTURE2DMS */
F16TEXTURE2DMSARRAY = 566, /* F16TEXTURE2DMSARRAY */
SUBPASSINPUT = 567, /* SUBPASSINPUT */
SUBPASSINPUTMS = 568, /* SUBPASSINPUTMS */
ISUBPASSINPUT = 569, /* ISUBPASSINPUT */
ISUBPASSINPUTMS = 570, /* ISUBPASSINPUTMS */
USUBPASSINPUT = 571, /* USUBPASSINPUT */
USUBPASSINPUTMS = 572, /* USUBPASSINPUTMS */
F16SUBPASSINPUT = 573, /* F16SUBPASSINPUT */
F16SUBPASSINPUTMS = 574, /* F16SUBPASSINPUTMS */
SPIRV_INSTRUCTION = 575, /* SPIRV_INSTRUCTION */
SPIRV_EXECUTION_MODE = 576, /* SPIRV_EXECUTION_MODE */
SPIRV_EXECUTION_MODE_ID = 577, /* SPIRV_EXECUTION_MODE_ID */
SPIRV_DECORATE = 578, /* SPIRV_DECORATE */
SPIRV_DECORATE_ID = 579, /* SPIRV_DECORATE_ID */
SPIRV_DECORATE_STRING = 580, /* SPIRV_DECORATE_STRING */
SPIRV_TYPE = 581, /* SPIRV_TYPE */
SPIRV_STORAGE_CLASS = 582, /* SPIRV_STORAGE_CLASS */
SPIRV_BY_REFERENCE = 583, /* SPIRV_BY_REFERENCE */
SPIRV_LITERAL = 584, /* SPIRV_LITERAL */
ATTACHMENTEXT = 585, /* ATTACHMENTEXT */
IATTACHMENTEXT = 586, /* IATTACHMENTEXT */
UATTACHMENTEXT = 587, /* UATTACHMENTEXT */
LEFT_OP = 588, /* LEFT_OP */
RIGHT_OP = 589, /* RIGHT_OP */
INC_OP = 590, /* INC_OP */
DEC_OP = 591, /* DEC_OP */
LE_OP = 592, /* LE_OP */
GE_OP = 593, /* GE_OP */
EQ_OP = 594, /* EQ_OP */
NE_OP = 595, /* NE_OP */
AND_OP = 596, /* AND_OP */
OR_OP = 597, /* OR_OP */
XOR_OP = 598, /* XOR_OP */
MUL_ASSIGN = 599, /* MUL_ASSIGN */
DIV_ASSIGN = 600, /* DIV_ASSIGN */
ADD_ASSIGN = 601, /* ADD_ASSIGN */
MOD_ASSIGN = 602, /* MOD_ASSIGN */
LEFT_ASSIGN = 603, /* LEFT_ASSIGN */
RIGHT_ASSIGN = 604, /* RIGHT_ASSIGN */
AND_ASSIGN = 605, /* AND_ASSIGN */
XOR_ASSIGN = 606, /* XOR_ASSIGN */
OR_ASSIGN = 607, /* OR_ASSIGN */
SUB_ASSIGN = 608, /* SUB_ASSIGN */
STRING_LITERAL = 609, /* STRING_LITERAL */
LEFT_PAREN = 610, /* LEFT_PAREN */
RIGHT_PAREN = 611, /* RIGHT_PAREN */
LEFT_BRACKET = 612, /* LEFT_BRACKET */
RIGHT_BRACKET = 613, /* RIGHT_BRACKET */
LEFT_BRACE = 614, /* LEFT_BRACE */
RIGHT_BRACE = 615, /* RIGHT_BRACE */
DOT = 616, /* DOT */
COMMA = 617, /* COMMA */
COLON = 618, /* COLON */
EQUAL = 619, /* EQUAL */
SEMICOLON = 620, /* SEMICOLON */
BANG = 621, /* BANG */
DASH = 622, /* DASH */
TILDE = 623, /* TILDE */
PLUS = 624, /* PLUS */
STAR = 625, /* STAR */
SLASH = 626, /* SLASH */
PERCENT = 627, /* PERCENT */
LEFT_ANGLE = 628, /* LEFT_ANGLE */
RIGHT_ANGLE = 629, /* RIGHT_ANGLE */
VERTICAL_BAR = 630, /* VERTICAL_BAR */
CARET = 631, /* CARET */
AMPERSAND = 632, /* AMPERSAND */
QUESTION = 633, /* QUESTION */
INVARIANT = 634, /* INVARIANT */
HIGH_PRECISION = 635, /* HIGH_PRECISION */
MEDIUM_PRECISION = 636, /* MEDIUM_PRECISION */
LOW_PRECISION = 637, /* LOW_PRECISION */
PRECISION = 638, /* PRECISION */
PACKED = 639, /* PACKED */
RESOURCE = 640, /* RESOURCE */
SUPERP = 641, /* SUPERP */
FLOATCONSTANT = 642, /* FLOATCONSTANT */
INTCONSTANT = 643, /* INTCONSTANT */
UINTCONSTANT = 644, /* UINTCONSTANT */
BOOLCONSTANT = 645, /* BOOLCONSTANT */
IDENTIFIER = 646, /* IDENTIFIER */
TYPE_NAME = 647, /* TYPE_NAME */
CENTROID = 648, /* CENTROID */
IN = 649, /* IN */
OUT = 650, /* OUT */
INOUT = 651, /* INOUT */
STRUCT = 652, /* STRUCT */
VOID = 653, /* VOID */
WHILE = 654, /* WHILE */
BREAK = 655, /* BREAK */
CONTINUE = 656, /* CONTINUE */
DO = 657, /* DO */
ELSE = 658, /* ELSE */
FOR = 659, /* FOR */
IF = 660, /* IF */
DISCARD = 661, /* DISCARD */
RETURN = 662, /* RETURN */
SWITCH = 663, /* SWITCH */
CASE = 664, /* CASE */
DEFAULT = 665, /* DEFAULT */
TERMINATE_INVOCATION = 666, /* TERMINATE_INVOCATION */
TERMINATE_RAY = 667, /* TERMINATE_RAY */
IGNORE_INTERSECTION = 668, /* IGNORE_INTERSECTION */
UNIFORM = 669, /* UNIFORM */
SHARED = 670, /* SHARED */
BUFFER = 671, /* BUFFER */
TILEIMAGEEXT = 672, /* TILEIMAGEEXT */
FLAT = 673, /* FLAT */
SMOOTH = 674, /* SMOOTH */
LAYOUT = 675, /* LAYOUT */
DOUBLECONSTANT = 676, /* DOUBLECONSTANT */
INT16CONSTANT = 677, /* INT16CONSTANT */
UINT16CONSTANT = 678, /* UINT16CONSTANT */
FLOAT16CONSTANT = 679, /* FLOAT16CONSTANT */
INT32CONSTANT = 680, /* INT32CONSTANT */
UINT32CONSTANT = 681, /* UINT32CONSTANT */
INT64CONSTANT = 682, /* INT64CONSTANT */
UINT64CONSTANT = 683, /* UINT64CONSTANT */
SUBROUTINE = 684, /* SUBROUTINE */
DEMOTE = 685, /* DEMOTE */
PAYLOADNV = 686, /* PAYLOADNV */
PAYLOADINNV = 687, /* PAYLOADINNV */
HITATTRNV = 688, /* HITATTRNV */
CALLDATANV = 689, /* CALLDATANV */
CALLDATAINNV = 690, /* CALLDATAINNV */
PAYLOADEXT = 691, /* PAYLOADEXT */
PAYLOADINEXT = 692, /* PAYLOADINEXT */
HITATTREXT = 693, /* HITATTREXT */
CALLDATAEXT = 694, /* CALLDATAEXT */
CALLDATAINEXT = 695, /* CALLDATAINEXT */
PATCH = 696, /* PATCH */
SAMPLE = 697, /* SAMPLE */
NONUNIFORM = 698, /* NONUNIFORM */
COHERENT = 699, /* COHERENT */
VOLATILE = 700, /* VOLATILE */
RESTRICT = 701, /* RESTRICT */
READONLY = 702, /* READONLY */
WRITEONLY = 703, /* WRITEONLY */
DEVICECOHERENT = 704, /* DEVICECOHERENT */
QUEUEFAMILYCOHERENT = 705, /* QUEUEFAMILYCOHERENT */
WORKGROUPCOHERENT = 706, /* WORKGROUPCOHERENT */
SUBGROUPCOHERENT = 707, /* SUBGROUPCOHERENT */
NONPRIVATE = 708, /* NONPRIVATE */
SHADERCALLCOHERENT = 709, /* SHADERCALLCOHERENT */
NOPERSPECTIVE = 710, /* NOPERSPECTIVE */
EXPLICITINTERPAMD = 711, /* EXPLICITINTERPAMD */
PERVERTEXEXT = 712, /* PERVERTEXEXT */
PERVERTEXNV = 713, /* PERVERTEXNV */
PERPRIMITIVENV = 714, /* PERPRIMITIVENV */
PERVIEWNV = 715, /* PERVIEWNV */
PERTASKNV = 716, /* PERTASKNV */
PERPRIMITIVEEXT = 717, /* PERPRIMITIVEEXT */
TASKPAYLOADWORKGROUPEXT = 718, /* TASKPAYLOADWORKGROUPEXT */
PRECISE = 719 /* PRECISE */
};
typedef enum yytokentype yytoken_kind_t;
#endif
@ -559,10 +560,10 @@ union YYSTYPE
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
#line 566 "MachineIndependent/glslang_tab.cpp.h"
#line 567 "MachineIndependent/glslang_tab.cpp.h"
};
typedef union YYSTYPE YYSTYPE;
@ -572,6 +573,8 @@ typedef union YYSTYPE YYSTYPE;
int yyparse (glslang::TParseContext* pParseContext);
#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */

View file

@ -809,7 +809,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpConstructStruct: out.debug << "Construct structure"; break;
case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break;
case EOpConstructReference: out.debug << "Construct reference"; break;
case EOpConstructCooperativeMatrix: out.debug << "Construct cooperative matrix"; break;
case EOpConstructCooperativeMatrixNV: out.debug << "Construct cooperative matrix NV"; break;
case EOpConstructCooperativeMatrixKHR: out.debug << "Construct cooperative matrix KHR"; break;
case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break;
case EOpLessThan: out.debug << "Compare Less Than"; break;
@ -1103,9 +1104,12 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break;
case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break;
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix KHR"; break;
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix KHR"; break;
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices KHR"; break;
case EOpCooperativeMatrixLoadNV: out.debug << "Load cooperative matrix NV"; break;
case EOpCooperativeMatrixStoreNV: out.debug << "Store cooperative matrix NV"; break;
case EOpCooperativeMatrixMulAddNV: out.debug << "MulAdd cooperative matrices NV"; break;
case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
case EOpDebugPrintf: out.debug << "Debug printf"; break;

View file

@ -162,8 +162,9 @@ public:
virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void fcoopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void intcoopmatCheck(const TSourceLoc&, const char *op, bool builtIn = false);
virtual void fcoopmatCheckNV(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void intcoopmatCheckNV(const TSourceLoc&, const char *op, bool builtIn = false);
virtual void coopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
bool isForwardCompatible() const { return forwardCompatible; }