Testing for vertex buffer objects extension

I’m trying to test for vertex buffer objects using the gl.isExtensionAvailable(…) method with GL_EXT_pixel_buffer_object or GL_ARB_vertex_buffer_object, but I get false in both cases with a GeForce2 7950 card. The gl.glGetString(GL.GL_EXTENSIONS) gives:

maximum viewport=[4096 x 4096], maximum texture size=[4096], depth bits=24, GL vendor=[NVIDIA Corporation], GL version=[1.4 (2.1.0 NVIDIA 97.46)], GL renderer=[GeForce 7950 GT/PCI/SSE2], extensions=[GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_imaging GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shadow GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_vertex_array GL_ATI_texture_float GL_ATI_texture_mirror_once GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_multi_draw_arrays GL_SUN_slice_accum ]

I notice that I don’t see that extension listed, however running glxinfo from the command line I see both GL_EXT_pixel_buffer_object and GL_ARB_vertex_buffer_object are listed. Am I doing something wrong. I’m using the Java Bindings for OpenGL API Specification, Version = 1.1.0-rc2.

Could you please post the following:

  1. The output of your program with -Djogl.debug.X11GLDrawableFactory on the command line

  2. The output of glxinfo -t -v -b

Java Web Start 1.6.0
Using JRE version 1.6.0 Java HotSpot™ Server VM
User home directory = /home/jroam

c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to

!!! GLX server vendor : NVIDIA Corporation
!!! GLX server version: 1.4
!!! GLX client vendor : SGI
!!! GLX client version: 1.4
!!! GLX version: major 1, minor 4

glxinfo -t -v -b
36

For the output of your Java program, I’m looking for the output saying “glXChooseVisual recommended 0x…” indicating what visual was chosen for a given GLCanvas. It should be printed as long as you have a GLCanvas visible on-screen. That’s the only configuration in which you should be able to validly call glGetString(GL_EXTENSIONS) anyway.

It looks like I need to ask you for the output of glxinfo -t -v as well. (No -b.)

Output attached.

Java Web Start 1.6.0
Using JRE version 1.6.0 Java HotSpot™ Server VM
User home directory = /home/jroam

c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to

