diff options
author | Adam Jackson <[email protected]> | 2019-09-26 11:07:13 -0400 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-09-26 11:07:13 -0400 |
commit | a14e3b43be17997ab67a362addddab44ac856869 (patch) | |
tree | 10dabb8e89ca33ead6cb1348a2d4285120b7c885 /src/glx/create_context.c | |
parent | 30f0c0ea7db129dafb2e879de8faad6907a09791 (diff) |
Revert "glx: Implement GLX_EXT_no_config_context"
This reverts commit 0d635ccc912d7122f35f81eec27d8b2c0a2a7a28.
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1207
Diffstat (limited to 'src/glx/create_context.c')
-rw-r--r-- | src/glx/create_context.c | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/src/glx/create_context.c b/src/glx/create_context.c index fa15d551af0..38e949ab4cd 100644 --- a/src/glx/create_context.c +++ b/src/glx/create_context.c @@ -33,14 +33,6 @@ #error This code requires sizeof(uint32_t) == sizeof(int). #endif -/* debian stretch still has ancient headers and we're apparently still - * using that for gitlab ci. please delete me when that's fixed. - */ -#ifndef X_GLXCreateContextAttribsARB -#warning Please update your GLX protocol headers -#define X_GLXCreateContextAttribsARB 34 -#endif - _X_HIDDEN GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, @@ -55,41 +47,28 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, xcb_generic_error_t *err; xcb_void_cookie_t cookie; unsigned dummy_err = 0; - int screen = -1; - if (dpy == NULL) - return NULL; - - /* Count the number of attributes specified by the application. All - * attributes appear in pairs, except the terminating None. - */ - if (attrib_list != NULL) { - for (/* empty */; attrib_list[num_attribs * 2] != 0; num_attribs++) - /* empty */ ; - } - if (cfg) { - screen = cfg->screen; - } else { - for (unsigned int i = 0; i < num_attribs; i++) { - if (attrib_list[i * 2] == GLX_SCREEN) - screen = attrib_list[i * 2 + 1]; - } - if (screen == -1) { - __glXSendError(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, True); - return NULL; - } - } + if (dpy == NULL || cfg == NULL) + return NULL; /* This means that either the caller passed the wrong display pointer or * one of the internal GLX data structures (probably the fbconfig) has an * error. There is nothing sensible to do, so return an error. */ - psc = GetGLXScreenConfigs(dpy, screen); + psc = GetGLXScreenConfigs(dpy, cfg->screen); if (psc == NULL) return NULL; - assert(screen == psc->scr); + assert(cfg->screen == psc->scr); + + /* Count the number of attributes specified by the application. All + * attributes appear in pairs, except the terminating None. + */ + if (attrib_list != NULL) { + for (/* empty */; attrib_list[num_attribs * 2] != 0; num_attribs++) + /* empty */ ; + } if (direct && psc->vtable->create_context_attribs) { /* GLX drops the error returned by the driver. The expectation is that @@ -125,8 +104,8 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, cookie = xcb_glx_create_context_attribs_arb_checked(c, gc->xid, - cfg ? cfg->fbconfigID : 0, - screen, + cfg->fbconfigID, + cfg->screen, gc->share_xid, gc->isDirect, num_attribs, |