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
1189a7bc
Commit
1189a7bc
authored
Jun 29, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make double underscore "__" an error for ES 300, but a warning for 310.
The 310 spec (and desktop specs) have clarified this is a waring, not an error, but 300 tests still expect an error.
parent
63cebdb4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
7 deletions
+35
-7
300BuiltIns.frag
Test/300BuiltIns.frag
+7
-2
310.comp
Test/310.comp
+5
-0
300BuiltIns.frag.out
Test/baseResults/300BuiltIns.frag.out
+3
-1
310.comp.out
Test/baseResults/310.comp.out
+4
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+16
-4
No files found.
Test/300BuiltIns.frag
View file @
1189a7bc
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
int
imax
,
imin
;
int
imax
,
imin
;
uint
umax
,
umin
;
uint
umax
,
umin
;
vec3
x
,
y
;
vec3
x
,
y
;
// ERROR, needs default precision
bvec3
bv
;
bvec3
bv
;
uint
uy
;
uint
uy
;
...
@@ -67,5 +67,10 @@ void main()
...
@@ -67,5 +67,10 @@ void main()
vec2
v18
=
unpackHalf2x16
(
uy
);
vec2
v18
=
unpackHalf2x16
(
uy
);
// not present
// not present
noise2
(
v18
);
noise2
(
v18
);
// ERROR, not present
float
t__
;
// ERROR, no __ until revision 310
// ERROR, no __ until revision 310
#define __D
}
}
Test/310.comp
View file @
1189a7bc
...
@@ -231,3 +231,8 @@ in inb { // ERROR
...
@@ -231,3 +231,8 @@ in inb { // ERROR
out outb { // ERROR
out outb { // ERROR
int a;
int a;
} outbi;
} outbi;
float t__; // ERROR, no __ until revision 310
// ERROR, no __ until revision 310
#define __D
Test/baseResults/300BuiltIns.frag.out
View file @
1189a7bc
300BuiltIns.frag
300BuiltIns.frag
ERROR: 0:6: 'float' : type requires declaration of default precision qualifier
ERROR: 0:6: 'float' : type requires declaration of default precision qualifier
ERROR: 0:70: 'noise2' : no matching overloaded function found
ERROR: 0:70: 'noise2' : no matching overloaded function found
ERROR: 2 compilation errors. No code generated.
ERROR: 0:72: 't__' : identifiers containing consecutive underscores ("__") are reserved, and an error if version <= 300
ERROR: 0:75: '#define' : names containing consecutive underscores are reserved, and an error if version <= 300: __D
ERROR: 4 compilation errors. No code generated.
Shader version: 300
Shader version: 300
...
...
Test/baseResults/310.comp.out
View file @
1189a7bc
...
@@ -74,6 +74,8 @@ ERROR: 0:221: 'assign' : can't read from writeonly object: wo
...
@@ -74,6 +74,8 @@ ERROR: 0:221: 'assign' : can't read from writeonly object: wo
ERROR: 0:222: '~' : can't read from writeonly object: wo
ERROR: 0:222: '~' : can't read from writeonly object: wo
ERROR: 0:227: 'input block' : not supported in this stage: compute
ERROR: 0:227: 'input block' : not supported in this stage: compute
ERROR: 0:231: 'output block' : not supported in this stage: compute
ERROR: 0:231: 'output block' : not supported in this stage: compute
WARNING: 0:235: 't__' : identifiers containing consecutive underscores ("__") are reserved
WARNING: 0:238: '#define' : names containing consecutive underscores are reserved: __D
ERROR: 74 compilation errors. No code generated.
ERROR: 74 compilation errors. No code generated.
...
@@ -483,6 +485,7 @@ ERROR: node is still EOpNull!
...
@@ -483,6 +485,7 @@ ERROR: node is still EOpNull!
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'inbi' (in block{in highp int a})
0:? 'inbi' (in block{in highp int a})
0:? 'outbi' (out block{out highp int a})
0:? 'outbi' (out block{out highp int a})
0:? 't__' (global highp float)
Linked compute stage:
Linked compute stage:
...
@@ -894,4 +897,5 @@ ERROR: node is still EOpNull!
...
@@ -894,4 +897,5 @@ ERROR: node is still EOpNull!
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'inbi' (in block{in highp int a})
0:? 'inbi' (in block{in highp int a})
0:? 'outbi' (out block{out highp int a})
0:? 'outbi' (out block{out highp int a})
0:? 't__' (global highp float)
glslang/MachineIndependent/ParseHelper.cpp
View file @
1189a7bc
...
@@ -1788,11 +1788,17 @@ void TParseContext::reservedErrorCheck(TSourceLoc loc, const TString& identifier
...
@@ -1788,11 +1788,17 @@ void TParseContext::reservedErrorCheck(TSourceLoc loc, const TString& identifier
if
(
builtInName
(
identifier
))
if
(
builtInName
(
identifier
))
error
(
loc
,
"identifiers starting with
\"
gl_
\"
are reserved"
,
identifier
.
c_str
(),
""
);
error
(
loc
,
"identifiers starting with
\"
gl_
\"
are reserved"
,
identifier
.
c_str
(),
""
);
// "__" are not supposed to be an error. ES 310 (and desktop) added the clarification:
// "In addition, all identifiers containing two consecutive underscores (__) are
// "In addition, all identifiers containing two consecutive underscores (__) are
// reserved; using such a name does not itself result in an error, but may result
// reserved; using such a name does not itself result in an error, but may result
// in undefined behavior."
// in undefined behavior."
if
(
identifier
.
find
(
"__"
)
!=
TString
::
npos
)
// however, before that, ES tests required an error.
warn
(
loc
,
"identifiers containing consecutive underscores (
\"
__
\"
) are reserved"
,
identifier
.
c_str
(),
""
);
if
(
identifier
.
find
(
"__"
)
!=
TString
::
npos
)
{
if
(
profile
==
EEsProfile
&&
version
<=
300
)
error
(
loc
,
"identifiers containing consecutive underscores (
\"
__
\"
) are reserved, and an error if version <= 300"
,
identifier
.
c_str
(),
""
);
else
warn
(
loc
,
"identifiers containing consecutive underscores (
\"
__
\"
) are reserved"
,
identifier
.
c_str
(),
""
);
}
}
}
}
}
...
@@ -1801,11 +1807,13 @@ void TParseContext::reservedErrorCheck(TSourceLoc loc, const TString& identifier
...
@@ -1801,11 +1807,13 @@ void TParseContext::reservedErrorCheck(TSourceLoc loc, const TString& identifier
//
//
void
TParseContext
::
reservedPpErrorCheck
(
TSourceLoc
loc
,
const
char
*
identifier
,
const
char
*
op
)
void
TParseContext
::
reservedPpErrorCheck
(
TSourceLoc
loc
,
const
char
*
identifier
,
const
char
*
op
)
{
{
// "__" are not supposed to be an error. ES 310 (and desktop) added the clarification:
// "All macro names containing two consecutive underscores ( __ ) are reserved;
// "All macro names containing two consecutive underscores ( __ ) are reserved;
// defining such a name does not itself result in an error, but may result in
// defining such a name does not itself result in an error, but may result in
// undefined behavior. All macro names prefixed with "GL_" ("GL" followed by a
// undefined behavior. All macro names prefixed with "GL_" ("GL" followed by a
// single underscore) are also reserved, and defining such a name results in a
// single underscore) are also reserved, and defining such a name results in a
// compile-time error."
// compile-time error."
// however, before that, ES tests required an error.
if
(
strncmp
(
identifier
,
"GL_"
,
3
)
==
0
)
if
(
strncmp
(
identifier
,
"GL_"
,
3
)
==
0
)
error
(
loc
,
"names beginning with
\"
GL_
\"
can't be (un)defined:"
,
op
,
identifier
);
error
(
loc
,
"names beginning with
\"
GL_
\"
can't be (un)defined:"
,
op
,
identifier
);
else
if
(
strstr
(
identifier
,
"__"
)
!=
0
)
{
else
if
(
strstr
(
identifier
,
"__"
)
!=
0
)
{
...
@@ -1814,8 +1822,12 @@ void TParseContext::reservedPpErrorCheck(TSourceLoc loc, const char* identifier,
...
@@ -1814,8 +1822,12 @@ void TParseContext::reservedPpErrorCheck(TSourceLoc loc, const char* identifier,
strcmp
(
identifier
,
"__FILE__"
)
==
0
||
strcmp
(
identifier
,
"__FILE__"
)
==
0
||
strcmp
(
identifier
,
"__VERSION__"
)
==
0
))
strcmp
(
identifier
,
"__VERSION__"
)
==
0
))
error
(
loc
,
"predefined names can't be (un)defined:"
,
op
,
identifier
);
error
(
loc
,
"predefined names can't be (un)defined:"
,
op
,
identifier
);
else
else
{
warn
(
loc
,
"names containing consecutive underscores are reserved:"
,
op
,
identifier
);
if
(
profile
==
EEsProfile
&&
version
<=
300
)
error
(
loc
,
"names containing consecutive underscores are reserved, and an error if version <= 300:"
,
op
,
identifier
);
else
warn
(
loc
,
"names containing consecutive underscores are reserved:"
,
op
,
identifier
);
}
}
}
}
}
...
...
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