Implement the extension GL_ARB_gpu_shader_int64
- Add new keyword int64_t/uint64_t/i64vec/u64vec. - Support 64-bit integer literals (dec/hex/oct). - Support built-in operators for 64-bit integer type. - Add implicit and explicit type conversion for 64-bit integer type. - Add new built-in functions defined in this extension.
This commit is contained in:
parent
010e93fe62
commit
8ff43de891
33 changed files with 5047 additions and 3009 deletions
|
|
@ -141,6 +141,8 @@ void TPpContext::RecordToken(TokenStream *pTok, int token, TPpToken* ppToken)
|
|||
break;
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstDouble:
|
||||
str = ppToken->name;
|
||||
|
|
@ -193,6 +195,8 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
|||
case PpAtomConstDouble:
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
len = 0;
|
||||
ch = lReadByte(pTok);
|
||||
while (ch != 0 && ch != EndOfInput) {
|
||||
|
|
@ -227,6 +231,16 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
|
|||
} else
|
||||
ppToken->ival = atoi(ppToken->name);
|
||||
break;
|
||||
case PpAtomConstInt64:
|
||||
case PpAtomConstUint64:
|
||||
if (len > 0 && tokenText[0] == '0') {
|
||||
if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
|
||||
ppToken->i64val = std::stoll(ppToken->name, 0, 16);
|
||||
else
|
||||
ppToken->i64val = std::stoll(ppToken->name, 0, 8);
|
||||
} else
|
||||
ppToken->i64val = std::stoll(ppToken->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue