[Mesa-users] Switching from an onscreen glx context to an osmesa context

tom fogal tfogal at alumni.unh.edu
Fri Aug 5 12:58:30 PDT 2011


Paul Gotzel <paul.gotzel at gmail.com> writes:
> Hello,
> 
> I've taken on the task of upgrading from mesa 7.6.1 to 7.10.3 and come
> across what seems to be a regression.  I'm building on linux_x86-64 with gcc
> 4.5.1 and the following config:
> configure --prefix=/u/vm-RHwin7-pa03/people/paulg/clones/install/mesa/
> --with-driver=xlib --disable-gles1 --disable-gles2 --disable-egl
> --disable-gallium

Is it actually possible to link both the libGL and libOSMesa you get
from a similar configuration into the same application?  I would think
they both define e.g. glBegin.  For one, you'll call the gl* that gets
-l'd first in the link line, and I am not sure it makes sense that the
same entry point could be used for both OSMesa and glX anyway.

I think you should mangle OSMesa and use that to differentiate which
library to call.

-tom

> The problem happens when I switch between a mesa glx context to a osmesa
> context, the OSMesaMakeCurrent succeeds but ends up using the onscreen glx
> context for rendering.  The basic sequence of calls is as follows:
> 
> glxCreateContext
> glxMakeCurrent
> ... OpenGL commands ...
> OSMesaCreateContext
> OSMesaMakeCurrent
> ... OpenGL commands ...  <-- these commands render single buffered on the
> previous context.
> 
> I can workaround this by inserting a glxDestroyContext before the
> OSMesaMakeCurrent but I'm switching between the contexts in a loop so I'm
> hoping there is something I'm missing.  Any ideas?  This was not a problem
> in 7.6.1 but maybe I just got lucky.
> 
> Any help is appreciated.
> 
> Regards,
> Paul


More information about the mesa-users mailing list