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:
Rex Xu 2016-07-29 16:00:05 +08:00
parent b1672fa0de
commit c9e3c3c941
35 changed files with 9765 additions and 4370 deletions

View file

@ -705,6 +705,9 @@ int TPpContext::CPPerror(TPpToken* ppToken)
while (token != '\n' && token != EndOfInput) {
if (token == PpAtomConstInt || token == PpAtomConstUint ||
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
#ifdef AMD_EXTENSIONS
token == PpAtomConstFloat16 ||
#endif
token == PpAtomConstFloat || token == PpAtomConstDouble) {
message.append(ppToken->name);
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
@ -739,6 +742,9 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
case PpAtomConstUint64:
case PpAtomConstFloat:
case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
case PpAtomConstFloat16:
#endif
tokens.push_back(ppToken->name);
break;
default: