Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / dri / tdfx / tdfx_screen.c
index 2eb0024d40b7c737992dccb504565021beba197c..084560ff87dfb1387df464ad6e9c37cd5dd918f0 100644 (file)
@@ -36,9 +36,7 @@
 #include "tdfx_dri.h"
 #include "tdfx_context.h"
 #include "tdfx_lock.h"
-#include "tdfx_vb.h"
 #include "tdfx_span.h"
-#include "tdfx_tris.h"
 
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
@@ -70,7 +68,7 @@ static const __DRIextension *tdfxExtensions[] = {
 static const GLuint __driNConfigOptions = 1;
 
 static GLboolean
-tdfxCreateScreen( __DRIscreenPrivate *sPriv )
+tdfxCreateScreen( __DRIscreen *sPriv )
 {
    tdfxScreenPrivate *fxScreen;
    TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
@@ -121,7 +119,7 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
 
 
 static void
-tdfxDestroyScreen( __DRIscreenPrivate *sPriv )
+tdfxDestroyScreen( __DRIscreen *sPriv )
 {
    tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private;
 
@@ -139,7 +137,7 @@ tdfxDestroyScreen( __DRIscreenPrivate *sPriv )
 
 
 static GLboolean
-tdfxInitDriver( __DRIscreenPrivate *sPriv )
+tdfxInitDriver( __DRIscreen *sPriv )
 {
    if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
       fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)sPriv );
@@ -155,9 +153,9 @@ tdfxInitDriver( __DRIscreenPrivate *sPriv )
 
 
 static GLboolean
-tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
-                  __DRIdrawablePrivate *driDrawPriv,
-                  const __GLcontextModes *mesaVis,
+tdfxCreateBuffer( __DRIscreen *driScrnPriv,
+                  __DRIdrawable *driDrawPriv,
+                  const struct gl_config *mesaVis,
                   GLboolean isPixmap )
 {
    tdfxScreenPrivate *screen = (tdfxScreenPrivate *) driScrnPriv->private;
@@ -227,25 +225,25 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
 
 
 static void
-tdfxDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
+tdfxDestroyBuffer(__DRIdrawable *driDrawPriv)
 {
-   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+   _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 }
 
 
 static void
-tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
+tdfxSwapBuffers( __DRIdrawable *driDrawPriv )
 
 {
    GET_CURRENT_CONTEXT(ctx);
    tdfxContextPtr fxMesa = 0;
-   GLframebuffer *mesaBuffer;
+   struct gl_framebuffer *mesaBuffer;
 
    if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
       fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv );
    }
 
-   mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate;
+   mesaBuffer = (struct gl_framebuffer *) driDrawPriv->driverPrivate;
    if ( !mesaBuffer->Visual.doubleBufferMode )
       return; /* can't swap a single-buffered window */
 
@@ -253,7 +251,7 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
     * we have to do a glFinish (per the GLX spec).
     */
    if ( ctx ) {
-      __DRIdrawablePrivate *curDrawPriv;
+      __DRIdrawable *curDrawPriv;
       fxMesa = TDFX_CONTEXT(ctx);
       curDrawPriv = fxMesa->driContext->driDrawablePriv;
 
@@ -297,6 +295,8 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
    }
 #endif
 
+   assert(fxMesa);
+
    if (fxMesa->scissoredClipRects) {
       /* restore clip rects without scissor box */
       fxMesa->Glide.grDRIPosition( driDrawPriv->x, driDrawPriv->y,
@@ -341,7 +341,7 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
 }
 
 static const __DRIconfig **
-tdfxFillInModes(__DRIscreenPrivate *psp,
+tdfxFillInModes(__DRIscreen *psp,
                unsigned pixel_bits,
                unsigned depth_bits,
                unsigned stencil_bits,
@@ -385,7 +385,8 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
                            stencil_bits_array,
                            deep ? 2 : 4,
                            db_modes, 2,
-                           msaa_samples_array, 1);
+                           msaa_samples_array, 1,
+                           GL_TRUE);
 }
 
 /**
@@ -393,7 +394,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
  * 
  * \todo maybe fold this into intelInitDriver
  *
- * \return the __GLcontextModes supported by this driver
+ * \return the struct gl_config supported by this driver
  */
 static const __DRIconfig **
 tdfxInitScreen(__DRIscreen *psp)
@@ -440,3 +441,10 @@ const struct __DriverAPIRec driDriverAPI = {
    .WaitForSBC      = NULL,
    .SwapBuffersMSC  = NULL
 };
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+    &driCoreExtension.base,
+    &driLegacyExtension.base,
+    NULL
+};