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
0c6f9360
Commit
0c6f9360
authored
Apr 20, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #96: Support do-while loop substatements with no curly braces.
parent
67027189
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
hlsl.doLoop.frag.out
Test/baseResults/hlsl.doLoop.frag.out
+0
-0
hlsl.implicitBool.frag.out
Test/baseResults/hlsl.implicitBool.frag.out
+6
-4
hlsl.doLoop.frag
Test/hlsl.doLoop.frag
+5
-2
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+1
-7
No files found.
Test/baseResults/hlsl.doLoop.frag.out
View file @
0c6f9360
This diff is collapsed.
Click to expand it.
Test/baseResults/hlsl.implicitBool.frag.out
View file @
0c6f9360
...
@@ -118,8 +118,9 @@ gl_FragCoord origin is upper left
...
@@ -118,8 +118,9 @@ gl_FragCoord origin is upper left
0:24 Convert int to bool ( temp bool)
0:24 Convert int to bool ( temp bool)
0:24 'i' ( temp int)
0:24 'i' ( temp int)
0:24 Loop Body
0:24 Loop Body
0:24 Pre-Decrement ( temp int)
0:? Sequence
0:24 'i' ( temp int)
0:24 Pre-Decrement ( temp int)
0:24 'i' ( temp int)
0:? Sequence
0:? Sequence
0:26 Loop with condition tested first
0:26 Loop with condition tested first
0:26 Loop Condition
0:26 Loop Condition
...
@@ -286,8 +287,9 @@ gl_FragCoord origin is upper left
...
@@ -286,8 +287,9 @@ gl_FragCoord origin is upper left
0:24 Convert int to bool ( temp bool)
0:24 Convert int to bool ( temp bool)
0:24 'i' ( temp int)
0:24 'i' ( temp int)
0:24 Loop Body
0:24 Loop Body
0:24 Pre-Decrement ( temp int)
0:? Sequence
0:24 'i' ( temp int)
0:24 Pre-Decrement ( temp int)
0:24 'i' ( temp int)
0:? Sequence
0:? Sequence
0:26 Loop with condition tested first
0:26 Loop with condition tested first
0:26 Loop Condition
0:26 Loop Condition
...
...
Test/hlsl.doLoop.frag
View file @
0c6f9360
float4
PixelShaderFunction
(
float
4
input
)
:
COLOR0
float4
PixelShaderFunction
(
float
input
)
:
COLOR0
{
{
[
unroll
]
do
{}
while
(
false
);
[
unroll
]
do
{}
while
(
false
);
[
unroll
]
do
{;}
while
(
false
);
[
unroll
]
do
{;}
while
(
false
);
do
{
return
input
;
}
while
(
all
(
input
==
input
));
do
{
return
(
float4
)
input
;
}
while
(
input
>
2
.
0
);
do
++
input
;
while
(
input
<
10
.
0
);
do
while
(
++
input
<
10
.
0
);
while
(
++
input
<
10
.
0
);
// nest while inside do-while
return
(
float4
)
input
;
}
}
hlsl/hlslGrammar.cpp
View file @
0c6f9360
...
@@ -3328,18 +3328,12 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement)
...
@@ -3328,18 +3328,12 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement)
case
EHTokDo
:
case
EHTokDo
:
parseContext
.
nestLooping
();
parseContext
.
nestLooping
();
if
(
!
acceptTokenClass
(
EHTokLeftBrace
))
expected
(
"{"
);
// statement
// statement
if
(
!
peekTokenClass
(
EHTokRightBrace
)
&&
!
acceptScopedStatement
(
statement
))
{
if
(
!
acceptScopedStatement
(
statement
))
{
expected
(
"do sub-statement"
);
expected
(
"do sub-statement"
);
return
false
;
return
false
;
}
}
if
(
!
acceptTokenClass
(
EHTokRightBrace
))
expected
(
"}"
);
// WHILE
// WHILE
if
(
!
acceptTokenClass
(
EHTokWhile
))
{
if
(
!
acceptTokenClass
(
EHTokWhile
))
{
expected
(
"while"
);
expected
(
"while"
);
...
...
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