new backend: glx: use glFinish/glXWaitGL if not on NVIDIA
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
b35bfd07d1
commit
c55088944a
@ -834,6 +834,15 @@ bool gl_init(struct gl_data *gd, session_t *ps) {
|
|||||||
log_add_target_tls(gd->logger);
|
log_add_target_tls(gd->logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *vendor = (const char *)glGetString(GL_VENDOR);
|
||||||
|
log_debug("GL_VENDOR = %s", vendor);
|
||||||
|
if (strcmp(vendor, "NVIDIA Corporation") == 0) {
|
||||||
|
log_info("GL vendor is NVIDIA, don't use glFinish");
|
||||||
|
gd->is_nvidia = true;
|
||||||
|
} else {
|
||||||
|
gd->is_nvidia = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ typedef struct gl_texture {
|
|||||||
|
|
||||||
struct gl_data {
|
struct gl_data {
|
||||||
backend_t base;
|
backend_t base;
|
||||||
|
// If we are using proprietary NVIDIA driver
|
||||||
|
bool is_nvidia;
|
||||||
// Height and width of the viewport
|
// Height and width of the viewport
|
||||||
int height, width;
|
int height, width;
|
||||||
int npasses;
|
int npasses;
|
||||||
|
@ -435,6 +435,10 @@ err:
|
|||||||
static void glx_present(backend_t *base) {
|
static void glx_present(backend_t *base) {
|
||||||
struct _glx_data *gd = (void *)base;
|
struct _glx_data *gd = (void *)base;
|
||||||
glXSwapBuffers(gd->display, gd->target_win);
|
glXSwapBuffers(gd->display, gd->target_win);
|
||||||
|
// XXX there should be no need to block compton will wait for render to finish
|
||||||
|
if (!gd->gl.is_nvidia) {
|
||||||
|
glXWaitGL();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int glx_buffer_age(backend_t *base) {
|
static int glx_buffer_age(backend_t *base) {
|
||||||
|
Loading…
Reference in New Issue
Block a user