[Xquartz-changes] [293] AppleSGLX/trunk

source_changes at macosforge.org source_changes at macosforge.org
Sat Mar 7 15:04:23 PST 2009


Revision: 293
          http://trac.macosforge.org/projects/xquartz/changeset/293
Author:   gstaplin at apple.com
Date:     2009-03-07 15:04:22 -0800 (Sat, 07 Mar 2009)
Log Message:
-----------
Update the listing of defined extensions in glxext.h, based on further 
inspection of the ABI registry.  It seems I was right before, the 
extensions should be defined where available and implemented only.  I
was confused by a paragraph I read on this issue, that I thought
contradicted, which lead me to believe things had changed.

glxext.c: comment out some unhandled EXT/SGIX/OML config cases with #if 0.

include/GL/glxext.h: define many extensions to 0, and then undef 
these 0 defs.  This should prevent code using extensions from failing
to build, due to a lack of the implementation support functions for
those extensions.

glcontextmodes.c: Comment out unsupported extensions with #if 0.  This
allows us to build.

glxcmds.c: get the GLX_SGIX_fbconfig working properly.  These simple
changes should fix it.

glxextensions.c: change some Y to N for extensions we don't support.

With the default xorg-server-1.4-apple we now support:
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_rating, 
    GLX_SGIX_fbconfig


GLX_SGIX_fbconfig is used with some versions of glut.  I want to test this
a bit more, to verify that we don't have any regressions and it genuinely works.
Before the extension wasn't listed as available by glXQueryExtensionsString(),
but code could build with support for it.

ARB_multisample uses the same values for GLX_SAMPLES and GLX_SAMPLE_BUFFERS.

GLX_EXT_visual_rating gives us the Slow rating for some configs, which can 
be useful.

GLX_ARB_get_proc_address was made part of 1.4, but we keep the ARB around
for the many GLX-based apps that require it.

Modified Paths:
--------------
    AppleSGLX/trunk/glcontextmodes.c
    AppleSGLX/trunk/glx_empty.c
    AppleSGLX/trunk/glxcmds.c
    AppleSGLX/trunk/glxext.c
    AppleSGLX/trunk/glxextensions.c
    AppleSGLX/trunk/include/GL/glxext.h

Modified: AppleSGLX/trunk/glcontextmodes.c
===================================================================
--- AppleSGLX/trunk/glcontextmodes.c	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/glcontextmodes.c	2009-03-07 23:04:22 UTC (rev 293)
@@ -266,9 +266,12 @@
       case GLX_LEVEL:
 	*value_return = mode->level;
 	return 0;
+#if 0
+	/* This isn't supported by CGL. */
       case GLX_TRANSPARENT_TYPE_EXT:
 	*value_return = mode->transparentPixel;
 	return 0;
+#endif
       case GLX_TRANSPARENT_RED_VALUE:
 	*value_return = mode->transparentRed;
 	return 0;
@@ -314,6 +317,8 @@
       case GLX_MAX_PBUFFER_PIXELS:
 	*value_return = mode->maxPbufferPixels;
 	return 0;
+#if 0
+	/* These aren't supported by CGL. */
       case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
 	*value_return = mode->optimalPbufferWidth;
 	return 0;
@@ -323,10 +328,12 @@
       case GLX_SWAP_METHOD_OML:
 	*value_return = mode->swapMethod;
 	return 0;
-      case GLX_SAMPLE_BUFFERS_SGIS:
+#endif
+
+      case GLX_SAMPLE_BUFFERS:
 	*value_return = mode->sampleBuffers;
 	return 0;
-      case GLX_SAMPLES_SGIS:
+      case GLX_SAMPLES:
 	*value_return = mode->samples;
 	return 0;
       case GLX_BIND_TO_TEXTURE_RGB_EXT:
@@ -349,7 +356,10 @@
        * It is ONLY for communication between the GLX client and the GLX
        * server.
        */
