SPV: Implement Vulkan 1.1 features and extensions.

This commit is contained in:
John Kessenich 2018-03-06 16:12:04 -07:00
parent b2ae1d0521
commit 66011cb2c2
121 changed files with 51726 additions and 7500 deletions

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -177,11 +178,40 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
switch (getType().getBasicType()) {
case EbtDouble:
case EbtFloat:
#ifdef AMD_EXTENSIONS
case EbtFloat16:
#endif
newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst());
break;
case EbtInt8:
if (rightUnionArray[i] == 0)
newConstArray[i].setI8Const(0x7F);
else if (rightUnionArray[i].getI8Const() == -1 && leftUnionArray[i].getI8Const() == (signed char)0x80)
newConstArray[i].setI8Const((signed char)0x80);
else
newConstArray[i].setI8Const(leftUnionArray[i].getI8Const() / rightUnionArray[i].getI8Const());
break;
case EbtUint8:
if (rightUnionArray[i] == 0) {
newConstArray[i].setU8Const(0xFF);
} else
newConstArray[i].setU8Const(leftUnionArray[i].getU8Const() / rightUnionArray[i].getU8Const());
break;
case EbtInt16:
if (rightUnionArray[i] == 0)
newConstArray[i].setI16Const(0x7FFF);
else if (rightUnionArray[i].getI16Const() == -1 && leftUnionArray[i].getI16Const() == (signed short)0x8000)
newConstArray[i].setI16Const(short(0x8000));
else
newConstArray[i].setI16Const(leftUnionArray[i].getI16Const() / rightUnionArray[i].getI16Const());
break;
case EbtUint16:
if (rightUnionArray[i] == 0) {
newConstArray[i].setU16Const(0xFFFF);
} else
newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const());
break;
case EbtInt:
if (rightUnionArray[i] == 0)
@ -214,23 +244,6 @@ 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;
}
@ -411,6 +424,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
resultSize = 2;
break;
case EOpPack16:
case EOpPack32:
case EOpPack64:
case EOpUnpack32:
case EOpUnpack16:
case EOpUnpack8:
case EOpNormalize:
componentWise = false;
resultSize = objectSize;
@ -469,6 +488,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
case EOpPackSnorm2x16:
case EOpPackUnorm2x16:
case EOpPackHalf2x16:
case EOpPack16:
case EOpPack32:
case EOpPack64:
case EOpUnpack32:
case EOpUnpack16:
case EOpUnpack8:
case EOpUnpackSnorm2x16:
case EOpUnpackUnorm2x16:
@ -494,17 +519,13 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
case EOpNegative:
switch (getType().getBasicType()) {
case EbtDouble:
#ifdef AMD_EXTENSIONS
case EbtFloat16:
#endif
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
#ifdef AMD_EXTENSIONS
case EbtInt16:
#endif
case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const()))); break;
case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const()))); break;
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
#ifdef AMD_EXTENSIONS
case EbtUint16:
#endif
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
@ -659,13 +680,10 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
case EOpDoubleBitsToUint64:
case EOpInt64BitsToDouble:
case EOpUint64BitsToDouble:
#ifdef AMD_EXTENSIONS
case EOpFloat16BitsToInt16:
case EOpFloat16BitsToUint16:
case EOpInt16BitsToFloat16:
case EOpUint16BitsToFloat16:
#endif
default:
return 0;
}
@ -749,20 +767,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
for (unsigned int arg = 0; arg < children.size(); ++arg)
childConstUnions.push_back(children[arg]->getAsConstantUnion()->getConstArray());
// Second, do the actual folding
bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat ||
#ifdef AMD_EXTENSIONS
children[0]->getAsTyped()->getBasicType() == EbtFloat16 ||
#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;
if (componentwise) {
for (int comp = 0; comp < objectSize; comp++) {
@ -783,53 +787,114 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
newConstArray[comp].setDConst(pow(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
break;
case EOpMin:
if (isFloatingPoint)
switch(children[0]->getAsTyped()->getBasicType()) {
case EbtFloat16:
case EbtFloat:
case EbtDouble:
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
else if (isSigned) {
if (isInt64)
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
else
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
} else {
if (isInt64)
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
else
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
break;
case EbtInt8:
newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
break;
case EbtUint8:
newConstArray[comp].setU8Const(std::min(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()));
break;
case EbtInt16:
newConstArray[comp].setI16Const(std::min(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()));
break;
case EbtUint16:
newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
break;
case EbtInt:
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
break;
case EbtUint:
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
break;
case EbtInt64:
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
break;
case EbtUint64:
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
break;
default: assert(false && "Default missing");
}
break;
case EOpMax:
if (isFloatingPoint)
switch(children[0]->getAsTyped()->getBasicType()) {
case EbtFloat16:
case EbtFloat:
case EbtDouble:
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
else if (isSigned) {
if (isInt64)
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
else
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
} else {
if (isInt64)
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
else
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
break;
case EbtInt8:
newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
break;
case EbtUint8:
newConstArray[comp].setU8Const(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()));
break;
case EbtInt16:
newConstArray[comp].setI16Const(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()));
break;
case EbtUint16:
newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
break;
case EbtInt:
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
break;
case EbtUint:
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
break;
case EbtInt64:
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
break;
case EbtUint64:
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
break;
default: assert(false && "Default missing");
}
break;
case EOpClamp:
if (isFloatingPoint)
switch(children[0]->getAsTyped()->getBasicType()) {
case EbtFloat16:
case EbtFloat:
case EbtDouble:
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
childConstUnions[2][arg2comp].getDConst()));
else if (isSigned) {
if (isInt64)
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
childConstUnions[2][arg2comp].getI64Const()));
else
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
break;
case EbtInt8:
newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
childConstUnions[2][arg2comp].getI8Const()));
break;
case EbtUint8:
newConstArray[comp].setU8Const(std::min(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()),
childConstUnions[2][arg2comp].getU8Const()));
break;
case EbtInt16:
newConstArray[comp].setI16Const(std::min(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()),
childConstUnions[2][arg2comp].getI16Const()));
break;
case EbtUint16:
newConstArray[comp].setU16Const(std::min(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()),
childConstUnions[2][arg2comp].getU16Const()));
break;
case EbtInt:
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
childConstUnions[2][arg2comp].getIConst()));
} else {
if (isInt64)
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
childConstUnions[2][arg2comp].getU64Const()));
else
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
break;
case EbtUint:
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
childConstUnions[2][arg2comp].getUConst()));
break;
case EbtInt64:
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
childConstUnions[2][arg2comp].getI64Const()));
break;
case EbtUint64:
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
childConstUnions[2][arg2comp].getU64Const()));
break;
default: assert(false && "Default missing");
}
break;
case EOpLessThan:

File diff suppressed because it is too large Load diff

View file

@ -67,7 +67,6 @@ public:
virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; }
virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) = 0;
virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0;
protected:
@ -89,7 +88,6 @@ public:
void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage);
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable);
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
protected:

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,7 @@
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2015 LunarG, Inc.
// Copyright (C) 2015-2016 Google, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -1632,9 +1633,33 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
intermediate.setMultiStream();
break;
case EOpSubgroupClusteredAdd:
case EOpSubgroupClusteredMul:
case EOpSubgroupClusteredMin:
case EOpSubgroupClusteredMax:
case EOpSubgroupClusteredAnd:
case EOpSubgroupClusteredOr:
case EOpSubgroupClusteredXor:
if ((*argp)[1]->getAsConstantUnion() == nullptr)
error(loc, "argument must be compile-time constant", "cluster size", "");
else {
int size = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst();
if (size < 1)
error(loc, "argument must be at least 1", "cluster size", "");
else if (!IsPow2(size))
error(loc, "argument must be a power of 2", "cluster size", "");
}
break;
default:
break;
}
if (callNode.getOp() > EOpSubgroupGuardStart && callNode.getOp() < EOpSubgroupGuardStop) {
// these require SPIR-V 1.3
if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3)
error(loc, "requires SPIR-V 1.3", "subgroup op", "");
}
}
extern bool PureOperatorBuiltins;
@ -2196,7 +2221,6 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
case EOpConstructDMat4x2:
case EOpConstructDMat4x3:
case EOpConstructDMat4x4:
#ifdef AMD_EXTENSIONS
case EOpConstructF16Mat2x2:
case EOpConstructF16Mat2x3:
case EOpConstructF16Mat2x4:
@ -2206,7 +2230,6 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
case EOpConstructF16Mat4x2:
case EOpConstructF16Mat4x3:
case EOpConstructF16Mat4x4:
#endif
constructingMatrix = true;
break;
default:
@ -2263,18 +2286,30 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// Finish pinning down spec-const semantics
if (specConstType) {
switch (op) {
case EOpConstructInt8:
case EOpConstructUint8:
case EOpConstructInt16:
case EOpConstructUint16:
case EOpConstructInt:
case EOpConstructUint:
case EOpConstructInt64:
case EOpConstructUint64:
#ifdef AMD_EXTENSIONS
case EOpConstructInt16:
case EOpConstructUint16:
#endif
case EOpConstructBool:
case EOpConstructBVec2:
case EOpConstructBVec3:
case EOpConstructBVec4:
case EOpConstructI8Vec2:
case EOpConstructI8Vec3:
case EOpConstructI8Vec4:
case EOpConstructU8Vec2:
case EOpConstructU8Vec3:
case EOpConstructU8Vec4:
case EOpConstructI16Vec2:
case EOpConstructI16Vec3:
case EOpConstructI16Vec4:
case EOpConstructU16Vec2:
case EOpConstructU16Vec3:
case EOpConstructU16Vec4:
case EOpConstructIVec2:
case EOpConstructIVec3:
case EOpConstructIVec4:
@ -2287,14 +2322,6 @@ 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();
@ -2602,12 +2629,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
return;
}
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)
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble)
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
#ifdef AMD_EXTENSIONS
@ -2615,13 +2637,13 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
#else
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 ||
if (isTypeInt(publicType.basicType) ||
publicType.basicType == EbtDouble ||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt8) ||
publicType.userDef->containsBasicType(EbtUint8) ||
publicType.userDef->containsBasicType(EbtInt16) ||
publicType.userDef->containsBasicType(EbtUint16) ||
publicType.userDef->containsBasicType(EbtInt) ||
publicType.userDef->containsBasicType(EbtUint) ||
publicType.userDef->containsBasicType(EbtInt64) ||
publicType.userDef->containsBasicType(EbtUint64) ||
@ -4643,11 +4665,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
// containing a double, the offset must also be a multiple of 8..."
if (type.containsBasicType(EbtDouble) && ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8))
error(loc, "type contains double; xfb_offset must be a multiple of 8", "xfb_offset", "");
#ifdef AMD_EXTENSIONS
// ..., if applied to an aggregate containing a float16_t, the offset must also be a multiple of 2..."
else if (type.containsBasicType(EbtFloat16) && !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2))
error(loc, "type contains half float; xfb_offset must be a multiple of 2", "xfb_offset", "");
#endif
else if (! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4))
error(loc, "must be a multiple of size of first component", "xfb_offset", "");
}
@ -4758,20 +4778,18 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
error(loc, "can only be applied to a scalar", "constant_id", "");
switch (type.getBasicType())
{
case EbtInt8:
case EbtUint8:
case EbtInt16:
case EbtUint16:
case EbtInt:
case EbtUint:
case EbtInt64:
case EbtUint64:
#ifdef AMD_EXTENSIONS
case EbtInt16:
case EbtUint16:
#endif
case EbtBool:
case EbtFloat:
case EbtDouble:
#ifdef AMD_EXTENSIONS
case EbtFloat16:
#endif
break;
default:
error(loc, "cannot be applied to this type", "constant_id", "");
@ -4968,10 +4986,21 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
return nullptr;
}
bool explicitTypesEnabled = extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32) ||
extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64);
if (profile == EEsProfile || version < 120)
function = findFunctionExact(loc, call, builtIn);
else if (version < 400)
function = findFunction120(loc, call, builtIn);
else if (explicitTypesEnabled)
function = findFunctionExplicitTypes(loc, call, builtIn);
else
function = findFunction400(loc, call, builtIn);
@ -5156,6 +5185,85 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu
return bestMatch;
}
// "To determine whether the conversion for a single argument in one match
// is better than that for another match, the conversion is assigned of the
// three ranks ordered from best to worst:
// 1. Exact match: no conversion.
// 2. Promotion: integral or floating-point promotion.
// 3. Conversion: integral conversion, floating-point conversion,
// floating-integral conversion.
// A conversion C1 is better than a conversion C2 if the rank of C1 is
// better than the rank of C2."
const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn)
{
// first, look for an exact match
TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn);
if (symbol)
return symbol->getAsFunction();
// no exact match, use the generic selector, parameterized by the GLSL rules
// create list of candidates to send
TVector<const TFunction*> candidateList;
symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn);
// can 'from' convert to 'to'?
const auto convertible = [this](const TType& from, const TType& to, TOperator, int) -> bool {
if (from == to)
return true;
if (from.isArray() || to.isArray() || ! from.sameElementShape(to))
return false;
return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType());
};
// Is 'to2' a better conversion than 'to1'?
// Ties should not be considered as better.
// Assumes 'convertible' already said true.
const auto better = [this](const TType& from, const TType& to1, const TType& to2) -> bool {
// 1. exact match
if (from == to2)
return from != to1;
if (from == to1)
return false;
// 2. Promotion (integral, floating-point) is better
TBasicType from_type = from.getBasicType();
TBasicType to1_type = to1.getBasicType();
TBasicType to2_type = to2.getBasicType();
bool isPromotion1 = (intermediate.isIntegralPromotion(from_type, to1_type) ||
intermediate.isFPPromotion(from_type, to1_type));
bool isPromotion2 = (intermediate.isIntegralPromotion(from_type, to2_type) ||
intermediate.isFPPromotion(from_type, to2_type));
if (isPromotion2)
return !isPromotion1;
if(isPromotion1)
return false;
// 3. Conversion (integral, floating-point , floating-integral)
bool isConversion1 = (intermediate.isIntegralConversion(from_type, to1_type) ||
intermediate.isFPConversion(from_type, to1_type) ||
intermediate.isFPIntegralConversion(from_type, to1_type));
bool isConversion2 = (intermediate.isIntegralConversion(from_type, to2_type) ||
intermediate.isFPConversion(from_type, to2_type) ||
intermediate.isFPIntegralConversion(from_type, to2_type));
return isConversion2 && !isConversion1;
};
// for ambiguity reporting
bool tie = false;
// send to the generic selector
const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie);
if (bestMatch == nullptr)
error(loc, "no matching overloaded function found", call.getName().c_str(), "");
else if (tie)
error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), "");
return bestMatch;
}
// When a declaration includes a type, but not a variable name, it can be
// to establish defaults.
void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType)
@ -5680,7 +5788,6 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
basicOp = EOpConstructDouble;
break;
#ifdef AMD_EXTENSIONS
case EOpConstructF16Vec2:
case EOpConstructF16Vec3:
case EOpConstructF16Vec4:
@ -5696,7 +5803,34 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EOpConstructFloat16:
basicOp = EOpConstructFloat16;
break;
#endif
case EOpConstructI8Vec2:
case EOpConstructI8Vec3:
case EOpConstructI8Vec4:
case EOpConstructInt8:
basicOp = EOpConstructInt8;
break;
case EOpConstructU8Vec2:
case EOpConstructU8Vec3:
case EOpConstructU8Vec4:
case EOpConstructUint8:
basicOp = EOpConstructUint8;
break;
case EOpConstructI16Vec2:
case EOpConstructI16Vec3:
case EOpConstructI16Vec4:
case EOpConstructInt16:
basicOp = EOpConstructInt16;
break;
case EOpConstructU16Vec2:
case EOpConstructU16Vec3:
case EOpConstructU16Vec4:
case EOpConstructUint16:
basicOp = EOpConstructUint16;
break;
case EOpConstructIVec2:
case EOpConstructIVec3:
@ -5726,22 +5860,6 @@ 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:

View file

@ -392,6 +392,7 @@ public:
const TFunction* findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
const TFunction* findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
void declareTypeDefaults(const TSourceLoc&, const TPublicType&);
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0);
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -464,16 +465,34 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["u64vec3"] = U64VEC3;
(*KeywordMap)["u64vec4"] = U64VEC4;
#ifdef AMD_EXTENSIONS
// GL_KHX_shader_explicit_arithmetic_types
(*KeywordMap)["int8_t"] = INT8_T;
(*KeywordMap)["i8vec2"] = I8VEC2;
(*KeywordMap)["i8vec3"] = I8VEC3;
(*KeywordMap)["i8vec4"] = I8VEC4;
(*KeywordMap)["uint8_t"] = UINT8_T;
(*KeywordMap)["u8vec2"] = U8VEC2;
(*KeywordMap)["u8vec3"] = U8VEC3;
(*KeywordMap)["u8vec4"] = U8VEC4;
(*KeywordMap)["int16_t"] = INT16_T;
(*KeywordMap)["uint16_t"] = UINT16_T;
(*KeywordMap)["i16vec2"] = I16VEC2;
(*KeywordMap)["i16vec3"] = I16VEC3;
(*KeywordMap)["i16vec4"] = I16VEC4;
(*KeywordMap)["uint16_t"] = UINT16_T;
(*KeywordMap)["u16vec2"] = U16VEC2;
(*KeywordMap)["u16vec3"] = U16VEC3;
(*KeywordMap)["u16vec4"] = U16VEC4;
(*KeywordMap)["int32_t"] = INT32_T;
(*KeywordMap)["i32vec2"] = I32VEC2;
(*KeywordMap)["i32vec3"] = I32VEC3;
(*KeywordMap)["i32vec4"] = I32VEC4;
(*KeywordMap)["uint32_t"] = UINT32_T;
(*KeywordMap)["u32vec2"] = U32VEC2;
(*KeywordMap)["u32vec3"] = U32VEC3;
(*KeywordMap)["u32vec4"] = U32VEC4;
(*KeywordMap)["float16_t"] = FLOAT16_T;
(*KeywordMap)["f16vec2"] = F16VEC2;
(*KeywordMap)["f16vec3"] = F16VEC3;
@ -490,7 +509,39 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["f16mat4x2"] = F16MAT4X2;
(*KeywordMap)["f16mat4x3"] = F16MAT4X3;
(*KeywordMap)["f16mat4x4"] = F16MAT4X4;
#endif
(*KeywordMap)["float32_t"] = FLOAT32_T;
(*KeywordMap)["f32vec2"] = F32VEC2;
(*KeywordMap)["f32vec3"] = F32VEC3;
(*KeywordMap)["f32vec4"] = F32VEC4;
(*KeywordMap)["f32mat2"] = F32MAT2;
(*KeywordMap)["f32mat3"] = F32MAT3;
(*KeywordMap)["f32mat4"] = F32MAT4;
(*KeywordMap)["f32mat2x2"] = F32MAT2X2;
(*KeywordMap)["f32mat2x3"] = F32MAT2X3;
(*KeywordMap)["f32mat2x4"] = F32MAT2X4;
(*KeywordMap)["f32mat3x2"] = F32MAT3X2;
(*KeywordMap)["f32mat3x3"] = F32MAT3X3;
(*KeywordMap)["f32mat3x4"] = F32MAT3X4;
(*KeywordMap)["f32mat4x2"] = F32MAT4X2;
(*KeywordMap)["f32mat4x3"] = F32MAT4X3;
(*KeywordMap)["f32mat4x4"] = F32MAT4X4;
(*KeywordMap)["float64_t"] = FLOAT64_T;
(*KeywordMap)["f64vec2"] = F64VEC2;
(*KeywordMap)["f64vec3"] = F64VEC3;
(*KeywordMap)["f64vec4"] = F64VEC4;
(*KeywordMap)["f64mat2"] = F64MAT2;
(*KeywordMap)["f64mat3"] = F64MAT3;
(*KeywordMap)["f64mat4"] = F64MAT4;
(*KeywordMap)["f64mat2x2"] = F64MAT2X2;
(*KeywordMap)["f64mat2x3"] = F64MAT2X3;
(*KeywordMap)["f64mat2x4"] = F64MAT2X4;
(*KeywordMap)["f64mat3x2"] = F64MAT3X2;
(*KeywordMap)["f64mat3x3"] = F64MAT3X3;
(*KeywordMap)["f64mat3x4"] = F64MAT3X4;
(*KeywordMap)["f64mat4x2"] = F64MAT4X2;
(*KeywordMap)["f64mat4x3"] = F64MAT4X3;
(*KeywordMap)["f64mat4x4"] = F64MAT4X4;
(*KeywordMap)["sampler2D"] = SAMPLER2D;
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
@ -763,19 +814,15 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
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
case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT;
#endif
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT;
case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT;
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT;
case PpAtomIdentifier:
{
int token = tokenizeIdentifier();
@ -1036,11 +1083,28 @@ int TScanContext::tokenizeIdentifier()
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64)))
(parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64))))
return keyword;
return identifierOrType();
case INT8_T:
case UINT8_T:
case I8VEC2:
case I8VEC3:
case I8VEC4:
case U8VEC2:
case U8VEC3:
case U8VEC4:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8)) &&
parseContext.profile != EEsProfile && parseContext.version >= 450))
return keyword;
return identifierOrType();
#ifdef AMD_EXTENSIONS
case INT16_T:
case UINT16_T:
case I16VEC2:
@ -1052,7 +1116,74 @@ int TScanContext::tokenizeIdentifier()
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16)))
(
#ifdef AMD_EXTENSIONS
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) ||
#endif
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16))))
return keyword;
return identifierOrType();
case INT32_T:
case UINT32_T:
case I32VEC2:
case I32VEC3:
case I32VEC4:
case U32VEC2:
case U32VEC3:
case U32VEC4:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32)) &&
parseContext.profile != EEsProfile && parseContext.version >= 450))
return keyword;
return identifierOrType();
case FLOAT32_T:
case F32VEC2:
case F32VEC3:
case F32VEC4:
case F32MAT2:
case F32MAT3:
case F32MAT4:
case F32MAT2X2:
case F32MAT2X3:
case F32MAT2X4:
case F32MAT3X2:
case F32MAT3X3:
case F32MAT3X4:
case F32MAT4X2:
case F32MAT4X3:
case F32MAT4X4:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32)) &&
parseContext.profile != EEsProfile && parseContext.version >= 450))
return keyword;
return identifierOrType();
case FLOAT64_T:
case F64VEC2:
case F64VEC3:
case F64VEC4:
case F64MAT2:
case F64MAT3:
case F64MAT4:
case F64MAT2X2:
case F64MAT2X3:
case F64MAT2X4:
case F64MAT3X2:
case F64MAT3X3:
case F64MAT3X4:
case F64MAT4X2:
case F64MAT4X3:
case F64MAT4X4:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64)) &&
parseContext.profile != EEsProfile && parseContext.version >= 450))
return keyword;
return identifierOrType();
@ -1075,11 +1206,15 @@ int TScanContext::tokenizeIdentifier()
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)))
(
#ifdef AMD_EXTENSIONS
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) ||
#endif
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) ||
parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16))))
return keyword;
return identifierOrType();
#endif
case SAMPLERCUBEARRAY:
case SAMPLERCUBEARRAYSHADOW:

View file

@ -619,9 +619,9 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages
{
// Set up environmental defaults, first ignoring 'environment'.
if (messages & EShMsgSpvRules)
spvVersion.spv = 0x00010000;
spvVersion.spv = EShTargetSpv_1_0;
if (messages & EShMsgVulkanRules) {
spvVersion.vulkan = 100;
spvVersion.vulkan = EShTargetVulkan_1_0;
spvVersion.vulkanGlsl = 100;
} else if (spvVersion.spv != 0)
spvVersion.openGl = 100;

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -60,17 +61,15 @@ void TType::buildMangledName(TString& mangledName) const
switch (basicType) {
case EbtFloat: mangledName += 'f'; break;
case EbtDouble: mangledName += 'd'; break;
#ifdef AMD_EXTENSIONS
case EbtFloat16: mangledName += "f16"; break;
#endif
case EbtInt: mangledName += 'i'; break;
case EbtUint: mangledName += 'u'; break;
case EbtInt64: mangledName += "i64"; break;
case EbtUint64: mangledName += "u64"; break;
#ifdef AMD_EXTENSIONS
case EbtInt8: mangledName += "i8"; break;
case EbtUint8: mangledName += "u8"; break;
case EbtInt16: mangledName += "i16"; break;
case EbtUint16: mangledName += "u16"; break;
#endif
case EbtInt64: mangledName += "i64"; break;
case EbtUint64: mangledName += "u64"; break;
case EbtBool: mangledName += 'b'; break;
case EbtAtomicUint: mangledName += "au"; break;
case EbtSampler:

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -185,6 +186,15 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_arithmetic] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_ballot] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_shuffle] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable;
extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable;
@ -252,6 +262,16 @@ void TParseVersions::initializeExtensionBehavior()
// OVR extensions
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
extensionBehavior[E_GL_OVR_multiview2] = EBhDisable;
// explicit types
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int8] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int16] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int32] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int64] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float16] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float32] = EBhDisable;
extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float64] = EBhDisable;
}
// Get code that is not part of a shared symbol table, is specific to this shader,
@ -332,6 +352,16 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_post_depth_coverage 1\n"
"#define GL_EXT_control_flow_attributes 1\n"
// GL_KHR_shader_subgroup
"#define GL_KHR_shader_subgroup_basic 1\n"
"#define GL_KHR_shader_subgroup_vote 1\n"
"#define GL_KHR_shader_subgroup_arithmetic 1\n"
"#define GL_KHR_shader_subgroup_ballot 1\n"
"#define GL_KHR_shader_subgroup_shuffle 1\n"
"#define GL_KHR_shader_subgroup_shuffle_relative 1\n"
"#define GL_KHR_shader_subgroup_clustered 1\n"
"#define GL_KHR_shader_subgroup_quad 1\n"
#ifdef AMD_EXTENSIONS
"#define GL_AMD_shader_ballot 1\n"
"#define GL_AMD_shader_trinary_minmax 1\n"
@ -352,6 +382,14 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_NV_shader_atomic_int64 1\n"
"#define GL_NV_conservative_raster_underestimation 1\n"
#endif
"#define GL_KHX_shader_explicit_arithmetic_types 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_int16 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_int32 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_int64 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_float16 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_float32 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_float64 1\n"
;
if (version >= 150) {
@ -689,6 +727,21 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString);
else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0)
updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString);
// subgroup_* to subgroup_basic
else if (strcmp(extension, "GL_KHR_shader_subgroup_vote") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_arithmetic") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_ballot") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle_relative") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_clustered") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0)
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
}
void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior)
@ -746,29 +799,66 @@ void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
profileRequires(loc, ECompatibilityProfile, 400, nullptr, 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, op);
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) {
requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, op);
if (!builtIn) {
#if AMD_EXTENSIONS
const char* const extensions[3] = {E_GL_AMD_gpu_shader_half_float,
E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_float16};
#else
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_float16};
#endif
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
// Call for any operation needing GLSL float32 data-type support.
void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_float32};
requireExtensions(loc, 2, extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
// Call for any operation needing GLSL float64 data-type support.
void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_float64};
requireExtensions(loc, 2, extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
// Call for any operation needing GLSL explicit int8 data-type support.
void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (! builtIn) {
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int8};
requireExtensions(loc, 2, extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
#ifdef AMD_EXTENSIONS
// Call for any operation needing GLSL float16 opaque-type support
void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn)
{
@ -781,11 +871,46 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b
}
#endif
// Call for any operation needing GLSL explicit int16 data-type support.
void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (! builtIn) {
#if AMD_EXTENSIONS
const char* const extensions[3] = {E_GL_AMD_gpu_shader_int16,
E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int16};
#else
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int16};
#endif
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
// Call for any operation needing GLSL explicit int32 data-type support.
void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (! builtIn) {
const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int32};
requireExtensions(loc, 2, extensions, "explicit types");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
}
}
// Call for any operation needing GLSL 64-bit integer data-type support.
void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (! builtIn) {
requireExtensions(loc, 1, &E_GL_ARB_gpu_shader_int64, op);
const char* const extensions[3] = {E_GL_ARB_gpu_shader_int64,
E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int64};
requireExtensions(loc, 3, extensions, "shader int64");
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires(loc, ECoreProfile, 450, nullptr, op);
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -139,6 +140,15 @@ const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil
const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage";
const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array";
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic";
const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot";
const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle";
const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative";
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_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";
@ -221,6 +231,16 @@ const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessel
const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer";
const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array";
// KHX
const char* const E_GL_KHX_shader_explicit_arithmetic_types = "GL_KHX_shader_explicit_arithmetic_types";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_int8 = "GL_KHX_shader_explicit_arithmetic_types_int8";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_int16 = "GL_KHX_shader_explicit_arithmetic_types_int16";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_int32 = "GL_KHX_shader_explicit_arithmetic_types_int32";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_int64 = "GL_KHX_shader_explicit_arithmetic_types_int64";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_float16 = "GL_KHX_shader_explicit_arithmetic_types_float16";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_float32 = "GL_KHX_shader_explicit_arithmetic_types_float32";
const char* const E_GL_KHX_shader_explicit_arithmetic_types_float64 = "GL_KHX_shader_explicit_arithmetic_types_float64";
// Arrays of extensions for the above AEP duplications
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -123,15 +124,28 @@ extern int yylex(YYSTYPE*, TParseContext&);
%expect 1 // One shift reduce conflict because of if | else
%token <lex> ATTRIBUTE VARYING
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T INT16_T UINT16_T FLOAT16_T
%token <lex> FLOAT16_T FLOAT FLOAT32_T DOUBLE FLOAT64_T
%token <lex> CONST BOOL INT UINT INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4
%token <lex> BVEC2 BVEC3 BVEC4
%token <lex> IVEC2 IVEC3 IVEC4
%token <lex> UVEC2 UVEC3 UVEC4
%token <lex> I64VEC2 I64VEC3 I64VEC4
%token <lex> U64VEC2 U64VEC3 U64VEC4
%token <lex> I32VEC2 I32VEC3 I32VEC4
%token <lex> U32VEC2 U32VEC3 U32VEC4
%token <lex> I16VEC2 I16VEC3 I16VEC4
%token <lex> U16VEC2 U16VEC3 U16VEC4
%token <lex> I8VEC2 I8VEC3 I8VEC4
%token <lex> U8VEC2 U8VEC3 U8VEC4
%token <lex> VEC2 VEC3 VEC4
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
%token <lex> I16VEC2 I16VEC3 I16VEC4 U16VEC2 U16VEC3 U16VEC4
%token <lex> F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4
%token <lex> F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD
%token <lex> MAT2X2 MAT2X3 MAT2X4
@ -143,6 +157,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> F16MAT2X2 F16MAT2X3 F16MAT2X4
%token <lex> F16MAT3X2 F16MAT3X3 F16MAT3X4
%token <lex> F16MAT4X2 F16MAT4X3 F16MAT4X4
%token <lex> F32MAT2X2 F32MAT2X3 F32MAT2X4
%token <lex> F32MAT3X2 F32MAT3X3 F32MAT3X4
%token <lex> F32MAT4X2 F32MAT4X3 F32MAT4X4
%token <lex> F64MAT2X2 F64MAT2X3 F64MAT2X4
%token <lex> F64MAT3X2 F64MAT3X3 F64MAT3X4
%token <lex> F64MAT4X2 F64MAT4X3 F64MAT4X4
%token <lex> ATOMIC_UINT
// combined image/sampler
@ -206,7 +226,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> STRUCT VOID WHILE
%token <lex> IDENTIFIER TYPE_NAME
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT INT16CONSTANT UINT16CONSTANT BOOLCONSTANT FLOAT16CONSTANT
%token <lex> FLOATCONSTANT DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT INT32CONSTANT UINT32CONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT FLOAT16CONSTANT
%token <lex> LEFT_OP RIGHT_OP
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
@ -278,6 +298,14 @@ primary_expression
: variable_identifier {
$$ = $1;
}
| INT32CONSTANT {
parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
$$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
}
| UINT32CONSTANT {
parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
}
| INTCONSTANT {
$$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
}
@ -294,16 +322,12 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
}
| INT16CONSTANT {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit integer literal");
parseContext.explicitInt16Check($1.loc, "16-bit integer literal");
$$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true);
#endif
}
| UINT16CONSTANT {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit unsigned integer literal");
parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal");
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
#endif
}
| FLOATCONSTANT {
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
@ -313,10 +337,8 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
}
| FLOAT16CONSTANT {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float literal");
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
#endif
}
| BOOLCONSTANT {
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
@ -1375,11 +1397,19 @@ type_specifier_nonarray
$$.basicType = EbtDouble;
}
| FLOAT16_T {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float", parseContext.symbolTable.atBuiltInLevel());
parseContext.float16Check($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
#endif
}
| FLOAT32_T {
parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
}
| FLOAT64_T {
parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
}
| INT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1390,6 +1420,36 @@ type_specifier_nonarray
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
}
| INT8_T {
parseContext.explicitInt8Check($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt8;
}
| UINT8_T {
parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint8;
}
| INT16_T {
parseContext.explicitInt16Check($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
}
| UINT16_T {
parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
}
| INT32_T {
parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
}
| UINT32_T {
parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
}
| INT64_T {
parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1400,20 +1460,6 @@ type_specifier_nonarray
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint64;
}
| INT16_T {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
#endif
}
| UINT16_T {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
#endif
}
| BOOL {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtBool;
@ -1452,28 +1498,58 @@ type_specifier_nonarray
$$.setVector(4);
}
| F16VEC2 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setVector(2);
#endif
}
| F16VEC3 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setVector(3);
#endif
}
| F16VEC4 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setVector(4);
#endif
}
| F32VEC2 {
parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setVector(2);
}
| F32VEC3 {
parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setVector(3);
}
| F32VEC4 {
parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setVector(4);
}
| F64VEC2 {
parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(2);
}
| F64VEC3 {
parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(3);
}
| F64VEC4 {
parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(4);
}
| BVEC2 {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1505,6 +1581,60 @@ type_specifier_nonarray
$$.basicType = EbtInt;
$$.setVector(4);
}
| I8VEC2 {
parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt8;
$$.setVector(2);
}
| I8VEC3 {
parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt8;
$$.setVector(3);
}
| I8VEC4 {
parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt8;
$$.setVector(4);
}
| I16VEC2 {
parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(2);
}
| I16VEC3 {
parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(3);
}
| I16VEC4 {
parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(4);
}
| I32VEC2 {
parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.setVector(2);
}
| I32VEC3 {
parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.setVector(3);
}
| I32VEC4 {
parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.setVector(4);
}
| I64VEC2 {
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1523,30 +1653,6 @@ type_specifier_nonarray
$$.basicType = EbtInt64;
$$.setVector(4);
}
| I16VEC2 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(2);
#endif
}
| I16VEC3 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(3);
#endif
}
| I16VEC4 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt16;
$$.setVector(4);
#endif
}
| UVEC2 {
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1565,6 +1671,60 @@ type_specifier_nonarray
$$.basicType = EbtUint;
$$.setVector(4);
}
| U8VEC2 {
parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint8;
$$.setVector(2);
}
| U8VEC3 {
parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt8;
$$.setVector(3);
}
| U8VEC4 {
parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint8;
$$.setVector(4);
}
| U16VEC2 {
parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(2);
}
| U16VEC3 {
parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(3);
}
| U16VEC4 {
parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(4);
}
| U32VEC2 {
parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.setVector(2);
}
| U32VEC3 {
parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.setVector(3);
}
| U32VEC4 {
parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.setVector(4);
}
| U64VEC2 {
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -1583,30 +1743,6 @@ type_specifier_nonarray
$$.basicType = EbtUint64;
$$.setVector(4);
}
| U16VEC2 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(2);
#endif
}
| U16VEC3 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(3);
#endif
}
| U16VEC4 {
#ifdef AMD_EXTENSIONS
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint16;
$$.setVector(4);
#endif
}
| MAT2 {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
@ -1740,100 +1876,220 @@ type_specifier_nonarray
$$.setMatrix(4, 4);
}
| F16MAT2 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(2, 2);
#endif
}
| F16MAT3 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(3, 3);
#endif
}
| F16MAT4 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(4, 4);
#endif
}
| F16MAT2X2 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(2, 2);
#endif
}
| F16MAT2X3 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(2, 3);
#endif
}
| F16MAT2X4 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(2, 4);
#endif
}
| F16MAT3X2 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(3, 2);
#endif
}
| F16MAT3X3 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(3, 3);
#endif
}
| F16MAT3X4 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(3, 4);
#endif
}
| F16MAT4X2 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(4, 2);
#endif
}
| F16MAT4X3 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(4, 3);
#endif
}
| F16MAT4X4 {
#ifdef AMD_EXTENSIONS
parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat16;
$$.setMatrix(4, 4);
#endif
}
| F32MAT2 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(2, 2);
}
| F32MAT3 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(3, 3);
}
| F32MAT4 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(4, 4);
}
| F32MAT2X2 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(2, 2);
}
| F32MAT2X3 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(2, 3);
}
| F32MAT2X4 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(2, 4);
}
| F32MAT3X2 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(3, 2);
}
| F32MAT3X3 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(3, 3);
}
| F32MAT3X4 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(3, 4);
}
| F32MAT4X2 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(4, 2);
}
| F32MAT4X3 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(4, 3);
}
| F32MAT4X4 {
parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.setMatrix(4, 4);
}
| F64MAT2 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| F64MAT3 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| F64MAT4 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
}
| F64MAT2X2 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| F64MAT2X3 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 3);
}
| F64MAT2X4 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 4);
}
| F64MAT3X2 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 2);
}
| F64MAT3X3 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| F64MAT3X4 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 4);
}
| F64MAT4X2 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 2);
}
| F64MAT4X3 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 3);
}
| F64MAT4X4 {
parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
}
| ATOMIC_UINT {
parseContext.vulkanRemoved($1.loc, "atomic counter types");

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
/* A Bison parser, made by GNU Bison 3.0. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2013 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
@ -30,8 +30,8 @@
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
#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
@ -47,350 +47,400 @@ extern int yydebug;
{
ATTRIBUTE = 258,
VARYING = 259,
CONST = 260,
BOOL = 261,
FLOAT = 262,
FLOAT16_T = 260,
FLOAT = 261,
FLOAT32_T = 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,
F16SAMPLER1D = 410,
F16SAMPLER2D = 411,
F16SAMPLER3D = 412,
F16SAMPLER2DRECT = 413,
F16SAMPLERCUBE = 414,
F16SAMPLER1DARRAY = 415,
F16SAMPLER2DARRAY = 416,
F16SAMPLERCUBEARRAY = 417,
F16SAMPLERBUFFER = 418,
F16SAMPLER2DMS = 419,
F16SAMPLER2DMSARRAY = 420,
F16SAMPLER1DSHADOW = 421,
F16SAMPLER2DSHADOW = 422,
F16SAMPLER1DARRAYSHADOW = 423,
F16SAMPLER2DARRAYSHADOW = 424,
F16SAMPLER2DRECTSHADOW = 425,
F16SAMPLERCUBESHADOW = 426,
F16SAMPLERCUBEARRAYSHADOW = 427,
SAMPLER = 428,
SAMPLERSHADOW = 429,
TEXTURE1D = 430,
TEXTURE2D = 431,
TEXTURE3D = 432,
TEXTURECUBE = 433,
TEXTURE1DARRAY = 434,
TEXTURE2DARRAY = 435,
ITEXTURE1D = 436,
ITEXTURE2D = 437,
ITEXTURE3D = 438,
ITEXTURECUBE = 439,
ITEXTURE1DARRAY = 440,
ITEXTURE2DARRAY = 441,
UTEXTURE1D = 442,
UTEXTURE2D = 443,
UTEXTURE3D = 444,
UTEXTURECUBE = 445,
UTEXTURE1DARRAY = 446,
UTEXTURE2DARRAY = 447,
TEXTURE2DRECT = 448,
ITEXTURE2DRECT = 449,
UTEXTURE2DRECT = 450,
TEXTUREBUFFER = 451,
ITEXTUREBUFFER = 452,
UTEXTUREBUFFER = 453,
TEXTURECUBEARRAY = 454,
ITEXTURECUBEARRAY = 455,
UTEXTURECUBEARRAY = 456,
TEXTURE2DMS = 457,
ITEXTURE2DMS = 458,
UTEXTURE2DMS = 459,
TEXTURE2DMSARRAY = 460,
ITEXTURE2DMSARRAY = 461,
UTEXTURE2DMSARRAY = 462,
F16TEXTURE1D = 463,
F16TEXTURE2D = 464,
F16TEXTURE3D = 465,
F16TEXTURE2DRECT = 466,
F16TEXTURECUBE = 467,
F16TEXTURE1DARRAY = 468,
F16TEXTURE2DARRAY = 469,
F16TEXTURECUBEARRAY = 470,
F16TEXTUREBUFFER = 471,
F16TEXTURE2DMS = 472,
F16TEXTURE2DMSARRAY = 473,
SUBPASSINPUT = 474,
SUBPASSINPUTMS = 475,
ISUBPASSINPUT = 476,
ISUBPASSINPUTMS = 477,
USUBPASSINPUT = 478,
USUBPASSINPUTMS = 479,
F16SUBPASSINPUT = 480,
F16SUBPASSINPUTMS = 481,
IMAGE1D = 482,
IIMAGE1D = 483,
UIMAGE1D = 484,
IMAGE2D = 485,
IIMAGE2D = 486,
UIMAGE2D = 487,
IMAGE3D = 488,
IIMAGE3D = 489,
UIMAGE3D = 490,
IMAGE2DRECT = 491,
IIMAGE2DRECT = 492,
UIMAGE2DRECT = 493,
IMAGECUBE = 494,
IIMAGECUBE = 495,
UIMAGECUBE = 496,
IMAGEBUFFER = 497,
IIMAGEBUFFER = 498,
UIMAGEBUFFER = 499,
IMAGE1DARRAY = 500,
IIMAGE1DARRAY = 501,
UIMAGE1DARRAY = 502,
IMAGE2DARRAY = 503,
IIMAGE2DARRAY = 504,
UIMAGE2DARRAY = 505,
IMAGECUBEARRAY = 506,
IIMAGECUBEARRAY = 507,
UIMAGECUBEARRAY = 508,
IMAGE2DMS = 509,
IIMAGE2DMS = 510,
UIMAGE2DMS = 511,
IMAGE2DMSARRAY = 512,
IIMAGE2DMSARRAY = 513,
UIMAGE2DMSARRAY = 514,
F16IMAGE1D = 515,
F16IMAGE2D = 516,
F16IMAGE3D = 517,
F16IMAGE2DRECT = 518,
F16IMAGECUBE = 519,
F16IMAGE1DARRAY = 520,
F16IMAGE2DARRAY = 521,
F16IMAGECUBEARRAY = 522,
F16IMAGEBUFFER = 523,
F16IMAGE2DMS = 524,
F16IMAGE2DMSARRAY = 525,
STRUCT = 526,
VOID = 527,
WHILE = 528,
IDENTIFIER = 529,
TYPE_NAME = 530,
FLOATCONSTANT = 531,
DOUBLECONSTANT = 532,
INTCONSTANT = 533,
UINTCONSTANT = 534,
INT64CONSTANT = 535,
UINT64CONSTANT = 536,
INT16CONSTANT = 537,
UINT16CONSTANT = 538,
BOOLCONSTANT = 539,
FLOAT16CONSTANT = 540,
LEFT_OP = 541,
RIGHT_OP = 542,
INC_OP = 543,
DEC_OP = 544,
LE_OP = 545,
GE_OP = 546,
EQ_OP = 547,
NE_OP = 548,
AND_OP = 549,
OR_OP = 550,
XOR_OP = 551,
MUL_ASSIGN = 552,
DIV_ASSIGN = 553,
ADD_ASSIGN = 554,
MOD_ASSIGN = 555,
LEFT_ASSIGN = 556,
RIGHT_ASSIGN = 557,
AND_ASSIGN = 558,
XOR_ASSIGN = 559,
OR_ASSIGN = 560,
SUB_ASSIGN = 561,
LEFT_PAREN = 562,
RIGHT_PAREN = 563,
LEFT_BRACKET = 564,
RIGHT_BRACKET = 565,
LEFT_BRACE = 566,
RIGHT_BRACE = 567,
DOT = 568,
COMMA = 569,
COLON = 570,
EQUAL = 571,
SEMICOLON = 572,
BANG = 573,
DASH = 574,
TILDE = 575,
PLUS = 576,
STAR = 577,
SLASH = 578,
PERCENT = 579,
LEFT_ANGLE = 580,
RIGHT_ANGLE = 581,
VERTICAL_BAR = 582,
CARET = 583,
AMPERSAND = 584,
QUESTION = 585,
INVARIANT = 586,
PRECISE = 587,
HIGH_PRECISION = 588,
MEDIUM_PRECISION = 589,
LOW_PRECISION = 590,
PRECISION = 591,
PACKED = 592,
RESOURCE = 593,
SUPERP = 594
FLOAT64_T = 264,
CONST = 265,
BOOL = 266,
INT = 267,
UINT = 268,
INT64_T = 269,
UINT64_T = 270,
INT32_T = 271,
UINT32_T = 272,
INT16_T = 273,
UINT16_T = 274,
INT8_T = 275,
UINT8_T = 276,
BREAK = 277,
CONTINUE = 278,
DO = 279,
ELSE = 280,
FOR = 281,
IF = 282,
DISCARD = 283,
RETURN = 284,
SWITCH = 285,
CASE = 286,
DEFAULT = 287,
SUBROUTINE = 288,
BVEC2 = 289,
BVEC3 = 290,
BVEC4 = 291,
IVEC2 = 292,
IVEC3 = 293,
IVEC4 = 294,
UVEC2 = 295,
UVEC3 = 296,
UVEC4 = 297,
I64VEC2 = 298,
I64VEC3 = 299,
I64VEC4 = 300,
U64VEC2 = 301,
U64VEC3 = 302,
U64VEC4 = 303,
I32VEC2 = 304,
I32VEC3 = 305,
I32VEC4 = 306,
U32VEC2 = 307,
U32VEC3 = 308,
U32VEC4 = 309,
I16VEC2 = 310,
I16VEC3 = 311,
I16VEC4 = 312,
U16VEC2 = 313,
U16VEC3 = 314,
U16VEC4 = 315,
I8VEC2 = 316,
I8VEC3 = 317,
I8VEC4 = 318,
U8VEC2 = 319,
U8VEC3 = 320,
U8VEC4 = 321,
VEC2 = 322,
VEC3 = 323,
VEC4 = 324,
MAT2 = 325,
MAT3 = 326,
MAT4 = 327,
CENTROID = 328,
IN = 329,
OUT = 330,
INOUT = 331,
UNIFORM = 332,
PATCH = 333,
SAMPLE = 334,
BUFFER = 335,
SHARED = 336,
COHERENT = 337,
VOLATILE = 338,
RESTRICT = 339,
READONLY = 340,
WRITEONLY = 341,
DVEC2 = 342,
DVEC3 = 343,
DVEC4 = 344,
DMAT2 = 345,
DMAT3 = 346,
DMAT4 = 347,
F16VEC2 = 348,
F16VEC3 = 349,
F16VEC4 = 350,
F16MAT2 = 351,
F16MAT3 = 352,
F16MAT4 = 353,
F32VEC2 = 354,
F32VEC3 = 355,
F32VEC4 = 356,
F32MAT2 = 357,
F32MAT3 = 358,
F32MAT4 = 359,
F64VEC2 = 360,
F64VEC3 = 361,
F64VEC4 = 362,
F64MAT2 = 363,
F64MAT3 = 364,
F64MAT4 = 365,
NOPERSPECTIVE = 366,
FLAT = 367,
SMOOTH = 368,
LAYOUT = 369,
__EXPLICITINTERPAMD = 370,
MAT2X2 = 371,
MAT2X3 = 372,
MAT2X4 = 373,
MAT3X2 = 374,
MAT3X3 = 375,
MAT3X4 = 376,
MAT4X2 = 377,
MAT4X3 = 378,
MAT4X4 = 379,
DMAT2X2 = 380,
DMAT2X3 = 381,
DMAT2X4 = 382,
DMAT3X2 = 383,
DMAT3X3 = 384,
DMAT3X4 = 385,
DMAT4X2 = 386,
DMAT4X3 = 387,
DMAT4X4 = 388,
F16MAT2X2 = 389,
F16MAT2X3 = 390,
F16MAT2X4 = 391,
F16MAT3X2 = 392,
F16MAT3X3 = 393,
F16MAT3X4 = 394,
F16MAT4X2 = 395,
F16MAT4X3 = 396,
F16MAT4X4 = 397,
F32MAT2X2 = 398,
F32MAT2X3 = 399,
F32MAT2X4 = 400,
F32MAT3X2 = 401,
F32MAT3X3 = 402,
F32MAT3X4 = 403,
F32MAT4X2 = 404,
F32MAT4X3 = 405,
F32MAT4X4 = 406,
F64MAT2X2 = 407,
F64MAT2X3 = 408,
F64MAT2X4 = 409,
F64MAT3X2 = 410,
F64MAT3X3 = 411,
F64MAT3X4 = 412,
F64MAT4X2 = 413,
F64MAT4X3 = 414,
F64MAT4X4 = 415,
ATOMIC_UINT = 416,
SAMPLER1D = 417,
SAMPLER2D = 418,
SAMPLER3D = 419,
SAMPLERCUBE = 420,
SAMPLER1DSHADOW = 421,
SAMPLER2DSHADOW = 422,
SAMPLERCUBESHADOW = 423,
SAMPLER1DARRAY = 424,
SAMPLER2DARRAY = 425,
SAMPLER1DARRAYSHADOW = 426,
SAMPLER2DARRAYSHADOW = 427,
ISAMPLER1D = 428,
ISAMPLER2D = 429,
ISAMPLER3D = 430,
ISAMPLERCUBE = 431,
ISAMPLER1DARRAY = 432,
ISAMPLER2DARRAY = 433,
USAMPLER1D = 434,
USAMPLER2D = 435,
USAMPLER3D = 436,
USAMPLERCUBE = 437,
USAMPLER1DARRAY = 438,
USAMPLER2DARRAY = 439,
SAMPLER2DRECT = 440,
SAMPLER2DRECTSHADOW = 441,
ISAMPLER2DRECT = 442,
USAMPLER2DRECT = 443,
SAMPLERBUFFER = 444,
ISAMPLERBUFFER = 445,
USAMPLERBUFFER = 446,
SAMPLERCUBEARRAY = 447,
SAMPLERCUBEARRAYSHADOW = 448,
ISAMPLERCUBEARRAY = 449,
USAMPLERCUBEARRAY = 450,
SAMPLER2DMS = 451,
ISAMPLER2DMS = 452,
USAMPLER2DMS = 453,
SAMPLER2DMSARRAY = 454,
ISAMPLER2DMSARRAY = 455,
USAMPLER2DMSARRAY = 456,
SAMPLEREXTERNALOES = 457,
F16SAMPLER1D = 458,
F16SAMPLER2D = 459,
F16SAMPLER3D = 460,
F16SAMPLER2DRECT = 461,
F16SAMPLERCUBE = 462,
F16SAMPLER1DARRAY = 463,
F16SAMPLER2DARRAY = 464,
F16SAMPLERCUBEARRAY = 465,
F16SAMPLERBUFFER = 466,
F16SAMPLER2DMS = 467,
F16SAMPLER2DMSARRAY = 468,
F16SAMPLER1DSHADOW = 469,
F16SAMPLER2DSHADOW = 470,
F16SAMPLER1DARRAYSHADOW = 471,
F16SAMPLER2DARRAYSHADOW = 472,
F16SAMPLER2DRECTSHADOW = 473,
F16SAMPLERCUBESHADOW = 474,
F16SAMPLERCUBEARRAYSHADOW = 475,
SAMPLER = 476,
SAMPLERSHADOW = 477,
TEXTURE1D = 478,
TEXTURE2D = 479,
TEXTURE3D = 480,
TEXTURECUBE = 481,
TEXTURE1DARRAY = 482,
TEXTURE2DARRAY = 483,
ITEXTURE1D = 484,
ITEXTURE2D = 485,
ITEXTURE3D = 486,
ITEXTURECUBE = 487,
ITEXTURE1DARRAY = 488,
ITEXTURE2DARRAY = 489,
UTEXTURE1D = 490,
UTEXTURE2D = 491,
UTEXTURE3D = 492,
UTEXTURECUBE = 493,
UTEXTURE1DARRAY = 494,
UTEXTURE2DARRAY = 495,
TEXTURE2DRECT = 496,
ITEXTURE2DRECT = 497,
UTEXTURE2DRECT = 498,
TEXTUREBUFFER = 499,
ITEXTUREBUFFER = 500,
UTEXTUREBUFFER = 501,
TEXTURECUBEARRAY = 502,
ITEXTURECUBEARRAY = 503,
UTEXTURECUBEARRAY = 504,
TEXTURE2DMS = 505,
ITEXTURE2DMS = 506,
UTEXTURE2DMS = 507,
TEXTURE2DMSARRAY = 508,
ITEXTURE2DMSARRAY = 509,
UTEXTURE2DMSARRAY = 510,
F16TEXTURE1D = 511,
F16TEXTURE2D = 512,
F16TEXTURE3D = 513,
F16TEXTURE2DRECT = 514,
F16TEXTURECUBE = 515,
F16TEXTURE1DARRAY = 516,
F16TEXTURE2DARRAY = 517,
F16TEXTURECUBEARRAY = 518,
F16TEXTUREBUFFER = 519,
F16TEXTURE2DMS = 520,
F16TEXTURE2DMSARRAY = 521,
SUBPASSINPUT = 522,
SUBPASSINPUTMS = 523,
ISUBPASSINPUT = 524,
ISUBPASSINPUTMS = 525,
USUBPASSINPUT = 526,
USUBPASSINPUTMS = 527,
F16SUBPASSINPUT = 528,
F16SUBPASSINPUTMS = 529,
IMAGE1D = 530,
IIMAGE1D = 531,
UIMAGE1D = 532,
IMAGE2D = 533,
IIMAGE2D = 534,
UIMAGE2D = 535,
IMAGE3D = 536,
IIMAGE3D = 537,
UIMAGE3D = 538,
IMAGE2DRECT = 539,
IIMAGE2DRECT = 540,
UIMAGE2DRECT = 541,
IMAGECUBE = 542,
IIMAGECUBE = 543,
UIMAGECUBE = 544,
IMAGEBUFFER = 545,
IIMAGEBUFFER = 546,
UIMAGEBUFFER = 547,
IMAGE1DARRAY = 548,
IIMAGE1DARRAY = 549,
UIMAGE1DARRAY = 550,
IMAGE2DARRAY = 551,
IIMAGE2DARRAY = 552,
UIMAGE2DARRAY = 553,
IMAGECUBEARRAY = 554,
IIMAGECUBEARRAY = 555,
UIMAGECUBEARRAY = 556,
IMAGE2DMS = 557,
IIMAGE2DMS = 558,
UIMAGE2DMS = 559,
IMAGE2DMSARRAY = 560,
IIMAGE2DMSARRAY = 561,
UIMAGE2DMSARRAY = 562,
F16IMAGE1D = 563,
F16IMAGE2D = 564,
F16IMAGE3D = 565,
F16IMAGE2DRECT = 566,
F16IMAGECUBE = 567,
F16IMAGE1DARRAY = 568,
F16IMAGE2DARRAY = 569,
F16IMAGECUBEARRAY = 570,
F16IMAGEBUFFER = 571,
F16IMAGE2DMS = 572,
F16IMAGE2DMSARRAY = 573,
STRUCT = 574,
VOID = 575,
WHILE = 576,
IDENTIFIER = 577,
TYPE_NAME = 578,
FLOATCONSTANT = 579,
DOUBLECONSTANT = 580,
INT16CONSTANT = 581,
UINT16CONSTANT = 582,
INT32CONSTANT = 583,
UINT32CONSTANT = 584,
INTCONSTANT = 585,
UINTCONSTANT = 586,
INT64CONSTANT = 587,
UINT64CONSTANT = 588,
BOOLCONSTANT = 589,
FLOAT16CONSTANT = 590,
LEFT_OP = 591,
RIGHT_OP = 592,
INC_OP = 593,
DEC_OP = 594,
LE_OP = 595,
GE_OP = 596,
EQ_OP = 597,
NE_OP = 598,
AND_OP = 599,
OR_OP = 600,
XOR_OP = 601,
MUL_ASSIGN = 602,
DIV_ASSIGN = 603,
ADD_ASSIGN = 604,
MOD_ASSIGN = 605,
LEFT_ASSIGN = 606,
RIGHT_ASSIGN = 607,
AND_ASSIGN = 608,
XOR_ASSIGN = 609,
OR_ASSIGN = 610,
SUB_ASSIGN = 611,
LEFT_PAREN = 612,
RIGHT_PAREN = 613,
LEFT_BRACKET = 614,
RIGHT_BRACKET = 615,
LEFT_BRACE = 616,
RIGHT_BRACE = 617,
DOT = 618,
COMMA = 619,
COLON = 620,
EQUAL = 621,
SEMICOLON = 622,
BANG = 623,
DASH = 624,
TILDE = 625,
PLUS = 626,
STAR = 627,
SLASH = 628,
PERCENT = 629,
LEFT_ANGLE = 630,
RIGHT_ANGLE = 631,
VERTICAL_BAR = 632,
CARET = 633,
AMPERSAND = 634,
QUESTION = 635,
INVARIANT = 636,
PRECISE = 637,
HIGH_PRECISION = 638,
MEDIUM_PRECISION = 639,
LOW_PRECISION = 640,
PRECISION = 641,
PACKED = 642,
RESOURCE = 643,
SUPERP = 644
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 69 "glslang.y" /* yacc.c:1909 */
#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */
struct {
glslang::TSourceLoc loc;
@ -425,10 +475,8 @@ union YYSTYPE
};
} interm;
#line 429 "glslang_tab.cpp.h" /* yacc.c:1909 */
#line 479 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@ -437,4 +485,4 @@ typedef union YYSTYPE YYSTYPE;
int yyparse (glslang::TParseContext* pParseContext);
#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */
#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2016 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -224,48 +225,192 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpPreIncrement: out.debug << "Pre-Increment"; break;
case EOpPreDecrement: out.debug << "Pre-Decrement"; break;
// * -> bool
case EOpConvInt8ToBool: out.debug << "Convert int8_t to bool"; break;
case EOpConvUint8ToBool: out.debug << "Convert uint8_t to bool"; break;
case EOpConvInt16ToBool: out.debug << "Convert int16_t to bool"; break;
case EOpConvUint16ToBool: out.debug << "Convert uint16_t to bool";break;
case EOpConvIntToBool: out.debug << "Convert int to bool"; break;
case EOpConvUintToBool: out.debug << "Convert uint to bool"; break;
case EOpConvFloatToBool: out.debug << "Convert float to bool"; break;
case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break;
case EOpConvInt64ToBool: out.debug << "Convert int64 to bool"; break;
case EOpConvUint64ToBool: out.debug << "Convert uint64 to bool"; break;
case EOpConvIntToFloat: out.debug << "Convert int to float"; break;
case EOpConvUintToFloat: out.debug << "Convert uint to float"; break;
case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break;
case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break;
case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break;
case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break;
case EOpConvUintToInt: out.debug << "Convert uint to int"; break;
case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
case EOpConvDoubleToInt: out.debug << "Convert double to int"; break;
case EOpConvBoolToInt: out.debug << "Convert bool to int"; break;
case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break;
case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break;
case EOpConvIntToUint: out.debug << "Convert int to uint"; break;
case EOpConvFloatToUint: out.debug << "Convert float to uint"; break;
case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break;
case EOpConvFloat16ToBool: out.debug << "Convert float16_t to bool"; break;
case EOpConvFloatToBool: out.debug << "Convert float to bool"; break;
case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break;
// bool -> *
case EOpConvBoolToInt8: out.debug << "Convert bool to int8_t"; break;
case EOpConvBoolToUint8: out.debug << "Convert bool to uint8_t"; break;
case EOpConvBoolToInt16: out.debug << "Convert bool to in16t_t"; break;
case EOpConvBoolToUint16: out.debug << "Convert bool to uint16_t";break;
case EOpConvBoolToInt: out.debug << "Convert bool to int" ; break;
case EOpConvBoolToUint: out.debug << "Convert bool to uint"; break;
case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break;
case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break;
case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break;
case EOpConvBoolToUint64: out.debug << "Convert bool to uint64";break;
case EOpConvBoolToFloat16: out.debug << "Convert bool to float16_t"; break;
case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break;
case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break;
// int8_t -> (u)int*
case EOpConvInt8ToInt16: out.debug << "Convert int8_t to int16_t";break;
case EOpConvInt8ToInt: out.debug << "Convert int8_t to int"; break;
case EOpConvInt8ToInt64: out.debug << "Convert int8_t to int64"; break;
case EOpConvInt8ToUint8: out.debug << "Convert int8_t to uint8_t";break;
case EOpConvInt8ToUint16: out.debug << "Convert int8_t to uint16_t";break;
case EOpConvInt8ToUint: out.debug << "Convert int8_t to uint"; break;
case EOpConvInt8ToUint64: out.debug << "Convert int8_t to uint64"; break;
// uint8_t -> (u)int*
case EOpConvUint8ToInt8: out.debug << "Convert uint8_t to int8_t";break;
case EOpConvUint8ToInt16: out.debug << "Convert uint8_t to int16_t";break;
case EOpConvUint8ToInt: out.debug << "Convert uint8_t to int"; break;
case EOpConvUint8ToInt64: out.debug << "Convert uint8_t to int64"; break;
case EOpConvUint8ToUint16: out.debug << "Convert uint8_t to uint16_t";break;
case EOpConvUint8ToUint: out.debug << "Convert uint8_t to uint"; break;
case EOpConvUint8ToUint64: out.debug << "Convert uint8_t to uint64"; break;
// int8_t -> float*
case EOpConvInt8ToFloat16: out.debug << "Convert int8_t to float16_t";break;
case EOpConvInt8ToFloat: out.debug << "Convert int8_t to float"; break;
case EOpConvInt8ToDouble: out.debug << "Convert int8_t to double"; break;
// uint8_t -> float*
case EOpConvUint8ToFloat16: out.debug << "Convert uint8_t to float16_t";break;
case EOpConvUint8ToFloat: out.debug << "Convert uint8_t to float"; break;
case EOpConvUint8ToDouble: out.debug << "Convert uint8_t to double"; break;
// int16_t -> (u)int*
case EOpConvInt16ToInt8: out.debug << "Convert int16_t to int8_t";break;
case EOpConvInt16ToInt: out.debug << "Convert int16_t to int"; break;
case EOpConvInt16ToInt64: out.debug << "Convert int16_t to int64"; break;
case EOpConvInt16ToUint8: out.debug << "Convert int16_t to uint8_t";break;
case EOpConvInt16ToUint16: out.debug << "Convert int16_t to uint16_t";break;
case EOpConvInt16ToUint: out.debug << "Convert int16_t to uint"; break;
case EOpConvInt16ToUint64: out.debug << "Convert int16_t to uint64"; break;
// int16_t -> float*
case EOpConvInt16ToFloat16: out.debug << "Convert int16_t to float16_t";break;
case EOpConvInt16ToFloat: out.debug << "Convert int16_t to float"; break;
case EOpConvInt16ToDouble: out.debug << "Convert int16_t to double"; break;
// uint16_t -> (u)int*
case EOpConvUint16ToInt8: out.debug << "Convert uint16_t to int8_t";break;
case EOpConvUint16ToInt16: out.debug << "Convert uint16_t to int16_t";break;
case EOpConvUint16ToInt: out.debug << "Convert uint16_t to int"; break;
case EOpConvUint16ToInt64: out.debug << "Convert uint16_t to int64"; break;
case EOpConvUint16ToUint8: out.debug << "Convert uint16_t to uint8_t";break;
case EOpConvUint16ToUint: out.debug << "Convert uint16_t to uint"; break;
case EOpConvUint16ToUint64: out.debug << "Convert uint16_t to uint64"; break;
// uint16_t -> float*
case EOpConvUint16ToFloat16: out.debug << "Convert uint16_t to float16_t";break;
case EOpConvUint16ToFloat: out.debug << "Convert uint16_t to float"; break;
case EOpConvUint16ToDouble: out.debug << "Convert uint16_t to double"; break;
// int32_t -> (u)int*
case EOpConvIntToInt8: out.debug << "Convert int to int8_t";break;
case EOpConvIntToInt16: out.debug << "Convert int to int16_t";break;
case EOpConvIntToInt64: out.debug << "Convert int to int64"; break;
case EOpConvIntToUint8: out.debug << "Convert int to uint8_t";break;
case EOpConvIntToUint16: out.debug << "Convert int to uint16_t";break;
case EOpConvIntToUint: out.debug << "Convert int to uint"; break;
case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break;
// int32_t -> float*
case EOpConvIntToFloat16: out.debug << "Convert int to float16_t";break;
case EOpConvIntToFloat: out.debug << "Convert int to float"; break;
case EOpConvIntToDouble: out.debug << "Convert int to double"; break;
case EOpConvUintToDouble: out.debug << "Convert uint to double"; break;
case EOpConvFloatToDouble: out.debug << "Convert float to double"; break;
case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break;
case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break;
case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break;
case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break;
case EOpConvIntToInt64: out.debug << "Convert int to int64"; break;
// uint32_t -> (u)int*
case EOpConvUintToInt8: out.debug << "Convert uint to int8_t";break;
case EOpConvUintToInt16: out.debug << "Convert uint to int16_t";break;
case EOpConvUintToInt: out.debug << "Convert uint to int";break;
case EOpConvUintToInt64: out.debug << "Convert uint to int64"; break;
case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break;
case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break;
case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break;
case EOpConvBoolToUint64: out.debug << "Convert bool to uint64"; break;
case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break;
case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break;
case EOpConvUintToUint8: out.debug << "Convert uint to uint8_t";break;
case EOpConvUintToUint16: out.debug << "Convert uint to uint16_t";break;
case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break;
// uint32_t -> float*
case EOpConvUintToFloat16: out.debug << "Convert uint to float16_t";break;
case EOpConvUintToFloat: out.debug << "Convert uint to float"; break;
case EOpConvUintToDouble: out.debug << "Convert uint to double"; break;
// int64 -> (u)int*
case EOpConvInt64ToInt8: out.debug << "Convert int64 to int8_t"; break;
case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16_t"; break;
case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break;
case EOpConvInt64ToUint8: out.debug << "Convert int64 to uint8_t";break;
case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16_t";break;
case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break;
case EOpConvInt64ToUint64: out.debug << "Convert int64 to uint64"; break;
// int64 -> float*
case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16_t";break;
case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break;
case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break;
// uint64 -> (u)int*
case EOpConvUint64ToInt8: out.debug << "Convert uint64 to int8_t";break;
case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16_t";break;
case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break;
case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break;
case EOpConvUint64ToUint8: out.debug << "Convert uint64 to uint8_t";break;
case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break;
case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break;
// uint64 -> float*
case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16_t";break;
case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break;
case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break;
// float16_t -> int*
case EOpConvFloat16ToInt8: out.debug << "Convert float16_t to int8_t"; break;
case EOpConvFloat16ToInt16: out.debug << "Convert float16_t to int16_t"; break;
case EOpConvFloat16ToInt: out.debug << "Convert float16_t to int"; break;
case EOpConvFloat16ToInt64: out.debug << "Convert float16_t to int64"; break;
// float16_t -> uint*
case EOpConvFloat16ToUint8: out.debug << "Convert float16_t to uint8_t"; break;
case EOpConvFloat16ToUint16: out.debug << "Convert float16_t to uint16_t"; break;
case EOpConvFloat16ToUint: out.debug << "Convert float16_t to uint"; break;
case EOpConvFloat16ToUint64: out.debug << "Convert float16_t to uint64"; break;
// float16_t -> float*
case EOpConvFloat16ToFloat: out.debug << "Convert float16_t to float"; break;
case EOpConvFloat16ToDouble: out.debug << "Convert float16_t to double"; break;
// float32 -> float*
case EOpConvFloatToFloat16: out.debug << "Convert float to float16_t"; break;
case EOpConvFloatToDouble: out.debug << "Convert float to double"; break;
// float32_t -> int*
case EOpConvFloatToInt8: out.debug << "Convert float to int8_t"; break;
case EOpConvFloatToInt16: out.debug << "Convert float to int16_t"; break;
case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break;
// float32_t -> uint*
case EOpConvFloatToUint8: out.debug << "Convert float to uint8_t"; break;
case EOpConvFloatToUint16: out.debug << "Convert float to uint16_t"; break;
case EOpConvFloatToUint: out.debug << "Convert float to uint"; break;
case EOpConvFloatToUint64: out.debug << "Convert float to uint64"; break;
// double -> float*
case EOpConvDoubleToFloat16: out.debug << "Convert double to float16_t"; break;
case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break;
// double -> int*
case EOpConvDoubleToInt8: out.debug << "Convert double to int8_t"; break;
case EOpConvDoubleToInt16: out.debug << "Convert double to int16_t"; break;
case EOpConvDoubleToInt: out.debug << "Convert double to int"; break;
case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break;
// float32_t -> uint*
case EOpConvDoubleToUint8: out.debug << "Convert double to uint8_t"; break;
case EOpConvDoubleToUint16: out.debug << "Convert double to uint16_t"; break;
case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break;
case EOpConvDoubleToUint64: out.debug << "Convert double to uint64"; break;
case EOpConvInt64ToUint64: out.debug << "Convert uint64 to uint64"; break;
case EOpRadians: out.debug << "radians"; break;
case EOpDegrees: out.debug << "degrees"; break;
@ -309,12 +454,10 @@ 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;
@ -322,6 +465,12 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpUnpackUnorm2x16:out.debug << "unpackUnorm2x16"; break;
case EOpPackHalf2x16: out.debug << "packHalf2x16"; break;
case EOpUnpackHalf2x16: out.debug << "unpackHalf2x16"; break;
case EOpPack16: out.debug << "pack16"; break;
case EOpPack32: out.debug << "pack32"; break;
case EOpPack64: out.debug << "pack64"; break;
case EOpUnpack32: out.debug << "unpack32"; break;
case EOpUnpack16: out.debug << "unpack16"; break;
case EOpUnpack8: out.debug << "unpack8"; break;
case EOpPackSnorm4x8: out.debug << "PackSnorm4x8"; break;
case EOpUnpackSnorm4x8: out.debug << "UnpackSnorm4x8"; break;
@ -335,7 +484,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpPackUint2x32: out.debug << "packUint2x32"; break;
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;
@ -345,10 +493,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
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
case EOpLength: out.debug << "length"; break;
case EOpNormalize: out.debug << "normalize"; break;
@ -402,6 +548,57 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpAllInvocations: out.debug << "allInvocations"; break;
case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break;
case EOpSubgroupElect: out.debug << "subgroupElect"; break;
case EOpSubgroupAll: out.debug << "subgroupAll"; break;
case EOpSubgroupAny: out.debug << "subgroupAny"; break;
case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break;
case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break;
case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break;
case EOpSubgroupBallot: out.debug << "subgroupBallot"; break;
case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break;
case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break;
case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break;
case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break;
case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break;
case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break;
case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break;
case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break;
case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break;
case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break;
case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break;
case EOpSubgroupAdd: out.debug << "subgroupAdd"; break;
case EOpSubgroupMul: out.debug << "subgroupMul"; break;
case EOpSubgroupMin: out.debug << "subgroupMin"; break;
case EOpSubgroupMax: out.debug << "subgroupMax"; break;
case EOpSubgroupAnd: out.debug << "subgroupAnd"; break;
case EOpSubgroupOr: out.debug << "subgroupOr"; break;
case EOpSubgroupXor: out.debug << "subgroupXor"; break;
case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break;
case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break;
case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break;
case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break;
case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break;
case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break;
case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break;
case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break;
case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break;
case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break;
case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break;
case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break;
case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break;
case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break;
case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break;
case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break;
case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break;
case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break;
case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break;
case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break;
case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break;
case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break;
case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break;
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
case EOpClip: out.debug << "clip"; break;
case EOpIsFinite: out.debug << "isfinite"; break;
case EOpLog10: out.debug << "log10"; break;
@ -434,62 +631,11 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpMbcnt: out.debug << "mbcnt"; break;
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
case EOpFragmentMaskFetch: out.debug << "fragmentMaskFetchAMD"; break;
case EOpFragmentFetch: out.debug << "fragmentFetchAMD"; break;
case EOpConvBoolToFloat16: out.debug << "Convert bool to float16"; break;
case EOpConvIntToFloat16: out.debug << "Convert int to float16"; break;
case EOpConvUintToFloat16: out.debug << "Convert uint to float16"; break;
case EOpConvFloatToFloat16: out.debug << "Convert float to float16"; break;
case EOpConvDoubleToFloat16: out.debug << "Convert double to float16"; break;
case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16"; break;
case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16"; break;
case EOpConvFloat16ToBool: out.debug << "Convert float16 to bool"; break;
case EOpConvFloat16ToInt: out.debug << "Convert float16 to int"; break;
case EOpConvFloat16ToUint: out.debug << "Convert float16 to uint"; break;
case EOpConvFloat16ToFloat: out.debug << "Convert float16 to float"; break;
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;
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
#endif
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
@ -537,23 +683,30 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpConstructBVec2: out.debug << "Construct bvec2"; break;
case EOpConstructBVec3: out.debug << "Construct bvec3"; break;
case EOpConstructBVec4: out.debug << "Construct bvec4"; break;
case EOpConstructInt8: out.debug << "Construct int8_t"; break;
case EOpConstructI8Vec2: out.debug << "Construct i8vec2"; break;
case EOpConstructI8Vec3: out.debug << "Construct i8vec3"; break;
case EOpConstructI8Vec4: out.debug << "Construct i8vec4"; break;
case EOpConstructInt: out.debug << "Construct int"; break;
case EOpConstructIVec2: out.debug << "Construct ivec2"; break;
case EOpConstructIVec3: out.debug << "Construct ivec3"; break;
case EOpConstructIVec4: out.debug << "Construct ivec4"; break;
case EOpConstructUint8: out.debug << "Construct uint8_t"; break;
case EOpConstructU8Vec2: out.debug << "Construct u8vec2"; break;
case EOpConstructU8Vec3: out.debug << "Construct u8vec3"; break;
case EOpConstructU8Vec4: out.debug << "Construct u8vec4"; break;
case EOpConstructUint: out.debug << "Construct uint"; break;
case EOpConstructUVec2: out.debug << "Construct uvec2"; break;
case EOpConstructUVec3: out.debug << "Construct uvec3"; break;
case EOpConstructUVec4: out.debug << "Construct uvec4"; break;
case EOpConstructInt64: out.debug << "Construct int64_t"; break;
case EOpConstructInt64: out.debug << "Construct int64"; break;
case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break;
case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break;
case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break;
case EOpConstructUint64: out.debug << "Construct uint64_t"; break;
case EOpConstructUint64: out.debug << "Construct uint64"; break;
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;
@ -562,7 +715,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
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;
@ -608,7 +760,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
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;
case EOpConstructF16Vec3: out.debug << "Construct f16vec3"; break;
@ -622,7 +773,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpConstructF16Mat4x2: out.debug << "Construct f16mat4x2"; break;
case EOpConstructF16Mat4x3: out.debug << "Construct f16mat4x3"; break;
case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4"; break;
#endif
case EOpConstructStruct: out.debug << "Construct structure"; break;
case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break;
@ -796,6 +946,62 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpWorkgroupMemoryBarrier: out.debug << "WorkgroupMemoryBarrier"; break;
case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break;
case EOpSubgroupBarrier: out.debug << "subgroupBarrier"; break;
case EOpSubgroupMemoryBarrier: out.debug << "subgroupMemoryBarrier"; break;
case EOpSubgroupMemoryBarrierBuffer: out.debug << "subgroupMemoryBarrierBuffer"; break;
case EOpSubgroupMemoryBarrierImage: out.debug << "subgroupMemoryBarrierImage"; break;
case EOpSubgroupMemoryBarrierShared: out.debug << "subgroupMemoryBarrierShared"; break;
case EOpSubgroupElect: out.debug << "subgroupElect"; break;
case EOpSubgroupAll: out.debug << "subgroupAll"; break;
case EOpSubgroupAny: out.debug << "subgroupAny"; break;
case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break;
case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break;
case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break;
case EOpSubgroupBallot: out.debug << "subgroupBallot"; break;
case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break;
case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break;
case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break;
case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break;
case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break;
case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break;
case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break;
case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break;
case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break;
case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break;
case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break;
case EOpSubgroupAdd: out.debug << "subgroupAdd"; break;
case EOpSubgroupMul: out.debug << "subgroupMul"; break;
case EOpSubgroupMin: out.debug << "subgroupMin"; break;
case EOpSubgroupMax: out.debug << "subgroupMax"; break;
case EOpSubgroupAnd: out.debug << "subgroupAnd"; break;
case EOpSubgroupOr: out.debug << "subgroupOr"; break;
case EOpSubgroupXor: out.debug << "subgroupXor"; break;
case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break;
case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break;
case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break;
case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break;
case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break;
case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break;
case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break;
case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break;
case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break;
case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break;
case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break;
case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break;
case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break;
case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break;
case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break;
case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break;
case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break;
case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break;
case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break;
case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break;
case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break;
case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break;
case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break;
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
@ -870,9 +1076,7 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const
break;
case EbtFloat:
case EbtDouble:
#ifdef AMD_EXTENSIONS
case EbtFloat16:
#endif
{
const double value = constUnion[i].getDConst();
// Print infinities and NaNs in a portable way.
@ -892,6 +1096,42 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const
}
}
break;
case EbtInt8:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI8Const(), "const int8_t");
out.debug << buf << "\n";
}
break;
case EbtUint8:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU8Const(), "const uint8_t");
out.debug << buf << "\n";
}
break;
case EbtInt16:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI16Const(), "const int16_t");
out.debug << buf << "\n";
}
break;
case EbtUint16:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU16Const(), "const uint16_t");
out.debug << buf << "\n";
}
break;
case EbtInt:
{
const int maxSize = 300;
@ -928,26 +1168,6 @@ 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;

View file

@ -1,5 +1,6 @@
//
// Copyright (C) 2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -1064,11 +1065,11 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
case EbtInt64:
case EbtUint64:
case EbtDouble: size = 8; return 8;
#ifdef AMD_EXTENSIONS
case EbtInt16:
case EbtUint16:
case EbtFloat16: size = 2; return 2;
#endif
case EbtInt8:
case EbtUint8: size = 1; return 1;
case EbtInt16:
case EbtUint16: size = 2; return 2;
default: size = 4; return 4;
}
}

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2016 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@ -78,7 +79,7 @@ public:
assert(i < MaxSwizzleSelectors);
return components[i];
}
private:
int size_;
selectorType components[MaxSwizzleSelectors];
@ -403,6 +404,7 @@ public:
TIntermSymbol* addSymbol(const TType&, const TSourceLoc&);
TIntermSymbol* addSymbol(const TIntermSymbol&);
TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const;
std::tuple<TIntermTyped*, TIntermTyped*> addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const;
TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*);
void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode);
TIntermTyped* addShapeConversion(const TType&, TIntermTyped*);
@ -412,6 +414,11 @@ public:
TIntermTyped* addUnaryMath(TOperator, TIntermTyped* child, TSourceLoc);
TIntermTyped* addBuiltInFunctionCall(const TSourceLoc& line, TOperator, bool unary, TIntermNode*, const TType& returnType);
bool canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op = EOpNull) const;
bool isIntegralPromotion(TBasicType from, TBasicType to) const;
bool isFPPromotion(TBasicType from, TBasicType to) const;
bool isIntegralConversion(TBasicType from, TBasicType to) const;
bool isFPConversion(TBasicType from, TBasicType to) const;
bool isFPIntegralConversion(TBasicType from, TBasicType to) const;
TOperator mapTypeToConstructorOp(const TType&) const;
TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right);
TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&);
@ -425,15 +432,14 @@ public:
TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);
TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, const TSourceLoc&);
TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(signed char, const TSourceLoc&, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(unsigned char, const TSourceLoc&, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(signed short, const TSourceLoc&, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const;
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;
@ -643,6 +649,10 @@ protected:
void pushSelector(TIntermSequence&, const TMatrixSelector&, const TSourceLoc&);
bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&);
void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root);
bool isConversionAllowed(TOperator op, TIntermTyped* node) const;
TIntermUnary* createConversion(TBasicType convertTo, TIntermTyped* node) const;
std::tuple<TBasicType, TBasicType> getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const;
bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();}
static const char* getResourceName(TResourceType);
const EShLanguage language; // stage, known at construction time
@ -650,8 +660,8 @@ protected:
std::string entryPointName;
std::string entryPointMangledName;
EProfile profile;
int version;
EProfile profile; // source profile
int version; // source version
SpvVersion spvVersion;
TIntermNode* treeRoot;
std::set<std::string> requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them

