File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88#include < igl/opengl/Timer.h>
99
10+ #include < igl/Macros.h>
1011#include < igl/opengl/DeviceFeatureSet.h>
1112
1213namespace igl ::opengl {
@@ -28,19 +29,23 @@ namespace igl::opengl {
2829#endif
2930
3031Timer::Timer (IContext& context) : WithContext(context) {
32+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
3133 iglGenQueries (1 , &id_);
3234 iglBeginQuery (GL_TIME_ELAPSED , id_);
3335}
3436
3537Timer::~Timer () {
38+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_DESTROY );
3639 iglDeleteQueries (1 , &id_);
3740}
3841
3942void Timer::end () {
43+ IGL_PROFILER_FUNCTION ();
4044 iglEndQuery (GL_TIME_ELAPSED );
4145}
4246
4347uint64_t Timer::getElapsedTimeNanos () const {
48+ IGL_PROFILER_FUNCTION ();
4449 // Check for GPU disjoint event (power management, context switch, etc.)
4550 // If a disjoint occurred, the timing results are invalid
4651 if (DeviceFeatureSet::usesOpenGLES ()) {
@@ -57,6 +62,7 @@ uint64_t Timer::getElapsedTimeNanos() const {
5762}
5863
5964bool Timer::resultsAvailable () const {
65+ IGL_PROFILER_FUNCTION ();
6066 GLint available = 0 ;
6167 iglGetQueryObjectiv (id_, GL_QUERY_RESULT_AVAILABLE , &available);
6268 // NOLINTNEXTLINE(readability-implicit-bool-conversion)
You can’t perform that action at this time.
0 commit comments