On 6 December 2017 at 19:25, Adam Jackson <a...@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
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to