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
+4
View File
@@ -234,6 +234,10 @@
DRI_CONF_OPT_B(force_compat_profile, def, \
"Force an OpenGL compatibility context")
#define DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(def) \
DRI_CONF_OPT_B(force_direct_glx_context, def, \
"Force direct GLX context (even if indirect is requested)")
#define DRI_CONF_OVERRIDE_VRAM_SIZE() \
DRI_CONF_OPT_I(override_vram_size, -1, -1, 2147483647, \
"Override the VRAM size advertised to the application in MiB (-1 = default)")
+1 -1
View File
@@ -320,7 +320,7 @@ driParseOptionInfo(driOptionCache *info,
/* Make the hash table big enough to fit more than the maximum number of
* config options we've ever seen in a driver.
*/
info->tableSize = 6;
info->tableSize = 7;
info->info = calloc((size_t)1 << info->tableSize, sizeof(driOptionInfo));
info->values = calloc((size_t)1 << info->tableSize, sizeof(driOptionValue));
if (info->info == NULL || info->values == NULL) {