[Mesa-dev] [PATCH 2/3] glx: Lift sending the MakeCurrent request to top-level code (v2)

Emil Velikov emil.l.velikov at gmail.com
Tue Dec 12 14:31:16 UTC 2017


On 6 December 2017 at 19:25, Adam Jackson <ajax at redhat.com> wrote:
> On Wed, 2017-12-06 at 15:14 +0000, Emil Velikov wrote:
>
>> > -      if (gc->vtable->bind(gc, oldGC, draw, read) != Success) {
>> > +      if (gc->vtable->bind(gc, gc, draw, read) != Success) {
>> >           __glXSetCurrentContextNull();
>>
>> This line seems inconsistent/wrong.
>>
>> The glXMakeCurrent manpage says "If False is returned, the previously
>> current rendering context and drawable (if any) remain unchanged."
>
> Ugh. That's not really possible to get perfectly right, there are
> unrecoverable states (think MakeCurrent away from a context that's been
> deleted, or whose current drawable is a destroyed window). Still, I
> suppose we should try at least a little.
>
>From a quick look delaying the unbind call should address that. I'd
drop the __glXSetCurrentContextNull call for now and keep the rest of
the yak shaving at a later stage.

Just noticed some copy/paste damage

 indirect_bind_context(struct glx_context *gc, struct glx_context *old,
                      GLXDrawable draw, GLXDrawable read)
 {

+    * cleverness before the GetString calls.
+    */
+   if (state && state->array_state == NULL) {
+      gc->currentDpy = gc->psc->dpy;
+      __glXSetCurrentContext(gc);
+      __glXSetCurrentContext(gc);

__glXSetCurrentContext should be only once.

Thanks
Emil


More information about the mesa-dev mailing list