Rendu
A lightweight rendering engine for experimentations
|
Represent a GPU query, automatically buffered and retrieved. More...
#include <GPUTypes.hpp>
Public Types | |
enum class | Type : uint { TIME_ELAPSED , SAMPLES_DRAWN , ANY_DRAWN } |
Public Member Functions | |
GPUQuery (Type type=GPUQuery::Type::TIME_ELAPSED) | |
void | begin () |
void | end () |
uint64_t | value () |
Private Attributes | |
Type | _type = GPUQuery::Type::TIME_ELAPSED |
The type of query. | |
uint | _count = 2 |
Number of queries used internally (two for duration queries) | |
uint | _offset = 0 |
Offset of the first query in the query pools. | |
bool | _ranThisFrame = false |
Has the query been run this frame (else we won't fetch its value). | |
bool | _running = false |
Is a measurement currently taking place. | |
Represent a GPU query, automatically buffered and retrieved.
|
strong |
Type for query to perform.
Enumerator | |
---|---|
TIME_ELAPSED | Time taken by GPU operations between the beginning and end of the query. |
SAMPLES_DRAWN | Number of samples passing the tests while the query is active. |
ANY_DRAWN | Was any sample drawn while the query was active. |
GPUQuery::GPUQuery | ( | Type | type = GPUQuery::Type::TIME_ELAPSED | ) |
Constructor.
type | the metric to query |
void GPUQuery::begin | ( | ) |
Start measuring the metric.
void GPUQuery::end | ( | ) |
End the measurement.
uint64_t GPUQuery::value | ( | ) |
Query the metric measured at the last frame. Unit used is nanoseconds for timing queries, number of samples for occlusion queries.