Panda3D
pStatGPUTimer.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pStatGPUTimer.h
10  * @author rdb
11  * @date 2014-08-21
12  */
13 
14 #ifndef PSTATGPUTIMER_H
15 #define PSTATGPUTIMER_H
16 
17 #include "pandabase.h"
18 #include "pStatTimer.h"
19 #include "pStatCollector.h"
20 #include "config_pstatclient.h"
21 #include "timerQueryContext.h"
22 
23 class Thread;
25 
26 /**
27  * This is a special type of PStatTimer that also uses a timer query on the
28  * GSG to measure how long a task actually takes to execute on the GPU, rather
29  * than how long it took for the API commands to be queued up.
30  *
31  * This class may only be used on the draw thread.
32  *
33  * At present, it tracks both the CPU time (like a regular PStatTimer does)
34  * and the GPU time, which is recorded using a special PStatThread.
35  */
36 class EXPCL_PANDA_DISPLAY PStatGPUTimer : public PStatTimer {
37 public:
38 #ifdef DO_PSTATS
40  PStatCollector &collector);
42  PStatCollector &collector,
43  Thread *current_thread);
44  INLINE ~PStatGPUTimer();
45 
47 
48 private:
49 #else // DO_PSTATS
50 
52  : PStatTimer(col) { }
54  : PStatTimer(col) { }
55  INLINE ~PStatGPUTimer() { }
56 
57 #endif // DO_PSTATS
58 };
59 
60 #include "pStatGPUTimer.I"
61 
62 #endif
Encapsulates all the communication with a particular instance of a given rendering backend.
A lightweight class that represents a single element that may be timed and/or counted via stats.
This is a special type of PStatTimer that also uses a timer query on the GSG to measure how long a ta...
Definition: pStatGPUTimer.h:36
A lightweight class that can be used to automatically start and stop a PStatCollector around a sectio...
Definition: pStatTimer.h:30
A thread; that is, a lightweight process.
Definition: thread.h:46
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.