JOGL and gl.glTexSubImage2D() performance issue on Linux

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
hi all,

I've faced with the issue that execution time for single gl.glTexSubImage2D() call takes 0.1-0.2sec while running on Linux and eating 100% of cpu. On mac it is all fine.

The call arguments are the following:

gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, 1920, 1080, GL2.GL_RED, GL2.GL_UNSIGNED_SHORT, data);

Textures setup is the following:

    void glCreateClearTex(GL gl, int target, int fmt, int format, int type, int filter, int w, int h, int val) {
        float fval = 0;
        int stride;
        if (w == 0)
            w = 1;
        if (h == 0)
            h = 1;
        stride = 2/*2048*/ * 2;
        ByteBuffer init = ByteBuffer.allocateDirect(stride * h/*2048*/);
        glAdjustAlignment(gl, stride);
        gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, w);
        gl.glTexImage2D(target, 0, fmt, w, h, 0, format, type, init);
        gl.glTexParameterf(target, GL2.GL_TEXTURE_PRIORITY, 1.0f);
        gl.glTexParameteri(target, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
        gl.glTexParameteri(target, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
        gl.glTexParameteri(target, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
        gl.glTexParameteri(target, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
        gl.glTexParameterfv(target, GL2.GL_TEXTURE_BORDER_COLOR, FloatBuffer.wrap(new float[] { fval, fval, fval, fval }));
    }

Mplayer doing same work natively runs just fine. glxgears runs ok but also takes up 100%. This may be the sign of OpenGL setup issues but glxinfo and others report that it is hw rendering. Graphic Card is ATI FirePro.

Any help appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

gouessej
Administrator
Hi

I'm under Mageia Linux 2 and I don't have such problems. Please show us what glxinfo displays. This problem has nothing to do with JOGL which is mainly a straight Java binding of OpenGL. Don't create a new direct NIO buffer at each call, it is a very bad idea (even though it isn't the root cause of your problem).
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
glCreateClearTex() is only called in init time. Its purpose is to allocate textures on gpu once and then upload data to them on every frame display.

Here is glxinfo (sorry for long post).

Thanks.

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: ATI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGIS_multisample,
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group
client glx vendor string: ATI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_swap_control, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_MESA_allocate_memory, GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
    GLX_MESA_swap_frame_usage, GLX_NV_swap_group, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_swap_barrier, GLX_SGIX_swap_group, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap, GLX_EXT_framebuffer_sRGB,
    GLX_ARB_fbconfig_float, GLX_AMD_gpu_association
GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_swap_control, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_MESA_swap_control, GLX_NV_swap_group, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_swap_barrier, GLX_SGIX_swap_group, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: ATI FirePro V7750 (FireGL)
OpenGL version string: 3.3.11627 Compatibility Profile Context FireGL
OpenGL shading language version string: 3.30
OpenGL extensions:
    GL_AMDX_debug_output, GL_AMDX_vertex_shader_tessellator,
    GL_AMD_conservative_depth, GL_AMD_debug_output,
    GL_AMD_depth_clamp_separate, GL_AMD_draw_buffers_blend,
    GL_AMD_name_gen_delete, GL_AMD_performance_monitor, GL_AMD_pinned_memory,
    GL_AMD_sample_positions, GL_AMD_seamless_cubemap_per_texture,
    GL_AMD_shader_stencil_export, GL_AMD_texture_cube_map_array,
    GL_AMD_texture_texture4, GL_AMD_vertex_shader_tessellator,
    GL_ARB_ES2_compatibility, GL_ARB_base_instance,
    GL_ARB_blend_func_extended, GL_ARB_color_buffer_float,
    GL_ARB_compressed_texture_pixel_storage, GL_ARB_conservative_depth,
    GL_ARB_copy_buffer, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp,
    GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend,
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced,
    GL_ARB_explicit_attrib_location, GL_ARB_fragment_coord_conventions,
    GL_ARB_fragment_program, GL_ARB_fragment_program_shadow,
    GL_ARB_fragment_shader, GL_ARB_framebuffer_object,
    GL_ARB_framebuffer_sRGB, GL_ARB_geometry_shader4,
    GL_ARB_get_program_binary, GL_ARB_half_float_pixel,
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_instanced_arrays,
    GL_ARB_internalformat_query, GL_ARB_map_buffer_alignment,
    GL_ARB_map_buffer_range, GL_ARB_multisample, GL_ARB_multitexture,
    GL_ARB_occlusion_query, GL_ARB_occlusion_query2,
    GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite,
    GL_ARB_provoking_vertex, GL_ARB_sample_shading, GL_ARB_sampler_objects,
    GL_ARB_seamless_cube_map, GL_ARB_separate_shader_objects,
    GL_ARB_shader_bit_encoding, GL_ARB_shader_objects,
    GL_ARB_shader_precision, GL_ARB_shader_stencil_export,
    GL_ARB_shader_texture_lod, GL_ARB_shading_language_100,
    GL_ARB_shading_language_420pack, GL_ARB_shading_language_packing,
    GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_sync,
    GL_ARB_texture_border_clamp, GL_ARB_texture_buffer_object,
    GL_ARB_texture_buffer_object_rgb32, GL_ARB_texture_compression,
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map,
    GL_ARB_texture_cube_map_array, GL_ARB_texture_env_add,
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,
    GL_ARB_texture_env_dot3, GL_ARB_texture_float, GL_ARB_texture_gather,
    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample,
    GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_lod,
    GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui,
    GL_ARB_texture_snorm, GL_ARB_texture_storage, GL_ARB_timer_query,
    GL_ARB_transform_feedback2, GL_ARB_transform_feedback3,
    GL_ARB_transform_feedback_instanced, GL_ARB_transpose_matrix,
    GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra,
    GL_ARB_vertex_array_object, GL_ARB_vertex_buffer_object,
    GL_ARB_vertex_program, GL_ARB_vertex_shader,
    GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_viewport_array,
    GL_ARB_window_pos, GL_ATI_draw_buffers, GL_ATI_envmap_bumpmap,
    GL_ATI_fragment_shader, GL_ATI_meminfo, GL_ATI_separate_stencil,
    GL_ATI_texture_compression_3dc, GL_ATI_texture_env_combine3,
    GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_EXT_abgr,
    GL_EXT_bgra, GL_EXT_bindable_uniform, 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_copy_buffer, GL_EXT_copy_texture, GL_EXT_direct_state_access,
    GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements,
    GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,
    GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB,
    GL_EXT_geometry_shader4, GL_EXT_gpu_program_parameters,
    GL_EXT_gpu_shader4, GL_EXT_histogram, GL_EXT_multi_draw_arrays,
    GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels,
    GL_EXT_pixel_buffer_object, GL_EXT_point_parameters,
    GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap,
    GL_EXT_subtexture, GL_EXT_texgen_reflection, GL_EXT_texture3D,
    GL_EXT_texture_array, GL_EXT_texture_buffer_object,
    GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc,
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map,
    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_integer,
    GL_EXT_texture_lod, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp,
    GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_texture_sRGB,
    GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm,
    GL_EXT_texture_storage, GL_EXT_texture_swizzle, GL_EXT_timer_query,
    GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_EXT_vertex_array_bgra,
    GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square,
    GL_NV_conditional_render, GL_NV_copy_depth_to_color, GL_NV_copy_image,
    GL_NV_explicit_multisample, GL_NV_float_buffer, GL_NV_half_float,
    GL_NV_primitive_restart, GL_NV_texgen_reflection, GL_NV_texture_barrier,
    GL_SGIS_generate_mipmap, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod,
    GL_SUN_multi_draw_arrays, GL_WIN_swap_hint, WGL_EXT_swap_control

121 GLX Visuals
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x025 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x026 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x027 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x028 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x029 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x02a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x02b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x02c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x02d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x02e 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x02f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x030 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x031 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x032 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x033 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x034 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x035 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x036 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x037 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x038 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x039 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x03a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x03b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x03c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x03d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x03e 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x03f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x040 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x041 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x042 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x043 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x044 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x045 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x046 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x047 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x048 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x049 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x04a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x04b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x04c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x04f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x050 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x051 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x052 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x053 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x054 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x055 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x056 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x057 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x058 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x059 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x05a 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x05b 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x05c 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x05d 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x05e 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x05f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x060 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x061 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x062 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x063 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x064 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x065 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x066 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x067 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x068 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x069 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x06a 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x06b 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x06c 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x06d 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x06e 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x06f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x070 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x071 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x072 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x073 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x074 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x075 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x076 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x07d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x07e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x07f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x080 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x085 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x086 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x087 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x088 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x08d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x08e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x08f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x090 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x095 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x096 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x097 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x098 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x09d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x09e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x09f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0a0 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0a7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x0a8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x0a9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x0aa 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x0af 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x0b0 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x0b1 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x0b2 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x0b7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x0b8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x0b9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x0ba 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x0bf 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x0c0 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x0c1 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x0c2 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x0c7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x0c8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x0c9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0ca 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x117 32 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 Ncon

131 GLXFBConfigs:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x025 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x026 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x027 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x028 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x029 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x02a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x02b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x02c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x02d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x02e 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x02f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x030 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x031 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x032 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x033 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x034 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x035 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x036 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x037 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x038 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x039 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x03a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x03b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x03c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x03d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x03e 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x03f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x040 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x041 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x042 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x043 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x044 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x045 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x046 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x047 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x048 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x049 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x04a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x04b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x04c 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x04f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x050 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x051 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x052 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x053 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x054 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
0x055 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x056 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 None
0x057 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x058 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x059 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x05a 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x05b 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x05c 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  2 1 None
0x05d 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x05e 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  2 1 None
0x05f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x060 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x061 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x062 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x063 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x064 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  4 1 None
0x065 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x066 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 None
0x067 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x068 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x069 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x06a 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x06b 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x06c 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  6 1 None
0x06d 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x06e 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  6 1 None
0x06f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x070 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None
0x071 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x072 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0 16 16 16 16  0 0 None
0x073 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x074 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  8 1 None
0x075 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x076 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  8 1 None
0x07d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x07e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x07f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x080 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x085 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x086 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x087 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x088 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x08d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x08e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x08f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x090 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x095 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x096 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x097 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x098 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x09d 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x09e 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x09f 30 tc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0a0 30 tc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0a7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x0a8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  0 0 None
0x0a9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x0aa 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  0 0 None
0x0af 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x0b0 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  2 1 None
0x0b1 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x0b2 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  2 1 None
0x0b7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x0b8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  4 1 None
0x0b9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x0ba 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  4 1 None
0x0bf 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x0c0 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  6 1 None
0x0c1 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x0c2 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  6 1 None
0x0c7 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x0c8 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  8  0  0  0  0  8 1 None
0x0c9 30 dc  0  32  0 r  y .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x0ca 30 dc  0  32  0 r  . .  10 10 10  2 .  .  0 24  0  0  0  0  0  8 1 None
0x117 32 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  0  0  0  0  0  4 1 Ncon
0x117 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  0  0  0  0  0  0 0 Ncon
0x117 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 Ncon
0x117 32 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 Ncon
0x117 32 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 Ncon
0x117  0 tc  0 128  0    y .  32 32 32 32 .  .  0 24  0  0  0  0  0  0 0 None
0x117  0 tc  0 128  0    . .  32 32 32 32 .  .  0 24  0  0  0  0  0  0 0 None
0x117  0 tc  0  64  0    y .  16 16 16 16 .  .  0 24  0  0  0  0  0  0 0 None
0x117  0 tc  0  64  0    . .  16 16 16 16 .  .  0 24  0  0  0  0  0  0 0 None
0x117  0 tc  0  32  0    y .  11 11 10  0 .  .  0 24  0  0  0  0  0  0 0 None
0x117  0 tc  0  32  0    . .  11 11 10  0 .  .  0 24  0  0  0  0  0  0 0 None
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
I found the issue. My mistake. I uploaded pixel data twice, once to pbo and another one using gl.glTexSubImage2D() variant that accepts pointer. Fix is to do it once and use gl.glTexSubImage2D(...offset).

Sorry :)
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

gouessej
Administrator
Don't be sorry, we just learn from our mistakes.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
btw, during this work I've made some nice fixes to gluegen. It could not work well when packing it all into one huge uber jar. Whom should I send the patch?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Xerxes Rånby
2012-11-12 12:32, Umka [via jogamp] skrev:
btw, during this work I've made some nice fixes to gluegen. It could not work well when packing it all into one huge uber jar. Whom should I send the patch?


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/JOGL-and-gl-glTexSubImage2D-performance-issue-on-Linux-tp4026810p4026880.html
To start a new topic under jogl, email [hidden email]
To unsubscribe from jogamp, click here.
NAML



Best is is you first fork the gluegen git, apply your patch and then send a pull request:
https://github.com/sgothel/gluegen
https://help.github.com/articles/fork-a-repo

Please use your real name for the git commits.

https://jogamp.org/wiki/index.php/How_to_Contribute

Cheers
Xerxes

Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

gouessej
Administrator
In reply to this post by Umka
Umka, where is your pull request?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
just a min, will handle this shortly. Was busy lastly )
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
Guys,

