Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / dri / savage / savage_xmesa.c
index 6f07ac275e8c1f5924d25653f73f2e4b7348dedc..b3aaa0e504ed02bcbc848303f669d4fb32567d35 100644 (file)
@@ -26,8 +26,6 @@
 #include <stdio.h>
 
 #include "main/context.h"
-#include "main/context.h"
-#include "main/matrix.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
 #include "main/simple_list.h"
@@ -44,6 +42,7 @@
 #include "tnl/t_pipeline.h"
 
 #include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
 
 #include "savagedd.h"
 #include "savagestate.h"
@@ -287,11 +286,12 @@ savageDestroyScreen(__DRIscreen *sPriv)
 }
 
 static GLboolean
-savageCreateContext( const __GLcontextModes *mesaVis,
+savageCreateContext( gl_api api,
+                    const struct gl_config *mesaVis,
                     __DRIcontext *driContextPriv,
                     void *sharedContextPrivate )
 {
-   GLcontext *ctx, *shareCtx;
+   struct gl_context *ctx, *shareCtx;
    savageContextPtr imesa;
    __DRIscreen *sPriv = driContextPriv->driScreenPriv;
    struct dd_function_table functions;
@@ -473,6 +473,8 @@ savageCreateContext( const __GLcontextModes *mesaVis,
    imesa->CurrentTexObj[0] = 0;
    imesa->CurrentTexObj[1] = 0;
 
+   _mesa_meta_init( ctx );
+
    /* Initialize the software rasterizer and helper modules.
     */
    _swrast_CreateContext( ctx );
@@ -564,6 +566,8 @@ savageDestroyContext(__DRIcontext *driContextPriv)
       free(imesa->cmdBuf.base);
       free(imesa->clientVtxBuf.buf);
 
+      _mesa_meta_free( imesa->glCtx );
+
       _swsetup_DestroyContext(imesa->glCtx );
       _tnl_DestroyContext( imesa->glCtx );
       _vbo_DestroyContext( imesa->glCtx );
@@ -582,7 +586,7 @@ savageDestroyContext(__DRIcontext *driContextPriv)
 static GLboolean
 savageCreateBuffer( __DRIscreen *driScrnPriv,
                    __DRIdrawable *driDrawPriv,
-                   const __GLcontextModes *mesaVis,
+                   const struct gl_config *mesaVis,
                    GLboolean isPixmap)
 {
    savageScreenPrivate *screen = (savageScreenPrivate *) driScrnPriv->private;
@@ -677,7 +681,7 @@ savageCreateBuffer( __DRIscreen *driScrnPriv,
 static void
 savageDestroyBuffer(__DRIdrawable *driDrawPriv)
 {
-   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+   _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 }
 
 #if 0
@@ -785,9 +789,9 @@ savageMakeCurrent(__DRIcontext *driContextPriv,
       savageContextPtr imesa
          = (savageContextPtr) driContextPriv->driverPrivate;
       struct gl_framebuffer *drawBuffer
-         = (GLframebuffer *) driDrawPriv->driverPrivate;
+         = (struct gl_framebuffer *) driDrawPriv->driverPrivate;
       struct gl_framebuffer *readBuffer
-         = (GLframebuffer *) driReadPriv->driverPrivate;
+         = (struct gl_framebuffer *) driReadPriv->driverPrivate;
       driRenderbuffer *frontRb = (driRenderbuffer *)
          drawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
       driRenderbuffer *backRb = (driRenderbuffer *)
@@ -888,7 +892,7 @@ savageFillInModes( __DRIscreen *psp,
                   unsigned stencil_bits, GLboolean have_back_buffer )
 {
     __DRIconfig **configs;
-    __GLcontextModes * m;
+    struct gl_config * m;
     unsigned depth_buffer_factor;
     unsigned back_buffer_factor;
     GLenum fb_format;
@@ -964,7 +968,7 @@ savageFillInModes( __DRIscreen *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 **
 savageInitScreen(__DRIscreen *psp)