Activating debug channel(s) -> actionhandler roam metrics opengl roam-refiner on target: http
JOGL/Java2D integration disabled
GLJPanel.addNotify()
Beginning DRI hack
Found /usr/lib/libGL.so.1
Ending DRI hack
!!! GLX server vendor : NVIDIA Corporation
!!! GLX server version: 1.4
!!! GLX client vendor : SGI
!!! GLX client version: 1.4
!!! GLX version: major 1, minor 4
Pbuffer caps on init: GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
Found 44 matching GLXFBConfigs
Parameters of default one:
render type: 0x1
rgba: true
r: 32
g: 32
b: 32
a: 32
depth: 24
double buffered: 0
Created pbuffer 0 x 0
GLJPanel.handleReshape: (w,h) = (780,505)
Resizing pbuffer from (256, 256) to fit (780, 505)
New pbuffer size is (1024, 512)
Pbuffer caps on init: GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
Found 44 matching GLXFBConfigs
Parameters of default one:
render type: 0x1
rgba: true
r: 32
g: 32
b: 32
a: 32
depth: 24
double buffered: 0
Created pbuffer 0 x 0
Creating context for pbuffer 0 x 0
Created context for pbuffer 0 x 0
AWT-EventQueue-2: !!! Created GL context for com.sun.opengl.impl.x11.X11PbufferGLContext
AWT-EventQueue-2: glXMakeCurrent(display 0x9926618, drawable 0x4a00002, context 0x995ea30) succeeded
AWT-EventQueue-2: !!! Initializing OpenGL extension address table for com.sun.opengl.impl.x11.X11PbufferGLContext@173a64a
AWT-EventQueue-2: !!! Initializing GLX extension address table
GLDrawableHelper com.sun.opengl.impl.GLDrawableHelper@1c81ac0.invokeGL(): Running initAction
glViewport(0, 0, 780, 505)
!!! Pre-caching extension availability
!!! GLX extensions: GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_EXT_texture_from_pixmap
!!! Available extensions: GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_imaging GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shadow GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_vertex_array GL_ATI_texture_float GL_ATI_texture_mirror_once GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_multi_draw_arrays GL_SUN_slice_accum GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_EXT_texture_from_pixmap
!!! GL vendor: NVIDIA Corporation
!!! Available: GL_ARB_depth_texture
!!! Available: GL_ARB_fragment_program
!!! Available: GL_ARB_fragment_program_shadow
!!! Available: GL_ARB_imaging
!!! Available: GL_ARB_multitexture
!!! Available: GL_ARB_occlusion_query
!!! Available: GL_ARB_point_parameters
!!! Available: GL_ARB_point_sprite
!!! Available: GL_ARB_shadow
!!! Available: GL_ARB_texture_border_clamp
!!! Available: GL_ARB_texture_compression
!!! Available: GL_ARB_texture_cube_map
!!! Available: GL_ARB_texture_env_add
!!! Available: GL_ARB_texture_env_combine
!!! Available: GL_ARB_texture_env_dot3
!!! Available: GL_ARB_texture_mirrored_repeat
!!! Available: GL_ARB_texture_non_power_of_two
!!! Available: GL_ARB_texture_rectangle
!!! Available: GL_ARB_transpose_matrix
!!! Available: GL_ARB_vertex_program
!!! Available: GL_ARB_window_pos
!!! Available: GL_EXT_abgr
!!! Available: GL_EXT_bgra
!!! Available: GL_EXT_blend_color
!!! Available: GL_EXT_blend_func_separate
!!! Available: GL_EXT_blend_minmax
!!! Available: GL_EXT_blend_subtract
!!! Available: GL_EXT_draw_range_elements
!!! Available: GL_EXT_fog_coord
!!! Available: GL_EXT_multi_draw_arrays
!!! Available: GL_EXT_packed_pixels
!!! Available: GL_EXT_point_parameters
!!! Available: GL_EXT_rescale_normal
!!! Available: GL_EXT_secondary_color
!!! Available: GL_EXT_separate_specular_color
!!! Available: GL_EXT_shadow_funcs
!!! Available: GL_EXT_stencil_wrap
!!! Available: GL_EXT_texture3D
!!! Available: GL_EXT_texture_compression_s3tc
!!! Available: GL_EXT_texture_edge_clamp
!!! Available: GL_EXT_texture_env_add
!!! Available: GL_EXT_texture_env_combine
!!! Available: GL_EXT_texture_env_dot3
!!! Available: GL_EXT_texture_filter_anisotropic
!!! Available: GL_EXT_texture_lod
!!! Available: GL_EXT_texture_lod_bias
!!! Available: GL_EXT_texture_mirror_clamp
!!! Available: GL_EXT_texture_object
!!! Available: GL_EXT_texture_rectangle
!!! Available: GL_EXT_vertex_array
!!! Available: GL_ATI_texture_float
!!! Available: GL_ATI_texture_mirror_once
!!! Available: GL_IBM_rasterpos_clip
!!! Available: GL_IBM_texture_mirrored_repeat
!!! Available: GL_INGR_blend_func_separate
!!! Available: GL_NV_blend_square
!!! Available: GL_NV_copy_depth_to_color
!!! Available: GL_NV_depth_clamp
!!! Available: GL_NV_fog_distance
!!! Available: GL_NV_fragment_program_option
!!! Available: GL_NV_fragment_program2
!!! Available: GL_NV_light_max_exponent
!!! Available: GL_NV_multisample_filter_hint
!!! Available: GL_NV_texgen_reflection
!!! Available: GL_NV_texture_compression_vtc
!!! Available: GL_NV_texture_env_combine4
!!! Available: GL_NV_texture_rectangle
!!! Available: GL_NV_vertex_program2_option
!!! Available: GL_NV_vertex_program3
!!! Available: GL_SGIS_generate_mipmap
!!! Available: GL_SGIS_texture_border_clamp
!!! Available: GL_SGIS_texture_edge_clamp
!!! Available: GL_SGIS_texture_lod
!!! Available: GL_SGIX_depth_texture
!!! Available: GL_SGIX_shadow
!!! Available: GL_SUN_multi_draw_arrays
!!! Available: GL_SUN_slice_accum
!!! Available: GLX_ARB_get_proc_address
!!! Available: GLX_ARB_multisample
!!! Available: GLX_EXT_import_context
!!! Available: GLX_EXT_visual_info
!!! Available: GLX_EXT_visual_rating
!!! Available: GLX_SGI_make_current_read
!!! Available: GLX_SGI_swap_control
!!! Available: GLX_SGI_video_sync
!!! Available: GLX_SGIX_fbconfig
!!! Available: GLX_SGIX_pbuffer
!!! Available: GLX_EXT_texture_from_pixmap
!!! Added GL_VERSION_1_4 to known extensions
!!! Added GL_VERSION_1_3 to known extensions
!!! Added GL_VERSION_1_2 to known extensions
!!! Added GL_VERSION_1_1 to known extensions
!!! Added GL_VERSION_1_0 to known extensions
DiamondFrustumCuller.diamondInFrustum(19)=CULL_OUT
DiamondFrustumCuller.diamondInFrustum(21)=CULL_ALLIN
GLJPanel.handleReshape: (w,h) = (780,505)
glViewport(0, 0, 780, 505)

