GteDX11PerformanceCounter.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
11 
12 namespace gte
13 {
14 
15 // Support for coarse-level GPU timing.
16 
18 {
19 public:
20  // Construction and destruction.
22  DX11PerformanceCounter(ID3D11Device* device);
23 
24  // Performance measurements.
25  int64_t GetTicks() const;
26  double GetSeconds() const;
27 
28  // Get the time for the specified number of ticks.
29  double GetSeconds(int64_t numTicks) const;
30 
31  // Get the number of ticks for the specified time.
32  int64_t GetTicks(double seconds) const;
33 
34  // For average performance measurements.
35  void ResetAccumulateTime();
36  void AccumulateTime();
37  double GetAverageSeconds() const;
38  unsigned int GetNumMeasurements() const;
39 
40 private:
41  // Allow the engine to access the members directly to avoid exposing
42  // internals via the public interface.
43  friend class DX11Engine;
44 
45  D3D11_QUERY_DATA_TIMESTAMP_DISJOINT mTimeStamp;
46  ID3D11Query* mFrequencyQuery;
47  ID3D11Query* mStartTimeQuery;
48  ID3D11Query* mFinalTimeQuery;
49  double mFrequency, mInvFrequency;
50  int64_t mStartTime, mFinalTime;
51  double mTotalSeconds;
52  unsigned int mNumMeasurements;
53 };
54 
55 }
GLfloat seconds
Definition: wglext.h:657
D3D11_QUERY_DATA_TIMESTAMP_DISJOINT mTimeStamp
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59