Error initialising pBuffers with Mesa drivers.

I’m having a problem with the Mesa 6.4.1 libraries trying to create a pbuffer on Linux. I have the following code:

GLCapabilities caps = new GLCapabilities();
caps.setAlphaBits(8);
pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, imageSide, imageSide, glcanvas.getContext());

The createGLPbuffer function causes the following exception:
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: pbuffer creation error: glXChooseFBConfig() failed
at com.sun.opengl.impl.x11.X11PbufferGLDrawable.createPbuffer(X11PbufferGLDrawable.java:126)
at com.sun.opengl.impl.x11.X11PbufferGLDrawable.(X11PbufferGLDrawable.java:73)
at com.sun.opengl.impl.x11.X11GLDrawableFactory$3.run(X11GLDrawableFactory.java:266)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.maybeDoSingleThreadedWorkaround(X11GLDrawableFactory.java:539)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.createGLPbuffer(X11GLDrawableFactory.java:273)

although the GLDrawableFactory.getFactory().canCreateGLPbuffer() function returns true. Querying the video card gives:
canvas size=[1001 x 448], doublebuffer=true, stereoview=false, maximum viewport=[4096 x 4096], maximum texture=[1024 x 1024], depth bits=16, alpha bits=[8], GL vendor=[Mesa project: www.mesa3d.org], GL version=[1.2 (1.5 Mesa 6.4.1)], GL renderer=[Mesa GLX Indirect], extensions=[GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_border_clamp GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_EXT_abgr GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_lod_bias ], canCreateOffscreenDrawable=true

I’m using the JSR-231 beta5 jogl. Am I missing something.

Try calling setDoubleBuffered(false) on the GLCapabilities object. We don’t do this internally because in theory one might want to create a double-buffered pbuffer (I think), but in practice some OpenGL implementations don’t deal well with a request to create one.

Sorry no luck.

Could you try checking out and building the current JOGL source tree? The Java 3D engineers recently pointed out some errors in the initialization of the attribute array for both pbuffers and on-screen contexts, and there’s a chance that that is causing the problem.

Aside from that I have no good guesses as to what is going wrong. Any investigation you could do into JOGL’s X11 implementation in your setup would be appreciated.

OK, I have put some debugging statements in X11GLDrawableFactory.glCapabilities2AttribList(…) and it builds the following attribute list:

AttributeList[0]=GLXExt.GLX_DRAWABLE_TYPE AttributeList[1]=GLXExt.GLX_PBUFFER_BIT AttributeList[2]= GLXExt.GLX_RENDER_TYPE AttributeList[3]=GLXExt.GLX_RGBA_BIT AttributeList[4]=GLX.GLX_DOUBLEBUFFER - (caps.getDoubleBuffered() == false) && pbuffer == true AttributeList[5]=GL.GL_FALSE - (caps.getDoubleBuffered() == false) && pbuffer == true AttributeList[6]=GLX.GLX_STEREO - (caps.getStereo() == false) && pbuffer == true AttributeList[7]=GL.GL_FALSE - (caps.getStereo() == false) && pbuffer == true AttributeList[8]=GLX.GLX_RED_SIZE AttributeList[9]=8 AttributeList[10]=GLX.GLX_GREEN_SIZE AttributeList[11]=8 AttributeList[12]=GLX.GLX_BLUE_SIZE AttributeList[13]=8 AttributeList[14]=GLX.GLX_ALPHA_SIZE AttributeList[15]=8 AttributeList[16]=GLX.GLX_DEPTH_SIZE AttributeList[17]=24

As you see it returns 8 for the size of the RGBA data and 24 for the depth. However when I am initialising the main canvas the gl.glGetIntegerv(GL.GL_DEPTH_BITS …) returns 16. Is this a problem.

Unclear. You might want to play with the depth bits requested in the GLCapabilities and see whether that helps.

[quote]Unclear. You might want to play with the depth bits requested in the GLCapabilities and see whether that helps.
[/quote]
Ok I will try that. I forgot to post the glxinfo output for the system in case that might show something.

`name of display: :0.0
display: :0 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_OML_swap_method, GLX_SGI_make_current_read,
GLX_SGIS_multisample, GLX_SGIX_hyperpipe, GLX_SGIX_swap_barrier,
GLX_SGIX_fbconfig
client glx vendor string: ATI
client glx version string: 1.3
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_ATI_pixel_format_float,
GLX_ATI_render_texture
GLX version: 1.2
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context,
GLX_ARB_multisample
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.2 (1.5 Mesa 6.4.1)
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat

0x23 24 tc 0 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 1 0 None
0x24 24 tc 0 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 1 0 None
0x25 24 tc 0 32 0 r y . 8 8 8 8 0 16 8 16 16 16 16 1 0 None
0x26 24 tc 0 32 0 r . . 8 8 8 8 0 16 8 16 16 16 16 1 0 None
0x27 24 dc 0 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 1 0 None
0x28 24 dc 0 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 1 0 None
0x29 24 dc 0 32 0 r y . 8 8 8 8 0 16 8 16 16 16 16 1 0 None
0x2a 24 dc 0 32 0 r . . 8 8 8 8 0 16 8 16 16 16 16 1 0 None
`