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
51813670
Unverified
Commit
51813670
authored
Jan 08, 2020
by
John Kessenich
Committed by
GitHub
Jan 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1998 from ShchchowAMD/ARB_gpu_shader_fp64
Add support for ARB_gpu_shader_fp64
parents
e5dbc311
ab6a5880
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
241 additions
and
61 deletions
+241
-61
150.frag
Test/150.frag
+10
-0
150.frag.out
Test/baseResults/150.frag.out
+61
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+4
-4
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+1
-1
Scan.cpp
glslang/MachineIndependent/Scan.cpp
+7
-2
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+4
-2
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
glslang.m4
glslang/MachineIndependent/glslang.m4
+51
-17
glslang.y
glslang/MachineIndependent/glslang.y
+51
-17
glslang_tab.cpp
glslang/MachineIndependent/glslang_tab.cpp
+51
-17
No files found.
Test/150.frag
View file @
51813670
...
@@ -49,3 +49,12 @@ int primitiveID()
...
@@ -49,3 +49,12 @@ int primitiveID()
return
gl_PrimitiveID
;
return
gl_PrimitiveID
;
gl_PerFragment
;
// ERROR, block name can't get reused
gl_PerFragment
;
// ERROR, block name can't get reused
}
}
in
double
type1
;
// ERROR
#extension GL_ARB_gpu_shader_fp64 : enable
double
type2
;
double
type3
=
2
.
0
;
int
absTest
=
sqrt
(
type3
);
double
absTest2
=
sqrt
(
type3
);
double
absTest3
=
sqrt
(
2
);
float
dk
=
sqrt
(
11
);
\ No newline at end of file
Test/baseResults/150.frag.out
View file @
51813670
...
@@ -5,10 +5,15 @@ ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_cent
...
@@ -5,10 +5,15 @@ ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_cent
ERROR: 0:14: 'gl_FragCoord' : cannot redeclare after use
ERROR: 0:14: 'gl_FragCoord' : cannot redeclare after use
ERROR: 0:50: 'gl_PerFragment' : cannot be used (maybe an instance name is needed)
ERROR: 0:50: 'gl_PerFragment' : cannot be used (maybe an instance name is needed)
ERROR: 0:50: 'gl_PerFragment' : undeclared identifier
ERROR: 0:50: 'gl_PerFragment' : undeclared identifier
ERROR: 6 compilation errors. No code generated.
ERROR: 0:53: 'double' : Reserved word.
ERROR: 0:53: 'double' : not supported for this version or the enabled extensions
ERROR: 0:53: 'double' : must be qualified as flat in
ERROR: 0:57: '=' : cannot convert from ' global double' to ' global int'
ERROR: 10 compilation errors. No code generated.
Shader version: 150
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
...
@@ -109,6 +114,26 @@ ERROR: node is still EOpNull!
...
@@ -109,6 +114,26 @@ ERROR: node is still EOpNull!
0:49 Branch: Return with expression
0:49 Branch: Return with expression
0:49 'gl_PrimitiveID' ( flat in int PrimitiveID)
0:49 'gl_PrimitiveID' ( flat in int PrimitiveID)
0:50 'gl_PerFragment' ( temp float)
0:50 'gl_PerFragment' ( temp float)
0:56 Sequence
0:56 move second child to first child ( temp double)
0:56 'type3' ( global double)
0:56 Constant:
0:56 2.000000
0:58 Sequence
0:58 move second child to first child ( temp double)
0:58 'absTest2' ( global double)
0:58 sqrt ( global double)
0:58 'type3' ( global double)
0:59 Sequence
0:59 move second child to first child ( temp double)
0:59 'absTest3' ( global double)
0:59 Constant:
0:59 1.414214
0:60 Sequence
0:60 move second child to first child ( temp float)
0:60 'dk' ( global float)
0:60 Constant:
0:60 3.316625
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'foo' ( smooth in 4-component vector of float)
0:? 'foo' ( smooth in 4-component vector of float)
...
@@ -123,12 +148,20 @@ ERROR: node is still EOpNull!
...
@@ -123,12 +148,20 @@ ERROR: node is still EOpNull!
0:? 'p2' ( flat in 2-component vector of int)
0:? 'p2' ( flat in 2-component vector of int)
0:? 'p3' ( flat in 3-component vector of int)
0:? 'p3' ( flat in 3-component vector of int)
0:? 'samp' ( flat in int)
0:? 'samp' ( flat in int)
0:? 'type1' ( smooth in double)
0:? 'type2' ( global double)
0:? 'type3' ( global double)
0:? 'absTest' ( global int)
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
Linked fragment stage:
Linked fragment stage:
Shader version: 150
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
...
@@ -144,6 +177,26 @@ ERROR: node is still EOpNull!
...
@@ -144,6 +177,26 @@ ERROR: node is still EOpNull!
0:18 'patch' ( global float)
0:18 'patch' ( global float)
0:18 Constant:
0:18 Constant:
0:18 3.100000
0:18 3.100000
0:56 Sequence
0:56 move second child to first child ( temp double)
0:56 'type3' ( global double)
0:56 Constant:
0:56 2.000000
0:58 Sequence
0:58 move second child to first child ( temp double)
0:58 'absTest2' ( global double)
0:58 sqrt ( global double)
0:58 'type3' ( global double)
0:59 Sequence
0:59 move second child to first child ( temp double)
0:59 'absTest3' ( global double)
0:59 Constant:
0:59 1.414214
0:60 Sequence
0:60 move second child to first child ( temp float)
0:60 'dk' ( global float)
0:60 Constant:
0:60 3.316625
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'foo' ( smooth in 4-component vector of float)
0:? 'foo' ( smooth in 4-component vector of float)
...
@@ -158,4 +211,11 @@ ERROR: node is still EOpNull!
...
@@ -158,4 +211,11 @@ ERROR: node is still EOpNull!
0:? 'p2' ( flat in 2-component vector of int)
0:? 'p2' ( flat in 2-component vector of int)
0:? 'p3' ( flat in 3-component vector of int)
0:? 'p3' ( flat in 3-component vector of int)
0:? 'samp' ( flat in int)
0:? 'samp' ( flat in int)
0:? 'type1' ( smooth in double)
0:? 'type2' ( global double)
0:? 'type3' ( global double)
0:? 'absTest' ( global int)
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
glslang/MachineIndependent/Initialize.cpp
View file @
51813670
...
@@ -690,7 +690,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -690,7 +690,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
//
//
// double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack
// double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack
//
//
if
(
profile
!=
EEsProfile
&&
version
>=
400
)
{
if
(
profile
!=
EEsProfile
&&
version
>=
150
)
{
// ARB_gpu_shader_fp64
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"double sqrt(double);"
"double sqrt(double);"
...
@@ -1298,15 +1298,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -1298,15 +1298,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"vec3 fma(vec3, vec3, vec3 );"
"vec3 fma(vec3, vec3, vec3 );"
"vec4 fma(vec4, vec4, vec4 );"
"vec4 fma(vec4, vec4, vec4 );"
"
\n
"
);
"
\n
"
);
}
if
(
profile
!=
EEsProfile
)
{
if
(
profile
!=
EEsProfile
&&
version
>=
150
)
{
// ARB_gpu_shader_fp64
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"double fma(double, double, double);"
"double fma(double, double, double);"
"dvec2 fma(dvec2, dvec2, dvec2 );"
"dvec2 fma(dvec2, dvec2, dvec2 );"
"dvec3 fma(dvec3, dvec3, dvec3 );"
"dvec3 fma(dvec3, dvec3, dvec3 );"
"dvec4 fma(dvec4, dvec4, dvec4 );"
"dvec4 fma(dvec4, dvec4, dvec4 );"
"
\n
"
);
"
\n
"
);
}
}
}
if
((
profile
==
EEsProfile
&&
version
>=
310
)
||
if
((
profile
==
EEsProfile
&&
version
>=
310
)
||
...
@@ -1325,7 +1325,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -1325,7 +1325,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"
\n
"
);
"
\n
"
);
}
}
if
(
profile
!=
EEsProfile
&&
version
>=
400
)
{
if
(
profile
!=
EEsProfile
&&
version
>=
150
)
{
// ARB_gpu_shader_fp64
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"double frexp(double, out int);"
"double frexp(double, out int);"
"dvec2 frexp( dvec2, out ivec2);"
"dvec2 frexp( dvec2, out ivec2);"
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
51813670
...
@@ -6091,7 +6091,7 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
...
@@ -6091,7 +6091,7 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
if
(
isEsProfile
()
||
version
<
120
)
if
(
isEsProfile
()
||
version
<
120
)
function
=
findFunctionExact
(
loc
,
call
,
builtIn
);
function
=
findFunctionExact
(
loc
,
call
,
builtIn
);
else
if
(
version
<
400
)
else
if
(
version
<
400
)
function
=
findFunction120
(
loc
,
call
,
builtIn
);
function
=
extensionTurnedOn
(
E_GL_ARB_gpu_shader_fp64
)
?
findFunction400
(
loc
,
call
,
builtIn
)
:
findFunction120
(
loc
,
call
,
builtIn
);
else
if
(
explicitTypesEnabled
)
else
if
(
explicitTypesEnabled
)
function
=
findFunctionExplicitTypes
(
loc
,
call
,
builtIn
);
function
=
findFunctionExplicitTypes
(
loc
,
call
,
builtIn
);
else
else
...
...
glslang/MachineIndependent/Scan.cpp
View file @
51813670
...
@@ -1166,7 +1166,10 @@ int TScanContext::tokenizeIdentifier()
...
@@ -1166,7 +1166,10 @@ int TScanContext::tokenizeIdentifier()
case
DVEC3
:
case
DVEC3
:
case
DVEC4
:
case
DVEC4
:
afterType
=
true
;
afterType
=
true
;
if
(
parseContext
.
isEsProfile
()
||
parseContext
.
version
<
400
)
if
(
parseContext
.
isEsProfile
()
||
parseContext
.
version
<
150
||
(
!
parseContext
.
symbolTable
.
atBuiltInLevel
()
&&
parseContext
.
version
<
400
&&
!
parseContext
.
extensionTurnedOn
(
E_GL_ARB_gpu_shader_fp64
)))
reservedWord
();
reservedWord
();
return
keyword
;
return
keyword
;
...
@@ -1741,7 +1744,9 @@ int TScanContext::dMat()
...
@@ -1741,7 +1744,9 @@ int TScanContext::dMat()
return
keyword
;
return
keyword
;
}
}
if
(
!
parseContext
.
isEsProfile
()
&&
parseContext
.
version
>=
400
)
if
(
!
parseContext
.
isEsProfile
()
&&
(
parseContext
.
version
>=
400
||
parseContext
.
symbolTable
.
atBuiltInLevel
()
||
(
parseContext
.
version
>=
150
&&
parseContext
.
extensionTurnedOn
(
E_GL_ARB_gpu_shader_fp64
))))
return
keyword
;
return
keyword
;
if
(
parseContext
.
isForwardCompatible
())
if
(
parseContext
.
isForwardCompatible
())
...
...
glslang/MachineIndependent/Versions.cpp
View file @
51813670
...
@@ -184,6 +184,7 @@ void TParseVersions::initializeExtensionBehavior()
...
@@ -184,6 +184,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_ARB_shader_texture_image_samples
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_texture_image_samples
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_viewport_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_viewport_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_gpu_shader_int64
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_gpu_shader_int64
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_gpu_shader_fp64
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_ballot
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_ballot
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sparse_texture2
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sparse_texture2
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sparse_texture_clamp
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sparse_texture_clamp
]
=
EBhDisable
;
...
@@ -393,6 +394,7 @@ void TParseVersions::getPreamble(std::string& preamble)
...
@@ -393,6 +394,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_shader_texture_image_samples 1
\n
"
"#define GL_ARB_shader_texture_image_samples 1
\n
"
"#define GL_ARB_viewport_array 1
\n
"
"#define GL_ARB_viewport_array 1
\n
"
"#define GL_ARB_gpu_shader_int64 1
\n
"
"#define GL_ARB_gpu_shader_int64 1
\n
"
"#define GL_ARB_gpu_shader_fp64 1
\n
"
"#define GL_ARB_shader_ballot 1
\n
"
"#define GL_ARB_shader_ballot 1
\n
"
"#define GL_ARB_sparse_texture2 1
\n
"
"#define GL_ARB_sparse_texture2 1
\n
"
"#define GL_ARB_sparse_texture_clamp 1
\n
"
"#define GL_ARB_sparse_texture_clamp 1
\n
"
...
@@ -925,8 +927,8 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
...
@@ -925,8 +927,8 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
// Call for any operation needing GLSL double data-type support.
// Call for any operation needing GLSL double data-type support.
void
TParseVersions
::
doubleCheck
(
const
TSourceLoc
&
loc
,
const
char
*
op
)
void
TParseVersions
::
doubleCheck
(
const
TSourceLoc
&
loc
,
const
char
*
op
)
{
{
requireProfile
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
op
);
//
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
400
,
nullptr
,
op
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
400
,
E_GL_ARB_gpu_shader_fp64
,
op
);
}
}
// Call for any operation needing GLSL float16 data-type support.
// Call for any operation needing GLSL float16 data-type support.
...
...
glslang/MachineIndependent/Versions.h
View file @
51813670
...
@@ -136,6 +136,7 @@ const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_con
...
@@ -136,6 +136,7 @@ const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_con
const
char
*
const
E_GL_ARB_shader_texture_image_samples
=
"GL_ARB_shader_texture_image_samples"
;
const
char
*
const
E_GL_ARB_shader_texture_image_samples
=
"GL_ARB_shader_texture_image_samples"
;
const
char
*
const
E_GL_ARB_viewport_array
=
"GL_ARB_viewport_array"
;
const
char
*
const
E_GL_ARB_viewport_array
=
"GL_ARB_viewport_array"
;
const
char
*
const
E_GL_ARB_gpu_shader_int64
=
"GL_ARB_gpu_shader_int64"
;
const
char
*
const
E_GL_ARB_gpu_shader_int64
=
"GL_ARB_gpu_shader_int64"
;
const
char
*
const
E_GL_ARB_gpu_shader_fp64
=
"GL_ARB_gpu_shader_fp64"
;
const
char
*
const
E_GL_ARB_shader_ballot
=
"GL_ARB_shader_ballot"
;
const
char
*
const
E_GL_ARB_shader_ballot
=
"GL_ARB_shader_ballot"
;
const
char
*
const
E_GL_ARB_sparse_texture2
=
"GL_ARB_sparse_texture2"
;
const
char
*
const
E_GL_ARB_sparse_texture2
=
"GL_ARB_sparse_texture2"
;
const
char
*
const
E_GL_ARB_sparse_texture_clamp
=
"GL_ARB_sparse_texture_clamp"
;
const
char
*
const
E_GL_ARB_sparse_texture_clamp
=
"GL_ARB_sparse_texture_clamp"
;
...
...
glslang/MachineIndependent/glslang.m4
View file @
51813670
...
@@ -402,7 +402,9 @@ GLSLANG_WEB_EXCLUDE_ON
...
@@ -402,7 +402,9 @@ GLSLANG_WEB_EXCLUDE_ON
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
}
}
| DOUBLECONSTANT {
| 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);
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
}
}
| FLOAT16CONSTANT {
| FLOAT16CONSTANT {
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
}
}
GLSLANG_WEB_EXCLUDE_ON
GLSLANG_WEB_EXCLUDE_ON
| DOUBLE {
| DOUBLE {
parseContext.doubleCheck($1.loc, "double");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
}
}
...
@@ -1811,19 +1815,25 @@ GLSLANG_WEB_EXCLUDE_ON
...
@@ -1811,19 +1815,25 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtUint64;
$$.basicType = EbtUint64;
}
}
| DVEC2 {
| DVEC2 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(2);
$$.setVector(2);
}
}
| DVEC3 {
| DVEC3 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(3);
$$.setVector(3);
}
}
| DVEC4 {
| DVEC4 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(4);
$$.setVector(4);
...
@@ -2027,73 +2037,97 @@ GLSLANG_WEB_EXCLUDE_ON
...
@@ -2027,73 +2037,97 @@ GLSLANG_WEB_EXCLUDE_ON
$$.setVector(4);
$$.setVector(4);
}
}
| DMAT2 {
| DMAT2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
$$.setMatrix(2, 2);
}
}
| DMAT3 {
| DMAT3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
$$.setMatrix(3, 3);
}
}
| DMAT4 {
| DMAT4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
$$.setMatrix(4, 4);
}
}
| DMAT2X2 {
| DMAT2X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
$$.setMatrix(2, 2);
}
}
| DMAT2X3 {
| DMAT2X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 3);
$$.setMatrix(2, 3);
}
}
| DMAT2X4 {
| DMAT2X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 4);
$$.setMatrix(2, 4);
}
}
| DMAT3X2 {
| DMAT3X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 2);
$$.setMatrix(3, 2);
}
}
| DMAT3X3 {
| DMAT3X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
$$.setMatrix(3, 3);
}
}
| DMAT3X4 {
| DMAT3X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 4);
$$.setMatrix(3, 4);
}
}
| DMAT4X2 {
| DMAT4X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 2);
$$.setMatrix(4, 2);
}
}
| DMAT4X3 {
| DMAT4X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 3);
$$.setMatrix(4, 3);
}
}
| DMAT4X4 {
| DMAT4X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
$$.setMatrix(4, 4);
...
...
glslang/MachineIndependent/glslang.y
View file @
51813670
...
@@ -402,7 +402,9 @@ primary_expression
...
@@ -402,7 +402,9 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
$$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
}
}
| DOUBLECONSTANT {
| 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);
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
}
}
| FLOAT16CONSTANT {
| FLOAT16CONSTANT {
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
...
@@ -1751,7 +1753,9 @@ type_specifier_nonarray
}
}
| DOUBLE {
| DOUBLE {
parseContext.doubleCheck($1.loc, "double");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
}
}
...
@@ -1811,19 +1815,25 @@ type_specifier_nonarray
...
@@ -1811,19 +1815,25 @@ type_specifier_nonarray
$$.basicType = EbtUint64;
$$.basicType = EbtUint64;
}
}
| DVEC2 {
| DVEC2 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(2);
$$.setVector(2);
}
}
| DVEC3 {
| DVEC3 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(3);
$$.setVector(3);
}
}
| DVEC4 {
| DVEC4 {
parseContext.doubleCheck($1.loc, "double vector");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double vector");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setVector(4);
$$.setVector(4);
...
@@ -2027,73 +2037,97 @@ type_specifier_nonarray
...
@@ -2027,73 +2037,97 @@ type_specifier_nonarray
$$.setVector(4);
$$.setVector(4);
}
}
| DMAT2 {
| DMAT2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
$$.setMatrix(2, 2);
}
}
| DMAT3 {
| DMAT3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
$$.setMatrix(3, 3);
}
}
| DMAT4 {
| DMAT4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
$$.setMatrix(4, 4);
}
}
| DMAT2X2 {
| DMAT2X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 2);
$$.setMatrix(2, 2);
}
}
| DMAT2X3 {
| DMAT2X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 3);
$$.setMatrix(2, 3);
}
}
| DMAT2X4 {
| DMAT2X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(2, 4);
$$.setMatrix(2, 4);
}
}
| DMAT3X2 {
| DMAT3X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 2);
$$.setMatrix(3, 2);
}
}
| DMAT3X3 {
| DMAT3X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 3);
$$.setMatrix(3, 3);
}
}
| DMAT3X4 {
| DMAT3X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(3, 4);
$$.setMatrix(3, 4);
}
}
| DMAT4X2 {
| DMAT4X2 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 2);
$$.setMatrix(4, 2);
}
}
| DMAT4X3 {
| DMAT4X3 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 3);
$$.setMatrix(4, 3);
}
}
| DMAT4X4 {
| DMAT4X4 {
parseContext.doubleCheck($1.loc, "double matrix");
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
parseContext.doubleCheck($1.loc, "double matrix");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtDouble;
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
$$.setMatrix(4, 4);
...
...
glslang/MachineIndependent/glslang_tab.cpp
View file @
51813670
This diff is collapsed.
Click to expand it.
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