View file

@ -1,5 +1,6 @@
//
// Copyright (C) 2016 Google, Inc.
// Copyright (C) 2017 ARM Limited.
//
// All rights reserved.
//
@ -77,12 +78,16 @@ public:
virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior);
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);
#ifdef AMD_EXTENSIONS
virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false);
#endif
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false);
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 spvRemoved(const TSourceLoc&, const char* op);
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
virtual void requireVulkan(const TSourceLoc&, const char* op);

View file

@ -731,12 +731,10 @@ int TPpContext::CPPerror(TPpToken* ppToken)
TSourceLoc loc = ppToken->loc;
while (token != '\n' && token != EndOfInput) {
if (token == PpAtomConstInt || token == PpAtomConstUint ||
if (token == PpAtomConstInt16 || token == PpAtomConstUint16 ||
token == PpAtomConstInt || token == PpAtomConstUint ||
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
#ifdef AMD_EXTENSIONS
token == PpAtomConstInt16 || token == PpAtomConstUint16 ||
token == PpAtomConstFloat16 ||
#endif
token == PpAtomConstFloat || token == PpAtomConstDouble) {
message.append(ppToken->name);
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
@ -775,9 +773,7 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
#endif
case PpAtomConstFloat:
case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
case PpAtomConstFloat16:
#endif
tokens.push_back(ppToken->name);
break;
default:

View file

@ -1,6 +1,7 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2013 LunarG, Inc.
// Copyright (C) 2017 ARM Limited.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@ -186,10 +187,8 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
isDouble = 1;
}
} else if (ch == 'h' || ch == 'H') {
#ifdef AMD_EXTENSIONS
if (parseContext.intermediate.getSource() == EShSourceGlsl)
parseContext.float16Check(ppToken->loc, "half floating-point suffix");
#endif
if (!HasDecimalOrExponent)
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
if (parseContext.intermediate.getSource() == EShSourceGlsl) {
@ -322,11 +321,24 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
int ch = 0;
int ii = 0;
unsigned long long ival = 0;
const auto floatingPointChar = [&](int ch) { return ch == '.' || ch == 'e' || ch == 'E' ||
ch == 'f' || ch == 'F' ||
ch == 'h' || ch == 'H'; };
static const char* const Int64_Extensions[] = {
E_GL_ARB_gpu_shader_int64,
E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int64 };
static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]);
static const char* const Int16_Extensions[] = {
#ifdef AMD_EXTENSIONS
E_GL_AMD_gpu_shader_int16,
#endif
E_GL_KHX_shader_explicit_arithmetic_types,
E_GL_KHX_shader_explicit_arithmetic_types_int16 };
static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]);
ppToken->ival = 0;
ppToken->i64val = 0;
ppToken->space = false;
@ -389,9 +401,7 @@ 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') ||
@ -469,21 +479,19 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit hexadecimal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_ARB_gpu_shader_int64,
"64-bit hexadecimal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal");
ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
#ifdef AMD_EXTENSIONS
} else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"16-bit hexadecimal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_AMD_gpu_shader_int16,
"16-bit hexadecimal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal");
}
ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
#endif
} else {
if (ival > 0xffffffffu && !AlreadyComplained)
pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", "");
@ -495,9 +503,7 @@ 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;
@ -585,21 +591,19 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit octal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_ARB_gpu_shader_int64,
"64-bit octal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal");
ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
#ifdef AMD_EXTENSIONS
} else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"16-bit octal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_AMD_gpu_shader_int16,
"16-bit octal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal");
}
ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
#endif
} else {
ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
@ -626,9 +630,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
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;
@ -672,19 +674,15 @@ 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';
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) {
@ -698,21 +696,19 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_ARB_gpu_shader_int64,
"64-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit literal");
ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
#ifdef AMD_EXTENSIONS
} else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"16-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, E_GL_AMD_gpu_shader_int16,
"16-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit literal");
}
ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
#endif
} else {
ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
@ -962,14 +958,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:
#endif
if (ppToken.name[0] == '\0')
continue;
break;

View file

@ -147,9 +147,7 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken)
#endif
case PpAtomConstFloat:
case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
case PpAtomConstFloat16:
#endif
str = ppToken->name;
while (*str) {
putSubtoken(*str);
@ -187,9 +185,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
case PpAtomIdentifier:
case PpAtomConstFloat:
case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
case PpAtomConstFloat16:
#endif
case PpAtomConstInt:
case PpAtomConstUint:
case PpAtomConstInt64:
@ -219,9 +215,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
break;
case PpAtomConstFloat:
case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
case PpAtomConstFloat16:
#endif
ppToken->dval = atof(ppToken->name);
break;
case PpAtomConstInt:

View file

@ -127,10 +127,8 @@ enum EFixedAtoms {
PpAtomConstUint,
PpAtomConstInt64,
PpAtomConstUint64,
#ifdef AMD_EXTENSIONS
PpAtomConstInt16,
PpAtomConstUint16,
#endif
PpAtomConstFloat,
PpAtomConstDouble,
PpAtomConstFloat16,