+#if 0
+	/* Not supported by AppleSGLX. */
       case GLX_VISUAL_SELECT_GROUP_SGIX:
+#endif
 
       default:
 	return GLX_BAD_ATTRIBUTE;

Modified: AppleSGLX/trunk/glx_empty.c
===================================================================
--- AppleSGLX/trunk/glx_empty.c	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/glx_empty.c	2009-03-07 23:04:22 UTC (rev 293)
@@ -278,6 +278,55 @@
     return None;
 }
 
+#if 0
+/* GLX_SGIX_fbconfig */
+PUBLIC int glXGetFBConfigAttribSGIX (Display *dpy, void *config, int a, int *b) {
+     (void)dpy;
+     (void)config;
+     (void)a;
+     (void)b;
+     return 0;
+}
+
+PUBLIC void *glXChooseFBConfigSGIX(Display *dpy, int a, int *b, int *c) {
+    (void)dpy;
+    (void)a;
+    (void)b;
+    (void)c;
+    return NULL;
+}
+
+PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, void *config, Pixmap p) {
+    (void)dpy;
+    (void)config;
+    (void)p;
+    return None;
+}
+
+PUBLIC GLXContext glXCreateContextWithConfigSGIX (Display *dpy, void *config, int a, 
+						  GLXContext b, Bool c) {
+    (void)dpy;
+    (void)config;
+    (void)a;
+    (void)b;
+    (void)c;
+    return NULL;
+}
+
+PUBLIC XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, void *config) {
+    (void)dpy;
+    (void)config;
+    return NULL;
+}
+
+PUBLIC void *glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *visinfo) {
+    (void)dpy;
+    (void)visinfo;
+    return NULL;
+}
+#endif
+
+
 PUBLIC GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
 		      (Display *dpy, GLXDrawable pbuf),
 		      (dpy, pbuf),

Modified: AppleSGLX/trunk/glxcmds.c
===================================================================
--- AppleSGLX/trunk/glxcmds.c	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/glxcmds.c	2009-03-07 23:04:22 UTC (rev 293)
@@ -1043,11 +1043,6 @@
 
 PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
 {
-    static const char extstr[] = "GLX_ARB_get_proc_address ";
-
-    return extstr;
-    
-#if 0
     __GLXscreenConfigs *psc;
     __GLXdisplayPrivate *priv;
 
@@ -1072,7 +1067,6 @@
     }
 
     return psc->effectiveGLXexts;
-#endif
 }
 
 PUBLIC const char *glXGetClientString( Display *dpy, int name )
@@ -1502,6 +1496,12 @@
 	return None;
     }
 
+    if(apple_glx_pixmap_create(dpy, fbconfig->screen, pixmap, fbconfig))
+	return None;
+
+    return pixmap;
+
+
     psc = GetGLXScreenConfigs( dpy, fbconfig->screen );
     if ( (psc != NULL) 
 	 && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) {
@@ -1569,7 +1569,6 @@
     return NULL;
 }
 
-
 #if 0 /* AppleSGLX may someday need to support this for X11 OpenGL
 	 compositing managers. */
 /**

Modified: AppleSGLX/trunk/glxext.c
===================================================================
--- AppleSGLX/trunk/glxext.c	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/glxext.c	2009-03-07 23:04:22 UTC (rev 293)
@@ -404,24 +404,36 @@
 	  case GLX_MAX_PBUFFER_PIXELS:
 	    config->maxPbufferPixels = *bp++;
 	    break;
+#if 0
+	    /* We can't currently support these with CGL. */
 	  case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
 	    config->optimalPbufferWidth = *bp++;
 	    break;
 	  case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
 	    config->optimalPbufferHeight = *bp++;
 	    break;
+#endif
+#if 0 
+	    /* Not supported. */
           case GLX_VISUAL_SELECT_GROUP_SGIX:
 	    config->visualSelectGroup = *bp++;
 	    break;
+#endif
+#if 0
+	    /* Changing the swap method is not supported by Xplugin. */
 	  case GLX_SWAP_METHOD_OML:
 	    config->swapMethod = *bp++;
 	    break;
-	  case GLX_SAMPLE_BUFFERS_SGIS:
+#endif
+	    /* These 2 have the same values as the SGIS versions, and ARB. */
+	  case GLX_SAMPLE_BUFFERS:
 	    config->sampleBuffers = *bp++;
 	    break;
-	  case GLX_SAMPLES_SGIS:
+	  case GLX_SAMPLES:
 	    config->samples = *bp++;
 	    break;
+#if 0
+	    /*These are part of GLX_EXT_texture_from_pixmap */
 	  case GLX_BIND_TO_TEXTURE_RGB_EXT:
 	    config->bindToTextureRgb = *bp++;
 	    break;
@@ -437,6 +449,7 @@
 	  case GLX_Y_INVERTED_EXT:
 	    config->yInverted = *bp++;
 	    break;
+#endif
 	  case None:
 	    i = count;
 	    break;

Modified: AppleSGLX/trunk/glxextensions.c
===================================================================
--- AppleSGLX/trunk/glxextensions.c	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/glxextensions.c	2009-03-07 23:04:22 UTC (rev 293)
@@ -74,34 +74,34 @@
    { 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 },
-   { GLX(EXT_import_context),          VER(0,0), Y, Y, N, N },
-   { GLX(EXT_visual_info),             VER(0,0), Y, Y, N, N },
+   { GLX(EXT_import_context),          VER(0,0), N, N, N, N },
+   { GLX(EXT_visual_info),             VER(0,0), N, N, N, N },
    { GLX(EXT_visual_rating),           VER(0,0), Y, Y, N, N },
-   { GLX(MESA_agp_offset),             VER(0,0), N, N, N, Y }, /* Deprecated */
-   { GLX(MESA_allocate_memory),        VER(0,0), Y, N, N, Y },
-   { GLX(MESA_copy_sub_buffer),        VER(0,0), Y, N, N, N },
+   { 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 },
    { GLX(MESA_pixmap_colormap),        VER(0,0), N, N, N, N }, /* Deprecated */
    { GLX(MESA_release_buffers),        VER(0,0), N, N, N, N }, /* Deprecated */
-   { GLX(MESA_swap_control),           VER(0,0), Y, N, N, Y },
-   { GLX(MESA_swap_frame_usage),       VER(0,0), Y, N, N, Y },
+   { GLX(MESA_swap_control),           VER(0,0), N, N, N, N },
+   { GLX(MESA_swap_frame_usage),       VER(0,0), N, N, N, N },
    { 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 },
-   { 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 },
+   { 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 },
    { GLX(SGIS_blended_overlay),        VER(0,0), N, N, N, N },
    { GLX(SGIS_color_range),            VER(0,0), N, N, N, N },
-   { GLX(SGIS_multisample),            VER(0,0), Y, Y, N, N },
+   { GLX(SGIS_multisample),            VER(0,0), N, N, N, N },
    { GLX(SGIX_fbconfig),               VER(1,3), Y, Y, N, N },
-   { GLX(SGIX_pbuffer),                VER(1,3), Y, N, N, N },
+   { GLX(SGIX_pbuffer),                VER(1,3), N, N, N, N },
    { GLX(SGIX_swap_barrier),           VER(0,0), N, N, N, N },
    { GLX(SGIX_swap_group),             VER(0,0), N, N, N, N },
-   { GLX(SGIX_visual_select_group),    VER(0,0), Y, Y, N, N },
-   { GLX(EXT_texture_from_pixmap),     VER(0,0), Y, N, N, N },
+   { GLX(SGIX_visual_select_group),    VER(0,0), N, N, N, N },
+   { GLX(EXT_texture_from_pixmap),     VER(0,0), N, N, N, N },
    { NULL }
 };
 

