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
2ad4492e
Commit
2ad4492e
authored
Sep 02, 2019
by
Roy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code refine
Reduce the number of cycles.
parent
e8e138b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
iomapper.cpp
glslang/MachineIndependent/iomapper.cpp
+6
-2
No files found.
glslang/MachineIndependent/iomapper.cpp
View file @
2ad4492e
...
...
@@ -1035,7 +1035,9 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase {
bool
TIoMapper
::
addStage
(
EShLanguage
stage
,
TIntermediate
&
intermediate
,
TInfoSink
&
infoSink
,
TIoMapResolver
*
resolver
)
{
bool
somethingToDo
=
!
intermediate
.
getResourceSetBinding
().
empty
()
||
intermediate
.
getAutoMapBindings
()
||
intermediate
.
getAutoMapLocations
();
for
(
int
res
=
0
;
res
<
EResCount
;
++
res
)
{
// Restrict the stricter condition to further check 'somethingToDo' only if 'somethingToDo' has not been set, reduce
// unnecessary or insignificant for-loop operation after 'somethingToDo' have been true.
for
(
int
res
=
0
;
(
res
<
EResCount
&&
!
somethingToDo
);
++
res
)
{
somethingToDo
=
somethingToDo
||
(
intermediate
.
getShiftBinding
(
TResourceType
(
res
))
!=
0
)
||
intermediate
.
hasShiftBindingForSet
(
TResourceType
(
res
));
}
...
...
@@ -1134,7 +1136,9 @@ bool TGlslIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TIn
bool
somethingToDo
=
!
intermediate
.
getResourceSetBinding
().
empty
()
||
intermediate
.
getAutoMapBindings
()
||
intermediate
.
getAutoMapLocations
();
for
(
int
res
=
0
;
res
<
EResCount
;
++
res
)
{
// Restrict the stricter condition to further check 'somethingToDo' only if 'somethingToDo' has not been set, reduce
// unnecessary or insignificant for-loop operation after 'somethingToDo' have been true.
for
(
int
res
=
0
;
(
res
<
EResCount
&&
!
somethingToDo
);
++
res
)
{
somethingToDo
=
somethingToDo
||
(
intermediate
.
getShiftBinding
(
TResourceType
(
res
))
!=
0
)
||
intermediate
.
hasShiftBindingForSet
(
TResourceType
(
res
));
}
...
...
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