glx: Require screens match for share contexts for classic CreateContext

The GLX_ARB_create_context path (with which this should all get unified,
someday, sigh) already enforces this, but the classic path does not.
It's effectively assumed by the implementation anyway, so let's enforce
it rather than do crashy things.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2020-03-05 16:32:56 -05:00
parent b56e501092
commit 1e29f3ea3e
1 changed files with 9 additions and 0 deletions

View File

@ -284,6 +284,15 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
*/
isDirect = GL_FALSE;
}
/* Core GLX doesn't explicitly require this, but GLX_ARB_create_context
* does (see glx/createcontext.c), and it's assumed by our
* implementation anyway, so let's be consistent about it.
*/
if (shareglxc->pGlxScreen != pGlxScreen) {
client->errorValue = shareglxc->pGlxScreen->pScreen->myNum;
return BadMatch;
}
}
/*