mirror of
https://github.com/RPCS3/glslang.git
synced 2025-02-26 05:47:29 +00:00
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:
|
||||
{
|
||||
// we need the integer value "1" or the floating point "1.0" to add/subtract
|
||||
spv::Id one = node->getBasicType() == glslang::EbtFloat ?
|
||||
builder.makeFloatConstant(1.0F) :
|
||||
builder.makeIntConstant(1);
|
||||
spv::Id one = 0;
|
||||
if (node->getBasicType() == glslang::EbtFloat)
|
||||
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;
|
||||
if (node->getOp() == glslang::EOpPreIncrement ||
|
||||
node->getOp() == glslang::EOpPostIncrement)
|
||||
@ -1080,8 +1084,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
op = glslang::EOpSub;
|
||||
|
||||
spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()),
|
||||
convertGlslangToSpvType(node->getType()), operand, one,
|
||||
node->getType().getBasicType());
|
||||
convertGlslangToSpvType(node->getType()), operand, one,
|
||||
node->getType().getBasicType());
|
||||
assert(result != spv::NoResult);
|
||||
|
||||
// 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::EOpConstructUVec3:
|
||||
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::EOpConstructTextureSampler:
|
||||
{
|
||||
@ -1740,6 +1752,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
||||
case glslang::EbtUint:
|
||||
spvType = builder.makeUintType(32);
|
||||
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:
|
||||
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);
|
||||
@ -2631,7 +2651,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
||||
spv::Id typeId, spv::Id left, spv::Id right,
|
||||
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 isBool = typeProxy == glslang::EbtBool;
|
||||
|
||||
@ -2948,7 +2968,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
||||
{
|
||||
spv::Op unaryOp = spv::OpNop;
|
||||
int libCall = -1;
|
||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||
|
||||
switch (op) {
|
||||
@ -3079,6 +3099,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
||||
case glslang::EOpFloatBitsToUint:
|
||||
case glslang::EOpIntBitsToFloat:
|
||||
case glslang::EOpUintBitsToFloat:
|
||||
case glslang::EOpDoubleBitsToInt64:
|
||||
case glslang::EOpDoubleBitsToUint64:
|
||||
case glslang::EOpInt64BitsToDouble:
|
||||
case glslang::EOpUint64BitsToDouble:
|
||||
unaryOp = spv::OpBitcast;
|
||||
break;
|
||||
|
||||
@ -3119,6 +3143,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
||||
libCall = spv::GLSLstd450UnpackDouble2x32;
|
||||
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:
|
||||
unaryOp = spv::OpDPdx;
|
||||
break;
|
||||
@ -3252,13 +3284,17 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
||||
spv::Op convOp = spv::OpNop;
|
||||
spv::Id zero = 0;
|
||||
spv::Id one = 0;
|
||||
spv::Id type = 0;
|
||||
|
||||
int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0;
|
||||
|
||||
switch (op) {
|
||||
case glslang::EOpConvIntToBool:
|
||||
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);
|
||||
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);
|
||||
break;
|
||||
case glslang::EOpConvBoolToInt:
|
||||
zero = builder.makeIntConstant(0);
|
||||
one = builder.makeIntConstant(1);
|
||||
case glslang::EOpConvBoolToInt64:
|
||||
zero = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(0) : builder.makeIntConstant(0);
|
||||
one = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(1) : builder.makeIntConstant(1);
|
||||
convOp = spv::OpSelect;
|
||||
break;
|
||||
case glslang::EOpConvBoolToUint:
|
||||
zero = builder.makeUintConstant(0);
|
||||
one = builder.makeUintConstant(1);
|
||||
case glslang::EOpConvBoolToUint64:
|
||||
zero = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
||||
one = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(1) : builder.makeUintConstant(1);
|
||||
convOp = spv::OpSelect;
|
||||
break;
|
||||
|
||||
case glslang::EOpConvIntToFloat:
|
||||
case glslang::EOpConvIntToDouble:
|
||||
case glslang::EOpConvInt64ToFloat:
|
||||
case glslang::EOpConvInt64ToDouble:
|
||||
convOp = spv::OpConvertSToF;
|
||||
break;
|
||||
|
||||
case glslang::EOpConvUintToFloat:
|
||||
case glslang::EOpConvUintToDouble:
|
||||
case glslang::EOpConvUint64ToFloat:
|
||||
case glslang::EOpConvUint64ToDouble:
|
||||
convOp = spv::OpConvertUToF;
|
||||
break;
|
||||
|
||||
@ -3310,14 +3352,19 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
||||
|
||||
case glslang::EOpConvFloatToInt:
|
||||
case glslang::EOpConvDoubleToInt:
|
||||
case glslang::EOpConvFloatToInt64:
|
||||
case glslang::EOpConvDoubleToInt64:
|
||||
convOp = spv::OpConvertFToS;
|
||||
break;
|
||||
|
||||
case glslang::EOpConvUintToInt:
|
||||
case glslang::EOpConvIntToUint:
|
||||
case glslang::EOpConvUint64ToInt64:
|
||||
case glslang::EOpConvInt64ToUint64:
|
||||
if (builder.isInSpecConstCodeGenMode()) {
|
||||
// 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);
|
||||
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
||||
// generating for OpSpecConstantOp instruction.
|
||||
@ -3329,8 +3376,65 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
||||
|
||||
case glslang::EOpConvFloatToUint:
|
||||
case glslang::EOpConvDoubleToUint:
|
||||
case glslang::EOpConvFloatToUint64:
|
||||
case glslang::EOpConvDoubleToUint64:
|
||||
convOp = spv::OpConvertFToU;
|
||||
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:
|
||||
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)
|
||||
{
|
||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||
|
||||
spv::Op opCode = spv::OpNop;
|
||||
@ -3876,6 +3980,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
case glslang::EbtUint:
|
||||
spvConsts.push_back(builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst()));
|
||||
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:
|
||||
spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
||||
break;
|
||||
@ -3902,6 +4012,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
case glslang::EbtUint:
|
||||
scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant);
|
||||
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:
|
||||
scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
||||
break;
|
||||
|
@ -606,7 +606,7 @@ Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned valu
|
||||
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
|
||||
{
|
||||
Instruction* constant;
|
||||
@ -711,6 +711,31 @@ Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant)
|
||||
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)
|
||||
{
|
||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||
|
@ -188,6 +188,8 @@ public:
|
||||
Id makeBoolConstant(bool b, bool specConstant = false);
|
||||
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 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 makeDoubleConstant(double d, bool specConstant = false);
|
||||
|
||||
@ -533,6 +535,7 @@ public:
|
||||
|
||||
protected:
|
||||
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 v1, unsigned v2) 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.functionSemantics.frag
|
||||
spv.interpOps.frag
|
||||
spv.int64.frag
|
||||
spv.layoutNested.vert
|
||||
spv.length.frag
|
||||
spv.localAggregates.frag
|
||||
|
@ -48,6 +48,8 @@ enum TBasicType {
|
||||
EbtDouble,
|
||||
EbtInt,
|
||||
EbtUint,
|
||||
EbtInt64,
|
||||
EbtUint64,
|
||||
EbtBool,
|
||||
EbtAtomicUint,
|
||||
EbtSampler,
|
||||
|
@ -57,6 +57,18 @@ public:
|
||||
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)
|
||||
{
|
||||
dConst = d;
|
||||
@ -69,10 +81,12 @@ public:
|
||||
type = EbtBool;
|
||||
}
|
||||
|
||||
int getIConst() const { return iConst; }
|
||||
unsigned int getUConst() const { return uConst; }
|
||||
double getDConst() const { return dConst; }
|
||||
bool getBConst() const { return bConst; }
|
||||
int getIConst() const { return iConst; }
|
||||
unsigned int getUConst() const { return uConst; }
|
||||
long long getI64Const() const { return i64Const; }
|
||||
unsigned long long getU64Const() const { return u64Const; }
|
||||
double getDConst() const { return dConst; }
|
||||
bool getBConst() const { return bConst; }
|
||||
|
||||
bool operator==(const int i) const
|
||||
{
|
||||
@ -82,7 +96,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator==(unsigned const int u) const
|
||||
bool operator==(const unsigned int u) const
|
||||
{
|
||||
if (u == uConst)
|
||||
return true;
|
||||
@ -90,6 +104,22 @@ public:
|
||||
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
|
||||
{
|
||||
if (d == dConst)
|
||||
@ -121,6 +151,16 @@ public:
|
||||
if (constant.uConst == uConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtInt64:
|
||||
if (constant.i64Const == i64Const)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtUint64:
|
||||
if (constant.u64Const == u64Const)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtDouble:
|
||||
if (constant.dConst == dConst)
|
||||
@ -149,6 +189,16 @@ public:
|
||||
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
|
||||
{
|
||||
return !operator==(f);
|
||||
@ -177,6 +227,16 @@ public:
|
||||
if (uConst > constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt64:
|
||||
if (i64Const > constant.i64Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint64:
|
||||
if (u64Const > constant.u64Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst > constant.dConst)
|
||||
@ -202,6 +262,16 @@ public:
|
||||
if (uConst < constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt64:
|
||||
if (i64Const < constant.i64Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint64:
|
||||
if (u64Const < constant.u64Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst < constant.dConst)
|
||||
@ -220,7 +290,9 @@ public:
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
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 EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
@ -234,7 +306,9 @@ public:
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
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 EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
@ -248,7 +322,9 @@ public:
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
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 EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
@ -261,8 +337,10 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.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 EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -275,16 +353,38 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||
case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||
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;
|
||||
default: assert(false && "Default missing");
|
||||
@ -299,16 +399,38 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||
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;
|
||||
default: assert(false && "Default missing");
|
||||
@ -324,6 +446,8 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst & constant.iConst); 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");
|
||||
}
|
||||
|
||||
@ -337,6 +461,8 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst | constant.iConst); 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");
|
||||
}
|
||||
|
||||
@ -350,6 +476,8 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); 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");
|
||||
}
|
||||
|
||||
@ -362,6 +490,8 @@ public:
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(~iConst); break;
|
||||
case EbtUint: returnValue.setUConst(~uConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(~i64Const); break;
|
||||
case EbtUint64: returnValue.setU64Const(~u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -396,10 +526,12 @@ public:
|
||||
|
||||
private:
|
||||
union {
|
||||
int iConst; // used for ivec, scalar ints
|
||||
unsigned int uConst; // used for uvec, scalar uints
|
||||
bool bConst; // used for bvec, scalar bools
|
||||
double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles
|
||||
int iConst; // used for ivec, scalar ints
|
||||
unsigned int uConst; // used for uvec, scalar uints
|
||||
long long i64Const; // used for i64vec, scalar int64s
|
||||
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;
|
||||
|
@ -182,6 +182,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
case EbtFloat: break;
|
||||
case EbtInt: s.append("i"); 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
|
||||
}
|
||||
if (image) {
|
||||
@ -1319,6 +1321,8 @@ public:
|
||||
case EbtDouble:
|
||||
case EbtInt:
|
||||
case EbtUint:
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
case EbtBool:
|
||||
return true;
|
||||
default:
|
||||
@ -1409,6 +1413,8 @@ public:
|
||||
case EbtDouble: return "double";
|
||||
case EbtInt: return "int";
|
||||
case EbtUint: return "uint";
|
||||
case EbtInt64: return "int64_t";
|
||||
case EbtUint64: return "uint64_t";
|
||||
case EbtBool: return "bool";
|
||||
case EbtAtomicUint: return "atomic_uint";
|
||||
case EbtSampler: return "sampler/image";
|
||||
|
@ -81,22 +81,44 @@ enum TOperator {
|
||||
EOpConvUintToBool,
|
||||
EOpConvFloatToBool,
|
||||
EOpConvDoubleToBool,
|
||||
EOpConvInt64ToBool,
|
||||
EOpConvUint64ToBool,
|
||||
EOpConvBoolToFloat,
|
||||
EOpConvIntToFloat,
|
||||
EOpConvUintToFloat,
|
||||
EOpConvDoubleToFloat,
|
||||
EOpConvInt64ToFloat,
|
||||
EOpConvUint64ToFloat,
|
||||
EOpConvUintToInt,
|
||||
EOpConvFloatToInt,
|
||||
EOpConvBoolToInt,
|
||||
EOpConvDoubleToInt,
|
||||
EOpConvInt64ToInt,
|
||||
EOpConvUint64ToInt,
|
||||
EOpConvIntToUint,
|
||||
EOpConvFloatToUint,
|
||||
EOpConvBoolToUint,
|
||||
EOpConvDoubleToUint,
|
||||
EOpConvInt64ToUint,
|
||||
EOpConvUint64ToUint,
|
||||
EOpConvIntToDouble,
|
||||
EOpConvUintToDouble,
|
||||
EOpConvFloatToDouble,
|
||||
EOpConvBoolToDouble,
|
||||
EOpConvInt64ToDouble,
|
||||
EOpConvUint64ToDouble,
|
||||
EOpConvBoolToInt64,
|
||||
EOpConvIntToInt64,
|
||||
EOpConvUintToInt64,
|
||||
EOpConvFloatToInt64,
|
||||
EOpConvDoubleToInt64,
|
||||
EOpConvUint64ToInt64,
|
||||
EOpConvBoolToUint64,
|
||||
EOpConvIntToUint64,
|
||||
EOpConvUintToUint64,
|
||||
EOpConvFloatToUint64,
|
||||
EOpConvDoubleToUint64,
|
||||
EOpConvInt64ToUint64,
|
||||
|
||||
//
|
||||
// binary operations
|
||||
@ -194,6 +216,10 @@ enum TOperator {
|
||||
EOpFloatBitsToUint,
|
||||
EOpIntBitsToFloat,
|
||||
EOpUintBitsToFloat,
|
||||
EOpDoubleBitsToInt64,
|
||||
EOpDoubleBitsToUint64,
|
||||
EOpInt64BitsToDouble,
|
||||
EOpUint64BitsToDouble,
|
||||
EOpPackSnorm2x16,
|
||||
EOpUnpackSnorm2x16,
|
||||
EOpPackUnorm2x16,
|
||||
@ -206,6 +232,10 @@ enum TOperator {
|
||||
EOpUnpackHalf2x16,
|
||||
EOpPackDouble2x32,
|
||||
EOpUnpackDouble2x32,
|
||||
EOpPackInt2x32,
|
||||
EOpUnpackInt2x32,
|
||||
EOpPackUint2x32,
|
||||
EOpUnpackUint2x32,
|
||||
|
||||
EOpLength,
|
||||
EOpDistance,
|
||||
@ -287,6 +317,8 @@ enum TOperator {
|
||||
EOpConstructGuardStart,
|
||||
EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed
|
||||
EOpConstructUint,
|
||||
EOpConstructInt64,
|
||||
EOpConstructUint64,
|
||||
EOpConstructBool,
|
||||
EOpConstructFloat,
|
||||
EOpConstructDouble,
|
||||
@ -305,6 +337,12 @@ enum TOperator {
|
||||
EOpConstructUVec2,
|
||||
EOpConstructUVec3,
|
||||
EOpConstructUVec4,
|
||||
EOpConstructI64Vec2,
|
||||
EOpConstructI64Vec3,
|
||||
EOpConstructI64Vec4,
|
||||
EOpConstructU64Vec2,
|
||||
EOpConstructU64Vec3,
|
||||
EOpConstructU64Vec4,
|
||||
EOpConstructMat2x2,
|
||||
EOpConstructMat2x3,
|
||||
EOpConstructMat2x4,
|
||||
|
@ -194,6 +194,22 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
} else
|
||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||
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:
|
||||
return 0;
|
||||
}
|
||||
@ -419,6 +435,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); 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 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:
|
||||
return 0;
|
||||
}
|
||||
@ -566,6 +584,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpFloatBitsToUint:
|
||||
case EOpIntBitsToFloat:
|
||||
case EOpUintBitsToFloat:
|
||||
case EOpDoubleBitsToInt64:
|
||||
case EOpDoubleBitsToUint64:
|
||||
|
||||
default:
|
||||
return 0;
|
||||
@ -651,7 +671,10 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
|
||||
bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat ||
|
||||
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) {
|
||||
for (int comp = 0; comp < objectSize; comp++) {
|
||||
|
||||
@ -674,29 +697,52 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EOpMin:
|
||||
if (isFloatingPoint)
|
||||
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
else if (isSigned)
|
||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
else
|
||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
else if (isSigned) {
|
||||
if (isInt64)
|
||||
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||
else
|
||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
} else {
|
||||
if (isInt64)
|
||||
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
else
|
||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
}
|
||||
break;
|
||||
case EOpMax:
|
||||
if (isFloatingPoint)
|
||||
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
else if (isSigned)
|
||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
else
|
||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
else if (isSigned) {
|
||||
if (isInt64)
|
||||
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||
else
|
||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
} else {
|
||||
if (isInt64)
|
||||
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
else
|
||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
}
|
||||
break;
|
||||
case EOpClamp:
|
||||
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()));
|
||||
else if (isSigned)
|
||||
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
||||
childConstUnions[2][arg2comp].getIConst()));
|
||||
else
|
||||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
||||
childConstUnions[2][arg2comp].getUConst()));
|
||||
else if (isSigned) {
|
||||
if (isInt64)
|
||||
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
|
||||
childConstUnions[2][arg2comp].getI64Const()));
|
||||
else
|
||||
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
||||
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;
|
||||
case EOpLessThan:
|
||||
newConstArray[comp].setBConst(childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp]);
|
||||
|
@ -75,6 +75,8 @@ TBuiltIns::TBuiltIns()
|
||||
prefixes[EbtFloat] = "";
|
||||
prefixes[EbtInt] = "i";
|
||||
prefixes[EbtUint] = "u";
|
||||
prefixes[EbtInt64] = "i64";
|
||||
prefixes[EbtUint64] = "u64";
|
||||
postfixes[2] = "2";
|
||||
postfixes[3] = "3";
|
||||
postfixes[4] = "4";
|
||||
@ -626,6 +628,145 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
"dmat2 inverse(dmat2);"
|
||||
"dmat3 inverse(dmat3);"
|
||||
"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("intBitsToFloat", EOpIntBitsToFloat);
|
||||
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("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
||||
@ -3667,6 +3812,11 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan
|
||||
symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16);
|
||||
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("distance", EOpDistance);
|
||||
symbolTable.relateToOperator("dot", EOpDot);
|
||||
|
@ -247,6 +247,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
switch (op) {
|
||||
case EOpConstructInt: newType = EbtInt; break;
|
||||
case EOpConstructUint: newType = EbtUint; break;
|
||||
case EOpConstructInt64: newType = EbtInt64; break;
|
||||
case EOpConstructUint64: newType = EbtUint64; break;
|
||||
case EOpConstructBool: newType = EbtBool; break;
|
||||
case EOpConstructFloat: newType = EbtFloat; break;
|
||||
case EOpConstructDouble: newType = EbtDouble; break;
|
||||
@ -269,6 +271,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
switch (op) {
|
||||
case EOpConstructInt:
|
||||
case EOpConstructUint:
|
||||
case EOpConstructInt64:
|
||||
case EOpConstructUint64:
|
||||
case EOpConstructBool:
|
||||
case EOpConstructFloat:
|
||||
case EOpConstructDouble:
|
||||
@ -472,6 +476,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpConstructUint:
|
||||
promoteTo = EbtUint;
|
||||
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;
|
||||
@ -498,6 +508,9 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpAnd:
|
||||
case EOpInclusiveOr:
|
||||
case EOpExclusiveOr:
|
||||
case EOpAndAssign:
|
||||
case EOpInclusiveOrAssign:
|
||||
case EOpExclusiveOrAssign:
|
||||
|
||||
case EOpFunctionCall:
|
||||
case EOpReturn:
|
||||
@ -531,9 +544,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpLeftShiftAssign:
|
||||
case EOpRightShiftAssign:
|
||||
if ((type.getBasicType() == EbtInt ||
|
||||
type.getBasicType() == EbtUint) &&
|
||||
type.getBasicType() == EbtUint ||
|
||||
type.getBasicType() == EbtInt64 ||
|
||||
type.getBasicType() == EbtUint64) &&
|
||||
(node->getType().getBasicType() == EbtInt ||
|
||||
node->getType().getBasicType() == EbtUint))
|
||||
node->getType().getBasicType() == EbtUint ||
|
||||
node->getType().getBasicType() == EbtInt64 ||
|
||||
node->getType().getBasicType() == EbtUint64))
|
||||
|
||||
return node;
|
||||
else
|
||||
@ -567,6 +584,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EbtUint: newOp = EOpConvUintToDouble; break;
|
||||
case EbtBool: newOp = EOpConvBoolToDouble; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToDouble; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -577,6 +596,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EbtUint: newOp = EOpConvUintToFloat; break;
|
||||
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -587,6 +608,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EbtUint: newOp = EOpConvUintToBool; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -597,6 +620,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EbtBool: newOp = EOpConvBoolToInt; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToInt; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -607,6 +632,32 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EbtBool: newOp = EOpConvBoolToUint; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToUint; 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:
|
||||
return 0;
|
||||
}
|
||||
@ -643,6 +694,8 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const
|
||||
switch (from) {
|
||||
case EbtInt:
|
||||
case EbtUint:
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
return true;
|
||||
@ -674,6 +727,24 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const
|
||||
default:
|
||||
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:
|
||||
return false;
|
||||
}
|
||||
@ -873,6 +944,22 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned int u, const TSou
|
||||
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
|
||||
{
|
||||
TConstUnionArray unionArray(1);
|
||||
@ -1212,7 +1299,9 @@ bool TIntermUnary::promote()
|
||||
break;
|
||||
case EOpBitwiseNot:
|
||||
if (operand->getBasicType() != EbtInt &&
|
||||
operand->getBasicType() != EbtUint)
|
||||
operand->getBasicType() != EbtUint &&
|
||||
operand->getBasicType() != EbtInt64 &&
|
||||
operand->getBasicType() != EbtUint64)
|
||||
|
||||
return false;
|
||||
break;
|
||||
@ -1223,6 +1312,8 @@ bool TIntermUnary::promote()
|
||||
case EOpPreDecrement:
|
||||
if (operand->getBasicType() != EbtInt &&
|
||||
operand->getBasicType() != EbtUint &&
|
||||
operand->getBasicType() != EbtInt64 &&
|
||||
operand->getBasicType() != EbtUint64 &&
|
||||
operand->getBasicType() != EbtFloat &&
|
||||
operand->getBasicType() != EbtDouble)
|
||||
|
||||
@ -1340,8 +1431,10 @@ bool TIntermBinary::promote()
|
||||
case EOpInclusiveOrAssign:
|
||||
case EOpExclusiveOrAssign:
|
||||
// Check for integer-only operands.
|
||||
if (( left->getBasicType() != EbtInt && left->getBasicType() != EbtUint) ||
|
||||
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint))
|
||||
if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint &&
|
||||
left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) ||
|
||||
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint &&
|
||||
right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64))
|
||||
return false;
|
||||
if (left->isMatrix() || right->isMatrix())
|
||||
return false;
|
||||
@ -1643,6 +1736,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtUint:
|
||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
||||
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:
|
||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
||||
break;
|
||||
@ -1664,6 +1763,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtUint:
|
||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
|
||||
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:
|
||||
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
|
||||
break;
|
||||
@ -1683,6 +1788,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtUint:
|
||||
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getUConst()));
|
||||
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:
|
||||
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst()));
|
||||
break;
|
||||
@ -1702,6 +1813,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtUint:
|
||||
leftUnionArray[i] = rightUnionArray[i];
|
||||
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:
|
||||
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getBConst()));
|
||||
break;
|
||||
@ -1721,6 +1838,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtUint:
|
||||
leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0);
|
||||
break;
|
||||
case EbtInt64:
|
||||
leftUnionArray[i].setBConst(rightUnionArray[i].getI64Const() != 0);
|
||||
break;
|
||||
case EbtUint64:
|
||||
leftUnionArray[i].setBConst(rightUnionArray[i].getU64Const() != 0);
|
||||
break;
|
||||
case EbtBool:
|
||||
leftUnionArray[i] = rightUnionArray[i];
|
||||
break;
|
||||
@ -1732,6 +1855,56 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
return node;
|
||||
}
|
||||
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:
|
||||
return node;
|
||||
}
|
||||
|
@ -1812,6 +1812,24 @@ TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
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:
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructBool; break;
|
||||
@ -2534,13 +2552,19 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
||||
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");
|
||||
|
||||
if (! qualifier.flat) {
|
||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble ||
|
||||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
|
||||
publicType.userDef->containsBasicType(EbtUint) ||
|
||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||
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)))) {
|
||||
if (qualifier.storage == EvqVaryingIn && language == EShLangFragment)
|
||||
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 EbtUint:
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
case EbtBool:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
@ -5226,6 +5252,20 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
||||
basicOp = EOpConstructUint;
|
||||
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 EOpConstructBVec3:
|
||||
case EOpConstructBVec4:
|
||||
|
@ -454,6 +454,15 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["uvec3"] = UVEC3;
|
||||
(*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)["samplerCube"] = SAMPLERCUBE;
|
||||
(*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
|
||||
@ -667,10 +676,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
||||
case PpAtomDecrement: return DEC_OP;
|
||||
case PpAtomIncrement: return INC_OP;
|
||||
|
||||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||
case PpAtomIdentifier:
|
||||
{
|
||||
int token = tokenizeIdentifier();
|
||||
@ -914,6 +925,18 @@ int TScanContext::tokenizeIdentifier()
|
||||
reservedWord();
|
||||
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 SAMPLERCUBEARRAYSHADOW:
|
||||
case ISAMPLERCUBEARRAY:
|
||||
|
@ -62,6 +62,8 @@ void TType::buildMangledName(TString& mangledName)
|
||||
case EbtDouble: mangledName += 'd'; break;
|
||||
case EbtInt: mangledName += 'i'; break;
|
||||
case EbtUint: mangledName += 'u'; break;
|
||||
case EbtInt64: mangledName += "i64"; break;
|
||||
case EbtUint64: mangledName += "u64"; break;
|
||||
case EbtBool: mangledName += 'b'; break;
|
||||
case EbtAtomicUint: mangledName += "au"; break;
|
||||
case EbtSampler:
|
||||
|
@ -174,6 +174,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_sparse_texture2] = 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_shader_texture_image_samples 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_sparse_texture2 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);
|
||||
}
|
||||
|
||||
// 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.
|
||||
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_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_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_sparse_texture2 = "GL_ARB_sparse_texture2";
|
||||
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_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_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
|
@ -70,6 +70,8 @@ using namespace glslang;
|
||||
glslang::TString *string;
|
||||
int i;
|
||||
unsigned int u;
|
||||
long long i64;
|
||||
unsigned long long u64;
|
||||
bool b;
|
||||
double d;
|
||||
};
|
||||
@ -117,9 +119,9 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%expect 1 // One shift reduce conflict because of if | else
|
||||
|
||||
%token <lex> ATTRIBUTE VARYING
|
||||
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT
|
||||
%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> 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> UNIFORM PATCH SAMPLE BUFFER SHARED
|
||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
||||
@ -180,7 +182,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> STRUCT VOID WHILE
|
||||
|
||||
%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> 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
|
||||
@ -257,6 +259,14 @@ primary_expression
|
||||
parseContext.fullIntegerCheck($1.loc, "unsigned literal");
|
||||
$$ = 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 {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||
}
|
||||
@ -1309,6 +1319,16 @@ type_specifier_nonarray
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint;
|
||||
}
|
||||
| INT64_T {
|
||||
parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtInt64;
|
||||
}
|
||||
| UINT64_T {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint64;
|
||||
}
|
||||
| BOOL {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtBool;
|
||||
@ -1376,6 +1396,24 @@ type_specifier_nonarray
|
||||
$$.basicType = EbtInt;
|
||||
$$.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 {
|
||||
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
@ -1394,6 +1432,24 @@ type_specifier_nonarray
|
||||
$$.basicType = EbtUint;
|
||||
$$.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 {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.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
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 1
|
||||
@ -54,255 +54,265 @@ extern int yydebug;
|
||||
DOUBLE = 263,
|
||||
INT = 264,
|
||||
UINT = 265,
|
||||
BREAK = 266,
|
||||
CONTINUE = 267,
|
||||
DO = 268,
|
||||
ELSE = 269,
|
||||
FOR = 270,
|
||||
IF = 271,
|
||||
DISCARD = 272,
|
||||
RETURN = 273,
|
||||
SWITCH = 274,
|
||||
CASE = 275,
|
||||
DEFAULT = 276,
|
||||
SUBROUTINE = 277,
|
||||
BVEC2 = 278,
|
||||
BVEC3 = 279,
|
||||
BVEC4 = 280,
|
||||
IVEC2 = 281,
|
||||
IVEC3 = 282,
|
||||
IVEC4 = 283,
|
||||
UVEC2 = 284,
|
||||
UVEC3 = 285,
|
||||
UVEC4 = 286,
|
||||
VEC2 = 287,
|
||||
VEC3 = 288,
|
||||
VEC4 = 289,
|
||||
MAT2 = 290,
|
||||
MAT3 = 291,
|
||||
MAT4 = 292,
|
||||
CENTROID = 293,
|
||||
IN = 294,
|
||||
OUT = 295,
|
||||
INOUT = 296,
|
||||
UNIFORM = 297,
|
||||
PATCH = 298,
|
||||
SAMPLE = 299,
|
||||
BUFFER = 300,
|
||||
SHARED = 301,
|
||||
COHERENT = 302,
|
||||
VOLATILE = 303,
|
||||
RESTRICT = 304,
|
||||
READONLY = 305,
|
||||
WRITEONLY = 306,
|
||||
DVEC2 = 307,
|
||||
DVEC3 = 308,
|
||||
DVEC4 = 309,
|
||||
DMAT2 = 310,
|
||||
DMAT3 = 311,
|
||||
DMAT4 = 312,
|
||||
NOPERSPECTIVE = 313,
|
||||
FLAT = 314,
|
||||
SMOOTH = 315,
|
||||
LAYOUT = 316,
|
||||
MAT2X2 = 317,
|
||||
MAT2X3 = 318,
|
||||
MAT2X4 = 319,
|
||||
MAT3X2 = 320,
|
||||
MAT3X3 = 321,
|
||||
MAT3X4 = 322,
|
||||
MAT4X2 = 323,
|
||||
MAT4X3 = 324,
|
||||
MAT4X4 = 325,
|
||||
DMAT2X2 = 326,
|
||||
DMAT2X3 = 327,
|
||||
DMAT2X4 = 328,
|
||||
DMAT3X2 = 329,
|
||||
DMAT3X3 = 330,
|
||||
DMAT3X4 = 331,
|
||||
DMAT4X2 = 332,
|
||||
DMAT4X3 = 333,
|
||||
DMAT4X4 = 334,
|
||||
ATOMIC_UINT = 335,
|
||||
SAMPLER1D = 336,
|
||||
SAMPLER2D = 337,
|
||||
SAMPLER3D = 338,
|
||||
SAMPLERCUBE = 339,
|
||||
SAMPLER1DSHADOW = 340,
|
||||
SAMPLER2DSHADOW = 341,
|
||||
SAMPLERCUBESHADOW = 342,
|
||||
SAMPLER1DARRAY = 343,
|
||||
SAMPLER2DARRAY = 344,
|
||||
SAMPLER1DARRAYSHADOW = 345,
|
||||
SAMPLER2DARRAYSHADOW = 346,
|
||||
ISAMPLER1D = 347,
|
||||
ISAMPLER2D = 348,
|
||||
ISAMPLER3D = 349,
|
||||
ISAMPLERCUBE = 350,
|
||||
ISAMPLER1DARRAY = 351,
|
||||
ISAMPLER2DARRAY = 352,
|
||||
USAMPLER1D = 353,
|
||||
USAMPLER2D = 354,
|
||||
USAMPLER3D = 355,
|
||||
USAMPLERCUBE = 356,
|
||||
USAMPLER1DARRAY = 357,
|
||||
USAMPLER2DARRAY = 358,
|
||||
SAMPLER2DRECT = 359,
|
||||
SAMPLER2DRECTSHADOW = 360,
|
||||
ISAMPLER2DRECT = 361,
|
||||
USAMPLER2DRECT = 362,
|
||||
SAMPLERBUFFER = 363,
|
||||
ISAMPLERBUFFER = 364,
|
||||
USAMPLERBUFFER = 365,
|
||||
SAMPLERCUBEARRAY = 366,
|
||||
SAMPLERCUBEARRAYSHADOW = 367,
|
||||
ISAMPLERCUBEARRAY = 368,
|
||||
USAMPLERCUBEARRAY = 369,
|
||||
SAMPLER2DMS = 370,
|
||||
ISAMPLER2DMS = 371,
|
||||
USAMPLER2DMS = 372,
|
||||
SAMPLER2DMSARRAY = 373,
|
||||
ISAMPLER2DMSARRAY = 374,
|
||||
USAMPLER2DMSARRAY = 375,
|
||||
SAMPLEREXTERNALOES = 376,
|
||||
SAMPLER = 377,
|
||||
SAMPLERSHADOW = 378,
|
||||
TEXTURE1D = 379,
|
||||
TEXTURE2D = 380,
|
||||
TEXTURE3D = 381,
|
||||
TEXTURECUBE = 382,
|
||||
TEXTURE1DARRAY = 383,
|
||||
TEXTURE2DARRAY = 384,
|
||||
ITEXTURE1D = 385,
|
||||
ITEXTURE2D = 386,
|
||||
ITEXTURE3D = 387,
|
||||
ITEXTURECUBE = 388,
|
||||
ITEXTURE1DARRAY = 389,
|
||||
ITEXTURE2DARRAY = 390,
|
||||
UTEXTURE1D = 391,
|
||||
UTEXTURE2D = 392,
|
||||
UTEXTURE3D = 393,
|
||||
UTEXTURECUBE = 394,
|
||||
UTEXTURE1DARRAY = 395,
|
||||
UTEXTURE2DARRAY = 396,
|
||||
TEXTURE2DRECT = 397,
|
||||
ITEXTURE2DRECT = 398,
|
||||
UTEXTURE2DRECT = 399,
|
||||
TEXTUREBUFFER = 400,
|
||||
ITEXTUREBUFFER = 401,
|
||||
UTEXTUREBUFFER = 402,
|
||||
TEXTURECUBEARRAY = 403,
|
||||
ITEXTURECUBEARRAY = 404,
|
||||
UTEXTURECUBEARRAY = 405,
|
||||
TEXTURE2DMS = 406,
|
||||
ITEXTURE2DMS = 407,
|
||||
UTEXTURE2DMS = 408,
|
||||
TEXTURE2DMSARRAY = 409,
|
||||
ITEXTURE2DMSARRAY = 410,
|
||||
UTEXTURE2DMSARRAY = 411,
|
||||
SUBPASSINPUT = 412,
|
||||
SUBPASSINPUTMS = 413,
|
||||
ISUBPASSINPUT = 414,
|
||||
ISUBPASSINPUTMS = 415,
|
||||
USUBPASSINPUT = 416,
|
||||
USUBPASSINPUTMS = 417,
|
||||
IMAGE1D = 418,
|
||||
IIMAGE1D = 419,
|
||||
UIMAGE1D = 420,
|
||||
IMAGE2D = 421,
|
||||
IIMAGE2D = 422,
|
||||
UIMAGE2D = 423,
|
||||
IMAGE3D = 424,
|
||||
IIMAGE3D = 425,
|
||||
UIMAGE3D = 426,
|
||||
IMAGE2DRECT = 427,
|
||||
IIMAGE2DRECT = 428,
|
||||
UIMAGE2DRECT = 429,
|
||||
IMAGECUBE = 430,
|
||||
IIMAGECUBE = 431,
|
||||
UIMAGECUBE = 432,
|
||||
IMAGEBUFFER = 433,
|
||||
IIMAGEBUFFER = 434,
|
||||
UIMAGEBUFFER = 435,
|
||||
IMAGE1DARRAY = 436,
|
||||
IIMAGE1DARRAY = 437,
|
||||
UIMAGE1DARRAY = 438,
|
||||
IMAGE2DARRAY = 439,
|
||||
IIMAGE2DARRAY = 440,
|
||||
UIMAGE2DARRAY = 441,
|
||||
IMAGECUBEARRAY = 442,
|
||||
IIMAGECUBEARRAY = 443,
|
||||
UIMAGECUBEARRAY = 444,
|
||||
IMAGE2DMS = 445,
|
||||
IIMAGE2DMS = 446,
|
||||
UIMAGE2DMS = 447,
|
||||
IMAGE2DMSARRAY = 448,
|
||||
IIMAGE2DMSARRAY = 449,
|
||||
UIMAGE2DMSARRAY = 450,
|
||||
STRUCT = 451,
|
||||
VOID = 452,
|
||||
WHILE = 453,
|
||||
IDENTIFIER = 454,
|
||||
TYPE_NAME = 455,
|
||||
FLOATCONSTANT = 456,
|
||||
DOUBLECONSTANT = 457,
|
||||
INTCONSTANT = 458,
|
||||
UINTCONSTANT = 459,
|
||||
BOOLCONSTANT = 460,
|
||||
LEFT_OP = 461,
|
||||
RIGHT_OP = 462,
|
||||
INC_OP = 463,
|
||||
DEC_OP = 464,
|
||||
LE_OP = 465,
|
||||
GE_OP = 466,
|
||||
EQ_OP = 467,
|
||||
NE_OP = 468,
|
||||
AND_OP = 469,
|
||||
OR_OP = 470,
|
||||
XOR_OP = 471,
|
||||
MUL_ASSIGN = 472,
|
||||
DIV_ASSIGN = 473,
|
||||
ADD_ASSIGN = 474,
|
||||
MOD_ASSIGN = 475,
|
||||
LEFT_ASSIGN = 476,
|
||||
RIGHT_ASSIGN = 477,
|
||||
AND_ASSIGN = 478,
|
||||
XOR_ASSIGN = 479,
|
||||
OR_ASSIGN = 480,
|
||||
SUB_ASSIGN = 481,
|
||||
LEFT_PAREN = 482,
|
||||
RIGHT_PAREN = 483,
|
||||
LEFT_BRACKET = 484,
|
||||
RIGHT_BRACKET = 485,
|
||||
LEFT_BRACE = 486,
|
||||
RIGHT_BRACE = 487,
|
||||
DOT = 488,
|
||||
COMMA = 489,
|
||||
COLON = 490,
|
||||
EQUAL = 491,
|
||||
SEMICOLON = 492,
|
||||
BANG = 493,
|
||||
DASH = 494,
|
||||
TILDE = 495,
|
||||
PLUS = 496,
|
||||
STAR = 497,
|
||||
SLASH = 498,
|
||||
PERCENT = 499,
|
||||
LEFT_ANGLE = 500,
|
||||
RIGHT_ANGLE = 501,
|
||||
VERTICAL_BAR = 502,
|
||||
CARET = 503,
|
||||
AMPERSAND = 504,
|
||||
QUESTION = 505,
|
||||
INVARIANT = 506,
|
||||
PRECISE = 507,
|
||||
HIGH_PRECISION = 508,
|
||||
MEDIUM_PRECISION = 509,
|
||||
LOW_PRECISION = 510,
|
||||
PRECISION = 511,
|
||||
PACKED = 512,
|
||||
RESOURCE = 513,
|
||||
SUPERP = 514
|
||||
INT64_T = 266,
|
||||
UINT64_T = 267,
|
||||
BREAK = 268,
|
||||
CONTINUE = 269,
|
||||
DO = 270,
|
||||
ELSE = 271,
|
||||
FOR = 272,
|
||||
IF = 273,
|
||||
DISCARD = 274,
|
||||
RETURN = 275,
|
||||
SWITCH = 276,
|
||||
CASE = 277,
|
||||
DEFAULT = 278,
|
||||
SUBROUTINE = 279,
|
||||
BVEC2 = 280,
|
||||
BVEC3 = 281,
|
||||
BVEC4 = 282,
|
||||
IVEC2 = 283,
|
||||
IVEC3 = 284,
|
||||
IVEC4 = 285,
|
||||
I64VEC2 = 286,
|
||||
I64VEC3 = 287,
|
||||
I64VEC4 = 288,
|
||||
UVEC2 = 289,
|
||||
UVEC3 = 290,
|
||||
UVEC4 = 291,
|
||||
U64VEC2 = 292,
|
||||
U64VEC3 = 293,
|
||||
U64VEC4 = 294,
|
||||
VEC2 = 295,
|
||||
VEC3 = 296,
|
||||
VEC4 = 297,
|
||||
MAT2 = 298,
|
||||
MAT3 = 299,
|
||||
MAT4 = 300,
|
||||
CENTROID = 301,
|
||||
IN = 302,
|
||||
OUT = 303,
|
||||
INOUT = 304,
|
||||
UNIFORM = 305,
|
||||
PATCH = 306,
|
||||
SAMPLE = 307,
|
||||
BUFFER = 308,
|
||||
SHARED = 309,
|
||||
COHERENT = 310,
|
||||
VOLATILE = 311,
|
||||
RESTRICT = 312,
|
||||
READONLY = 313,
|
||||
WRITEONLY = 314,
|
||||
DVEC2 = 315,
|
||||
DVEC3 = 316,
|
||||
DVEC4 = 317,
|
||||
DMAT2 = 318,
|
||||
DMAT3 = 319,
|
||||
DMAT4 = 320,
|
||||
NOPERSPECTIVE = 321,
|
||||
FLAT = 322,
|
||||
SMOOTH = 323,
|
||||
LAYOUT = 324,
|
||||
MAT2X2 = 325,
|
||||
MAT2X3 = 326,
|
||||
MAT2X4 = 327,
|
||||
MAT3X2 = 328,
|
||||
MAT3X3 = 329,
|
||||
MAT3X4 = 330,
|
||||
MAT4X2 = 331,
|
||||
MAT4X3 = 332,
|
||||
MAT4X4 = 333,
|
||||
DMAT2X2 = 334,
|
||||
DMAT2X3 = 335,
|
||||
DMAT2X4 = 336,
|
||||
DMAT3X2 = 337,
|
||||
DMAT3X3 = 338,
|
||||
DMAT3X4 = 339,
|
||||
DMAT4X2 = 340,
|
||||
DMAT4X3 = 341,
|
||||
DMAT4X4 = 342,
|
||||
ATOMIC_UINT = 343,
|
||||
SAMPLER1D = 344,
|
||||
SAMPLER2D = 345,
|
||||
SAMPLER3D = 346,
|
||||
SAMPLERCUBE = 347,
|
||||
SAMPLER1DSHADOW = 348,
|
||||
SAMPLER2DSHADOW = 349,
|
||||
SAMPLERCUBESHADOW = 350,
|
||||
SAMPLER1DARRAY = 351,
|
||||
SAMPLER2DARRAY = 352,
|
||||
SAMPLER1DARRAYSHADOW = 353,
|
||||
SAMPLER2DARRAYSHADOW = 354,
|
||||
ISAMPLER1D = 355,
|
||||
ISAMPLER2D = 356,
|
||||
ISAMPLER3D = 357,
|
||||
ISAMPLERCUBE = 358,
|
||||
ISAMPLER1DARRAY = 359,
|
||||
ISAMPLER2DARRAY = 360,
|
||||
USAMPLER1D = 361,
|
||||
USAMPLER2D = 362,
|
||||
USAMPLER3D = 363,
|
||||
USAMPLERCUBE = 364,
|
||||
USAMPLER1DARRAY = 365,
|
||||
USAMPLER2DARRAY = 366,
|
||||
SAMPLER2DRECT = 367,
|
||||
SAMPLER2DRECTSHADOW = 368,
|
||||
ISAMPLER2DRECT = 369,
|
||||
USAMPLER2DRECT = 370,
|
||||
SAMPLERBUFFER = 371,
|
||||
ISAMPLERBUFFER = 372,
|
||||
USAMPLERBUFFER = 373,
|
||||
SAMPLERCUBEARRAY = 374,
|
||||
SAMPLERCUBEARRAYSHADOW = 375,
|
||||
ISAMPLERCUBEARRAY = 376,
|
||||
USAMPLERCUBEARRAY = 377,
|
||||
SAMPLER2DMS = 378,
|
||||
ISAMPLER2DMS = 379,
|
||||
USAMPLER2DMS = 380,
|
||||
SAMPLER2DMSARRAY = 381,
|
||||
ISAMPLER2DMSARRAY = 382,
|
||||
USAMPLER2DMSARRAY = 383,
|
||||
SAMPLEREXTERNALOES = 384,
|
||||
SAMPLER = 385,
|
||||
SAMPLERSHADOW = 386,
|
||||
TEXTURE1D = 387,
|
||||
TEXTURE2D = 388,
|
||||
TEXTURE3D = 389,
|
||||
TEXTURECUBE = 390,
|
||||
TEXTURE1DARRAY = 391,
|
||||
TEXTURE2DARRAY = 392,
|
||||
ITEXTURE1D = 393,
|
||||
ITEXTURE2D = 394,
|
||||
ITEXTURE3D = 395,
|
||||
ITEXTURECUBE = 396,
|
||||
ITEXTURE1DARRAY = 397,
|
||||
ITEXTURE2DARRAY = 398,
|
||||
UTEXTURE1D = 399,
|
||||
UTEXTURE2D = 400,
|
||||
UTEXTURE3D = 401,
|
||||
UTEXTURECUBE = 402,
|
||||
UTEXTURE1DARRAY = 403,
|
||||
UTEXTURE2DARRAY = 404,
|
||||
TEXTURE2DRECT = 405,
|
||||
ITEXTURE2DRECT = 406,
|
||||
UTEXTURE2DRECT = 407,
|
||||
TEXTUREBUFFER = 408,
|
||||
ITEXTUREBUFFER = 409,
|
||||
UTEXTUREBUFFER = 410,
|
||||
TEXTURECUBEARRAY = 411,
|
||||
ITEXTURECUBEARRAY = 412,
|
||||
UTEXTURECUBEARRAY = 413,
|
||||
TEXTURE2DMS = 414,
|
||||
ITEXTURE2DMS = 415,
|
||||
UTEXTURE2DMS = 416,
|
||||
TEXTURE2DMSARRAY = 417,
|
||||
ITEXTURE2DMSARRAY = 418,
|
||||
UTEXTURE2DMSARRAY = 419,
|
||||
SUBPASSINPUT = 420,
|
||||
SUBPASSINPUTMS = 421,
|
||||
ISUBPASSINPUT = 422,
|
||||
ISUBPASSINPUTMS = 423,
|
||||
USUBPASSINPUT = 424,
|
||||
USUBPASSINPUTMS = 425,
|
||||
IMAGE1D = 426,
|
||||
IIMAGE1D = 427,
|
||||
UIMAGE1D = 428,
|
||||
IMAGE2D = 429,
|
||||
IIMAGE2D = 430,
|
||||
UIMAGE2D = 431,
|
||||
IMAGE3D = 432,
|
||||
IIMAGE3D = 433,
|
||||
UIMAGE3D = 434,
|
||||
IMAGE2DRECT = 435,
|
||||
IIMAGE2DRECT = 436,
|
||||
UIMAGE2DRECT = 437,
|
||||
IMAGECUBE = 438,
|
||||
IIMAGECUBE = 439,
|
||||
UIMAGECUBE = 440,
|
||||
IMAGEBUFFER = 441,
|
||||
IIMAGEBUFFER = 442,
|
||||
UIMAGEBUFFER = 443,
|
||||
IMAGE1DARRAY = 444,
|
||||
IIMAGE1DARRAY = 445,
|
||||
UIMAGE1DARRAY = 446,
|
||||
IMAGE2DARRAY = 447,
|
||||
IIMAGE2DARRAY = 448,
|
||||
UIMAGE2DARRAY = 449,
|
||||
IMAGECUBEARRAY = 450,
|
||||
IIMAGECUBEARRAY = 451,
|
||||
UIMAGECUBEARRAY = 452,
|
||||
IMAGE2DMS = 453,
|
||||
IIMAGE2DMS = 454,
|
||||
UIMAGE2DMS = 455,
|
||||
IMAGE2DMSARRAY = 456,
|
||||
IIMAGE2DMSARRAY = 457,
|
||||
UIMAGE2DMSARRAY = 458,
|
||||
STRUCT = 459,
|
||||
VOID = 460,
|
||||
WHILE = 461,
|
||||
IDENTIFIER = 462,
|
||||
TYPE_NAME = 463,
|
||||
FLOATCONSTANT = 464,
|
||||
DOUBLECONSTANT = 465,
|
||||
INTCONSTANT = 466,
|
||||
UINTCONSTANT = 467,
|
||||
INT64CONSTANT = 468,
|
||||
UINT64CONSTANT = 469,
|
||||
BOOLCONSTANT = 470,
|
||||
LEFT_OP = 471,
|
||||
RIGHT_OP = 472,
|
||||
INC_OP = 473,
|
||||
DEC_OP = 474,
|
||||
LE_OP = 475,
|
||||
GE_OP = 476,
|
||||
EQ_OP = 477,
|
||||
NE_OP = 478,
|
||||
AND_OP = 479,
|
||||
OR_OP = 480,
|
||||
XOR_OP = 481,
|
||||
MUL_ASSIGN = 482,
|
||||
DIV_ASSIGN = 483,
|
||||
ADD_ASSIGN = 484,
|
||||
MOD_ASSIGN = 485,
|
||||
LEFT_ASSIGN = 486,
|
||||
RIGHT_ASSIGN = 487,
|
||||
AND_ASSIGN = 488,
|
||||
XOR_ASSIGN = 489,
|
||||
OR_ASSIGN = 490,
|
||||
SUB_ASSIGN = 491,
|
||||
LEFT_PAREN = 492,
|
||||
RIGHT_PAREN = 493,
|
||||
LEFT_BRACKET = 494,
|
||||
RIGHT_BRACKET = 495,
|
||||
LEFT_BRACE = 496,
|
||||
RIGHT_BRACE = 497,
|
||||
DOT = 498,
|
||||
COMMA = 499,
|
||||
COLON = 500,
|
||||
EQUAL = 501,
|
||||
SEMICOLON = 502,
|
||||
BANG = 503,
|
||||
DASH = 504,
|
||||
TILDE = 505,
|
||||
PLUS = 506,
|
||||
STAR = 507,
|
||||
SLASH = 508,
|
||||
PERCENT = 509,
|
||||
LEFT_ANGLE = 510,
|
||||
RIGHT_ANGLE = 511,
|
||||
VERTICAL_BAR = 512,
|
||||
CARET = 513,
|
||||
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
|
||||
|
||||
@ -311,7 +321,7 @@ extern int yydebug;
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 2058 of yacc.c */
|
||||
#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y"
|
||||
#line 66 "glslang.y"
|
||||
|
||||
struct {
|
||||
glslang::TSourceLoc loc;
|
||||
@ -319,6 +329,8 @@ typedef union YYSTYPE
|
||||
glslang::TString *string;
|
||||
int i;
|
||||
unsigned int u;
|
||||
long long i64;
|
||||
unsigned long long u64;
|
||||
bool b;
|
||||
double d;
|
||||
};
|
||||
@ -345,7 +357,7 @@ typedef union YYSTYPE
|
||||
|
||||
|
||||
/* Line 2058 of yacc.c */
|
||||
#line 349 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp.h"
|
||||
#line 361 "glslang_tab.cpp.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
@ -367,4 +379,4 @@ int yyparse ();
|
||||
#endif
|
||||
#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 EOpConvFloatToBool: out.debug << "Convert float to bool"; break;
|
||||
case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break;
|
||||
case EOpConvInt64ToBool: out.debug << "Convert int64 to bool"; break;
|
||||
case EOpConvUint64ToBool: out.debug << "Convert uint64 to bool"; break;
|
||||
case EOpConvIntToFloat: out.debug << "Convert int to float"; break;
|
||||
case EOpConvUintToFloat: out.debug << "Convert uint to float"; break;
|
||||
case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break;
|
||||
case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break;
|
||||
case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break;
|
||||
case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break;
|
||||
case EOpConvUintToInt: out.debug << "Convert uint to int"; break;
|
||||
case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
|
||||
case EOpConvDoubleToInt: out.debug << "Convert double to int"; break;
|
||||
case EOpConvBoolToInt: out.debug << "Convert bool to int"; break;
|
||||
case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break;
|
||||
case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break;
|
||||
case EOpConvIntToUint: out.debug << "Convert int to uint"; break;
|
||||
case EOpConvFloatToUint: out.debug << "Convert float to uint"; break;
|
||||
case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break;
|
||||
case 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 EOpConvUintToDouble: out.debug << "Convert uint to double"; break;
|
||||
case EOpConvFloatToDouble: out.debug << "Convert float to double"; break;
|
||||
case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break;
|
||||
case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break;
|
||||
case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break;
|
||||
case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break;
|
||||
case EOpConvIntToInt64: out.debug << "Convert int to int64"; break;
|
||||
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 EOpDegrees: out.debug << "degrees"; break;
|
||||
@ -261,6 +283,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpFloatBitsToUint:out.debug << "floatBitsToUint"; break;
|
||||
case EOpIntBitsToFloat: out.debug << "intBitsToFloat"; 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 EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; 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 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 EOpNormalize: out.debug << "normalize"; 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 EOpConstructUVec3: out.debug << "Construct uvec3"; 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 EOpConstructMat2x3: out.debug << "Construct mat2x3"; 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";
|
||||
}
|
||||
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:
|
||||
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
|
||||
break;
|
||||
|
@ -880,6 +880,8 @@ const int baseAlignmentVec4Std140 = 16;
|
||||
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||
{
|
||||
switch (type.getBasicType()) {
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
case EbtDouble: size = 8; return 8;
|
||||
default: size = 4; return 4;
|
||||
}
|
||||
|
@ -191,6 +191,8 @@ public:
|
||||
TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) 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 fullIntegerCheck(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 vulkanRemoved(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;
|
||||
|
||||
while (token != '\n' && token != EndOfInput) {
|
||||
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
||||
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
||||
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
|
||||
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
||||
message.append(ppToken->name);
|
||||
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
|
||||
@ -736,6 +737,8 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
|
||||
case PpAtomIdentifier:
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstDouble:
|
||||
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
|
||||
int ival;
|
||||
double dval;
|
||||
long long i64val;
|
||||
int atom;
|
||||
char name[MaxTokenLength + 1];
|
||||
};
|
||||
|
@ -238,9 +238,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
int len = 0;
|
||||
int ch = 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->i64val = 0;
|
||||
ppToken->space = false;
|
||||
ch = getch();
|
||||
for (;;) {
|
||||
@ -299,6 +301,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
// must be hexidecimal
|
||||
|
||||
bool isUnsigned = false;
|
||||
bool isInt64 = false;
|
||||
ppToken->name[len++] = (char)ch;
|
||||
ch = getch();
|
||||
if ((ch >= '0' && ch <= '9') ||
|
||||
@ -307,7 +310,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
|
||||
ival = 0;
|
||||
do {
|
||||
if (ival <= 0x0fffffff) {
|
||||
if (ival <= 0x0fffffff || (enableInt64 && ival <= 0x0fffffffffffffffull)) {
|
||||
ppToken->name[len++] = (char)ch;
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
ii = ch - '0';
|
||||
@ -323,7 +326,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
pp->parseContext.ppError(ppToken->loc, "hexidecimal literal too big", "", "");
|
||||
AlreadyComplained = 1;
|
||||
}
|
||||
ival = 0xffffffff;
|
||||
ival = 0xffffffffffffffffull;
|
||||
}
|
||||
ch = getch();
|
||||
} while ((ch >= '0' && ch <= '9') ||
|
||||
@ -336,19 +339,37 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
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
|
||||
ungetch();
|
||||
ppToken->name[len] = '\0';
|
||||
ppToken->ival = (int)ival;
|
||||
|
||||
if (isUnsigned)
|
||||
return PpAtomConstUint;
|
||||
else
|
||||
return PpAtomConstInt;
|
||||
if (isInt64) {
|
||||
ppToken->i64val = ival;
|
||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||
} else {
|
||||
ppToken->ival = (int)ival;
|
||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||
}
|
||||
} else {
|
||||
// could be octal integer or floating point, speculative pursue octal until it must be floating point
|
||||
|
||||
bool isUnsigned = false;
|
||||
bool isInt64 = false;
|
||||
bool octalOverflow = false;
|
||||
bool nonOctal = false;
|
||||
ival = 0;
|
||||
@ -361,7 +382,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||
AlreadyComplained = 1;
|
||||
}
|
||||
if (ival <= 0x1fffffff) {
|
||||
if (ival <= 0x1fffffff || (enableInt64 && ival <= 0x1fffffffffffffffull)) {
|
||||
ii = ch - '0';
|
||||
ival = (ival << 3) | ii;
|
||||
} else
|
||||
@ -382,7 +403,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
ch = getch();
|
||||
} 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);
|
||||
|
||||
// wasn't a float, so must be octal...
|
||||
@ -393,6 +414,21 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
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
|
||||
ungetch();
|
||||
ppToken->name[len] = '\0';
|
||||
@ -400,12 +436,13 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
if (octalOverflow)
|
||||
pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", "");
|
||||
|
||||
ppToken->ival = (int)ival;
|
||||
|
||||
if (isUnsigned)
|
||||
return PpAtomConstUint;
|
||||
else
|
||||
return PpAtomConstInt;
|
||||
if (isInt64) {
|
||||
ppToken->i64val = ival;
|
||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||
} else {
|
||||
ppToken->ival = (int)ival;
|
||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '1': case '2': case '3': case '4':
|
||||
@ -421,16 +458,31 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
}
|
||||
ch = getch();
|
||||
} 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);
|
||||
} else {
|
||||
// Finish handling signed and unsigned integers
|
||||
int numericLen = len;
|
||||
bool uint = false;
|
||||
bool isUnsigned = false;
|
||||
bool isInt64 = false;
|
||||
if (ch == 'u' || ch == 'U') {
|
||||
if (len < MaxTokenLength)
|
||||
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
|
||||
ungetch();
|
||||
|
||||
@ -438,21 +490,26 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
ival = 0;
|
||||
const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10;
|
||||
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++) {
|
||||
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", "", "");
|
||||
ival = 0xFFFFFFFFu;
|
||||
ival = 0xFFFFFFFFFFFFFFFFull;
|
||||
break;
|
||||
} else
|
||||
ival = ival * 10 + ch;
|
||||
}
|
||||
ppToken->ival = (int)ival;
|
||||
|
||||
if (uint)
|
||||
return PpAtomConstUint;
|
||||
else
|
||||
return PpAtomConstInt;
|
||||
if (isInt64) {
|
||||
ppToken->i64val = ival;
|
||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||
} else {
|
||||
ppToken->ival = (int)ival;
|
||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
@ -686,6 +743,8 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
case PpAtomConstDouble:
|
||||
tokenString = ppToken->name;
|
||||
break;
|
||||
|
@ -141,6 +141,8 @@ void TPpContext::RecordToken(TokenStream *pTok, int token, TPpToken* ppToken)
|
||||
break;
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstDouble:
|
||||
str = ppToken->name;
|
||||
@ -193,6 +195,8 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
||||
case PpAtomConstDouble:
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
len = 0;
|
||||
ch = lReadByte(pTok);
|
||||
while (ch != 0 && ch != EndOfInput) {
|
||||
@ -227,6 +231,16 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
||||
} else
|
||||
ppToken->ival = atoi(ppToken->name);
|
||||
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,
|
||||
PpAtomConstUint,
|
||||
PpAtomConstInt64,
|
||||
PpAtomConstUint64,
|
||||
PpAtomConstFloat,
|
||||
PpAtomConstDouble,
|
||||
PpAtomConstString,
|
||||
|
@ -540,6 +540,8 @@ public:
|
||||
case EbtDouble: return GL_DOUBLE_VEC2 + offset;
|
||||
case EbtInt: return GL_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 EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER + offset;
|
||||
default: return 0;
|
||||
@ -605,6 +607,8 @@ public:
|
||||
case EbtDouble: return GL_DOUBLE;
|
||||
case EbtInt: return GL_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 EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER;
|
||||
default: return 0;
|
||||
|
@ -119,6 +119,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"spv.functionCall.frag",
|
||||
"spv.functionSemantics.frag",
|
||||
"spv.interpOps.frag",
|
||||
"spv.int64.frag",
|
||||
"spv.layoutNested.vert",
|
||||
"spv.length.frag",
|
||||
"spv.localAggregates.frag",
|
||||
|
Loading…
x
Reference in New Issue
Block a user