xserver/GL/mesa/X compsize.c, 1.11, NONE xf86glx.c, 1.6, 1.7 xf86glxint.h, 1.3, 1.4

Dave Airlie xserver-commit at pdx.freedesktop.org
Thu Dec 22 18:08:00 PST 2005


Committed by: airlied

Update of /cvs/xserver/xserver/GL/mesa/X
In directory gabe:/tmp/cvs-serv19869/GL/mesa/X

Modified Files:
	xf86glx.c xf86glxint.h 
Removed Files:
	compsize.c 
Log Message:
Well there were a couple of snapshots later than CVS available outside of 
Novell, so I've done a crazy merge to try and get them into a workable 
CVS, I suspect I may have failed.. there is a pre-xgldrop-merge tag if I did.


--- compsize.c DELETED ---

Index: xf86glx.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/mesa/X/xf86glx.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xf86glx.c	23 Jun 2005 10:45:13 -0000	1.6
+++ xf86glx.c	23 Dec 2005 02:07:57 -0000	1.7
@@ -410,38 +410,28 @@
     glSecondaryColorPointerEXT,
     glPointParameteriNV,
     glPointParameterivNV,
-    glActiveStencilFaceEXT
-};
-
-/*
- * This structure is statically allocated in the __glXScreens[]
- * structure.  This struct is not used anywhere other than in
- * __glXScreenInit to initialize each of the active screens
- * (__glXActiveScreens[]).  Several of the fields must be initialized by
- * the screenProbe routine before they are copied to the active screens
- * struct.  In particular, the contextCreate, pGlxVisual, numVisuals,
- * and numUsableVisuals fields must be initialized.
- */
-__GLXscreenInfo __glDDXScreenInfo = {
-    __MESA_screenProbe,   /* Must be generic and handle all screens */
-    __MESA_createContext, /* Substitute screen's createContext routine */
-    __MESA_createBuffer,  /* Substitute screen's createBuffer routine */
-    NULL,                 /* Set up pGlxVisual in probe */
-    NULL,                 /* Set up pVisualPriv in probe */
-    0,                    /* Set up numVisuals in probe */
-    0,                    /* Set up numUsableVisuals in probe */
-    "Vendor String",      /* GLXvendor is overwritten by __glXScreenInit */
-    "Version String",     /* GLXversion is overwritten by __glXScreenInit */
-    "Extensions String",  /* GLXextensions is overwritten by __glXScreenInit */
-    NULL                  /* WrappedPositionWindow is overwritten */
+    glActiveStencilFaceEXT,
+    glIsRenderbufferEXT,
+    glBindRenderbufferEXT,
+    glDeleteRenderbuffersEXT,
+    glGenRenderbuffersEXT,
+    glRenderbufferStorageEXT,
+    glGetRenderbufferParameterivEXT,
+    glIsFramebufferEXT,
+    glBindFramebufferEXT,
+    glDeleteFramebuffersEXT,
+    glGenFramebuffersEXT,
+    glCheckFramebufferStatusEXT,
+    glFramebufferTexture1DEXT,
+    glFramebufferTexture2DEXT,
+    glFramebufferTexture3DEXT,
+    glFramebufferRenderbufferEXT,
+    glGetFramebufferAttachmentParameterivEXT,
+    glGenerateMipmapEXT
 };
 
-__GLXextensionInfo __glDDXExtensionInfo = {
-    GL_CORE_MESA,
-    __MESA_resetExtension,
-    __MESA_initVisuals,
-    __MESA_setVisualConfigs
-};
+extern __GLXextensionInfo __glDDXExtensionInfo;
+extern __GLXscreenInfo __glDDXScreenInfo;
 
 static __MESA_screen  MESAScreens[MAXSCREENS];
 static __GLcontext   *MESA_CC        = NULL;
@@ -590,6 +580,74 @@
   },
 };
 
+void *
+__glXMalloc(size_t size)
+{
+    void *addr;
+
+    if (size == 0) {
+	return NULL;
+    }
+    addr = (void *) xalloc(size);
+    if (addr == NULL) {
+	/* XXX: handle out of memory error */
+	return NULL;
+    }
+    return addr;
+}
+
+void *
+__glXCalloc(size_t numElements, size_t elementSize)
+{
+    void *addr;
+    size_t size;
+
+    if ((numElements == 0) || (elementSize == 0)) {
+	return NULL;
+    }
+    size = numElements * elementSize;
+    addr = (void *) xalloc(size);
+    if (addr == NULL) {
+	/* XXX: handle out of memory error */
+	return NULL;
+    }
+    __glXMemset(addr, 0, size);
+    return addr;
+}
+
+void *
+__glXRealloc(void *addr, size_t newSize)
+{
+    void *newAddr;
+
+    if (addr) {
+	if (newSize == 0) {
+	    xfree(addr);
+	    return NULL;
+	} else {
+	    newAddr = xrealloc(addr, newSize);
+	}
+    } else {
+	if (newSize == 0) {
+	    return NULL;
+	} else {
+	    newAddr = xalloc(newSize);
+	}
+    }
+    if (newAddr == NULL) {
+	return NULL;	/* XXX: out of memory */
+    }
+
+    return newAddr;
+}
+
+void
+__glXFree(void *addr)
+{
+    if (addr) {
+	xfree(addr);
+    }
+}
 
 static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
 			 VisualID *defaultVisp,
