Print deprecation warning for removed OpenGL options

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-09-30 21:05:32 +01:00
parent 03f33ed45c
commit cb4bab1cf6
7 changed files with 11 additions and 50 deletions

View File

@ -74,8 +74,6 @@ invert-color-include = [ ];
# GLX backend
# glx-no-stencil = true;
glx-copy-from-front = false;
# glx-use-copysubbuffermesa = true;
# glx-no-rebind-pixmap = true;
glx-swap-method = "undefined";
# glx-use-gpushader4 = true;

View File

@ -249,17 +249,11 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
*--glx-no-stencil*::
GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content (but never practically happened) and may not work with *--blur-background*. My tests show a 15% performance boost. Recommended.
*--glx-copy-from-front*::
GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, but a 20% increase when only 1/4 is. My tests on nouveau show terrible slowdown. Useful with `--glx-swap-method`, as well.
*--glx-use-copysubbuffermesa*::
GLX backend: Use 'MESA_copy_sub_buffer' to do partial screen update. My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. May break VSync and is not available on some drivers. Overrides *--glx-copy-from-front*.
*--glx-no-rebind-pixmap*::
GLX backend: Avoid rebinding pixmap on window damage. Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
*--glx-swap-method* undefined/exchange/copy/3/4/5/6/buffer-age::
GLX backend: GLX buffer swap method we assume. Could be `undefined` (0), `copy` (1), `exchange` (2), 3-6, or `buffer-age` (-1). `undefined` is the slowest and the safest, and the default value. `copy` is fastest, but may fail on some drivers, 2-6 are gradually slower but safer (6 is still faster than 0). Usually, double buffer means 2, triple buffer means 3. `buffer-age` means auto-detect using 'GLX_EXT_buffer_age', supported by some drivers. Useless with *--glx-use-copysubbuffermesa*. Partially breaks `--resize-damage`. Defaults to `undefined`.
GLX backend: GLX buffer swap method we assume. Could be `undefined` (0), `copy` (1), `exchange` (2), 3-6, or `buffer-age` (-1). `undefined` is the slowest and the safest, and the default value. `copy` is fastest, but may fail on some drivers, 2-6 are gradually slower but safer (6 is still faster than 0). Usually, double buffer means 2, triple buffer means 3. `buffer-age` means auto-detect using 'GLX_EXT_buffer_age', supported by some drivers. Partially breaks `--resize-damage`. Defaults to `undefined`.
*--glx-use-gpushader4*::
GLX backend: Use 'GL_EXT_gpu_shader4' for some optimization on blur GLSL code. My tests on GTX 670 show no noticeable effect.

View File

