Panda3D
Loading...
Searching...
No Matches
panda
src
display
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
;
24
class
GraphicsStateGuardian
;
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
39
INLINE
PStatGPUTimer
(
GraphicsStateGuardian
*gsg,
40
PStatCollector
&collector);
41
INLINE
PStatGPUTimer
(
GraphicsStateGuardian
*gsg,
42
PStatCollector
&collector,
43
Thread
*current_thread);
44
INLINE
~PStatGPUTimer
();
45
46
GraphicsStateGuardian
*_gsg;
47
48
private
:
49
#else
// DO_PSTATS
50
51
INLINE
PStatGPUTimer
(
GraphicsStateGuardian
*,
PStatCollector
&col)
52
:
PStatTimer
(col) { }
53
INLINE
PStatGPUTimer
(
GraphicsStateGuardian
*,
PStatCollector
&col,
Thread
*)
54
:
PStatTimer
(col) { }
55
INLINE
~PStatGPUTimer
() { }
56
57
#endif
// DO_PSTATS
58
};
59
60
#include "
pStatGPUTimer.I
"
61
62
#endif
GraphicsStateGuardian
Encapsulates all the communication with a particular instance of a given rendering backend.
Definition
graphicsStateGuardian.h:65
PStatCollector
A lightweight class that represents a single element that may be timed and/or counted via stats.
Definition
pStatCollector.h:43
PStatGPUTimer
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
PStatTimer
A lightweight class that can be used to automatically start and stop a PStatCollector around a sectio...
Definition
pStatTimer.h:30
Thread
A thread; that is, a lightweight process.
Definition
thread.h:46
config_pstatclient.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatCollector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatGPUTimer.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatTimer.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
timerQueryContext.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Mon Jan 8 2024 17:18:37 for Panda3D by
1.10.0