Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
dc64895d
Commit
dc64895d
authored
Mar 29, 2017
by
Jakob Weiss
Browse files
Improved timing of processors, TextureManager enabled by default
parent
b2472508
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/pipeline/abstractpipeline.cpp
View file @
dc64895d
...
...
@@ -220,9 +220,13 @@ namespace campvis {
}
std
::
chrono
::
high_resolution_clock
::
time_point
endTime
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
dT
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
endTime
-
startTime
);
auto
timeSinceLastExec
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
endTime
-
processor
->
getLastExecutionTime
());
double
dTms
=
double
(
dT
.
count
())
/
1000.
;
double
timeSinceLastExecMs
=
double
(
timeSinceLastExec
.
count
())
/
1000.
;
LINFO
(
"Executed processor "
<<
processor
->
getName
()
<<
" GPU duration:
\t
"
<<
double
(
gpuTimeElapsed
)
/
1e6
<<
", total:
\t
"
<<
dTms
<<
" ms"
);
processor
->
setLastExeuctionTime
(
endTime
);
LINFO
(
"Timing "
<<
processor
->
getName
()
<<
": GPU:
\t
"
<<
double
(
gpuTimeElapsed
)
/
1e6
<<
"ms, total:
\t
"
<<
dTms
<<
"ms, since Last Exec:
\t
"
<<
timeSinceLastExecMs
<<
"ms."
);
}
}
}
...
...
core/pipeline/abstractprocessor.cpp
View file @
dc64895d
...
...
@@ -147,6 +147,16 @@ namespace campvis {
_clockExecutionTime
=
value
;
}
std
::
chrono
::
high_resolution_clock
::
time_point
AbstractProcessor
::
getLastExecutionTime
()
{
return
_lastExecutionTime
;
}
void
AbstractProcessor
::
setLastExeuctionTime
(
const
std
::
chrono
::
high_resolution_clock
::
time_point
&
executionTime
)
{
_lastExecutionTime
=
executionTime
;
}
void
AbstractProcessor
::
process
(
DataContainer
&
data
)
{
if
(
hasInvalidShader
())
{
updateShader
();
...
...
core/pipeline/abstractprocessor.h
View file @
dc64895d
...
...
@@ -36,6 +36,7 @@
#include
"core/datastructures/datacontainer.h"
#include
"core/properties/propertycollection.h"
#include
<chrono>
#include
<unordered_map>
#include
<string>
#include
<vector>
...
...
@@ -232,6 +233,16 @@ namespace campvis {
*/
void
setClockExecutionTime
(
bool
value
);
/**
* Returns the absolute time of the last (timed) execution
*/
std
::
chrono
::
high_resolution_clock
::
time_point
getLastExecutionTime
();
/**
* Sets the absolute time of the last execution
*/
void
setLastExeuctionTime
(
const
std
::
chrono
::
high_resolution_clock
::
time_point
&
executionTime
);
/**
* Returns the current lockProcessor status of this processor.
* If a processor is locked, all of its properties are locked and its process method must not be called.
...
...
@@ -388,6 +399,7 @@ namespace campvis {
tbb
::
atomic
<
bool
>
_enabled
;
///< flag whether this processor is currently enabled
tbb
::
atomic
<
bool
>
_clockExecutionTime
;
///< flag whether to measure the execution time of this processor
std
::
chrono
::
high_resolution_clock
::
time_point
_lastExecutionTime
;
///< time of last execution
tbb
::
atomic
<
int
>
_ignorePropertyChanges
;
///< flag whether signals from properties shall be ignored
/// Flag whether this processor is currently locked
...
...
ext/cgt/texturemanager.cpp
View file @
dc64895d
...
...
@@ -5,7 +5,7 @@
#include
"opengljobprocessor.h"
//
#define ENABLE_TEXTURE_POOL
#define ENABLE_TEXTURE_POOL
namespace
{
/// private class to format iostream to use points as a thousands separator
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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