mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 15:48:36 +02:00
dri3: Fix MakeCurrent without a default framebuffer
In OpenGL 3.0 and later it is legal to make a context current without
a default framebuffer.
This has been broken since DRI3 support was introduced.
Cc: "13.0 12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit b6670157d7)
This commit is contained in:
parent
32d50d0f75
commit
5afc33bcb3
1 changed files with 10 additions and 4 deletions
|
|
@ -209,18 +209,24 @@ dri3_bind_context(struct glx_context *context, struct glx_context *old,
|
|||
struct dri3_context *pcp = (struct dri3_context *) context;
|
||||
struct dri3_screen *psc = (struct dri3_screen *) pcp->base.psc;
|
||||
struct dri3_drawable *pdraw, *pread;
|
||||
__DRIdrawable *dri_draw = NULL, *dri_read = NULL;
|
||||
|
||||
pdraw = (struct dri3_drawable *) driFetchDrawable(context, draw);
|
||||
pread = (struct dri3_drawable *) driFetchDrawable(context, read);
|
||||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
if (pdraw == NULL || pread == NULL)
|
||||
if (pdraw)
|
||||
dri_draw = pdraw->loader_drawable.dri_drawable;
|
||||
else if (draw != None)
|
||||
return GLXBadDrawable;
|
||||
|
||||
if (!(*psc->core->bindContext) (pcp->driContext,
|
||||
pdraw->loader_drawable.dri_drawable,
|
||||
pread->loader_drawable.dri_drawable))
|
||||
if (pread)
|
||||
dri_read = pread->loader_drawable.dri_drawable;
|
||||
else if (read != None)
|
||||
return GLXBadDrawable;
|
||||
|
||||
if (!(*psc->core->bindContext) (pcp->driContext, dri_draw, dri_read))
|
||||
return GLXBadContext;
|
||||
|
||||
return Success;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue