X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fglxextensions.c;h=9332e61b427dff948b257f579179d4812854a0cb;hb=df0de9320684be29d45121a06de2fa64328eadaf;hp=e58c296b30945283742e27cecd0001c5bd59d909;hpb=0594cf70883b64692ba617d85f4f9b4e636e5c2b;p=mesa.git diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c index e58c296b309..9332e61b427 100644 --- a/src/glx/glxextensions.c +++ b/src/glx/glxextensions.c @@ -71,77 +71,34 @@ struct extension_info /* *INDENT-OFF* */ 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_get_proc_address), VER(1,4), Y, N, Y, N }, { GLX(ARB_multisample), VER(1,4), Y, Y, N, N }, - { GLX(ARB_render_texture), VER(0,0), N, N, N, N }, { GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(EXT_import_context), VER(0,0), N, N, N, N }, - { GLX(EXT_visual_info), VER(0,0), N, N, N, N }, -#else { GLX(EXT_import_context), VER(0,0), Y, Y, N, N }, { GLX(EXT_visual_info), VER(0,0), Y, Y, N, N }, -#endif { GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(MESA_agp_offset), VER(0,0), N, N, N, N }, /* Deprecated */ - { GLX(MESA_allocate_memory), VER(0,0), N, N, N, N }, - { GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, -#else - { GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */ - { GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y }, + { 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 }, -#endif - { GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */ - { GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */ -#ifdef GLX_USE_APPLEGL - { GLX(MESA_swap_control), VER(0,0), N, N, N, N }, - { GLX(MESA_swap_frame_usage), VER(0,0), N, N, N, N }, -#else + { GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, Y, N }, { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y }, - { GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y }, -#endif { GLX(NV_float_buffer), VER(0,0), N, N, N, N }, - { GLX(NV_render_depth_texture), VER(0,0), N, N, N, N }, - { GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(NV_vertex_array_range), VER(0,0), N, N, N, N }, /* Deprecated */ - { GLX(OML_swap_method), VER(0,0), N, N, N, N }, - { GLX(OML_sync_control), VER(0,0), N, N, N, N }, - { GLX(SGI_make_current_read), VER(1,3), N, N, N, N }, - { GLX(SGI_swap_control), VER(0,0), N, N, N, N }, - { GLX(SGI_video_sync), VER(0,0), N, N, N, N }, -#else - { GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */ { GLX(OML_swap_method), VER(0,0), Y, Y, N, N }, { GLX(OML_sync_control), VER(0,0), Y, N, N, Y }, { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N }, { GLX(SGI_swap_control), VER(0,0), Y, N, N, N }, { GLX(SGI_video_sync), VER(0,0), Y, N, N, Y }, -#endif - { GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N }, - { GLX(SGIS_color_range), VER(0,0), N, N, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(SGIS_multisample), VER(0,0), N, N, N, N }, -#else { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N }, -#endif { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(SGIX_pbuffer), VER(1,3), N, N, N, N }, -#else { GLX(SGIX_pbuffer), VER(1,3), Y, Y, N, N }, -#endif { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, -#ifdef GLX_USE_APPLEGL - { GLX(SGIX_visual_select_group), VER(0,0), N, N, N, N }, - { GLX(EXT_texture_from_pixmap), VER(0,0), N, N, N, N }, -#else { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N }, { GLX(EXT_texture_from_pixmap), VER(0,0), Y, N, N, N }, -#endif - { GLX(INTEL_swap_event), VER(1,4), Y, Y, N, N }, + { GLX(INTEL_swap_event), VER(0,0), Y, N, N, N }, { NULL } }; @@ -169,6 +126,7 @@ static const struct extension_info known_gl_extensions[] = { { GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N }, { GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N }, { GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N }, + { GL(ARB_texture_rg), VER(0,0), Y, N, N, N }, { GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N }, { GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N }, { GL(ARB_vertex_program), VER(0,0), Y, N, N, N }, @@ -192,6 +150,7 @@ static const struct extension_info known_gl_extensions[] = { { GL(EXT_framebuffer_blit), VER(0,0), Y, N, N, N }, { GL(EXT_framebuffer_multisample), VER(0,0), Y, N, N, N }, { GL(EXT_framebuffer_object), VER(0,0), Y, N, N, N }, + { GL(EXT_framebuffer_sRGB), VER(0,0), Y, N, N, N }, { GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N }, { GL(EXT_packed_depth_stencil), VER(0,0), Y, N, N, N }, { GL(EXT_packed_pixels), VER(1,2), Y, N, N, N }, @@ -316,7 +275,7 @@ static const unsigned gl_minor = 4; static const char *__glXGLXClientExtensions = NULL; static void __glXExtensionsCtr(void); -static void __glXExtensionsCtrScreen(__GLXscreenConfigs * psc); +static void __glXExtensionsCtrScreen(struct glx_screen * psc); static void __glXProcessServerString(const struct extension_info *ext, const char *server_string, unsigned char *server_support); @@ -400,7 +359,7 @@ __glXProcessServerString(const struct extension_info *ext, } void -__glXEnableDirectExtension(__GLXscreenConfigs * psc, const char *name) +__glXEnableDirectExtension(struct glx_screen * psc, const char *name) { __glXExtensionsCtr(); __glXExtensionsCtrScreen(psc); @@ -478,7 +437,7 @@ __glXExtensionsCtr(void) */ static void -__glXExtensionsCtrScreen(__GLXscreenConfigs * psc) +__glXExtensionsCtrScreen(struct glx_screen * psc) { if (psc->ext_list_first_time) { psc->ext_list_first_time = GL_FALSE; @@ -498,7 +457,7 @@ __glXExtensionsCtrScreen(__GLXscreenConfigs * psc) * \c NULL, then \c GL_FALSE is returned. */ GLboolean -__glXExtensionBitIsEnabled(__GLXscreenConfigs * psc, unsigned bit) +__glXExtensionBitIsEnabled(struct glx_screen * psc, unsigned bit) { GLboolean enabled = GL_FALSE; @@ -517,7 +476,7 @@ __glXExtensionBitIsEnabled(__GLXscreenConfigs * psc, unsigned bit) * */ GLboolean -__glExtensionBitIsEnabled(const __GLXcontext * gc, unsigned bit) +__glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit) { GLboolean enabled = GL_FALSE; @@ -550,7 +509,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; @@ -598,7 +557,7 @@ __glXGetClientExtensions(void) */ void -__glXCalculateUsableExtensions(__GLXscreenConfigs * psc, +__glXCalculateUsableExtensions(struct glx_screen * psc, GLboolean display_is_direct_capable, int minor_version) { @@ -619,7 +578,7 @@ __glXCalculateUsableExtensions(__GLXscreenConfigs * psc, * support for GLX 1.3, enable support for the extensions that can be * "emulated" as well. */ - +#ifndef GLX_USE_APPLEGL if (minor_version >= 3) { SET_BIT(server_support, EXT_visual_info_bit); SET_BIT(server_support, EXT_visual_rating_bit); @@ -635,7 +594,7 @@ __glXCalculateUsableExtensions(__GLXscreenConfigs * psc, SET_BIT(server_support, EXT_import_context_bit); } - +#endif /* An extension is supported if the client-side (i.e., libGL) supports * it and the "server" supports it. In this case that means that either @@ -663,6 +622,16 @@ __glXCalculateUsableExtensions(__GLXscreenConfigs * 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); } @@ -679,7 +648,7 @@ __glXCalculateUsableExtensions(__GLXscreenConfigs * psc, */ void -__glXCalculateUsableGLExtensions(__GLXcontext * gc, +__glXCalculateUsableGLExtensions(struct glx_context * gc, const char *server_string, int major_version, int minor_version) {