glx: fix indirect initialization crash

Fixes: b090246a ("glx: Only compute client GL extensions for indirect contexts")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393

Reviewed-by: Adam Jackson <ajax@redhat.com>

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21591>
(cherry picked from commit 1eab7e69e2)
This commit is contained in:
Illia Polishchuk 2023-02-28 16:07:59 +02:00 committed by Dylan Baker
parent d8700f6086
commit 4ffe464165
3 changed files with 9 additions and 3 deletions

View file

@ -5818,7 +5818,7 @@
"description": "glx: fix indirect initialization crash",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b090246ad27457bc48ea8f5dbe8213f5899efa22"
},

View file

@ -816,10 +816,17 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
if (psc == NULL)
psc = applegl_create_screen(i, priv);
#else
bool indirect = false;
if (psc == NULL)
psc = indirect_create_screen(i, priv);
{
psc = indirect_create_screen(i, priv);
indirect = true;
}
#endif
priv->screens[i] = psc;
if(indirect) /* Load extensions required only for indirect glx */
glxSendClientInfo(priv, i);
}
SyncHandle();
return GL_TRUE;

View file

@ -383,7 +383,6 @@ indirect_create_screen(int screen, struct glx_display * priv)
return NULL;
glx_screen_init(psc, screen, priv);
glxSendClientInfo(priv, screen);
psc->vtable = &indirect_screen_vtable;
return psc;