[PATCH 0/8] Attempt to fix GLX for OSX

Jon TURNEY jon.turney at dronecode.org.uk
Fri Dec 6 06:19:36 PST 2013


On 03/12/2013 20:14, Adam Jackson wrote:
> This fixes up the indirect glx code to only call-by-name those symbols
> present in the Linux OpenGL ABI, which corresponds to OpenGL 1.2.1.
> Since that was available even on OSX 10.0 this should be sufficient for
> xquartz as well.

When testing my code generator for the stubs I'm going to need, I notice that
after these changes, we still link directly with glGetCompressedTexImage().

I'm not sure that GL_ARB_texture_compression is in OpenGL 1.2.1, but maybe I
am looking at the wrong thing.

There's also a consistency issue with ARB_multitexture functions, sometimes
the ARB-suffixed name is used and sometimes not, e.g. glMultiTexCoord1fvARB
and glMultiTexCoord1dv.

Attached is a patch to consistently use the ARB-suffixed name, which I think
is the one definitively in the OpenGL 1.2.1 ABI.

1 to 7, Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
8 looks correct but only Jeremy can tell you if it works :D

-------------- next part --------------
>From a5d7a5e9793b49d47eb1e0448ae5d9e23a5c642a Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Fri, 6 Dec 2013 14:00:21 +0000
Subject: [PATCH] Consistently use ARB-suffixed names for ARB_multitexture
 functions

At the moment we have a mix of ARB and non-ARB suffixed forms for ARB_multitexture functions
e.g. glMultiTexCoord1fvARB and glMultiTexCoord1dv

Consistently use the ARB-suffixed form, as that is the one present in the linux
OpenGL 1.2.1 ABI

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 glx/indirect_dispatch.c      | 26 ++++++++--------
 glx/indirect_dispatch_swap.c | 72 ++++++++++++++++++++++----------------------
 2 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/glx/indirect_dispatch.c b/glx/indirect_dispatch.c
index a50f285..38ddd65 100644
--- a/glx/indirect_dispatch.c
+++ b/glx/indirect_dispatch.c
@@ -3460,7 +3460,7 @@ __glXDisp_CopyTexSubImage3D(GLbyte * pc)
 void
 __glXDisp_ActiveTexture(GLbyte * pc)
 {
-    glActiveTexture(*(GLenum *) (pc + 0));
+    glActiveTextureARB(*(GLenum *) (pc + 0));
 }
 
 void
@@ -3473,7 +3473,7 @@ __glXDisp_MultiTexCoord1dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord1dv(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0));
+    glMultiTexCoord1dvARB(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0));
 }
 
 void
@@ -3485,13 +3485,13 @@ __glXDisp_MultiTexCoord1fvARB(GLbyte * pc)
 void
 __glXDisp_MultiTexCoord1iv(GLbyte * pc)
 {
-    glMultiTexCoord1iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
+    glMultiTexCoord1ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
 }
 
 void
 __glXDisp_MultiTexCoord1sv(GLbyte * pc)
 {
-    glMultiTexCoord1sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
+    glMultiTexCoord1svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
 }
 
 void
@@ -3504,7 +3504,7 @@ __glXDisp_MultiTexCoord2dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord2dv(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0));
+    glMultiTexCoord2dvARB(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0));
 }
 
 void
@@ -3516,13 +3516,13 @@ __glXDisp_MultiTexCoord2fvARB(GLbyte * pc)
 void
 __glXDisp_MultiTexCoord2iv(GLbyte * pc)
 {
-    glMultiTexCoord2iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
+    glMultiTexCoord2ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
 }
 
 void
 __glXDisp_MultiTexCoord2sv(GLbyte * pc)
 {
-    glMultiTexCoord2sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
+    glMultiTexCoord2svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
 }
 
 void
@@ -3535,7 +3535,7 @@ __glXDisp_MultiTexCoord3dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord3dv(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0));
+    glMultiTexCoord3dvARB(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0));
 }
 
 void
@@ -3547,13 +3547,13 @@ __glXDisp_MultiTexCoord3fvARB(GLbyte * pc)
 void
 __glXDisp_MultiTexCoord3iv(GLbyte * pc)
 {
-    glMultiTexCoord3iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
+    glMultiTexCoord3ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
 }
 
 void
 __glXDisp_MultiTexCoord3sv(GLbyte * pc)
 {
-    glMultiTexCoord3sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
+    glMultiTexCoord3svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
 }
 
 void
@@ -3566,7 +3566,7 @@ __glXDisp_MultiTexCoord4dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord4dv(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0));
+    glMultiTexCoord4dvARB(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0));
 }
 
 void
