summaryrefslogtreecommitdiffstats
path: root/src/glx/create_context.c
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2017-11-09 11:41:14 -0500
committerAdam Jackson <[email protected]>2017-11-09 11:41:14 -0500
commit015cc6bb7cd1199ce43018bb47c89c0a26adc96a (patch)
treeb737c4ed53b1125aff02ebda463d2bc4e0524278 /src/glx/create_context.c
parent9ceb057ebf7484700506fa091316c4db6faf3815 (diff)
Revert "glx: Implement GLX_EXT_no_config_context (v2)"
Pushed ahead of things actually working. This reverts commit 5293b96b160b904c0e53cbce93679c3aa090f846.
Diffstat (limited to 'src/glx/create_context.c')
-rw-r--r--src/glx/create_context.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/glx/create_context.c b/src/glx/create_context.c
index eab6511ad87..38e949ab4cd 100644
--- a/src/glx/create_context.c
+++ b/src/glx/create_context.c
@@ -47,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 {
- int i;
- for (i = 0; i < num_attribs; i++) {
- if (attrib_list[i * 2] == GLX_SCREEN)
- screen = attrib_list[i * 2 + 1];
- }
- }
+ 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);
- if (!cfg && !__glXExtensionBitIsEnabled(psc, EXT_no_config_context_bit))
- 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 (direct && psc->vtable->create_context_attribs) {
/* GLX drops the error returned by the driver. The expectation is that
@@ -117,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,