octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50479] __osmesa_print__ fails with mesa using


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50479] __osmesa_print__ fails with mesa using libglvnd, build and test suite fail
Date: Mon, 6 Nov 2017 23:57:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #38, bug #50479 (project octave):

On a system with libglvnd, if you start Octave with


__GLVND_APP_ERROR_CHECKING=1 __GLVND_ABORT_ON_APP_ERROR=0


set in the environment, then try to print with osmesa, for example, with


figure (1, 'visible', 'off')
sombrero
print sombrero.pdf


you should see the following error messages:


OpenGL function called without a current context
OpenGL function called without a current context
error: __osmesa_print__: Depth and stencil doesn't match, are you sure you are
using OSMesa >= 9.0?
error: called from
    __opengl_print__ at line 161 column 7
    print at line 552 column 14


If I understand correctly, those first two messages about calling an OpenGL
function without a current context are coming from the calls to glGetIntegerv
in F__osmesa_print__ and are happening because of the way libglvnd handles
dispatching.

It worked previously if you were using a Mesa libGL because we linked directly
to libGL and OpenGL functions were provided directly from there.  Since OSMesa
uses a context that begins with the base Mesa context, those gl* calls would
work.

Now, there is some magic in libglvnd to manage the pointer to the  OpenGL
context and dispatch to fucntions that properly manage that context.  This
works for libGL, but not libOSMesa.  So when glGetIntegerv is called no
context has been created and you end up in the stub function that reports the
error.

Note that making the figure visible so that a Mesa context is created does not
work.  The following still fails with the same error message:


figure (1, 'visible', 'on')
sombrero
__osmesa_print__ (1, 'sombrero.pdf', 'pdf')


still fails with the same messages because although OSMesaMakeCurrent would
make the context current when using the Mesa libGL, it does not do that with
libglvnd so the libglvnd context is still invalid.

To fix this, it seems we need to have libOSMesa integrated with libglvnd so
that the OSMesa context and dispatching for functions in libOSMesa can be
properly managed by libglvnd.

It would be great if we could just ask libglvnd to create an off-screen
rendering context that uses OSMesa and have it manage the function dispatch. 
This should allow OSMesa to mix with any vendor OpenGL library, not just
Mesa.

I've spent considerable time looking at this problem but it's still not clear
to me exactly how to do that.  It appears that libglvnd maintains a table of
OpenGL contexts and dispatching info for libGL functions that is indexed by
X11 display and screen info.  For OSMesa, there may not be a display or
screen, so some other way of storing and indexing these contexts is needed.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50479>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]