#include <Query.h>
Public Member Functions | |
| void | begin (gpu::Batch &batch) |
| Adds a batch command to begin query. More... | |
| void | end (gpu::Batch &batch) |
| Adds a batch command to get query. More... | |
| double | getGPUAverage () const |
| double | getBatchAverage () const |
| const std::string & | name () const |
Protected Member Functions | |
| int | rangeIndex (int index) const |
| Calculates index in the circular buffer where the queries are stored. | |
Protected Attributes | |
| const std::string | _name |
| Name of the range timer. | |
| gpu::Queries | _timerQueries |
| Query objects used for this range timer. | |
| int | _headIndex = -1 |
Used for circular buffer. Index of the last query that was executed can be calculated from this using rangeIndex(). | |
| int | _tailIndex = -1 |
| MovingAverage< double, QUERY_QUEUE_SIZE *2 > | _movingAverageGPU |
| Average of the time measured on GPU in millseconds. | |
| MovingAverage< double, QUERY_QUEUE_SIZE *2 > | _movingAverageBatch |
Average of the time between do_beginQuery and do_endQuery measured when the batch is executed. | |
Static Protected Attributes | |
| static const int | QUERY_QUEUE_SIZE { 4 } |
| Number of query objects in this range timer. | |
gpu RangeTimer is just returning an estimate of the time taken by a chunk of work delimited by the begin and end calls repeated for several times. The result is always a late average of the time spent for that same task a few cycles ago.
| void RangeTimer::begin | ( | gpu::Batch & | batch | ) |
Adds a batch command to begin query.
| batch | Batch to add the command to. |
| void RangeTimer::end | ( | gpu::Batch & | batch | ) |
Adds a batch command to get query.
| batch | Batch to add the command to. |
| double RangeTimer::getBatchAverage | ( | ) | const |
Batch time is time measured between do_beginQuery and do_endQuery.
| double RangeTimer::getGPUAverage | ( | ) | const |
|
inline |
|
protected |
Used for circular buffer. Index of the last query that was executed can be calculated from this using rangeIndex(). Incremented by a Query object when it's ready for reading.