As you see the XXX_pixel_buffer_object is not in the list to be choosen but it is available with glxinfo. Also in case it is importatnt I’m using the lastest NVIDIA drivers 1.0-9746.

Can you also post the output of demos.printext.PrintExt from the jogl-demos workspace? I’m trying to understand whether this is somehow related to the use of pbuffers.

GL vendor: NVIDIA Corporation
GL version: 2.1.0 NVIDIA 97.46
GL renderer: GeForce 7950 GT/PCI/SSE2
GL extensions:
GL_ARB_color_buffer_float GL_ARB_depth_texture
GL_ARB_draw_buffers GL_ARB_fragment_program
GL_ARB_fragment_program_shadow GL_ARB_fragment_shader
GL_ARB_half_float_pixel GL_ARB_imaging
GL_ARB_multisample GL_ARB_multitexture
GL_ARB_occlusion_query GL_ARB_pixel_buffer_object
GL_ARB_point_parameters GL_ARB_point_sprite
GL_ARB_shadow GL_ARB_shader_objects
GL_ARB_shading_language_100 GL_ARB_texture_border_clamp
GL_ARB_texture_compression GL_ARB_texture_cube_map
GL_ARB_texture_env_add GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3 GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object GL_ARB_vertex_program
GL_ARB_vertex_shader GL_ARB_window_pos
GL_ATI_draw_buffers GL_ATI_texture_float
GL_ATI_texture_mirror_once GL_S3_s3tc
GL_EXT_texture_env_add GL_EXT_abgr
GL_EXT_bgra GL_EXT_blend_color
GL_EXT_blend_equation_separate GL_EXT_blend_func_separate
GL_EXT_blend_minmax GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array GL_EXT_Cg_shader
GL_EXT_depth_bounds_test GL_EXT_draw_range_elements
GL_EXT_fog_coord GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object
GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object GL_EXT_point_parameters
GL_EXT_rescale_normal GL_EXT_secondary_color
GL_EXT_separate_specular_color GL_EXT_shadow_funcs
GL_EXT_stencil_two_side GL_EXT_stencil_wrap
GL_EXT_texture3D GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod
GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp
GL_EXT_texture_object GL_EXT_texture_sRGB
GL_EXT_timer_query GL_EXT_vertex_array
GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region GL_NV_blend_square
GL_NV_copy_depth_to_color GL_NV_depth_clamp
GL_NV_fence GL_NV_float_buffer
GL_NV_fog_distance GL_NV_fragment_program
GL_NV_fragment_program_option GL_NV_fragment_program2
GL_NV_framebuffer_multisample_coverage GL_NV_half_float
GL_NV_light_max_exponent GL_NV_multisample_filter_hint
GL_NV_occlusion_query GL_NV_packed_depth_stencil
GL_NV_pixel_data_range GL_NV_point_sprite
GL_NV_primitive_restart GL_NV_register_combiners
GL_NV_register_combiners2 GL_NV_texgen_reflection
GL_NV_texture_compression_vtc GL_NV_texture_env_combine4
GL_NV_texture_expand_normal GL_NV_texture_rectangle
GL_NV_texture_shader GL_NV_texture_shader2
GL_NV_texture_shader3 GL_NV_vertex_array_range
GL_NV_vertex_array_range2 GL_NV_vertex_program
GL_NV_vertex_program1_1 GL_NV_vertex_program2
GL_NV_vertex_program2_option GL_NV_vertex_program3
GL_NVX_conditional_render GL_SGIS_generate_mipmap
GL_SGIS_texture_lod GL_SGIX_depth_texture
GL_SGIX_shadow GL_SUN_slice_accum

