glx/drirc: add a force_direct_glx_context option

Some applications may request an indirect context but this feature is
disabled by default on Xorg and thus context creation will fail.

This commit adds a drirc setting to force the creation of direct glx
context, regardless of what the app is requesting.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13246>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2021-10-07 12:14:44 +02:00
parent 9b09655a58
commit fc3ef76eec
9 changed files with 41 additions and 1 deletions

View File

@@ -1014,6 +1014,14 @@ dri3_create_screen(int screen, struct glx_display * priv)
&tmp) == 0)
__IndirectGlParseExtensionOverride(&psc->base, tmp);
if (psc->config->base.version > 1) {
uint8_t force = false;
if (psc->config->configQueryb(psc->driScreen, "force_direct_glx_context",
&force) == 0) {
psc->base.force_direct_context = force;
}
}
free(driverName);
tmp = getenv("LIBGL_SHOW_FPS");