mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-21 06:46:46 -04:00
render: add wlr_renderer_get_time()
This queries the current GPU time. [1]: https://registry.khronos.org/OpenGL/extensions/EXT/EXT_disjoint_timer_query.txt References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3025
This commit is contained in:
parent
c07424411a
commit
b4765809b5
5 changed files with 45 additions and 0 deletions
|
|
@ -32,6 +32,10 @@ struct wlr_gles2_tex_shader {
|
|||
GLint tex_attrib;
|
||||
};
|
||||
|
||||
// Fixed here, but missing from any libglvnd release:
|
||||
// https://gitlab.freedesktop.org/glvnd/libglvnd/-/merge_requests/268
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data);
|
||||
|
||||
struct wlr_gles2_renderer {
|
||||
struct wlr_renderer wlr_renderer;
|
||||
|
||||
|
|
@ -48,6 +52,7 @@ struct wlr_gles2_renderer {
|
|||
bool EXT_texture_type_2_10_10_10_REV;
|
||||
bool OES_texture_half_float_linear;
|
||||
bool EXT_texture_norm16;
|
||||
bool EXT_disjoint_timer_query;
|
||||
} exts;
|
||||
|
||||
struct {
|
||||
|
|
@ -57,6 +62,7 @@ struct wlr_gles2_renderer {
|
|||
PFNGLPOPDEBUGGROUPKHRPROC glPopDebugGroupKHR;
|
||||
PFNGLPUSHDEBUGGROUPKHRPROC glPushDebugGroupKHR;
|
||||
PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES;
|
||||
PFNGLGETINTEGER64VEXTPROC glGetInteger64vEXT;
|
||||
} procs;
|
||||
|
||||
struct {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ struct wlr_renderer_impl {
|
|||
uint32_t (*get_render_buffer_caps)(struct wlr_renderer *renderer);
|
||||
struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer);
|
||||
bool (*get_time)(struct wlr_renderer *r, struct timespec *t);
|
||||
};
|
||||
|
||||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#include <wlr/backend.h>
|
||||
#include <wlr/render/wlr_texture.h>
|
||||
|
||||
struct timespec;
|
||||
|
||||
struct wlr_renderer_impl;
|
||||
struct wlr_drm_format_set;
|
||||
struct wlr_buffer;
|
||||
|
|
@ -112,6 +114,11 @@ bool wlr_renderer_init_wl_shm(struct wlr_renderer *r,
|
|||
*/
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *r);
|
||||
|
||||
/**
|
||||
* Get the current GPU time.
|
||||
*/
|
||||
bool wlr_renderer_get_time(struct wlr_renderer *r, struct timespec *t);
|
||||
|
||||
/**
|
||||
* Destroys the renderer.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue