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
029d746b
Commit
029d746b
authored
Nov 12, 2013
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix line-continuation bug.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24021
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
df0488dd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
8 deletions
+47
-8
lineContinuation.vert.out
Test/baseResults/lineContinuation.vert.out
+10
-0
lineContinuation100.vert.out
Test/baseResults/lineContinuation100.vert.out
+12
-1
lineContinuation.vert
Test/lineContinuation.vert
+7
-1
lineContinuation100.vert
Test/lineContinuation100.vert
+7
-1
Scan.cpp
glslang/MachineIndependent/Scan.cpp
+1
-1
PpScanner.cpp
glslang/MachineIndependent/preprocessor/PpScanner.cpp
+10
-4
No files found.
Test/baseResults/lineContinuation.vert.out
View file @
029d746b
...
...
@@ -11,6 +11,16 @@ ERROR: node is still EOpNull!
0:20 'gl_Position' (gl_Position highp 4-component vector of float)
0:20 Construct vec4 (highp 4-component vector of float)
0:20 'foo' (highp float)
0:22 Function Definition: foo2(vf4; (highp 4-component vector of float)
0:22 Function Parameters:
0:22 'a' (in highp 4-component vector of float)
0:24 Sequence
0:24 Sequence
0:24 move second child to first child (highp 4-component vector of float)
0:24 'b' (highp 4-component vector of float)
0:24 'a' (in highp 4-component vector of float)
0:25 Branch: Return with expression
0:25 'b' (highp 4-component vector of float)
0:? Linker Objects
0:? 'foo' (highp float)
0:? 'gl_VertexID' (gl_VertexId highp int)
...
...
Test/baseResults/lineContinuation100.vert.out
View file @
029d746b
...
...
@@ -6,7 +6,8 @@ ERROR: 0:13: 'line continuation' : not supported for this version or the enabled
ERROR: 0:14: 'line continuation' : not supported for this version or the enabled extensions
ERROR: 0:15: 'line continuation' : not supported for this version or the enabled extensions
ERROR: 0:18: '#error' : e3
ERROR: 8 compilation errors. No code generated.
ERROR: 0:24: 'line continuation' : not supported for this version or the enabled extensions
ERROR: 9 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:20 Function Definition: main( (void)
...
...
@@ -16,6 +17,16 @@ ERROR: node is still EOpNull!
0:20 'gl_Position' (gl_Position highp 4-component vector of float)
0:20 Construct vec4 (highp 4-component vector of float)
0:20 'foo' (highp float)
0:22 Function Definition: foo2(vf4; (highp 4-component vector of float)
0:22 Function Parameters:
0:22 'a' (in highp 4-component vector of float)
0:24 Sequence
0:24 Sequence
0:24 move second child to first child (highp 4-component vector of float)
0:24 'b' (highp 4-component vector of float)
0:24 'a' (in highp 4-component vector of float)
0:25 Branch: Return with expression
0:25 'b' (highp 4-component vector of float)
0:? Linker Objects
0:? 'foo' (highp float)
Test/lineContinuation.vert
View file @
029d746b
...
...
@@ -11,10 +11,16 @@ oo; // same as 'float foo;'
#error e2
#define MAIN void main() \
{
\
{
\
gl_Position = vec4(foo); \
}
#error e3
MAIN
vec4
foo2
(
vec4
a
)
{
vec4
b
=
a
;
\
return
b
;
}
Test/lineContinuation100.vert
View file @
029d746b
...
...
@@ -11,10 +11,16 @@ oo; // same as 'float foo;'
#error e2
#define MAIN void main() \
{
\
{
\
gl_Position
=
vec4
(
foo
);
\
}
#error e3
MAIN
vec4
foo2
(
vec4
a
)
{
vec4
b
=
a
;
\
return
b
;
}
glslang/MachineIndependent/Scan.cpp
View file @
029d746b
...
...
@@ -90,7 +90,7 @@ bool TInputScanner::consumeComment()
break
;
}
else
{
// it's a '\', so we need to keep going, after skipping what's escaped
// read the skipped character
c
=
get
();
...
...
glslang/MachineIndependent/preprocessor/PpScanner.cpp
View file @
029d746b
...
...
@@ -256,10 +256,9 @@ int TPpContext::sourceScan(TPpContext* pp, InputSrc*, TPpToken* ppToken)
int
len
,
ch
,
ii
;
unsigned
ival
=
0
;
ppToken
->
ival
=
0
;
ch
=
pp
->
currentInput
->
getch
(
pp
,
pp
->
currentInput
,
ppToken
);
for
(;;)
{
ppToken
->
ival
=
0
;
ch
=
pp
->
currentInput
->
getch
(
pp
,
pp
->
currentInput
,
ppToken
);
while
(
ch
==
' '
||
ch
==
'\t'
||
ch
==
'\r'
)
{
ppToken
->
ival
=
1
;
ch
=
pp
->
currentInput
->
getch
(
pp
,
pp
->
currentInput
,
ppToken
);
...
...
@@ -281,7 +280,7 @@ int TPpContext::sourceScan(TPpContext* pp, InputSrc*, TPpToken* ppToken)
case
'k'
:
case
'l'
:
case
'm'
:
case
'n'
:
case
'o'
:
case
'p'
:
case
'q'
:
case
'r'
:
case
's'
:
case
't'
:
case
'u'
:
case
'v'
:
case
'w'
:
case
'x'
:
case
'y'
:
case
'z'
:
case
'z'
:
case
'\\'
:
do
{
if
(
ch
==
'\\'
)
{
// escaped character
...
...
@@ -311,6 +310,10 @@ int TPpContext::sourceScan(TPpContext* pp, InputSrc*, TPpToken* ppToken)
ch
==
'_'
||
ch
==
'\\'
);
// line continuation with no token before or after makes len == 0, and need to start over skipping white space, etc.
if
(
len
==
0
)
continue
;
tokenText
[
len
]
=
'\0'
;
pp
->
currentInput
->
ungetch
(
pp
,
pp
->
currentInput
,
ch
,
ppToken
);
ppToken
->
atom
=
pp
->
LookUpAddString
(
tokenText
);
...
...
@@ -706,6 +709,9 @@ int TPpContext::sourceScan(TPpContext* pp, InputSrc*, TPpToken* ppToken)
return
CPP_ERROR_SY
;
}
}
ppToken
->
ival
=
0
;
ch
=
pp
->
currentInput
->
getch
(
pp
,
pp
->
currentInput
,
ppToken
);
}
}
...
...
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