I'm sorry I don't have time for doing things totally right with that gluegen patch landing/inspecting, etc. What if I send it (not really production ready but works for me) and you just get idea of the fix and some of you produce a better fix?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
index 94f451e..5cca3d0 100644
--- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
+++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
@@ -154,12 +154,17 @@ public class JNILibLoaderBase {
         msg.append(nativeJarName);
         final URL jarUrlRoot = JarUtil.getURLDirname( JarUtil.getJarSubURL( classJarURL ) );
         msg.append(" + ").append(jarUrlRoot);
-        final URL nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName);
+        URL nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName);
         msg.append(" -> ").append(nativeJarURL);
         if(DEBUG) {
             System.err.println(msg.toString());
         }
-        TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURL);
+        try {
+            TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURL);
+        } catch (Exception e) {
+            nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarBasename + ".jar");
+            TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURL);
+        }
         ok = true;
     }
     return ok;
@@ -426,7 +431,7 @@ public class JNILibLoaderBase {
         }
     } else {
       // System.err.println("sun.boot.library.path=" + Debug.getProperty("sun.boot.library.path", false));
-      final String libraryPath = NativeLibrary.findLibrary(libraryName, cl); // implicit TempJarCache usage if used/initialized
+      String libraryPath = NativeLibrary.findLibrary(libraryName, cl); // implicit TempJarCache usage if used/initialized
       if(DEBUG) {
           System.err.print("JNILibLoaderBase: loadLibraryInternal("+libraryName+"): CL: "+libraryPath);
       }
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java
index 72a0b3d..6a551c1 100644
--- a/src/java/com/jogamp/common/os/Platform.java
+++ b/src/java/com/jogamp/common/os/Platform.java
@@ -183,11 +183,11 @@ public class Platform extends PlatformPropsImpl {
         AWT_AVAILABLE = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
             public Boolean run() {
                 // load GluegenRT native library
-                loadGlueGenRTImpl();
-                
+                loadGlueGenRTImpl(libBaseName);
+
                 // JVM bug workaround
                 JVMUtil.initSingleton(); // requires gluegen-rt, one-time init.
-                
+
                 // detect AWT availability
                 boolean awtAvailable = false;
                 {
@@ -231,7 +231,7 @@ public class Platform extends PlatformPropsImpl {
         return null != platformClassJarURL;
     }
     
-    private static final void loadGlueGenRTImpl() {
+    public static final void loadGlueGenRTImpl(String libName) {
         if(USE_TEMP_JAR_CACHE && TempJarCache.initSingleton()) {
             String nativeJarName = null;
             URL jarUrlRoot = null;
@@ -241,14 +241,19 @@ public class Platform extends PlatformPropsImpl {
                 final String nativeJarBasename = jarName.substring(0, jarName.indexOf(".jar")); // ".jar" already validated w/ JarUtil.getJarBasename(..)
                 nativeJarName = nativeJarBasename+"-natives-"+PlatformPropsImpl.os_and_arch+".jar";                    
                 jarUrlRoot = JarUtil.getURLDirname( JarUtil.getJarSubURL(platformClassJarURL) );
-                nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName);
-                TempJarCache.bootstrapNativeLib(Platform.class, libBaseName, nativeJarURL);
+                try {
+                    nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName);
+                    TempJarCache.bootstrapNativeLib(Platform.class, libName, nativeJarURL);
+                } catch (Exception ee) {
+                    nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, jarName);
+                    TempJarCache.bootstrapNativeLib(Platform.class, libName, nativeJarURL);
+                }
+                DynamicLibraryBundle.GlueJNILibLoader.loadLibrary(libName, false, Platform.class.getClassLoader());
             } catch (Exception e0) {
                 // IllegalArgumentException, IOException
                 System.err.println("Catched "+e0.getClass().getSimpleName()+": "+e0.getMessage()+", while TempJarCache.bootstrapNativeLib() of "+nativeJarURL+" ("+jarUrlRoot+" + "+nativeJarName+")");
             }
         }
-        DynamicLibraryBundle.GlueJNILibLoader.loadLibrary(libBaseName, false, Platform.class.getClassLoader());
     }
     
     /**
diff --git a/src/java/com/jogamp/common/util/JarUtil.java b/src/java/com/jogamp/common/util/JarUtil.java
index 84ec59d..ea08183 100644
--- a/src/java/com/jogamp/common/util/JarUtil.java
+++ b/src/java/com/jogamp/common/util/JarUtil.java
@@ -48,6 +48,7 @@ import java.util.jar.JarFile;
 import com.jogamp.common.os.NativeLibrary;
 
 import jogamp.common.Debug;
+import jogamp.common.os.PlatformPropsImpl;
 
 public class JarUtil {
     private static final boolean DEBUG = Debug.debug("JarUtil");
@@ -499,36 +500,43 @@ public class JarUtil {
                                    ", isClassFile " + isClassFile + ", isDir " + isDir +
                                    ", isRootEntry " + isRootEntry );
             }
-            
+
             final File destFile = new File(dest, entryName);
             if(isDir) {
                 if (DEBUG) {
                     System.err.println("JarUtil: MKDIR: " + entryName + " -> " + destFile );
                 }
-                destFile.mkdir();
+                destFile.mkdirs();
             } else {
                 final File destFolder = new File(destFile.getParent());
                 if(!destFolder.exists()) {
                     if (DEBUG) {
                         System.err.println("JarUtil: MKDIR (parent): " + entryName + " -> " + destFolder );
-                    }                    
-                    destFolder.mkdir();
+                    }
+                    destFolder.mkdirs();
                 }
-                final InputStream in = new BufferedInputStream(jarFile.getInputStream(entry));
-                final OutputStream out = new BufferedOutputStream(new FileOutputStream(destFile));
+                boolean addedAsNativeLib = false;
                 int numBytes = -1;
-                try {
-                    numBytes = IOUtil.copyStream2Stream(in, out, -1);
-                } finally {
-                    in.close();
-                    out.close();
+                if (DEBUG) {
+                    System.err.println("JarUtil: hasOsAndArch(" + destFolder.getName() + "): " + PlatformPropsImpl.hasOsAndArch(destFolder.getName()));
+                    System.err.println("JarUtil: hasLocalArch(" + destFile.getParent() + "): " + PlatformPropsImpl.hasLocalArch(destFolder.getName()));
+                    System.err.println("JarUtil: localArch: " + PlatformPropsImpl.os_and_arch);
                 }
-                boolean addedAsNativeLib = false;
-                if (numBytes>0) {
-                    num++;
-                    if (isNativeLib && ( isRootEntry || !nativeLibMap.containsKey(libBaseName) ) ) {                    
-                        nativeLibMap.put(libBaseName, destFile.getAbsolutePath());
-                        addedAsNativeLib = true;
+                if ((!PlatformPropsImpl.hasOsAndArch(destFolder.getName()) || PlatformPropsImpl.hasLocalArch(destFolder.getName())) && !nativeLibMap.containsKey(libBaseName)) {
+                    final InputStream in = new BufferedInputStream(jarFile.getInputStream(entry));
+                    final OutputStream out = new BufferedOutputStream(new FileOutputStream(destFile));
+                    try {
+                        numBytes = IOUtil.copyStream2Stream(in, out, -1);
+                    } finally {
+                        in.close();
+                        out.close();
+                    }
+                    if (numBytes>0) {
+                        num++;
+                        if (isNativeLib && ( isRootEntry || !nativeLibMap.containsKey(libBaseName) )) {
+                            nativeLibMap.put(libBaseName, destFile.getAbsolutePath());
+                            addedAsNativeLib = true;
+                        }
                     }
                 }
                 if (DEBUG) {
diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java
index 6f24c68..822efe0 100644
--- a/src/java/com/jogamp/common/util/cache/TempJarCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java
@@ -49,6 +49,7 @@ import com.jogamp.common.os.NativeLibrary;
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.common.util.JarUtil;
 import com.jogamp.common.util.SecurityUtil;
+import jogamp.common.os.PlatformPropsImpl;
 
 public class TempJarCache {
     private static final boolean DEBUG = Debug.debug("TempJarCache");
@@ -209,15 +210,15 @@ public class TempJarCache {
      */
     public synchronized static final void addNativeLibs(Class<?> certClass, URL jarURL) throws IOException, SecurityException {        
         final LoadState nativeLibJarsLS = nativeLibJars.get(jarURL);
-        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) ) {
-            nativeLibJars.put(jarURL, LoadState.LOOKED_UP);
+        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) || !testLoadState(nativeLibJarsLS, LoadState.LOADED) ) {
             final JarFile jarFile = JarUtil.getJarFile(jarURL);
             if(DEBUG) {
                 System.err.println("TempJarCache: addNativeLibs: "+jarURL+": nativeJar "+jarFile.getName());
             }
+            nativeLibJars.put(jarURL, LoadState.LOOKED_UP);
             validateCertificates(certClass, jarFile);
             JarUtil.extract(tmpFileCache.getTempDir(), nativeLibMap, jarFile,
-                            true, false, false);
+                            true, false, false);
             nativeLibJars.put(jarURL, LoadState.LOADED);
         } else if( !testLoadState(nativeLibJarsLS, LoadState.LOADED) ) {
             throw new IOException("TempJarCache: addNativeLibs: "+jarURL+", previous load attempt failed");
@@ -237,12 +238,12 @@ public class TempJarCache {
      */
     public synchronized static final void addClasses(Class<?> certClass, URL jarURL) throws IOException, SecurityException {
         final LoadState classFileJarsLS = classFileJars.get(jarURL);
-        if( !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) ) {
-            classFileJars.put(jarURL, LoadState.LOOKED_UP);
+        if( !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) || !testLoadState(classFileJarsLS, LoadState.LOADED) ) {
             final JarFile jarFile = JarUtil.getJarFile(jarURL);
             if(DEBUG) {
                 System.err.println("TempJarCache: addClasses: "+jarURL+": nativeJar "+jarFile.getName());
             }
+            classFileJars.put(jarURL, LoadState.LOOKED_UP);
             validateCertificates(certClass, jarFile);
             JarUtil.extract(tmpFileCache.getTempDir(), null, jarFile,
                             false, true, false);
@@ -263,12 +264,12 @@ public class TempJarCache {
      */
     public synchronized static final void addResources(Class<?> certClass, URL jarURL) throws IOException, SecurityException {        
         final LoadState resourceFileJarsLS = resourceFileJars.get(jarURL);
-        if( !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) ) {
-            resourceFileJars.put(jarURL, LoadState.LOOKED_UP);
+        if( !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) || !testLoadState(resourceFileJarsLS, LoadState.LOADED) ) {
             final JarFile jarFile = JarUtil.getJarFile(jarURL);
             if(DEBUG) {
                 System.err.println("TempJarCache: addResources: "+jarURL+": nativeJar "+jarFile.getName());
             }
+            resourceFileJars.put(jarURL, LoadState.LOOKED_UP);
             validateCertificates(certClass, jarFile);
             JarUtil.extract(tmpFileCache.getTempDir(), null, jarFile,
                             false, false, true);
@@ -298,14 +299,18 @@ public class TempJarCache {
         final LoadState nativeLibJarsLS = nativeLibJars.get(jarURL);
         final LoadState classFileJarsLS = classFileJars.get(jarURL);
         final LoadState resourceFileJarsLS = resourceFileJars.get(jarURL);
-        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) ||
-            !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) ||
-            !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) ) {
+        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) || !testLoadState(nativeLibJarsLS, LoadState.LOADED) ||
+            !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) || !testLoadState(classFileJarsLS, LoadState.LOADED) ||
+            !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) || !testLoadState(resourceFileJarsLS, LoadState.LOADED) ) {
             
             final boolean extractNativeLibraries = !testLoadState(nativeLibJarsLS, LoadState.LOADED);
             final boolean extractClassFiles = !testLoadState(classFileJarsLS, LoadState.LOADED);
             final boolean extractOtherFiles = !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP);
             
+            final JarFile jarFile = JarUtil.getJarFile(jarURL);
+            if(DEBUG) {
+                System.err.println("TempJarCache: addAll: "+jarURL+": nativeJar "+jarFile.getName());
+            }
             // mark looked-up (those who are not loaded)
             if(extractNativeLibraries) {
                 nativeLibJars.put(jarURL, LoadState.LOOKED_UP);
@@ -317,10 +322,6 @@ public class TempJarCache {
                 resourceFileJars.put(jarURL, LoadState.LOOKED_UP);
             }
             
-            final JarFile jarFile = JarUtil.getJarFile(jarURL);
-            if(DEBUG) {
-                System.err.println("TempJarCache: addAll: "+jarURL+": nativeJar "+jarFile.getName());
-            }
             validateCertificates(certClass, jarFile);
             JarUtil.extract(tmpFileCache.getTempDir(), nativeLibMap, jarFile,
                             extractNativeLibraries, extractClassFiles, extractOtherFiles);
@@ -342,6 +343,7 @@ public class TempJarCache {
         }
     }
     
+
     public synchronized static final String findLibrary(String libName) {
         checkInitialized();
         // try with mapped library basename first
@@ -408,26 +410,29 @@ public class TempJarCache {
         boolean ok = false;
         int countEntries = 0;
         final LoadState nativeLibJarsLS = nativeLibJars.get(jarURL);
-        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) && !nativeLibMap.containsKey(libBaseName) ) {
+        if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) || !nativeLibMap.containsKey(libBaseName) ) {
             if(DEBUG) {
                 System.err.println("TempJarCache: bootstrapNativeLib(certClass: "+certClass+", libBaseName "+libBaseName+", jarURL "+jarURL+")");
             }
-            nativeLibJars.put(jarURL, LoadState.LOOKED_UP);
             final JarFile jarFile = JarUtil.getJarFile(jarURL);
             if(DEBUG) {
                 System.err.println("TempJarCache: bootstrapNativeLib: nativeJar "+jarFile.getName());
             }
+            //nativeLibJars.put(jarURL, LoadState.LOOKED_UP);
             validateCertificates(certClass, jarFile);
             final Enumeration<JarEntry> entries = jarFile.entries();
             while (entries.hasMoreElements()) {
                 final JarEntry entry = (JarEntry) entries.nextElement();
                 final String entryName = entry.getName();
-    
+                final File destFile = new File(tmpFileCache.getTempDir(), entryName);
+
                 if( entryName.indexOf('/') == -1 &&
                     entryName.indexOf(File.separatorChar) == -1 &&
-                    entryName.indexOf(libBaseName) >= 0 )
+                    entryName.indexOf(libBaseName) >= 0 &&
+                    NativeLibrary.isValidNativeLibraryName(entryName, false) != null &&
+                    (!PlatformPropsImpl.hasOsAndArch(destFile.getParent()) ||
+                      PlatformPropsImpl.hasLocalArch(destFile.getParent())))
                 {
-                    final File destFile = new File(tmpFileCache.getTempDir(), entryName);
                     final InputStream in = new BufferedInputStream(jarFile.getInputStream(entry));
                     final OutputStream out = new BufferedOutputStream(new FileOutputStream(destFile));
                     int numBytes = 0;
@@ -442,7 +447,7 @@ public class TempJarCache {
                     } finally { in.close(); out.close(); }
                     if (numBytes>0) {
                         nativeLibMap.put(libBaseName, destFile.getAbsolutePath());
-                        nativeLibJars.put(jarURL, LoadState.LOADED);
+                        //nativeLibJars.put(jarURL, LoadState.LOADED);
                         ok = true;
                         countEntries++;
                     }
diff --git a/src/java/jogamp/common/os/PlatformPropsImpl.java b/src/java/jogamp/common/os/PlatformPropsImpl.java
index 111523d..fc3f4b9 100644
--- a/src/java/jogamp/common/os/PlatformPropsImpl.java
+++ b/src/java/jogamp/common/os/PlatformPropsImpl.java
@@ -210,7 +210,22 @@ public abstract class PlatformPropsImpl {
      * kick off static initialization of platform property information
      */
     public static void initSingleton() { }
-    
+
+    public static final boolean hasOsAndArch(String str) {
+        String arches[] = new String[] {"freebsd-i386", "freebsd-i586", "freebsd-amd64", "hpux-hppa", "linux-amd64", "linux-ia64", "linux-i586",
+                                        "linux-armv6", "android-armv6", "macosx-universal", "solaris-sparc", "solaris-sparcv9",
+                                        "solaris-amd64", "solaris-i586", "windows-amd64", "windows-i586", "linux-i386", "sunos-x86"};
+        for (int i = 0; i < arches.length; i++) {
+                if (str.indexOf(arches[i]) != -1)
+                    return true;
+        }
+        return false;
+    }
+
+    public static final boolean hasLocalArch(String str) {
+        return (str.indexOf(PlatformPropsImpl.os_and_arch) != -1);
+    }
+
     /**
      * Returns the GlueGen common name for the given OSType and CPUType
      * as implemented in the build system in 'gluegen-cpptasks-base.xml'.<br>
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Sven Gothel
Administrator
In reply to this post by Umka
On 11/15/2012 04:58 PM, Umka [via jogamp] wrote:
> Guys,
>
> I'm sorry I don't have time for doing things totally right with that gluegen
> patch landing/inspecting, etc. What if I send it (not really production ready
> but works for me) and you just get idea of the fix and some of you produce a
> better fix?
>
"Guy", I am the maintainer of GlueGen and I cannot accept such a fly-bye diff
without reasoning or explanation.

Rule-1 (especially for new sources of human input):
  - Don't mix your semantic patch w/ whitespace changes
  - I need an explanation
  - I probably need a unit test
  - I need a full name of a real person incl. valid email address,
    best as a git formatted email patch (if not a pull request)

This is very important especially for GlueGen, since it's failure
means failure of all JogAmp modules.

And 'no time' is no excuse to not serve the bare minimum (a
discussion/explanation).

So either you are capable of delivering a proper patch with comments
and explanations w/o whitespaces, or it's 'gone w/ the guys'.

Sorry for being harsh - but we need to keep our QA standards.

And .. guess what ? Our time is limited as well :)

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Sven Gothel
Administrator
In reply to this post by Umka
On 11/15/2012 05:00 PM, Umka [via jogamp] wrote:
> diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
> b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java

.. many lines of very invasive changes to native lib loading ,.

I glanced over it, besides a few NOP changes you made (".jar") suffix,
which are redundant and hence invalid,
you also try to hardcode the architecture into the native library JAR file
by creating subdir for each architecture.

This would require a serious discussion, but also you to understand our
current deployment schema _first_.

Again: Such things cannot be done w/ a fly-bye stop dropping some half-ass patch.

Also this is not a _FIX_ but a feature enhancement, if not even a loophole
for some insecurity .. who knows ? :)

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Umka
Up to you mister "maintainer" :) Throw it though the window if you like. I will not do anything, especially after your stupidly arrogant answer. It looks like you are 15...
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

gouessej
Administrator
We won't throw it to the window, I really want to understand what it fixes and how.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL and gl.glTexSubImage2D() performance issue on Linux

Sven Gothel
Administrator
In reply to this post by Umka
On 11/15/2012 10:33 PM, Umka [via jogamp] wrote:
> Up to you mister "maintainer" :) Throw it though the window if you like. I
> will not do anything, especially after your stupidly arrogant answer.

:)

Dear Umka,

.. I know, don't feed the trolls, so this reply is probably futile.

I gave you the attention even though
you have no time to deliver a proper patch or to discuss it.

I have read you writings, responded - even if it is to your dislike.

I also looked at your patch, even though it is to my dislike :)

You may find one day that time indeed is limited not only on
you end, but also on the end of the others.

Usually we have open discussions about changes, well - a source patch
may qualify for that as well, but it is ofc often harder to use as such.

It usually all boils down to discussions and spending lots of time
and if the latter is to no availability dealing with such contributions
is usually futile on my end.

Well, it is not in my powers to ask you for your quality and time,
which would be required to getting to the essence of your patch
and maybe even ongoing commitment.

Time and quality is one metric of mutual respect.

> It looks like you are 15...

Thank you for the compliment. I only wish, I would :)

~Sven



signature.asc (909 bytes) Download Attachment