glx: Prepare the DRI backends for GLX_EXT_no_config_context
authorAdam Jackson <ajax@redhat.com>
Tue, 7 Nov 2017 16:36:52 +0000 (11:36 -0500)
committerAdam Jackson <ajax@redhat.com>
Thu, 9 Nov 2017 14:35:22 +0000 (09:35 -0500)
This should be safe as these backends already support the EGL version of
this extension. DRI1 is not affected because it does not support
GLX_ARB_create_context anyway. DRI-Windows is not prepared to implement
this as there's no equivalent WGL extension, and wglCreateContextAttribs
seems to really want the HDC's pixel format to be set.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glx/dri2_glx.c
src/glx/dri3_glx.c
src/glx/drisw_glx.c

index e67a15f9dabddf7e15f55eaed6fa3a08396716f0..0f44635725d86161a3ca7f2e104a208c62960706 100644 (file)
@@ -278,7 +278,7 @@ dri2_create_context_attribs(struct glx_screen *base,
       goto error_exit;
    }
 
-   if (!glx_context_init(&pcp->base, &psc->base, &config->base))
+   if (!glx_context_init(&pcp->base, &psc->base, config_base))
       goto error_exit;
 
    ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
@@ -317,7 +317,7 @@ dri2_create_context_attribs(struct glx_screen *base,
    pcp->driContext =
       (*psc->dri2->createContextAttribs) (psc->driScreen,
                                          api,
-                                         config->driConfig,
+                                         config ? config->driConfig : NULL,
                                          shared,
                                          num_ctx_attribs / 2,
                                          ctx_attribs,
index d613073994cde99a794764053e2d64984853efe3..fa048f990a9ed9c0911aea1de0319e63b1ef3a86 100644 (file)
@@ -263,7 +263,7 @@ dri3_create_context_attribs(struct glx_screen *base,
       goto error_exit;
    }
 
-   if (!glx_context_init(&pcp->base, &psc->base, &config->base))
+   if (!glx_context_init(&pcp->base, &psc->base, config_base))
       goto error_exit;
 
    ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
@@ -297,7 +297,8 @@ dri3_create_context_attribs(struct glx_screen *base,
    pcp->driContext =
       (*psc->image_driver->createContextAttribs) (psc->driScreen,
                                                   api,
-                                                  config->driConfig,
+                                                  config ? config->driConfig
+                                                         : NULL,
                                                   shared,
                                                   num_ctx_attribs / 2,
                                                   ctx_attribs,
index a471856634d12cdd81b1337f22a6ea2c164569b1..2f0675addb42a8065bf476702bebd5c2c867529e 100644 (file)
@@ -455,7 +455,7 @@ drisw_create_context_attribs(struct glx_screen *base,
    if (pcp == NULL)
       return NULL;
 
-   if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
+   if (!glx_context_init(&pcp->base, &psc->base, config_base)) {
       free(pcp);
       return NULL;
    }
@@ -483,7 +483,7 @@ drisw_create_context_attribs(struct glx_screen *base,
    pcp->driContext =
       (*psc->swrast->createContextAttribs) (psc->driScreen,
                                            api,
-                                           config->driConfig,
+                                           config ? config->driConfig : 0,
                                            shared,
                                            num_ctx_attribs / 2,
                                            ctx_attribs,