Cannot get a compatibility profile with mesa on archlinux

Started by atom, September 12, 2017, 17:20:22

Previous topic - Next topic

atom

Hello, i am unable to get a compatibility profile, but core profile is ok.

This sample code :
public static void main(String[] args) {
    GLFWErrorCallback.createPrint(System.err).set();
    if (!glfwInit()) {
        throw new IllegalStateException("Unable to initialize GLFW");
    }
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
    long handle = glfwCreateWindow(100, 100, "test", NULL, NULL);
    glfwMakeContextCurrent(handle);
    GL.createCapabilities();
    System.out.println("OpenGL version : "+glGetString(GL_VERSION));
}

gives me:
Quote[LWJGL] Version: 3.1.2 build 29
[LWJGL]     OS: Linux v4.13.1-1-ARCH
[LWJGL]    JRE: 1.8.0_144 amd64
[LWJGL]    JVM: OpenJDK 64-Bit Server VM v25.144-b01 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libjemalloc.so
[LWJGL] MemoryUtil allocator: DebugAllocator
[LWJGL] Loading library: glfw
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libglfw.so
[LWJGL] GLFW_VERSION_UNAVAILABLE error
   Description : GLX: Failed to create context: GLXBadFBConfig
   Stacktrace  :
      org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1361)
      org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1521)
      org.lwjglx.debug.glfw.GLFW.glfwCreateWindow(GLFW.java:380)
      org.lwjglx.debug.$Proxy$1.4(Unknown Source)
      CrashCompatibilityProfile.main(CrashCompatibilityProfile.java:30)
[LWJGL] GLFW_VERSION_UNAVAILABLE error
   Description : GLX: Failed to create context: GLXBadFBConfig
   Stacktrace  :
      org.lwjgl.system.JNI.invokePPPP(Native Method)
      org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1361)
      org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1521)
      org.lwjglx.debug.glfw.GLFW.glfwCreateWindow(GLFW.java:380)
      org.lwjglx.debug.$Proxy$1.4(Unknown Source)
      CrashCompatibilityProfile.main(CrashCompatibilityProfile.java:30)
[error] Failed to create GLFW window
[LWJGL] Loading library (system): lwjgl_opengl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl_opengl.so
[LWJGL] Loading library: libGL.so.1
[LWJGL]    libGL.so.1 not found in org.lwjgl.librarypath=natives
[LWJGL]    Loaded from system paths

and this sample code :
public static void main(String[] args) {
    GLFWErrorCallback.createPrint(System.err).set();
    if (!glfwInit()) {
        throw new IllegalStateException("Unable to initialize GLFW");
    }
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    long handle = glfwCreateWindow(100, 100, "test", NULL, NULL);
    glfwMakeContextCurrent(handle);
    GL.createCapabilities();
    System.out.println("OpenGL version : "+glGetString(GL_VERSION));
}

gives me that :
Quote[LWJGL] Version: 3.1.2 build 29
[LWJGL]     OS: Linux v4.13.1-1-ARCH
[LWJGL]    JRE: 1.8.0_144 amd64
[LWJGL]    JVM: OpenJDK 64-Bit Server VM v25.144-b01 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libjemalloc.so
[LWJGL] MemoryUtil allocator: DebugAllocator
[LWJGL] Loading library: glfw
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libglfw.so
[LWJGL] Loading library (system): lwjgl_opengl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl_opengl.so
[LWJGL] Loading library: libGL.so.1
[LWJGL]    libGL.so.1 not found in org.lwjgl.librarypath=natives
[LWJGL]    Loaded from system paths
[LWJGL] [GL] Using OpenGL 4.3 for error logging.
[info ][1] Initialized OpenGL context for window[1]
  Effective OpenGL version: 4.5
  OpenGL version string   : 4.5 (Core Profile) Mesa 17.2.0
  OpenGL vendor           : X.Org
  OpenGL renderer         : AMD Radeon (TM) RX 480 Graphics (AMD POLARIS10 / DRM 3.18.0 / 4.13.1-1-ARCH, LLVM 4.0.1)
  GL_MAX_VERTEX_ATTRIBS   : 16
  Capabilities:
        1      GL_AMD_conservative_depth GL_AMD_draw_buffers_blend GL_AMD_performance_monitor
        2      GL_AMD_pinned_memory GL_AMD_seamless_cubemap_per_texture
        3      GL_AMD_shader_stencil_export GL_AMD_shader_trinary_minmax
        4      GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index
        5      GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture
        6      GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object
        7      GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float
        8      GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader
        9      GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted
       10      GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image
       11      GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float
       12      GL_ARB_depth_clamp GL_ARB_derivative_control GL_ARB_direct_state_access
       13      GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex
       14      GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts
       15      GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility
       16      GL_ARB_ES3_compatibility GL_ARB_explicit_attrib_location
       17      GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions
       18      GL_ARB_fragment_layer_viewport GL_ARB_fragment_shader
       19      GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object
       20      GL_ARB_framebuffer_sRGB GL_ARB_get_program_binary GL_ARB_get_texture_sub_image
       21      GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64
       22      GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_indirect_parameters
       23      GL_ARB_instanced_arrays GL_ARB_internalformat_query
       24      GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata
       25      GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind
       26      GL_ARB_multi_draw_indirect GL_ARB_occlusion_query2
       27      GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_sprite
       28      GL_ARB_program_interface_query GL_ARB_provoking_vertex
       29      GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior
       30      GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects
       31      GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture
       32      GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops
       33      GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_clock
       34      GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote
       35      GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects
       36      GL_ARB_shader_precision GL_ARB_shader_stencil_export
       37      GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine
       38      GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod
       39      GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_420pack
       40      GL_ARB_shading_language_packing GL_ARB_sparse_buffer GL_ARB_stencil_texturing
       41      GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier
       42      GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32
       43      GL_ARB_texture_buffer_range GL_ARB_texture_compression_bptc
       44      GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map_array
       45      GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge
       46      GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two
       47      GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle
       48      GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8
       49      GL_ARB_texture_storage GL_ARB_texture_storage_multisample
       50      GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query
       51      GL_ARB_transform_feedback2 GL_ARB_transform_feedback3
       52      GL_ARB_transform_feedback_instanced GL_ARB_uniform_buffer_object
       53      GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit
       54      GL_ARB_vertex_attrib_binding GL_ARB_vertex_shader
       55      GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev
       56      GL_ARB_viewport_array GL_ATI_meminfo GL_EXT_abgr GL_EXT_blend_equation_separate
       57      GL_EXT_depth_bounds_test GL_EXT_draw_buffers2 GL_EXT_draw_instanced
       58      GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample
       59      GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_sRGB
       60      GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_pixel_buffer_object
       61      GL_EXT_polygon_offset_clamp GL_EXT_provoking_vertex GL_EXT_shader_integer_mix
       62      GL_EXT_texture_array GL_EXT_texture_compression_rgtc
       63      GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic
       64      GL_EXT_texture_integer GL_EXT_texture_mirror_clamp
       65      GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_sRGB
       66      GL_EXT_texture_sRGB_decode GL_EXT_texture_swizzle GL_EXT_timer_query
       67      GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_KHR_context_flush_control
       68      GL_KHR_debug GL_KHR_no_error GL_KHR_robust_buffer_access_behavior
       69      GL_KHR_robustness GL_NV_conditional_render GL_NV_depth_clamp
       70      GL_NV_packed_depth_stencil GL_NV_texture_barrier GL_NVX_gpu_memory_info
       71      forwardCompatible
OpenGL version : 4.5 (Core Profile) Mesa 17.2.0

I've read somewhere else that mesa doesn't provide compatibility context, is that true?
Do I do something wrong?