Merge branch 'richardgv-dev'

This commit is contained in:
Richard Grenville 2014-01-06 15:31:42 +08:00
commit 4868d1ec3e
2 changed files with 18 additions and 2 deletions

View File

@ -513,6 +513,9 @@ typedef struct {
bool dbe; bool dbe;
/// Whether to do VSync aggressively. /// Whether to do VSync aggressively.
bool vsync_aggressive; bool vsync_aggressive;
/// Whether to use glFinish() instead of glFlush() for (possibly) better
/// VSync yet probably higher CPU usage.
bool vsync_use_glfinish;
// === Shadow === // === Shadow ===
/// Enable/disable shadow for specific window types. /// Enable/disable shadow for specific window types.
@ -1491,6 +1494,11 @@ parse_backend(session_t *ps, const char *str) {
ps->o.backend = i; ps->o.backend = i;
return true; return true;
} }
// Keep compatibility with an old revision containing a spelling mistake...
if (!strcasecmp(str, "xr_glx_hybird")) {
ps->o.backend = BKEND_XR_GLX_HYBRID;
return true;
}
printf_errf("(\"%s\"): Invalid backend argument.", str); printf_errf("(\"%s\"): Invalid backend argument.", str);
return false; return false;
} }

View File

@ -1905,7 +1905,10 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t
XSync(ps->dpy, False); XSync(ps->dpy, False);
#ifdef CONFIG_VSYNC_OPENGL #ifdef CONFIG_VSYNC_OPENGL
if (ps->glx_context) { if (ps->glx_context) {
glFinish(); if (ps->o.vsync_use_glfinish)
glFinish();
else
glFlush();
glXWaitX(); glXWaitX();
} }
#endif #endif
@ -1939,7 +1942,10 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t
#ifdef CONFIG_VSYNC_OPENGL #ifdef CONFIG_VSYNC_OPENGL
case BKEND_XR_GLX_HYBRID: case BKEND_XR_GLX_HYBRID:
XSync(ps->dpy, False); XSync(ps->dpy, False);
glFinish(); if (ps->o.vsync_use_glfinish)
glFinish();
else
glFlush();
glXWaitX(); glXWaitX();
paint_bind_tex_real(ps, &ps->tgt_buffer, paint_bind_tex_real(ps, &ps->tgt_buffer,
ps->root_width, ps->root_height, ps->depth, ps->root_width, ps->root_height, ps->depth,
@ -5421,6 +5427,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
{ "unredir-if-possible-exclude", required_argument, NULL, 308 }, { "unredir-if-possible-exclude", required_argument, NULL, 308 },
{ "unredir-if-possible-delay", required_argument, NULL, 309 }, { "unredir-if-possible-delay", required_argument, NULL, 309 },
{ "write-pid-path", required_argument, NULL, 310 }, { "write-pid-path", required_argument, NULL, 310 },
{ "vsync-use-glfinish", no_argument, NULL, 311 },
// Must terminate with a NULL entry // Must terminate with a NULL entry
{ NULL, 0, NULL, 0 }, { NULL, 0, NULL, 0 },
}; };
@ -5668,6 +5675,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
// --write-pid-path // --write-pid-path
ps->o.write_pid_path = mstrcpy(optarg); ps->o.write_pid_path = mstrcpy(optarg);
break; break;
P_CASEBOOL(311, vsync_use_glfinish);
default: default:
usage(1); usage(1);
break; break;