[Mesa-dev] [PATCH 3/3] glx: Implement GLX_EXT_no_config_context (v4)
Kyle Brenneman
kbrenneman at nvidia.com
Wed Dec 6 21:38:39 UTC 2017
On 12/05/2017 02:22 PM, Adam Jackson wrote:
> This more or less ports EGL_KHR_no_config_context to GLX.
>
> v2: Enable the extension only for those backends that support it.
> v3: Fix glvnd path and dri2_convert_glx_attribs()
> v4: Screeching signedness correctness, and disable a now
> inappropriate test.
>
> diff --git a/src/glx/g_glxglvnddispatchfuncs.c b/src/glx/g_glxglvnddispatchfuncs.c
> index 56d894eda7..04f6d8263a 100644
> --- a/src/glx/g_glxglvnddispatchfuncs.c
> +++ b/src/glx/g_glxglvnddispatchfuncs.c
> @@ -164,7 +164,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;
>
>
That should just look up the vendor by screen number, not based on the
root window. Calling GetDispatchFromDrawable instead of
(__VND->getDynDispatch(dpy, screen)) requires an extra round trip to the
server.
More information about the mesa-dev
mailing list