@@ -3578,13 +3578,13 @@ __glXDisp_MultiTexCoord4fvARB(GLbyte * pc)
 void
 __glXDisp_MultiTexCoord4iv(GLbyte * pc)
 {
-    glMultiTexCoord4iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
+    glMultiTexCoord4ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
 }
 
 void
 __glXDisp_MultiTexCoord4sv(GLbyte * pc)
 {
-    glMultiTexCoord4sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
+    glMultiTexCoord4svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
 }
 
 void
diff --git a/glx/indirect_dispatch_swap.c b/glx/indirect_dispatch_swap.c
index 0d2dbf7..9f888b9 100644
--- a/glx/indirect_dispatch_swap.c
+++ b/glx/indirect_dispatch_swap.c
@@ -3821,7 +3821,7 @@ __glXDispSwap_CopyTexSubImage3D(GLbyte * pc)
 void
 __glXDispSwap_ActiveTexture(GLbyte * pc)
 {
-    glActiveTexture((GLenum) bswap_ENUM(pc + 0));
+    glActiveTextureARB((GLenum) bswap_ENUM(pc + 0));
 }
 
 void
@@ -3834,8 +3834,8 @@ __glXDispSwap_MultiTexCoord1dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord1dv((GLenum) bswap_ENUM(pc + 8),
-                       (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
+    glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8),
+                          (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
                                                          1));
 }
 
@@ -3850,17 +3850,17 @@ __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc)
 void
 __glXDispSwap_MultiTexCoord1iv(GLbyte * pc)
 {
-    glMultiTexCoord1iv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
-                                                      1));
+    glMultiTexCoord1ivARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
+                                                         1));
 }
 
 void
 __glXDispSwap_MultiTexCoord1sv(GLbyte * pc)
 {
-    glMultiTexCoord1sv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
-                                                        1));
+    glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
+                                                           1));
 }
 
 void
@@ -3873,9 +3873,9 @@ __glXDispSwap_MultiTexCoord2dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord2dv((GLenum) bswap_ENUM(pc + 16),
-                       (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
-                                                         2));
+    glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16),
+                          (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
+                                                            2));
 }
 
 void
@@ -3889,17 +3889,17 @@ __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc)
 void
 __glXDispSwap_MultiTexCoord2iv(GLbyte * pc)
 {
-    glMultiTexCoord2iv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
-                                                      2));
+    glMultiTexCoord2ivARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
+                                                         2));
 }
 
 void
 __glXDispSwap_MultiTexCoord2sv(GLbyte * pc)
 {
-    glMultiTexCoord2sv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
-                                                        2));
+    glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
+                                                           2));
 }
 
 void
@@ -3912,9 +3912,9 @@ __glXDispSwap_MultiTexCoord3dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord3dv((GLenum) bswap_ENUM(pc + 24),
-                       (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
-                                                         3));
+    glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24),
+                          (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
+                                                            3));
 }
 
 void
@@ -3928,17 +3928,17 @@ __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc)
 void
 __glXDispSwap_MultiTexCoord3iv(GLbyte * pc)
 {
-    glMultiTexCoord3iv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
-                                                      3));
+    glMultiTexCoord3ivARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
+                                                         3));
 }
 
 void
 __glXDispSwap_MultiTexCoord3sv(GLbyte * pc)
 {
-    glMultiTexCoord3sv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
-                                                        3));
+    glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
+                                                           3));
 }
 
 void
@@ -3951,9 +3951,9 @@ __glXDispSwap_MultiTexCoord4dv(GLbyte * pc)
     }
 #endif
 
-    glMultiTexCoord4dv((GLenum) bswap_ENUM(pc + 32),
-                       (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
-                                                         4));
+    glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32),
+                          (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0),
+                                                            4));
 }
 
 void
@@ -3967,17 +3967,17 @@ __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc)
 void
 __glXDispSwap_MultiTexCoord4iv(GLbyte * pc)
 {
-    glMultiTexCoord4iv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
-                                                      4));
+    glMultiTexCoord4ivARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLint *) bswap_32_array((uint32_t *) (pc + 4),
+                                                         4));
 }
 
 void
 __glXDispSwap_MultiTexCoord4sv(GLbyte * pc)
 {
-    glMultiTexCoord4sv((GLenum) bswap_ENUM(pc + 0),
-                       (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
-                                                        4));
+    glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0),
+                          (const GLshort *) bswap_16_array((uint16_t *) (pc + 4),
+                                                           4));
 }
 
 void
-- 
1.8.3.4



More information about the xorg-devel mailing list