Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / dri / tdfx / tdfx_context.c
index 68b5027561bd651def0939373df3619ba0fe079a..63dfa5ae746687e139339f60354da475f9164da7 100644 (file)
 #define need_GL_EXT_paletted_texture
 /* #define need_GL_EXT_secondary_color */
 /* #define need_GL_NV_vertex_program */
-#include "extension_helper.h"
+#include "main/remap_helper.h"
 
 
 /**
  * Common extension strings exported by all cards
  */
-const struct dri_extension card_extensions[] =
+static const struct dri_extension card_extensions[] =
 {
     { "GL_ARB_occlusion_query",            GL_ARB_occlusion_query_functions },
     { "GL_ARB_texture_mirrored_repeat",    NULL },
@@ -107,7 +107,7 @@ const struct dri_extension card_extensions[] =
 /**
  * Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
  */
-const struct dri_extension napalm_extensions[] =
+static const struct dri_extension napalm_extensions[] =
 {
     { "GL_ARB_texture_env_combine",        NULL },
     { "GL_EXT_blend_equation_separate",    GL_EXT_blend_equation_separate_functions },
@@ -124,7 +124,7 @@ const struct dri_extension napalm_extensions[] =
 /*
  * Enable/Disable the extensions for this context.
  */
-static void tdfxDDInitExtensions( GLcontext *ctx )
+static void tdfxDDInitExtensions( struct gl_context *ctx )
 {
    tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
 
@@ -136,8 +136,6 @@ static void tdfxDDInitExtensions( GLcontext *ctx )
 
    if ( TDFX_IS_NAPALM( fxMesa ) ) {
       driInitExtensions( ctx, napalm_extensions, GL_FALSE );
-   } else {
-      _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" );
    }
 }
 
@@ -164,13 +162,14 @@ static const struct dri_debug_control debug_control[] =
     { NULL,    0 }
 };
 
-GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis,
-                            __DRIcontextPrivate *driContextPriv,
+GLboolean tdfxCreateContext( gl_api api,
+                            const struct gl_config *mesaVis,
+                            __DRIcontext *driContextPriv,
                              void *sharedContextPrivate )
 {
    tdfxContextPtr fxMesa;
-   GLcontext *ctx, *shareCtx;
-   __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+   struct gl_context *ctx, *shareCtx;
+   __DRIscreen *sPriv = driContextPriv->driScreenPriv;
    tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private;
    TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA +
                                              sizeof(drm_sarea_t));
@@ -441,7 +440,7 @@ static GLboolean tdfxInitVertexFormats( tdfxContextPtr fxMesa )
  * Initialize the state in an tdfxContextPtr struct.
  */
 static GLboolean
-tdfxInitContext( __DRIdrawablePrivate *driDrawPriv, tdfxContextPtr fxMesa )
+tdfxInitContext( __DRIdrawable *driDrawPriv, tdfxContextPtr fxMesa )
 {
    /* KW: Would be nice to make one of these a member of the other.
     */
@@ -563,7 +562,7 @@ tdfxInitContext( __DRIdrawablePrivate *driDrawPriv, tdfxContextPtr fxMesa )
 
 
 void
-tdfxDestroyContext( __DRIcontextPrivate *driContextPriv )
+tdfxDestroyContext( __DRIcontext *driContextPriv )
 {
    tdfxContextPtr fxMesa = (tdfxContextPtr) driContextPriv->driverPrivate;
 
@@ -607,7 +606,7 @@ tdfxDestroyContext( __DRIcontextPrivate *driContextPriv )
 
 
 GLboolean
-tdfxUnbindContext( __DRIcontextPrivate *driContextPriv )
+tdfxUnbindContext( __DRIcontext *driContextPriv )
 {
    GET_CURRENT_CONTEXT(ctx);
    tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
@@ -626,9 +625,9 @@ tdfxUnbindContext( __DRIcontextPrivate *driContextPriv )
 
 
 GLboolean
-tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
-                 __DRIdrawablePrivate *driDrawPriv,
-                 __DRIdrawablePrivate *driReadPriv )
+tdfxMakeCurrent( __DRIcontext *driContextPriv,
+                 __DRIdrawable *driDrawPriv,
+                 __DRIdrawable *driReadPriv )
 {
    if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
       fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driContextPriv );
@@ -636,7 +635,7 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
 
    if ( driContextPriv ) {
       tdfxContextPtr newFx = (tdfxContextPtr) driContextPriv->driverPrivate;
-      GLcontext *newCtx = newFx->glCtx;
+      struct gl_context *newCtx = newFx->glCtx;
       GET_CURRENT_CONTEXT(curCtx);
 
       if ((newFx->driDrawable != driDrawPriv)
@@ -652,8 +651,8 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
              * dispatch is set correctly.
              */
             _mesa_make_current( newCtx,
-                                (GLframebuffer *) driDrawPriv->driverPrivate,
-                                (GLframebuffer *) driReadPriv->driverPrivate );
+                                (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+                                (struct gl_framebuffer *) driReadPriv->driverPrivate );
             return GL_TRUE;
         }
         /* [dBorca] tunnel2 requires this */
@@ -690,8 +689,8 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
       }
 
       _mesa_make_current( newCtx,
-                          (GLframebuffer *) driDrawPriv->driverPrivate,
-                          (GLframebuffer *) driReadPriv->driverPrivate );
+                          (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+                          (struct gl_framebuffer *) driReadPriv->driverPrivate );
    } else {
       _mesa_make_current( NULL, NULL, NULL );
    }