Parser: Implement extension GL_AMD_gpu_shader_half_float.
- Add built-in types: float16_t, f16vec, f16mat. - Add support of half float constant: hf, HF. - Extend built-in floating-point operators: +, -, *, /, ++, --, +=, -=, *=, /=, ==, !=, >=, <=, >, <. - Add support of type conversions: float16_t -> XXX, XXX -> float16_t. - Add new built-in functions.
This commit is contained in:
parent
b1672fa0de
commit
c9e3c3c941
35 changed files with 9765 additions and 4370 deletions
|
|
@ -46,6 +46,9 @@ enum TBasicType {
|
|||
EbtVoid,
|
||||
EbtFloat,
|
||||
EbtDouble,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EbtFloat16,
|
||||
#endif
|
||||
EbtInt,
|
||||
EbtUint,
|
||||
EbtInt64,
|
||||
|
|
|
|||
|
|
@ -185,8 +185,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|||
case EbtFloat: break;
|
||||
case EbtInt: s.append("i"); break;
|
||||
case EbtUint: s.append("u"); break;
|
||||
case EbtInt64: s.append("i64"); break;
|
||||
case EbtUint64: s.append("u64"); break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
if (image) {
|
||||
|
|
@ -1277,7 +1275,11 @@ public:
|
|||
virtual bool isImplicitlySizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage != EvqBuffer; }
|
||||
virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; }
|
||||
virtual bool isStruct() const { return structure != nullptr; }
|
||||
#ifdef AMD_EXTENSIONS
|
||||
virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; }
|
||||
#else
|
||||
virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble; }
|
||||
#endif
|
||||
|
||||
virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint; }
|
||||
|
||||
|
|
@ -1359,6 +1361,9 @@ public:
|
|||
case EbtVoid:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtFloat16:
|
||||
#endif
|
||||
case EbtInt:
|
||||
case EbtUint:
|
||||
case EbtInt64:
|
||||
|
|
@ -1451,6 +1456,9 @@ public:
|
|||
case EbtVoid: return "void";
|
||||
case EbtFloat: return "float";
|
||||
case EbtDouble: return "double";
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtFloat16: return "float16_t";
|
||||
#endif
|
||||
case EbtInt: return "int";
|
||||
case EbtUint: return "uint";
|
||||
case EbtInt64: return "int64_t";
|
||||
|
|
|
|||
|
|
@ -119,6 +119,22 @@ enum TOperator {
|
|||
EOpConvFloatToUint64,
|
||||
EOpConvDoubleToUint64,
|
||||
EOpConvInt64ToUint64,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpConvBoolToFloat16,
|
||||
EOpConvIntToFloat16,
|
||||
EOpConvUintToFloat16,
|
||||
EOpConvFloatToFloat16,
|
||||
EOpConvDoubleToFloat16,
|
||||
EOpConvInt64ToFloat16,
|
||||
EOpConvUint64ToFloat16,
|
||||
EOpConvFloat16ToBool,
|
||||
EOpConvFloat16ToInt,
|
||||
EOpConvFloat16ToUint,
|
||||
EOpConvFloat16ToFloat,
|
||||
EOpConvFloat16ToDouble,
|
||||
EOpConvFloat16ToInt64,
|
||||
EOpConvFloat16ToUint64,
|
||||
#endif
|
||||
|
||||
//
|
||||
// binary operations
|
||||
|
|
@ -236,6 +252,10 @@ enum TOperator {
|
|||
EOpUnpackInt2x32,
|
||||
EOpPackUint2x32,
|
||||
EOpUnpackUint2x32,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpPackFloat2x16,
|
||||
EOpUnpackFloat2x16,
|
||||
#endif
|
||||
|
||||
EOpLength,
|
||||
EOpDistance,
|
||||
|
|
@ -396,6 +416,21 @@ enum TOperator {
|
|||
EOpConstructDMat4x2,
|
||||
EOpConstructDMat4x3,
|
||||
EOpConstructDMat4x4,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpConstructFloat16,
|
||||
EOpConstructF16Vec2,
|
||||
EOpConstructF16Vec3,
|
||||
EOpConstructF16Vec4,
|
||||
EOpConstructF16Mat2x2,
|
||||
EOpConstructF16Mat2x3,
|
||||
EOpConstructF16Mat2x4,
|
||||
EOpConstructF16Mat3x2,
|
||||
EOpConstructF16Mat3x3,
|
||||
EOpConstructF16Mat3x4,
|
||||
EOpConstructF16Mat4x2,
|
||||
EOpConstructF16Mat4x3,
|
||||
EOpConstructF16Mat4x4,
|
||||
#endif
|
||||
EOpConstructStruct,
|
||||
EOpConstructTextureSampler,
|
||||
EOpConstructGuardEnd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue