I'm trying to upgrade a Mesa 10 installation to Mesa 17. There have been plenty of changes, but only one breakage that's left me perplexed.
In this CL, Mesa stopped maintaining a __GLXcontext for FakeGLX; there's just an XMesaContext.
Fake_glXGetCurrentContext() casts the XMesaContext to a __GLXContext and returns it. Perhaps the reasonable assumption is that a context is an opaque object.
However, glXGetCurrentDisplay() doesn't respect that assumption; it assumes it is getting a valid __GLXContext and returns __GLXContext::currentDpy, the first pointer.
The first pointer in an XMesaContext is *not* a pointer to a Display, and so any code that relies on this code path seems doomed to disappointment.
This is hitting us in open-source projects based on Ogre, but seems like a breakage in the public API that other users would have run into in the 3 years since that commit?
Created attachment 131440 [details] [review]
Fix for glxGetCurrentDisplay()
Looks like this has been broken for a long time. Can you try the attached patch?
I hacked glxgears.c to call glXGetCurrentDisplay() and it seemed to work, but it would be great if you could check too.
Thanks. Sorry for the slow reply. I was out for a couple weeks.
Awesome, unless I'm missing something this fixes all our tests, and is a lot simpler than anything we'd tried.
(In reply to Tom Hudson from comment #2)
> Awesome, unless I'm missing something this fixes all our tests, and is a lot
> simpler than anything we'd tried.
Great. I'll put Tested-by: Tom Hudson <email@example.com> on the patch and push it soon.
Pushed as commit c6ba85a8c0f02b3b7058dae7afb6c49f56567319