Implement extension GL_AMD_gpu_shader_int16
- Add int16 types (int16_t, uint16_t, i16vec, u16vec). - Add int16 support to GLSL operators. - Add int16 type conversions (to int16, from int16). - Add int16 built-in functions.
This commit is contained in:
parent
4d5bcd3162
commit
cabbb788b4
@ -33,7 +33,7 @@ enum Decoration;
|
|||||||
enum Op;
|
enum Op;
|
||||||
|
|
||||||
static const int GLSLextAMDVersion = 100;
|
static const int GLSLextAMDVersion = 100;
|
||||||
static const int GLSLextAMDRevision = 3;
|
static const int GLSLextAMDRevision = 4;
|
||||||
|
|
||||||
// SPV_AMD_shader_ballot
|
// SPV_AMD_shader_ballot
|
||||||
static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot";
|
static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot";
|
||||||
@ -119,4 +119,7 @@ static const char* const E_SPV_AMD_texture_gather_bias_lod = "SPV_AMD_texture_ga
|
|||||||
|
|
||||||
static const Capability OpCapabilityImageGatherBiasLodAMD = static_cast<Capability>(5009);
|
static const Capability OpCapabilityImageGatherBiasLodAMD = static_cast<Capability>(5009);
|
||||||
|
|
||||||
|
// SPV_AMD_gpu_shader_int16
|
||||||
|
static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16";
|
||||||
|
|
||||||
#endif // #ifndef GLSLextAMD_H
|
#endif // #ifndef GLSLextAMD_H
|
||||||
|
@ -1369,6 +1369,10 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
|||||||
#endif
|
#endif
|
||||||
else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64)
|
else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64)
|
||||||
one = builder.makeInt64Constant(1);
|
one = builder.makeInt64Constant(1);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (node->getBasicType() == glslang::EbtInt16 || node->getBasicType() == glslang::EbtUint16)
|
||||||
|
one = builder.makeInt16Constant(1);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
one = builder.makeIntConstant(1);
|
one = builder.makeIntConstant(1);
|
||||||
glslang::TOperator op;
|
glslang::TOperator op;
|
||||||
@ -1616,6 +1620,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|||||||
case glslang::EOpConstructU64Vec2:
|
case glslang::EOpConstructU64Vec2:
|
||||||
case glslang::EOpConstructU64Vec3:
|
case glslang::EOpConstructU64Vec3:
|
||||||
case glslang::EOpConstructU64Vec4:
|
case glslang::EOpConstructU64Vec4:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConstructInt16:
|
||||||
|
case glslang::EOpConstructI16Vec2:
|
||||||
|
case glslang::EOpConstructI16Vec3:
|
||||||
|
case glslang::EOpConstructI16Vec4:
|
||||||
|
case glslang::EOpConstructUint16:
|
||||||
|
case glslang::EOpConstructU16Vec2:
|
||||||
|
case glslang::EOpConstructU16Vec3:
|
||||||
|
case glslang::EOpConstructU16Vec4:
|
||||||
|
#endif
|
||||||
case glslang::EOpConstructStruct:
|
case glslang::EOpConstructStruct:
|
||||||
case glslang::EOpConstructTextureSampler:
|
case glslang::EOpConstructTextureSampler:
|
||||||
{
|
{
|
||||||
@ -2149,7 +2163,9 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
|
|||||||
spv::Id spvType = convertGlslangToSpvType(node->getType());
|
spv::Id spvType = convertGlslangToSpvType(node->getType());
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16);
|
const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16) ||
|
||||||
|
node->getType().containsBasicType(glslang::EbtInt16) ||
|
||||||
|
node->getType().containsBasicType(glslang::EbtUint16);
|
||||||
if (contains16BitType) {
|
if (contains16BitType) {
|
||||||
if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) {
|
if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) {
|
||||||
builder.addExtension(spv::E_SPV_KHR_16bit_storage);
|
builder.addExtension(spv::E_SPV_KHR_16bit_storage);
|
||||||
@ -2262,13 +2278,21 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
|||||||
spvType = builder.makeUintType(32);
|
spvType = builder.makeUintType(32);
|
||||||
break;
|
break;
|
||||||
case glslang::EbtInt64:
|
case glslang::EbtInt64:
|
||||||
builder.addCapability(spv::CapabilityInt64);
|
|
||||||
spvType = builder.makeIntType(64);
|
spvType = builder.makeIntType(64);
|
||||||
break;
|
break;
|
||||||
case glslang::EbtUint64:
|
case glslang::EbtUint64:
|
||||||
builder.addCapability(spv::CapabilityInt64);
|
|
||||||
spvType = builder.makeUintType(64);
|
spvType = builder.makeUintType(64);
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EbtInt16:
|
||||||
|
builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16);
|
||||||
|
spvType = builder.makeIntType(16);
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint16:
|
||||||
|
builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16);
|
||||||
|
spvType = builder.makeUintType(16);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case glslang::EbtAtomicUint:
|
case glslang::EbtAtomicUint:
|
||||||
builder.addCapability(spv::CapabilityAtomicStorage);
|
builder.addCapability(spv::CapabilityAtomicStorage);
|
||||||
spvType = builder.makeUintType(32);
|
spvType = builder.makeUintType(32);
|
||||||
@ -3485,10 +3509,11 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
|||||||
spv::Id typeId, spv::Id left, spv::Id right,
|
spv::Id typeId, spv::Id left, spv::Id right,
|
||||||
glslang::TBasicType typeProxy, bool reduceComparison)
|
glslang::TBasicType typeProxy, bool reduceComparison)
|
||||||
{
|
{
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
||||||
#else
|
#else
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
#endif
|
#endif
|
||||||
bool isBool = typeProxy == glslang::EbtBool;
|
bool isBool = typeProxy == glslang::EbtBool;
|
||||||
@ -3815,10 +3840,11 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
spv::Op unaryOp = spv::OpNop;
|
spv::Op unaryOp = spv::OpNop;
|
||||||
int extBuiltins = -1;
|
int extBuiltins = -1;
|
||||||
int libCall = -1;
|
int libCall = -1;
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
||||||
#else
|
#else
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3957,6 +3983,12 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
case glslang::EOpDoubleBitsToUint64:
|
case glslang::EOpDoubleBitsToUint64:
|
||||||
case glslang::EOpInt64BitsToDouble:
|
case glslang::EOpInt64BitsToDouble:
|
||||||
case glslang::EOpUint64BitsToDouble:
|
case glslang::EOpUint64BitsToDouble:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpFloat16BitsToInt16:
|
||||||
|
case glslang::EOpFloat16BitsToUint16:
|
||||||
|
case glslang::EOpInt16BitsToFloat16:
|
||||||
|
case glslang::EOpUint16BitsToFloat16:
|
||||||
|
#endif
|
||||||
unaryOp = spv::OpBitcast;
|
unaryOp = spv::OpBitcast;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4005,6 +4037,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpPackInt2x16:
|
||||||
|
case glslang::EOpUnpackInt2x16:
|
||||||
|
case glslang::EOpPackUint2x16:
|
||||||
|
case glslang::EOpUnpackUint2x16:
|
||||||
|
case glslang::EOpPackInt4x16:
|
||||||
|
case glslang::EOpUnpackInt4x16:
|
||||||
|
case glslang::EOpPackUint4x16:
|
||||||
|
case glslang::EOpUnpackUint4x16:
|
||||||
case glslang::EOpPackFloat2x16:
|
case glslang::EOpPackFloat2x16:
|
||||||
case glslang::EOpUnpackFloat2x16:
|
case glslang::EOpUnpackFloat2x16:
|
||||||
unaryOp = spv::OpBitcast;
|
unaryOp = spv::OpBitcast;
|
||||||
@ -4204,8 +4244,18 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvUintToBool:
|
case glslang::EOpConvUintToBool:
|
||||||
case glslang::EOpConvInt64ToBool:
|
case glslang::EOpConvInt64ToBool:
|
||||||
case glslang::EOpConvUint64ToBool:
|
case glslang::EOpConvUint64ToBool:
|
||||||
zero = (op == glslang::EOpConvInt64ToBool ||
|
#ifdef AMD_EXTENSIONS
|
||||||
op == glslang::EOpConvUint64ToBool) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
case glslang::EOpConvInt16ToBool:
|
||||||
|
case glslang::EOpConvUint16ToBool:
|
||||||
|
#endif
|
||||||
|
if (op == glslang::EOpConvInt64ToBool || op == glslang::EOpConvUint64ToBool)
|
||||||
|
zero = builder.makeUint64Constant(0);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvInt16ToBool || op == glslang::EOpConvUint16ToBool)
|
||||||
|
zero = builder.makeUint16Constant(0);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
zero = builder.makeUintConstant(0);
|
||||||
zero = makeSmearedConstant(zero, vectorSize);
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
||||||
|
|
||||||
@ -4248,15 +4298,53 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
|
|
||||||
case glslang::EOpConvBoolToInt:
|
case glslang::EOpConvBoolToInt:
|
||||||
case glslang::EOpConvBoolToInt64:
|
case glslang::EOpConvBoolToInt64:
|
||||||
zero = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(0) : builder.makeIntConstant(0);
|
#ifdef AMD_EXTENSIONS
|
||||||
one = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(1) : builder.makeIntConstant(1);
|
case glslang::EOpConvBoolToInt16:
|
||||||
|
#endif
|
||||||
|
if (op == glslang::EOpConvBoolToInt64)
|
||||||
|
zero = builder.makeInt64Constant(0);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvBoolToInt16)
|
||||||
|
zero = builder.makeInt16Constant(0);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
zero = builder.makeIntConstant(0);
|
||||||
|
|
||||||
|
if (op == glslang::EOpConvBoolToInt64)
|
||||||
|
one = builder.makeInt64Constant(1);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvBoolToInt16)
|
||||||
|
one = builder.makeInt16Constant(1);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
one = builder.makeIntConstant(1);
|
||||||
|
|
||||||
convOp = spv::OpSelect;
|
convOp = spv::OpSelect;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case glslang::EOpConvBoolToUint:
|
case glslang::EOpConvBoolToUint:
|
||||||
case glslang::EOpConvBoolToUint64:
|
case glslang::EOpConvBoolToUint64:
|
||||||
zero = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
#ifdef AMD_EXTENSIONS
|
||||||
one = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(1) : builder.makeUintConstant(1);
|
case glslang::EOpConvBoolToUint16:
|
||||||
|
#endif
|
||||||
|
if (op == glslang::EOpConvBoolToUint64)
|
||||||
|
zero = builder.makeUint64Constant(0);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvBoolToUint16)
|
||||||
|
zero = builder.makeUint16Constant(0);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
zero = builder.makeUintConstant(0);
|
||||||
|
|
||||||
|
if (op == glslang::EOpConvBoolToUint64)
|
||||||
|
one = builder.makeUint64Constant(1);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvBoolToUint16)
|
||||||
|
one = builder.makeUint16Constant(1);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
one = builder.makeUintConstant(1);
|
||||||
|
|
||||||
convOp = spv::OpSelect;
|
convOp = spv::OpSelect;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4265,6 +4353,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvInt64ToFloat:
|
case glslang::EOpConvInt64ToFloat:
|
||||||
case glslang::EOpConvInt64ToDouble:
|
case glslang::EOpConvInt64ToDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvInt16ToFloat:
|
||||||
|
case glslang::EOpConvInt16ToDouble:
|
||||||
|
case glslang::EOpConvInt16ToFloat16:
|
||||||
case glslang::EOpConvIntToFloat16:
|
case glslang::EOpConvIntToFloat16:
|
||||||
case glslang::EOpConvInt64ToFloat16:
|
case glslang::EOpConvInt64ToFloat16:
|
||||||
#endif
|
#endif
|
||||||
@ -4276,6 +4367,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvUint64ToFloat:
|
case glslang::EOpConvUint64ToFloat:
|
||||||
case glslang::EOpConvUint64ToDouble:
|
case glslang::EOpConvUint64ToDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUint16ToFloat:
|
||||||
|
case glslang::EOpConvUint16ToDouble:
|
||||||
|
case glslang::EOpConvUint16ToFloat16:
|
||||||
case glslang::EOpConvUintToFloat16:
|
case glslang::EOpConvUintToFloat16:
|
||||||
case glslang::EOpConvUint64ToFloat16:
|
case glslang::EOpConvUint64ToFloat16:
|
||||||
#endif
|
#endif
|
||||||
@ -4300,6 +4394,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvFloatToInt64:
|
case glslang::EOpConvFloatToInt64:
|
||||||
case glslang::EOpConvDoubleToInt64:
|
case glslang::EOpConvDoubleToInt64:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvFloatToInt16:
|
||||||
|
case glslang::EOpConvDoubleToInt16:
|
||||||
|
case glslang::EOpConvFloat16ToInt16:
|
||||||
case glslang::EOpConvFloat16ToInt:
|
case glslang::EOpConvFloat16ToInt:
|
||||||
case glslang::EOpConvFloat16ToInt64:
|
case glslang::EOpConvFloat16ToInt64:
|
||||||
#endif
|
#endif
|
||||||
@ -4310,10 +4407,21 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvIntToUint:
|
case glslang::EOpConvIntToUint:
|
||||||
case glslang::EOpConvUint64ToInt64:
|
case glslang::EOpConvUint64ToInt64:
|
||||||
case glslang::EOpConvInt64ToUint64:
|
case glslang::EOpConvInt64ToUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUint16ToInt16:
|
||||||
|
case glslang::EOpConvInt16ToUint16:
|
||||||
|
#endif
|
||||||
if (builder.isInSpecConstCodeGenMode()) {
|
if (builder.isInSpecConstCodeGenMode()) {
|
||||||
// Build zero scalar or vector for OpIAdd.
|
// Build zero scalar or vector for OpIAdd.
|
||||||
zero = (op == glslang::EOpConvUint64ToInt64 ||
|
if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64)
|
||||||
op == glslang::EOpConvInt64ToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
zero = builder.makeUint64Constant(0);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16)
|
||||||
|
zero = builder.makeUint16Constant(0);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
zero = builder.makeUintConstant(0);
|
||||||
|
|
||||||
zero = makeSmearedConstant(zero, vectorSize);
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
||||||
// generating for OpSpecConstantOp instruction.
|
// generating for OpSpecConstantOp instruction.
|
||||||
@ -4328,6 +4436,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvFloatToUint64:
|
case glslang::EOpConvFloatToUint64:
|
||||||
case glslang::EOpConvDoubleToUint64:
|
case glslang::EOpConvDoubleToUint64:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvFloatToUint16:
|
||||||
|
case glslang::EOpConvDoubleToUint16:
|
||||||
|
case glslang::EOpConvFloat16ToUint16:
|
||||||
case glslang::EOpConvFloat16ToUint:
|
case glslang::EOpConvFloat16ToUint:
|
||||||
case glslang::EOpConvFloat16ToUint64:
|
case glslang::EOpConvFloat16ToUint64:
|
||||||
#endif
|
#endif
|
||||||
@ -4336,11 +4447,23 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
|
|
||||||
case glslang::EOpConvIntToInt64:
|
case glslang::EOpConvIntToInt64:
|
||||||
case glslang::EOpConvInt64ToInt:
|
case glslang::EOpConvInt64ToInt:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvIntToInt16:
|
||||||
|
case glslang::EOpConvInt16ToInt:
|
||||||
|
case glslang::EOpConvInt64ToInt16:
|
||||||
|
case glslang::EOpConvInt16ToInt64:
|
||||||
|
#endif
|
||||||
convOp = spv::OpSConvert;
|
convOp = spv::OpSConvert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case glslang::EOpConvUintToUint64:
|
case glslang::EOpConvUintToUint64:
|
||||||
case glslang::EOpConvUint64ToUint:
|
case glslang::EOpConvUint64ToUint:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUintToUint16:
|
||||||
|
case glslang::EOpConvUint16ToUint:
|
||||||
|
case glslang::EOpConvUint64ToUint16:
|
||||||
|
case glslang::EOpConvUint16ToUint64:
|
||||||
|
#endif
|
||||||
convOp = spv::OpUConvert;
|
convOp = spv::OpUConvert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4348,24 +4471,58 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
case glslang::EOpConvInt64ToUint:
|
case glslang::EOpConvInt64ToUint:
|
||||||
case glslang::EOpConvUint64ToInt:
|
case glslang::EOpConvUint64ToInt:
|
||||||
case glslang::EOpConvUintToInt64:
|
case glslang::EOpConvUintToInt64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvInt16ToUint:
|
||||||
|
case glslang::EOpConvUintToInt16:
|
||||||
|
case glslang::EOpConvInt16ToUint64:
|
||||||
|
case glslang::EOpConvUint64ToInt16:
|
||||||
|
case glslang::EOpConvUint16ToInt:
|
||||||
|
case glslang::EOpConvIntToUint16:
|
||||||
|
case glslang::EOpConvUint16ToInt64:
|
||||||
|
case glslang::EOpConvInt64ToUint16:
|
||||||
|
#endif
|
||||||
// OpSConvert/OpUConvert + OpBitCast
|
// OpSConvert/OpUConvert + OpBitCast
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case glslang::EOpConvIntToUint64:
|
case glslang::EOpConvIntToUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvInt16ToUint64:
|
||||||
|
#endif
|
||||||
convOp = spv::OpSConvert;
|
convOp = spv::OpSConvert;
|
||||||
type = builder.makeIntType(64);
|
type = builder.makeIntType(64);
|
||||||
break;
|
break;
|
||||||
case glslang::EOpConvInt64ToUint:
|
case glslang::EOpConvInt64ToUint:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvInt16ToUint:
|
||||||
|
#endif
|
||||||
convOp = spv::OpSConvert;
|
convOp = spv::OpSConvert;
|
||||||
type = builder.makeIntType(32);
|
type = builder.makeIntType(32);
|
||||||
break;
|
break;
|
||||||
case glslang::EOpConvUint64ToInt:
|
case glslang::EOpConvUint64ToInt:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUint16ToInt:
|
||||||
|
#endif
|
||||||
convOp = spv::OpUConvert;
|
convOp = spv::OpUConvert;
|
||||||
type = builder.makeUintType(32);
|
type = builder.makeUintType(32);
|
||||||
break;
|
break;
|
||||||
case glslang::EOpConvUintToInt64:
|
case glslang::EOpConvUintToInt64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUint16ToInt64:
|
||||||
|
#endif
|
||||||
convOp = spv::OpUConvert;
|
convOp = spv::OpUConvert;
|
||||||
type = builder.makeUintType(64);
|
type = builder.makeUintType(64);
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpConvUintToInt16:
|
||||||
|
case glslang::EOpConvUint64ToInt16:
|
||||||
|
convOp = spv::OpUConvert;
|
||||||
|
type = builder.makeUintType(16);
|
||||||
|
break;
|
||||||
|
case glslang::EOpConvIntToUint16:
|
||||||
|
case glslang::EOpConvInt64ToUint16:
|
||||||
|
convOp = spv::OpSConvert;
|
||||||
|
type = builder.makeIntType(16);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
@ -4378,8 +4535,22 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
|
|||||||
|
|
||||||
if (builder.isInSpecConstCodeGenMode()) {
|
if (builder.isInSpecConstCodeGenMode()) {
|
||||||
// Build zero scalar or vector for OpIAdd.
|
// Build zero scalar or vector for OpIAdd.
|
||||||
zero = (op == glslang::EOpConvIntToUint64 ||
|
#ifdef AMD_EXTENSIONS
|
||||||
op == glslang::EOpConvUintToInt64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
|
if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64 ||
|
||||||
|
op == glslang::EOpConvInt16ToUint64 || op == glslang::EOpConvUint16ToInt64)
|
||||||
|
zero = builder.makeUint64Constant(0);
|
||||||
|
else if (op == glslang::EOpConvIntToUint16 || op == glslang::EOpConvUintToInt16 ||
|
||||||
|
op == glslang::EOpConvInt64ToUint16 || op == glslang::EOpConvUint64ToInt16)
|
||||||
|
zero = builder.makeUint16Constant(0);
|
||||||
|
else
|
||||||
|
zero = builder.makeUintConstant(0);
|
||||||
|
#else
|
||||||
|
if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64)
|
||||||
|
zero = builder.makeUint64Constant(0);
|
||||||
|
else
|
||||||
|
zero = builder.makeUintConstant(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
zero = makeSmearedConstant(zero, vectorSize);
|
zero = makeSmearedConstant(zero, vectorSize);
|
||||||
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
// Use OpIAdd, instead of OpBitcast to do the conversion when
|
||||||
// generating for OpSpecConstantOp instruction.
|
// generating for OpSpecConstantOp instruction.
|
||||||
@ -4765,10 +4936,11 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv
|
|||||||
|
|
||||||
spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
|
spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
|
||||||
{
|
{
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16;
|
||||||
#else
|
#else
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5353,6 +5525,14 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
|||||||
case glslang::EbtUint64:
|
case glslang::EbtUint64:
|
||||||
spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const()));
|
spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const()));
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EbtInt16:
|
||||||
|
spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst()));
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint16:
|
||||||
|
spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst()));
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case glslang::EbtFloat:
|
case glslang::EbtFloat:
|
||||||
spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
||||||
break;
|
break;
|
||||||
@ -5390,6 +5570,14 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
|||||||
case glslang::EbtUint64:
|
case glslang::EbtUint64:
|
||||||
scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant);
|
scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant);
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EbtInt16:
|
||||||
|
scalar = builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst(), specConstant);
|
||||||
|
break;
|
||||||
|
case glslang::EbtUint16:
|
||||||
|
scalar = builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst(), specConstant);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case glslang::EbtFloat:
|
case glslang::EbtFloat:
|
||||||
scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
||||||
break;
|
break;
|
||||||
|
@ -214,6 +214,10 @@ public:
|
|||||||
Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); }
|
Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); }
|
||||||
Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); }
|
Id 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 makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); }
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
Id makeInt16Constant(short i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)((unsigned short)i), specConstant); }
|
||||||
|
Id makeUint16Constant(unsigned short u, bool specConstant = false) { return makeIntConstant(makeUintType(16), (unsigned)u, specConstant); }
|
||||||
|
#endif
|
||||||
Id makeFloatConstant(float f, bool specConstant = false);
|
Id makeFloatConstant(float f, bool specConstant = false);
|
||||||
Id makeDoubleConstant(double d, bool specConstant = false);
|
Id makeDoubleConstant(double d, bool specConstant = false);
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
779
Test/baseResults/spv.int16.frag.out
Normal file
779
Test/baseResults/spv.int16.frag.out
Normal file
@ -0,0 +1,779 @@
|
|||||||
|
spv.int16.frag
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80001
|
||||||
|
// Id's are bound by 561
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
Capability Float16
|
||||||
|
Capability Float64
|
||||||
|
Capability Int64
|
||||||
|
Capability Int16
|
||||||
|
Capability StorageUniform16
|
||||||
|
Capability StorageInputOutput16
|
||||||
|
Extension "SPV_AMD_gpu_shader_half_float"
|
||||||
|
Extension "SPV_AMD_gpu_shader_int16"
|
||||||
|
Extension "SPV_KHR_16bit_storage"
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Fragment 4 "main" 520 522
|
||||||
|
ExecutionMode 4 OriginUpperLeft
|
||||||
|
Source GLSL 450
|
||||||
|
SourceExtension "GL_AMD_gpu_shader_half_float"
|
||||||
|
SourceExtension "GL_AMD_gpu_shader_int16"
|
||||||
|
SourceExtension "GL_ARB_gpu_shader_int64"
|
||||||
|
Name 4 "main"
|
||||||
|
Name 6 "literal("
|
||||||
|
Name 8 "operators("
|
||||||
|
Name 10 "typeCast("
|
||||||
|
Name 12 "builtinFuncs("
|
||||||
|
Name 16 "u16"
|
||||||
|
Name 25 "Uniforms"
|
||||||
|
MemberName 25(Uniforms) 0 "i"
|
||||||
|
Name 27 ""
|
||||||
|
Name 34 "indexable"
|
||||||
|
Name 45 "indexable"
|
||||||
|
Name 51 "u16v"
|
||||||
|
Name 57 "i16"
|
||||||
|
Name 70 "u16"
|
||||||
|
Name 108 "i"
|
||||||
|
Name 130 "b"
|
||||||
|
Name 151 "u"
|
||||||
|
Name 190 "i16v"
|
||||||
|
Name 193 "bv"
|
||||||
|
Name 201 "u16v"
|
||||||
|
Name 214 "iv"
|
||||||
|
Name 227 "uv"
|
||||||
|
Name 241 "fv"
|
||||||
|
Name 253 "dv"
|
||||||
|
Name 265 "f16v"
|
||||||
|
Name 277 "i64v"
|
||||||
|
Name 291 "u64v"
|
||||||
|
Name 306 "i16v"
|
||||||
|
Name 312 "i16"
|
||||||
|
Name 320 "u16v"
|
||||||
|
Name 322 "u16"
|
||||||
|
Name 394 "f16v"
|
||||||
|
Name 397 "exp"
|
||||||
|
Name 398 "ResType"
|
||||||
|
Name 419 "packi"
|
||||||
|
Name 424 "packu"
|
||||||
|
Name 433 "packi64"
|
||||||
|
Name 442 "packu64"
|
||||||
|
Name 451 "bv"
|
||||||
|
Name 516 "Block"
|
||||||
|
MemberName 516(Block) 0 "i16v"
|
||||||
|
MemberName 516(Block) 1 "u16"
|
||||||
|
Name 518 "block"
|
||||||
|
Name 520 "iu16v"
|
||||||
|
Name 522 "ii16"
|
||||||
|
Name 523 "si64"
|
||||||
|
Name 524 "su64"
|
||||||
|
Name 525 "si"
|
||||||
|
Name 526 "su"
|
||||||
|
Name 527 "sb"
|
||||||
|
Name 528 "si16"
|
||||||
|
Name 529 "su16"
|
||||||
|
MemberDecorate 25(Uniforms) 0 Offset 0
|
||||||
|
Decorate 25(Uniforms) Block
|
||||||
|
Decorate 27 DescriptorSet 0
|
||||||
|
Decorate 27 Binding 0
|
||||||
|
MemberDecorate 516(Block) 0 Offset 0
|
||||||
|
MemberDecorate 516(Block) 1 Offset 6
|
||||||
|
Decorate 516(Block) Block
|
||||||
|
Decorate 518(block) DescriptorSet 0
|
||||||
|
Decorate 518(block) Binding 1
|
||||||
|
Decorate 520(iu16v) Flat
|
||||||
|
Decorate 520(iu16v) Location 0
|
||||||
|
Decorate 522(ii16) Flat
|
||||||
|
Decorate 522(ii16) Location 1
|
||||||
|
Decorate 523(si64) SpecId 100
|
||||||
|
Decorate 524(su64) SpecId 101
|
||||||
|
Decorate 525(si) SpecId 102
|
||||||
|
Decorate 526(su) SpecId 103
|
||||||
|
Decorate 527(sb) SpecId 104
|
||||||
|
Decorate 528(si16) SpecId 105
|
||||||
|
Decorate 529(su16) SpecId 106
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
14: TypeInt 16 0
|
||||||
|
15: TypePointer Function 14(int)
|
||||||
|
17: TypeInt 16 1
|
||||||
|
18: TypeInt 32 0
|
||||||
|
19: 18(int) Constant 3
|
||||||
|
20: TypeArray 17(int) 19
|
||||||
|
21: 17(int) Constant 273
|
||||||
|
22: 17(int) Constant 65534
|
||||||
|
23: 17(int) Constant 256
|
||||||
|
24: 20 ConstantComposite 21 22 23
|
||||||
|
25(Uniforms): TypeStruct 18(int)
|
||||||
|
26: TypePointer Uniform 25(Uniforms)
|
||||||
|
27: 26(ptr) Variable Uniform
|
||||||
|
28: TypeInt 32 1
|
||||||
|
29: 28(int) Constant 0
|
||||||
|
30: TypePointer Uniform 18(int)
|
||||||
|
33: TypePointer Function 20
|
||||||
|
35: TypePointer Function 17(int)
|
||||||
|
39: TypeArray 14(int) 19
|
||||||
|
40: 14(int) Constant 65535
|
||||||
|
41: 39 ConstantComposite 40 40 40
|
||||||
|
44: TypePointer Function 39
|
||||||
|
49: TypeVector 14(int) 3
|
||||||
|
50: TypePointer Function 49(ivec3)
|
||||||
|
53: 17(int) Constant 1
|
||||||
|
54: TypeVector 17(int) 3
|
||||||
|
107: TypePointer Function 28(int)
|
||||||
|
111: TypeVector 28(int) 3
|
||||||
|
114: 18(int) Constant 1
|
||||||
|
120: 18(int) Constant 2
|
||||||
|
128: TypeBool
|
||||||
|
129: TypePointer Function 128(bool)
|
||||||
|
131: 18(int) Constant 0
|
||||||
|
150: TypePointer Function 18(int)
|
||||||
|
188: TypeVector 17(int) 2
|
||||||
|
189: TypePointer Function 188(ivec2)
|
||||||
|
191: TypeVector 128(bool) 2
|
||||||
|
192: TypePointer Function 191(bvec2)
|
||||||
|
195: 17(int) Constant 0
|
||||||
|
196: 188(ivec2) ConstantComposite 195 195
|
||||||
|
197: 188(ivec2) ConstantComposite 53 53
|
||||||
|
199: TypeVector 14(int) 2
|
||||||
|
200: TypePointer Function 199(ivec2)
|
||||||
|
203: 14(int) Constant 0
|
||||||
|
204: 14(int) Constant 1
|
||||||
|
205: 199(ivec2) ConstantComposite 203 203
|
||||||
|
206: 199(ivec2) ConstantComposite 204 204
|
||||||
|
212: TypeVector 28(int) 2
|
||||||
|
213: TypePointer Function 212(ivec2)
|
||||||
|
223: TypeVector 18(int) 2
|
||||||
|
226: TypePointer Function 223(ivec2)
|
||||||
|
238: TypeFloat 32
|
||||||
|
239: TypeVector 238(float) 2
|
||||||
|
240: TypePointer Function 239(fvec2)
|
||||||
|
250: TypeFloat 64
|
||||||
|
251: TypeVector 250(float) 2
|
||||||
|
252: TypePointer Function 251(fvec2)
|
||||||
|
262: TypeFloat 16
|
||||||
|
263: TypeVector 262(float) 2
|
||||||
|
264: TypePointer Function 263(fvec2)
|
||||||
|
274: TypeInt 64 1
|
||||||
|
275: TypeVector 274(int) 2
|
||||||
|
276: TypePointer Function 275(ivec2)
|
||||||
|
286: TypeInt 64 0
|
||||||
|
287: TypeVector 286(int) 2
|
||||||
|
290: TypePointer Function 287(ivec2)
|
||||||
|
317: 17(int) Constant 65535
|
||||||
|
318: 188(ivec2) ConstantComposite 317 317
|
||||||
|
327: 49(ivec3) ConstantComposite 203 203 203
|
||||||
|
369: 128(bool) ConstantTrue
|
||||||
|
376: 128(bool) ConstantFalse
|
||||||
|
377: 191(bvec2) ConstantComposite 376 376
|
||||||
|
389: TypeVector 128(bool) 3
|
||||||
|
390: 389(bvec3) ConstantComposite 376 376 376
|
||||||
|
392: TypeVector 262(float) 3
|
||||||
|
393: TypePointer Function 392(fvec3)
|
||||||
|
396: TypePointer Function 54(ivec3)
|
||||||
|
398(ResType): TypeStruct 392(fvec3) 54(ivec3)
|
||||||
|
408: TypePointer Function 262(float)
|
||||||
|
432: TypePointer Function 274(int)
|
||||||
|
435: TypeVector 17(int) 4
|
||||||
|
441: TypePointer Function 286(int)
|
||||||
|
444: TypeVector 14(int) 4
|
||||||
|
450: TypePointer Function 389(bvec3)
|
||||||
|
516(Block): TypeStruct 54(ivec3) 14(int)
|
||||||
|
517: TypePointer Uniform 516(Block)
|
||||||
|
518(block): 517(ptr) Variable Uniform
|
||||||
|
519: TypePointer Input 49(ivec3)
|
||||||
|
520(iu16v): 519(ptr) Variable Input
|
||||||
|
521: TypePointer Input 17(int)
|
||||||
|
522(ii16): 521(ptr) Variable Input
|
||||||
|
523(si64): 274(int) SpecConstant 4294967286 4294967295
|
||||||
|
524(su64): 286(int) SpecConstant 20 0
|
||||||
|
525(si): 28(int) SpecConstant 4294967291
|
||||||
|
526(su): 18(int) SpecConstant 4
|
||||||
|
527(sb): 128(bool) SpecConstantTrue
|
||||||
|
528(si16): 17(int) SpecConstant 65531
|
||||||
|
529(su16): 14(int) SpecConstant 4
|
||||||
|
530: 128(bool) SpecConstantOp 171 528(si16) 203
|
||||||
|
531: 128(bool) SpecConstantOp 171 529(su16) 203
|
||||||
|
532: 17(int) SpecConstantOp 169 527(sb) 53 195
|
||||||
|
533: 14(int) SpecConstantOp 169 527(sb) 204 203
|
||||||
|
534: 28(int) SpecConstantOp 114 528(si16)
|
||||||
|
535: 18(int) SpecConstantOp 113 529(su16)
|
||||||
|
536: 28(int) SpecConstantOp 128 535 131
|
||||||
|
537: 17(int) SpecConstantOp 114 525(si)
|
||||||
|
538: 17(int) SpecConstantOp 114 525(si)
|
||||||
|
539: 14(int) SpecConstantOp 128 538 203
|
||||||
|
540: 28(int) SpecConstantOp 114 528(si16)
|
||||||
|
541: 18(int) SpecConstantOp 128 540 131
|
||||||
|
542: 18(int) SpecConstantOp 113 529(su16)
|
||||||
|
543: 14(int) SpecConstantOp 113 526(su)
|
||||||
|
544: 17(int) SpecConstantOp 128 543 203
|
||||||
|
545: 14(int) SpecConstantOp 113 526(su)
|
||||||
|
546: 274(int) SpecConstantOp 114 528(si16)
|
||||||
|
547: 286(int) SpecConstantOp 113 529(su16)
|
||||||
|
548: 286(int) Constant 0 0
|
||||||
|
549: 274(int) SpecConstantOp 128 547 548
|
||||||
|
550: 17(int) SpecConstantOp 114 523(si64)
|
||||||
|
551: 17(int) SpecConstantOp 114 523(si64)
|
||||||
|
552: 14(int) SpecConstantOp 128 551 203
|
||||||
|
553: 274(int) SpecConstantOp 114 528(si16)
|
||||||
|
554: 286(int) SpecConstantOp 128 553 548
|
||||||
|
555: 286(int) SpecConstantOp 113 529(su16)
|
||||||
|
556: 14(int) SpecConstantOp 113 524(su64)
|
||||||
|
557: 17(int) SpecConstantOp 128 556 203
|
||||||
|
558: 14(int) SpecConstantOp 113 524(su64)
|
||||||
|
559: 14(int) SpecConstantOp 128 528(si16) 203
|
||||||
|
560: 17(int) SpecConstantOp 128 529(su16) 203
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
512: 2 FunctionCall 6(literal()
|
||||||
|
513: 2 FunctionCall 8(operators()
|
||||||
|
514: 2 FunctionCall 10(typeCast()
|
||||||
|
515: 2 FunctionCall 12(builtinFuncs()
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
6(literal(): 2 Function None 3
|
||||||
|
7: Label
|
||||||
|
16(u16): 15(ptr) Variable Function
|
||||||
|
34(indexable): 33(ptr) Variable Function
|
||||||
|
45(indexable): 44(ptr) Variable Function
|
||||||
|
31: 30(ptr) AccessChain 27 29
|
||||||
|
32: 18(int) Load 31
|
||||||
|
Store 34(indexable) 24
|
||||||
|
36: 35(ptr) AccessChain 34(indexable) 32
|
||||||
|
37: 17(int) Load 36
|
||||||
|
38: 14(int) Bitcast 37
|
||||||
|
42: 30(ptr) AccessChain 27 29
|
||||||
|
43: 18(int) Load 42
|
||||||
|
Store 45(indexable) 41
|
||||||
|
46: 15(ptr) AccessChain 45(indexable) 43
|
||||||
|
47: 14(int) Load 46
|
||||||
|
48: 14(int) IAdd 38 47
|
||||||
|
Store 16(u16) 48
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
8(operators(): 2 Function None 3
|
||||||
|
9: Label
|
||||||
|
51(u16v): 50(ptr) Variable Function
|
||||||
|
57(i16): 35(ptr) Variable Function
|
||||||
|
70(u16): 15(ptr) Variable Function
|
||||||
|
108(i): 107(ptr) Variable Function
|
||||||
|
130(b): 129(ptr) Variable Function
|
||||||
|
151(u): 150(ptr) Variable Function
|
||||||
|
52: 49(ivec3) Load 51(u16v)
|
||||||
|
55: 54(ivec3) CompositeConstruct 53 53 53
|
||||||
|
56: 49(ivec3) IAdd 52 55
|
||||||
|
Store 51(u16v) 56
|
||||||
|
58: 17(int) Load 57(i16)
|
||||||
|
59: 17(int) ISub 58 53
|
||||||
|
Store 57(i16) 59
|
||||||
|
60: 17(int) Load 57(i16)
|
||||||
|
61: 17(int) IAdd 60 53
|
||||||
|
Store 57(i16) 61
|
||||||
|
62: 49(ivec3) Load 51(u16v)
|
||||||
|
63: 54(ivec3) CompositeConstruct 53 53 53
|
||||||
|
64: 49(ivec3) ISub 62 63
|
||||||
|
Store 51(u16v) 64
|
||||||
|
65: 49(ivec3) Load 51(u16v)
|
||||||
|
66: 49(ivec3) Not 65
|
||||||
|
Store 51(u16v) 66
|
||||||
|
67: 17(int) Load 57(i16)
|
||||||
|
Store 57(i16) 67
|
||||||
|
68: 49(ivec3) Load 51(u16v)
|
||||||
|
69: 49(ivec3) SNegate 68
|
||||||
|
Store 51(u16v) 69
|
||||||
|
71: 17(int) Load 57(i16)
|
||||||
|
72: 14(int) Bitcast 71
|
||||||
|
73: 14(int) Load 70(u16)
|
||||||
|
74: 14(int) IAdd 73 72
|
||||||
|
Store 70(u16) 74
|
||||||
|
75: 49(ivec3) Load 51(u16v)
|
||||||
|
76: 49(ivec3) Load 51(u16v)
|
||||||
|
77: 49(ivec3) ISub 76 75
|
||||||
|
Store 51(u16v) 77
|
||||||
|
78: 17(int) Load 57(i16)
|
||||||
|
79: 17(int) Load 57(i16)
|
||||||
|
80: 17(int) IMul 79 78
|
||||||
|
Store 57(i16) 80
|
||||||
|
81: 49(ivec3) Load 51(u16v)
|
||||||
|
82: 49(ivec3) Load 51(u16v)
|
||||||
|
83: 49(ivec3) UDiv 82 81
|
||||||
|
Store 51(u16v) 83
|
||||||
|
84: 17(int) Load 57(i16)
|
||||||
|
85: 14(int) Bitcast 84
|
||||||
|
86: 49(ivec3) Load 51(u16v)
|
||||||
|
87: 49(ivec3) CompositeConstruct 85 85 85
|
||||||
|
88: 49(ivec3) UMod 86 87
|
||||||
|
Store 51(u16v) 88
|
||||||
|
89: 49(ivec3) Load 51(u16v)
|
||||||
|
90: 49(ivec3) Load 51(u16v)
|
||||||
|
91: 49(ivec3) IAdd 89 90
|
||||||
|
Store 51(u16v) 91
|
||||||
|
92: 17(int) Load 57(i16)
|
||||||
|
93: 14(int) Bitcast 92
|
||||||
|
94: 14(int) Load 70(u16)
|
||||||
|
95: 14(int) ISub 93 94
|
||||||
|
Store 70(u16) 95
|
||||||
|
96: 49(ivec3) Load 51(u16v)
|
||||||
|
97: 17(int) Load 57(i16)
|
||||||
|
98: 14(int) Bitcast 97
|
||||||
|
99: 49(ivec3) CompositeConstruct 98 98 98
|
||||||
|
100: 49(ivec3) IMul 96 99
|
||||||
|
Store 51(u16v) 100
|
||||||
|
101: 17(int) Load 57(i16)
|
||||||
|
102: 17(int) Load 57(i16)
|
||||||
|
103: 17(int) IMul 101 102
|
||||||
|
Store 57(i16) 103
|
||||||
|
104: 17(int) Load 57(i16)
|
||||||
|
105: 17(int) Load 57(i16)
|
||||||
|
106: 17(int) SMod 104 105
|
||||||
|
Store 57(i16) 106
|
||||||
|
109: 28(int) Load 108(i)
|
||||||
|
110: 49(ivec3) Load 51(u16v)
|
||||||
|
112: 111(ivec3) CompositeConstruct 109 109 109
|
||||||
|
113: 49(ivec3) ShiftLeftLogical 110 112
|
||||||
|
Store 51(u16v) 113
|
||||||
|
115: 15(ptr) AccessChain 51(u16v) 114
|
||||||
|
116: 14(int) Load 115
|
||||||
|
117: 17(int) Load 57(i16)
|
||||||
|
118: 17(int) ShiftRightArithmetic 117 116
|
||||||
|
Store 57(i16) 118
|
||||||
|
119: 17(int) Load 57(i16)
|
||||||
|
121: 15(ptr) AccessChain 51(u16v) 120
|
||||||
|
122: 14(int) Load 121
|
||||||
|
123: 17(int) ShiftLeftLogical 119 122
|
||||||
|
Store 57(i16) 123
|
||||||
|
124: 49(ivec3) Load 51(u16v)
|
||||||
|
125: 17(int) Load 57(i16)
|
||||||
|
126: 54(ivec3) CompositeConstruct 125 125 125
|
||||||
|
127: 49(ivec3) ShiftLeftLogical 124 126
|
||||||
|
Store 51(u16v) 127
|
||||||
|
132: 15(ptr) AccessChain 51(u16v) 131
|
||||||
|
133: 14(int) Load 132
|
||||||
|
134: 17(int) Load 57(i16)
|
||||||
|
135: 14(int) Bitcast 134
|
||||||
|
136: 128(bool) INotEqual 133 135
|
||||||
|
Store 130(b) 136
|
||||||
|
137: 17(int) Load 57(i16)
|
||||||
|
138: 14(int) Bitcast 137
|
||||||
|
139: 15(ptr) AccessChain 51(u16v) 131
|
||||||
|
140: 14(int) Load 139
|
||||||
|
141: 128(bool) IEqual 138 140
|
||||||
|
Store 130(b) 141
|
||||||
|
142: 15(ptr) AccessChain 51(u16v) 131
|
||||||
|
143: 14(int) Load 142
|
||||||
|
144: 15(ptr) AccessChain 51(u16v) 114
|
||||||
|
145: 14(int) Load 144
|
||||||
|
146: 128(bool) UGreaterThan 143 145
|
||||||
|
Store 130(b) 146
|
||||||
|
147: 17(int) Load 57(i16)
|
||||||
|
148: 28(int) SConvert 147
|
||||||
|
149: 18(int) Bitcast 148
|
||||||
|
152: 18(int) Load 151(u)
|
||||||
|
153: 128(bool) ULessThan 149 152
|
||||||
|
Store 130(b) 153
|
||||||
|
154: 15(ptr) AccessChain 51(u16v) 114
|
||||||
|
155: 14(int) Load 154
|
||||||
|
156: 15(ptr) AccessChain 51(u16v) 131
|
||||||
|
157: 14(int) Load 156
|
||||||
|
158: 128(bool) UGreaterThanEqual 155 157
|
||||||
|
Store 130(b) 158
|
||||||
|
159: 17(int) Load 57(i16)
|
||||||
|
160: 28(int) SConvert 159
|
||||||
|
161: 28(int) Load 108(i)
|
||||||
|
162: 128(bool) SLessThanEqual 160 161
|
||||||
|
Store 130(b) 162
|
||||||
|
163: 17(int) Load 57(i16)
|
||||||
|
164: 14(int) Bitcast 163
|
||||||
|
165: 49(ivec3) Load 51(u16v)
|
||||||
|
166: 49(ivec3) CompositeConstruct 164 164 164
|
||||||
|
167: 49(ivec3) BitwiseOr 165 166
|
||||||
|
Store 51(u16v) 167
|
||||||
|
168: 17(int) Load 57(i16)
|
||||||
|
169: 14(int) Bitcast 168
|
||||||
|
170: 14(int) Load 70(u16)
|
||||||
|
171: 14(int) BitwiseOr 169 170
|
||||||
|
Store 70(u16) 171
|
||||||
|
172: 17(int) Load 57(i16)
|
||||||
|
173: 17(int) Load 57(i16)
|
||||||
|
174: 17(int) BitwiseAnd 173 172
|
||||||
|
Store 57(i16) 174
|
||||||
|
175: 49(ivec3) Load 51(u16v)
|
||||||
|
176: 49(ivec3) Load 51(u16v)
|
||||||
|
177: 49(ivec3) BitwiseAnd 175 176
|
||||||
|
Store 51(u16v) 177
|
||||||
|
178: 17(int) Load 57(i16)
|
||||||
|
179: 14(int) Bitcast 178
|
||||||
|
180: 49(ivec3) Load 51(u16v)
|
||||||
|
181: 49(ivec3) CompositeConstruct 179 179 179
|
||||||
|
182: 49(ivec3) BitwiseXor 180 181
|
||||||
|
Store 51(u16v) 182
|
||||||
|
183: 49(ivec3) Load 51(u16v)
|
||||||
|
184: 17(int) Load 57(i16)
|
||||||
|
185: 14(int) Bitcast 184
|
||||||
|
186: 49(ivec3) CompositeConstruct 185 185 185
|
||||||
|
187: 49(ivec3) BitwiseXor 183 186
|
||||||
|
Store 51(u16v) 187
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
10(typeCast(): 2 Function None 3
|
||||||
|
11: Label
|
||||||
|
190(i16v): 189(ptr) Variable Function
|
||||||
|
193(bv): 192(ptr) Variable Function
|
||||||
|
201(u16v): 200(ptr) Variable Function
|
||||||
|
214(iv): 213(ptr) Variable Function
|
||||||
|
227(uv): 226(ptr) Variable Function
|
||||||
|
241(fv): 240(ptr) Variable Function
|
||||||
|
253(dv): 252(ptr) Variable Function
|
||||||
|
265(f16v): 264(ptr) Variable Function
|
||||||
|
277(i64v): 276(ptr) Variable Function
|
||||||
|
291(u64v): 290(ptr) Variable Function
|
||||||
|
194: 191(bvec2) Load 193(bv)
|
||||||
|
198: 188(ivec2) Select 194 197 196
|
||||||
|
Store 190(i16v) 198
|
||||||
|
202: 191(bvec2) Load 193(bv)
|
||||||
|
207: 199(ivec2) Select 202 206 205
|
||||||
|
Store 201(u16v) 207
|
||||||
|
208: 188(ivec2) Load 190(i16v)
|
||||||
|
209: 191(bvec2) INotEqual 208 205
|
||||||
|
Store 193(bv) 209
|
||||||
|
210: 199(ivec2) Load 201(u16v)
|
||||||
|
211: 191(bvec2) INotEqual 210 205
|
||||||
|
Store 193(bv) 211
|
||||||
|
215: 212(ivec2) Load 214(iv)
|
||||||
|
216: 188(ivec2) SConvert 215
|
||||||
|
Store 190(i16v) 216
|
||||||
|
217: 212(ivec2) Load 214(iv)
|
||||||
|
218: 188(ivec2) SConvert 217
|
||||||
|
219: 199(ivec2) Bitcast 218
|
||||||
|
Store 201(u16v) 219
|
||||||
|
220: 188(ivec2) Load 190(i16v)
|
||||||
|
221: 212(ivec2) SConvert 220
|
||||||
|
Store 214(iv) 221
|
||||||
|
222: 199(ivec2) Load 201(u16v)
|
||||||
|
224: 223(ivec2) UConvert 222
|
||||||
|
225: 212(ivec2) Bitcast 224
|
||||||
|
Store 214(iv) 225
|
||||||
|
228: 223(ivec2) Load 227(uv)
|
||||||
|
229: 199(ivec2) UConvert 228
|
||||||
|
230: 188(ivec2) Bitcast 229
|
||||||
|
Store 190(i16v) 230
|
||||||
|
231: 223(ivec2) Load 227(uv)
|
||||||
|
232: 199(ivec2) UConvert 231
|
||||||
|
Store 201(u16v) 232
|
||||||
|
233: 188(ivec2) Load 190(i16v)
|
||||||
|
234: 212(ivec2) SConvert 233
|
||||||
|
235: 223(ivec2) Bitcast 234
|
||||||
|
Store 227(uv) 235
|
||||||
|
236: 199(ivec2) Load 201(u16v)
|
||||||
|
237: 223(ivec2) UConvert 236
|
||||||
|
Store 227(uv) 237
|
||||||
|
242: 239(fvec2) Load 241(fv)
|
||||||
|
243: 188(ivec2) ConvertFToS 242
|
||||||
|
Store 190(i16v) 243
|
||||||
|
244: 239(fvec2) Load 241(fv)
|
||||||
|
245: 199(ivec2) ConvertFToU 244
|
||||||
|
Store 201(u16v) 245
|
||||||
|
246: 188(ivec2) Load 190(i16v)
|
||||||
|
247: 239(fvec2) ConvertSToF 246
|
||||||
|
Store 241(fv) 247
|
||||||
|
248: 199(ivec2) Load 201(u16v)
|
||||||
|
249: 239(fvec2) ConvertUToF 248
|
||||||
|
Store 241(fv) 249
|
||||||
|
254: 251(fvec2) Load 253(dv)
|
||||||
|
255: 188(ivec2) ConvertFToS 254
|
||||||
|
Store 190(i16v) 255
|
||||||
|
256: 251(fvec2) Load 253(dv)
|
||||||
|
257: 199(ivec2) ConvertFToU 256
|
||||||
|
Store 201(u16v) 257
|
||||||
|
258: 188(ivec2) Load 190(i16v)
|
||||||
|
259: 251(fvec2) ConvertSToF 258
|
||||||
|
Store 253(dv) 259
|
||||||
|
260: 199(ivec2) Load 201(u16v)
|
||||||
|
261: 251(fvec2) ConvertUToF 260
|
||||||
|
Store 253(dv) 261
|
||||||
|
266: 263(fvec2) Load 265(f16v)
|
||||||
|
267: 188(ivec2) ConvertFToS 266
|
||||||
|
Store 190(i16v) 267
|
||||||
|
268: 263(fvec2) Load 265(f16v)
|
||||||
|
269: 199(ivec2) ConvertFToU 268
|
||||||
|
Store 201(u16v) 269
|
||||||
|
270: 188(ivec2) Load 190(i16v)
|
||||||
|
271: 263(fvec2) ConvertSToF 270
|
||||||
|
Store 265(f16v) 271
|
||||||
|
272: 199(ivec2) Load 201(u16v)
|
||||||
|
273: 263(fvec2) ConvertUToF 272
|
||||||
|
Store 265(f16v) 273
|
||||||
|
278: 275(ivec2) Load 277(i64v)
|
||||||
|
279: 188(ivec2) SConvert 278
|
||||||
|
Store 190(i16v) 279
|
||||||
|
280: 275(ivec2) Load 277(i64v)
|
||||||
|
281: 188(ivec2) SConvert 280
|
||||||
|
282: 199(ivec2) Bitcast 281
|
||||||
|
Store 201(u16v) 282
|
||||||
|
283: 188(ivec2) Load 190(i16v)
|
||||||
|
284: 275(ivec2) SConvert 283
|
||||||
|
Store 277(i64v) 284
|
||||||
|
285: 199(ivec2) Load 201(u16v)
|
||||||
|
288: 287(ivec2) UConvert 285
|
||||||
|
289: 275(ivec2) Bitcast 288
|
||||||
|
Store 277(i64v) 289
|
||||||
|
292: 287(ivec2) Load 291(u64v)
|
||||||
|
293: 199(ivec2) UConvert 292
|
||||||
|
294: 188(ivec2) Bitcast 293
|
||||||
|
Store 190(i16v) 294
|
||||||
|
295: 287(ivec2) Load 291(u64v)
|
||||||
|
296: 199(ivec2) UConvert 295
|
||||||
|
Store 201(u16v) 296
|
||||||
|
297: 188(ivec2) Load 190(i16v)
|
||||||
|
298: 275(ivec2) SConvert 297
|
||||||
|
299: 287(ivec2) Bitcast 298
|
||||||
|
Store 291(u64v) 299
|
||||||
|
300: 199(ivec2) Load 201(u16v)
|
||||||
|
301: 287(ivec2) UConvert 300
|
||||||
|
Store 291(u64v) 301
|
||||||
|
302: 199(ivec2) Load 201(u16v)
|
||||||
|
303: 188(ivec2) Bitcast 302
|
||||||
|
Store 190(i16v) 303
|
||||||
|
304: 188(ivec2) Load 190(i16v)
|
||||||
|
305: 199(ivec2) Bitcast 304
|
||||||
|
Store 201(u16v) 305
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
12(builtinFuncs(): 2 Function None 3
|
||||||
|
13: Label
|
||||||
|
306(i16v): 189(ptr) Variable Function
|
||||||
|
312(i16): 35(ptr) Variable Function
|
||||||
|
320(u16v): 50(ptr) Variable Function
|
||||||
|
322(u16): 15(ptr) Variable Function
|
||||||
|
394(f16v): 393(ptr) Variable Function
|
||||||
|
397(exp): 396(ptr) Variable Function
|
||||||
|
419(packi): 107(ptr) Variable Function
|
||||||
|
424(packu): 150(ptr) Variable Function
|
||||||
|
433(packi64): 432(ptr) Variable Function
|
||||||
|
442(packu64): 441(ptr) Variable Function
|
||||||
|
451(bv): 450(ptr) Variable Function
|
||||||
|
307: 188(ivec2) Load 306(i16v)
|
||||||
|
308: 188(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 307
|
||||||
|
Store 306(i16v) 308
|
||||||
|
309: 188(ivec2) Load 306(i16v)
|
||||||
|
310: 188(ivec2) ExtInst 1(GLSL.std.450) 7(SSign) 309
|
||||||
|
Store 306(i16v) 310
|
||||||
|
311: 188(ivec2) Load 306(i16v)
|
||||||
|
313: 17(int) Load 312(i16)
|
||||||
|
314: 188(ivec2) CompositeConstruct 313 313
|
||||||
|
315: 188(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 311 314
|
||||||
|
Store 306(i16v) 315
|
||||||
|
316: 188(ivec2) Load 306(i16v)
|
||||||
|
319: 188(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 316 318
|
||||||
|
Store 306(i16v) 319
|
||||||
|
321: 49(ivec3) Load 320(u16v)
|
||||||
|
323: 14(int) Load 322(u16)
|
||||||
|
324: 49(ivec3) CompositeConstruct 323 323 323
|
||||||
|
325: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 321 324
|
||||||
|
Store 320(u16v) 325
|
||||||
|
326: 49(ivec3) Load 320(u16v)
|
||||||
|
328: 49(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 326 327
|
||||||
|
Store 320(u16v) 328
|
||||||
|
329: 188(ivec2) Load 306(i16v)
|
||||||
|
330: 17(int) Load 312(i16)
|
||||||
|
331: 188(ivec2) CompositeConstruct 330 330
|
||||||
|
332: 188(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 329 331
|
||||||
|
Store 306(i16v) 332
|
||||||
|
333: 188(ivec2) Load 306(i16v)
|
||||||
|
334: 188(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 333 318
|
||||||
|
Store 306(i16v) 334
|
||||||
|
335: 49(ivec3) Load 320(u16v)
|
||||||
|
336: 14(int) Load 322(u16)
|
||||||
|
337: 49(ivec3) CompositeConstruct 336 336 336
|
||||||
|
338: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 335 337
|
||||||
|
Store 320(u16v) 338
|
||||||
|
339: 49(ivec3) Load 320(u16v)
|
||||||
|
340: 49(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 339 327
|
||||||
|
Store 320(u16v) 340
|
||||||
|
341: 188(ivec2) Load 306(i16v)
|
||||||
|
342: 17(int) Load 312(i16)
|
||||||
|
343: 17(int) SNegate 342
|
||||||
|
344: 17(int) Load 312(i16)
|
||||||
|
345: 188(ivec2) CompositeConstruct 343 343
|
||||||
|
346: 188(ivec2) CompositeConstruct 344 344
|
||||||
|
347: 188(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 341 345 346
|
||||||
|
Store 306(i16v) 347
|
||||||
|
348: 188(ivec2) Load 306(i16v)
|
||||||
|
349: 188(ivec2) Load 306(i16v)
|
||||||
|
350: 188(ivec2) SNegate 349
|
||||||
|
351: 188(ivec2) Load 306(i16v)
|
||||||
|
352: 188(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 348 350 351
|
||||||
|
Store 306(i16v) 352
|
||||||
|
353: 49(ivec3) Load 320(u16v)
|
||||||
|
354: 14(int) Load 322(u16)
|
||||||
|
355: 14(int) SNegate 354
|
||||||
|
356: 14(int) Load 322(u16)
|
||||||
|
357: 49(ivec3) CompositeConstruct 355 355 355
|
||||||
|
358: 49(ivec3) CompositeConstruct 356 356 356
|
||||||
|
359: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 353 357 358
|
||||||
|
Store 320(u16v) 359
|
||||||
|
360: 49(ivec3) Load 320(u16v)
|
||||||
|
361: 49(ivec3) Load 320(u16v)
|
||||||
|
362: 49(ivec3) SNegate 361
|
||||||
|
363: 49(ivec3) Load 320(u16v)
|
||||||
|
364: 49(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 360 362 363
|
||||||
|
Store 320(u16v) 364
|
||||||
|
365: 35(ptr) AccessChain 306(i16v) 131
|
||||||
|
366: 17(int) Load 365
|
||||||
|
367: 35(ptr) AccessChain 306(i16v) 114
|
||||||
|
368: 17(int) Load 367
|
||||||
|
370: 17(int) Select 369 368 366
|
||||||
|
Store 312(i16) 370
|
||||||
|
371: 17(int) Load 312(i16)
|
||||||
|
372: 188(ivec2) CompositeConstruct 371 371
|
||||||
|
373: 17(int) Load 312(i16)
|
||||||
|
374: 17(int) SNegate 373
|
||||||
|
375: 188(ivec2) CompositeConstruct 374 374
|
||||||
|
378: 188(ivec2) Select 377 375 372
|
||||||
|
Store 306(i16v) 378
|
||||||
|
379: 15(ptr) AccessChain 320(u16v) 131
|
||||||
|
380: 14(int) Load 379
|
||||||
|
381: 15(ptr) AccessChain 320(u16v) 114
|
||||||
|
382: 14(int) Load 381
|
||||||
|
383: 14(int) Select 369 382 380
|
||||||
|
Store 322(u16) 383
|
||||||
|
384: 14(int) Load 322(u16)
|
||||||
|
385: 49(ivec3) CompositeConstruct 384 384 384
|
||||||
|
386: 14(int) Load 322(u16)
|
||||||
|
387: 14(int) SNegate 386
|
||||||
|
388: 49(ivec3) CompositeConstruct 387 387 387
|
||||||
|
391: 49(ivec3) Select 390 388 385
|
||||||
|
Store 320(u16v) 391
|
||||||
|
395: 392(fvec3) Load 394(f16v)
|
||||||
|
399:398(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 395
|
||||||
|
400: 54(ivec3) CompositeExtract 399 1
|
||||||
|
Store 397(exp) 400
|
||||||
|
401: 392(fvec3) CompositeExtract 399 0
|
||||||
|
Store 394(f16v) 401
|
||||||
|
402: 392(fvec3) Load 394(f16v)
|
||||||
|
403: 54(ivec3) Load 397(exp)
|
||||||
|
404: 392(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 402 403
|
||||||
|
Store 394(f16v) 404
|
||||||
|
405: 392(fvec3) Load 394(f16v)
|
||||||
|
406: 263(fvec2) VectorShuffle 405 405 0 1
|
||||||
|
407: 188(ivec2) Bitcast 406
|
||||||
|
Store 306(i16v) 407
|
||||||
|
409: 408(ptr) AccessChain 394(f16v) 120
|
||||||
|
410: 262(float) Load 409
|
||||||
|
411: 14(int) Bitcast 410
|
||||||
|
412: 15(ptr) AccessChain 320(u16v) 131
|
||||||
|
Store 412 411
|
||||||
|
413: 188(ivec2) Load 306(i16v)
|
||||||
|
414: 263(fvec2) Bitcast 413
|
||||||
|
415: 392(fvec3) Load 394(f16v)
|
||||||
|
416: 392(fvec3) VectorShuffle 415 414 3 4 2
|
||||||
|
Store 394(f16v) 416
|
||||||
|
417: 49(ivec3) Load 320(u16v)
|
||||||
|
418: 392(fvec3) Bitcast 417
|
||||||
|
Store 394(f16v) 418
|
||||||
|
420: 188(ivec2) Load 306(i16v)
|
||||||
|
421: 28(int) Bitcast 420
|
||||||
|
Store 419(packi) 421
|
||||||
|
422: 28(int) Load 419(packi)
|
||||||
|
423: 188(ivec2) Bitcast 422
|
||||||
|
Store 306(i16v) 423
|
||||||
|
425: 49(ivec3) Load 320(u16v)
|
||||||
|
426: 199(ivec2) VectorShuffle 425 425 0 1
|
||||||
|
427: 18(int) Bitcast 426
|
||||||
|
Store 424(packu) 427
|
||||||
|
428: 18(int) Load 424(packu)
|
||||||
|
429: 199(ivec2) Bitcast 428
|
||||||
|
430: 49(ivec3) Load 320(u16v)
|
||||||
|
431: 49(ivec3) VectorShuffle 430 429 3 4 2
|
||||||
|
Store 320(u16v) 431
|
||||||
|
434: 17(int) Load 312(i16)
|
||||||
|
436: 435(ivec4) CompositeConstruct 434 434 434 434
|
||||||
|
437: 274(int) Bitcast 436
|
||||||
|
Store 433(packi64) 437
|
||||||
|
438: 274(int) Load 433(packi64)
|
||||||
|
439: 435(ivec4) Bitcast 438
|
||||||
|
440: 188(ivec2) VectorShuffle 439 439 0 1
|
||||||
|
Store 306(i16v) 440
|
||||||
|
443: 14(int) Load 322(u16)
|
||||||
|
445: 444(ivec4) CompositeConstruct 443 443 443 443
|
||||||
|
446: 286(int) Bitcast 445
|
||||||
|
Store 442(packu64) 446
|
||||||
|
447: 286(int) Load 442(packu64)
|
||||||
|
448: 444(ivec4) Bitcast 447
|
||||||
|
449: 49(ivec3) VectorShuffle 448 448 0 1 2
|
||||||
|
Store 320(u16v) 449
|
||||||
|
452: 49(ivec3) Load 320(u16v)
|
||||||
|
453: 14(int) Load 322(u16)
|
||||||
|
454: 49(ivec3) CompositeConstruct 453 453 453
|
||||||
|
455: 389(bvec3) ULessThan 452 454
|
||||||
|
Store 451(bv) 455
|
||||||
|
456: 188(ivec2) Load 306(i16v)
|
||||||
|
457: 17(int) Load 312(i16)
|
||||||
|
458: 188(ivec2) CompositeConstruct 457 457
|
||||||
|
459: 191(bvec2) SLessThan 456 458
|
||||||
|
460: 389(bvec3) Load 451(bv)
|
||||||
|
461: 389(bvec3) VectorShuffle 460 459 3 4 2
|
||||||
|
Store 451(bv) 461
|
||||||
|
462: 49(ivec3) Load 320(u16v)
|
||||||
|
463: 14(int) Load 322(u16)
|
||||||
|
464: 49(ivec3) CompositeConstruct 463 463 463
|
||||||
|
465: 389(bvec3) ULessThanEqual 462 464
|
||||||
|
Store 451(bv) 465
|
||||||
|
466: 188(ivec2) Load 306(i16v)
|
||||||
|
467: 17(int) Load 312(i16)
|
||||||
|
468: 188(ivec2) CompositeConstruct 467 467
|
||||||
|
469: 191(bvec2) SLessThanEqual 466 468
|
||||||
|
470: 389(bvec3) Load 451(bv)
|
||||||
|
471: 389(bvec3) VectorShuffle 470 469 3 4 2
|
||||||
|
Store 451(bv) 471
|
||||||
|
472: 49(ivec3) Load 320(u16v)
|
||||||
|
473: 14(int) Load 322(u16)
|
||||||
|
474: 49(ivec3) CompositeConstruct 473 473 473
|
||||||
|
475: 389(bvec3) UGreaterThan 472 474
|
||||||
|
Store 451(bv) 475
|
||||||
|
476: 188(ivec2) Load 306(i16v)
|
||||||
|
477: 17(int) Load 312(i16)
|
||||||
|
478: 188(ivec2) CompositeConstruct 477 477
|
||||||
|
479: 191(bvec2) SGreaterThan 476 478
|
||||||
|
480: 389(bvec3) Load 451(bv)
|
||||||
|
481: 389(bvec3) VectorShuffle 480 479 3 4 2
|
||||||
|
Store 451(bv) 481
|
||||||
|
482: 49(ivec3) Load 320(u16v)
|
||||||
|
483: 14(int) Load 322(u16)
|
||||||
|
484: 49(ivec3) CompositeConstruct 483 483 483
|
||||||
|
485: 389(bvec3) UGreaterThanEqual 482 484
|
||||||
|
Store 451(bv) 485
|
||||||
|
486: 188(ivec2) Load 306(i16v)
|
||||||
|
487: 17(int) Load 312(i16)
|
||||||
|
488: 188(ivec2) CompositeConstruct 487 487
|
||||||
|
489: 191(bvec2) SGreaterThanEqual 486 488
|
||||||
|
490: 389(bvec3) Load 451(bv)
|
||||||
|
491: 389(bvec3) VectorShuffle 490 489 3 4 2
|
||||||
|
Store 451(bv) 491
|
||||||
|
492: 49(ivec3) Load 320(u16v)
|
||||||
|
493: 14(int) Load 322(u16)
|
||||||
|
494: 49(ivec3) CompositeConstruct 493 493 493
|
||||||
|
495: 389(bvec3) IEqual 492 494
|
||||||
|
Store 451(bv) 495
|
||||||
|
496: 188(ivec2) Load 306(i16v)
|
||||||
|
497: 17(int) Load 312(i16)
|
||||||
|
498: 188(ivec2) CompositeConstruct 497 497
|
||||||
|
499: 191(bvec2) IEqual 496 498
|
||||||
|
500: 389(bvec3) Load 451(bv)
|
||||||
|
501: 389(bvec3) VectorShuffle 500 499 3 4 2
|
||||||
|
Store 451(bv) 501
|
||||||
|
502: 49(ivec3) Load 320(u16v)
|
||||||
|
503: 14(int) Load 322(u16)
|
||||||
|
504: 49(ivec3) CompositeConstruct 503 503 503
|
||||||
|
505: 389(bvec3) INotEqual 502 504
|
||||||
|
Store 451(bv) 505
|
||||||
|
506: 188(ivec2) Load 306(i16v)
|
||||||
|
507: 17(int) Load 312(i16)
|
||||||
|
508: 188(ivec2) CompositeConstruct 507 507
|
||||||
|
509: 191(bvec2) INotEqual 506 508
|
||||||
|
510: 389(bvec3) Load 451(bv)
|
||||||
|
511: 389(bvec3) VectorShuffle 510 509 3 4 2
|
||||||
|
Store 451(bv) 511
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
314
Test/spv.int16.frag
Normal file
314
Test/spv.int16.frag
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
#version 450 core
|
||||||
|
|
||||||
|
#extension GL_ARB_gpu_shader_int64: enable
|
||||||
|
#extension GL_AMD_gpu_shader_half_float: enable
|
||||||
|
#extension GL_AMD_gpu_shader_int16: enable
|
||||||
|
|
||||||
|
layout(binding = 0) uniform Uniforms
|
||||||
|
{
|
||||||
|
uint i;
|
||||||
|
};
|
||||||
|
|
||||||
|
// int16/uint16 in block
|
||||||
|
layout(std140, binding = 1) uniform Block
|
||||||
|
{
|
||||||
|
i16vec3 i16v;
|
||||||
|
uint16_t u16;
|
||||||
|
} block;
|
||||||
|
|
||||||
|
// int16/uint16 for input
|
||||||
|
layout(location = 0) in flat u16vec3 iu16v;
|
||||||
|
layout(location = 1) in flat int16_t ii16;
|
||||||
|
|
||||||
|
void literal()
|
||||||
|
{
|
||||||
|
const int16_t i16c[3] =
|
||||||
|
{
|
||||||
|
0x111S, // Hex
|
||||||
|
-2s, // Dec
|
||||||
|
0400s, // Oct
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t u16c[] =
|
||||||
|
{
|
||||||
|
0xFFFFus, // Hex
|
||||||
|
65535US, // Dec
|
||||||
|
0177777us, // Oct
|
||||||
|
};
|
||||||
|
|
||||||
|
uint16_t u16 = i16c[i] + u16c[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void operators()
|
||||||
|
{
|
||||||
|
u16vec3 u16v;
|
||||||
|
int16_t i16;
|
||||||
|
uint16_t u16;
|
||||||
|
int i;
|
||||||
|
uint u;
|
||||||
|
bool b;
|
||||||
|
|
||||||
|
// Unary
|
||||||
|
u16v++;
|
||||||
|
i16--;
|
||||||
|
++i16;
|
||||||
|
--u16v;
|
||||||
|
|
||||||
|
u16v = ~u16v;
|
||||||
|
|
||||||
|
i16 = +i16;
|
||||||
|
u16v = -u16v;
|
||||||
|
|
||||||
|
// Arithmetic
|
||||||
|
u16 += i16;
|
||||||
|
u16v -= u16v;
|
||||||
|
i16 *= i16;
|
||||||
|
u16v /= u16v;
|
||||||
|
u16v %= i16;
|
||||||
|
|
||||||
|
u16v = u16v + u16v;
|
||||||
|
u16 = i16 - u16;
|
||||||
|
u16v = u16v * i16;
|
||||||
|
i16 = i16 * i16;
|
||||||
|
i16 = i16 % i16;
|
||||||
|
|
||||||
|
// Shift
|
||||||
|
u16v <<= i;
|
||||||
|
i16 >>= u16v.y;
|
||||||
|
|
||||||
|
i16 = i16 << u16v.z;
|
||||||
|
u16v = u16v << i16;
|
||||||
|
|
||||||
|
// Relational
|
||||||
|
b = (u16v.x != i16);
|
||||||
|
b = (i16 == u16v.x);
|
||||||
|
b = (u16v.x > u16v.y);
|
||||||
|
b = (i16 < u);
|
||||||
|
b = (u16v.y >= u16v.x);
|
||||||
|
b = (i16 <= i);
|
||||||
|
|
||||||
|
// Bitwise
|
||||||
|
u16v |= i16;
|
||||||
|
u16 = i16 | u16;
|
||||||
|
i16 &= i16;
|
||||||
|
u16v = u16v & u16v;
|
||||||
|
u16v ^= i16;
|
||||||
|
u16v = u16v ^ i16;
|
||||||
|
}
|
||||||
|
|
||||||
|
void typeCast()
|
||||||
|
{
|
||||||
|
bvec2 bv;
|
||||||
|
ivec2 iv;
|
||||||
|
uvec2 uv;
|
||||||
|
vec2 fv;
|
||||||
|
dvec2 dv;
|
||||||
|
|
||||||
|
f16vec2 f16v;
|
||||||
|
i64vec2 i64v;
|
||||||
|
u64vec2 u64v;
|
||||||
|
i16vec2 i16v;
|
||||||
|
u16vec2 u16v;
|
||||||
|
|
||||||
|
i16v = i16vec2(bv); // bool -> int16
|
||||||
|
u16v = u16vec2(bv); // bool -> uint16
|
||||||
|
bv = bvec2(i16v); // int16 -> bool
|
||||||
|
bv = bvec2(u16v); // uint16 -> bool
|
||||||
|
|
||||||
|
i16v = i16vec2(iv); // int -> int16
|
||||||
|
u16v = u16vec2(iv); // int -> uint16
|
||||||
|
iv = i16v; // int16 -> int
|
||||||
|
iv = ivec2(u16v); // uint16 -> int
|
||||||
|
|
||||||
|
i16v = i16vec2(uv); // uint -> int16
|
||||||
|
u16v = u16vec2(uv); // uint -> uint16
|
||||||
|
uv = i16v; // int16 -> uint
|
||||||
|
uv = u16v; // uint16 -> uint
|
||||||
|
|
||||||
|
i16v = i16vec2(fv); // float -> int16
|
||||||
|
u16v = u16vec2(fv); // float -> uint16
|
||||||
|
fv = i16v; // int16 -> float
|
||||||
|
fv = u16v; // uint16 -> float
|
||||||
|
|
||||||
|
i16v = i16vec2(dv); // double -> int16
|
||||||
|
u16v = u16vec2(dv); // double -> uint16
|
||||||
|
dv = i16v; // int16 -> double
|
||||||
|
dv = u16v; // uint16 -> double
|
||||||
|
|
||||||
|
i16v = i16vec2(f16v); // float16 -> int16
|
||||||
|
u16v = u16vec2(f16v); // float16 -> uint16
|
||||||
|
f16v = i16v; // int16 -> float16
|
||||||
|
f16v = u16v; // uint16 -> float16
|
||||||
|
|
||||||
|
i16v = i16vec2(i64v); // int64 -> int16
|
||||||
|
u16v = u16vec2(i64v); // int64 -> uint16
|
||||||
|
i64v = i16v; // int16 -> int64
|
||||||
|
i64v = i64vec2(u16v); // uint16 -> int64
|
||||||
|
|
||||||
|
i16v = i16vec2(u64v); // uint64 -> int16
|
||||||
|
u16v = u16vec2(u64v); // uint64 -> uint16
|
||||||
|
u64v = i16v; // int16 -> uint64
|
||||||
|
u64v = u16v; // uint16 -> uint64
|
||||||
|
|
||||||
|
i16v = i16vec2(u16v); // uint16 -> int16
|
||||||
|
u16v = i16v; // int16 -> uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
void builtinFuncs()
|
||||||
|
{
|
||||||
|
i16vec2 i16v;
|
||||||
|
u16vec3 u16v;
|
||||||
|
f16vec3 f16v;
|
||||||
|
bvec3 bv;
|
||||||
|
|
||||||
|
int16_t i16;
|
||||||
|
uint16_t u16;
|
||||||
|
|
||||||
|
// abs()
|
||||||
|
i16v = abs(i16v);
|
||||||
|
|
||||||
|
// sign()
|
||||||
|
i16v = sign(i16v);
|
||||||
|
|
||||||
|
// min()
|
||||||
|
i16v = min(i16v, i16);
|
||||||
|
i16v = min(i16v, i16vec2(-1s));
|
||||||
|
u16v = min(u16v, u16);
|
||||||
|
u16v = min(u16v, u16vec3(0us));
|
||||||
|
|
||||||
|
// max()
|
||||||
|
i16v = max(i16v, i16);
|
||||||
|
i16v = max(i16v, i16vec2(-1s));
|
||||||
|
u16v = max(u16v, u16);
|
||||||
|
u16v = max(u16v, u16vec3(0us));
|
||||||
|
|
||||||
|
// clamp()
|
||||||
|
i16v = clamp(i16v, -i16, i16);
|
||||||
|
i16v = clamp(i16v, -i16v, i16v);
|
||||||
|
u16v = clamp(u16v, -u16, u16);
|
||||||
|
u16v = clamp(u16v, -u16v, u16v);
|
||||||
|
|
||||||
|
// mix()
|
||||||
|
i16 = mix(i16v.x, i16v.y, true);
|
||||||
|
i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false));
|
||||||
|
u16 = mix(u16v.x, u16v.y, true);
|
||||||
|
u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false));
|
||||||
|
|
||||||
|
// frexp()
|
||||||
|
i16vec3 exp;
|
||||||
|
f16v = frexp(f16v, exp);
|
||||||
|
|
||||||
|
// ldexp()
|
||||||
|
f16v = ldexp(f16v, exp);
|
||||||
|
|
||||||
|
// float16BitsToInt16()
|
||||||
|
i16v = float16BitsToInt16(f16v.xy);
|
||||||
|
|
||||||
|
// float16BitsToUint16()
|
||||||
|
u16v.x = float16BitsToUint16(f16v.z);
|
||||||
|
|
||||||
|
// int16BitsToFloat16()
|
||||||
|
f16v.xy = int16BitsToFloat16(i16v);
|
||||||
|
|
||||||
|
// uint16BitsToFloat16()
|
||||||
|
f16v = uint16BitsToFloat16(u16v);
|
||||||
|
|
||||||
|
// packInt2x16()
|
||||||
|
int packi = packInt2x16(i16v);
|
||||||
|
|
||||||
|
// unpackInt2x16()
|
||||||
|
i16v = unpackInt2x16(packi);
|
||||||
|
|
||||||
|
// packUint2x16()
|
||||||
|
uint packu = packUint2x16(u16v.xy);
|
||||||
|
|
||||||
|
// unpackUint2x16()
|
||||||
|
u16v.xy = unpackUint2x16(packu);
|
||||||
|
|
||||||
|
// packInt4x16()
|
||||||
|
int64_t packi64 = packInt4x16(i16vec4(i16));
|
||||||
|
|
||||||
|
// unpackInt4x16()
|
||||||
|
i16v = unpackInt4x16(packi64).xy;
|
||||||
|
|
||||||
|
// packUint4x16()
|
||||||
|
uint64_t packu64 = packUint4x16(u16vec4(u16));
|
||||||
|
|
||||||
|
// unpackUint4x16()
|
||||||
|
u16v = unpackUint4x16(packu64).xyz;
|
||||||
|
|
||||||
|
// lessThan()
|
||||||
|
bv = lessThan(u16v, u16vec3(u16));
|
||||||
|
bv.xy = lessThan(i16v, i16vec2(i16));
|
||||||
|
|
||||||
|
// lessThanEqual()
|
||||||
|
bv = lessThanEqual(u16v, u16vec3(u16));
|
||||||
|
bv.xy = lessThanEqual(i16v, i16vec2(i16));
|
||||||
|
|
||||||
|
// greaterThan()
|
||||||
|
bv = greaterThan(u16v, u16vec3(u16));
|
||||||
|
bv.xy = greaterThan(i16v, i16vec2(i16));
|
||||||
|
|
||||||
|
// greaterThanEqual()
|
||||||
|
bv = greaterThanEqual(u16v, u16vec3(u16));
|
||||||
|
bv.xy = greaterThanEqual(i16v, i16vec2(i16));
|
||||||
|
|
||||||
|
// equal()
|
||||||
|
bv = equal(u16v, u16vec3(u16));
|
||||||
|
bv.xy = equal(i16v, i16vec2(i16));
|
||||||
|
|
||||||
|
// notEqual()
|
||||||
|
bv = notEqual(u16v, u16vec3(u16));
|
||||||
|
bv.xy = notEqual(i16v, i16vec2(i16));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type conversion for specialization constant
|
||||||
|
layout(constant_id = 100) const int64_t si64 = -10L;
|
||||||
|
layout(constant_id = 101) const uint64_t su64 = 20UL;
|
||||||
|
layout(constant_id = 102) const int si = -5;
|
||||||
|
layout(constant_id = 103) const uint su = 4;
|
||||||
|
layout(constant_id = 104) const bool sb = true;
|
||||||
|
layout(constant_id = 105) const int16_t si16 = -5S;
|
||||||
|
layout(constant_id = 106) const uint16_t su16 = 4US;
|
||||||
|
|
||||||
|
// bool <-> int16/uint16
|
||||||
|
const bool i16_to_b = bool(si16);
|
||||||
|
const bool u16_to_b = bool(su16);
|
||||||
|
const int16_t b_to_i16 = int16_t(sb);
|
||||||
|
const uint16_t b_to_u16 = uint16_t(sb);
|
||||||
|
|
||||||
|
// int <-> int16/uint16
|
||||||
|
const int i16_to_i = int(si16);
|
||||||
|
const int u16_to_i = int(su16);
|
||||||
|
const int16_t i_to_i16 = int16_t(si);
|
||||||
|
const uint16_t i_to_u16 = uint16_t(si);
|
||||||
|
|
||||||
|
// uint <-> int16/uint16
|
||||||
|
const uint i16_to_u = uint(si16);
|
||||||
|
const uint u16_to_u = uint(su16);
|
||||||
|
const int16_t u_to_i16 = int16_t(su);
|
||||||
|
const uint16_t u_to_u16 = uint16_t(su);
|
||||||
|
|
||||||
|
// int64 <-> int16/uint16
|
||||||
|
const int64_t i16_to_i64 = int64_t(si16);
|
||||||
|
const int64_t u16_to_i64 = int64_t(su16);
|
||||||
|
const int16_t i64_to_i16 = int16_t(si64);
|
||||||
|
const uint16_t i64_to_u16 = uint16_t(si64);
|
||||||
|
|
||||||
|
// uint64 <-> int16/uint16
|
||||||
|
const uint64_t i16_to_u64 = uint64_t(si16);
|
||||||
|
const uint64_t u16_to_u64 = uint64_t(su16);
|
||||||
|
const int16_t u64_to_i16 = int16_t(su64);
|
||||||
|
const uint16_t u64_to_u16 = uint16_t(su64);
|
||||||
|
|
||||||
|
// int16 <-> uint16
|
||||||
|
const uint16_t i16_to_u16 = uint16_t(si16);
|
||||||
|
const int16_t u16_to_i16 = int16_t(su16);
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
literal();
|
||||||
|
operators();
|
||||||
|
typeCast();
|
||||||
|
builtinFuncs();
|
||||||
|
}
|
@ -53,6 +53,10 @@ enum TBasicType {
|
|||||||
EbtUint,
|
EbtUint,
|
||||||
EbtInt64,
|
EbtInt64,
|
||||||
EbtUint64,
|
EbtUint64,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EbtInt16,
|
||||||
|
EbtUint16,
|
||||||
|
#endif
|
||||||
EbtBool,
|
EbtBool,
|
||||||
EbtAtomicUint,
|
EbtAtomicUint,
|
||||||
EbtSampler,
|
EbtSampler,
|
||||||
|
@ -190,8 +190,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|||||||
case EbtFloat: break;
|
case EbtFloat: break;
|
||||||
case EbtInt: s.append("i"); break;
|
case EbtInt: s.append("i"); break;
|
||||||
case EbtUint: s.append("u"); break;
|
case EbtUint: s.append("u"); break;
|
||||||
case EbtInt64: s.append("i64"); break;
|
|
||||||
case EbtUint64: s.append("u64"); break;
|
|
||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
if (image) {
|
if (image) {
|
||||||
@ -1448,6 +1446,10 @@ public:
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@ -1531,6 +1533,10 @@ public:
|
|||||||
case EbtUint: return "uint";
|
case EbtUint: return "uint";
|
||||||
case EbtInt64: return "int64_t";
|
case EbtInt64: return "int64_t";
|
||||||
case EbtUint64: return "uint64_t";
|
case EbtUint64: return "uint64_t";
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: return "int16_t";
|
||||||
|
case EbtUint16: return "uint16_t";
|
||||||
|
#endif
|
||||||
case EbtBool: return "bool";
|
case EbtBool: return "bool";
|
||||||
case EbtAtomicUint: return "atomic_uint";
|
case EbtAtomicUint: return "atomic_uint";
|
||||||
case EbtSampler: return "sampler/image";
|
case EbtSampler: return "sampler/image";
|
||||||
|
@ -141,6 +141,42 @@ enum TOperator {
|
|||||||
EOpConvFloat16ToDouble,
|
EOpConvFloat16ToDouble,
|
||||||
EOpConvFloat16ToInt64,
|
EOpConvFloat16ToInt64,
|
||||||
EOpConvFloat16ToUint64,
|
EOpConvFloat16ToUint64,
|
||||||
|
|
||||||
|
EOpConvBoolToInt16,
|
||||||
|
EOpConvIntToInt16,
|
||||||
|
EOpConvUintToInt16,
|
||||||
|
EOpConvFloatToInt16,
|
||||||
|
EOpConvDoubleToInt16,
|
||||||
|
EOpConvFloat16ToInt16,
|
||||||
|
EOpConvInt64ToInt16,
|
||||||
|
EOpConvUint64ToInt16,
|
||||||
|
EOpConvUint16ToInt16,
|
||||||
|
EOpConvInt16ToBool,
|
||||||
|
EOpConvInt16ToInt,
|
||||||
|
EOpConvInt16ToUint,
|
||||||
|
EOpConvInt16ToFloat,
|
||||||
|
EOpConvInt16ToDouble,
|
||||||
|
EOpConvInt16ToFloat16,
|
||||||
|
EOpConvInt16ToInt64,
|
||||||
|
EOpConvInt16ToUint64,
|
||||||
|
|
||||||
|
EOpConvBoolToUint16,
|
||||||
|
EOpConvIntToUint16,
|
||||||
|
EOpConvUintToUint16,
|
||||||
|
EOpConvFloatToUint16,
|
||||||
|
EOpConvDoubleToUint16,
|
||||||
|
EOpConvFloat16ToUint16,
|
||||||
|
EOpConvInt64ToUint16,
|
||||||
|
EOpConvUint64ToUint16,
|
||||||
|
EOpConvInt16ToUint16,
|
||||||
|
EOpConvUint16ToBool,
|
||||||
|
EOpConvUint16ToInt,
|
||||||
|
EOpConvUint16ToUint,
|
||||||
|
EOpConvUint16ToFloat,
|
||||||
|
EOpConvUint16ToDouble,
|
||||||
|
EOpConvUint16ToFloat16,
|
||||||
|
EOpConvUint16ToInt64,
|
||||||
|
EOpConvUint16ToUint64,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -244,6 +280,12 @@ enum TOperator {
|
|||||||
EOpDoubleBitsToUint64,
|
EOpDoubleBitsToUint64,
|
||||||
EOpInt64BitsToDouble,
|
EOpInt64BitsToDouble,
|
||||||
EOpUint64BitsToDouble,
|
EOpUint64BitsToDouble,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpFloat16BitsToInt16,
|
||||||
|
EOpFloat16BitsToUint16,
|
||||||
|
EOpInt16BitsToFloat16,
|
||||||
|
EOpUint16BitsToFloat16,
|
||||||
|
#endif
|
||||||
EOpPackSnorm2x16,
|
EOpPackSnorm2x16,
|
||||||
EOpUnpackSnorm2x16,
|
EOpUnpackSnorm2x16,
|
||||||
EOpPackUnorm2x16,
|
EOpPackUnorm2x16,
|
||||||
@ -263,6 +305,14 @@ enum TOperator {
|
|||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
EOpPackFloat2x16,
|
EOpPackFloat2x16,
|
||||||
EOpUnpackFloat2x16,
|
EOpUnpackFloat2x16,
|
||||||
|
EOpPackInt2x16,
|
||||||
|
EOpUnpackInt2x16,
|
||||||
|
EOpPackUint2x16,
|
||||||
|
EOpUnpackUint2x16,
|
||||||
|
EOpPackInt4x16,
|
||||||
|
EOpUnpackInt4x16,
|
||||||
|
EOpPackUint4x16,
|
||||||
|
EOpUnpackUint4x16,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EOpLength,
|
EOpLength,
|
||||||
@ -394,15 +444,27 @@ enum TOperator {
|
|||||||
EOpConstructUint,
|
EOpConstructUint,
|
||||||
EOpConstructInt64,
|
EOpConstructInt64,
|
||||||
EOpConstructUint64,
|
EOpConstructUint64,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpConstructInt16,
|
||||||
|
EOpConstructUint16,
|
||||||
|
#endif
|
||||||
EOpConstructBool,
|
EOpConstructBool,
|
||||||
EOpConstructFloat,
|
EOpConstructFloat,
|
||||||
EOpConstructDouble,
|
EOpConstructDouble,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpConstructFloat16,
|
||||||
|
#endif
|
||||||
EOpConstructVec2,
|
EOpConstructVec2,
|
||||||
EOpConstructVec3,
|
EOpConstructVec3,
|
||||||
EOpConstructVec4,
|
EOpConstructVec4,
|
||||||
EOpConstructDVec2,
|
EOpConstructDVec2,
|
||||||
EOpConstructDVec3,
|
EOpConstructDVec3,
|
||||||
EOpConstructDVec4,
|
EOpConstructDVec4,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpConstructF16Vec2,
|
||||||
|
EOpConstructF16Vec3,
|
||||||
|
EOpConstructF16Vec4,
|
||||||
|
#endif
|
||||||
EOpConstructBVec2,
|
EOpConstructBVec2,
|
||||||
EOpConstructBVec3,
|
EOpConstructBVec3,
|
||||||
EOpConstructBVec4,
|
EOpConstructBVec4,
|
||||||
@ -418,6 +480,14 @@ enum TOperator {
|
|||||||
EOpConstructU64Vec2,
|
EOpConstructU64Vec2,
|
||||||
EOpConstructU64Vec3,
|
EOpConstructU64Vec3,
|
||||||
EOpConstructU64Vec4,
|
EOpConstructU64Vec4,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpConstructI16Vec2,
|
||||||
|
EOpConstructI16Vec3,
|
||||||
|
EOpConstructI16Vec4,
|
||||||
|
EOpConstructU16Vec2,
|
||||||
|
EOpConstructU16Vec3,
|
||||||
|
EOpConstructU16Vec4,
|
||||||
|
#endif
|
||||||
EOpConstructMat2x2,
|
EOpConstructMat2x2,
|
||||||
EOpConstructMat2x3,
|
EOpConstructMat2x3,
|
||||||
EOpConstructMat2x4,
|
EOpConstructMat2x4,
|
||||||
@ -464,10 +534,6 @@ enum TOperator {
|
|||||||
EOpConstructBMat4x3,
|
EOpConstructBMat4x3,
|
||||||
EOpConstructBMat4x4,
|
EOpConstructBMat4x4,
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
EOpConstructFloat16,
|
|
||||||
EOpConstructF16Vec2,
|
|
||||||
EOpConstructF16Vec3,
|
|
||||||
EOpConstructF16Vec4,
|
|
||||||
EOpConstructF16Mat2x2,
|
EOpConstructF16Mat2x2,
|
||||||
EOpConstructF16Mat2x3,
|
EOpConstructF16Mat2x3,
|
||||||
EOpConstructF16Mat2x4,
|
EOpConstructF16Mat2x4,
|
||||||
|
@ -193,7 +193,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
|
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
if (rightUnionArray[i] == 0) {
|
if (rightUnionArray[i] == 0) {
|
||||||
newConstArray[i].setUConst(0xFFFFFFFF);
|
newConstArray[i].setUConst(0xFFFFFFFFu);
|
||||||
} else
|
} else
|
||||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||||
break;
|
break;
|
||||||
@ -213,6 +213,23 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
} else
|
} else
|
||||||
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
|
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
if (rightUnionArray[i] == 0)
|
||||||
|
newConstArray[i].setIConst(0x7FFF);
|
||||||
|
else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x8000)
|
||||||
|
newConstArray[i].setIConst(0x8000);
|
||||||
|
else
|
||||||
|
newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EbtUint16:
|
||||||
|
if (rightUnionArray[i] == 0) {
|
||||||
|
newConstArray[i].setUConst(0xFFFFu);
|
||||||
|
} else
|
||||||
|
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -457,10 +474,16 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
#endif
|
#endif
|
||||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
#endif
|
||||||
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
case 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 EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
|
||||||
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getU64Const()))); break;
|
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -610,6 +633,14 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpUintBitsToFloat:
|
case EOpUintBitsToFloat:
|
||||||
case EOpDoubleBitsToInt64:
|
case EOpDoubleBitsToInt64:
|
||||||
case EOpDoubleBitsToUint64:
|
case EOpDoubleBitsToUint64:
|
||||||
|
case EOpInt64BitsToDouble:
|
||||||
|
case EOpUint64BitsToDouble:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpFloat16BitsToInt16:
|
||||||
|
case EOpFloat16BitsToUint16:
|
||||||
|
case EOpInt16BitsToFloat16:
|
||||||
|
case EOpUint16BitsToFloat16:
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -702,6 +733,9 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
#endif
|
#endif
|
||||||
children[0]->getAsTyped()->getBasicType() == EbtDouble;
|
children[0]->getAsTyped()->getBasicType() == EbtDouble;
|
||||||
bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt ||
|
bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt ||
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
children[0]->getAsTyped()->getBasicType() == EbtInt16 ||
|
||||||
|
#endif
|
||||||
children[0]->getAsTyped()->getBasicType() == EbtInt64;
|
children[0]->getAsTyped()->getBasicType() == EbtInt64;
|
||||||
bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 ||
|
bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 ||
|
||||||
children[0]->getAsTyped()->getBasicType() == EbtUint64;
|
children[0]->getAsTyped()->getBasicType() == EbtUint64;
|
||||||
|
@ -85,8 +85,6 @@ TBuiltIns::TBuiltIns()
|
|||||||
prefixes[EbtFloat] = "";
|
prefixes[EbtFloat] = "";
|
||||||
prefixes[EbtInt] = "i";
|
prefixes[EbtInt] = "i";
|
||||||
prefixes[EbtUint] = "u";
|
prefixes[EbtUint] = "u";
|
||||||
prefixes[EbtInt64] = "i64";
|
|
||||||
prefixes[EbtUint64] = "u64";
|
|
||||||
postfixes[2] = "2";
|
postfixes[2] = "2";
|
||||||
postfixes[3] = "3";
|
postfixes[3] = "3";
|
||||||
postfixes[4] = "4";
|
postfixes[4] = "4";
|
||||||
@ -2612,6 +2610,157 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||||||
|
|
||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GL_AMD_gpu_shader_int16
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
commonBuiltins.append(
|
||||||
|
"int16_t abs(int16_t);"
|
||||||
|
"i16vec2 abs(i16vec2);"
|
||||||
|
"i16vec3 abs(i16vec3);"
|
||||||
|
"i16vec4 abs(i16vec4);"
|
||||||
|
|
||||||
|
"int16_t sign(int16_t);"
|
||||||
|
"i16vec2 sign(i16vec2);"
|
||||||
|
"i16vec3 sign(i16vec3);"
|
||||||
|
"i16vec4 sign(i16vec4);"
|
||||||
|
|
||||||
|
"int16_t min(int16_t, int16_t);"
|
||||||
|
"i16vec2 min(i16vec2, int16_t);"
|
||||||
|
"i16vec3 min(i16vec3, int16_t);"
|
||||||
|
"i16vec4 min(i16vec4, int16_t);"
|
||||||
|
"i16vec2 min(i16vec2, i16vec2);"
|
||||||
|
"i16vec3 min(i16vec3, i16vec3);"
|
||||||
|
"i16vec4 min(i16vec4, i16vec4);"
|
||||||
|
"uint16_t min(uint16_t, uint16_t);"
|
||||||
|
"u16vec2 min(u16vec2, uint16_t);"
|
||||||
|
"u16vec3 min(u16vec3, uint16_t);"
|
||||||
|
"u16vec4 min(u16vec4, uint16_t);"
|
||||||
|
"u16vec2 min(u16vec2, u16vec2);"
|
||||||
|
"u16vec3 min(u16vec3, u16vec3);"
|
||||||
|
"u16vec4 min(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"int16_t max(int16_t, int16_t);"
|
||||||
|
"i16vec2 max(i16vec2, int16_t);"
|
||||||
|
"i16vec3 max(i16vec3, int16_t);"
|
||||||
|
"i16vec4 max(i16vec4, int16_t);"
|
||||||
|
"i16vec2 max(i16vec2, i16vec2);"
|
||||||
|
"i16vec3 max(i16vec3, i16vec3);"
|
||||||
|
"i16vec4 max(i16vec4, i16vec4);"
|
||||||
|
"uint16_t max(uint16_t, uint16_t);"
|
||||||
|
"u16vec2 max(u16vec2, uint16_t);"
|
||||||
|
"u16vec3 max(u16vec3, uint16_t);"
|
||||||
|
"u16vec4 max(u16vec4, uint16_t);"
|
||||||
|
"u16vec2 max(u16vec2, u16vec2);"
|
||||||
|
"u16vec3 max(u16vec3, u16vec3);"
|
||||||
|
"u16vec4 max(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"int16_t clamp(int16_t, int16_t, int16_t);"
|
||||||
|
"i16vec2 clamp(i16vec2, int16_t, int16_t);"
|
||||||
|
"i16vec3 clamp(i16vec3, int16_t, int16_t);"
|
||||||
|
"i16vec4 clamp(i16vec4, int16_t, int16_t);"
|
||||||
|
"i16vec2 clamp(i16vec2, i16vec2, i16vec2);"
|
||||||
|
"i16vec3 clamp(i16vec3, i16vec3, i16vec3);"
|
||||||
|
"i16vec4 clamp(i16vec4, i16vec4, i16vec4);"
|
||||||
|
"uint16_t clamp(uint16_t, uint16_t, uint16_t);"
|
||||||
|
"u16vec2 clamp(u16vec2, uint16_t, uint16_t);"
|
||||||
|
"u16vec3 clamp(u16vec3, uint16_t, uint16_t);"
|
||||||
|
"u16vec4 clamp(u16vec4, uint16_t, uint16_t);"
|
||||||
|
"u16vec2 clamp(u16vec2, u16vec2, u16vec2);"
|
||||||
|
"u16vec3 clamp(u16vec3, u16vec3, u16vec3);"
|
||||||
|
"u16vec4 clamp(u16vec4, u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"int16_t mix(int16_t, int16_t, bool);"
|
||||||
|
"i16vec2 mix(i16vec2, i16vec2, bvec2);"
|
||||||
|
"i16vec3 mix(i16vec3, i16vec3, bvec3);"
|
||||||
|
"i16vec4 mix(i16vec4, i16vec4, bvec4);"
|
||||||
|
"uint16_t mix(uint16_t, uint16_t, bool);"
|
||||||
|
"u16vec2 mix(u16vec2, u16vec2, bvec2);"
|
||||||
|
"u16vec3 mix(u16vec3, u16vec3, bvec3);"
|
||||||
|
"u16vec4 mix(u16vec4, u16vec4, bvec4);"
|
||||||
|
|
||||||
|
"float16_t frexp(float16_t, out int16_t);"
|
||||||
|
"f16vec2 frexp(f16vec2, out i16vec2);"
|
||||||
|
"f16vec3 frexp(f16vec3, out i16vec3);"
|
||||||
|
"f16vec4 frexp(f16vec4, out i16vec4);"
|
||||||
|
|
||||||
|
"float16_t ldexp(float16_t, int16_t);"
|
||||||
|
"f16vec2 ldexp(f16vec2, i16vec2);"
|
||||||
|
"f16vec3 ldexp(f16vec3, i16vec3);"
|
||||||
|
"f16vec4 ldexp(f16vec4, i16vec4);"
|
||||||
|
|
||||||
|
"int16_t float16BitsToInt16(float16_t);"
|
||||||
|
"i16vec2 float16BitsToInt16(f16vec2);"
|
||||||
|
"i16vec3 float16BitsToInt16(f16vec3);"
|
||||||
|
"i16vec4 float16BitsToInt16(f16vec4);"
|
||||||
|
|
||||||
|
"uint16_t float16BitsToUint16(float16_t);"
|
||||||
|
"u16vec2 float16BitsToUint16(f16vec2);"
|
||||||
|
"u16vec3 float16BitsToUint16(f16vec3);"
|
||||||
|
"u16vec4 float16BitsToUint16(f16vec4);"
|
||||||
|
|
||||||
|
"float16_t int16BitsToFloat16(int16_t);"
|
||||||
|
"f16vec2 int16BitsToFloat16(i16vec2);"
|
||||||
|
"f16vec3 int16BitsToFloat16(i16vec3);"
|
||||||
|
"f16vec4 int16BitsToFloat16(i16vec4);"
|
||||||
|
|
||||||
|
"float16_t uint16BitsToFloat16(uint16_t);"
|
||||||
|
"f16vec2 uint16BitsToFloat16(u16vec2);"
|
||||||
|
"f16vec3 uint16BitsToFloat16(u16vec3);"
|
||||||
|
"f16vec4 uint16BitsToFloat16(u16vec4);"
|
||||||
|
|
||||||
|
"int packInt2x16(i16vec2);"
|
||||||
|
"uint packUint2x16(u16vec2);"
|
||||||
|
"int64_t packInt4x16(i16vec4);"
|
||||||
|
"uint64_t packUint4x16(u16vec4);"
|
||||||
|
"i16vec2 unpackInt2x16(int);"
|
||||||
|
"u16vec2 unpackUint2x16(uint);"
|
||||||
|
"i16vec4 unpackInt4x16(int64_t);"
|
||||||
|
"u16vec4 unpackUint4x16(uint64_t);"
|
||||||
|
|
||||||
|
"bvec2 lessThan(i16vec2, i16vec2);"
|
||||||
|
"bvec3 lessThan(i16vec3, i16vec3);"
|
||||||
|
"bvec4 lessThan(i16vec4, i16vec4);"
|
||||||
|
"bvec2 lessThan(u16vec2, u16vec2);"
|
||||||
|
"bvec3 lessThan(u16vec3, u16vec3);"
|
||||||
|
"bvec4 lessThan(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"bvec2 lessThanEqual(i16vec2, i16vec2);"
|
||||||
|
"bvec3 lessThanEqual(i16vec3, i16vec3);"
|
||||||
|
"bvec4 lessThanEqual(i16vec4, i16vec4);"
|
||||||
|
"bvec2 lessThanEqual(u16vec2, u16vec2);"
|
||||||
|
"bvec3 lessThanEqual(u16vec3, u16vec3);"
|
||||||
|
"bvec4 lessThanEqual(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"bvec2 greaterThan(i16vec2, i16vec2);"
|
||||||
|
"bvec3 greaterThan(i16vec3, i16vec3);"
|
||||||
|
"bvec4 greaterThan(i16vec4, i16vec4);"
|
||||||
|
"bvec2 greaterThan(u16vec2, u16vec2);"
|
||||||
|
"bvec3 greaterThan(u16vec3, u16vec3);"
|
||||||
|
"bvec4 greaterThan(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"bvec2 greaterThanEqual(i16vec2, i16vec2);"
|
||||||
|
"bvec3 greaterThanEqual(i16vec3, i16vec3);"
|
||||||
|
"bvec4 greaterThanEqual(i16vec4, i16vec4);"
|
||||||
|
"bvec2 greaterThanEqual(u16vec2, u16vec2);"
|
||||||
|
"bvec3 greaterThanEqual(u16vec3, u16vec3);"
|
||||||
|
"bvec4 greaterThanEqual(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"bvec2 equal(i16vec2, i16vec2);"
|
||||||
|
"bvec3 equal(i16vec3, i16vec3);"
|
||||||
|
"bvec4 equal(i16vec4, i16vec4);"
|
||||||
|
"bvec2 equal(u16vec2, u16vec2);"
|
||||||
|
"bvec3 equal(u16vec3, u16vec3);"
|
||||||
|
"bvec4 equal(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"bvec2 notEqual(i16vec2, i16vec2);"
|
||||||
|
"bvec3 notEqual(i16vec3, i16vec3);"
|
||||||
|
"bvec4 notEqual(i16vec4, i16vec4);"
|
||||||
|
"bvec2 notEqual(u16vec2, u16vec2);"
|
||||||
|
"bvec3 notEqual(u16vec3, u16vec3);"
|
||||||
|
"bvec4 notEqual(u16vec4, u16vec4);"
|
||||||
|
|
||||||
|
"\n");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@ -5639,6 +5788,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
|
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
|
||||||
symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble);
|
symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble);
|
||||||
symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble);
|
symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16);
|
||||||
|
symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16);
|
||||||
|
symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16);
|
||||||
|
symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16);
|
||||||
|
#endif
|
||||||
|
|
||||||
symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
|
symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
|
||||||
symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
||||||
@ -5662,6 +5817,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32);
|
symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32);
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16);
|
||||||
|
symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16);
|
||||||
|
symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16);
|
||||||
|
symbolTable.relateToOperator("unpackUint2x16", EOpUnpackUint2x16);
|
||||||
|
|
||||||
|
symbolTable.relateToOperator("packInt4x16", EOpPackInt4x16);
|
||||||
|
symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16);
|
||||||
|
symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16);
|
||||||
|
symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16);
|
||||||
|
|
||||||
symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16);
|
symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16);
|
||||||
symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16);
|
symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16);
|
||||||
#endif
|
#endif
|
||||||
|
@ -308,6 +308,10 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
|||||||
case EOpConstructUint: newType = EbtUint; break;
|
case EOpConstructUint: newType = EbtUint; break;
|
||||||
case EOpConstructInt64: newType = EbtInt64; break;
|
case EOpConstructInt64: newType = EbtInt64; break;
|
||||||
case EOpConstructUint64: newType = EbtUint64; break;
|
case EOpConstructUint64: newType = EbtUint64; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructInt16: newType = EbtInt16; break;
|
||||||
|
case EOpConstructUint16: newType = EbtUint16; break;
|
||||||
|
#endif
|
||||||
case EOpConstructBool: newType = EbtBool; break;
|
case EOpConstructBool: newType = EbtBool; break;
|
||||||
case EOpConstructFloat: newType = EbtFloat; break;
|
case EOpConstructFloat: newType = EbtFloat; break;
|
||||||
case EOpConstructDouble: newType = EbtDouble; break;
|
case EOpConstructDouble: newType = EbtDouble; break;
|
||||||
@ -336,6 +340,10 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
|||||||
case EOpConstructUint:
|
case EOpConstructUint:
|
||||||
case EOpConstructInt64:
|
case EOpConstructInt64:
|
||||||
case EOpConstructUint64:
|
case EOpConstructUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructInt16:
|
||||||
|
case EOpConstructUint16:
|
||||||
|
#endif
|
||||||
case EOpConstructBool:
|
case EOpConstructBool:
|
||||||
case EOpConstructFloat:
|
case EOpConstructFloat:
|
||||||
case EOpConstructDouble:
|
case EOpConstructDouble:
|
||||||
@ -528,6 +536,14 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EOpConstructUint64:
|
case EOpConstructUint64:
|
||||||
promoteTo = EbtUint64;
|
promoteTo = EbtUint64;
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructInt16:
|
||||||
|
promoteTo = EbtInt16;
|
||||||
|
break;
|
||||||
|
case EOpConstructUint16:
|
||||||
|
promoteTo = EbtUint16;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// List all the binary ops that can implicitly convert one operand to the other's type;
|
// List all the binary ops that can implicitly convert one operand to the other's type;
|
||||||
@ -616,10 +632,18 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EOpRightShiftAssign:
|
case EOpRightShiftAssign:
|
||||||
if ((type.getBasicType() == EbtInt ||
|
if ((type.getBasicType() == EbtInt ||
|
||||||
type.getBasicType() == EbtUint ||
|
type.getBasicType() == EbtUint ||
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
type.getBasicType() == EbtInt16 ||
|
||||||
|
type.getBasicType() == EbtUint16 ||
|
||||||
|
#endif
|
||||||
type.getBasicType() == EbtInt64 ||
|
type.getBasicType() == EbtInt64 ||
|
||||||
type.getBasicType() == EbtUint64) &&
|
type.getBasicType() == EbtUint64) &&
|
||||||
(node->getType().getBasicType() == EbtInt ||
|
(node->getType().getBasicType() == EbtInt ||
|
||||||
node->getType().getBasicType() == EbtUint ||
|
node->getType().getBasicType() == EbtUint ||
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
node->getType().getBasicType() == EbtInt16 ||
|
||||||
|
node->getType().getBasicType() == EbtUint16 ||
|
||||||
|
#endif
|
||||||
node->getType().getBasicType() == EbtInt64 ||
|
node->getType().getBasicType() == EbtInt64 ||
|
||||||
node->getType().getBasicType() == EbtUint64))
|
node->getType().getBasicType() == EbtUint64))
|
||||||
|
|
||||||
@ -663,6 +687,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToDouble; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToDouble; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -678,6 +706,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToFloat; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToFloat; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -692,6 +724,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtDouble: newOp = EOpConvDoubleToFloat16; break;
|
case EbtDouble: newOp = EOpConvDoubleToFloat16; break;
|
||||||
case EbtInt64: newOp = EOpConvInt64ToFloat16; break;
|
case EbtInt64: newOp = EOpConvInt64ToFloat16; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToFloat16; break;
|
case EbtUint64: newOp = EOpConvUint64ToFloat16; break;
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToFloat16; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToFloat16; break;
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -708,6 +742,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToBool; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToBool; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -723,6 +761,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToInt; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToInt; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -738,6 +780,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||||
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToUint; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToUint; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -753,6 +799,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtFloat16: newOp = EOpConvFloat16ToInt64; break;
|
case EbtFloat16: newOp = EOpConvFloat16ToInt64; break;
|
||||||
#endif
|
#endif
|
||||||
case EbtUint64: newOp = EOpConvUint64ToInt64; break;
|
case EbtUint64: newOp = EOpConvUint64ToInt64; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToInt64; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToInt64; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -768,10 +818,46 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||||||
case EbtFloat16: newOp = EOpConvFloat16ToUint64; break;
|
case EbtFloat16: newOp = EOpConvFloat16ToUint64; break;
|
||||||
#endif
|
#endif
|
||||||
case EbtInt64: newOp = EOpConvInt64ToUint64; break;
|
case EbtInt64: newOp = EOpConvInt64ToUint64; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToUint64; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToUint64; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
switch (node->getBasicType()) {
|
||||||
|
case EbtInt: newOp = EOpConvIntToInt16; break;
|
||||||
|
case EbtUint: newOp = EOpConvUintToInt16; break;
|
||||||
|
case EbtBool: newOp = EOpConvBoolToInt16; break;
|
||||||
|
case EbtFloat: newOp = EOpConvFloatToInt16; break;
|
||||||
|
case EbtDouble: newOp = EOpConvDoubleToInt16; break;
|
||||||
|
case EbtFloat16: newOp = EOpConvFloat16ToInt16; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToInt16; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToInt16; break;
|
||||||
|
case EbtUint16: newOp = EOpConvUint16ToInt16; break;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint16:
|
||||||
|
switch (node->getBasicType()) {
|
||||||
|
case EbtInt: newOp = EOpConvIntToUint16; break;
|
||||||
|
case EbtUint: newOp = EOpConvUintToUint16; break;
|
||||||
|
case EbtBool: newOp = EOpConvBoolToUint16; break;
|
||||||
|
case EbtFloat: newOp = EOpConvFloatToUint16; break;
|
||||||
|
case EbtDouble: newOp = EOpConvDoubleToUint16; break;
|
||||||
|
case EbtFloat16: newOp = EOpConvFloat16ToUint16; break;
|
||||||
|
case EbtInt64: newOp = EOpConvInt64ToUint16; break;
|
||||||
|
case EbtUint64: newOp = EOpConvUint64ToUint16; break;
|
||||||
|
case EbtInt16: newOp = EOpConvInt16ToUint16; break;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1020,6 +1106,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
@ -1033,6 +1123,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
switch (from) {
|
switch (from) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
@ -1048,6 +1142,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
case EbtInt:
|
case EbtInt:
|
||||||
return version >= 400 || (source == EShSourceHlsl);
|
return version >= 400 || (source == EShSourceHlsl);
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
return (source == EShSourceHlsl);
|
return (source == EShSourceHlsl);
|
||||||
@ -1057,6 +1155,9 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
return (source == EShSourceHlsl);
|
return (source == EShSourceHlsl);
|
||||||
@ -1069,6 +1170,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -1077,10 +1182,32 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
switch (from) {
|
switch (from) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtFloat16:
|
||||||
|
switch (from) {
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
case EbtFloat16:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
case EbtUint16:
|
||||||
|
switch (from) {
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1313,6 +1440,26 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
|||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
switch(type.getVectorSize()) {
|
||||||
|
case 1: op = EOpConstructInt16; break;
|
||||||
|
case 2: op = EOpConstructI16Vec2; break;
|
||||||
|
case 3: op = EOpConstructI16Vec3; break;
|
||||||
|
case 4: op = EOpConstructI16Vec4; break;
|
||||||
|
default: break; // some compilers want this
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint16:
|
||||||
|
switch(type.getVectorSize()) {
|
||||||
|
case 1: op = EOpConstructUint16; break;
|
||||||
|
case 2: op = EOpConstructU16Vec2; break;
|
||||||
|
case 3: op = EOpConstructU16Vec3; break;
|
||||||
|
case 4: op = EOpConstructU16Vec4; break;
|
||||||
|
default: break; // some compilers want this
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
if (type.getMatrixCols()) {
|
if (type.getMatrixCols()) {
|
||||||
switch (type.getMatrixCols()) {
|
switch (type.getMatrixCols()) {
|
||||||
@ -1620,6 +1767,24 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, co
|
|||||||
return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal);
|
return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
TIntermConstantUnion* TIntermediate::addConstantUnion(short i16, const TSourceLoc& loc, bool literal) const
|
||||||
|
{
|
||||||
|
TConstUnionArray unionArray(1);
|
||||||
|
unionArray[0].setIConst(i16);
|
||||||
|
|
||||||
|
return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal);
|
||||||
|
}
|
||||||
|
|
||||||
|
TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const
|
||||||
|
{
|
||||||
|
TConstUnionArray unionArray(1);
|
||||||
|
unionArray[0].setUConst(u16);
|
||||||
|
|
||||||
|
return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const
|
TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const
|
||||||
{
|
{
|
||||||
TConstUnionArray unionArray(1);
|
TConstUnionArray unionArray(1);
|
||||||
@ -1979,6 +2144,30 @@ bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const
|
|||||||
case EOpConvUintToInt64:
|
case EOpConvUintToInt64:
|
||||||
case EOpConvUint64ToInt:
|
case EOpConvUint64ToInt:
|
||||||
case EOpConvIntToUint64:
|
case EOpConvIntToUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConvInt16ToBool:
|
||||||
|
case EOpConvBoolToInt16:
|
||||||
|
case EOpConvInt16ToInt:
|
||||||
|
case EOpConvIntToInt16:
|
||||||
|
case EOpConvInt16ToUint:
|
||||||
|
case EOpConvUintToInt16:
|
||||||
|
case EOpConvInt16ToInt64:
|
||||||
|
case EOpConvInt64ToInt16:
|
||||||
|
case EOpConvInt16ToUint64:
|
||||||
|
case EOpConvUint64ToInt16:
|
||||||
|
case EOpConvUint16ToBool:
|
||||||
|
case EOpConvBoolToUint16:
|
||||||
|
case EOpConvUint16ToInt:
|
||||||
|
case EOpConvIntToUint16:
|
||||||
|
case EOpConvUint16ToUint:
|
||||||
|
case EOpConvUintToUint16:
|
||||||
|
case EOpConvUint16ToInt64:
|
||||||
|
case EOpConvInt64ToUint16:
|
||||||
|
case EOpConvUint16ToUint64:
|
||||||
|
case EOpConvUint64ToUint16:
|
||||||
|
case EOpConvInt16ToUint16:
|
||||||
|
case EOpConvUint16ToInt16:
|
||||||
|
#endif
|
||||||
|
|
||||||
// unary operations
|
// unary operations
|
||||||
case EOpNegative:
|
case EOpNegative:
|
||||||
@ -2107,6 +2296,10 @@ bool TIntermediate::promoteUnary(TIntermUnary& node)
|
|||||||
case EOpBitwiseNot:
|
case EOpBitwiseNot:
|
||||||
if (operand->getBasicType() != EbtInt &&
|
if (operand->getBasicType() != EbtInt &&
|
||||||
operand->getBasicType() != EbtUint &&
|
operand->getBasicType() != EbtUint &&
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
operand->getBasicType() != EbtInt16 &&
|
||||||
|
operand->getBasicType() != EbtUint16 &&
|
||||||
|
#endif
|
||||||
operand->getBasicType() != EbtInt64 &&
|
operand->getBasicType() != EbtInt64 &&
|
||||||
operand->getBasicType() != EbtUint64)
|
operand->getBasicType() != EbtUint64)
|
||||||
|
|
||||||
@ -2121,6 +2314,10 @@ bool TIntermediate::promoteUnary(TIntermUnary& node)
|
|||||||
operand->getBasicType() != EbtUint &&
|
operand->getBasicType() != EbtUint &&
|
||||||
operand->getBasicType() != EbtInt64 &&
|
operand->getBasicType() != EbtInt64 &&
|
||||||
operand->getBasicType() != EbtUint64 &&
|
operand->getBasicType() != EbtUint64 &&
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
operand->getBasicType() != EbtInt16 &&
|
||||||
|
operand->getBasicType() != EbtUint16 &&
|
||||||
|
#endif
|
||||||
operand->getBasicType() != EbtFloat &&
|
operand->getBasicType() != EbtFloat &&
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
operand->getBasicType() != EbtFloat16 &&
|
operand->getBasicType() != EbtFloat16 &&
|
||||||
@ -2327,8 +2524,14 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
|
|||||||
|
|
||||||
// Check for integer-only operands.
|
// Check for integer-only operands.
|
||||||
if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint &&
|
if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint &&
|
||||||
left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) ||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
left->getBasicType() != EbtInt16 && left->getBasicType() != EbtUint16 &&
|
||||||
|
#endif
|
||||||
|
left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) ||
|
||||||
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint &&
|
(right->getBasicType() != EbtInt && right->getBasicType() != EbtUint &&
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
right->getBasicType() != EbtInt16 && right->getBasicType() != EbtUint16 &&
|
||||||
|
#endif
|
||||||
right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64))
|
right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64))
|
||||||
return false;
|
return false;
|
||||||
if (left->isMatrix() || right->isMatrix())
|
if (left->isMatrix() || right->isMatrix())
|
||||||
|
@ -2220,6 +2220,10 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
|
|||||||
case EOpConstructUint:
|
case EOpConstructUint:
|
||||||
case EOpConstructInt64:
|
case EOpConstructInt64:
|
||||||
case EOpConstructUint64:
|
case EOpConstructUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructInt16:
|
||||||
|
case EOpConstructUint16:
|
||||||
|
#endif
|
||||||
case EOpConstructBool:
|
case EOpConstructBool:
|
||||||
case EOpConstructBVec2:
|
case EOpConstructBVec2:
|
||||||
case EOpConstructBVec3:
|
case EOpConstructBVec3:
|
||||||
@ -2236,6 +2240,14 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
|
|||||||
case EOpConstructU64Vec2:
|
case EOpConstructU64Vec2:
|
||||||
case EOpConstructU64Vec3:
|
case EOpConstructU64Vec3:
|
||||||
case EOpConstructU64Vec4:
|
case EOpConstructU64Vec4:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructI16Vec2:
|
||||||
|
case EOpConstructI16Vec3:
|
||||||
|
case EOpConstructI16Vec4:
|
||||||
|
case EOpConstructU16Vec2:
|
||||||
|
case EOpConstructU16Vec3:
|
||||||
|
case EOpConstructU16Vec4:
|
||||||
|
#endif
|
||||||
// This was the list of valid ones, if they aren't converting from float
|
// This was the list of valid ones, if they aren't converting from float
|
||||||
// and aren't making an array.
|
// and aren't making an array.
|
||||||
makeSpecConst = ! floatArgument && ! type.isArray();
|
makeSpecConst = ! floatArgument && ! type.isArray();
|
||||||
@ -2528,6 +2540,9 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 ||
|
||||||
|
#endif
|
||||||
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||||
publicType.basicType == EbtDouble)
|
publicType.basicType == EbtDouble)
|
||||||
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
||||||
@ -2538,6 +2553,9 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
|||||||
if (!qualifier.flat) {
|
if (!qualifier.flat) {
|
||||||
#endif
|
#endif
|
||||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 ||
|
||||||
|
#endif
|
||||||
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||||
publicType.basicType == EbtDouble ||
|
publicType.basicType == EbtDouble ||
|
||||||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
|
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) ||
|
||||||
@ -4634,6 +4652,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
|
#endif
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
@ -5580,6 +5602,22 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
|||||||
basicOp = EOpConstructUint64;
|
basicOp = EOpConstructUint64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructI16Vec2:
|
||||||
|
case EOpConstructI16Vec3:
|
||||||
|
case EOpConstructI16Vec4:
|
||||||
|
case EOpConstructInt16:
|
||||||
|
basicOp = EOpConstructInt16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EOpConstructU16Vec2:
|
||||||
|
case EOpConstructU16Vec3:
|
||||||
|
case EOpConstructU16Vec4:
|
||||||
|
case EOpConstructUint16:
|
||||||
|
basicOp = EOpConstructUint16;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case EOpConstructBVec2:
|
case EOpConstructBVec2:
|
||||||
case EOpConstructBVec3:
|
case EOpConstructBVec3:
|
||||||
case EOpConstructBVec4:
|
case EOpConstructBVec4:
|
||||||
|
@ -464,6 +464,15 @@ void TScanContext::fillInKeywordMap()
|
|||||||
(*KeywordMap)["u64vec4"] = U64VEC4;
|
(*KeywordMap)["u64vec4"] = U64VEC4;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
(*KeywordMap)["int16_t"] = INT16_T;
|
||||||
|
(*KeywordMap)["uint16_t"] = UINT16_T;
|
||||||
|
(*KeywordMap)["i16vec2"] = I16VEC2;
|
||||||
|
(*KeywordMap)["i16vec3"] = I16VEC3;
|
||||||
|
(*KeywordMap)["i16vec4"] = I16VEC4;
|
||||||
|
(*KeywordMap)["u16vec2"] = U16VEC2;
|
||||||
|
(*KeywordMap)["u16vec3"] = U16VEC3;
|
||||||
|
(*KeywordMap)["u16vec4"] = U16VEC4;
|
||||||
|
|
||||||
(*KeywordMap)["float16_t"] = FLOAT16_T;
|
(*KeywordMap)["float16_t"] = FLOAT16_T;
|
||||||
(*KeywordMap)["f16vec2"] = F16VEC2;
|
(*KeywordMap)["f16vec2"] = F16VEC2;
|
||||||
(*KeywordMap)["f16vec3"] = F16VEC3;
|
(*KeywordMap)["f16vec3"] = F16VEC3;
|
||||||
@ -709,6 +718,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
|||||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||||
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT;
|
||||||
|
case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT;
|
||||||
|
#endif
|
||||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
@ -973,6 +986,21 @@ int TScanContext::tokenizeIdentifier()
|
|||||||
return identifierOrType();
|
return identifierOrType();
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case INT16_T:
|
||||||
|
case UINT16_T:
|
||||||
|
case I16VEC2:
|
||||||
|
case I16VEC3:
|
||||||
|
case I16VEC4:
|
||||||
|
case U16VEC2:
|
||||||
|
case U16VEC3:
|
||||||
|
case U16VEC4:
|
||||||
|
afterType = true;
|
||||||
|
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||||
|
(parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) &&
|
||||||
|
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||||
|
return keyword;
|
||||||
|
return identifierOrType();
|
||||||
|
|
||||||
case FLOAT16_T:
|
case FLOAT16_T:
|
||||||
case F16VEC2:
|
case F16VEC2:
|
||||||
case F16VEC3:
|
case F16VEC3:
|
||||||
|
@ -67,6 +67,10 @@ void TType::buildMangledName(TString& mangledName) const
|
|||||||
case EbtUint: mangledName += 'u'; break;
|
case EbtUint: mangledName += 'u'; break;
|
||||||
case EbtInt64: mangledName += "i64"; break;
|
case EbtInt64: mangledName += "i64"; break;
|
||||||
case EbtUint64: mangledName += "u64"; break;
|
case EbtUint64: mangledName += "u64"; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16: mangledName += "i16"; break;
|
||||||
|
case EbtUint16: mangledName += "u16"; break;
|
||||||
|
#endif
|
||||||
case EbtBool: mangledName += 'b'; break;
|
case EbtBool: mangledName += 'b'; break;
|
||||||
case EbtAtomicUint: mangledName += "au"; break;
|
case EbtAtomicUint: mangledName += "au"; break;
|
||||||
case EbtSampler:
|
case EbtSampler:
|
||||||
|
@ -195,6 +195,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_AMD_gcn_shader] = EBhDisable;
|
extensionBehavior[E_GL_AMD_gcn_shader] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable;
|
extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable;
|
extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
@ -318,6 +319,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_AMD_gcn_shader 1\n"
|
"#define GL_AMD_gcn_shader 1\n"
|
||||||
"#define GL_AMD_gpu_shader_half_float 1\n"
|
"#define GL_AMD_gpu_shader_half_float 1\n"
|
||||||
"#define GL_AMD_texture_gather_bias_lod 1\n"
|
"#define GL_AMD_texture_gather_bias_lod 1\n"
|
||||||
|
"#define GL_AMD_gpu_shader_int16 1\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
@ -710,10 +712,21 @@ void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
// Call for any operation needing float16 data-type support.
|
// Call for any operation needing GLSL 16-bit integer data-type support.
|
||||||
|
void TParseVersions::int16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||||
|
{
|
||||||
|
if (! builtIn) {
|
||||||
|
requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_int16, "shader int16");
|
||||||
|
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||||
|
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||||
|
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call for any operation needing GLSL float16 data-type support.
|
||||||
void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||||
{
|
{
|
||||||
if (!builtIn) {
|
if (! builtIn) {
|
||||||
requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, "shader half float");
|
requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, "shader half float");
|
||||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||||
|
@ -147,7 +147,9 @@ const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader
|
|||||||
const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader";
|
const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader";
|
||||||
const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float";
|
const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float";
|
||||||
const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod";
|
const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod";
|
||||||
|
const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
|
|
||||||
const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage";
|
const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage";
|
||||||
|
@ -121,7 +121,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%expect 1 // One shift reduce conflict because of if | else
|
%expect 1 // One shift reduce conflict because of if | else
|
||||||
|
|
||||||
%token <lex> ATTRIBUTE VARYING
|
%token <lex> ATTRIBUTE VARYING
|
||||||
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T FLOAT16_T
|
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T INT16_T UINT16_T FLOAT16_T
|
||||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
|
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
|
||||||
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4
|
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4
|
||||||
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
|
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
|
||||||
@ -129,6 +129,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
||||||
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
|
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
|
||||||
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
|
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
|
||||||
|
%token <lex> I16VEC2 I16VEC3 I16VEC4 U16VEC2 U16VEC3 U16VEC4
|
||||||
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD
|
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD
|
||||||
|
|
||||||
%token <lex> MAT2X2 MAT2X3 MAT2X4
|
%token <lex> MAT2X2 MAT2X3 MAT2X4
|
||||||
@ -188,7 +189,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%token <lex> STRUCT VOID WHILE
|
%token <lex> STRUCT VOID WHILE
|
||||||
|
|
||||||
%token <lex> IDENTIFIER TYPE_NAME
|
%token <lex> IDENTIFIER TYPE_NAME
|
||||||
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT FLOAT16CONSTANT
|
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT INT16CONSTANT UINT16CONSTANT BOOLCONSTANT FLOAT16CONSTANT
|
||||||
%token <lex> LEFT_OP RIGHT_OP
|
%token <lex> LEFT_OP RIGHT_OP
|
||||||
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
|
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
|
||||||
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
||||||
@ -273,6 +274,18 @@ primary_expression
|
|||||||
parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
|
parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
|
||||||
$$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
|
$$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
|
||||||
}
|
}
|
||||||
|
| INT16CONSTANT {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit integer literal");
|
||||||
|
$$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| UINT16CONSTANT {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit unsigned integer literal");
|
||||||
|
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
| FLOATCONSTANT {
|
| FLOATCONSTANT {
|
||||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||||
}
|
}
|
||||||
@ -1363,6 +1376,20 @@ type_specifier_nonarray
|
|||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtUint64;
|
$$.basicType = EbtUint64;
|
||||||
}
|
}
|
||||||
|
| INT16_T {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt16;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| UINT16_T {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint16;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
| BOOL {
|
| BOOL {
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtBool;
|
$$.basicType = EbtBool;
|
||||||
@ -1472,6 +1499,30 @@ type_specifier_nonarray
|
|||||||
$$.basicType = EbtInt64;
|
$$.basicType = EbtInt64;
|
||||||
$$.setVector(4);
|
$$.setVector(4);
|
||||||
}
|
}
|
||||||
|
| I16VEC2 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt16;
|
||||||
|
$$.setVector(2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| I16VEC3 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt16;
|
||||||
|
$$.setVector(3);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| I16VEC4 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtInt16;
|
||||||
|
$$.setVector(4);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
| UVEC2 {
|
| UVEC2 {
|
||||||
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
@ -1508,6 +1559,30 @@ type_specifier_nonarray
|
|||||||
$$.basicType = EbtUint64;
|
$$.basicType = EbtUint64;
|
||||||
$$.setVector(4);
|
$$.setVector(4);
|
||||||
}
|
}
|
||||||
|
| U16VEC2 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint16;
|
||||||
|
$$.setVector(2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| U16VEC3 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint16;
|
||||||
|
$$.setVector(3);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
| U16VEC4 {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||||
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
|
$$.basicType = EbtUint16;
|
||||||
|
$$.setVector(4);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
| MAT2 {
|
| MAT2 {
|
||||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||||
$$.basicType = EbtFloat;
|
$$.basicType = EbtFloat;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,10 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* A Bison parser, made by GNU Bison 2.4.1. */
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -30,315 +32,319 @@
|
|||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
|
||||||
# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
|
||||||
/* Debug traces. */
|
|
||||||
#ifndef YYDEBUG
|
|
||||||
# define YYDEBUG 1
|
|
||||||
#endif
|
|
||||||
#if YYDEBUG
|
|
||||||
extern int yydebug;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Token type. */
|
/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
{
|
know about them. */
|
||||||
ATTRIBUTE = 258,
|
enum yytokentype {
|
||||||
VARYING = 259,
|
ATTRIBUTE = 258,
|
||||||
CONST = 260,
|
VARYING = 259,
|
||||||
BOOL = 261,
|
CONST = 260,
|
||||||
FLOAT = 262,
|
BOOL = 261,
|
||||||
DOUBLE = 263,
|
FLOAT = 262,
|
||||||
INT = 264,
|
DOUBLE = 263,
|
||||||
UINT = 265,
|
INT = 264,
|
||||||
INT64_T = 266,
|
UINT = 265,
|
||||||
UINT64_T = 267,
|
INT64_T = 266,
|
||||||
FLOAT16_T = 268,
|
UINT64_T = 267,
|
||||||
BREAK = 269,
|
INT16_T = 268,
|
||||||
CONTINUE = 270,
|
UINT16_T = 269,
|
||||||
DO = 271,
|
FLOAT16_T = 270,
|
||||||
ELSE = 272,
|
BREAK = 271,
|
||||||
FOR = 273,
|
CONTINUE = 272,
|
||||||
IF = 274,
|
DO = 273,
|
||||||
DISCARD = 275,
|
ELSE = 274,
|
||||||
RETURN = 276,
|
FOR = 275,
|
||||||
SWITCH = 277,
|
IF = 276,
|
||||||
CASE = 278,
|
DISCARD = 277,
|
||||||
DEFAULT = 279,
|
RETURN = 278,
|
||||||
SUBROUTINE = 280,
|
SWITCH = 279,
|
||||||
BVEC2 = 281,
|
CASE = 280,
|
||||||
BVEC3 = 282,
|
DEFAULT = 281,
|
||||||
BVEC4 = 283,
|
SUBROUTINE = 282,
|
||||||
IVEC2 = 284,
|
BVEC2 = 283,
|
||||||
IVEC3 = 285,
|
BVEC3 = 284,
|
||||||
IVEC4 = 286,
|
BVEC4 = 285,
|
||||||
I64VEC2 = 287,
|
IVEC2 = 286,
|
||||||
I64VEC3 = 288,
|
IVEC3 = 287,
|
||||||
I64VEC4 = 289,
|
IVEC4 = 288,
|
||||||
UVEC2 = 290,
|
I64VEC2 = 289,
|
||||||
UVEC3 = 291,
|
I64VEC3 = 290,
|
||||||
UVEC4 = 292,
|
I64VEC4 = 291,
|
||||||
U64VEC2 = 293,
|
UVEC2 = 292,
|
||||||
U64VEC3 = 294,
|
UVEC3 = 293,
|
||||||
U64VEC4 = 295,
|
UVEC4 = 294,
|
||||||
VEC2 = 296,
|
U64VEC2 = 295,
|
||||||
VEC3 = 297,
|
U64VEC3 = 296,
|
||||||
VEC4 = 298,
|
U64VEC4 = 297,
|
||||||
MAT2 = 299,
|
VEC2 = 298,
|
||||||
MAT3 = 300,
|
VEC3 = 299,
|
||||||
MAT4 = 301,
|
VEC4 = 300,
|
||||||
CENTROID = 302,
|
MAT2 = 301,
|
||||||
IN = 303,
|
MAT3 = 302,
|
||||||
OUT = 304,
|
MAT4 = 303,
|
||||||
INOUT = 305,
|
CENTROID = 304,
|
||||||
UNIFORM = 306,
|
IN = 305,
|
||||||
PATCH = 307,
|
OUT = 306,
|
||||||
SAMPLE = 308,
|
INOUT = 307,
|
||||||
BUFFER = 309,
|
UNIFORM = 308,
|
||||||
SHARED = 310,
|
PATCH = 309,
|
||||||
COHERENT = 311,
|
SAMPLE = 310,
|
||||||
VOLATILE = 312,
|
BUFFER = 311,
|
||||||
RESTRICT = 313,
|
SHARED = 312,
|
||||||
READONLY = 314,
|
COHERENT = 313,
|
||||||
WRITEONLY = 315,
|
VOLATILE = 314,
|
||||||
DVEC2 = 316,
|
RESTRICT = 315,
|
||||||
DVEC3 = 317,
|
READONLY = 316,
|
||||||
DVEC4 = 318,
|
WRITEONLY = 317,
|
||||||
DMAT2 = 319,
|
DVEC2 = 318,
|
||||||
DMAT3 = 320,
|
DVEC3 = 319,
|
||||||
DMAT4 = 321,
|
DVEC4 = 320,
|
||||||
F16VEC2 = 322,
|
DMAT2 = 321,
|
||||||
F16VEC3 = 323,
|
DMAT3 = 322,
|
||||||
F16VEC4 = 324,
|
DMAT4 = 323,
|
||||||
F16MAT2 = 325,
|
F16VEC2 = 324,
|
||||||
F16MAT3 = 326,
|
F16VEC3 = 325,
|
||||||
F16MAT4 = 327,
|
F16VEC4 = 326,
|
||||||
NOPERSPECTIVE = 328,
|
F16MAT2 = 327,
|
||||||
FLAT = 329,
|
F16MAT3 = 328,
|
||||||
SMOOTH = 330,
|
F16MAT4 = 329,
|
||||||
LAYOUT = 331,
|
I16VEC2 = 330,
|
||||||
__EXPLICITINTERPAMD = 332,
|
I16VEC3 = 331,
|
||||||
MAT2X2 = 333,
|
I16VEC4 = 332,
|
||||||
MAT2X3 = 334,
|
U16VEC2 = 333,
|
||||||
MAT2X4 = 335,
|
U16VEC3 = 334,
|
||||||
MAT3X2 = 336,
|
U16VEC4 = 335,
|
||||||
MAT3X3 = 337,
|
NOPERSPECTIVE = 336,
|
||||||
MAT3X4 = 338,
|
FLAT = 337,
|
||||||
MAT4X2 = 339,
|
SMOOTH = 338,
|
||||||
MAT4X3 = 340,
|
LAYOUT = 339,
|
||||||
MAT4X4 = 341,
|
__EXPLICITINTERPAMD = 340,
|
||||||
DMAT2X2 = 342,
|
MAT2X2 = 341,
|
||||||
DMAT2X3 = 343,
|
MAT2X3 = 342,
|
||||||
DMAT2X4 = 344,
|
MAT2X4 = 343,
|
||||||
DMAT3X2 = 345,
|
MAT3X2 = 344,
|
||||||
DMAT3X3 = 346,
|
MAT3X3 = 345,
|
||||||
DMAT3X4 = 347,
|
MAT3X4 = 346,
|
||||||
DMAT4X2 = 348,
|
MAT4X2 = 347,
|
||||||
DMAT4X3 = 349,
|
MAT4X3 = 348,
|
||||||
DMAT4X4 = 350,
|
MAT4X4 = 349,
|
||||||
F16MAT2X2 = 351,
|
DMAT2X2 = 350,
|
||||||
F16MAT2X3 = 352,
|
DMAT2X3 = 351,
|
||||||
F16MAT2X4 = 353,
|
DMAT2X4 = 352,
|
||||||
F16MAT3X2 = 354,
|
DMAT3X2 = 353,
|
||||||
F16MAT3X3 = 355,
|
DMAT3X3 = 354,
|
||||||
F16MAT3X4 = 356,
|
DMAT3X4 = 355,
|
||||||
F16MAT4X2 = 357,
|
DMAT4X2 = 356,
|
||||||
F16MAT4X3 = 358,
|
DMAT4X3 = 357,
|
||||||
F16MAT4X4 = 359,
|
DMAT4X4 = 358,
|
||||||
ATOMIC_UINT = 360,
|
F16MAT2X2 = 359,
|
||||||
SAMPLER1D = 361,
|
F16MAT2X3 = 360,
|
||||||
SAMPLER2D = 362,
|
F16MAT2X4 = 361,
|
||||||
SAMPLER3D = 363,
|
F16MAT3X2 = 362,
|
||||||
SAMPLERCUBE = 364,
|
F16MAT3X3 = 363,
|
||||||
SAMPLER1DSHADOW = 365,
|
F16MAT3X4 = 364,
|
||||||
SAMPLER2DSHADOW = 366,
|
F16MAT4X2 = 365,
|
||||||
SAMPLERCUBESHADOW = 367,
|
F16MAT4X3 = 366,
|
||||||
SAMPLER1DARRAY = 368,
|
F16MAT4X4 = 367,
|
||||||
SAMPLER2DARRAY = 369,
|
ATOMIC_UINT = 368,
|
||||||
SAMPLER1DARRAYSHADOW = 370,
|
SAMPLER1D = 369,
|
||||||
SAMPLER2DARRAYSHADOW = 371,
|
SAMPLER2D = 370,
|
||||||
ISAMPLER1D = 372,
|
SAMPLER3D = 371,
|
||||||
ISAMPLER2D = 373,
|
SAMPLERCUBE = 372,
|
||||||
ISAMPLER3D = 374,
|
SAMPLER1DSHADOW = 373,
|
||||||
ISAMPLERCUBE = 375,
|
SAMPLER2DSHADOW = 374,
|
||||||
ISAMPLER1DARRAY = 376,
|
SAMPLERCUBESHADOW = 375,
|
||||||
ISAMPLER2DARRAY = 377,
|
SAMPLER1DARRAY = 376,
|
||||||
USAMPLER1D = 378,
|
SAMPLER2DARRAY = 377,
|
||||||
USAMPLER2D = 379,
|
SAMPLER1DARRAYSHADOW = 378,
|
||||||
USAMPLER3D = 380,
|
SAMPLER2DARRAYSHADOW = 379,
|
||||||
USAMPLERCUBE = 381,
|
ISAMPLER1D = 380,
|
||||||
USAMPLER1DARRAY = 382,
|
ISAMPLER2D = 381,
|
||||||
USAMPLER2DARRAY = 383,
|
ISAMPLER3D = 382,
|
||||||
SAMPLER2DRECT = 384,
|
ISAMPLERCUBE = 383,
|
||||||
SAMPLER2DRECTSHADOW = 385,
|
ISAMPLER1DARRAY = 384,
|
||||||
ISAMPLER2DRECT = 386,
|
ISAMPLER2DARRAY = 385,
|
||||||
USAMPLER2DRECT = 387,
|
USAMPLER1D = 386,
|
||||||
SAMPLERBUFFER = 388,
|
USAMPLER2D = 387,
|
||||||
ISAMPLERBUFFER = 389,
|
USAMPLER3D = 388,
|
||||||
USAMPLERBUFFER = 390,
|
USAMPLERCUBE = 389,
|
||||||
SAMPLERCUBEARRAY = 391,
|
USAMPLER1DARRAY = 390,
|
||||||
SAMPLERCUBEARRAYSHADOW = 392,
|
USAMPLER2DARRAY = 391,
|
||||||
ISAMPLERCUBEARRAY = 393,
|
SAMPLER2DRECT = 392,
|
||||||
USAMPLERCUBEARRAY = 394,
|
SAMPLER2DRECTSHADOW = 393,
|
||||||
SAMPLER2DMS = 395,
|
ISAMPLER2DRECT = 394,
|
||||||
ISAMPLER2DMS = 396,
|
USAMPLER2DRECT = 395,
|
||||||
USAMPLER2DMS = 397,
|
SAMPLERBUFFER = 396,
|
||||||
SAMPLER2DMSARRAY = 398,
|
ISAMPLERBUFFER = 397,
|
||||||
ISAMPLER2DMSARRAY = 399,
|
USAMPLERBUFFER = 398,
|
||||||
USAMPLER2DMSARRAY = 400,
|
SAMPLERCUBEARRAY = 399,
|
||||||
SAMPLEREXTERNALOES = 401,
|
SAMPLERCUBEARRAYSHADOW = 400,
|
||||||
SAMPLER = 402,
|
ISAMPLERCUBEARRAY = 401,
|
||||||
SAMPLERSHADOW = 403,
|
USAMPLERCUBEARRAY = 402,
|
||||||
TEXTURE1D = 404,
|
SAMPLER2DMS = 403,
|
||||||
TEXTURE2D = 405,
|
ISAMPLER2DMS = 404,
|
||||||
TEXTURE3D = 406,
|
USAMPLER2DMS = 405,
|
||||||
TEXTURECUBE = 407,
|
SAMPLER2DMSARRAY = 406,
|
||||||
TEXTURE1DARRAY = 408,
|
ISAMPLER2DMSARRAY = 407,
|
||||||
TEXTURE2DARRAY = 409,
|
USAMPLER2DMSARRAY = 408,
|
||||||
ITEXTURE1D = 410,
|
SAMPLEREXTERNALOES = 409,
|
||||||
ITEXTURE2D = 411,
|
SAMPLER = 410,
|
||||||
ITEXTURE3D = 412,
|
SAMPLERSHADOW = 411,
|
||||||
ITEXTURECUBE = 413,
|
TEXTURE1D = 412,
|
||||||
ITEXTURE1DARRAY = 414,
|
TEXTURE2D = 413,
|
||||||
ITEXTURE2DARRAY = 415,
|
TEXTURE3D = 414,
|
||||||
UTEXTURE1D = 416,
|
TEXTURECUBE = 415,
|
||||||
UTEXTURE2D = 417,
|
TEXTURE1DARRAY = 416,
|
||||||
UTEXTURE3D = 418,
|
TEXTURE2DARRAY = 417,
|
||||||
UTEXTURECUBE = 419,
|
ITEXTURE1D = 418,
|
||||||
UTEXTURE1DARRAY = 420,
|
ITEXTURE2D = 419,
|
||||||
UTEXTURE2DARRAY = 421,
|
ITEXTURE3D = 420,
|
||||||
TEXTURE2DRECT = 422,
|
ITEXTURECUBE = 421,
|
||||||
ITEXTURE2DRECT = 423,
|
ITEXTURE1DARRAY = 422,
|
||||||
UTEXTURE2DRECT = 424,
|
ITEXTURE2DARRAY = 423,
|
||||||
TEXTUREBUFFER = 425,
|
UTEXTURE1D = 424,
|
||||||
ITEXTUREBUFFER = 426,
|
UTEXTURE2D = 425,
|
||||||
UTEXTUREBUFFER = 427,
|
UTEXTURE3D = 426,
|
||||||
TEXTURECUBEARRAY = 428,
|
UTEXTURECUBE = 427,
|
||||||
ITEXTURECUBEARRAY = 429,
|
UTEXTURE1DARRAY = 428,
|
||||||
UTEXTURECUBEARRAY = 430,
|
UTEXTURE2DARRAY = 429,
|
||||||
TEXTURE2DMS = 431,
|
TEXTURE2DRECT = 430,
|
||||||
ITEXTURE2DMS = 432,
|
ITEXTURE2DRECT = 431,
|
||||||
UTEXTURE2DMS = 433,
|
UTEXTURE2DRECT = 432,
|
||||||
TEXTURE2DMSARRAY = 434,
|
TEXTUREBUFFER = 433,
|
||||||
ITEXTURE2DMSARRAY = 435,
|
ITEXTUREBUFFER = 434,
|
||||||
UTEXTURE2DMSARRAY = 436,
|
UTEXTUREBUFFER = 435,
|
||||||
SUBPASSINPUT = 437,
|
TEXTURECUBEARRAY = 436,
|
||||||
SUBPASSINPUTMS = 438,
|
ITEXTURECUBEARRAY = 437,
|
||||||
ISUBPASSINPUT = 439,
|
UTEXTURECUBEARRAY = 438,
|
||||||
ISUBPASSINPUTMS = 440,
|
TEXTURE2DMS = 439,
|
||||||
USUBPASSINPUT = 441,
|
ITEXTURE2DMS = 440,
|
||||||
USUBPASSINPUTMS = 442,
|
UTEXTURE2DMS = 441,
|
||||||
IMAGE1D = 443,
|
TEXTURE2DMSARRAY = 442,
|
||||||
IIMAGE1D = 444,
|
ITEXTURE2DMSARRAY = 443,
|
||||||
UIMAGE1D = 445,
|
UTEXTURE2DMSARRAY = 444,
|
||||||
IMAGE2D = 446,
|
SUBPASSINPUT = 445,
|
||||||
IIMAGE2D = 447,
|
SUBPASSINPUTMS = 446,
|
||||||
UIMAGE2D = 448,
|
ISUBPASSINPUT = 447,
|
||||||
IMAGE3D = 449,
|
ISUBPASSINPUTMS = 448,
|
||||||
IIMAGE3D = 450,
|
USUBPASSINPUT = 449,
|
||||||
UIMAGE3D = 451,
|
USUBPASSINPUTMS = 450,
|
||||||
IMAGE2DRECT = 452,
|
IMAGE1D = 451,
|
||||||
IIMAGE2DRECT = 453,
|
IIMAGE1D = 452,
|
||||||
UIMAGE2DRECT = 454,
|
UIMAGE1D = 453,
|
||||||
IMAGECUBE = 455,
|
IMAGE2D = 454,
|
||||||
IIMAGECUBE = 456,
|
IIMAGE2D = 455,
|
||||||
UIMAGECUBE = 457,
|
UIMAGE2D = 456,
|
||||||
IMAGEBUFFER = 458,
|
IMAGE3D = 457,
|
||||||
IIMAGEBUFFER = 459,
|
IIMAGE3D = 458,
|
||||||
UIMAGEBUFFER = 460,
|
UIMAGE3D = 459,
|
||||||
IMAGE1DARRAY = 461,
|
IMAGE2DRECT = 460,
|
||||||
IIMAGE1DARRAY = 462,
|
IIMAGE2DRECT = 461,
|
||||||
UIMAGE1DARRAY = 463,
|
UIMAGE2DRECT = 462,
|
||||||
IMAGE2DARRAY = 464,
|
IMAGECUBE = 463,
|
||||||
IIMAGE2DARRAY = 465,
|
IIMAGECUBE = 464,
|
||||||
UIMAGE2DARRAY = 466,
|
UIMAGECUBE = 465,
|
||||||
IMAGECUBEARRAY = 467,
|
IMAGEBUFFER = 466,
|
||||||
IIMAGECUBEARRAY = 468,
|
IIMAGEBUFFER = 467,
|
||||||
UIMAGECUBEARRAY = 469,
|
UIMAGEBUFFER = 468,
|
||||||
IMAGE2DMS = 470,
|
IMAGE1DARRAY = 469,
|
||||||
IIMAGE2DMS = 471,
|
IIMAGE1DARRAY = 470,
|
||||||
UIMAGE2DMS = 472,
|
UIMAGE1DARRAY = 471,
|
||||||
IMAGE2DMSARRAY = 473,
|
IMAGE2DARRAY = 472,
|
||||||
IIMAGE2DMSARRAY = 474,
|
IIMAGE2DARRAY = 473,
|
||||||
UIMAGE2DMSARRAY = 475,
|
UIMAGE2DARRAY = 474,
|
||||||
STRUCT = 476,
|
IMAGECUBEARRAY = 475,
|
||||||
VOID = 477,
|
IIMAGECUBEARRAY = 476,
|
||||||
WHILE = 478,
|
UIMAGECUBEARRAY = 477,
|
||||||
IDENTIFIER = 479,
|
IMAGE2DMS = 478,
|
||||||
TYPE_NAME = 480,
|
IIMAGE2DMS = 479,
|
||||||
FLOATCONSTANT = 481,
|
UIMAGE2DMS = 480,
|
||||||
DOUBLECONSTANT = 482,
|
IMAGE2DMSARRAY = 481,
|
||||||
INTCONSTANT = 483,
|
IIMAGE2DMSARRAY = 482,
|
||||||
UINTCONSTANT = 484,
|
UIMAGE2DMSARRAY = 483,
|
||||||
INT64CONSTANT = 485,
|
STRUCT = 484,
|
||||||
UINT64CONSTANT = 486,
|
VOID = 485,
|
||||||
BOOLCONSTANT = 487,
|
WHILE = 486,
|
||||||
FLOAT16CONSTANT = 488,
|
IDENTIFIER = 487,
|
||||||
LEFT_OP = 489,
|
TYPE_NAME = 488,
|
||||||
RIGHT_OP = 490,
|
FLOATCONSTANT = 489,
|
||||||
INC_OP = 491,
|
DOUBLECONSTANT = 490,
|
||||||
DEC_OP = 492,
|
INTCONSTANT = 491,
|
||||||
LE_OP = 493,
|
UINTCONSTANT = 492,
|
||||||
GE_OP = 494,
|
INT64CONSTANT = 493,
|
||||||
EQ_OP = 495,
|
UINT64CONSTANT = 494,
|
||||||
NE_OP = 496,
|
INT16CONSTANT = 495,
|
||||||
AND_OP = 497,
|
UINT16CONSTANT = 496,
|
||||||
OR_OP = 498,
|
BOOLCONSTANT = 497,
|
||||||
XOR_OP = 499,
|
FLOAT16CONSTANT = 498,
|
||||||
MUL_ASSIGN = 500,
|
LEFT_OP = 499,
|
||||||
DIV_ASSIGN = 501,
|
RIGHT_OP = 500,
|
||||||
ADD_ASSIGN = 502,
|
INC_OP = 501,
|
||||||
MOD_ASSIGN = 503,
|
DEC_OP = 502,
|
||||||
LEFT_ASSIGN = 504,
|
LE_OP = 503,
|
||||||
RIGHT_ASSIGN = 505,
|
GE_OP = 504,
|
||||||
AND_ASSIGN = 506,
|
EQ_OP = 505,
|
||||||
XOR_ASSIGN = 507,
|
NE_OP = 506,
|
||||||
OR_ASSIGN = 508,
|
AND_OP = 507,
|
||||||
SUB_ASSIGN = 509,
|
OR_OP = 508,
|
||||||
LEFT_PAREN = 510,
|
XOR_OP = 509,
|
||||||
RIGHT_PAREN = 511,
|
MUL_ASSIGN = 510,
|
||||||
LEFT_BRACKET = 512,
|
DIV_ASSIGN = 511,
|
||||||
RIGHT_BRACKET = 513,
|
ADD_ASSIGN = 512,
|
||||||
LEFT_BRACE = 514,
|
MOD_ASSIGN = 513,
|
||||||
RIGHT_BRACE = 515,
|
LEFT_ASSIGN = 514,
|
||||||
DOT = 516,
|
RIGHT_ASSIGN = 515,
|
||||||
COMMA = 517,
|
AND_ASSIGN = 516,
|
||||||
COLON = 518,
|
XOR_ASSIGN = 517,
|
||||||
EQUAL = 519,
|
OR_ASSIGN = 518,
|
||||||
SEMICOLON = 520,
|
SUB_ASSIGN = 519,
|
||||||
BANG = 521,
|
LEFT_PAREN = 520,
|
||||||
DASH = 522,
|
RIGHT_PAREN = 521,
|
||||||
TILDE = 523,
|
LEFT_BRACKET = 522,
|
||||||
PLUS = 524,
|
RIGHT_BRACKET = 523,
|
||||||
STAR = 525,
|
LEFT_BRACE = 524,
|
||||||
SLASH = 526,
|
RIGHT_BRACE = 525,
|
||||||
PERCENT = 527,
|
DOT = 526,
|
||||||
LEFT_ANGLE = 528,
|
COMMA = 527,
|
||||||
RIGHT_ANGLE = 529,
|
COLON = 528,
|
||||||
VERTICAL_BAR = 530,
|
EQUAL = 529,
|
||||||
CARET = 531,
|
SEMICOLON = 530,
|
||||||
AMPERSAND = 532,
|
BANG = 531,
|
||||||
QUESTION = 533,
|
DASH = 532,
|
||||||
INVARIANT = 534,
|
TILDE = 533,
|
||||||
PRECISE = 535,
|
PLUS = 534,
|
||||||
HIGH_PRECISION = 536,
|
STAR = 535,
|
||||||
MEDIUM_PRECISION = 537,
|
SLASH = 536,
|
||||||
LOW_PRECISION = 538,
|
PERCENT = 537,
|
||||||
PRECISION = 539,
|
LEFT_ANGLE = 538,
|
||||||
PACKED = 540,
|
RIGHT_ANGLE = 539,
|
||||||
RESOURCE = 541,
|
VERTICAL_BAR = 540,
|
||||||
SUPERP = 542
|
CARET = 541,
|
||||||
};
|
AMPERSAND = 542,
|
||||||
|
QUESTION = 543,
|
||||||
|
INVARIANT = 544,
|
||||||
|
PRECISE = 545,
|
||||||
|
HIGH_PRECISION = 546,
|
||||||
|
MEDIUM_PRECISION = 547,
|
||||||
|
LOW_PRECISION = 548,
|
||||||
|
PRECISION = 549,
|
||||||
|
PACKED = 550,
|
||||||
|
RESOURCE = 551,
|
||||||
|
SUPERP = 552
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Value type. */
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
||||||
|
|
||||||
union YYSTYPE
|
|
||||||
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
|
typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
|
||||||
|
/* Line 1676 of yacc.c */
|
||||||
|
#line 68 "glslang.y"
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
glslang::TSourceLoc loc;
|
glslang::TSourceLoc loc;
|
||||||
@ -372,16 +378,16 @@ union YYSTYPE
|
|||||||
};
|
};
|
||||||
} interm;
|
} interm;
|
||||||
|
|
||||||
#line 376 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef union YYSTYPE YYSTYPE;
|
|
||||||
|
/* Line 1676 of yacc.c */
|
||||||
|
#line 385 "glslang_tab.cpp.h"
|
||||||
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int yyparse (glslang::TParseContext* pParseContext);
|
|
||||||
|
|
||||||
#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */
|
|
||||||
|
@ -308,6 +308,13 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break;
|
case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break;
|
||||||
case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break;
|
case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break;
|
||||||
case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break;
|
case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpFloat16BitsToInt16: out.debug << "float16BitsToInt16"; break;
|
||||||
|
case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break;
|
||||||
|
case EOpInt16BitsToFloat16: out.debug << "int16BitsToFloat16"; break;
|
||||||
|
case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break;
|
case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break;
|
||||||
case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break;
|
case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break;
|
||||||
case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break;
|
case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break;
|
||||||
@ -328,6 +335,16 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break;
|
case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpPackInt2x16: out.debug << "packInt2x16"; break;
|
||||||
|
case EOpUnpackInt2x16: out.debug << "unpackInt2x16"; break;
|
||||||
|
case EOpPackUint2x16: out.debug << "packUint2x16"; break;
|
||||||
|
case EOpUnpackUint2x16: out.debug << "unpackUint2x16"; break;
|
||||||
|
|
||||||
|
case EOpPackInt4x16: out.debug << "packInt4x16"; break;
|
||||||
|
case EOpUnpackInt4x16: out.debug << "unpackInt4x16"; break;
|
||||||
|
case EOpPackUint4x16: out.debug << "packUint4x16"; break;
|
||||||
|
case EOpUnpackUint4x16: out.debug << "unpackUint4x16"; break;
|
||||||
|
|
||||||
case EOpPackFloat2x16: out.debug << "packFloat2x16"; break;
|
case EOpPackFloat2x16: out.debug << "packFloat2x16"; break;
|
||||||
case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break;
|
case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break;
|
||||||
#endif
|
#endif
|
||||||
@ -433,6 +450,42 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpConvFloat16ToDouble: out.debug << "Convert float16 to double"; break;
|
case EOpConvFloat16ToDouble: out.debug << "Convert float16 to double"; break;
|
||||||
case EOpConvFloat16ToInt64: out.debug << "Convert float16 to int64"; break;
|
case EOpConvFloat16ToInt64: out.debug << "Convert float16 to int64"; break;
|
||||||
case EOpConvFloat16ToUint64: out.debug << "Convert float16 to uint64"; break;
|
case EOpConvFloat16ToUint64: out.debug << "Convert float16 to uint64"; break;
|
||||||
|
|
||||||
|
case EOpConvBoolToInt16: out.debug << "Convert bool to int16"; break;
|
||||||
|
case EOpConvIntToInt16: out.debug << "Convert int to int16"; break;
|
||||||
|
case EOpConvUintToInt16: out.debug << "Convert uint to int16"; break;
|
||||||
|
case EOpConvFloatToInt16: out.debug << "Convert float to int16"; break;
|
||||||
|
case EOpConvDoubleToInt16: out.debug << "Convert double to int16"; break;
|
||||||
|
case EOpConvFloat16ToInt16: out.debug << "Convert float16 to int16"; break;
|
||||||
|
case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16"; break;
|
||||||
|
case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16"; break;
|
||||||
|
case EOpConvUint16ToInt16: out.debug << "Convert uint16 to int16"; break;
|
||||||
|
case EOpConvInt16ToBool: out.debug << "Convert int16 to bool"; break;
|
||||||
|
case EOpConvInt16ToInt: out.debug << "Convert int16 to int"; break;
|
||||||
|
case EOpConvInt16ToUint: out.debug << "Convert int16 to uint"; break;
|
||||||
|
case EOpConvInt16ToFloat: out.debug << "Convert int16 to float"; break;
|
||||||
|
case EOpConvInt16ToDouble: out.debug << "Convert int16 to double"; break;
|
||||||
|
case EOpConvInt16ToFloat16: out.debug << "Convert int16 to float16"; break;
|
||||||
|
case EOpConvInt16ToInt64: out.debug << "Convert int16 to int64"; break;
|
||||||
|
case EOpConvInt16ToUint64: out.debug << "Convert int16 to uint64"; break;
|
||||||
|
|
||||||
|
case EOpConvBoolToUint16: out.debug << "Convert bool to uint16"; break;
|
||||||
|
case EOpConvIntToUint16: out.debug << "Convert int to uint16"; break;
|
||||||
|
case EOpConvUintToUint16: out.debug << "Convert uint to uint16"; break;
|
||||||
|
case EOpConvFloatToUint16: out.debug << "Convert float to uint16"; break;
|
||||||
|
case EOpConvDoubleToUint16: out.debug << "Convert double to uint16"; break;
|
||||||
|
case EOpConvFloat16ToUint16: out.debug << "Convert float16 to uint16"; break;
|
||||||
|
case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16"; break;
|
||||||
|
case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break;
|
||||||
|
case EOpConvInt16ToUint16: out.debug << "Convert int16 to uint16"; break;
|
||||||
|
case EOpConvUint16ToBool: out.debug << "Convert uint16 to bool"; break;
|
||||||
|
case EOpConvUint16ToInt: out.debug << "Convert uint16 to int"; break;
|
||||||
|
case EOpConvUint16ToUint: out.debug << "Convert uint16 to uint"; break;
|
||||||
|
case EOpConvUint16ToFloat: out.debug << "Convert uint16 to float"; break;
|
||||||
|
case EOpConvUint16ToDouble: out.debug << "Convert uint16 to double"; break;
|
||||||
|
case EOpConvUint16ToFloat16: out.debug << "Convert uint16 to float16"; break;
|
||||||
|
case EOpConvUint16ToInt64: out.debug << "Convert uint16 to int64"; break;
|
||||||
|
case EOpConvUint16ToUint64: out.debug << "Convert uint16 to uint64"; break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default: out.debug.message(EPrefixError, "Bad unary op");
|
default: out.debug.message(EPrefixError, "Bad unary op");
|
||||||
@ -466,9 +519,13 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
|
|
||||||
case EOpConstructFloat: out.debug << "Construct float"; break;
|
case EOpConstructFloat: out.debug << "Construct float"; break;
|
||||||
case EOpConstructDouble:out.debug << "Construct double"; break;
|
case EOpConstructDouble:out.debug << "Construct double"; break;
|
||||||
|
|
||||||
case EOpConstructVec2: out.debug << "Construct vec2"; break;
|
case EOpConstructVec2: out.debug << "Construct vec2"; break;
|
||||||
case EOpConstructVec3: out.debug << "Construct vec3"; break;
|
case EOpConstructVec3: out.debug << "Construct vec3"; break;
|
||||||
case EOpConstructVec4: out.debug << "Construct vec4"; break;
|
case EOpConstructVec4: out.debug << "Construct vec4"; break;
|
||||||
|
case EOpConstructDVec2: out.debug << "Construct dvec2"; break;
|
||||||
|
case EOpConstructDVec3: out.debug << "Construct dvec3"; break;
|
||||||
|
case EOpConstructDVec4: out.debug << "Construct dvec4"; break;
|
||||||
case EOpConstructBool: out.debug << "Construct bool"; break;
|
case EOpConstructBool: out.debug << "Construct bool"; break;
|
||||||
case EOpConstructBVec2: out.debug << "Construct bvec2"; break;
|
case EOpConstructBVec2: out.debug << "Construct bvec2"; break;
|
||||||
case EOpConstructBVec3: out.debug << "Construct bvec3"; break;
|
case EOpConstructBVec3: out.debug << "Construct bvec3"; break;
|
||||||
@ -489,6 +546,16 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break;
|
case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break;
|
||||||
case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break;
|
case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break;
|
||||||
case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break;
|
case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpConstructInt16: out.debug << "Construct int16_t"; break;
|
||||||
|
case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break;
|
||||||
|
case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break;
|
||||||
|
case EOpConstructI16Vec4: out.debug << "Construct i16vec4"; break;
|
||||||
|
case EOpConstructUint16: out.debug << "Construct uint16_t"; break;
|
||||||
|
case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break;
|
||||||
|
case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break;
|
||||||
|
case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break;
|
||||||
|
#endif
|
||||||
case EOpConstructMat2x2: out.debug << "Construct mat2"; break;
|
case EOpConstructMat2x2: out.debug << "Construct mat2"; break;
|
||||||
case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break;
|
case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break;
|
||||||
case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break;
|
case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break;
|
||||||
@ -827,6 +894,26 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const
|
|||||||
out.debug << buf << "\n";
|
out.debug << buf << "\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
{
|
||||||
|
const int maxSize = 300;
|
||||||
|
char buf[maxSize];
|
||||||
|
snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int16_t");
|
||||||
|
|
||||||
|
out.debug << buf << "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint16:
|
||||||
|
{
|
||||||
|
const int maxSize = 300;
|
||||||
|
char buf[maxSize];
|
||||||
|
snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint16_t");
|
||||||
|
|
||||||
|
out.debug << buf << "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
|
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
|
||||||
break;
|
break;
|
||||||
|
@ -1057,6 +1057,8 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
|||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
case EbtDouble: size = 8; return 8;
|
case EbtDouble: size = 8; return 8;
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbtInt16:
|
||||||
|
case EbtUint16:
|
||||||
case EbtFloat16: size = 2; return 2;
|
case EbtFloat16: size = 2; return 2;
|
||||||
#endif
|
#endif
|
||||||
default: size = 4; return 4;
|
default: size = 4; return 4;
|
||||||
|
@ -285,6 +285,11 @@ public:
|
|||||||
TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
TIntermConstantUnion* addConstantUnion(short, const TSourceLoc&, bool literal = false) const;
|
||||||
|
TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const;
|
||||||
|
|
||||||
|
#endif
|
||||||
TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const;
|
||||||
TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const;
|
TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const;
|
||||||
|
@ -78,6 +78,7 @@ public:
|
|||||||
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
||||||
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
virtual void int16Check(const TSourceLoc& loc, const char* op, bool builtIn = false);
|
||||||
virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
#endif
|
#endif
|
||||||
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
|
@ -724,6 +724,7 @@ int TPpContext::CPPerror(TPpToken* ppToken)
|
|||||||
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
if (token == PpAtomConstInt || token == PpAtomConstUint ||
|
||||||
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
|
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
token == PpAtomConstInt16 || token == PpAtomConstUint16 ||
|
||||||
token == PpAtomConstFloat16 ||
|
token == PpAtomConstFloat16 ||
|
||||||
#endif
|
#endif
|
||||||
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
||||||
@ -758,6 +759,10 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
|
|||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
case PpAtomConstInt64:
|
case PpAtomConstInt64:
|
||||||
case PpAtomConstUint64:
|
case PpAtomConstUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16:
|
||||||
|
case PpAtomConstUint16:
|
||||||
|
#endif
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
|
@ -334,6 +334,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
int ii = 0;
|
int ii = 0;
|
||||||
unsigned long long ival = 0;
|
unsigned long long ival = 0;
|
||||||
bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64);
|
bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool enableInt16 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16);
|
||||||
|
#endif
|
||||||
bool acceptHalf = pp->parseContext.intermediate.getSource() == EShSourceHlsl;
|
bool acceptHalf = pp->parseContext.intermediate.getSource() == EShSourceHlsl;
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
if (pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float))
|
if (pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float))
|
||||||
@ -406,6 +409,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
|
|
||||||
bool isUnsigned = false;
|
bool isUnsigned = false;
|
||||||
bool isInt64 = false;
|
bool isInt64 = false;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isInt16 = false;
|
||||||
|
#endif
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
ch = getch();
|
ch = getch();
|
||||||
if ((ch >= '0' && ch <= '9') ||
|
if ((ch >= '0' && ch <= '9') ||
|
||||||
@ -414,7 +420,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
|
|
||||||
ival = 0;
|
ival = 0;
|
||||||
do {
|
do {
|
||||||
if (ival <= 0x0fffffff || (enableInt64 && ival <= 0x0fffffffffffffffull)) {
|
if (ival <= 0x0fffffffu || (enableInt64 && ival <= 0x0fffffffffffffffull)) {
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
if (ch >= '0' && ch <= '9') {
|
if (ch >= '0' && ch <= '9') {
|
||||||
ii = ch - '0';
|
ii = ch - '0';
|
||||||
@ -453,11 +459,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (enableInt16) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt16 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
} else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (enableInt16 && (ch == 's' || ch == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt16 = true;
|
||||||
|
#endif
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
ppToken->name[len] = '\0';
|
ppToken->name[len] = '\0';
|
||||||
@ -465,6 +488,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (isInt64) {
|
if (isInt64) {
|
||||||
ppToken->i64val = ival;
|
ppToken->i64val = ival;
|
||||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (isInt16) {
|
||||||
|
ppToken->ival = (int)ival;
|
||||||
|
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ppToken->ival = (int)ival;
|
ppToken->ival = (int)ival;
|
||||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
@ -474,6 +502,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
|
|
||||||
bool isUnsigned = false;
|
bool isUnsigned = false;
|
||||||
bool isInt64 = false;
|
bool isInt64 = false;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isInt16 = false;
|
||||||
|
#endif
|
||||||
bool octalOverflow = false;
|
bool octalOverflow = false;
|
||||||
bool nonOctal = false;
|
bool nonOctal = false;
|
||||||
ival = 0;
|
ival = 0;
|
||||||
@ -486,7 +517,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", "");
|
||||||
AlreadyComplained = 1;
|
AlreadyComplained = 1;
|
||||||
}
|
}
|
||||||
if (ival <= 0x1fffffff || (enableInt64 && ival <= 0x1fffffffffffffffull)) {
|
if (ival <= 0x1fffffffu || (enableInt64 && ival <= 0x1fffffffffffffffull)) {
|
||||||
ii = ch - '0';
|
ii = ch - '0';
|
||||||
ival = (ival << 3) | ii;
|
ival = (ival << 3) | ii;
|
||||||
} else
|
} else
|
||||||
@ -528,11 +559,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (enableInt16) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt16 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
} else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (enableInt16 && (ch == 's' || ch == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt16 = true;
|
||||||
|
#endif
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
ppToken->name[len] = '\0';
|
ppToken->name[len] = '\0';
|
||||||
@ -543,6 +591,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (isInt64) {
|
if (isInt64) {
|
||||||
ppToken->i64val = ival;
|
ppToken->i64val = ival;
|
||||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (isInt16) {
|
||||||
|
ppToken->ival = (int)ival;
|
||||||
|
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ppToken->ival = (int)ival;
|
ppToken->ival = (int)ival;
|
||||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
@ -569,6 +622,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
int numericLen = len;
|
int numericLen = len;
|
||||||
bool isUnsigned = false;
|
bool isUnsigned = false;
|
||||||
bool isInt64 = false;
|
bool isInt64 = false;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool isInt16 = false;
|
||||||
|
#endif
|
||||||
if (ch == 'u' || ch == 'U') {
|
if (ch == 'u' || ch == 'U') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
@ -583,10 +639,28 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (enableInt16) {
|
||||||
|
int nextCh = getch();
|
||||||
|
if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)nextCh;
|
||||||
|
isInt16 = true;
|
||||||
|
} else
|
||||||
|
ungetch();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
} else if (enableInt64 && (ch == 'l' || ch == 'L')) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (enableInt16 && (ch == 's' || ch == 'S')) {
|
||||||
|
if (len < MaxTokenLength)
|
||||||
|
ppToken->name[len++] = (char)ch;
|
||||||
|
isInt16 = true;
|
||||||
|
#endif
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
|
|
||||||
@ -596,10 +670,22 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt;
|
const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt;
|
||||||
const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10;
|
const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10;
|
||||||
const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64;
|
const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
const unsigned short oneTenthMaxInt16 = 0xFFFFu / 10;
|
||||||
|
const unsigned short remainderMaxInt16 = 0xFFFFu - 10 * oneTenthMaxInt16;
|
||||||
|
#endif
|
||||||
for (int i = 0; i < numericLen; i++) {
|
for (int i = 0; i < numericLen; i++) {
|
||||||
ch = ppToken->name[i] - '0';
|
ch = ppToken->name[i] - '0';
|
||||||
if ((enableInt64 == false && ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt))) ||
|
bool overflow = false;
|
||||||
(enableInt64 && ((ival > oneTenthMaxInt64) || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)))) {
|
if (isInt64)
|
||||||
|
overflow = (ival > oneTenthMaxInt64 || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64));
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (isInt16)
|
||||||
|
overflow = (ival > oneTenthMaxInt16 || (ival == oneTenthMaxInt16 && (unsigned short)ch > remainderMaxInt16));
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
overflow = (ival > oneTenthMaxInt || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt));
|
||||||
|
if (overflow) {
|
||||||
pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", "");
|
pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", "");
|
||||||
ival = 0xFFFFFFFFFFFFFFFFull;
|
ival = 0xFFFFFFFFFFFFFFFFull;
|
||||||
break;
|
break;
|
||||||
@ -610,6 +696,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
if (isInt64) {
|
if (isInt64) {
|
||||||
ppToken->i64val = ival;
|
ppToken->i64val = ival;
|
||||||
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} else if (isInt16) {
|
||||||
|
ppToken->ival = (int)ival;
|
||||||
|
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ppToken->ival = (int)ival;
|
ppToken->ival = (int)ival;
|
||||||
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
|
||||||
@ -859,6 +950,10 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
|||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstInt64:
|
case PpAtomConstInt64:
|
||||||
case PpAtomConstUint64:
|
case PpAtomConstUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16:
|
||||||
|
case PpAtomConstUint16:
|
||||||
|
#endif
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
case PpAtomConstFloat16:
|
case PpAtomConstFloat16:
|
||||||
|
@ -141,6 +141,10 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken)
|
|||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
case PpAtomConstInt64:
|
case PpAtomConstInt64:
|
||||||
case PpAtomConstUint64:
|
case PpAtomConstUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16:
|
||||||
|
case PpAtomConstUint16:
|
||||||
|
#endif
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifdef AMD_EXTENSIONS
|
||||||
@ -190,6 +194,10 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
case PpAtomConstInt64:
|
case PpAtomConstInt64:
|
||||||
case PpAtomConstUint64:
|
case PpAtomConstUint64:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16:
|
||||||
|
case PpAtomConstUint16:
|
||||||
|
#endif
|
||||||
len = 0;
|
len = 0;
|
||||||
ch = getSubtoken();
|
ch = getSubtoken();
|
||||||
while (ch != 0 && ch != EndOfInput) {
|
while (ch != 0 && ch != EndOfInput) {
|
||||||
@ -217,6 +225,9 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||||||
ppToken->dval = atof(ppToken->name);
|
ppToken->dval = atof(ppToken->name);
|
||||||
break;
|
break;
|
||||||
case PpAtomConstInt:
|
case PpAtomConstInt:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstInt16:
|
||||||
|
#endif
|
||||||
if (len > 0 && ppToken->name[0] == '0') {
|
if (len > 0 && ppToken->name[0] == '0') {
|
||||||
if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X'))
|
if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X'))
|
||||||
ppToken->ival = (int)strtol(ppToken->name, 0, 16);
|
ppToken->ival = (int)strtol(ppToken->name, 0, 16);
|
||||||
@ -226,6 +237,9 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||||||
ppToken->ival = atoi(ppToken->name);
|
ppToken->ival = atoi(ppToken->name);
|
||||||
break;
|
break;
|
||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case PpAtomConstUint16:
|
||||||
|
#endif
|
||||||
if (len > 0 && ppToken->name[0] == '0') {
|
if (len > 0 && ppToken->name[0] == '0') {
|
||||||
if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X'))
|
if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X'))
|
||||||
ppToken->ival = (int)strtoul(ppToken->name, 0, 16);
|
ppToken->ival = (int)strtoul(ppToken->name, 0, 16);
|
||||||
|
@ -127,6 +127,10 @@ enum EFixedAtoms {
|
|||||||
PpAtomConstUint,
|
PpAtomConstUint,
|
||||||
PpAtomConstInt64,
|
PpAtomConstInt64,
|
||||||
PpAtomConstUint64,
|
PpAtomConstUint64,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
PpAtomConstInt16,
|
||||||
|
PpAtomConstUint16,
|
||||||
|
#endif
|
||||||
PpAtomConstFloat,
|
PpAtomConstFloat,
|
||||||
PpAtomConstDouble,
|
PpAtomConstDouble,
|
||||||
PpAtomConstFloat16,
|
PpAtomConstFloat16,
|
||||||
|
@ -396,6 +396,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Glsl, CompileVulkanToSpirvTestAMD,
|
Glsl, CompileVulkanToSpirvTestAMD,
|
||||||
::testing::ValuesIn(std::vector<std::string>({
|
::testing::ValuesIn(std::vector<std::string>({
|
||||||
"spv.float16.frag",
|
"spv.float16.frag",
|
||||||
|
"spv.int16.frag",
|
||||||
"spv.shaderBallotAMD.comp",
|
"spv.shaderBallotAMD.comp",
|
||||||
"spv.textureGatherBiasLod.frag"
|
"spv.textureGatherBiasLod.frag"
|
||||||
})),
|
})),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user