forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpStatGPUTimer.I
More file actions
54 lines (49 loc) · 1.21 KB
/
pStatGPUTimer.I
File metadata and controls
54 lines (49 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file pStatGPUTimer.I
* @author rdb
* @date 2014-08-21
*/
#ifdef DO_PSTATS
/**
*
*/
INLINE PStatGPUTimer::
PStatGPUTimer(GraphicsStateGuardian *gsg, PStatCollector &collector) :
PStatTimer(collector),
_gsg(gsg)
{
if (gsg->get_timer_queries_active() && collector.is_active()) {
gsg->issue_timer_query(collector.get_index());
// cerr << "issuing " << collector << " active " << collector.is_active()
// << "\n";
}
}
/**
*
*/
INLINE PStatGPUTimer::
PStatGPUTimer(GraphicsStateGuardian *gsg, PStatCollector &collector, Thread *current_thread) :
PStatTimer(collector, current_thread),
_gsg(gsg)
{
if (gsg->get_timer_queries_active() && collector.is_active()) {
gsg->issue_timer_query(collector.get_index());
}
}
/**
*
*/
INLINE PStatGPUTimer::
~PStatGPUTimer() {
if (_gsg->get_timer_queries_active() && _collector.is_active()) {
_gsg->issue_timer_query(_collector.get_index() | 0x8000);
}
}
#endif