diff options
author | Alexander Trukhin <alxtry@gmail.com> | 2015-08-24 23:17:43 +0300 |
---|---|---|
committer | Alexander Trukhin <alxtry@gmail.com> | 2015-08-26 21:02:42 +0300 |
commit | 1d0bf77be127f08a243f2ce7078606c4e8902a5d (patch) | |
tree | a65addd578b996641d6e5cdd94b830f4e78db36e /retrace/metric_backend_intel_perfquery.hpp | |
parent | ca8139cdf18dec6956131642e4f914301345555d (diff) |
Add support for handling context switches in Metrics abstraction.
In OpenGL, a context switch is executed by calling MakeCurrent.
Two new functions in the MetricBackend interface:
void pausePass()
void continuePass()
In glretrace these calls are added to MakeCurrent invocation.
The pausePass() function should be called before the context switch while
the continuePass() one should be called after.
pausePass() ends all current queries, prepares for context switch.
continuePass() is called in a new context, makes everything needed for
profiling continuation (checks backends support, setups queries etc.)
With this commit backends gain only basic support for context switches.
Somewhere checks are missing, somewhere it should be made more clear
what to do with interrupted queries.
Diffstat (limited to 'retrace/metric_backend_intel_perfquery.hpp')
-rw-r--r-- | retrace/metric_backend_intel_perfquery.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/retrace/metric_backend_intel_perfquery.hpp b/retrace/metric_backend_intel_perfquery.hpp index da84f269..6c447804 100644 --- a/retrace/metric_backend_intel_perfquery.hpp +++ b/retrace/metric_backend_intel_perfquery.hpp @@ -107,6 +107,7 @@ private: unsigned curQuery; bool supported; bool perFrame; + bool queryInProgress; int numPasses; int numFramePasses; int curPass; @@ -149,6 +150,10 @@ public: void endPass(); + void pausePass(); + + void continuePass(); + void beginQuery(QueryBoundary boundary = QUERY_BOUNDARY_DRAWCALL); void endQuery(QueryBoundary boundary = QUERY_BOUNDARY_DRAWCALL); |