globjects
2.0.0.690708773bba
Strict OpenGL objects wrapper.
|
Encapsulates a GL Query object. More...
#include <globjects/include/globjects/Query.h>
Public Member Functions | |
Query () | |
virtual | ~Query () |
virtual void | accept (ObjectVisitor &visitor) override |
void | begin (gl::GLenum target) const |
void | end (gl::GLenum target) const |
void | beginIndexed (gl::GLenum target, gl::GLuint index) const |
void | endIndexed (gl::GLenum target, gl::GLuint index) const |
gl::GLuint | get (gl::GLenum pname) const |
gl::GLuint64 | get64 (gl::GLenum pname) const |
bool | resultAvailable () const |
void | wait () const |
void | wait (const std::chrono::duration< int, std::nano > &timeout) const |
gl::GLuint | waitAndGet (gl::GLenum pname) const |
gl::GLuint64 | waitAndGet64 (gl::GLenum pname) const |
gl::GLuint | waitAndGet (const std::chrono::duration< int, std::nano > &timeout, gl::GLenum pname) const |
gl::GLuint64 | waitAndGet64 (const std::chrono::duration< int, std::nano > &timeout, gl::GLenum pname) const |
gl::GLuint | waitAndGet (gl::GLenum pname, const std::chrono::duration< int, std::nano > &timeout) const |
gl::GLuint64 | waitAndGet64 (gl::GLenum pname, const std::chrono::duration< int, std::nano > &timeout) const |
void | counter () const |
virtual gl::GLenum | objectType () const override |
Public Member Functions inherited from globjects::Object | |
gl::GLuint | id () const |
std::string | name () const |
void | setName (const std::string &name) |
bool | hasName () const |
bool | isDefault () const |
void | detach () |
Static Public Member Functions | |
static std::unique_ptr< Query > | fromId (gl::GLuint id) |
static std::unique_ptr< Query > | current (gl::GLenum target) |
static std::unique_ptr< Query > | timestamp () |
static gl::GLint | get (gl::GLenum target, gl::GLenum pname) |
static gl::GLint | getIndexed (gl::GLenum target, gl::GLuint index, gl::GLenum pname) |
static gl::GLint | getCounterBits (gl::GLenum target) |
static bool | isQuery (gl::GLuint id) |
Static Public Member Functions inherited from globjects::Object | |
static void | hintNameImplementation (NameImplementation impl) |
Static Public Member Functions inherited from globjects::Instantiator< Query > | |
static std::unique_ptr< Query > | create (Args &&...args) |
static std::unique_ptr< Query > | fromId (gl::GLuint id, Args &&...args) |
Protected Member Functions | |
Query (std::unique_ptr< IDResource > &&resource) | |
void | counter (gl::GLenum target) const |
Protected Member Functions inherited from globjects::Object | |
Object (std::unique_ptr< IDResource > &&resource) | |
virtual | ~Object () |
Static Protected Member Functions | |
static gl::GLuint | genQuery () |
Additional Inherited Members | |
Public Types inherited from globjects::Object | |
enum | NameImplementation { NameImplementation::DebugKHR, NameImplementation::Legacy } |
Protected Attributes inherited from globjects::Object | |
std::unique_ptr< IDResource > | m_resource |
void * | m_objectLabelState |
Encapsulates a GL Query object.
A Query object is used to query different aspects of the rendering pipeline, such as passed samples, generated primitives, written transform feedback primitives or elapsed time. With begin() and end(), the scope of the measurements could be specified. As a Query object queries the GPU asynchroneously, the result won't be available right after the end() invokation. The resultAvailable() method indicates whether the calling of get()/get64() will return the final result. To wait until the result is available, the wait() method can be used. Alternatively there are waitAndGet() and waitAndGet64() to query the result in one invokation.
There is a convenience method to create a Query object which answeres with the current timestamp on the GPU named timestamp() (see example below).
An example time measurement:
An example timestamp access:
globjects::Query::Query | ( | ) |
|
virtual |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
overridevirtual |
Implements globjects::Object.
void globjects::Query::begin | ( | gl::GLenum | target | ) | const |
void globjects::Query::end | ( | gl::GLenum | target | ) | const |
void globjects::Query::beginIndexed | ( | gl::GLenum | target, |
gl::GLuint | index | ||
) | const |
void globjects::Query::endIndexed | ( | gl::GLenum | target, |
gl::GLuint | index | ||
) | const |
|
static |
gl::GLuint globjects::Query::get | ( | gl::GLenum | pname | ) | const |
gl::GLuint64 globjects::Query::get64 | ( | gl::GLenum | pname | ) | const |
bool globjects::Query::resultAvailable | ( | ) | const |
void globjects::Query::wait | ( | ) | const |
void globjects::Query::wait | ( | const std::chrono::duration< int, std::nano > & | timeout | ) | const |
gl::GLuint globjects::Query::waitAndGet | ( | gl::GLenum | pname | ) | const |
gl::GLuint64 globjects::Query::waitAndGet64 | ( | gl::GLenum | pname | ) | const |
gl::GLuint globjects::Query::waitAndGet | ( | const std::chrono::duration< int, std::nano > & | timeout, |
gl::GLenum | pname | ||
) | const |
gl::GLuint64 globjects::Query::waitAndGet64 | ( | const std::chrono::duration< int, std::nano > & | timeout, |
gl::GLenum | pname | ||
) | const |
gl::GLuint globjects::Query::waitAndGet | ( | gl::GLenum | pname, |
const std::chrono::duration< int, std::nano > & | timeout | ||
) | const |
gl::GLuint64 globjects::Query::waitAndGet64 | ( | gl::GLenum | pname, |
const std::chrono::duration< int, std::nano > & | timeout | ||
) | const |
void globjects::Query::counter | ( | ) | const |
|
overridevirtual |
Implements globjects::Object.
|
staticprotected |
|
protected |