Implement the extension GL_ARB_gpu_shader_int64
- Add new keyword int64_t/uint64_t/i64vec/u64vec. - Support 64-bit integer literals (dec/hex/oct). - Support built-in operators for 64-bit integer type. - Add implicit and explicit type conversion for 64-bit integer type. - Add new built-in functions defined in this extension.
This commit is contained in:
parent
010e93fe62
commit
8ff43de891
@ -1069,9 +1069,13 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
|||||||
case glslang::EOpPreDecrement:
|
case glslang::EOpPreDecrement:
|
||||||
{
|
{
|
||||||
// we need the integer value "1" or the floating point "1.0" to add/subtract
|
// we need the integer value "1" or the floating point "1.0" to add/subtract
|
||||||
spv::Id one = node->getBasicType() == glslang::EbtFloat ?
|
spv::Id one = 0;
|
||||||
builder.makeFloatConstant(1.0F) :
|
if (node->getBasicType() == glslang::EbtFloat)
|
||||||
builder.makeIntConstant(1);
|
one = builder.makeFloatConstant(1.0F);
|
||||||
|
else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64)
|
||||||
|
one = builder.makeInt64Constant(1);
|
||||||
|
else
|
||||||
|
one = builder.makeIntConstant(1);
|
||||||
glslang::TOperator op;
|
glslang::TOperator op;
|
||||||
if (node->getOp() == glslang::EOpPreIncrement ||
|
if (node->getOp() == glslang::EOpPreIncrement ||
|
||||||
node->getOp() == glslang::EOpPostIncrement)
|
node->getOp() == glslang::EOpPostIncrement)
|
||||||
@ -1080,8 +1084,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
|||||||
op = glslang::EOpSub;
|
op = glslang::EOpSub;
|
||||||
|
|
||||||
spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()),
|
spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()),
|
||||||
convertGlslangToSpvType(node->getType()), operand, one,
|
convertGlslangToSpvType(node->getType()), operand, one,
|
||||||
node->getType().getBasicType());
|
node->getType().getBasicType());
|
||||||
assert(result != spv::NoResult);
|
assert(result != spv::NoResult);
|
||||||
|
|
||||||
// The result of operation is always stored, but conditionally the
|
// The result of operation is always stored, but conditionally the
|
||||||
@ -1260,6 +1264,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|||||||
case glslang::EOpConstructUVec2:
|
case glslang::EOpConstructUVec2:
|
||||||
case glslang::EOpConstructUVec3:
|
case glslang::EOpConstructUVec3:
|
||||||
case glslang::EOpConstructUVec4:
|
case glslang::EOpConstructUVec4:
|
||||||
|
case glslang::EOpConstructInt64:
|
||||||
|
case glslang::EOpConstructI64Vec2:
|
||||||
|
case glslang::EOpConstructI64Vec3:
|
||||||
|
case glslang::EOpConstructI64Vec4:
|
||||||
|
case glslang::EOpConstructUint64:
|
||||||
|
case glslang::EOpConstructU64Vec2:
|
||||||
|
case glslang::EOpConstructU64Vec3:
|
||||||
|
case glslang::EOpConstructU64Vec4:
|
||||||
case glslang::EOpConstructStruct:
|
case glslang::EOpConstructStruct:
|
||||||
case glslang::EOpConstructTextureSampler:
|
case glslang::EOpConstructTextureSampler:
|
||||||
{
|
{
|
||||||
@ -1740,6 +1752,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
|||||||
case glslang::EbtUint:
|
case glslang::EbtUint:
|
||||||
spvType = builder.makeUintType(32);
|
spvType = builder.makeUintType(32);
|
||||||
break;
|
break;
|
||||||
|
case glslang::EbtInt64:
|
||||||
|
builder.addCapability(spv::CapabilityInt64);
|
||||||
|
spvType = builder.makeIntType(64);
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint64:
|
||||||
|
builder.addCapability(spv::CapabilityInt64);
|
||||||
|
spvType = builder.makeUintType(64);
|
||||||
|
break;
|
||||||
case glslang::EbtAtomicUint:
|
case glslang::EbtAtomicUint:
|
||||||
spv::TbdFunctionality("Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class?");
|
spv::TbdFunctionality("Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class?");
|
||||||
spvType = builder.makeUintType(32);
|
spvType = builder.makeUintType(32);
|
||||||
@ -2631,7 +2651,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
|||||||
spv::Id typeId, spv::Id left, spv::Id right,
|
spv::Id typeId, spv::Id left, spv::Id right,
|
||||||
glslang::TBasicType typeProxy, bool reduceComparison)
|
glslang::TBasicType typeProxy, bool reduceComparison)
|
||||||
{
|
{
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
bool isBool = typeProxy == glslang::EbtBool;
|
bool isBool = typeProxy == glslang::EbtBool;
|
||||||
|
|
||||||
@ -2948,7 +2968,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
{
|
{
|
||||||
spv::Op unaryOp = spv::OpNop;
|
spv::Op unaryOp = spv::OpNop;
|
||||||
int libCall = -1;
|
int libCall = -1;
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@ -3079,6 +3099,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
case glslang::EOpFloatBitsToUint:
|
case glslang::EOpFloatBitsToUint:
|
||||||
case glslang::EOpIntBitsToFloat:
|
case glslang::EOpIntBitsToFloat:
|
||||||
case glslang::EOpUintBitsToFloat:
|
case glslang::EOpUintBitsToFloat:
|
||||||
|
case glslang::EOpDoubleBitsToInt64:
|
||||||
|
case glslang::EOpDoubleBitsToUint64:
|
||||||
|
case glslang::EOpInt64BitsToDouble:
|
||||||
|
case glslang::EOpUint64BitsToDouble:
|
||||||
unaryOp = spv::OpBitcast;
|
unaryOp = spv::OpBitcast;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3119,6 +3143,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
libCall = spv::GLSLstd450UnpackDouble2x32;
|
libCall = spv::GLSLstd450UnpackDouble2x32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpPackInt2x32:
|
||||||
|
case glslang::EOpUnpackInt2x32:
|
||||||
|
case glslang::EOpPackUint2x32:
|
||||||
|
case glslang::EOpUnpackUint2x32:
|
||||||
|
spv::MissingFunctionality("shader int64");
|
||||||
|
libCall = spv::GLSLstd450Bad; // TODO: This is a placeholder.
|
||||||
|
break;
|
||||||
|
|
||||||
case glslang::EOpDPdx:
|
case glslang::EOpDPdx:
|
||||||
unaryOp = spv::OpDPdx;
|
unaryOp = spv::OpDPdx;
|
||||||
break;
|
break;
|
||||||
@ -3252,13 +3284,17 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
spv::Op convOp = spv::OpNop;
|
spv::Op convOp = spv::OpNop;
|
||||||
spv::Id zero = 0;
|
spv::Id zero = 0;
|
||||||
spv::Id one = 0;
|
spv::Id one = 0;
|
||||||
|
spv::Id type = 0;
|
||||||
|
|
||||||
int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0;
|
int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case glslang::EOpConvIntToBool:
|
case glslang::EOpConvIntToBool:
|
||||||
case glslang::EOpConvUintToBool:
|
case glslang::EOpConvUintToBool:
|
||||||
zero = builder.makeUintConstant(0);
|
case glslang::EOpConvInt64ToBool:
|
||||||
|
case glslang::EOpConvUint64ToBool:
|
||||||
|
zero = (op == glslang::EOpConvInt64ToBool ||
|
||||||
|
op == glslang::EOpConvUint64ToBool) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
||||||
zero = makeSmearedConstant(zero, vectorSize);
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
||||||
|
|
||||||
@ -3283,23 +3319,29 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
one = builder.makeDoubleConstant(1.0);
|
one = builder.makeDoubleConstant(1.0);
|
||||||
break;
|
break;
|
||||||
case glslang::EOpConvBoolToInt:
|
case glslang::EOpConvBoolToInt:
|
||||||
zero = builder.makeIntConstant(0);
|
case glslang::EOpConvBoolToInt64:
|
||||||
one = builder.makeIntConstant(1);
|
zero = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(0) : builder.makeIntConstant(0);
|
||||||
|
one = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(1) : builder.makeIntConstant(1);
|
||||||
convOp = spv::OpSelect;
|
convOp = spv::OpSelect;
|
||||||
break;
|
break;
|
||||||
case glslang::EOpConvBoolToUint:
|
case glslang::EOpConvBoolToUint:
|
||||||
zero = builder.makeUintConstant(0);
|
case glslang::EOpConvBoolToUint64:
|
||||||
one = builder.makeUintConstant(1);
|
zero = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
||||||
|
one = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(1) : builder.makeUintConstant(1);
|
||||||
convOp = spv::OpSelect;
|
convOp = spv::OpSelect;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case glslang::EOpConvIntToFloat:
|
case glslang::EOpConvIntToFloat:
|
||||||
case glslang::EOpConvIntToDouble:
|
case glslang::EOpConvIntToDouble:
|
||||||
|
case glslang::EOpConvInt64ToFloat:
|
||||||
|
case glslang::EOpConvInt64ToDouble:
|
||||||
convOp = spv::OpConvertSToF;
|
convOp = spv::OpConvertSToF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case glslang::EOpConvUintToFloat:
|
case glslang::EOpConvUintToFloat:
|
||||||
case glslang::EOpConvUintToDouble:
|
case glslang::EOpConvUintToDouble:
|
||||||
|
case glslang::EOpConvUint64ToFloat:
|
||||||
|
case glslang::EOpConvUint64ToDouble:
|
||||||
convOp = spv::OpConvertUToF;
|
convOp = spv::OpConvertUToF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3310,14 +3352,19 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
|
|
||||||
case glslang::EOpConvFloatToInt:
|
case glslang::EOpConvFloatToInt:
|
||||||
case glslang::EOpConvDoubleToInt:
|
case glslang::EOpConvDoubleToInt:
|
||||||
|
case glslang::EOpConvFloatToInt64:
|
||||||
|
case glslang::EOpConvDoubleToInt64:
|
||||||
convOp = spv::OpConvertFToS;
|
convOp = spv::OpConvertFToS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case glslang::EOpConvUintToInt:
|
case glslang::EOpConvUintToInt:
|
||||||
case glslang::EOpConvIntToUint:
|
case glslang::EOpConvIntToUint:
|
||||||
|
case glslang::EOpConvUint64ToInt64:
|
||||||
|
case glslang::EOpConvInt64ToUint64:
|
||||||
if (builder.isInSpecConstCodeGenMode()) {
|
if (builder.isInSpecConstCodeGenMode()) {
|
||||||
// Build zero scalar or vector for OpIAdd.
|
// Build zero scalar or vector for OpIAdd.
|
||||||
zero = builder.makeUintConstant(0);
|
zero = (op == glslang::EOpConvUintToInt64 ||
|
||||||
|
op == glslang::EOpConvIntToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
||||||
zero = makeSmearedConstant(zero, vectorSize);
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
||||||
// generating for OpSpecConstantOp instruction.
|
// generating for OpSpecConstantOp instruction.
|
||||||
@ -3329,8 +3376,65 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
|
|
||||||
case glslang::EOpConvFloatToUint:
|
case glslang::EOpConvFloatToUint:
|
||||||
case glslang::EOpConvDoubleToUint:
|
case glslang::EOpConvDoubleToUint:
|
||||||
|
case glslang::EOpConvFloatToUint64:
|
||||||
|
case glslang::EOpConvDoubleToUint64:
|
||||||
convOp = spv::OpConvertFToU;
|
convOp = spv::OpConvertFToU;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpConvIntToInt64:
|
||||||
|
case glslang::EOpConvInt64ToInt:
|
||||||
|
convOp = spv::OpSConvert;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpConvUintToUint64:
|
||||||
|
case glslang::EOpConvUint64ToUint:
|
||||||
|
convOp = spv::OpUConvert;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpConvIntToUint64:
|
||||||
|
case glslang::EOpConvInt64ToUint:
|
||||||
|
case glslang::EOpConvUint64ToInt:
|
||||||
|
case glslang::EOpConvUintToInt64:
|
||||||
|
// OpSConvert/OpUConvert + OpBitCast
|
||||||
|
switch (op) {
|
||||||
|
case glslang::EOpConvIntToUint64:
|
||||||
|
convOp = spv::OpSConvert;
|
||||||
|
type = builder.makeIntType(64);
|
||||||
|
break;
|
||||||
|
case glslang::EOpConvInt64ToUint:
|
||||||
|
convOp = spv::OpSConvert;
|
||||||
|
type = builder.makeIntType(32);
|
||||||
|
break;
|
||||||
|
case glslang::EOpConvUint64ToInt:
|
||||||
|
convOp = spv::OpUConvert;
|
||||||
|
type = builder.makeUintType(32);
|
||||||
|
break;
|
||||||
|
case glslang::EOpConvUintToInt64:
|
||||||
|
convOp = spv::OpUConvert;
|
||||||
|
type = builder.makeUintType(64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vectorSize > 0)
|
||||||
|
type = builder.makeVectorType(type, vectorSize);
|
||||||
|
|
||||||
|
operand = builder.createUnaryOp(convOp, type, operand);
|
||||||
|
|
||||||
|
if (builder.isInSpecConstCodeGenMode()) {
|
||||||
|
// Build zero scalar or vector for OpIAdd.
|
||||||
|
zero = (op == glslang::EOpConvIntToUint64 ||
|
||||||
|
op == glslang::EOpConvUintToInt64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
||||||
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
|
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
||||||
|
// generating for OpSpecConstantOp instruction.
|
||||||
|
return builder.createBinOp(spv::OpIAdd, destType, operand, zero);
|
||||||
|
}
|
||||||
|
// For normal run-time conversion instruction, use OpBitcast.
|
||||||
|
convOp = spv::OpBitcast;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3441,7 +3545,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
|
|||||||
|
|
||||||
spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
|
spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
|
||||||
{
|
{
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
|
|
||||||
spv::Op opCode = spv::OpNop;
|
spv::Op opCode = spv::OpNop;
|
||||||
@ -3876,6 +3980,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
|||||||
case glslang::EbtUint:
|
case glslang::EbtUint:
|
||||||
spvConsts.push_back(builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst()));
|
spvConsts.push_back(builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst()));
|
||||||
break;
|
break;
|
||||||
|
case glslang::EbtInt64:
|
||||||
|
spvConsts.push_back(builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const()));
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint64:
|
||||||
|
spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const()));
|
||||||
|
break;
|
||||||
case glslang::EbtFloat:
|
case glslang::EbtFloat:
|
||||||
spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
||||||
break;
|
break;
|
||||||
@ -3902,6 +4012,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
|||||||
case glslang::EbtUint:
|
case glslang::EbtUint:
|
||||||
scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant);
|
scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant);
|
||||||
break;
|
break;
|
||||||
|
case glslang::EbtInt64:
|
||||||
|
scalar = builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const(), specConstant);
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint64:
|
||||||
|
scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant);
|
||||||
|
break;
|
||||||
case glslang::EbtFloat:
|
case glslang::EbtFloat:
|
||||||
scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
||||||
break;
|
break;
|
||||||
|
@ -606,7 +606,7 @@ Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned valu
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double').
|
// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64').
|
||||||
Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const
|
Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const
|
||||||
{
|
{
|
||||||
Instruction* constant;
|
Instruction* constant;
|
||||||
@ -711,6 +711,31 @@ Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant)
|
|||||||
return c->getResultId();
|
return c->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specConstant)
|
||||||
|
{
|
||||||
|
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||||
|
|
||||||
|
unsigned op1 = value & 0xFFFFFFFF;
|
||||||
|
unsigned op2 = value >> 32;
|
||||||
|
|
||||||
|
// See if we already made it. Applies only to regular constants, because specialization constants
|
||||||
|
// must remain distinct for the purpose of applying a SpecId decoration.
|
||||||
|
if (! specConstant) {
|
||||||
|
Id existing = findScalarConstant(OpTypeInt, opcode, typeId, op1, op2);
|
||||||
|
if (existing)
|
||||||
|
return existing;
|
||||||
|
}
|
||||||
|
|
||||||
|
Instruction* c = new Instruction(getUniqueId(), typeId, opcode);
|
||||||
|
c->addImmediateOperand(op1);
|
||||||
|
c->addImmediateOperand(op2);
|
||||||
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(c));
|
||||||
|
groupedConstants[OpTypeInt].push_back(c);
|
||||||
|
module.mapInstruction(c);
|
||||||
|
|
||||||
|
return c->getResultId();
|
||||||
|
}
|
||||||
|
|
||||||
Id Builder::makeFloatConstant(float f, bool specConstant)
|
Id Builder::makeFloatConstant(float f, bool specConstant)
|
||||||
{
|
{
|
||||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||||
|
@ -188,6 +188,8 @@ public:
|
|||||||
Id makeBoolConstant(bool b, bool specConstant = false);
|
Id makeBoolConstant(bool b, bool specConstant = false);
|
||||||
Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); }
|
Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); }
|
||||||
Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); }
|
Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); }
|
||||||
|
Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); }
|
||||||
|
Id makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); }
|
||||||
Id makeFloatConstant(float f, bool specConstant = false);
|
Id makeFloatConstant(float f, bool specConstant = false);
|
||||||
Id makeDoubleConstant(double d, bool specConstant = false);
|
Id makeDoubleConstant(double d, bool specConstant = false);
|
||||||
|
|
||||||
@ -533,6 +535,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Id makeIntConstant(Id typeId, unsigned value, bool specConstant);
|
Id makeIntConstant(Id typeId, unsigned value, bool specConstant);
|
||||||
|
Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant);
|
||||||
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const;
|
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const;
|
||||||
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const;
|
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const;
|
||||||
Id findCompositeConstant(Op typeClass, std::vector<Id>& comps) const;
|
Id findCompositeConstant(Op typeClass, std::vector<Id>& comps) const;
|
||||||
|
629
Test/baseResults/spv.int64.frag.out
Normal file
629
Test/baseResults/spv.int64.frag.out
Normal file
@ -0,0 +1,629 @@
|
|||||||
|
spv.int64.frag
|
||||||
|
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||||
|
|
||||||
|
|
||||||
|
Linked fragment stage:
|
||||||
|
|
||||||
|
|
||||||
|
Missing functionality: shader int64
|
||||||
|
Missing functionality: shader int64
|
||||||
|
Missing functionality: shader int64
|
||||||
|
Missing functionality: shader int64
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80001
|
||||||
|
// Id's are bound by 455
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
Capability Float64
|
||||||
|
Capability Int64
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Fragment 4 "main"
|
||||||
|
ExecutionMode 4 OriginUpperLeft
|
||||||
|
Source GLSL 450
|
||||||
|
SourceExtension "GL_ARB_gpu_shader_int64"
|
||||||
|
Name 4 "main"
|
||||||
|
Name 6 "literal("
|
||||||
|
Name 8 "typeCast("
|
||||||
|
Name 10 "operators("
|
||||||
|
Name 12 "builtinFuncs("
|
||||||
|
Name 16 "i64"
|
||||||
|
Name 24 "Uniforms"
|
||||||
|
MemberName 24(Uniforms) 0 "index"
|
||||||
|
Name 26 ""
|
||||||
|
Name 33 "indexable"
|
||||||
|
Name 38 "u64"
|
||||||
|
Name 47 "indexable"
|
||||||
|
Name 52 "i64v"
|
||||||
|
Name 56 "bv"
|
||||||
|
Name 65 "u64v"
|
||||||
|
Name 74 "iv"
|
||||||
|
Name 81 "uv"
|
||||||
|
Name 89 "fv"
|
||||||
|
Name 95 "dv"
|
||||||
|
Name 132 "u64v"
|
||||||
|
Name 137 "i64"
|
||||||
|
Name 157 "i"
|
||||||
|
Name 164 "uv"
|
||||||
|
Name 216 "b"
|
||||||
|
Name 276 "i64v"
|
||||||
|
Name 279 "i64"
|
||||||
|
Name 289 "u64v"
|
||||||
|
Name 291 "u64"
|
||||||
|
Name 363 "dv"
|
||||||
|
Name 382 "iv"
|
||||||
|
Name 387 "uv"
|
||||||
|
Name 391 "bv"
|
||||||
|
Name 452 "Block"
|
||||||
|
MemberName 452(Block) 0 "i64v"
|
||||||
|
MemberName 452(Block) 1 "u64"
|
||||||
|
Name 454 "block"
|
||||||
|
MemberDecorate 24(Uniforms) 0 Offset 0
|
||||||
|
Decorate 24(Uniforms) Block
|
||||||
|
Decorate 26 DescriptorSet 0
|
||||||
|
Decorate 26 Binding 0
|
||||||
|
MemberDecorate 452(Block) 0 Offset 0
|
||||||
|
MemberDecorate 452(Block) 1 Offset 24
|
||||||
|
Decorate 452(Block) Block
|
||||||
|
Decorate 454(block) DescriptorSet 0
|
||||||
|
Decorate 454(block) Binding 1
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
14: TypeInt 64 1
|
||||||
|
15: TypePointer Function 14(int)
|
||||||
|
17: TypeInt 32 0
|
||||||
|
18: 17(int) Constant 3
|
||||||
|
19: TypeArray 14(int) 18
|
||||||
|
20: 14(int) Constant 4008636143 4008636142
|
||||||
|
21: 14(int) Constant 4294967295 4294967295
|
||||||
|
22: 14(int) Constant 0 1
|
||||||
|
23: 19 ConstantComposite 20 21 22
|
||||||
|
24(Uniforms): TypeStruct 17(int)
|
||||||
|
25: TypePointer Uniform 24(Uniforms)
|
||||||
|
26: 25(ptr) Variable Uniform
|
||||||
|
27: TypeInt 32 1
|
||||||
|
28: 27(int) Constant 0
|
||||||
|
29: TypePointer Uniform 17(int)
|
||||||
|
32: TypePointer Function 19
|
||||||
|
36: TypeInt 64 0
|
||||||
|
37: TypePointer Function 36(int)
|
||||||
|
39: TypeArray 36(int) 18
|
||||||
|
40: 36(int) Constant 4294967295 4294967295
|
||||||
|
41: 36(int) Constant 0 1
|
||||||
|
42: 36(int) Constant 4294967295 1
|
||||||
|
43: 39 ConstantComposite 40 41 42
|
||||||
|
46: TypePointer Function 39
|
||||||
|
50: TypeVector 14(int) 2
|
||||||
|
51: TypePointer Function 50(ivec2)
|
||||||
|
53: TypeBool
|
||||||
|
54: TypeVector 53(bool) 2
|
||||||
|
55: TypePointer Function 54(bvec2)
|
||||||
|
58: 14(int) Constant 0 0
|
||||||
|
59: 14(int) Constant 1 0
|
||||||
|
60: 50(ivec2) ConstantComposite 58 58
|
||||||
|
61: 50(ivec2) ConstantComposite 59 59
|
||||||
|
63: TypeVector 36(int) 2
|
||||||
|
64: TypePointer Function 63(ivec2)
|
||||||
|
67: 36(int) Constant 0 0
|
||||||
|
68: 36(int) Constant 1 0
|
||||||
|
69: 63(ivec2) ConstantComposite 67 67
|
||||||
|
70: 63(ivec2) ConstantComposite 68 68
|
||||||
|
72: TypeVector 27(int) 2
|
||||||
|
73: TypePointer Function 72(ivec2)
|
||||||
|
79: TypeVector 17(int) 2
|
||||||
|
80: TypePointer Function 79(ivec2)
|
||||||
|
86: TypeFloat 32
|
||||||
|
87: TypeVector 86(float) 2
|
||||||
|
88: TypePointer Function 87(fvec2)
|
||||||
|
92: TypeFloat 64
|
||||||
|
93: TypeVector 92(float) 2
|
||||||
|
94: TypePointer Function 93(fvec2)
|
||||||
|
130: TypeVector 36(int) 3
|
||||||
|
131: TypePointer Function 130(ivec3)
|
||||||
|
134: TypeVector 14(int) 3
|
||||||
|
156: TypePointer Function 27(int)
|
||||||
|
162: TypeVector 17(int) 3
|
||||||
|
163: TypePointer Function 162(ivec3)
|
||||||
|
197: TypeVector 27(int) 3
|
||||||
|
200: 17(int) Constant 1
|
||||||
|
201: TypePointer Function 17(int)
|
||||||
|
207: 17(int) Constant 2
|
||||||
|
215: TypePointer Function 53(bool)
|
||||||
|
217: 17(int) Constant 0
|
||||||
|
287: 50(ivec2) ConstantComposite 21 21
|
||||||
|
296: 130(ivec3) ConstantComposite 67 67 67
|
||||||
|
338: 53(bool) ConstantTrue
|
||||||
|
345: 53(bool) ConstantFalse
|
||||||
|
346: 54(bvec2) ConstantComposite 345 345
|
||||||
|
358: TypeVector 53(bool) 3
|
||||||
|
359: 358(bvec3) ConstantComposite 345 345 345
|
||||||
|
361: TypeVector 92(float) 3
|
||||||
|
362: TypePointer Function 361(fvec3)
|
||||||
|
367: TypePointer Function 92(float)
|
||||||
|
378: 27(int) Constant 1
|
||||||
|
379: 27(int) Constant 2
|
||||||
|
380: 72(ivec2) ConstantComposite 378 379
|
||||||
|
385: 79(ivec2) ConstantComposite 207 18
|
||||||
|
390: TypePointer Function 358(bvec3)
|
||||||
|
452(Block): TypeStruct 134(ivec3) 36(int)
|
||||||
|
453: TypePointer Uniform 452(Block)
|
||||||
|
454(block): 453(ptr) Variable Uniform
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
6(literal(): 2 Function None 3
|
||||||
|
7: Label
|
||||||
|
16(i64): 15(ptr) Variable Function
|
||||||
|
33(indexable): 32(ptr) Variable Function
|
||||||
|
38(u64): 37(ptr) Variable Function
|
||||||
|
47(indexable): 46(ptr) Variable Function
|
||||||
|
30: 29(ptr) AccessChain 26 28
|
||||||
|
31: 17(int) Load 30
|
||||||
|
Store 33(indexable) 23
|
||||||
|
34: 15(ptr) AccessChain 33(indexable) 31
|
||||||
|
35: 14(int) Load 34
|
||||||
|
Store 16(i64) 35
|
||||||
|
44: 29(ptr) AccessChain 26 28
|
||||||
|
45: 17(int) Load 44
|
||||||
|
Store 47(indexable) 43
|
||||||
|
48: 37(ptr) AccessChain 47(indexable) 45
|
||||||
|
49: 36(int) Load 48
|
||||||
|
Store 38(u64) 49
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
8(typeCast(): 2 Function None 3
|
||||||
|
9: Label
|
||||||
|
52(i64v): 51(ptr) Variable Function
|
||||||
|
56(bv): 55(ptr) Variable Function
|
||||||
|
65(u64v): 64(ptr) Variable Function
|
||||||
|
74(iv): 73(ptr) Variable Function
|
||||||
|
81(uv): 80(ptr) Variable Function
|
||||||
|
89(fv): 88(ptr) Variable Function
|
||||||
|
95(dv): 94(ptr) Variable Function
|
||||||
|
57: 54(bvec2) Load 56(bv)
|
||||||
|
62: 50(ivec2) Select 57 61 60
|
||||||
|
Store 52(i64v) 62
|
||||||
|
66: 54(bvec2) Load 56(bv)
|
||||||
|
71: 63(ivec2) Select 66 70 69
|
||||||
|
Store 65(u64v) 71
|
||||||
|
75: 72(ivec2) Load 74(iv)
|
||||||
|
76: 50(ivec2) SConvert 75
|
||||||
|
Store 52(i64v) 76
|
||||||
|
77: 50(ivec2) Load 52(i64v)
|
||||||
|
78: 72(ivec2) SConvert 77
|
||||||
|
Store 74(iv) 78
|
||||||
|
82: 79(ivec2) Load 81(uv)
|
||||||
|
83: 63(ivec2) UConvert 82
|
||||||
|
Store 65(u64v) 83
|
||||||
|
84: 63(ivec2) Load 65(u64v)
|
||||||
|
85: 79(ivec2) UConvert 84
|
||||||
|
Store 81(uv) 85
|
||||||
|
90: 50(ivec2) Load 52(i64v)
|
||||||
|
91: 87(fvec2) ConvertSToF 90
|
||||||
|
Store 89(fv) 91
|
||||||
|
96: 50(ivec2) Load 52(i64v)
|
||||||
|
97: 93(fvec2) ConvertSToF 96
|
||||||
|
Store 95(dv) 97
|
||||||
|
98: 63(ivec2) Load 65(u64v)
|
||||||
|
99: 87(fvec2) ConvertUToF 98
|
||||||
|
Store 89(fv) 99
|
||||||
|
100: 63(ivec2) Load 65(u64v)
|
||||||
|
101: 93(fvec2) ConvertUToF 100
|
||||||
|
Store 95(dv) 101
|
||||||
|
102: 87(fvec2) Load 89(fv)
|
||||||
|
103: 50(ivec2) ConvertFToS 102
|
||||||
|
Store 52(i64v) 103
|
||||||
|
104: 93(fvec2) Load 95(dv)
|
||||||
|
105: 50(ivec2) ConvertFToS 104
|
||||||
|
Store 52(i64v) 105
|
||||||
|
106: 87(fvec2) Load 89(fv)
|
||||||
|
107: 63(ivec2) ConvertFToU 106
|
||||||
|
Store 65(u64v) 107
|
||||||
|
108: 93(fvec2) Load 95(dv)
|
||||||
|
109: 63(ivec2) ConvertFToU 108
|
||||||
|
Store 65(u64v) 109
|
||||||
|
110: 50(ivec2) Load 52(i64v)
|
||||||
|
111: 54(bvec2) INotEqual 110 69
|
||||||
|
Store 56(bv) 111
|
||||||
|
112: 63(ivec2) Load 65(u64v)
|
||||||
|
113: 54(bvec2) INotEqual 112 69
|
||||||
|
Store 56(bv) 113
|
||||||
|
114: 50(ivec2) Load 52(i64v)
|
||||||
|
115: 63(ivec2) Bitcast 114
|
||||||
|
Store 65(u64v) 115
|
||||||
|
116: 63(ivec2) Load 65(u64v)
|
||||||
|
117: 50(ivec2) Bitcast 116
|
||||||
|
Store 52(i64v) 117
|
||||||
|
118: 50(ivec2) Load 52(i64v)
|
||||||
|
119: 72(ivec2) SConvert 118
|
||||||
|
120: 79(ivec2) Bitcast 119
|
||||||
|
Store 81(uv) 120
|
||||||
|
121: 79(ivec2) Load 81(uv)
|
||||||
|
122: 63(ivec2) UConvert 121
|
||||||
|
123: 50(ivec2) Bitcast 122
|
||||||
|
Store 52(i64v) 123
|
||||||
|
124: 63(ivec2) Load 65(u64v)
|
||||||
|
125: 79(ivec2) UConvert 124
|
||||||
|
126: 72(ivec2) Bitcast 125
|
||||||
|
Store 74(iv) 126
|
||||||
|
127: 72(ivec2) Load 74(iv)
|
||||||
|
128: 50(ivec2) SConvert 127
|
||||||
|
129: 63(ivec2) Bitcast 128
|
||||||
|
Store 65(u64v) 129
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
10(operators(): 2 Function None 3
|
||||||
|
11: Label
|
||||||
|
132(u64v): 131(ptr) Variable Function
|
||||||
|
137(i64): 15(ptr) Variable Function
|
||||||
|
157(i): 156(ptr) Variable Function
|
||||||
|
164(uv): 163(ptr) Variable Function
|
||||||
|
216(b): 215(ptr) Variable Function
|
||||||
|
133: 130(ivec3) Load 132(u64v)
|
||||||
|
135: 134(ivec3) CompositeConstruct 59 59 59
|
||||||
|
136: 130(ivec3) IAdd 133 135
|
||||||
|
Store 132(u64v) 136
|
||||||
|
138: 14(int) Load 137(i64)
|
||||||
|
139: 14(int) ISub 138 59
|
||||||
|
Store 137(i64) 139
|
||||||
|
140: 14(int) Load 137(i64)
|
||||||
|
141: 14(int) IAdd 140 59
|
||||||
|
Store 137(i64) 141
|
||||||
|
142: 130(ivec3) Load 132(u64v)
|
||||||
|
143: 134(ivec3) CompositeConstruct 59 59 59
|
||||||
|
144: 130(ivec3) ISub 142 143
|
||||||
|
Store 132(u64v) 144
|
||||||
|
145: 130(ivec3) Load 132(u64v)
|
||||||
|
146: 130(ivec3) Not 145
|
||||||
|
Store 132(u64v) 146
|
||||||
|
147: 14(int) Load 137(i64)
|
||||||
|
Store 137(i64) 147
|
||||||
|
148: 130(ivec3) Load 132(u64v)
|
||||||
|
149: 130(ivec3) SNegate 148
|
||||||
|
Store 132(u64v) 149
|
||||||
|
150: 14(int) Load 137(i64)
|
||||||
|
151: 14(int) Load 137(i64)
|
||||||
|
152: 14(int) IAdd 151 150
|
||||||
|
Store 137(i64) 152
|
||||||
|
153: 130(ivec3) Load 132(u64v)
|
||||||
|
154: 130(ivec3) Load 132(u64v)
|
||||||
|
155: 130(ivec3) ISub 154 153
|
||||||
|
Store 132(u64v) 155
|
||||||
|
158: 27(int) Load 157(i)
|
||||||
|
159: 14(int) SConvert 158
|
||||||
|
160: 14(int) Load 137(i64)
|
||||||
|
161: 14(int) IMul 160 159
|
||||||
|
Store 137(i64) 161
|
||||||
|
165: 162(ivec3) Load 164(uv)
|
||||||
|
166: 130(ivec3) UConvert 165
|
||||||
|
167: 130(ivec3) Load 132(u64v)
|
||||||
|
168: 130(ivec3) UDiv 167 166
|
||||||
|
Store 132(u64v) 168
|
||||||
|
169: 27(int) Load 157(i)
|
||||||
|
170: 14(int) SConvert 169
|
||||||
|
171: 36(int) Bitcast 170
|
||||||
|
172: 130(ivec3) Load 132(u64v)
|
||||||
|
173: 130(ivec3) CompositeConstruct 171 171 171
|
||||||
|
174: 130(ivec3) UMod 172 173
|
||||||
|
Store 132(u64v) 174
|
||||||
|
175: 130(ivec3) Load 132(u64v)
|
||||||
|
176: 162(ivec3) Load 164(uv)
|
||||||
|
177: 130(ivec3) UConvert 176
|
||||||
|
178: 130(ivec3) IAdd 175 177
|
||||||
|
Store 132(u64v) 178
|
||||||
|
179: 14(int) Load 137(i64)
|
||||||
|
180: 27(int) Load 157(i)
|
||||||
|
181: 14(int) SConvert 180
|
||||||
|
182: 14(int) ISub 179 181
|
||||||
|
Store 137(i64) 182
|
||||||
|
183: 130(ivec3) Load 132(u64v)
|
||||||
|
184: 162(ivec3) Load 164(uv)
|
||||||
|
185: 130(ivec3) UConvert 184
|
||||||
|
186: 130(ivec3) IMul 183 185
|
||||||
|
Store 132(u64v) 186
|
||||||
|
187: 14(int) Load 137(i64)
|
||||||
|
188: 27(int) Load 157(i)
|
||||||
|
189: 14(int) SConvert 188
|
||||||
|
190: 14(int) IMul 187 189
|
||||||
|
Store 137(i64) 190
|
||||||
|
191: 14(int) Load 137(i64)
|
||||||
|
192: 27(int) Load 157(i)
|
||||||
|
193: 14(int) SConvert 192
|
||||||
|
194: 14(int) SMod 191 193
|
||||||
|
Store 137(i64) 194
|
||||||
|
195: 27(int) Load 157(i)
|
||||||
|
196: 130(ivec3) Load 132(u64v)
|
||||||
|
198: 197(ivec3) CompositeConstruct 195 195 195
|
||||||
|
199: 130(ivec3) ShiftLeftLogical 196 198
|
||||||
|
Store 132(u64v) 199
|
||||||
|
202: 201(ptr) AccessChain 164(uv) 200
|
||||||
|
203: 17(int) Load 202
|
||||||
|
204: 14(int) Load 137(i64)
|
||||||
|
205: 14(int) ShiftRightArithmetic 204 203
|
||||||
|
Store 137(i64) 205
|
||||||
|
206: 14(int) Load 137(i64)
|
||||||
|
208: 37(ptr) AccessChain 132(u64v) 207
|
||||||
|
209: 36(int) Load 208
|
||||||
|
210: 14(int) ShiftLeftLogical 206 209
|
||||||
|
Store 137(i64) 210
|
||||||
|
211: 130(ivec3) Load 132(u64v)
|
||||||
|
212: 14(int) Load 137(i64)
|
||||||
|
213: 134(ivec3) CompositeConstruct 212 212 212
|
||||||
|
214: 130(ivec3) ShiftLeftLogical 211 213
|
||||||
|
Store 132(u64v) 214
|
||||||
|
218: 37(ptr) AccessChain 132(u64v) 217
|
||||||
|
219: 36(int) Load 218
|
||||||
|
220: 14(int) Load 137(i64)
|
||||||
|
221: 36(int) Bitcast 220
|
||||||
|
222: 53(bool) INotEqual 219 221
|
||||||
|
Store 216(b) 222
|
||||||
|
223: 14(int) Load 137(i64)
|
||||||
|
224: 36(int) Bitcast 223
|
||||||
|
225: 37(ptr) AccessChain 132(u64v) 217
|
||||||
|
226: 36(int) Load 225
|
||||||
|
227: 53(bool) IEqual 224 226
|
||||||
|
Store 216(b) 227
|
||||||
|
228: 37(ptr) AccessChain 132(u64v) 217
|
||||||
|
229: 36(int) Load 228
|
||||||
|
230: 201(ptr) AccessChain 164(uv) 200
|
||||||
|
231: 17(int) Load 230
|
||||||
|
232: 36(int) UConvert 231
|
||||||
|
233: 53(bool) UGreaterThan 229 232
|
||||||
|
Store 216(b) 233
|
||||||
|
234: 14(int) Load 137(i64)
|
||||||
|
235: 27(int) Load 157(i)
|
||||||
|
236: 14(int) SConvert 235
|
||||||
|
237: 53(bool) SLessThan 234 236
|
||||||
|
Store 216(b) 237
|
||||||
|
238: 37(ptr) AccessChain 132(u64v) 200
|
||||||
|
239: 36(int) Load 238
|
||||||
|
240: 201(ptr) AccessChain 164(uv) 217
|
||||||
|
241: 17(int) Load 240
|
||||||
|
242: 36(int) UConvert 241
|
||||||
|
243: 53(bool) UGreaterThanEqual 239 242
|
||||||
|
Store 216(b) 243
|
||||||
|
244: 14(int) Load 137(i64)
|
||||||
|
245: 27(int) Load 157(i)
|
||||||
|
246: 14(int) SConvert 245
|
||||||
|
247: 53(bool) SLessThanEqual 244 246
|
||||||
|
Store 216(b) 247
|
||||||
|
248: 27(int) Load 157(i)
|
||||||
|
249: 14(int) SConvert 248
|
||||||
|
250: 36(int) Bitcast 249
|
||||||
|
251: 130(ivec3) Load 132(u64v)
|
||||||
|
252: 130(ivec3) CompositeConstruct 250 250 250
|
||||||
|
253: 130(ivec3) BitwiseOr 251 252
|
||||||
|
Store 132(u64v) 253
|
||||||
|
254: 14(int) Load 137(i64)
|
||||||
|
255: 27(int) Load 157(i)
|
||||||
|
256: 14(int) SConvert 255
|
||||||
|
257: 14(int) BitwiseOr 254 256
|
||||||
|
Store 137(i64) 257
|
||||||
|
258: 27(int) Load 157(i)
|
||||||
|
259: 14(int) SConvert 258
|
||||||
|
260: 14(int) Load 137(i64)
|
||||||
|
261: 14(int) BitwiseAnd 260 259
|
||||||
|
Store 137(i64) 261
|
||||||
|
262: 130(ivec3) Load 132(u64v)
|
||||||
|
263: 162(ivec3) Load 164(uv)
|
||||||
|
264: 130(ivec3) UConvert 263
|
||||||
|
265: 130(ivec3) BitwiseAnd 262 264
|
||||||
|
Store 132(u64v) 265
|
||||||
|
266: 14(int) Load 137(i64)
|
||||||
|
267: 36(int) Bitcast 266
|
||||||
|
268: 130(ivec3) Load 132(u64v)
|
||||||
|
269: 130(ivec3) CompositeConstruct 267 267 267
|
||||||
|
270: 130(ivec3) BitwiseXor 268 269
|
||||||
|
Store 132(u64v) 270
|
||||||
|
271: 130(ivec3) Load 132(u64v)
|
||||||
|
272: 14(int) Load 137(i64)
|
||||||
|
273: 36(int) Bitcast 272
|
||||||
|
274: 130(ivec3) CompositeConstruct 273 273 273
|
||||||
|
275: 130(ivec3) BitwiseXor 271 274
|
||||||
|
Store 132(u64v) 275
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
12(builtinFuncs(): 2 Function None 3
|
||||||
|
13: Label
|
||||||
|
276(i64v): 51(ptr) Variable Function
|
||||||
|
279(i64): 15(ptr) Variable Function
|
||||||
|
289(u64v): 131(ptr) Variable Function
|
||||||
|
291(u64): 37(ptr) Variable Function
|
||||||
|
363(dv): 362(ptr) Variable Function
|
||||||
|
382(iv): 73(ptr) Variable Function
|
||||||
|
387(uv): 80(ptr) Variable Function
|
||||||
|
391(bv): 390(ptr) Variable Function
|
||||||
|
277: 50(ivec2) Load 276(i64v)
|
||||||
|
278: 50(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 277
|
||||||
|
Store 276(i64v) 278
|
||||||
|
280: 14(int) Load 279(i64)
|
||||||
|
281: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 280
|
||||||
|
Store 279(i64) 281
|
||||||
|
282: 50(ivec2) Load 276(i64v)
|
||||||
|
283: 14(int) Load 279(i64)
|
||||||
|
284: 50(ivec2) CompositeConstruct 283 283
|
||||||
|
285: 50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 282 284
|
||||||
|
Store 276(i64v) 285
|
||||||
|
286: 50(ivec2) Load 276(i64v)
|
||||||
|
288: 50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 286 287
|
||||||
|
Store 276(i64v) 288
|
||||||
|
290: 130(ivec3) Load 289(u64v)
|
||||||
|
292: 36(int) Load 291(u64)
|
||||||
|
293: 130(ivec3) CompositeConstruct 292 292 292
|
||||||
|
294: 130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 290 293
|
||||||
|
Store 289(u64v) 294
|
||||||
|
295: 130(ivec3) Load 289(u64v)
|
||||||
|
297: 130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 295 296
|
||||||
|
Store 289(u64v) 297
|
||||||
|
298: 50(ivec2) Load 276(i64v)
|
||||||
|
299: 14(int) Load 279(i64)
|
||||||
|
300: 50(ivec2) CompositeConstruct 299 299
|
||||||
|
301: 50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 298 300
|
||||||
|
Store 276(i64v) 301
|
||||||
|
302: 50(ivec2) Load 276(i64v)
|
||||||
|
303: 50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 302 287
|
||||||
|
Store 276(i64v) 303
|
||||||
|
304: 130(ivec3) Load 289(u64v)
|
||||||
|
305: 36(int) Load 291(u64)
|
||||||
|
306: 130(ivec3) CompositeConstruct 305 305 305
|
||||||
|
307: 130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 304 306
|
||||||
|
Store 289(u64v) 307
|
||||||
|
308: 130(ivec3) Load 289(u64v)
|
||||||
|
309: 130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 308 296
|
||||||
|
Store 289(u64v) 309
|
||||||
|
310: 50(ivec2) Load 276(i64v)
|
||||||
|
311: 14(int) Load 279(i64)
|
||||||
|
312: 14(int) SNegate 311
|
||||||
|
313: 14(int) Load 279(i64)
|
||||||
|
314: 50(ivec2) CompositeConstruct 312 312
|
||||||
|
315: 50(ivec2) CompositeConstruct 313 313
|
||||||
|
316: 50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 310 314 315
|
||||||
|
Store 276(i64v) 316
|
||||||
|
317: 50(ivec2) Load 276(i64v)
|
||||||
|
318: 50(ivec2) Load 276(i64v)
|
||||||
|
319: 50(ivec2) SNegate 318
|
||||||
|
320: 50(ivec2) Load 276(i64v)
|
||||||
|
321: 50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 317 319 320
|
||||||
|
Store 276(i64v) 321
|
||||||
|
322: 130(ivec3) Load 289(u64v)
|
||||||
|
323: 36(int) Load 291(u64)
|
||||||
|
324: 36(int) SNegate 323
|
||||||
|
325: 36(int) Load 291(u64)
|
||||||
|
326: 130(ivec3) CompositeConstruct 324 324 324
|
||||||
|
327: 130(ivec3) CompositeConstruct 325 325 325
|
||||||
|
328: 130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 322 326 327
|
||||||
|
Store 289(u64v) 328
|
||||||
|
329: 130(ivec3) Load 289(u64v)
|
||||||
|
330: 130(ivec3) Load 289(u64v)
|
||||||
|
331: 130(ivec3) SNegate 330
|
||||||
|
332: 130(ivec3) Load 289(u64v)
|
||||||
|
333: 130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 329 331 332
|
||||||
|
Store 289(u64v) 333
|
||||||
|
334: 15(ptr) AccessChain 276(i64v) 217
|
||||||
|
335: 14(int) Load 334
|
||||||
|
336: 15(ptr) AccessChain 276(i64v) 200
|
||||||
|
337: 14(int) Load 336
|
||||||
|
339: 14(int) Select 338 337 335
|
||||||
|
Store 279(i64) 339
|
||||||
|
340: 14(int) Load 279(i64)
|
||||||
|
341: 50(ivec2) CompositeConstruct 340 340
|
||||||
|
342: 14(int) Load 279(i64)
|
||||||
|
343: 14(int) SNegate 342
|
||||||
|
344: 50(ivec2) CompositeConstruct 343 343
|
||||||
|
347: 50(ivec2) Select 346 344 341
|
||||||
|
Store 276(i64v) 347
|
||||||
|
348: 37(ptr) AccessChain 289(u64v) 217
|
||||||
|
349: 36(int) Load 348
|
||||||
|
350: 37(ptr) AccessChain 289(u64v) 200
|
||||||
|
351: 36(int) Load 350
|
||||||
|
352: 36(int) Select 338 351 349
|
||||||
|
Store 291(u64) 352
|
||||||
|
353: 36(int) Load 291(u64)
|
||||||
|
354: 130(ivec3) CompositeConstruct 353 353 353
|
||||||
|
355: 36(int) Load 291(u64)
|
||||||
|
356: 36(int) SNegate 355
|
||||||
|
357: 130(ivec3) CompositeConstruct 356 356 356
|
||||||
|
360: 130(ivec3) Select 359 357 354
|
||||||
|
Store 289(u64v) 360
|
||||||
|
364: 361(fvec3) Load 363(dv)
|
||||||
|
365: 93(fvec2) VectorShuffle 364 364 0 1
|
||||||
|
366: 50(ivec2) Bitcast 365
|
||||||
|
Store 276(i64v) 366
|
||||||
|
368: 367(ptr) AccessChain 363(dv) 207
|
||||||
|
369: 92(float) Load 368
|
||||||
|
370: 36(int) Bitcast 369
|
||||||
|
371: 37(ptr) AccessChain 289(u64v) 217
|
||||||
|
Store 371 370
|
||||||
|
372: 50(ivec2) Load 276(i64v)
|
||||||
|
373: 93(fvec2) Bitcast 372
|
||||||
|
374: 361(fvec3) Load 363(dv)
|
||||||
|
375: 361(fvec3) VectorShuffle 374 373 3 4 2
|
||||||
|
Store 363(dv) 375
|
||||||
|
376: 130(ivec3) Load 289(u64v)
|
||||||
|
377: 361(fvec3) Bitcast 376
|
||||||
|
Store 363(dv) 377
|
||||||
|
381: 14(int) ExtInst 1(GLSL.std.450) 0(Unknown) 380
|
||||||
|
Store 279(i64) 381
|
||||||
|
383: 14(int) Load 279(i64)
|
||||||
|
384: 72(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 383
|
||||||
|
Store 382(iv) 384
|
||||||
|
386: 36(int) ExtInst 1(GLSL.std.450) 0(Unknown) 385
|
||||||
|
Store 291(u64) 386
|
||||||
|
388: 36(int) Load 291(u64)
|
||||||
|
389: 79(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 388
|
||||||
|
Store 387(uv) 389
|
||||||
|
392: 130(ivec3) Load 289(u64v)
|
||||||
|
393: 36(int) Load 291(u64)
|
||||||
|
394: 130(ivec3) CompositeConstruct 393 393 393
|
||||||
|
395: 358(bvec3) ULessThan 392 394
|
||||||
|
Store 391(bv) 395
|
||||||
|
396: 50(ivec2) Load 276(i64v)
|
||||||
|
397: 14(int) Load 279(i64)
|
||||||
|
398: 50(ivec2) CompositeConstruct 397 397
|
||||||
|
399: 54(bvec2) SLessThan 396 398
|
||||||
|
400: 358(bvec3) Load 391(bv)
|
||||||
|
401: 358(bvec3) VectorShuffle 400 399 3 4 2
|
||||||
|
Store 391(bv) 401
|
||||||
|
402: 130(ivec3) Load 289(u64v)
|
||||||
|
403: 36(int) Load 291(u64)
|
||||||
|
404: 130(ivec3) CompositeConstruct 403 403 403
|
||||||
|
405: 358(bvec3) ULessThanEqual 402 404
|
||||||
|
Store 391(bv) 405
|
||||||
|
406: 50(ivec2) Load 276(i64v)
|
||||||
|
407: 14(int) Load 279(i64)
|
||||||
|
408: 50(ivec2) CompositeConstruct 407 407
|
||||||
|
409: 54(bvec2) SLessThanEqual 406 408
|
||||||
|
410: 358(bvec3) Load 391(bv)
|
||||||
|
411: 358(bvec3) VectorShuffle 410 409 3 4 2
|
||||||
|
Store 391(bv) 411
|
||||||
|
412: 130(ivec3) Load 289(u64v)
|
||||||
|
413: 36(int) Load 291(u64)
|
||||||
|
414: 130(ivec3) CompositeConstruct 413 413 413
|
||||||
|
415: 358(bvec3) UGreaterThan 412 414
|
||||||
|
Store 391(bv) 415
|
||||||
|
416: 50(ivec2) Load 276(i64v)
|
||||||
|
417: 14(int) Load 279(i64)
|
||||||
|
418: 50(ivec2) CompositeConstruct 417 417
|
||||||
|
419: 54(bvec2) SGreaterThan 416 418
|
||||||
|
420: 358(bvec3) Load 391(bv)
|
||||||
|
421: 358(bvec3) VectorShuffle 420 419 3 4 2
|
||||||
|
Store 391(bv) 421
|
||||||
|
422: 130(ivec3) Load 289(u64v)
|
||||||
|
423: 36(int) Load 291(u64)
|
||||||
|
424: 130(ivec3) CompositeConstruct 423 423 423
|
||||||
|
425: 358(bvec3) UGreaterThanEqual 422 424
|
||||||
|
Store 391(bv) 425
|
||||||
|
426: 50(ivec2) Load 276(i64v)
|
||||||
|
427: 14(int) Load 279(i64)
|
||||||
|
428: 50(ivec2) CompositeConstruct 427 427
|
||||||
|
429: 54(bvec2) SGreaterThanEqual 426 428
|
||||||
|
430: 358(bvec3) Load 391(bv)
|
||||||
|
431: 358(bvec3) VectorShuffle 430 429 3 4 2
|
||||||
|
Store 391(bv) 431
|
||||||
|
432: 130(ivec3) Load 289(u64v)
|
||||||
|
433: 36(int) Load 291(u64)
|
||||||
|
434: 130(ivec3) CompositeConstruct 433 433 433
|
||||||
|
435: 358(bvec3) IEqual 432 434
|
||||||
|
Store 391(bv) 435
|
||||||
|
436: 50(ivec2) Load 276(i64v)
|
||||||
|
437: 14(int) Load 279(i64)
|
||||||
|
438: 50(ivec2) CompositeConstruct 437 437
|
||||||
|
439: 54(bvec2) IEqual 436 438
|
||||||
|
440: 358(bvec3) Load 391(bv)
|
||||||
|
441: 358(bvec3) VectorShuffle 440 439 3 4 2
|
||||||
|
Store 391(bv) 441
|
||||||
|
442: 130(ivec3) Load 289(u64v)
|
||||||
|
443: 36(int) Load 291(u64)
|
||||||
|
444: 130(ivec3) CompositeConstruct 443 443 443
|
||||||
|
445: 358(bvec3) INotEqual 442 444
|
||||||
|
Store 391(bv) 445
|
||||||
|
446: 50(ivec2) Load 276(i64v)
|
||||||
|
447: 14(int) Load 279(i64)
|
||||||
|
448: 50(ivec2) CompositeConstruct 447 447
|
||||||
|
449: 54(bvec2) INotEqual 446 448
|
||||||
|
450: 358(bvec3) Load 391(bv)
|
||||||
|
451: 358(bvec3) VectorShuffle 450 449 3 4 2
|
||||||
|
Store 391(bv) 451
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
228
Test/spv.int64.frag
Normal file
228
Test/spv.int64.frag
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
#extension GL_ARB_gpu_shader_int64: enable
|
||||||
|
|
||||||
|
layout(binding = 0) uniform Uniforms
|
||||||
|
{
|
||||||
|
uint index;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(std140, binding = 1) uniform Block
|
||||||
|
{
|
||||||
|
i64vec3 i64v;
|
||||||
|
uint64_t u64;
|
||||||
|
} block;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void literal()
|
||||||
|
{
|
||||||
|
const int64_t i64Const[3] =
|
||||||
|
{
|
||||||
|
-0x1111111111111111l, // Hex
|
||||||
|
-1l, // Dec
|
||||||
|
040000000000l, // Oct
|
||||||
|
};
|
||||||
|
|
||||||
|
int64_t i64 = i64Const[index];
|
||||||
|
|
||||||
|
const uint64_t u64Const[] =
|
||||||
|
{
|
||||||
|
0xFFFFFFFFFFFFFFFFul, // Hex
|
||||||
|
4294967296UL, // Dec
|
||||||
|
077777777777ul, // Oct
|
||||||
|
};
|
||||||
|
|
||||||
|
uint64_t u64 = u64Const[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
void typeCast()
|
||||||
|
{
|
||||||
|
bvec2 bv;
|
||||||
|
ivec2 iv;
|
||||||
|
uvec2 uv;
|
||||||
|
vec2 fv;
|
||||||
|
dvec2 dv;
|
||||||
|
|
||||||
|
i64vec2 i64v;
|
||||||
|
u64vec2 u64v;
|
||||||
|
|
||||||
|
i64v = i64vec2(bv); // bool -> int64
|
||||||
|
u64v = u64vec2(bv); // bool -> uint64
|
||||||
|
|
||||||
|
i64v = iv; // int -> int64
|
||||||
|
iv = ivec2(i64v); // int64 -> int
|
||||||
|
|
||||||
|
u64v = uv; // uint -> uint64
|
||||||
|
uv = uvec2(u64v); // uint64 -> uint
|
||||||
|
|
||||||
|
fv = vec2(i64v); // int64 -> float
|
||||||
|
dv = i64v; // int64 -> double
|
||||||
|
|
||||||
|
fv = vec2(u64v); // uint64 -> float
|
||||||
|
dv = u64v; // uint64 -> double
|
||||||
|
|
||||||
|
i64v = i64vec2(fv); // float -> int64
|
||||||
|
i64v = i64vec2(dv); // double -> int64
|
||||||
|
|
||||||
|
u64v = u64vec2(fv); // float -> uint64
|
||||||
|
u64v = u64vec2(dv); // double -> uint64
|
||||||
|
|
||||||
|
bv = bvec2(i64v); // int64 -> bool
|
||||||
|
bv = bvec2(u64v); // uint64 -> bool
|
||||||
|
|
||||||
|
u64v = i64v; // int64 -> uint64
|
||||||
|
i64v = i64vec2(u64v); // uint64 -> int64
|
||||||
|
|
||||||
|
uv = uvec2(i64v); // int64 -> uint
|
||||||
|
i64v = i64vec2(uv); // uint -> int64
|
||||||
|
iv = ivec2(u64v); // uint64 -> int
|
||||||
|
u64v = iv; // int -> uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
void operators()
|
||||||
|
{
|
||||||
|
u64vec3 u64v;
|
||||||
|
int64_t i64;
|
||||||
|
uvec3 uv;
|
||||||
|
int i;
|
||||||
|
bool b;
|
||||||
|
|
||||||
|
// Unary
|
||||||
|
u64v++;
|
||||||
|
i64--;
|
||||||
|
++i64;
|
||||||
|
--u64v;
|
||||||
|
|
||||||
|
u64v = ~u64v;
|
||||||
|
|
||||||
|
i64 = +i64;
|
||||||
|
u64v = -u64v;
|
||||||
|
|
||||||
|
// Arithmetic
|
||||||
|
i64 += i64;
|
||||||
|
u64v -= u64v;
|
||||||
|
i64 *= i;
|
||||||
|
u64v /= uv;
|
||||||
|
u64v %= i;
|
||||||
|
|
||||||
|
u64v = u64v + uv;
|
||||||
|
i64 = i64 - i;
|
||||||
|
u64v = u64v * uv;
|
||||||
|
i64 = i64 * i;
|
||||||
|
i64 = i64 % i;
|
||||||
|
|
||||||
|
// Shift
|
||||||
|
u64v <<= i;
|
||||||
|
i64 >>= uv.y;
|
||||||
|
|
||||||
|
i64 = i64 << u64v.z;
|
||||||
|
u64v = u64v << i64;
|
||||||
|
|
||||||
|
// Relational
|
||||||
|
b = (u64v.x != i64);
|
||||||
|
b = (i64 == u64v.x);
|
||||||
|
b = (u64v.x > uv.y);
|
||||||
|
b = (i64 < i);
|
||||||
|
b = (u64v.y >= uv.x);
|
||||||
|
b = (i64 <= i);
|
||||||
|
|
||||||
|
// Bitwise
|
||||||
|
u64v |= i;
|
||||||
|
i64 = i64 | i;
|
||||||
|
i64 &= i;
|
||||||
|
u64v = u64v & uv;
|
||||||
|
u64v ^= i64;
|
||||||
|
u64v = u64v ^ i64;
|
||||||
|
}
|
||||||
|
|
||||||
|
void builtinFuncs()
|
||||||
|
{
|
||||||
|
i64vec2 i64v;
|
||||||
|
u64vec3 u64v;
|
||||||
|
dvec3 dv;
|
||||||
|
bvec3 bv;
|
||||||
|
|
||||||
|
int64_t i64;
|
||||||
|
uint64_t u64;
|
||||||
|
|
||||||
|
// abs()
|
||||||
|
i64v = abs(i64v);
|
||||||
|
|
||||||
|
// sign()
|
||||||
|
i64 = sign(i64);
|
||||||
|
|
||||||
|
// min()
|
||||||
|
i64v = min(i64v, i64);
|
||||||
|
i64v = min(i64v, i64vec2(-1));
|
||||||
|
u64v = min(u64v, u64);
|
||||||
|
u64v = min(u64v, u64vec3(0));
|
||||||
|
|
||||||
|
// max()
|
||||||
|
i64v = max(i64v, i64);
|
||||||
|
i64v = max(i64v, i64vec2(-1));
|
||||||
|
u64v = max(u64v, u64);
|
||||||
|
u64v = max(u64v, u64vec3(0));
|
||||||
|
|
||||||
|
// clamp()
|
||||||
|
i64v = clamp(i64v, -i64, i64);
|
||||||
|
i64v = clamp(i64v, -i64v, i64v);
|
||||||
|
u64v = clamp(u64v, -u64, u64);
|
||||||
|
u64v = clamp(u64v, -u64v, u64v);
|
||||||
|
|
||||||
|
// mix()
|
||||||
|
i64 = mix(i64v.x, i64v.y, true);
|
||||||
|
i64v = mix(i64vec2(i64), i64vec2(-i64), bvec2(false));
|
||||||
|
u64 = mix(u64v.x, u64v.y, true);
|
||||||
|
u64v = mix(u64vec3(u64), u64vec3(-u64), bvec3(false));
|
||||||
|
|
||||||
|
// doubleBitsToInt64()
|
||||||
|
i64v = doubleBitsToInt64(dv.xy);
|
||||||
|
|
||||||
|
// doubleBitsToUint64()
|
||||||
|
u64v.x = doubleBitsToUint64(dv.z);
|
||||||
|
|
||||||
|
// int64BitsToDouble()
|
||||||
|
dv.xy = int64BitsToDouble(i64v);
|
||||||
|
|
||||||
|
// uint64BitsToDouble()
|
||||||
|
dv = uint64BitsToDouble(u64v);
|
||||||
|
|
||||||
|
// packInt2x32()
|
||||||
|
i64 = packInt2x32(ivec2(1, 2));
|
||||||
|
|
||||||
|
// unpackInt2x32()
|
||||||
|
ivec2 iv = unpackInt2x32(i64);
|
||||||
|
|
||||||
|
// packUint2x32()
|
||||||
|
u64 = packUint2x32(uvec2(2, 3));
|
||||||
|
|
||||||
|
// unpackUint2x32()
|
||||||
|
uvec2 uv = unpackUint2x32(u64);
|
||||||
|
|
||||||
|
// lessThan()
|
||||||
|
bv = lessThan(u64v, u64vec3(u64));
|
||||||
|
bv.xy = lessThan(i64v, i64vec2(i64));
|
||||||
|
|
||||||
|
// lessThanEqual()
|
||||||
|
bv = lessThanEqual(u64v, u64vec3(u64));
|
||||||
|
bv.xy = lessThanEqual(i64v, i64vec2(i64));
|
||||||
|
|
||||||
|
// greaterThan()
|
||||||
|
bv = greaterThan(u64v, u64vec3(u64));
|
||||||
|
bv.xy = greaterThan(i64v, i64vec2(i64));
|
||||||
|
|
||||||
|
// greaterThanEqual()
|
||||||
|
bv = greaterThanEqual(u64v, u64vec3(u64));
|
||||||
|
bv.xy = greaterThanEqual(i64v, i64vec2(i64));
|
||||||
|
|
||||||
|
// equal()
|
||||||
|
bv = equal(u64v, u64vec3(u64));
|
||||||
|
bv.xy = equal(i64v, i64vec2(i64));
|
||||||
|
|
||||||
|
// notEqual()
|
||||||
|
bv = notEqual(u64v, u64vec3(u64));
|
||||||
|
bv.xy = notEqual(i64v, i64vec2(i64));
|
||||||
|
}
|
@ -53,6 +53,7 @@ spv.forwardFun.frag
|
|||||||
spv.functionCall.frag
|
spv.functionCall.frag
|
||||||
spv.functionSemantics.frag
|
spv.functionSemantics.frag
|
||||||
spv.interpOps.frag
|
spv.interpOps.frag
|
||||||
|
spv.int64.frag
|
||||||
spv.layoutNested.vert
|
spv.layoutNested.vert
|
||||||
spv.length.frag
|
spv.length.frag
|
||||||
spv.localAggregates.frag
|
spv.localAggregates.frag
|
||||||
|
@ -48,6 +48,8 @@ enum TBasicType {
|
|||||||
EbtDouble,
|
EbtDouble,
|
||||||
EbtInt,
|
EbtInt,
|
||||||
EbtUint,
|
EbtUint,
|
||||||
|
EbtInt64,
|
||||||
|
EbtUint64,
|
||||||
EbtBool,
|
EbtBool,
|
||||||
EbtAtomicUint,
|
EbtAtomicUint,
|
||||||
EbtSampler,
|
EbtSampler,
|
||||||
|
@ -57,6 +57,18 @@ public:
|
|||||||
type = EbtUint;
|
type = EbtUint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setI64Const(long long i64)
|
||||||
|
{
|
||||||
|
i64Const = i64;
|
||||||
|
type = EbtInt64;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setU64Const(unsigned long long u64)
|
||||||
|
{
|
||||||
|
u64Const = u64;
|
||||||
|
type = EbtUint64;
|
||||||
|
}
|
||||||
|
|
||||||
void setDConst(double d)
|
void setDConst(double d)
|
||||||
{
|
{
|
||||||
dConst = d;
|
dConst = d;
|
||||||
@ -69,10 +81,12 @@ public:
|
|||||||
type = EbtBool;
|
type = EbtBool;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getIConst() const { return iConst; }
|
int getIConst() const { return iConst; }
|
||||||
unsigned int getUConst() const { return uConst; }
|
unsigned int getUConst() const { return uConst; }
|
||||||
double getDConst() const { return dConst; }
|
long long getI64Const() const { return i64Const; }
|
||||||
bool getBConst() const { return bConst; }
|
unsigned long long getU64Const() const { return u64Const; }
|
||||||
|
double getDConst() const { return dConst; }
|
||||||
|
bool getBConst() const { return bConst; }
|
||||||
|
|
||||||
bool operator==(const int i) const
|
bool operator==(const int i) const
|
||||||
{
|
{
|
||||||
@ -82,7 +96,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(unsigned const int u) const
|
bool operator==(const unsigned int u) const
|
||||||
{
|
{
|
||||||
if (u == uConst)
|
if (u == uConst)
|
||||||
return true;
|
return true;
|
||||||
@ -90,6 +104,22 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(const long long i64) const
|
||||||
|
{
|
||||||
|
if (i64 == i64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const unsigned long long u64) const
|
||||||
|
{
|
||||||
|
if (u64 == u64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const double d) const
|
bool operator==(const double d) const
|
||||||
{
|
{
|
||||||
if (d == dConst)
|
if (d == dConst)
|
||||||
@ -121,6 +151,16 @@ public:
|
|||||||
if (constant.uConst == uConst)
|
if (constant.uConst == uConst)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
if (constant.i64Const == i64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
if (constant.u64Const == u64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
if (constant.dConst == dConst)
|
if (constant.dConst == dConst)
|
||||||
@ -149,6 +189,16 @@ public:
|
|||||||
return !operator==(u);
|
return !operator==(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator!=(const long long i) const
|
||||||
|
{
|
||||||
|
return !operator==(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const unsigned long long u) const
|
||||||
|
{
|
||||||
|
return !operator==(u);
|
||||||
|
}
|
||||||
|
|
||||||
bool operator!=(const float f) const
|
bool operator!=(const float f) const
|
||||||
{
|
{
|
||||||
return !operator==(f);
|
return !operator==(f);
|
||||||
@ -177,6 +227,16 @@ public:
|
|||||||
if (uConst > constant.uConst)
|
if (uConst > constant.uConst)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtInt64:
|
||||||
|
if (i64Const > constant.i64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtUint64:
|
||||||
|
if (u64Const > constant.u64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
if (dConst > constant.dConst)
|
if (dConst > constant.dConst)
|
||||||
@ -202,6 +262,16 @@ public:
|
|||||||
if (uConst < constant.uConst)
|
if (uConst < constant.uConst)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtInt64:
|
||||||
|
if (i64Const < constant.i64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtUint64:
|
||||||
|
if (u64Const < constant.u64Const)
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
if (dConst < constant.dConst)
|
if (dConst < constant.dConst)
|
||||||
@ -220,7 +290,9 @@ public:
|
|||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
@ -234,7 +306,9 @@ public:
|
|||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
@ -248,7 +322,9 @@ public:
|
|||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
@ -261,8 +337,10 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,16 +353,38 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||||
default: assert(false && "Default missing");
|
case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||||
default: assert(false && "Default missing");
|
case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setI64Const(i64Const >> constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setI64Const(i64Const >> constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const >> constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setI64Const(i64Const >> constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setU64Const(u64Const >> constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setU64Const(u64Const >> constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setU64Const(u64Const >> constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const >> constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
@ -299,16 +399,38 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||||
default: assert(false && "Default missing");
|
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||||
default: assert(false && "Default missing");
|
case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setI64Const(i64Const << constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setI64Const(i64Const << constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setI64Const(i64Const << constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setU64Const(u64Const << constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setU64Const(u64Const << constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setU64Const(u64Const << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const << constant.u64Const); break;
|
||||||
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
@ -324,6 +446,8 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +461,8 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +476,8 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,6 +490,8 @@ public:
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case EbtInt: returnValue.setIConst(~iConst); break;
|
case EbtInt: returnValue.setIConst(~iConst); break;
|
||||||
case EbtUint: returnValue.setUConst(~uConst); break;
|
case EbtUint: returnValue.setUConst(~uConst); break;
|
||||||
|
case EbtInt64: returnValue.setI64Const(~i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setU64Const(~u64Const); break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,10 +526,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
union {
|
union {
|
||||||
int iConst; // used for ivec, scalar ints
|
int iConst; // used for ivec, scalar ints
|
||||||
unsigned int uConst; // used for uvec, scalar uints
|
unsigned int uConst; // used for uvec, scalar uints
|
||||||
bool bConst; // used for bvec, scalar bools
|
long long i64Const; // used for i64vec, scalar int64s
|
||||||
double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles
|
unsigned long long u64Const; // used for u64vec, scalar uint64s
|
||||||
|
bool bConst; // used for bvec, scalar bools
|
||||||
|
double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles
|
||||||
};
|
};
|
||||||
|
|
||||||
TBasicType type;
|
TBasicType type;
|
||||||
|
@ -182,6 +182,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|||||||
case EbtFloat: break;
|
case EbtFloat: break;
|
||||||
case EbtInt: s.append("i"); break;
|
case EbtInt: s.append("i"); break;
|
||||||
case EbtUint: s.append("u"); break;
|
case EbtUint: s.append("u"); break;
|
||||||
|
case EbtInt64: s.append("i64"); break;
|
||||||
|
case EbtUint64: s.append("u64"); break;
|
||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
if (image) {
|
if (image) {
|
||||||
@ -1319,6 +1321,8 @@ public:
|
|||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
|
case EbtInt64:
|
||||||
|
case EbtUint64:
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@ -1409,6 +1413,8 @@ public:
|
|||||||
case EbtDouble: return "double";
|
case EbtDouble: return "double";
|
||||||
case EbtInt: return "int";
|
case EbtInt: return "int";
|
||||||
case EbtUint: return "uint";
|
case EbtUint: return "uint";
|
||||||
|
case EbtInt64: return "int64_t";
|
||||||
|
case EbtUint64: return "uint64_t";
|
||||||
case EbtBool: return "bool";
|
case EbtBool: return "bool";
|
||||||
case EbtAtomicUint: return "atomic_uint";
|
case EbtAtomicUint: return "atomic_uint";
|
||||||
case EbtSampler: return "sampler/image";
|
case EbtSampler: return "sampler/image";
|
||||||
|
@ -81,22 +81,44 @@ enum TOperator {
|
|||||||
EOpConvUintToBool,
|
EOpConvUintToBool,
|
||||||
EOpConvFloatToBool,
|
EOpConvFloatToBool,
|
||||||
EOpConvDoubleToBool,
|
EOpConvDoubleToBool,
|
||||||
|
EOpConvInt64ToBool,
|
||||||
|
EOpConvUint64ToBool,
|
||||||
EOpConvBoolToFloat,
|
EOpConvBoolToFloat,
|
||||||
EOpConvIntToFloat,
|
EOpConvIntToFloat,
|
||||||
EOpConvUintToFloat,
|
EOpConvUintToFloat,
|
||||||
EOpConvDoubleToFloat,
|
EOpConvDoubleToFloat,
|
||||||
|
EOpConvInt64ToFloat,
|
||||||
|
EOpConvUint64ToFloat,
|
||||||
EOpConvUintToInt,
|
EOpConvUintToInt,
|
||||||
EOpConvFloatToInt,
|
EOpConvFloatToInt,
|
||||||
EOpConvBoolToInt,
|
EOpConvBoolToInt,
|
||||||
EOpConvDoubleToInt,
|
EOpConvDoubleToInt,
|
||||||
|
EOpConvInt64ToInt,
|
||||||
|
EOpConvUint64ToInt,
|
||||||
EOpConvIntToUint,
|
EOpConvIntToUint,
|
||||||
EOpConvFloatToUint,
|
EOpConvFloatToUint,
|
||||||
EOpConvBoolToUint,
|
EOpConvBoolToUint,
|
||||||
EOpConvDoubleToUint,
|
EOpConvDoubleToUint,
|
||||||
|
EOpConvInt64ToUint,
|
||||||
|
EOpConvUint64ToUint,
|
||||||
EOpConvIntToDouble,
|
EOpConvIntToDouble,
|
||||||
EOpConvUintToDouble,
|
EOpConvUintToDouble,
|
||||||
EOpConvFloatToDouble,
|
EOpConvFloatToDouble,
|
||||||
EOpConvBoolToDouble,
|
EOpConvBoolToDouble,
|
||||||
|
EOpConvInt64ToDouble,
|
||||||
|
EOpConvUint64ToDouble,
|
||||||
|
EOpConvBoolToInt64,
|
||||||
|
EOpConvIntToInt64,
|
||||||
|
EOpConvUintToInt64,
|
||||||
|
EOpConvFloatToInt64,
|
||||||
|
EOpConvDoubleToInt64,
|
||||||
|
EOpConvUint64ToInt64,
|
||||||
|
EOpConvBoolToUint64,
|
||||||
|
EOpConvIntToUint64,
|
||||||
|
EOpConvUintToUint64,
|
||||||
|
EOpConvFloatToUint64,
|
||||||
|
EOpConvDoubleToUint64,
|
||||||
|
EOpConvInt64ToUint64,
|
||||||
|
|
||||||
//
|
//
|
||||||
// binary operations
|
// binary operations
|
||||||
@ -194,6 +216,10 @@ enum TOperator {
|
|||||||
EOpFloatBitsToUint,
|
EOpFloatBitsToUint,
|
||||||
EOpIntBitsToFloat,
|
EOpIntBitsToFloat,
|
||||||
EOpUintBitsToFloat,
|
EOpUintBitsToFloat,
|
||||||
|
EOpDoubleBitsToInt64,
|
||||||
|
EOpDoubleBitsToUint64,
|
||||||
|
EOpInt64BitsToDouble,
|
||||||
|
EOpUint64BitsToDouble,
|
||||||
EOpPackSnorm2x16,
|
EOpPackSnorm2x16,
|
||||||
EOpUnpackSnorm2x16,
|
EOpUnpackSnorm2x16,
|
||||||
EOpPackUnorm2x16,
|
EOpPackUnorm2x16,
|
||||||
@ -206,6 +232,10 @@ enum TOperator {
|
|||||||
EOpUnpackHalf2x16,
|
EOpUnpackHalf2x16,
|
||||||
EOpPackDouble2x32,
|
EOpPackDouble2x32,
|
||||||
EOpUnpackDouble2x32,
|
EOpUnpackDouble2x32,
|
||||||
|
EOpPackInt2x32,
|
||||||
|
EOpUnpackInt2x32,
|
||||||
|
EOpPackUint2x32,
|
||||||
|
EOpUnpackUint2x32,
|
||||||
|
|
||||||
EOpLength,
|
EOpLength,
|
||||||
EOpDistance,
|
EOpDistance,
|
||||||
@ -287,6 +317,8 @@ enum TOperator {
|
|||||||
EOpConstructGuardStart,
|
EOpConstructGuardStart,
|
||||||
EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed
|
EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed
|
||||||
EOpConstructUint,
|
EOpConstructUint,
|
||||||
|
EOpConstructInt64,
|
||||||
|
EOpConstructUint64,
|
||||||
EOpConstructBool,
|
EOpConstructBool,
|
||||||
EOpConstructFloat,
|
EOpConstructFloat,
|
||||||
EOpConstructDouble,
|
EOpConstructDouble,
|
||||||
@ -305,6 +337,12 @@ enum TOperator {
|
|||||||
EOpConstructUVec2,
|
EOpConstructUVec2,
|
||||||
EOpConstructUVec3,
|
EOpConstructUVec3,
|
||||||
EOpConstructUVec4,
|
EOpConstructUVec4,
|
||||||
|
EOpConstructI64Vec2,
|
||||||
|
EOpConstructI64Vec3,
|
||||||
|
EOpConstructI64Vec4,
|
||||||
|
EOpConstructU64Vec2,
|
||||||
|
EOpConstructU64Vec3,
|
||||||
|
EOpConstructU64Vec4,
|
||||||
EOpConstructMat2x2,
|
EOpConstructMat2x2,
|
||||||
EOpConstructMat2x3,
|
EOpConstructMat2x3,
|
||||||
EOpConstructMat2x4,
|
EOpConstructMat2x4,
|
||||||
|
@ -194,6 +194,22 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
} else
|
} else
|
||||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EbtInt64:
|
||||||
|
if (rightUnionArray[i] == 0)
|
||||||
|
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
|
||||||
|
else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)0x8000000000000000)
|
||||||
|
newConstArray[i].setI64Const(0x8000000000000000);
|
||||||
|
else
|
||||||
|
newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EbtUint64:
|
||||||
|
if (rightUnionArray[i] == 0) {
|
||||||
|
newConstArray[i].setU64Const(0xFFFFFFFFFFFFFFFFull);
|
||||||
|
} else
|
||||||
|
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -419,6 +435,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
||||||
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
||||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
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 int>(-static_cast<int>(unionArray[i].getU64Const()))); break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -566,6 +584,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpFloatBitsToUint:
|
case EOpFloatBitsToUint:
|
||||||
case EOpIntBitsToFloat:
|
case EOpIntBitsToFloat:
|
||||||
case EOpUintBitsToFloat:
|
case EOpUintBitsToFloat:
|
||||||
|
case EOpDoubleBitsToInt64:
|
||||||
|
case EOpDoubleBitsToUint64:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -651,7 +671,10 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
|
|
||||||
bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat ||
|
bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat ||
|
||||||
children[0]->getAsTyped()->getBasicType() == EbtDouble;
|
children[0]->getAsTyped()->getBasicType() == EbtDouble;
|
||||||
bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt;
|
bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt ||
|
||||||
|
children[0]->getAsTyped()->getBasicType() == EbtInt64;
|
||||||
|
bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 ||
|
||||||
|
children[0]->getAsTyped()->getBasicType() == EbtUint64;
|
||||||
if (componentwise) {
|
if (componentwise) {
|
||||||
for (int comp = 0; comp < objectSize; comp++) {
|
for (int comp = 0; comp < objectSize; comp++) {
|
||||||
|
|
||||||
@ -674,29 +697,52 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
case EOpMin:
|
case EOpMin:
|
||||||
if (isFloatingPoint)
|
if (isFloatingPoint)
|
||||||
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||||
else if (isSigned)
|
else if (isSigned) {
|
||||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
if (isInt64)
|
||||||
else
|
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
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;
|
break;
|
||||||
case EOpMax:
|
case EOpMax:
|
||||||
if (isFloatingPoint)
|
if (isFloatingPoint)
|
||||||
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||||
else if (isSigned)
|
else if (isSigned) {
|
||||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
if (isInt64)
|
||||||
else
|
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
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;
|
break;
|
||||||
case EOpClamp:
|
case EOpClamp:
|
||||||
if (isFloatingPoint)
|
if (isFloatingPoint)
|
||||||
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
||||||
childConstUnions[2][arg2comp].getDConst()));
|
childConstUnions[2][arg2comp].getDConst()));
|
||||||
else if (isSigned)
|
else if (isSigned) {
|
||||||
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
if (isInt64)
|
||||||
childConstUnions[2][arg2comp].getIConst()));
|
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
|
||||||
else
|
childConstUnions[2][arg2comp].getI64Const()));
|
||||||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
else
|
||||||
childConstUnions[2][arg2comp].getUConst()));
|
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()),
|
||||||
|
childConstUnions[2][arg2comp].getUConst()));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EOpLessThan:
|
case EOpLessThan:
|
||||||
newConstArray[comp].setBConst(childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp]);
|
newConstArray[comp].setBConst(childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp]);
|
||||||
|
@ -75,6 +75,8 @@ TBuiltIns::TBuiltIns()
|
|||||||
prefixes[EbtFloat] = "";
|
prefixes[EbtFloat] = "";
|
||||||
prefixes[EbtInt] = "i";
|
prefixes[EbtInt] = "i";
|
||||||
prefixes[EbtUint] = "u";
|
prefixes[EbtUint] = "u";
|
||||||
|
prefixes[EbtInt64] = "i64";
|
||||||
|
prefixes[EbtUint64] = "u64";
|
||||||
postfixes[2] = "2";
|
postfixes[2] = "2";
|
||||||
postfixes[3] = "3";
|
postfixes[3] = "3";
|
||||||
postfixes[4] = "4";
|
postfixes[4] = "4";
|
||||||
@ -626,6 +628,145 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
|||||||
"dmat2 inverse(dmat2);"
|
"dmat2 inverse(dmat2);"
|
||||||
"dmat3 inverse(dmat3);"
|
"dmat3 inverse(dmat3);"
|
||||||
"dmat4 inverse(dmat4);"
|
"dmat4 inverse(dmat4);"
|
||||||
|
|
||||||
|
"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
commonBuiltins.append(
|
||||||
|
|
||||||
|
"int64_t abs(int64_t);"
|
||||||
|
"i64vec2 abs(i64vec2);"
|
||||||
|
"i64vec3 abs(i64vec3);"
|
||||||
|
"i64vec4 abs(i64vec4);"
|
||||||
|
|
||||||
|
"int64_t sign(int64_t);"
|
||||||
|
"i64vec2 sign(i64vec2);"
|
||||||
|
"i64vec3 sign(i64vec3);"
|
||||||
|
"i64vec4 sign(i64vec4);"
|
||||||
|
|
||||||
|
"int64_t min(int64_t, int64_t);"
|
||||||
|
"i64vec2 min(i64vec2, int64_t);"
|
||||||
|
"i64vec3 min(i64vec3, int64_t);"
|
||||||
|
"i64vec4 min(i64vec4, int64_t);"
|
||||||
|
"i64vec2 min(i64vec2, i64vec2);"
|
||||||
|
"i64vec3 min(i64vec3, i64vec3);"
|
||||||
|
"i64vec4 min(i64vec4, i64vec4);"
|
||||||
|
"uint64_t min(uint64_t, uint64_t);"
|
||||||
|
"u64vec2 min(u64vec2, uint64_t);"
|
||||||
|
"u64vec3 min(u64vec3, uint64_t);"
|
||||||
|
"u64vec4 min(u64vec4, uint64_t);"
|
||||||
|
"u64vec2 min(u64vec2, u64vec2);"
|
||||||
|
"u64vec3 min(u64vec3, u64vec3);"
|
||||||
|
"u64vec4 min(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"int64_t max(int64_t, int64_t);"
|
||||||
|
"i64vec2 max(i64vec2, int64_t);"
|
||||||
|
"i64vec3 max(i64vec3, int64_t);"
|
||||||
|
"i64vec4 max(i64vec4, int64_t);"
|
||||||
|
"i64vec2 max(i64vec2, i64vec2);"
|
||||||
|
"i64vec3 max(i64vec3, i64vec3);"
|
||||||
|
"i64vec4 max(i64vec4, i64vec4);"
|
||||||
|
"uint64_t max(uint64_t, uint64_t);"
|
||||||
|
"u64vec2 max(u64vec2, uint64_t);"
|
||||||
|
"u64vec3 max(u64vec3, uint64_t);"
|
||||||
|
"u64vec4 max(u64vec4, uint64_t);"
|
||||||
|
"u64vec2 max(u64vec2, u64vec2);"
|
||||||
|
"u64vec3 max(u64vec3, u64vec3);"
|
||||||
|
"u64vec4 max(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"int64_t clamp(int64_t, int64_t, int64_t);"
|
||||||
|
"i64vec2 clamp(i64vec2, int64_t, int64_t);"
|
||||||
|
"i64vec3 clamp(i64vec3, int64_t, int64_t);"
|
||||||
|
"i64vec4 clamp(i64vec4, int64_t, int64_t);"
|
||||||
|
"i64vec2 clamp(i64vec2, i64vec2, i64vec2);"
|
||||||
|
"i64vec3 clamp(i64vec3, i64vec3, i64vec3);"
|
||||||
|
"i64vec4 clamp(i64vec4, i64vec4, i64vec4);"
|
||||||
|
"uint64_t clamp(uint64_t, uint64_t, uint64_t);"
|
||||||
|
"u64vec2 clamp(u64vec2, uint64_t, uint64_t);"
|
||||||
|
"u64vec3 clamp(u64vec3, uint64_t, uint64_t);"
|
||||||
|
"u64vec4 clamp(u64vec4, uint64_t, uint64_t);"
|
||||||
|
"u64vec2 clamp(u64vec2, u64vec2, u64vec2);"
|
||||||
|
"u64vec3 clamp(u64vec3, u64vec3, u64vec3);"
|
||||||
|
"u64vec4 clamp(u64vec4, u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"int64_t mix(int64_t, int64_t, bool);"
|
||||||
|
"i64vec2 mix(i64vec2, i64vec2, bvec2);"
|
||||||
|
"i64vec3 mix(i64vec3, i64vec3, bvec3);"
|
||||||
|
"i64vec4 mix(i64vec4, i64vec4, bvec4);"
|
||||||
|
"uint64_t mix(uint64_t, uint64_t, bool);"
|
||||||
|
"u64vec2 mix(u64vec2, u64vec2, bvec2);"
|
||||||
|
"u64vec3 mix(u64vec3, u64vec3, bvec3);"
|
||||||
|
"u64vec4 mix(u64vec4, u64vec4, bvec4);"
|
||||||
|
|
||||||
|
"int64_t doubleBitsToInt64(double);"
|
||||||
|
"i64vec2 doubleBitsToInt64(dvec2);"
|
||||||
|
"i64vec3 doubleBitsToInt64(dvec3);"
|
||||||
|
"i64vec4 doubleBitsToInt64(dvec4);"
|
||||||
|
|
||||||
|
"uint64_t doubleBitsToUint64(double);"
|
||||||
|
"u64vec2 doubleBitsToUint64(dvec2);"
|
||||||
|
"u64vec3 doubleBitsToUint64(dvec3);"
|
||||||
|
"u64vec4 doubleBitsToUint64(dvec4);"
|
||||||
|
|
||||||
|
"double int64BitsToDouble(int64_t);"
|
||||||
|
"dvec2 int64BitsToDouble(i64vec2);"
|
||||||
|
"dvec3 int64BitsToDouble(i64vec3);"
|
||||||
|
"dvec4 int64BitsToDouble(i64vec4);"
|
||||||
|
|
||||||
|
"double uint64BitsToDouble(uint64_t);"
|
||||||
|
"dvec2 uint64BitsToDouble(u64vec2);"
|
||||||
|
"dvec3 uint64BitsToDouble(u64vec3);"
|
||||||
|
"dvec4 uint64BitsToDouble(u64vec4);"
|
||||||
|
|
||||||
|
"int64_t packInt2x32(ivec2);"
|
||||||
|
"uint64_t packUint2x32(uvec2);"
|
||||||
|
"ivec2 unpackInt2x32(int64_t);"
|
||||||
|
"uvec2 unpackUint2x32(uint64_t);"
|
||||||
|
|
||||||
|
"bvec2 lessThan(i64vec2, i64vec2);"
|
||||||
|
"bvec3 lessThan(i64vec3, i64vec3);"
|
||||||
|
"bvec4 lessThan(i64vec4, i64vec4);"
|
||||||
|
"bvec2 lessThan(u64vec2, u64vec2);"
|
||||||
|
"bvec3 lessThan(u64vec3, u64vec3);"
|
||||||
|
"bvec4 lessThan(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"bvec2 lessThanEqual(i64vec2, i64vec2);"
|
||||||
|
"bvec3 lessThanEqual(i64vec3, i64vec3);"
|
||||||
|
"bvec4 lessThanEqual(i64vec4, i64vec4);"
|
||||||
|
"bvec2 lessThanEqual(u64vec2, u64vec2);"
|
||||||
|
"bvec3 lessThanEqual(u64vec3, u64vec3);"
|
||||||
|
"bvec4 lessThanEqual(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"bvec2 greaterThan(i64vec2, i64vec2);"
|
||||||
|
"bvec3 greaterThan(i64vec3, i64vec3);"
|
||||||
|
"bvec4 greaterThan(i64vec4, i64vec4);"
|
||||||
|
"bvec2 greaterThan(u64vec2, u64vec2);"
|
||||||
|
"bvec3 greaterThan(u64vec3, u64vec3);"
|
||||||
|
"bvec4 greaterThan(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"bvec2 greaterThanEqual(i64vec2, i64vec2);"
|
||||||
|
"bvec3 greaterThanEqual(i64vec3, i64vec3);"
|
||||||
|
"bvec4 greaterThanEqual(i64vec4, i64vec4);"
|
||||||
|
"bvec2 greaterThanEqual(u64vec2, u64vec2);"
|
||||||
|
"bvec3 greaterThanEqual(u64vec3, u64vec3);"
|
||||||
|
"bvec4 greaterThanEqual(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"bvec2 equal(i64vec2, i64vec2);"
|
||||||
|
"bvec3 equal(i64vec3, i64vec3);"
|
||||||
|
"bvec4 equal(i64vec4, i64vec4);"
|
||||||
|
"bvec2 equal(u64vec2, u64vec2);"
|
||||||
|
"bvec3 equal(u64vec3, u64vec3);"
|
||||||
|
"bvec4 equal(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"bvec2 notEqual(i64vec2, i64vec2);"
|
||||||
|
"bvec3 notEqual(i64vec3, i64vec3);"
|
||||||
|
"bvec4 notEqual(i64vec4, i64vec4);"
|
||||||
|
"bvec2 notEqual(u64vec2, u64vec2);"
|
||||||
|
"bvec3 notEqual(u64vec3, u64vec3);"
|
||||||
|
"bvec4 notEqual(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3650,6 +3791,10 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan
|
|||||||
symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint);
|
symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint);
|
||||||
symbolTable.relateToOperator("intBitsToFloat", EOpIntBitsToFloat);
|
symbolTable.relateToOperator("intBitsToFloat", EOpIntBitsToFloat);
|
||||||
symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat);
|
symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat);
|
||||||
|
symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64);
|
||||||
|
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
|
||||||
|
symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble);
|
||||||
|
symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble);
|
||||||
|
|
||||||
symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
|
symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
|
||||||
symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
||||||
@ -3667,6 +3812,11 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan
|
|||||||
symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16);
|
symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16);
|
||||||
symbolTable.relateToOperator("unpackHalf2x16", EOpUnpackHalf2x16);
|
symbolTable.relateToOperator("unpackHalf2x16", EOpUnpackHalf2x16);
|
||||||
|
|
||||||
|
symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32);
|
||||||
|
symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32);
|
||||||
|
symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32);
|
||||||
|
symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32);
|
||||||
|
|
||||||
symbolTable.relateToOperator("length", EOpLength);
|
symbolTable.relateToOperator("length", EOpLength);
|
||||||
symbolTable.relateToOperator("distance", EOpDistance);
|
symbolTable.relateToOperator("distance", EOpDistance);
|
||||||
symbolTable.relateToOperator("dot", EOpDot);
|
symbolTable.relateToOperator("dot", EOpDot);
|
||||||
|
@ -247,6 +247,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
|||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpConstructInt: newType = EbtInt; break;
|
case EOpConstructInt: newType = EbtInt; break;
|
||||||
case EOpConstructUint: newType = EbtUint; break;
|
case EOpConstructUint: newType = EbtUint; break;
|
||||||
|
case EOpConstructInt64: newType = EbtInt64; break;
|
||||||
|
case EOpConstructUint64: newType = EbtUint64; break;
|
||||||
case EOpConstructBool: newType = EbtBool; break;
|
case EOpConstructBool: newType = EbtBool; break;
|
||||||
case EOpConstructFloat: newType = EbtFloat; break;
|
case EOpConstructFloat: newType = EbtFloat; break;
|
||||||
case EOpConstructDouble: newType = EbtDouble; break;
|
case EOpConstructDouble: newType = EbtDouble; break;
|
||||||
@ -269,6 +271,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
|||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpConstructInt:
|
case EOpConstructInt:
|
||||||
case EOpConstructUint:
|
case EOpConstructUint:
|
||||||
|
case EOpConstructInt64:
|
||||||
|
case EOpConstructUint64:
|
||||||
case EOpConstructBool:
|
case EOpConstructBool:
|
||||||
case EOpConstructFloat:
|
case EOpConstructFloat:
|
||||||
case EOpConstructDouble:
|
case EOpConstructDouble:
|
||||||
@ -472,6 +476,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EOpConstructUint:
|
case EOpConstructUint:
|
||||||
promoteTo = EbtUint;
|
promoteTo = EbtUint;
|
||||||
break;
|
break;
|
||||||
|
case EOpConstructInt64:
|
||||||
|
promoteTo = EbtInt64;
|
||||||
|
break;
|
||||||
|
case EOpConstructUint64:
|
||||||
|
promoteTo = EbtUint64;
|
||||||
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
// List all the binary ops that can implicitly convert one operand to the other's type;
|
// List all the binary ops that can implicitly convert one operand to the other's type;
|
||||||
@ -498,6 +508,9 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EOpAnd:
|
case EOpAnd:
|
||||||
case EOpInclusiveOr:
|
case EOpInclusiveOr:
|
||||||
case EOpExclusiveOr:
|
case EOpExclusiveOr:
|
||||||
|
case EOpAndAssign:
|
||||||
|
case EOpInclusiveOrAssign:
|
||||||
|
case EOpExclusiveOrAssign:
|
||||||
|
|
||||||
case EOpFunctionCall:
|
case EOpFunctionCall:
|
||||||
case EOpReturn:
|
case EOpReturn:
|
||||||
@ -531,9 +544,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EOpLeftShiftAssign:
|
case EOpLeftShiftAssign:
|
||||||
case EOpRightShiftAssign:
|
case EOpRightShiftAssign:
|
||||||
if ((type.getBasicType() == EbtInt ||
|
if ((type.getBasicType() == EbtInt ||
|
||||||
type.getBasicType() == EbtUint) &&
|
type.getBasicType() == EbtUint ||
|
||||||
|
type.getBasicType() == EbtInt64 ||
|
||||||
|
type.getBasicType() == EbtUint64) &&
|
||||||
(node->getType().getBasicType() == EbtInt ||
|
(node->getType().getBasicType() == EbtInt ||
|
||||||
node->getType().getBasicType() == EbtUint))
|
node->getType().getBasicType() == EbtUint ||
|
||||||
|
node->getType().getBasicType() == EbtInt64 ||
|
||||||
|
node->getType().getBasicType() == EbtUint64))
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
else
|
else
|
||||||
@ -567,6 +584,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtUint: newOp = EOpConvUintToDouble; break;
|
case EbtUint: newOp = EOpConvUintToDouble; break;
|
||||||
case EbtBool: newOp = EOpConvBoolToDouble; break;
|
case EbtBool: newOp = EOpConvBoolToDouble; break;
|
||||||
case EbtFloat: newOp = EOpConvFloatToDouble; break;
|
case EbtFloat: newOp = EOpConvFloatToDouble; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -577,6 +596,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtUint: newOp = EOpConvUintToFloat; break;
|
case EbtUint: newOp = EOpConvUintToFloat; break;
|
||||||
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
||||||
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -587,6 +608,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtUint: newOp = EOpConvUintToBool; break;
|
case EbtUint: newOp = EOpConvUintToBool; break;
|
||||||
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
||||||
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -597,6 +620,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtBool: newOp = EOpConvBoolToInt; break;
|
case EbtBool: newOp = EOpConvBoolToInt; break;
|
||||||
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
||||||
case EbtDouble: newOp = EOpConvDoubleToInt; break;
|
case EbtDouble: newOp = EOpConvDoubleToInt; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -607,6 +632,32 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtBool: newOp = EOpConvBoolToUint; break;
|
case EbtBool: newOp = EOpConvBoolToUint; break;
|
||||||
case EbtFloat: newOp = EOpConvFloatToUint; break;
|
case EbtFloat: newOp = EOpConvFloatToUint; break;
|
||||||
case EbtDouble: newOp = EOpConvDoubleToUint; break;
|
case EbtDouble: newOp = EOpConvDoubleToUint; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
switch (node->getBasicType()) {
|
||||||
|
case EbtInt: newOp = EOpConvIntToInt64; break;
|
||||||
|
case EbtUint: newOp = EOpConvUintToInt64; break;
|
||||||
|
case EbtBool: newOp = EOpConvBoolToInt64; break;
|
||||||
|
case EbtFloat: newOp = EOpConvFloatToInt64; break;
|
||||||
|
case EbtDouble: newOp = EOpConvDoubleToInt64; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToInt64; break;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
switch (node->getBasicType()) {
|
||||||
|
case EbtInt: newOp = EOpConvIntToUint64; break;
|
||||||
|
case EbtUint: newOp = EOpConvUintToUint64; break;
|
||||||
|
case EbtBool: newOp = EOpConvBoolToUint64; break;
|
||||||
|
case EbtFloat: newOp = EOpConvFloatToUint64; break;
|
||||||
|
case EbtDouble: newOp = EOpConvDoubleToUint64; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToUint64; break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -643,6 +694,8 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const
|
|||||||
switch (from) {
|
switch (from) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
|
case EbtInt64:
|
||||||
|
case EbtUint64:
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
return true;
|
return true;
|
||||||
@ -674,6 +727,24 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
case EbtUint64:
|
||||||
|
switch (from) {
|
||||||
|
case EbtInt:
|
||||||
|
case EbtUint:
|
||||||
|
case EbtInt64:
|
||||||
|
case EbtUint64:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
case EbtInt64:
|
||||||
|
switch (from) {
|
||||||
|
case EbtInt:
|
||||||
|
case EbtInt64:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -873,6 +944,22 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned int u, const TSou
|
|||||||
return addConstantUnion(unionArray, TType(EbtUint, EvqConst), loc, literal);
|
return addConstantUnion(unionArray, TType(EbtUint, EvqConst), loc, literal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TIntermConstantUnion* TIntermediate::addConstantUnion(long long i64, const TSourceLoc& loc, bool literal) const
|
||||||
|
{
|
||||||
|
TConstUnionArray unionArray(1);
|
||||||
|
unionArray[0].setI64Const(i64);
|
||||||
|
|
||||||
|
return addConstantUnion(unionArray, TType(EbtInt64, EvqConst), loc, literal);
|
||||||
|
}
|
||||||
|
|
||||||
|
TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, const TSourceLoc& loc, bool literal) const
|
||||||
|
{
|
||||||
|
TConstUnionArray unionArray(1);
|
||||||
|
unionArray[0].setU64Const(u64);
|
||||||
|
|
||||||
|
return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal);
|
||||||
|
}
|
||||||
|
|
||||||
TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const
|
TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const
|
||||||
{
|
{
|
||||||
TConstUnionArray unionArray(1);
|
TConstUnionArray unionArray(1);
|
||||||
@ -1212,7 +1299,9 @@ bool TIntermUnary::promote()
|
|||||||
break;
|
break;
|
||||||
case EOpBitwiseNot:
|
case EOpBitwiseNot:
|
||||||
if (operand->getBasicType() != EbtInt &&
|
if (operand->getBasicType() != EbtInt &&
|
||||||
operand->getBasicType() != EbtUint)
|
operand->getBasicType() != EbtUint &&
|
||||||
|
operand->getBasicType() != EbtInt64 &&
|
||||||
|
operand->getBasicType() != EbtUint64)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
@ -1223,6 +1312,8 @@ bool TIntermUnary::promote()
|
|||||||
case EOpPreDecrement:
|
case EOpPreDecrement:
|
||||||
if (operand->getBasicType() != EbtInt &&
|
if (operand->getBasicType() != EbtInt &&
|
||||||
operand->getBasicType() != EbtUint &&
|
operand->getBasicType() != EbtUint &&
|
||||||
|
operand->getBasicType() != EbtInt64 &&
|
||||||
|
operand->getBasicType() != EbtUint64 &&
|
||||||
operand->getBasicType() != EbtFloat &&
|
operand->getBasicType() != EbtFloat &&
|
||||||
operand->getBasicType() != EbtDouble)
|
operand->getBasicType() != EbtDouble)
|
||||||
|
|
||||||
@ -1340,8 +1431,10 @@ bool TIntermBinary::promote()
|
|||||||
case EOpInclusiveOrAssign:
|
case EOpInclusiveOrAssign:
|
||||||
case EOpExclusiveOrAssign:
|
case EOpExclusiveOrAssign:
|
||||||
// Check for integer-only operands.
|
// Check for integer-only operands.
|
||||||
if (( left->getBasicType() != EbtInt && left->getBasicType() != EbtUint) ||
|
if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint &&
|
||||||
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint))
|
left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) ||
|
||||||
|
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint &&
|
||||||
|
right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64))
|
||||||
return false;
|
return false;
|
||||||
if (left->isMatrix() || right->isMatrix())
|
if (left->isMatrix() || right->isMatrix())
|
||||||
return false;
|
return false;
|
||||||
@ -1643,6 +1736,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getI64Const()));
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getU64Const()));
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
||||||
break;
|
break;
|
||||||
@ -1664,6 +1763,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getI64Const()));
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getU64Const()));
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
||||||
break;
|
break;
|
||||||
@ -1683,6 +1788,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getUConst()));
|
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getUConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getI64Const()));
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getU64Const()));
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst()));
|
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst()));
|
||||||
break;
|
break;
|
||||||
@ -1702,6 +1813,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
leftUnionArray[i] = rightUnionArray[i];
|
leftUnionArray[i] = rightUnionArray[i];
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getI64Const()));
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getU64Const()));
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getBConst()));
|
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getBConst()));
|
||||||
break;
|
break;
|
||||||
@ -1721,6 +1838,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0);
|
leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0);
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setBConst(rightUnionArray[i].getI64Const() != 0);
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setBConst(rightUnionArray[i].getU64Const() != 0);
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
leftUnionArray[i] = rightUnionArray[i];
|
leftUnionArray[i] = rightUnionArray[i];
|
||||||
break;
|
break;
|
||||||
@ -1732,6 +1855,56 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
switch (node->getType().getBasicType()) {
|
||||||
|
case EbtInt:
|
||||||
|
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getIConst()));
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getUConst()));
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i] = rightUnionArray[i];
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getU64Const()));
|
||||||
|
break;
|
||||||
|
case EbtBool:
|
||||||
|
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getBConst()));
|
||||||
|
break;
|
||||||
|
case EbtFloat:
|
||||||
|
case EbtDouble:
|
||||||
|
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getDConst()));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
switch (node->getType().getBasicType()) {
|
||||||
|
case EbtInt:
|
||||||
|
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getIConst()));
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getUConst()));
|
||||||
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getI64Const()));
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
leftUnionArray[i] = rightUnionArray[i];
|
||||||
|
break;
|
||||||
|
case EbtBool:
|
||||||
|
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getBConst()));
|
||||||
|
break;
|
||||||
|
case EbtFloat:
|
||||||
|
case EbtDouble:
|
||||||
|
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getDConst()));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
@ -1812,6 +1812,24 @@ TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const
|
|||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
switch(type.getVectorSize()) {
|
||||||
|
case 1: op = EOpConstructInt64; break;
|
||||||
|
case 2: op = EOpConstructI64Vec2; break;
|
||||||
|
case 3: op = EOpConstructI64Vec3; break;
|
||||||
|
case 4: op = EOpConstructI64Vec4; break;
|
||||||
|
default: break; // some compilers want this
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
switch(type.getVectorSize()) {
|
||||||
|
case 1: op = EOpConstructUint64; break;
|
||||||
|
case 2: op = EOpConstructU64Vec2; break;
|
||||||
|
case 3: op = EOpConstructU64Vec3; break;
|
||||||
|
case 4: op = EOpConstructU64Vec4; break;
|
||||||
|
default: break; // some compilers want this
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
switch(type.getVectorSize()) {
|
switch(type.getVectorSize()) {
|
||||||
case 1: op = EOpConstructBool; break;
|
case 1: op = EOpConstructBool; break;
|
||||||
@ -2534,13 +2552,19 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble)
|
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||||
|
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||||
|
publicType.basicType == EbtDouble)
|
||||||
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
||||||
|
|
||||||
if (! qualifier.flat) {
|
if (! qualifier.flat) {
|
||||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble ||
|
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
|
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||||
publicType.userDef->containsBasicType(EbtUint) ||
|
publicType.basicType == EbtDouble ||
|
||||||
|
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
|
||||||
|
publicType.userDef->containsBasicType(EbtUint) ||
|
||||||
|
publicType.userDef->containsBasicType(EbtInt64) ||
|
||||||
|
publicType.userDef->containsBasicType(EbtUint64) ||
|
||||||
publicType.userDef->containsBasicType(EbtDouble)))) {
|
publicType.userDef->containsBasicType(EbtDouble)))) {
|
||||||
if (qualifier.storage == EvqVaryingIn && language == EShLangFragment)
|
if (qualifier.storage == EvqVaryingIn && language == EShLangFragment)
|
||||||
error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage));
|
error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage));
|
||||||
@ -4415,6 +4439,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
|||||||
{
|
{
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
|
case EbtInt64:
|
||||||
|
case EbtUint64:
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
@ -5226,6 +5252,20 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
|||||||
basicOp = EOpConstructUint;
|
basicOp = EOpConstructUint;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EOpConstructI64Vec2:
|
||||||
|
case EOpConstructI64Vec3:
|
||||||
|
case EOpConstructI64Vec4:
|
||||||
|
case EOpConstructInt64:
|
||||||
|
basicOp = EOpConstructInt64;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EOpConstructU64Vec2:
|
||||||
|
case EOpConstructU64Vec3:
|
||||||
|
case EOpConstructU64Vec4:
|
||||||
|
case EOpConstructUint64:
|
||||||
|
basicOp = EOpConstructUint64;
|
||||||
|
break;
|
||||||
|
|
||||||
case EOpConstructBVec2:
|
case EOpConstructBVec2:
|
||||||
case EOpConstructBVec3:
|
case EOpConstructBVec3:
|
||||||
case EOpConstructBVec4:
|
case EOpConstructBVec4:
|
||||||
|
@ -454,6 +454,15 @@ void TScanContext::fillInKeywordMap()
|
|||||||
(*KeywordMap)["uvec3"] = UVEC3;
|
(*KeywordMap)["uvec3"] = UVEC3;
|
||||||
(*KeywordMap)["uvec4"] = UVEC4;
|
(*KeywordMap)["uvec4"] = UVEC4;
|
||||||
|
|
||||||
|
(*KeywordMap)["int64_t"] = INT64_T;
|
||||||
|
(*KeywordMap)["uint64_t"] = UINT64_T;
|
||||||
|
(*KeywordMap)["i64vec2"] = I64VEC2;
|
||||||
|
(*KeywordMap)["i64vec3"] = I64VEC3;
|
||||||
|
(*KeywordMap)["i64vec4"] = I64VEC4;
|
||||||
|
(*KeywordMap)["u64vec2"] = U64VEC2;
|
||||||
|
(*KeywordMap)["u64vec3"] = U64VEC3;
|
||||||
|
(*KeywordMap)["u64vec4"] = U64VEC4;
|
||||||
|
|
||||||
(*KeywordMap)["sampler2D"] = SAMPLER2D;
|
(*KeywordMap)["sampler2D"] = SAMPLER2D;
|
||||||
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
|
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
|
||||||
(*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
|
(*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
|
||||||
@ -667,10 +676,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
|||||||
case PpAtomDecrement: return DEC_OP;
|
case PpAtomDecrement: return DEC_OP;
|
||||||
case PpAtomIncrement: return INC_OP;
|
case PpAtomIncrement: return INC_OP;
|
||||||
|
|
||||||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
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 PpAtomIdentifier:
|
case PpAtomIdentifier:
|
||||||
{
|
{
|
||||||
int token = tokenizeIdentifier();
|
int token = tokenizeIdentifier();
|
||||||
@ -914,6 +925,18 @@ int TScanContext::tokenizeIdentifier()
|
|||||||
reservedWord();
|
reservedWord();
|
||||||
return keyword;
|
return keyword;
|
||||||
|
|
||||||
|
case INT64_T:
|
||||||
|
case UINT64_T:
|
||||||
|
case I64VEC2:
|
||||||
|
case I64VEC3:
|
||||||
|
case I64VEC4:
|
||||||
|
case U64VEC2:
|
||||||
|
case U64VEC3:
|
||||||
|
case U64VEC4:
|
||||||
|
if (parseContext.profile != EEsProfile && parseContext.version >= 450)
|
||||||
|
return keyword;
|
||||||
|
return identifierOrType();
|
||||||
|
|
||||||
case SAMPLERCUBEARRAY:
|
case SAMPLERCUBEARRAY:
|
||||||
case SAMPLERCUBEARRAYSHADOW:
|
case SAMPLERCUBEARRAYSHADOW:
|
||||||
case ISAMPLERCUBEARRAY:
|
case ISAMPLERCUBEARRAY:
|
||||||
|
@ -62,6 +62,8 @@ void TType::buildMangledName(TString& mangledName)
|
|||||||
case EbtDouble: mangledName += 'd'; break;
|
case EbtDouble: mangledName += 'd'; break;
|
||||||
case EbtInt: mangledName += 'i'; break;
|
case EbtInt: mangledName += 'i'; break;
|
||||||
case EbtUint: mangledName += 'u'; break;
|
case EbtUint: mangledName += 'u'; break;
|
||||||
|
case EbtInt64: mangledName += "i64"; break;
|
||||||
|
case EbtUint64: mangledName += "u64"; break;
|
||||||
case EbtBool: mangledName += 'b'; break;
|
case EbtBool: mangledName += 'b'; break;
|
||||||
case EbtAtomicUint: mangledName += "au"; break;
|
case EbtAtomicUint: mangledName += "au"; break;
|
||||||
case EbtSampler:
|
case EbtSampler:
|
||||||
|
@ -174,6 +174,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable;
|
extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable;
|
extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable;
|
extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable;
|
extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable;
|
||||||
@ -278,6 +279,7 @@ const char* TParseVersions::getPreamble()
|
|||||||
"#define GL_ARB_derivative_control 1\n"
|
"#define GL_ARB_derivative_control 1\n"
|
||||||
"#define GL_ARB_shader_texture_image_samples 1\n"
|
"#define GL_ARB_shader_texture_image_samples 1\n"
|
||||||
"#define GL_ARB_viewport_array 1\n"
|
"#define GL_ARB_viewport_array 1\n"
|
||||||
|
"#define GL_ARB_gpu_shader_int64 1\n"
|
||||||
"#define GL_ARB_gl_spirv 1\n"
|
"#define GL_ARB_gl_spirv 1\n"
|
||||||
"#define GL_ARB_sparse_texture2 1\n"
|
"#define GL_ARB_sparse_texture2 1\n"
|
||||||
"#define GL_ARB_sparse_texture_clamp 1\n"
|
"#define GL_ARB_sparse_texture_clamp 1\n"
|
||||||
@ -627,6 +629,17 @@ void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
|
|||||||
profileRequires(loc, ECompatibilityProfile, 400, nullptr, op);
|
profileRequires(loc, ECompatibilityProfile, 400, 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, "shader int64");
|
||||||
|
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||||
|
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||||
|
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call for any operation removed because SPIR-V is in use.
|
// Call for any operation removed because SPIR-V is in use.
|
||||||
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +111,7 @@ const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_pa
|
|||||||
const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control";
|
const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control";
|
||||||
const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
|
const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
|
||||||
const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array";
|
const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array";
|
||||||
|
const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64";
|
||||||
const char* const E_GL_ARB_gl_spirv = "GL_ARB_gl_spirv";
|
const char* const E_GL_ARB_gl_spirv = "GL_ARB_gl_spirv";
|
||||||
const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2";
|
const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2";
|
||||||
const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp";
|
const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp";
|
||||||
|
@ -41,6 +41,16 @@
|
|||||||
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
||||||
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
||||||
|
|
||||||
|
#define GL_INT64_ARB 0x140E
|
||||||
|
#define GL_INT64_VEC2_ARB 0x8FE9
|
||||||
|
#define GL_INT64_VEC3_ARB 0x8FEA
|
||||||
|
#define GL_INT64_VEC4_ARB 0x8FEB
|
||||||
|
|
||||||
|
#define GL_UNSIGNED_INT64_ARB 0x140F
|
||||||
|
#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FE5
|
||||||
|
#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FE6
|
||||||
|
#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FE7
|
||||||
|
|
||||||
#define GL_BOOL 0x8B56
|
#define GL_BOOL 0x8B56
|
||||||
#define GL_BOOL_VEC2 0x8B57
|
#define GL_BOOL_VEC2 0x8B57
|
||||||
#define GL_BOOL_VEC3 0x8B58
|
#define GL_BOOL_VEC3 0x8B58
|
||||||
|
@ -70,6 +70,8 @@ using namespace glslang;
|
|||||||
glslang::TString *string;
|
glslang::TString *string;
|
||||||
int i;
|
int i;
|
||||||
unsigned int u;
|
unsigned int u;
|
||||||
|
long long i64;
|
||||||
|
unsigned long long u64;
|
||||||
bool b;
|
bool b;
|
||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
@ -117,9 +119,9 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%expect 1 // One shift reduce conflict because of if | else
|
%expect 1 // One shift reduce conflict because of if | else
|
||||||
|
|
||||||
%token <lex> ATTRIBUTE VARYING
|
%token <lex> ATTRIBUTE VARYING
|
||||||
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT
|
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T
|
||||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
|
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
|
||||||
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4
|
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4
|
||||||
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
|
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
|
||||||
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
|
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
|
||||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
||||||
@ -180,7 +182,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%token <lex> STRUCT VOID WHILE
|
%token <lex> STRUCT VOID WHILE
|
||||||
|
|
||||||
%token <lex> IDENTIFIER TYPE_NAME
|
%token <lex> IDENTIFIER TYPE_NAME
|
||||||
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
|
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT
|
||||||
%token <lex> LEFT_OP RIGHT_OP
|
%token <lex> LEFT_OP RIGHT_OP
|
||||||
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_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
|
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
||||||
@ -257,6 +259,14 @@ primary_expression
|
|||||||
parseContext.fullIntegerCheck($1.loc, "unsigned literal");
|
parseContext.fullIntegerCheck($1.loc, "unsigned literal");
|
||||||
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
|
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
|
||||||
}
|
}
|
||||||
|
| INT64CONSTANT {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit integer literal");
|
||||||
|
$$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true);
|
||||||
|
}
|
||||||
|
| UINT64CONSTANT {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
|
||||||
|
$$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
|
||||||
|
}
|
||||||
| FLOATCONSTANT {
|
| FLOATCONSTANT {
|
||||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||||
}
|
}
|
||||||
@ -1309,6 +1319,16 @@ type_specifier_nonarray
|
|||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtUint;
|
$$.basicType = EbtUint;
|
||||||
}
|
}
|
||||||
|
| INT64_T {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt64;
|
||||||
|
}
|
||||||
|
| UINT64_T {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint64;
|
||||||
|
}
|
||||||
| BOOL {
|
| BOOL {
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtBool;
|
$$.basicType = EbtBool;
|
||||||
@ -1376,6 +1396,24 @@ type_specifier_nonarray
|
|||||||
$$.basicType = EbtInt;
|
$$.basicType = EbtInt;
|
||||||
$$.setVector(4);
|
$$.setVector(4);
|
||||||
}
|
}
|
||||||
|
| I64VEC2 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt64;
|
||||||
|
$$.setVector(2);
|
||||||
|
}
|
||||||
|
| I64VEC3 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt64;
|
||||||
|
$$.setVector(3);
|
||||||
|
}
|
||||||
|
| I64VEC4 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt64;
|
||||||
|
$$.setVector(4);
|
||||||
|
}
|
||||||
| UVEC2 {
|
| UVEC2 {
|
||||||
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
@ -1394,6 +1432,24 @@ type_specifier_nonarray
|
|||||||
$$.basicType = EbtUint;
|
$$.basicType = EbtUint;
|
||||||
$$.setVector(4);
|
$$.setVector(4);
|
||||||
}
|
}
|
||||||
|
| U64VEC2 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint64;
|
||||||
|
$$.setVector(2);
|
||||||
|
}
|
||||||
|
| U64VEC3 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint64;
|
||||||
|
$$.setVector(3);
|
||||||
|
}
|
||||||
|
| U64VEC4 {
|
||||||
|
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint64;
|
||||||
|
$$.setVector(4);
|
||||||
|
}
|
||||||
| MAT2 {
|
| MAT2 {
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtFloat;
|
$$.basicType = EbtFloat;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -30,8 +30,8 @@
|
|||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||||
# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
# define YYDEBUG 1
|
# define YYDEBUG 1
|
||||||
@ -54,255 +54,265 @@ extern int yydebug;
|
|||||||
DOUBLE = 263,
|
DOUBLE = 263,
|
||||||
INT = 264,
|
INT = 264,
|
||||||
UINT = 265,
|
UINT = 265,
|
||||||
BREAK = 266,
|
INT64_T = 266,
|
||||||
CONTINUE = 267,
|
UINT64_T = 267,
|
||||||
DO = 268,
|
BREAK = 268,
|
||||||
ELSE = 269,
|
CONTINUE = 269,
|
||||||
FOR = 270,
|
DO = 270,
|
||||||
IF = 271,
|
ELSE = 271,
|
||||||
DISCARD = 272,
|
FOR = 272,
|
||||||
RETURN = 273,
|
IF = 273,
|
||||||
SWITCH = 274,
|
DISCARD = 274,
|
||||||
CASE = 275,
|
RETURN = 275,
|
||||||
DEFAULT = 276,
|
SWITCH = 276,
|
||||||
SUBROUTINE = 277,
|
CASE = 277,
|
||||||
BVEC2 = 278,
|
DEFAULT = 278,
|
||||||
BVEC3 = 279,
|
SUBROUTINE = 279,
|
||||||
BVEC4 = 280,
|
BVEC2 = 280,
|
||||||
IVEC2 = 281,
|
BVEC3 = 281,
|
||||||
IVEC3 = 282,
|
BVEC4 = 282,
|
||||||
IVEC4 = 283,
|
IVEC2 = 283,
|
||||||
UVEC2 = 284,
|
IVEC3 = 284,
|
||||||
UVEC3 = 285,
|
IVEC4 = 285,
|
||||||
UVEC4 = 286,
|
I64VEC2 = 286,
|
||||||
VEC2 = 287,
|
I64VEC3 = 287,
|
||||||
VEC3 = 288,
|
I64VEC4 = 288,
|
||||||
VEC4 = 289,
|
UVEC2 = 289,
|
||||||
MAT2 = 290,
|
UVEC3 = 290,
|
||||||
MAT3 = 291,
|
UVEC4 = 291,
|
||||||
MAT4 = 292,
|
U64VEC2 = 292,
|
||||||
CENTROID = 293,
|
U64VEC3 = 293,
|
||||||
IN = 294,
|
U64VEC4 = 294,
|
||||||
OUT = 295,
|
VEC2 = 295,
|
||||||
INOUT = 296,
|
VEC3 = 296,
|
||||||
UNIFORM = 297,
|
VEC4 = 297,
|
||||||
PATCH = 298,
|
MAT2 = 298,
|
||||||
SAMPLE = 299,
|
MAT3 = 299,
|
||||||
BUFFER = 300,
|
MAT4 = 300,
|
||||||
SHARED = 301,
|
CENTROID = 301,
|
||||||
COHERENT = 302,
|
IN = 302,
|
||||||
VOLATILE = 303,
|
OUT = 303,
|
||||||
RESTRICT = 304,
|
INOUT = 304,
|
||||||
READONLY = 305,
|
UNIFORM = 305,
|
||||||
WRITEONLY = 306,
|
PATCH = 306,
|
||||||
DVEC2 = 307,
|
SAMPLE = 307,
|
||||||
DVEC3 = 308,
|
BUFFER = 308,
|
||||||
DVEC4 = 309,
|
SHARED = 309,
|
||||||
DMAT2 = 310,
|
COHERENT = 310,
|
||||||
DMAT3 = 311,
|
VOLATILE = 311,
|
||||||
DMAT4 = 312,
|
RESTRICT = 312,
|
||||||
NOPERSPECTIVE = 313,
|
READONLY = 313,
|
||||||
FLAT = 314,
|
WRITEONLY = 314,
|
||||||
SMOOTH = 315,
|
DVEC2 = 315,
|
||||||
LAYOUT = 316,
|
DVEC3 = 316,
|
||||||
MAT2X2 = 317,
|
DVEC4 = 317,
|
||||||
MAT2X3 = 318,
|
DMAT2 = 318,
|
||||||
MAT2X4 = 319,
|
DMAT3 = 319,
|
||||||
MAT3X2 = 320,
|
DMAT4 = 320,
|
||||||
MAT3X3 = 321,
|
NOPERSPECTIVE = 321,
|
||||||
MAT3X4 = 322,
|
FLAT = 322,
|
||||||
MAT4X2 = 323,
|
SMOOTH = 323,
|
||||||
MAT4X3 = 324,
|
LAYOUT = 324,
|
||||||
MAT4X4 = 325,
|
MAT2X2 = 325,
|
||||||
DMAT2X2 = 326,
|
MAT2X3 = 326,
|
||||||
DMAT2X3 = 327,
|
MAT2X4 = 327,
|
||||||
DMAT2X4 = 328,
|
MAT3X2 = 328,
|
||||||
DMAT3X2 = 329,
|
MAT3X3 = 329,
|
||||||
DMAT3X3 = 330,
|
MAT3X4 = 330,
|
||||||
DMAT3X4 = 331,
|
MAT4X2 = 331,
|
||||||
DMAT4X2 = 332,
|
MAT4X3 = 332,
|
||||||
DMAT4X3 = 333,
|
MAT4X4 = 333,
|
||||||
DMAT4X4 = 334,
|
DMAT2X2 = 334,
|
||||||
ATOMIC_UINT = 335,
|
DMAT2X3 = 335,
|
||||||
SAMPLER1D = 336,
|
DMAT2X4 = 336,
|
||||||
SAMPLER2D = 337,
|
DMAT3X2 = 337,
|
||||||
SAMPLER3D = 338,
|
DMAT3X3 = 338,
|
||||||
SAMPLERCUBE = 339,
|
DMAT3X4 = 339,
|
||||||
SAMPLER1DSHADOW = 340,
|
DMAT4X2 = 340,
|
||||||
SAMPLER2DSHADOW = 341,
|
DMAT4X3 = 341,
|
||||||
SAMPLERCUBESHADOW = 342,
|
DMAT4X4 = 342,
|
||||||
SAMPLER1DARRAY = 343,
|
ATOMIC_UINT = 343,
|
||||||
SAMPLER2DARRAY = 344,
|
SAMPLER1D = 344,
|
||||||
SAMPLER1DARRAYSHADOW = 345,
|
SAMPLER2D = 345,
|
||||||
SAMPLER2DARRAYSHADOW = 346,
|
SAMPLER3D = 346,
|
||||||
ISAMPLER1D = 347,
|
SAMPLERCUBE = 347,
|
||||||
ISAMPLER2D = 348,
|
SAMPLER1DSHADOW = 348,
|
||||||
ISAMPLER3D = 349,
|
SAMPLER2DSHADOW = 349,
|
||||||
ISAMPLERCUBE = 350,
|
SAMPLERCUBESHADOW = 350,
|
||||||
ISAMPLER1DARRAY = 351,
|
SAMPLER1DARRAY = 351,
|
||||||
ISAMPLER2DARRAY = 352,
|
SAMPLER2DARRAY = 352,
|
||||||
USAMPLER1D = 353,
|
SAMPLER1DARRAYSHADOW = 353,
|
||||||
USAMPLER2D = 354,
|
SAMPLER2DARRAYSHADOW = 354,
|
||||||
USAMPLER3D = 355,
|
ISAMPLER1D = 355,
|
||||||
USAMPLERCUBE = 356,
|
ISAMPLER2D = 356,
|
||||||
USAMPLER1DARRAY = 357,
|
ISAMPLER3D = 357,
|
||||||
USAMPLER2DARRAY = 358,
|
ISAMPLERCUBE = 358,
|
||||||
SAMPLER2DRECT = 359,
|
ISAMPLER1DARRAY = 359,
|
||||||
SAMPLER2DRECTSHADOW = 360,
|
ISAMPLER2DARRAY = 360,
|
||||||
ISAMPLER2DRECT = 361,
|
USAMPLER1D = 361,
|
||||||
USAMPLER2DRECT = 362,
|
USAMPLER2D = 362,
|
||||||
SAMPLERBUFFER = 363,
|
USAMPLER3D = 363,
|
||||||
ISAMPLERBUFFER = 364,
|
USAMPLERCUBE = 364,
|
||||||
USAMPLERBUFFER = 365,
|
USAMPLER1DARRAY = 365,
|
||||||
SAMPLERCUBEARRAY = 366,
|
USAMPLER2DARRAY = 366,
|
||||||
SAMPLERCUBEARRAYSHADOW = 367,
|
SAMPLER2DRECT = 367,
|
||||||
ISAMPLERCUBEARRAY = 368,
|
SAMPLER2DRECTSHADOW = 368,
|
||||||
USAMPLERCUBEARRAY = 369,
|
ISAMPLER2DRECT = 369,
|
||||||
SAMPLER2DMS = 370,
|
USAMPLER2DRECT = 370,
|
||||||
ISAMPLER2DMS = 371,
|
SAMPLERBUFFER = 371,
|
||||||
USAMPLER2DMS = 372,
|
ISAMPLERBUFFER = 372,
|
||||||
SAMPLER2DMSARRAY = 373,
|
USAMPLERBUFFER = 373,
|
||||||
ISAMPLER2DMSARRAY = 374,
|
SAMPLERCUBEARRAY = 374,
|
||||||
USAMPLER2DMSARRAY = 375,
|
SAMPLERCUBEARRAYSHADOW = 375,
|
||||||
SAMPLEREXTERNALOES = 376,
|
ISAMPLERCUBEARRAY = 376,
|
||||||
SAMPLER = 377,
|
USAMPLERCUBEARRAY = 377,
|
||||||
SAMPLERSHADOW = 378,
|
SAMPLER2DMS = 378,
|
||||||
TEXTURE1D = 379,
|
ISAMPLER2DMS = 379,
|
||||||
TEXTURE2D = 380,
|
USAMPLER2DMS = 380,
|
||||||
TEXTURE3D = 381,
|
SAMPLER2DMSARRAY = 381,
|
||||||
TEXTURECUBE = 382,
|
ISAMPLER2DMSARRAY = 382,
|
||||||
TEXTURE1DARRAY = 383,
|
USAMPLER2DMSARRAY = 383,
|
||||||
TEXTURE2DARRAY = 384,
|
SAMPLEREXTERNALOES = 384,
|
||||||
ITEXTURE1D = 385,
|
SAMPLER = 385,
|
||||||
ITEXTURE2D = 386,
|
SAMPLERSHADOW = 386,
|
||||||
ITEXTURE3D = 387,
|
TEXTURE1D = 387,
|
||||||
ITEXTURECUBE = 388,
|
TEXTURE2D = 388,
|
||||||
ITEXTURE1DARRAY = 389,
|
TEXTURE3D = 389,
|
||||||
ITEXTURE2DARRAY = 390,
|
TEXTURECUBE = 390,
|
||||||
UTEXTURE1D = 391,
|
TEXTURE1DARRAY = 391,
|
||||||
UTEXTURE2D = 392,
|
TEXTURE2DARRAY = 392,
|
||||||
UTEXTURE3D = 393,
|
ITEXTURE1D = 393,
|
||||||
UTEXTURECUBE = 394,
|
ITEXTURE2D = 394,
|
||||||
UTEXTURE1DARRAY = 395,
|
ITEXTURE3D = 395,
|
||||||
UTEXTURE2DARRAY = 396,
|
ITEXTURECUBE = 396,
|
||||||
TEXTURE2DRECT = 397,
|
ITEXTURE1DARRAY = 397,
|
||||||
ITEXTURE2DRECT = 398,
|
ITEXTURE2DARRAY = 398,
|
||||||
UTEXTURE2DRECT = 399,
|
UTEXTURE1D = 399,
|
||||||
TEXTUREBUFFER = 400,
|
UTEXTURE2D = 400,
|
||||||
ITEXTUREBUFFER = 401,
|
UTEXTURE3D = 401,
|
||||||
UTEXTUREBUFFER = 402,
|
UTEXTURECUBE = 402,
|
||||||
TEXTURECUBEARRAY = 403,
|
UTEXTURE1DARRAY = 403,
|
||||||
ITEXTURECUBEARRAY = 404,
|
UTEXTURE2DARRAY = 404,
|
||||||
UTEXTURECUBEARRAY = 405,
|
TEXTURE2DRECT = 405,
|
||||||
TEXTURE2DMS = 406,
|
ITEXTURE2DRECT = 406,
|
||||||
ITEXTURE2DMS = 407,
|
UTEXTURE2DRECT = 407,
|
||||||
UTEXTURE2DMS = 408,
|
TEXTUREBUFFER = 408,
|
||||||
TEXTURE2DMSARRAY = 409,
|
ITEXTUREBUFFER = 409,
|
||||||
ITEXTURE2DMSARRAY = 410,
|
UTEXTUREBUFFER = 410,
|
||||||
UTEXTURE2DMSARRAY = 411,
|
TEXTURECUBEARRAY = 411,
|
||||||
SUBPASSINPUT = 412,
|
ITEXTURECUBEARRAY = 412,
|
||||||
SUBPASSINPUTMS = 413,
|
UTEXTURECUBEARRAY = 413,
|
||||||
ISUBPASSINPUT = 414,
|
TEXTURE2DMS = 414,
|
||||||
ISUBPASSINPUTMS = 415,
|
ITEXTURE2DMS = 415,
|
||||||
USUBPASSINPUT = 416,
|
UTEXTURE2DMS = 416,
|
||||||
USUBPASSINPUTMS = 417,
|
TEXTURE2DMSARRAY = 417,
|
||||||
IMAGE1D = 418,
|
ITEXTURE2DMSARRAY = 418,
|
||||||
IIMAGE1D = 419,
|
UTEXTURE2DMSARRAY = 419,
|
||||||
UIMAGE1D = 420,
|
SUBPASSINPUT = 420,
|
||||||
IMAGE2D = 421,
|
SUBPASSINPUTMS = 421,
|
||||||
IIMAGE2D = 422,
|
ISUBPASSINPUT = 422,
|
||||||
UIMAGE2D = 423,
|
ISUBPASSINPUTMS = 423,
|
||||||
IMAGE3D = 424,
|
USUBPASSINPUT = 424,
|
||||||
IIMAGE3D = 425,
|
USUBPASSINPUTMS = 425,
|
||||||
UIMAGE3D = 426,
|
IMAGE1D = 426,
|
||||||
IMAGE2DRECT = 427,
|
IIMAGE1D = 427,
|
||||||
IIMAGE2DRECT = 428,
|
UIMAGE1D = 428,
|
||||||
UIMAGE2DRECT = 429,
|
IMAGE2D = 429,
|
||||||
IMAGECUBE = 430,
|
IIMAGE2D = 430,
|
||||||
IIMAGECUBE = 431,
|
UIMAGE2D = 431,
|
||||||
UIMAGECUBE = 432,
|
IMAGE3D = 432,
|
||||||
IMAGEBUFFER = 433,
|
IIMAGE3D = 433,
|
||||||
IIMAGEBUFFER = 434,
|
UIMAGE3D = 434,
|
||||||
UIMAGEBUFFER = 435,
|
IMAGE2DRECT = 435,
|
||||||
IMAGE1DARRAY = 436,
|
IIMAGE2DRECT = 436,
|
||||||
IIMAGE1DARRAY = 437,
|
UIMAGE2DRECT = 437,
|
||||||
UIMAGE1DARRAY = 438,
|
IMAGECUBE = 438,
|
||||||
IMAGE2DARRAY = 439,
|
IIMAGECUBE = 439,
|
||||||
IIMAGE2DARRAY = 440,
|
UIMAGECUBE = 440,
|
||||||
UIMAGE2DARRAY = 441,
|
IMAGEBUFFER = 441,
|
||||||
IMAGECUBEARRAY = 442,
|
IIMAGEBUFFER = 442,
|
||||||
IIMAGECUBEARRAY = 443,
|
UIMAGEBUFFER = 443,
|
||||||
UIMAGECUBEARRAY = 444,
|
IMAGE1DARRAY = 444,
|
||||||
IMAGE2DMS = 445,
|
IIMAGE1DARRAY = 445,
|
||||||
IIMAGE2DMS = 446,
|
UIMAGE1DARRAY = 446,
|
||||||
UIMAGE2DMS = 447,
|
IMAGE2DARRAY = 447,
|
||||||
IMAGE2DMSARRAY = 448,
|
IIMAGE2DARRAY = 448,
|
||||||
IIMAGE2DMSARRAY = 449,
|
UIMAGE2DARRAY = 449,
|
||||||
UIMAGE2DMSARRAY = 450,
|
IMAGECUBEARRAY = 450,
|
||||||
STRUCT = 451,
|
IIMAGECUBEARRAY = 451,
|
||||||
VOID = 452,
|
UIMAGECUBEARRAY = 452,
|
||||||
WHILE = 453,
|
IMAGE2DMS = 453,
|
||||||
IDENTIFIER = 454,
|
IIMAGE2DMS = 454,
|
||||||
TYPE_NAME = 455,
|
UIMAGE2DMS = 455,
|
||||||
FLOATCONSTANT = 456,
|
IMAGE2DMSARRAY = 456,
|
||||||
DOUBLECONSTANT = 457,
|
IIMAGE2DMSARRAY = 457,
|
||||||
INTCONSTANT = 458,
|
UIMAGE2DMSARRAY = 458,
|
||||||
UINTCONSTANT = 459,
|
STRUCT = 459,
|
||||||
BOOLCONSTANT = 460,
|
VOID = 460,
|
||||||
LEFT_OP = 461,
|
WHILE = 461,
|
||||||
RIGHT_OP = 462,
|
IDENTIFIER = 462,
|
||||||
INC_OP = 463,
|
TYPE_NAME = 463,
|
||||||
DEC_OP = 464,
|
FLOATCONSTANT = 464,
|
||||||
LE_OP = 465,
|
DOUBLECONSTANT = 465,
|
||||||
GE_OP = 466,
|
INTCONSTANT = 466,
|
||||||
EQ_OP = 467,
|
UINTCONSTANT = 467,
|
||||||
NE_OP = 468,
|
INT64CONSTANT = 468,
|
||||||
AND_OP = 469,
|
UINT64CONSTANT = 469,
|
||||||
OR_OP = 470,
|
BOOLCONSTANT = 470,
|
||||||
XOR_OP = 471,
|
LEFT_OP = 471,
|
||||||
MUL_ASSIGN = 472,
|
RIGHT_OP = 472,
|
||||||
DIV_ASSIGN = 473,
|
INC_OP = 473,
|
||||||
ADD_ASSIGN = 474,
|
DEC_OP = 474,
|
||||||
MOD_ASSIGN = 475,
|
LE_OP = 475,
|
||||||
LEFT_ASSIGN = 476,
|
GE_OP = 476,
|
||||||
RIGHT_ASSIGN = 477,
|
EQ_OP = 477,
|
||||||
AND_ASSIGN = 478,
|
NE_OP = 478,
|
||||||
XOR_ASSIGN = 479,
|
AND_OP = 479,
|
||||||
OR_ASSIGN = 480,
|
OR_OP = 480,
|
||||||
SUB_ASSIGN = 481,
|
XOR_OP = 481,
|
||||||
LEFT_PAREN = 482,
|
MUL_ASSIGN = 482,
|
||||||
RIGHT_PAREN = 483,
|
DIV_ASSIGN = 483,
|
||||||
LEFT_BRACKET = 484,
|
ADD_ASSIGN = 484,
|
||||||
RIGHT_BRACKET = 485,
|
MOD_ASSIGN = 485,
|
||||||
LEFT_BRACE = 486,
|
LEFT_ASSIGN = 486,
|
||||||
RIGHT_BRACE = 487,
|
RIGHT_ASSIGN = 487,
|
||||||
DOT = 488,
|
AND_ASSIGN = 488,
|
||||||
COMMA = 489,
|
XOR_ASSIGN = 489,
|
||||||
COLON = 490,
|
OR_ASSIGN = 490,
|
||||||
EQUAL = 491,
|
SUB_ASSIGN = 491,
|
||||||
SEMICOLON = 492,
|
LEFT_PAREN = 492,
|
||||||
BANG = 493,
|
RIGHT_PAREN = 493,
|
||||||
DASH = 494,
|
LEFT_BRACKET = 494,
|
||||||
TILDE = 495,
|
RIGHT_BRACKET = 495,
|
||||||
PLUS = 496,
|
LEFT_BRACE = 496,
|
||||||
STAR = 497,
|
RIGHT_BRACE = 497,
|
||||||
SLASH = 498,
|
DOT = 498,
|
||||||
PERCENT = 499,
|
COMMA = 499,
|
||||||
LEFT_ANGLE = 500,
|
COLON = 500,
|
||||||
RIGHT_ANGLE = 501,
|
EQUAL = 501,
|
||||||
VERTICAL_BAR = 502,
|
SEMICOLON = 502,
|
||||||
CARET = 503,
|
BANG = 503,
|
||||||
AMPERSAND = 504,
|
DASH = 504,
|
||||||
QUESTION = 505,
|
TILDE = 505,
|
||||||
INVARIANT = 506,
|
PLUS = 506,
|
||||||
PRECISE = 507,
|
STAR = 507,
|
||||||
HIGH_PRECISION = 508,
|
SLASH = 508,
|
||||||
MEDIUM_PRECISION = 509,
|
PERCENT = 509,
|
||||||
LOW_PRECISION = 510,
|
LEFT_ANGLE = 510,
|
||||||
PRECISION = 511,
|
RIGHT_ANGLE = 511,
|
||||||
PACKED = 512,
|
VERTICAL_BAR = 512,
|
||||||
RESOURCE = 513,
|
CARET = 513,
|
||||||
SUPERP = 514
|
AMPERSAND = 514,
|
||||||
|
QUESTION = 515,
|
||||||
|
INVARIANT = 516,
|
||||||
|
PRECISE = 517,
|
||||||
|
HIGH_PRECISION = 518,
|
||||||
|
MEDIUM_PRECISION = 519,
|
||||||
|
LOW_PRECISION = 520,
|
||||||
|
PRECISION = 521,
|
||||||
|
PACKED = 522,
|
||||||
|
RESOURCE = 523,
|
||||||
|
SUPERP = 524
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -311,7 +321,7 @@ extern int yydebug;
|
|||||||
typedef union YYSTYPE
|
typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
/* Line 2058 of yacc.c */
|
/* Line 2058 of yacc.c */
|
||||||
#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y"
|
#line 66 "glslang.y"
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
glslang::TSourceLoc loc;
|
glslang::TSourceLoc loc;
|
||||||
@ -319,6 +329,8 @@ typedef union YYSTYPE
|
|||||||
glslang::TString *string;
|
glslang::TString *string;
|
||||||
int i;
|
int i;
|
||||||
unsigned int u;
|
unsigned int u;
|
||||||
|
long long i64;
|
||||||
|
unsigned long long u64;
|
||||||
bool b;
|
bool b;
|
||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
@ -345,7 +357,7 @@ typedef union YYSTYPE
|
|||||||
|
|
||||||
|
|
||||||
/* Line 2058 of yacc.c */
|
/* Line 2058 of yacc.c */
|
||||||
#line 349 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp.h"
|
#line 361 "glslang_tab.cpp.h"
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
@ -367,4 +379,4 @@ int yyparse ();
|
|||||||
#endif
|
#endif
|
||||||
#endif /* ! YYPARSE_PARAM */
|
#endif /* ! YYPARSE_PARAM */
|
||||||
|
|
||||||
#endif /* !YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */
|
#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */
|
||||||
|
@ -206,22 +206,44 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpConvUintToBool: out.debug << "Convert uint to bool"; break;
|
case EOpConvUintToBool: out.debug << "Convert uint to bool"; break;
|
||||||
case EOpConvFloatToBool: out.debug << "Convert float to bool"; break;
|
case EOpConvFloatToBool: out.debug << "Convert float to bool"; break;
|
||||||
case EOpConvDoubleToBool: out.debug << "Convert double 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 EOpConvIntToFloat: out.debug << "Convert int to float"; break;
|
||||||
case EOpConvUintToFloat: out.debug << "Convert uint to float"; break;
|
case EOpConvUintToFloat: out.debug << "Convert uint to float"; break;
|
||||||
case EOpConvDoubleToFloat: out.debug << "Convert double 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 EOpConvBoolToFloat: out.debug << "Convert bool to float"; break;
|
||||||
case EOpConvUintToInt: out.debug << "Convert uint to int"; break;
|
case EOpConvUintToInt: out.debug << "Convert uint to int"; break;
|
||||||
case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
|
case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
|
||||||
case EOpConvDoubleToInt: out.debug << "Convert double to int"; break;
|
case EOpConvDoubleToInt: out.debug << "Convert double to int"; break;
|
||||||
case EOpConvBoolToInt: out.debug << "Convert bool 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 EOpConvIntToUint: out.debug << "Convert int to uint"; break;
|
||||||
case EOpConvFloatToUint: out.debug << "Convert float to uint"; break;
|
case EOpConvFloatToUint: out.debug << "Convert float to uint"; break;
|
||||||
case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break;
|
case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break;
|
||||||
case EOpConvBoolToUint: out.debug << "Convert bool to uint"; 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 EOpConvIntToDouble: out.debug << "Convert int to double"; break;
|
case EOpConvIntToDouble: out.debug << "Convert int to double"; break;
|
||||||
case EOpConvUintToDouble: out.debug << "Convert uint to double"; break;
|
case EOpConvUintToDouble: out.debug << "Convert uint to double"; break;
|
||||||
case EOpConvFloatToDouble: out.debug << "Convert float to double"; break;
|
case EOpConvFloatToDouble: out.debug << "Convert float to double"; break;
|
||||||
case EOpConvBoolToDouble: out.debug << "Convert bool 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;
|
||||||
|
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 EOpConvFloatToUint64: out.debug << "Convert float to uint64"; 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 EOpRadians: out.debug << "radians"; break;
|
||||||
case EOpDegrees: out.debug << "degrees"; break;
|
case EOpDegrees: out.debug << "degrees"; break;
|
||||||
@ -261,6 +283,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpFloatBitsToUint:out.debug << "floatBitsToUint"; break;
|
case EOpFloatBitsToUint:out.debug << "floatBitsToUint"; break;
|
||||||
case EOpIntBitsToFloat: out.debug << "intBitsToFloat"; break;
|
case EOpIntBitsToFloat: out.debug << "intBitsToFloat"; break;
|
||||||
case EOpUintBitsToFloat:out.debug << "uintBitsToFloat"; break;
|
case EOpUintBitsToFloat:out.debug << "uintBitsToFloat"; break;
|
||||||
|
case EOpDoubleBitsToInt64: out.debug << "doubleBitsToInt64"; break;
|
||||||
|
case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break;
|
||||||
|
case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break;
|
||||||
|
case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break;
|
||||||
case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break;
|
case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break;
|
||||||
case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break;
|
case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break;
|
||||||
case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break;
|
case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break;
|
||||||
@ -275,6 +301,11 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpPackDouble2x32: out.debug << "PackDouble2x32"; break;
|
case EOpPackDouble2x32: out.debug << "PackDouble2x32"; break;
|
||||||
case EOpUnpackDouble2x32: out.debug << "UnpackDouble2x32"; break;
|
case EOpUnpackDouble2x32: out.debug << "UnpackDouble2x32"; break;
|
||||||
|
|
||||||
|
case EOpPackInt2x32: out.debug << "packInt2x32"; break;
|
||||||
|
case EOpUnpackInt2x32: out.debug << "unpackInt2x32"; break;
|
||||||
|
case EOpPackUint2x32: out.debug << "packUint2x32"; break;
|
||||||
|
case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break;
|
||||||
|
|
||||||
case EOpLength: out.debug << "length"; break;
|
case EOpLength: out.debug << "length"; break;
|
||||||
case EOpNormalize: out.debug << "normalize"; break;
|
case EOpNormalize: out.debug << "normalize"; break;
|
||||||
case EOpDPdx: out.debug << "dPdx"; break;
|
case EOpDPdx: out.debug << "dPdx"; break;
|
||||||
@ -366,6 +397,14 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpConstructUVec2: out.debug << "Construct uvec2"; break;
|
case EOpConstructUVec2: out.debug << "Construct uvec2"; break;
|
||||||
case EOpConstructUVec3: out.debug << "Construct uvec3"; break;
|
case EOpConstructUVec3: out.debug << "Construct uvec3"; break;
|
||||||
case EOpConstructUVec4: out.debug << "Construct uvec4"; break;
|
case EOpConstructUVec4: out.debug << "Construct uvec4"; break;
|
||||||
|
case EOpConstructInt64: out.debug << "Construct int64_t"; 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 EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break;
|
||||||
|
case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break;
|
||||||
|
case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break;
|
||||||
case EOpConstructMat2x2: out.debug << "Construct mat2"; break;
|
case EOpConstructMat2x2: out.debug << "Construct mat2"; break;
|
||||||
case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break;
|
case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break;
|
||||||
case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break;
|
case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break;
|
||||||
@ -582,6 +621,24 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const
|
|||||||
out.debug << buf << "\n";
|
out.debug << buf << "\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EbtInt64:
|
||||||
|
{
|
||||||
|
const int maxSize = 300;
|
||||||
|
char buf[maxSize];
|
||||||
|
snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t");
|
||||||
|
|
||||||
|
out.debug << buf << "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint64:
|
||||||
|
{
|
||||||
|
const int maxSize = 300;
|
||||||
|
char buf[maxSize];
|
||||||
|
snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t");
|
||||||
|
|
||||||
|
out.debug << buf << "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
|
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
|
||||||
break;
|
break;
|
||||||
|
@ -880,6 +880,8 @@ const int baseAlignmentVec4Std140 = 16;
|
|||||||
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||||
{
|
{
|
||||||
switch (type.getBasicType()) {
|
switch (type.getBasicType()) {
|
||||||
|
case EbtInt64:
|
||||||
|
case EbtUint64:
|
||||||
case EbtDouble: size = 8; return 8;
|
case EbtDouble: size = 8; return 8;
|
||||||
default: size = 4; return 4;
|
default: size = 4; return 4;
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,8 @@ public:
|
|||||||
TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(int, 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(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;
|
||||||
TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const;
|
TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const;
|
||||||
|
@ -76,6 +76,7 @@ public:
|
|||||||
virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior);
|
virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior);
|
||||||
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
||||||
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
||||||
|
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
||||||
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
|
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
|
||||||
virtual void requireVulkan(const TSourceLoc&, const char* op);
|
virtual void requireVulkan(const TSourceLoc&, const char* op);
|
||||||
|
@ -705,7 +705,8 @@ int TPpContext::CPPerror(TPpToken* ppToken)
|
|||||||
TSourceLoc loc = ppToken->loc;
|
TSourceLoc loc = ppToken->loc;
|
||||||
|
|
||||||
while (token != '\n' && token != EndOfInput) {
|
while (token != '\n' && token != EndOfInput) {
|
||||||
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
||||||
|
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
|
||||||
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
||||||
message.append(ppToken->name);
|
message.append(ppToken->name);
|
||||||
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
|
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
|
||||||
@ -736,6 +737,8 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
|
|||||||
case PpAtomIdentifier:
|
case PpAtomIdentifier:
|
||||||
case PpAtomConstInt:
|
case PpAtomConstInt:
|
||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
|
case PpAtomConstInt64:
|
||||||
|
case PpAtomConstUint64:
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
tokens.push_back(ppToken->name);
|
tokens.push_back(ppToken->name);
|
||||||
|
@ -111,6 +111,7 @@ public:
|
|||||||
bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned
|
bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned
|
||||||
int ival;
|
int ival;
|
||||||
double dval;
|
double dval;
|
||||||
|
long long i64val;
|
||||||
int atom;
|
int atom;
|
||||||
char name[MaxTokenLength + 1];
|
char name[MaxTokenLength + 1];
|
||||||
};
|
};
|
||||||
|
@ -238,9 +238,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
int len = 0;
|
int len = 0;
|
||||||
int ch = 0;
|
int ch = 0;
|
||||||
int ii = 0;
|
int ii = 0;
|
||||||
unsigned ival = 0;
|
unsigned long long ival = 0;
|
||||||
|
bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64);
|
||||||
|
|
||||||
ppToken->ival = 0;
|
ppToken->ival = 0;
|
||||||
|
ppToken->i64val = 0;
|
||||||
ppToken->space = false;
|
ppToken->space = false;
|
||||||
ch = getch();
|
ch = getch();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -299,6 +301,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
// must be hexidecimal
|
// must be hexidecimal
|
||||||
|
|
||||||
bool isUnsigned = false;
|
bool isUnsigned = false;
|
||||||
|
bool isInt64 = false;
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
ch = getch();
|
ch = getch();
|
||||||
if ((ch >= '0' && ch <= '9') ||
|
if ((ch >= '0' && ch <= '9') ||
|
||||||
@ -307,7 +310,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
|
|
||||||
ival = 0;
|
ival = 0;
|
||||||
do {
|
do {
|
||||||
if (ival <= 0x0fffffff) {
|
if (ival <= 0x0fffffff || (enableInt64 && ival <= 0x0fffffffffffffffull)) {
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
if (ch >= '0' && ch <= '9') {
|
if (ch >= '0' && ch <= '9') {
|
||||||
ii = ch - '0';
|
ii = ch - '0';
|
||||||
@ -323,7 +326,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
pp->parseContext.ppError(ppToken->loc, "hexidecimal literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "hexidecimal literal too big", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
ival = 0xffffffff;
|
ival = 0xffffffffffffffffull;
|
||||||
}
|
}
|
||||||
ch = getch();
|
ch = getch();
|
||||||
} while ((ch >= '0' && ch <= '9') ||
|
} while ((ch >= '0' && ch <= '9') ||
|
||||||
@ -336,19 +339,37 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isUnsigned = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
if (enableInt64) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt64 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt64 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
ppToken->name[len] = '\0';
|
ppToken->name[len] = '\0';
|
||||||
ppToken->ival = (int)ival;
|
|
||||||
|
|
||||||
if (isUnsigned)
|
if (isInt64) {
|
||||||
return PpAtomConstUint;
|
ppToken->i64val = ival;
|
||||||
else
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
return PpAtomConstInt;
|
} else {
|
||||||
|
ppToken->ival = (int)ival;
|
||||||
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// could be octal integer or floating point, speculative pursue octal until it must be floating point
|
// could be octal integer or floating point, speculative pursue octal until it must be floating point
|
||||||
|
|
||||||
bool isUnsigned = false;
|
bool isUnsigned = false;
|
||||||
|
bool isInt64 = false;
|
||||||
bool octalOverflow = false;
|
bool octalOverflow = false;
|
||||||
bool nonOctal = false;
|
bool nonOctal = false;
|
||||||
ival = 0;
|
ival = 0;
|
||||||
@ -361,7 +382,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
if (ival <= 0x1fffffff) {
|
if (ival <= 0x1fffffff || (enableInt64 && ival <= 0x1fffffffffffffffull)) {
|
||||||
ii = ch - '0';
|
ii = ch - '0';
|
||||||
ival = (ival << 3) | ii;
|
ival = (ival << 3) | ii;
|
||||||
} else
|
} else
|
||||||
@ -382,7 +403,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ch = getch();
|
ch = getch();
|
||||||
} while (ch >= '0' && ch <= '9');
|
} while (ch >= '0' && ch <= '9');
|
||||||
}
|
}
|
||||||
if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F' || ch == 'l' || ch == 'L')
|
if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F')
|
||||||
return pp->lFloatConst(len, ch, ppToken);
|
return pp->lFloatConst(len, ch, ppToken);
|
||||||
|
|
||||||
// wasn't a float, so must be octal...
|
// wasn't a float, so must be octal...
|
||||||
@ -393,6 +414,21 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isUnsigned = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
if (enableInt64) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt64 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt64 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
ppToken->name[len] = '\0';
|
ppToken->name[len] = '\0';
|
||||||
@ -400,12 +436,13 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (octalOverflow)
|
if (octalOverflow)
|
||||||
pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", "");
|
||||||
|
|
||||||
ppToken->ival = (int)ival;
|
if (isInt64) {
|
||||||
|
ppToken->i64val = ival;
|
||||||
if (isUnsigned)
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
return PpAtomConstUint;
|
} else {
|
||||||
else
|
ppToken->ival = (int)ival;
|
||||||
return PpAtomConstInt;
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '1': case '2': case '3': case '4':
|
case '1': case '2': case '3': case '4':
|
||||||
@ -421,16 +458,31 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
}
|
}
|
||||||
ch = getch();
|
ch = getch();
|
||||||
} while (ch >= '0' && ch <= '9');
|
} while (ch >= '0' && ch <= '9');
|
||||||
if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F' || ch == 'l' || ch == 'L') {
|
if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F') {
|
||||||
return pp->lFloatConst(len, ch, ppToken);
|
return pp->lFloatConst(len, ch, ppToken);
|
||||||
} else {
|
} else {
|
||||||
// Finish handling signed and unsigned integers
|
// Finish handling signed and unsigned integers
|
||||||
int numericLen = len;
|
int numericLen = len;
|
||||||
bool uint = false;
|
bool isUnsigned = false;
|
||||||
|
bool isInt64 = false;
|
||||||
if (ch == 'u' || ch == 'U') {
|
if (ch == 'u' || ch == 'U') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
uint = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
if (enableInt64) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt64 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
} else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt64 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
|
|
||||||
@ -438,21 +490,26 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ival = 0;
|
ival = 0;
|
||||||
const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10;
|
const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10;
|
||||||
const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt;
|
const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt;
|
||||||
|
const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10;
|
||||||
|
const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64;
|
||||||
for (int i = 0; i < numericLen; i++) {
|
for (int i = 0; i < numericLen; i++) {
|
||||||
ch = ppToken->name[i] - '0';
|
ch = ppToken->name[i] - '0';
|
||||||
if ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)) {
|
if ((enableInt64 == false && ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt))) ||
|
||||||
|
(enableInt64 && ((ival > oneTenthMaxInt64) || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)))) {
|
||||||
pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", "");
|
||||||
ival = 0xFFFFFFFFu;
|
ival = 0xFFFFFFFFFFFFFFFFull;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
ival = ival * 10 + ch;
|
ival = ival * 10 + ch;
|
||||||
}
|
}
|
||||||
ppToken->ival = (int)ival;
|
|
||||||
|
|
||||||
if (uint)
|
if (isInt64) {
|
||||||
return PpAtomConstUint;
|
ppToken->i64val = ival;
|
||||||
else
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
return PpAtomConstInt;
|
} else {
|
||||||
|
ppToken->ival = (int)ival;
|
||||||
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@ -686,6 +743,8 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
|
|||||||
case PpAtomConstInt:
|
case PpAtomConstInt:
|
||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
|
case PpAtomConstInt64:
|
||||||
|
case PpAtomConstUint64:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
tokenString = ppToken->name;
|
tokenString = ppToken->name;
|
||||||
break;
|
break;
|
||||||
|
@ -141,6 +141,8 @@ void TPpContext::RecordToken(TokenStream *pTok, int token, TPpToken* ppToken)
|
|||||||
break;
|
break;
|
||||||
case PpAtomConstInt:
|
case PpAtomConstInt:
|
||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
|
case PpAtomConstInt64:
|
||||||
|
case PpAtomConstUint64:
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
str = ppToken->name;
|
str = ppToken->name;
|
||||||
@ -193,6 +195,8 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
|||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
case PpAtomConstInt:
|
case PpAtomConstInt:
|
||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
|
case PpAtomConstInt64:
|
||||||
|
case PpAtomConstUint64:
|
||||||
len = 0;
|
len = 0;
|
||||||
ch = lReadByte(pTok);
|
ch = lReadByte(pTok);
|
||||||
while (ch != 0 && ch != EndOfInput) {
|
while (ch != 0 && ch != EndOfInput) {
|
||||||
@ -227,6 +231,16 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
|||||||
} else
|
} else
|
||||||
ppToken->ival = atoi(ppToken->name);
|
ppToken->ival = atoi(ppToken->name);
|
||||||
break;
|
break;
|
||||||
|
case PpAtomConstInt64:
|
||||||
|
case PpAtomConstUint64:
|
||||||
|
if (len > 0 && tokenText[0] == '0') {
|
||||||
|
if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
|
||||||
|
ppToken->i64val = std::stoll(ppToken->name, 0, 16);
|
||||||
|
else
|
||||||
|
ppToken->i64val = std::stoll(ppToken->name, 0, 8);
|
||||||
|
} else
|
||||||
|
ppToken->i64val = std::stoll(ppToken->name);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +119,8 @@ enum EFixedAtoms {
|
|||||||
|
|
||||||
PpAtomConstInt,
|
PpAtomConstInt,
|
||||||
PpAtomConstUint,
|
PpAtomConstUint,
|
||||||
|
PpAtomConstInt64,
|
||||||
|
PpAtomConstUint64,
|
||||||
PpAtomConstFloat,
|
PpAtomConstFloat,
|
||||||
PpAtomConstDouble,
|
PpAtomConstDouble,
|
||||||
PpAtomConstString,
|
PpAtomConstString,
|
||||||
|
@ -540,6 +540,8 @@ public:
|
|||||||
case EbtDouble: return GL_DOUBLE_VEC2 + offset;
|
case EbtDouble: return GL_DOUBLE_VEC2 + offset;
|
||||||
case EbtInt: return GL_INT_VEC2 + offset;
|
case EbtInt: return GL_INT_VEC2 + offset;
|
||||||
case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset;
|
case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset;
|
||||||
|
case EbtInt64: return GL_INT64_ARB + offset;
|
||||||
|
case EbtUint64: return GL_UNSIGNED_INT64_ARB + offset;
|
||||||
case EbtBool: return GL_BOOL_VEC2 + offset;
|
case EbtBool: return GL_BOOL_VEC2 + offset;
|
||||||
case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER + offset;
|
case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER + offset;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
@ -605,6 +607,8 @@ public:
|
|||||||
case EbtDouble: return GL_DOUBLE;
|
case EbtDouble: return GL_DOUBLE;
|
||||||
case EbtInt: return GL_INT;
|
case EbtInt: return GL_INT;
|
||||||
case EbtUint: return GL_UNSIGNED_INT;
|
case EbtUint: return GL_UNSIGNED_INT;
|
||||||
|
case EbtInt64: return GL_INT64_ARB;
|
||||||
|
case EbtUint64: return GL_UNSIGNED_INT64_ARB;
|
||||||
case EbtBool: return GL_BOOL;
|
case EbtBool: return GL_BOOL;
|
||||||
case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER;
|
case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
|
@ -119,6 +119,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"spv.functionCall.frag",
|
"spv.functionCall.frag",
|
||||||
"spv.functionSemantics.frag",
|
"spv.functionSemantics.frag",
|
||||||
"spv.interpOps.frag",
|
"spv.interpOps.frag",
|
||||||
|
"spv.int64.frag",
|
||||||
"spv.layoutNested.vert",
|
"spv.layoutNested.vert",
|
||||||
"spv.length.frag",
|
"spv.length.frag",
|
||||||
"spv.localAggregates.frag",
|
"spv.localAggregates.frag",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user