Modified: AppleSGLX/trunk/include/GL/glxext.h
===================================================================
--- AppleSGLX/trunk/include/GL/glxext.h	2009-03-07 14:15:44 UTC (rev 292)
+++ AppleSGLX/trunk/include/GL/glxext.h	2009-03-07 23:04:22 UTC (rev 293)
@@ -28,6 +28,41 @@
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
 
+#define GLX_ARB_fbconfig_float 0
+#define GLX_EXT_visual_info 0
+#define GLX_EXT_import_context 0
+#define GLX_SGIS_shared_multisample 0
+#define GLX_SGIX_visual_select_group 0
+#define GLX_NV_present_video 0
+#define GLX_EXT_framebuffer_sRGB 0
+#define GLX_EXT_fbconfig_packed_float 0
+#define GLX_NV_float_buffer 0
+#define GLX_MESA_release_buffers 0
+#define GLX_SGIS_blended_overlay 0
+#define GLX_ARB_create_context 0
+#define GLX_SGIX_pbuffer 0
+#define GLX_SGIX_dmbuffer 0
+#define GLX_SGI_swap_control 0
+#define GLX_SGI_video_sync 0
+#define GLX_SGI_make_current_read 0
+#define GLX_SGIX_hyperpipe 0
+#define GLX_MESA_pixmap_colormap 0
+#define GLX_NV_video_out 0
+#define GLX_MESA_set_3dfx_mode 0
+#define GLX_3DFX_multisample 0
+#define GLX_SGIX_swap_group 0
+#define GLX_SGIX_video_source 0
+#define GLX_NV_swap_group 0
+#define GLX_EXT_texture_from_pixmap 0
+#define GLX_OML_swap_method 0
+#define GLX_MESA_copy_sub_buffer 0
+#define GLX_SGIX_video_resize 0
+#define GLX_MESA_agp_offset 0
+#define GLX_SGIX_swap_barrier 0
+#define GLX_SGI_cushion 0
+#define GLX_OML_sync_control 0
+#define GLX_SUN_get_transparent_index 0
+
 #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
 #define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
@@ -825,6 +860,40 @@
 #define GLX_NV_swap_group 1
 #endif
 
+#undef GLX_ARB_fbconfig_float
+#undef GLX_EXT_visual_info
+#undef GLX_EXT_import_context
+#undef GLX_SGIS_shared_multisample
+#undef GLX_SGIX_visual_select_group
+#undef GLX_NV_present_video
+#undef GLX_EXT_framebuffer_sRGB
+#undef GLX_EXT_fbconfig_packed_float
+#undef GLX_NV_float_buffer
+#undef GLX_MESA_release_buffers
+#undef GLX_SGIS_blended_overlay
+#undef GLX_ARB_create_context
+#undef GLX_SGIX_pbuffer
+#undef GLX_SGIX_dmbuffer
+#undef GLX_SGI_swap_control
+#undef GLX_SGI_video_sync
+#undef GLX_SGI_make_current_read
+#undef GLX_SGIX_hyperpipe
+#undef GLX_MESA_pixmap_colormap
+#undef GLX_NV_video_out
+#undef GLX_MESA_set_3dfx_mode
+#undef GLX_3DFX_multisample
+#undef GLX_SGIX_swap_group
+#undef GLX_SGIX_video_source
+#undef GLX_NV_swap_group
+#undef GLX_EXT_texture_from_pixmap
+#undef GLX_OML_swap_method
+#undef GLX_MESA_copy_sub_buffer
+#undef GLX_SGIX_video_resize
+#undef GLX_MESA_agp_offset
+#undef GLX_SGIX_swap_barrier
+#undef GLX_SGI_cushion
+#undef GLX_OML_sync_control
+#undef GLX_SUN_get_transparent_index
 
 #ifdef __cplusplus
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/xquartz-changes/attachments/20090307/fabbc4a2/attachment-0001.html>


More information about the Xquartz-changes mailing list