mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-22 07:40:36 +01:00
dri3: Check for dummyContext to see if the glx_context is valid
According to the comments in src/glx/glxcurrent.c __glXGetCurrentContext() always returns a valid pointer. If no context is made current, it will contain dummyContext. Thus a test for NULL will always fail. https://lists.freedesktop.org/archives/mesa-dev/2016-April/113962.html Signed-off-by: Stefan Dirsch <sndirsch@suse.de> Reviewed-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
4d9b518ad2
commit
7d25ed7036
1 changed files with 2 additions and 6 deletions
|
|
@ -127,13 +127,9 @@ static __DRIcontext *
|
|||
glx_dri3_get_dri_context(struct loader_dri3_drawable *draw)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
struct dri3_context *dri3Ctx = (struct dri3_context *) gc;
|
||||
|
||||
if (gc) {
|
||||
struct dri3_context *dri3Ctx = (struct dri3_context *) gc;
|
||||
return dri3Ctx->driContext;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return (gc != &dummyContext) ? dri3Ctx->driContext : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue