glx: keep native window glx drawable by driconf option

DRI3 window back buffer is a client resource, so it's destroyed
when context switch drawable for native window.

But some application like Abaqus may leave a dirty back buffer
and reuse it when switch back. So add a driconf option for these
kind of app to keep the entire GLX drawable for native window.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
This commit is contained in:
Qiang Yu
2022-02-07 17:54:57 +08:00
committed by Marge Bot
parent 4a420c50f2
commit 1dac5454ea
6 changed files with 86 additions and 2 deletions

View File

@@ -1055,6 +1055,13 @@ dri3_create_screen(int screen, struct glx_display * priv)
&invalid_glx_destroy_window) == 0) {
psc->base.allow_invalid_glx_destroy_window = invalid_glx_destroy_window;
}
uint8_t keep_native_window_glx_drawable = false;
if (psc->config->configQueryb(psc->driScreen,
"keep_native_window_glx_drawable",
&keep_native_window_glx_drawable) == 0) {
psc->base.keep_native_window_glx_drawable = keep_native_window_glx_drawable;
}
}
free(driverName);