Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
ab6a5880
Commit
ab6a5880
authored
Jan 08, 2020
by
Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move symbol builtin check to grammar stage
FYI, move builtin check to type symbol check. Avoid modifying interface doubleCheck().
parent
a3c7a25e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
40 deletions
+107
-40
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+3
-4
glslang.m4
glslang/MachineIndependent/glslang.m4
+51
-17
glslang.y
glslang/MachineIndependent/glslang.y
+51
-17
glslang_tab.cpp
glslang/MachineIndependent/glslang_tab.cpp
+0
-0
parseVersions.h
glslang/MachineIndependent/parseVersions.h
+2
-2
No files found.
glslang/MachineIndependent/Versions.cpp
View file @
ab6a5880
...
...
@@ -925,11 +925,10 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
}
// Call for any operation needing GLSL double data-type support.
void
TParseVersions
::
doubleCheck
(
const
TSourceLoc
&
loc
,
const
char
*
op
,
bool
builtIn
)
void
TParseVersions
::
doubleCheck
(
const
TSourceLoc
&
loc
,
const
char
*
op
)
{
requireProfile
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
op
);
if
(
!
builtIn
)
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
400
,
E_GL_ARB_gpu_shader_fp64
,
op
);
//requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
400
,
E_GL_ARB_gpu_shader_fp64
,
op
);
}
// Call for any operation needing GLSL float16 data-type support.
...
...
glslang/MachineIndependent/glslang.m4
View file @
ab6a5880
...
...
@@ -402,7 +402,9 @@ GLSLANG_WEB_EXCLUDE_ON
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
}
| DOUBLECONSTANT {
parseContext.doubleCheck($1.loc, "double literal");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double literal");
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
}
| FLOAT16CONSTANT {
...
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
}
GLSLANG_WEB_EXCLUDE_ON
| DOUBLE {
parseContext.doubleCheck($1.loc, "double", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
}
...
...
@@ -1811,19 +1815,25 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtUint64;
}
| DVEC2 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(2);
}
| DVEC3 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(3);
}
| DVEC4 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(4);
...
...
@@ -2027,73 +2037,97 @@ GLSLANG_WEB_EXCLUDE_ON
$$.setVector(4);
}
| DMAT2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| DMAT3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| DMAT4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
}
| DMAT2X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| DMAT2X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 3);
}
| DMAT2X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 4);
}
| DMAT3X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 2);
}
| DMAT3X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| DMAT3X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 4);
}
| DMAT4X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 2);
}
| DMAT4X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 3);
}
| DMAT4X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
...
...
glslang/MachineIndependent/glslang.y
View file @
ab6a5880
...
...
@@ -402,7 +402,9 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
}
| DOUBLECONSTANT {
parseContext.doubleCheck($1.loc, "double literal");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double literal");
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
}
| FLOAT16CONSTANT {
...
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
}
| DOUBLE {
parseContext.doubleCheck($1.loc, "double", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
}
...
...
@@ -1811,19 +1815,25 @@ type_specifier_nonarray
$$.basicType = EbtUint64;
}
| DVEC2 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(2);
}
| DVEC3 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(3);
}
| DVEC4 {
parseContext.doubleCheck($1.loc, "double vector", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setVector(4);
...
...
@@ -2027,73 +2037,97 @@ type_specifier_nonarray
$$.setVector(4);
}
| DMAT2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| DMAT3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| DMAT4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
}
| DMAT2X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
}
| DMAT2X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 3);
}
| DMAT2X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(2, 4);
}
| DMAT3X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 2);
}
| DMAT3X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
}
| DMAT3X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(3, 4);
}
| DMAT4X2 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 2);
}
| DMAT4X3 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 3);
}
| DMAT4X4 {
parseContext.doubleCheck($1.loc, "double matrix", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
...
...
glslang/MachineIndependent/glslang_tab.cpp
View file @
ab6a5880
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/parseVersions.h
View file @
ab6a5880
...
...
@@ -102,7 +102,7 @@ public:
void
updateExtensionBehavior
(
const
char
*
const
extension
,
TExtensionBehavior
)
{
}
void
checkExtensionStage
(
const
TSourceLoc
&
,
const
char
*
const
extension
)
{
}
void
fullIntegerCheck
(
const
TSourceLoc
&
,
const
char
*
op
)
{
}
void
doubleCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
bool
builtIn
=
false
)
{
}
void
doubleCheck
(
const
TSourceLoc
&
,
const
char
*
op
)
{
}
bool
float16Arithmetic
()
{
return
false
;
}
void
requireFloat16Arithmetic
(
const
TSourceLoc
&
loc
,
const
char
*
op
,
const
char
*
featureDesc
)
{
}
bool
int16Arithmetic
()
{
return
false
;
}
...
...
@@ -142,7 +142,7 @@ public:
virtual
void
fullIntegerCheck
(
const
TSourceLoc
&
,
const
char
*
op
);
virtual
void
unimplemented
(
const
TSourceLoc
&
,
const
char
*
featureDesc
);
virtual
void
doubleCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
bool
builtIn
=
false
);
virtual
void
doubleCheck
(
const
TSourceLoc
&
,
const
char
*
op
);
virtual
void
float16Check
(
const
TSourceLoc
&
,
const
char
*
op
,
bool
builtIn
=
false
);
virtual
void
float16ScalarVectorCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
bool
builtIn
=
false
);
virtual
bool
float16Arithmetic
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment