MantisBT - VTK
View Issue Details
0011390VTK(No Category)public2010-11-01 16:192013-04-05 20:54
Kevin H. Hobbs 
David Partyka 
normalminorhave not tried
closedfixed 
 
 
0011390: Tests must call Render before ExtensionManager
The tests Charts-TestMultipleScalarsToColors, TestMultiTexturing, and TestMultiTexturingTransform should call Render on the render window before checking for OpenGL extensions.

In OSMesa calling glGetString without a current context causes a segfault.

The documentation for vtkOpenGLExtensionManager clearly says that just creating the render window does not create a context and make it current.
No tags attached.
Issue History
2010-11-01 16:19Kevin H. HobbsNew Issue
2010-11-01 16:35Marcus D. HanwellStatusbacklog => tabled
2010-11-01 16:35Marcus D. HanwellAssigned To => Julien Finet
2011-01-05 06:20David PartykaAssigned ToJulien Finet => Marcus D. Hanwell
2011-01-05 06:20David PartykaNote Added: 0024410
2011-01-05 10:32Marcus D. HanwellNote Added: 0024415
2011-01-05 10:38David PartykaNote Added: 0024416
2011-01-05 10:48Marcus D. HanwellAssigned ToMarcus D. Hanwell => David Partyka
2011-01-05 11:06Kevin H. HobbsNote Added: 0024418
2011-01-05 11:11Marcus D. HanwellNote Added: 0024423
2011-01-05 11:18Kevin H. HobbsNote Added: 0024425
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-04-05 20:53Berk GeveciStatusbacklog => tabled
2013-04-05 20:53Berk GeveciResolutionopen => fixed
2013-04-05 20:54Berk GeveciStatustabled => closed

Notes
(0024410)
David Partyka   
2011-01-05 06:20   
Looks like Marcus fixed it!
(0024415)
Marcus D. Hanwell   
2011-01-05 10:32   
For the web and others who might find this report - it is not enough to call Render before using the extension manager. Ideally you initialize a class on its first render, checking for the necessary extensions etc and then save the result in an ivar. You can then check the ivar after a call to render to see if the necessary extensions were present.

There are two other tests outstanding that I did not touch, and so I have not closed this bug report. Dave - are you going to look at them?
(0024416)
David Partyka   
2011-01-05 10:38   
Yes I will fix up the two multi-texturing tests similarly.
(0024418)
Kevin H. Hobbs   
2011-01-05 11:06   
Charts-TestMultipleScalarsToColors is passing but the output is :

GL version 2 or higher is required.

So it really isn't running.

I do :

#include <stdlib.h>
#include <stdio.h>
#include "GL/osmesa.h"
#include "GL/glu.h"

static int Width = 400;
static int Height = 400;

int main( int argc, char * argv[] )
{

  OSMesaContext ctx = OSMesaCreateContext( OSMESA_RGBA, NULL );
  void *buffer;
  const char *gl_renderer;
  buffer = malloc( Width * Height * 4 * sizeof(GLubyte) );
  OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height );
  gl_renderer=(const char *)glGetString(GL_VERSION);
  puts(gl_renderer);
  return 0;
}

$ gcc \
  -Xlinker "-rpath=/home/kevin/mesa_osmesa/lib" \
  -Lmesa_osmesa/lib/ \
  -lOSMesa -lGLU mesatest.c

$ ./a.out
2.1 Mesa 7.10-devel

So osmesa claims to support gl 2.1 what gives?
(0024423)
Marcus D. Hanwell   
2011-01-05 11:11   
The fact that it wasn't even rendering simple non power of two textures correctly, multiple test failures due to rendering issues when attempting to use simple GL 2 features led me to disable it in the 2D rendering code for now. We have had to do the same in several other 3D rendering classes too I'm afraid.

I would like to revisit this, but the final results look better when using the legacy code - with this test I would like to make things a little more granular as I think it may be supported. I wanted to verify the general approach would work.
(0024425)
Kevin H. Hobbs   
2011-01-05 11:18   
Do I need to file a bug against osmesa?

I'm afraid example code for such an issue is beyond me, but "I'm all about" filing bug reports.