One note though. I’m not using pbuffers.

Note that the above list contains the extensions you’re interested in. The PrintExt demo uses a heavyweight GLCanvas to create its temporary OpenGL context. I don’t understand why, but it looks like when you’re rendering to an off-screen surface you’re getting a different set of available extensions.

It looks like you’re using a GLJPanel which is using pbuffers internally. Is there a specific reason you’re using that component instead of a GLCanvas? Have you tried using the heavyweight component, and does it improve things at all?

I figured out (just after I posted the last entry) that the pbuffers was probably in use by the GLJPanel which I’m using the GLJPanel. I need the panel because I have some overlapping transparent JInternalFrames, some of which use jogl and some of which use Java2D.

Can you point me to where I could look in the source to see why I’m getting a subset of the capabilities.

One other matter, I’m not sure if its related. Is the OpenGL/Java2D pipeline enabled by default, or do I still need to enable it. When I put

in the jnlp file I get the attached jvm crash report. When I put it in the j2se tag:

<j2se initial-heap-size=“384m” max-heap-size=“512m” version=“1.6+” java-vm-args="-Dsun.java2d.opengl=true" / >

I get the message ‘JOGL/Java2D integration disabled’ in the console output.

The GLXFBConfig selection code for pbuffers on X11 platforms is in src/classes/com/sun/opengl/impl/x11/X11PbufferDrawable.java. You could try playing with which one gets selected (currently the code only allows selection of the first of potentially multiple matching configs). Once the OpenGL context is created you should be able to use glGetString to see what the available extensions are.

I’d also recommend you write a small test case (similar to PrintExt) which creates a small 1x1 pbuffer and a context on it in order to query the available extensions, just to see whether something strange is going on in the GLJPanel implementation. I noticed the creation of a 0x0 pbuffer in your earlier log output which might be a bug in the GLJPanel.

You still need to enable it. It’s probably a bug in NVidia’s drivers that you’re getting a crash in the Java 2D code when you try to enable it. Maybe Chris Campbell from the Java 2D team can shed some light on this.

Ok. I will try this. In the mean time I’ve just found an earlier version of my code that used the 1.0.0 version of jogl before (as I remember it) the gluegen stuff was separated out. In this version I am able to have access to vertex buffer objects and pixel buffer objects in my GLJPanel. I’m gonna try and download the earliest jogl with the gluegen code separated to see if the problem started then.

OK. problem solved. I had downloaded the latest jogl 1.1.0.rc2 but I didn’t use the matching gluegen-rt.jar. It was probably the gluegen-rt-1.0b03 release. When I downloaded the 1.0b04 for January 23 it works. All is good, and I can get all the extensions. However the Java2D/OpenGL pipeline still crashes. Guess I’ll leave that for another day.

Thanks.

Glad to hear things are working. Even knowing what the implementation differences were between the two GlueGen runtime versions, that’s a pretty strange failure mode I don’t understand. Anyway, glad we don’t have to dig further.