summaryrefslogtreecommitdiff
path: root/src/glx/g_glxglvnddispatchfuncs.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-11-14 15:13:06 -0500
committerMarge Bot <eric+marge@anholt.net>2021-04-23 21:15:19 +0000
commit01ba8a8d02ba04575860570ce51fc282c9b7866e (patch)
treef1dc70946ddb42220c3517e33f903a6dde7c33d1 /src/glx/g_glxglvnddispatchfuncs.c
parentf9d57207a365a896a771e3b3b62351749fbd99c6 (diff)
glx: Implement GLX_EXT_no_config_context
This is the GLX counterpart to EGL_KHR_no_config_context. Contexts may now be created without reference to an fbconfig, in which case it is treated as compatible with any fbconfig (and thus any GLX drawable). Khronos: https://github.com/KhronosGroup/OpenGL-Registry/pull/102 Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8999>
Diffstat (limited to 'src/glx/g_glxglvnddispatchfuncs.c')
-rw-r--r--src/glx/g_glxglvnddispatchfuncs.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/glx/g_glxglvnddispatchfuncs.c b/src/glx/g_glxglvnddispatchfuncs.c
index e0ea27c0b18..c6dfb7932f0 100644
--- a/src/glx/g_glxglvnddispatchfuncs.c
+++ b/src/glx/g_glxglvnddispatchfuncs.c
@@ -161,7 +161,19 @@ static GLXContext dispatch_CreateContextAttribsARB(Display *dpy,
__GLXvendorInfo *dd;
GLXContext ret;
- dd = GetDispatchFromFBConfig(dpy, config);
+ if (config) {
+ dd = GetDispatchFromFBConfig(dpy, config);
+ } else if (attrib_list) {
+ int i, screen;
+
+ for (i = 0; attrib_list[i * 2] != None; i++) {
+ if (attrib_list[i * 2] == GLX_SCREEN) {
+ screen = attrib_list[i * 2 + 1];
+ dd = GetDispatchFromDrawable(dpy, RootWindow(dpy, screen));
+ break;
+ }
+ }
+ }
if (dd == NULL)
return None;