[PATCH xserver 6/8] xwin/glx: Assume WGL_ARB_make_current_read exists

Jon Turney jon.turney at dronecode.org.uk
Tue Mar 22 14:02:27 UTC 2016


On 21/03/2016 20:29, Adam Jackson wrote:
> This seems to be fairly universal these days, and if it doesn't exist
> the only thing you break is separate drawable and readable, which is a
> fairly rare feature to use. So pretend it's always there and just throw
> an error on MakeCurrent if it doesn't.
>
> As a result we can enable GLX 1.4 unconditionally.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>   hw/xwin/glx/indirect.c | 36 ++++++++++++++++--------------------
>   1 file changed, 16 insertions(+), 20 deletions(-)
>
> diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c

> @@ -1408,6 +1396,7 @@ static int
>   glxWinContextMakeCurrent(__GLXcontext * base)
>   {
>       __GLXWinContext *gc = (__GLXWinContext *) base;
> +    __GLXWinScreen *scr = (__GLXWinScreen *) base->pGlxScreen;

Doesn't compile because this type doesn't follow the naming pattern, so 
I think this line should be:

glxWinScreen *scr = (glxWinScreen *) base->pGlxScreen


>       BOOL ret;
>       HDC drawDC;
>       HDC readDC = NULL;
> @@ -1440,7 +1429,14 @@ glxWinContextMakeCurrent(__GLXcontext * base)
>       }
>
>       if ((gc->base.readPriv != NULL) && (gc->base.readPriv != gc->base.drawPriv)) {
> -        // XXX: should only occur with WGL_ARB_make_current_read
> +        /*
> +         * We enable this unconditionally, but the renderer _might_ not support
> +         * it. It's fairly rare to use this feature so just error out if it
> +         * can't work.
> +         */
> +        if (!scr->has_WGL_ARB_make_current_read)
> +            return False;
> +
>           /*
>              If there is a separate read drawable, create a separate read DC, and
>              use the wglMakeContextCurrent extension to make the context current drawing




More information about the xorg-devel mailing list