@ -378,8 +378,6 @@ typedef int (*f_SwapIntervalMESA) (unsigned int interval);
typedef void (*f_BindTexImageEXT) (Display *display, GLXDrawable drawable, int buffer, const int *attrib_list);
typedef void (*f_ReleaseTexImageEXT) (Display *display, GLXDrawable drawable, int buffer);
typedef void (*f_CopySubBuffer) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#ifdef CONFIG_GLX_SYNC
// Looks like duplicate typedef of the same type is safe?
typedef int64_t GLint64;
@ -541,10 +539,6 @@ typedef struct options_t {
/// Whether to avoid using stencil buffer under GLX backend. Might be
/// unsafe.
bool glx_no_stencil;
/// Whether to copy unmodified regions from front buffer.
bool glx_copy_from_front;
/// Whether to use glXCopySubBufferMESA() to update screen.
bool glx_use_copysubbuffermesa;
/// Whether to avoid rebinding pixmap on window damage.
bool glx_no_rebind_pixmap;
/// GLX swap method we assume OpenGL uses.
@ -744,8 +738,6 @@ typedef struct {
f_BindTexImageEXT glXBindTexImageProc;
/// Pointer to glXReleaseTexImageEXT function.
f_ReleaseTexImageEXT glXReleaseTexImageProc;
/// Pointer to glXCopySubBufferMESA function.
f_CopySubBuffer glXCopySubBufferProc;
#ifdef CONFIG_GLX_SYNC
/// Pointer to the glFenceSync() function.
f_FenceSync glFenceSyncProc;

View File

@ -3441,19 +3441,6 @@ usage(int ret) {
" when rendering transparent content. My tests show a 15% performance\n"
" boost.\n"
"\n"
"--glx-copy-from-front\n"
" GLX backend: Copy unmodified regions from front buffer instead of\n"
" redrawing them all. My tests with nvidia-drivers show a 5% decrease\n"
" in performance when the whole screen is modified, but a 30% increase\n"
" when only 1/4 is. My tests on nouveau show terrible slowdown. Could\n"
" work with --glx-swap-method but not --glx-use-copysubbuffermesa.\n"
"\n"
"--glx-use-copysubbuffermesa\n"
" GLX backend: Use MESA_copy_sub_buffer to do partial screen update.\n"
" My tests on nouveau shows a 200% performance boost when only 1/4 of\n"
" the screen is updated. May break VSync and is not available on some\n"
" drivers. Overrides --glx-copy-from-front.\n"
"\n"
"--glx-no-rebind-pixmap\n"
" GLX backend: Avoid rebinding pixmap on window damage. Probably\n"
" could improve performance on rapid window content changes, but is\n"
@ -3466,8 +3453,7 @@ usage(int ret) {
" \"undefined\" is the slowest and the safest, and the default value.\n"
" 1 is fastest, but may fail on some drivers, 2-6 are gradually slower\n"
" but safer (6 is still faster than 0). -1 means auto-detect using\n"
" GLX_EXT_buffer_age, supported by some drivers. Useless with\n"
" --glx-use-copysubbuffermesa.\n"
" GLX_EXT_buffer_age, supported by some drivers. \n"
"\n"
"--glx-use-gpushader4\n"
" GLX backend: Use GL_EXT_gpu_shader4 for some optimization on blur\n"
@ -3971,13 +3957,17 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
exit(1);
break;
P_CASEBOOL(291, glx_no_stencil);
P_CASEBOOL(292, glx_copy_from_front);
case 292:
printf_errf("(): --glx-copy-from-front is deprecated");
break;
P_CASELONG(293, benchmark);
case 294:
// --benchmark-wid
ps->o.benchmark_wid = strtol(optarg, NULL, 0);
break;
P_CASEBOOL(295, glx_use_copysubbuffermesa);
case 295:
printf_errf("(): --glx-use-copysubbuffermesa is deprecated");
break;
case 296:
// --blur-background-exclude
condlst_add(ps, &ps->o.blur_background_blacklist, optarg);
@ -5007,7 +4997,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
.display = NULL,
.backend = BKEND_XRENDER,
.glx_no_stencil = false,
.glx_copy_from_front = false,
#ifdef CONFIG_OPENGL
.glx_prog_win = GLX_PROG_MAIN_INIT,
#endif

View File

@ -355,10 +355,6 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) {
lcfg_lookup_int(&cfg, "resize-damage", &ps->o.resize_damage);
// --glx-no-stencil
lcfg_lookup_bool(&cfg, "glx-no-stencil", &ps->o.glx_no_stencil);
// --glx-copy-from-front
lcfg_lookup_bool(&cfg, "glx-copy-from-front", &ps->o.glx_copy_from_front);
// --glx-use-copysubbuffermesa
lcfg_lookup_bool(&cfg, "glx-use-copysubbuffermesa", &ps->o.glx_use_copysubbuffermesa);
// --glx-no-rebind-pixmap
lcfg_lookup_bool(&cfg, "glx-no-rebind-pixmap", &ps->o.glx_no_rebind_pixmap);
// --glx-swap-method

View File

@ -974,9 +974,9 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
cdbus_m_opts_get_do(detect_client_leader, cdbus_reply_bool);
#ifdef CONFIG_OPENGL
cdbus_m_opts_get_stub(glx_use_copysubbuffermesa, cdbus_reply_bool, false);
cdbus_m_opts_get_stub(glx_copy_from_front, cdbus_reply_bool, false);
cdbus_m_opts_get_do(glx_no_stencil, cdbus_reply_bool);
cdbus_m_opts_get_do(glx_copy_from_front, cdbus_reply_bool);
cdbus_m_opts_get_do(glx_use_copysubbuffermesa, cdbus_reply_bool);
cdbus_m_opts_get_do(glx_no_rebind_pixmap, cdbus_reply_bool);
cdbus_m_opts_get_do(glx_swap_method, cdbus_reply_int32);
#endif
@ -985,6 +985,7 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
cdbus_m_opts_get_do(track_wdata, cdbus_reply_bool);
cdbus_m_opts_get_do(track_leader, cdbus_reply_bool);
#undef cdbus_m_opts_get_do
#undef cdbus_m_opts_get_stub
printf_errf("(): " CDBUS_ERROR_BADTGT_S, target);
cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target);

View File

@ -380,15 +380,6 @@ glx_init(session_t *ps, bool need_render) {
goto glx_init_end;
}
if (ps->o.glx_use_copysubbuffermesa) {
psglx->glXCopySubBufferProc = (f_CopySubBuffer)
glXGetProcAddress((const GLubyte *) "glXCopySubBufferMESA");
if (!psglx->glXCopySubBufferProc) {
printf_errf("(): Failed to acquire glXCopySubBufferMESA().");
goto glx_init_end;
}
}
#ifdef CONFIG_GLX_SYNC
psglx->glFenceSyncProc = (f_FenceSync)
glXGetProcAddress((const GLubyte *) "glFenceSync");