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
94f28eb6
Commit
94f28eb6
authored
Nov 13, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory: Add loop around main, to test tear-down and reuse, and monitor memory changes.
parent
cb42541e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
StandAlone.cpp
StandAlone/StandAlone.cpp
+31
-13
No files found.
StandAlone/StandAlone.cpp
View file @
94f28eb6
...
@@ -127,6 +127,9 @@ void InfoLogMsg(const char* msg, const char* name, const int num);
...
@@ -127,6 +127,9 @@ void InfoLogMsg(const char* msg, const char* name, const int num);
bool
CompileFailed
=
false
;
bool
CompileFailed
=
false
;
bool
LinkFailed
=
false
;
bool
LinkFailed
=
false
;
// array of unique places to leave the shader names and infologs for the asynchronous compiles
std
::
vector
<
std
::
unique_ptr
<
glslang
::
TWorkItem
>>
WorkItems
;
TBuiltInResource
Resources
;
TBuiltInResource
Resources
;
std
::
string
ConfigFile
;
std
::
string
ConfigFile
;
...
@@ -1022,14 +1025,10 @@ void CompileAndLinkShaderFiles(glslang::TWorklist& Worklist)
...
@@ -1022,14 +1025,10 @@ void CompileAndLinkShaderFiles(glslang::TWorklist& Worklist)
FreeFileData
(
const_cast
<
char
*>
(
it
->
text
[
0
]));
FreeFileData
(
const_cast
<
char
*>
(
it
->
text
[
0
]));
}
}
int
C_DECL
main
(
int
argc
,
char
*
argv
[]
)
int
singleMain
(
)
{
{
// array of unique places to leave the shader names and infologs for the asynchronous compiles
std
::
vector
<
std
::
unique_ptr
<
glslang
::
TWorkItem
>>
workItems
;
ProcessArguments
(
workItems
,
argc
,
argv
);
glslang
::
TWorklist
workList
;
glslang
::
TWorklist
workList
;
std
::
for_each
(
workItems
.
begin
(),
w
orkItems
.
end
(),
[
&
workList
](
std
::
unique_ptr
<
glslang
::
TWorkItem
>&
item
)
{
std
::
for_each
(
WorkItems
.
begin
(),
W
orkItems
.
end
(),
[
&
workList
](
std
::
unique_ptr
<
glslang
::
TWorkItem
>&
item
)
{
assert
(
item
);
assert
(
item
);
workList
.
add
(
item
.
get
());
workList
.
add
(
item
.
get
());
});
});
...
@@ -1061,8 +1060,8 @@ int C_DECL main(int argc, char* argv[])
...
@@ -1061,8 +1060,8 @@ int C_DECL main(int argc, char* argv[])
}
}
if
(
Options
&
EOptionStdin
)
{
if
(
Options
&
EOptionStdin
)
{
w
orkItems
.
push_back
(
std
::
unique_ptr
<
glslang
::
TWorkItem
>
{
new
glslang
::
TWorkItem
(
"stdin"
)});
W
orkItems
.
push_back
(
std
::
unique_ptr
<
glslang
::
TWorkItem
>
{
new
glslang
::
TWorkItem
(
"stdin"
)});
workList
.
add
(
w
orkItems
.
back
().
get
());
workList
.
add
(
W
orkItems
.
back
().
get
());
}
}
ProcessConfigFile
();
ProcessConfigFile
();
...
@@ -1100,11 +1099,11 @@ int C_DECL main(int argc, char* argv[])
...
@@ -1100,11 +1099,11 @@ int C_DECL main(int argc, char* argv[])
CompileShaders
(
workList
);
CompileShaders
(
workList
);
// Print out all the resulting infologs
// Print out all the resulting infologs
for
(
size_t
w
=
0
;
w
<
w
orkItems
.
size
();
++
w
)
{
for
(
size_t
w
=
0
;
w
<
W
orkItems
.
size
();
++
w
)
{
if
(
w
orkItems
[
w
])
{
if
(
W
orkItems
[
w
])
{
if
(
printShaderNames
||
w
orkItems
[
w
]
->
results
.
size
()
>
0
)
if
(
printShaderNames
||
W
orkItems
[
w
]
->
results
.
size
()
>
0
)
PutsIfNonEmpty
(
w
orkItems
[
w
]
->
name
.
c_str
());
PutsIfNonEmpty
(
W
orkItems
[
w
]
->
name
.
c_str
());
PutsIfNonEmpty
(
w
orkItems
[
w
]
->
results
.
c_str
());
PutsIfNonEmpty
(
W
orkItems
[
w
]
->
results
.
c_str
());
}
}
}
}
...
@@ -1119,6 +1118,25 @@ int C_DECL main(int argc, char* argv[])
...
@@ -1119,6 +1118,25 @@ int C_DECL main(int argc, char* argv[])
return
0
;
return
0
;
}
}
int
C_DECL
main
(
int
argc
,
char
*
argv
[])
{
ProcessArguments
(
WorkItems
,
argc
,
argv
);
int
ret
=
0
;
// Loop over the entire init/finalize cycle to watch memory changes
const
int
iterations
=
1
;
if
(
iterations
>
1
)
glslang
::
OS_DumpMemoryCounters
();
for
(
int
i
=
0
;
i
<
iterations
;
++
i
)
{
ret
=
singleMain
();
if
(
iterations
>
1
)
glslang
::
OS_DumpMemoryCounters
();
}
return
ret
;
}
//
//
// Deduce the language from the filename. Files must end in one of the
// Deduce the language from the filename. Files must end in one of the
// following extensions:
// following extensions:
...
...
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