[Mesa-dev] how "client glx extensions" and "GLX extensions" are determined (and how best to limit them)
Jeremy Huddleston Sequoia
jeremyhu at freedesktop.org
Sun Jun 1 17:49:00 PDT 2014
I'm trying to take a stab at adding core profile support to XQuartz. As a first step, I'm trying to add GLX_ARB_create_context and GLX_ARB_create_context_profile.
For now, I want to make sure that GLX_ARB_create_context and GLX_ARB_create_context_profile are only advertised as being available when in a testing mode (so as to not enable breakage by default while working on these changes). To this end, I'm the following to applegl_create_screen:
@@ -183,6 +191,12 @@ applegl_create_screen(int screen, struct glx_display * priv)
glx_screen_init(psc, screen, priv);
psc->vtable = &applegl_screen_vtable;
+ /* Testing support for core profiles is guarded by an envvar for now */
+ if (getenv("LIBGL_PROFILE_CORE")) {
+ __glXEnableDirectExtension(psc, "GLX_ARB_create_context");
+ __glXEnableDirectExtension(psc, "GLX_ARB_create_context_profile");
+ }
+
return psc;
}
The goal of this change is that these extensions would only be advertised as available to clients if they set the LIBGL_PROFILE_CORE environment variable. Unfortunately, it seems that GLX_ARB_create_context and GLX_ARB_create_context_profile are always advertised on current mesa. __glXExtensionsCtr sets them up as client supported (but not direct supported) by default, so I'm confused why they're being listed as available GLX extensions when using direct rendering. Can someone fill me in on how to best prevent GLX_ARB_create_context and GLX_ARB_create_context_profile from being advertised (short of adding more #ifdef GLX_USE_APPLEGL)?
Thanks,
Jeremy
(lldb) print known_glx_extensions
(const extension_info [34]) $2 = {
[0] = {
name = 0x00000001004896b4 "GLX_ARB_create_context"
name_len = 22
bit = '\0'
version_major = '\0'
version_minor = '\0'
client_support = '\x01'
direct_support = '\0'
client_only = '\0'
direct_only = '\0'
}
[1] = {
name = 0x000000010048aa82 "GLX_ARB_create_context_profile"
name_len = 30
bit = '\x01'
version_major = '\0'
version_minor = '\0'
client_support = '\x01'
direct_support = '\0'
client_only = '\0'
direct_only = '\0'
}
display: /tmp/launch-l5xfi8/org.macosforge.xquartz:0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_OML_swap_method, GLX_SGIS_multisample,
GLX_SGIX_fbconfig
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap,
GLX_INTEL_swap_event, GLX_EXT_buffer_age
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_visual_info, GLX_EXT_visual_rating,
GLX_MESA_multithread_makecurrent, GLX_OML_swap_method,
GLX_SGIS_multisample, GLX_SGIX_fbconfig
OpenGL vendor string: ATI Technologies Inc.
More information about the mesa-dev
mailing list