@@ -977,9 +1035,6 @@
      */
     init_screen_visuals(screen);
 
-    __glRenderTable = &__glMesaRenderTable;
-    __glRenderTableEXT = &__glMesaRenderTableEXT;
-
     return TRUE;
 }
 
@@ -1155,7 +1210,7 @@
 {
     XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
     MESA_CC = NULL;
-    __glXLastContext = NULL;
+    GlxFlushContextCache ();
     return XMesaLoseCurrent(xmesa);
 }
 
@@ -1192,6 +1247,7 @@
 {
     XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
     MESA_CC = gc;
+    GlxSetRenderTables (&__glMesaRenderTable, &__glMesaRenderTableEXT);
     return XMesaForceCurrent(xmesa);
 }
 
@@ -1234,51 +1290,3 @@
     ErrorF("__MESA_endDispatchOverride\n");
     return;
 }
-
-
-/*
- * Server-side GLX uses these functions which are normally defined
- * in the OpenGL SI.
- */
-
-GLint __glEvalComputeK(GLenum target)
-{
-    switch (target) {
-    case GL_MAP1_VERTEX_4:
-    case GL_MAP1_COLOR_4:
-    case GL_MAP1_TEXTURE_COORD_4:
-    case GL_MAP2_VERTEX_4:
-    case GL_MAP2_COLOR_4:
-    case GL_MAP2_TEXTURE_COORD_4:
-	return 4;
-    case GL_MAP1_VERTEX_3:
-    case GL_MAP1_TEXTURE_COORD_3:
-    case GL_MAP1_NORMAL:
-    case GL_MAP2_VERTEX_3:
-    case GL_MAP2_TEXTURE_COORD_3:
-    case GL_MAP2_NORMAL:
-	return 3;
-    case GL_MAP1_TEXTURE_COORD_2:
-    case GL_MAP2_TEXTURE_COORD_2:
-	return 2;
-    case GL_MAP1_TEXTURE_COORD_1:
-    case GL_MAP2_TEXTURE_COORD_1:
-    case GL_MAP1_INDEX:
-    case GL_MAP2_INDEX:
-	return 1;
-    default:
-	return 0;
-    }
-}
-
-GLuint __glFloorLog2(GLuint val)
-{
-    int c = 0;
-
-    while (val > 1) {
-	c++;
-	val >>= 1;
-    }
-    return c;
-}
-

Index: xf86glxint.h
===================================================================
RCS file: /cvs/xserver/xserver/GL/mesa/X/xf86glxint.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xf86glxint.h	10 Jun 2005 12:30:39 -0000	1.3
+++ xf86glxint.h	23 Dec 2005 02:07:57 -0000	1.4
@@ -106,23 +106,4 @@
 extern void __MESA_beginDispatchOverride(__GLcontext *gc);
 extern void __MESA_endDispatchOverride(__GLcontext *gc);
 
-extern GLint __glCallLists_size(GLsizei n, GLenum type);
-extern GLint __glEvalComputeK(GLenum target);
-extern GLuint __glFloorLog2(GLuint val);
-extern GLint __glFogfv_size(GLenum pname);
-extern GLint __glFogiv_size(GLenum pname);
-extern GLint __glLightModelfv_size(GLenum pname);
-extern GLint __glLightModeliv_size(GLenum pname);
-extern GLint __glLightfv_size(GLenum pname);
-extern GLint __glLightiv_size(GLenum pname);
-extern GLint __glMaterialfv_size(GLenum pname);
-extern GLint __glMaterialiv_size(GLenum pname);
-extern GLint __glTexEnvfv_size(GLenum pname);
-extern GLint __glTexEnviv_size(GLenum pname);
-extern GLint __glTexGendv_size(GLenum pname);
-extern GLint __glTexGenfv_size(GLenum pname);
-extern GLint __glTexGeniv_size(GLenum pname);
-extern GLint __glTexParameterfv_size(GLenum pname);
-extern GLint __glTexParameteriv_size(GLenum pname);
-
 #endif /* _XF86GLXINT_H_ */



More information about the xserver-commit mailing list