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
|
|
@ -70,6 +70,8 @@ using namespace glslang;
|
|||
glslang::TString *string;
|
||||
int i;
|
||||
unsigned int u;
|
||||
long long i64;
|
||||
unsigned long long u64;
|
||||
bool b;
|
||||
double d;
|
||||
};
|
||||
|
|
@ -117,9 +119,9 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%expect 1 // One shift reduce conflict because of if | else
|
||||
|
||||
%token <lex> ATTRIBUTE VARYING
|
||||
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT
|
||||
%token <lex> CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T
|
||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
|
||||
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4
|
||||
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4
|
||||
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
|
||||
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
|
||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
||||
|
|
@ -180,7 +182,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> STRUCT VOID WHILE
|
||||
|
||||
%token <lex> IDENTIFIER TYPE_NAME
|
||||
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
|
||||
%token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT
|
||||
%token <lex> LEFT_OP RIGHT_OP
|
||||
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
|
||||
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
||||
|
|
@ -257,6 +259,14 @@ primary_expression
|
|||
parseContext.fullIntegerCheck($1.loc, "unsigned literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
|
||||
}
|
||||
| INT64CONSTANT {
|
||||
parseContext.int64Check($1.loc, "64-bit integer literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true);
|
||||
}
|
||||
| UINT64CONSTANT {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
|
||||
}
|
||||
| FLOATCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||
}
|
||||
|
|
@ -1309,6 +1319,16 @@ type_specifier_nonarray
|
|||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint;
|
||||
}
|
||||
| INT64_T {
|
||||
parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtInt64;
|
||||
}
|
||||
| UINT64_T {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint64;
|
||||
}
|
||||
| BOOL {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtBool;
|
||||
|
|
@ -1376,6 +1396,24 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtInt;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| I64VEC2 {
|
||||
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtInt64;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| I64VEC3 {
|
||||
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtInt64;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| I64VEC4 {
|
||||
parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtInt64;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| UVEC2 {
|
||||
parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
|
|
@ -1394,6 +1432,24 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtUint;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| U64VEC2 {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint64;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| U64VEC3 {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint64;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| U64VEC4 {
|
||||
parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtUint64;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| MAT2 {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloat;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue