dri: Allow config options to be passed to the loader through extensions.
[mesa.git] / src / glx / glxextensions.c
index df5ef5c6b472d1d090fd6247cb72a39f3ed4b716..7b00a9e338da40a89e000de2f041b5e22e159994 100644 (file)
@@ -73,13 +73,18 @@ struct extension_info
 static const struct extension_info known_glx_extensions[] = {
    { GLX(ARB_create_context),          VER(0,0), Y, N, N, N },
    { GLX(ARB_create_context_profile),  VER(0,0), Y, N, N, N },
+   { GLX(ARB_create_context_robustness), VER(0,0), Y, N, N, N },
+   { GLX(ARB_fbconfig_float),          VER(0,0), Y, Y, N, N },
+   { GLX(ARB_framebuffer_sRGB),        VER(0,0), Y, Y, N, N },
    { GLX(ARB_get_proc_address),        VER(1,4), Y, N, Y, N },
    { GLX(ARB_multisample),             VER(1,4), Y, Y, N, N },
    { GLX(ATI_pixel_format_float),      VER(0,0), N, N, N, N },
    { GLX(EXT_import_context),          VER(0,0), Y, Y, N, N },
    { GLX(EXT_visual_info),             VER(0,0), Y, Y, N, N },
    { GLX(EXT_visual_rating),           VER(0,0), Y, Y, N, N },
+   { GLX(EXT_fbconfig_packed_float),   VER(0,0), Y, Y, N, N },
    { GLX(EXT_framebuffer_sRGB),        VER(0,0), Y, Y, N, N },
+   { GLX(EXT_create_context_es2_profile), VER(0,0), Y, N, N, Y },
    { GLX(MESA_copy_sub_buffer),        VER(0,0), Y, N, N, N },
    { GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, Y, N },
    { GLX(MESA_swap_control),           VER(0,0), Y, N, N, Y },
@@ -507,7 +512,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
       }
    }
 
-   ext_str = Xmalloc(ext_str_len + 1);
+   ext_str = malloc(ext_str_len + 1);
    if (ext_str != NULL) {
       point = ext_str;
 
@@ -620,6 +625,16 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
       }
    }
 
+   /* This hack is necessary because GLX_ARB_create_context_profile depends on
+    * server support, but GLX_EXT_create_context_es2_profile is direct-only.
+    * Without this hack, it would be possible to advertise
+    * GLX_EXT_create_context_es2_profile without
+    * GLX_ARB_create_context_profile.  That would be a problem.
+    */
+   if (!IS_SET(server_support, ARB_create_context_profile_bit)) {
+      CLR_BIT(usable, EXT_create_context_es2_profile_bit);
+   }
+
    psc->effectiveGLXexts = __glXGetStringFromTable(known_glx_extensions,
                                                    usable);
 }