radeon/r200: drop legacy texture heap code
authorDave Airlie <airlied@redhat.com>
Tue, 17 Feb 2009 04:00:24 +0000 (14:00 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 17 Feb 2009 04:00:24 +0000 (14:00 +1000)
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.h
src/mesa/drivers/dri/radeon/radeon_context.c

index a9cb2e2fe9143ebcb5a79a3d03138f9c6c7f6413..a744469b31ce5168befc299f86d74df41a154227 100644 (file)
@@ -331,25 +331,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
      return GL_FALSE;
    }
 
-
-   (void) memset( rmesa->radeon.texture_heaps, 0, sizeof( rmesa->radeon.texture_heaps ) );
-   make_empty_list( & rmesa->radeon.swapped );
-
-   rmesa->radeon.nr_heaps = 1 /* screen->numTexHeaps */ ;
-   assert(rmesa->radeon.nr_heaps < RADEON_NR_TEX_HEAPS);
-#if 0
-   for ( i = 0 ; i < rmesa->radeon.nr_heaps ; i++ ) {
-      rmesa->radeon.texture_heaps[i] = driCreateTextureHeap( i, rmesa,
-           screen->texSize[i],
-           12,
-           RADEON_NR_TEX_REGIONS,
-           (drmTextureRegionPtr)rmesa->radeon.sarea->tex_list[i],
-           & rmesa->radeon.sarea->tex_age[i],
-           & rmesa->radeon.swapped,
-           sizeof( radeonTexObj ),
-           (destroy_texture_object_t *) r200DestroyTexObj );
-   }
-#endif
    rmesa->radeon.texture_depth = driQueryOptioni (&rmesa->radeon.optionCache,
                                           "texture_depth");
    if (rmesa->radeon.texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
@@ -373,22 +354,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
 
    i = driQueryOptioni( &rmesa->radeon.optionCache, "allow_large_textures");
 
-   driCalculateMaxTextureLevels( rmesa->radeon.texture_heaps,
-                                rmesa->radeon.nr_heaps,
-                                & ctx->Const,
-                                4,
-                                11, /* max 2D texture size is 2048x2048 */
-#if ENABLE_HW_3D_TEXTURE
-                                8,  /* max 3D texture size is 256^3 */
-#else
-                                0,  /* 3D textures unsupported */
-#endif
-                                11, /* max cube texture size is 2048x2048 */
-                                11, /* max texture rectangle size is 2048x2048 */
-                                12,
-                                GL_FALSE,
-                                i );
-
    ctx->Const.MaxTextureMaxAnisotropy = 16.0;
 
    /* No wide AA points.
@@ -541,10 +506,7 @@ void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
    /* Free r200 context resources */
    assert(rmesa); /* should never be null */
    if ( rmesa ) {
-      GLboolean   release_texture_heaps;
 
-
-      release_texture_heaps = (rmesa->radeon.glCtx->Shared->RefCount == 1);
       _swsetup_DestroyContext( rmesa->radeon.glCtx );
       _tnl_DestroyContext( rmesa->radeon.glCtx );
       _vbo_DestroyContext( rmesa->radeon.glCtx );
@@ -563,21 +525,6 @@ void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
         rmesa->radeon.state.scissor.pClipRects = NULL;
       }
 
-
-      if ( release_texture_heaps ) {
-         /* This share group is about to go away, free our private
-          * texture object data.
-          */
-         int i;
-
-         for ( i = 0 ; i < rmesa->radeon.nr_heaps ; i++ ) {
-           driDestroyTextureHeap( rmesa->radeon.texture_heaps[ i ] );
-           rmesa->radeon.texture_heaps[ i ] = NULL;
-         }
-
-        assert( is_empty_list( & rmesa->radeon.swapped ) );
-      }
-
       radeonCleanupContext(&rmesa->radeon);
 
       FREE( rmesa );
index 7618b3482f30ca80eac711ac2dcb044218ac1ccc..a200e902210adecf8f9f15d65449782b93c1c36b 100644 (file)
@@ -375,9 +375,6 @@ struct radeon_context {
   
    /* Texture object bookkeeping
     */
-   unsigned              nr_heaps;
-   driTexHeap          * texture_heaps[ RADEON_NR_TEX_HEAPS ];
-   driTextureObject      swapped;
    int                   texture_depth;
    float                 initialMaxAnisotropy;
 
index f562876db4b02365b14405986f8efcdf20728d17..e4202c71fc58a743bb9948e4ca33787ac412a40b 100644 (file)
@@ -161,7 +161,6 @@ static void r100_get_lock(radeonContextPtr radeon)
    }
    
    if (sarea->ctx_owner != rmesa->radeon.dri.hwContext) {
-      int i;
       sarea->ctx_owner = rmesa->radeon.dri.hwContext;
       
       if (!radeon->radeonScreen->kernel_mm)
@@ -255,26 +254,6 @@ radeonCreateContext( const __GLcontextModes *glVisual,
      return GL_FALSE;
    }
 
-   (void) memset( rmesa->radeon.texture_heaps, 0, sizeof( rmesa->radeon.texture_heaps ) );
-   make_empty_list( & rmesa->radeon.swapped );
-
-#if 0
-   rmesa->radeon.nr_heaps = screen->numTexHeaps;
-   for ( i = 0 ; i < rmesa->radeon.nr_heaps ; i++ ) {
-      rmesa->radeon.texture_heaps[i] = driCreateTextureHeap( i, rmesa,
-           screen->texSize[i],
-           12,
-           RADEON_NR_TEX_REGIONS,
-           (drmTextureRegionPtr)rmesa->radeon.sarea->tex_list[i],
-           & rmesa->radeon.sarea->tex_age[i],
-           & rmesa->radeon.swapped,
-           sizeof( radeonTexObj ),
-           (destroy_texture_object_t *) radeonDestroyTexObj );
-
-      driSetTextureSwapCounterLocation( rmesa->radeon.texture_heaps[i],
-                                       & rmesa->c_textureSwaps );
-   }
-#endif
    rmesa->radeon.texture_depth = driQueryOptioni (&rmesa->radeon.optionCache,
                                           "texture_depth");
    if (rmesa->radeon.texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
@@ -298,19 +277,6 @@ radeonCreateContext( const __GLcontextModes *glVisual,
 
    i = driQueryOptioni( &rmesa->radeon.optionCache, "allow_large_textures");
 
-   driCalculateMaxTextureLevels( rmesa->radeon.texture_heaps,
-                                rmesa->radeon.nr_heaps,
-                                & ctx->Const,
-                                4,
-                                11, /* max 2D texture size is 2048x2048 */
-                                8,  /* 256^3 */
-                                9,  /* \todo: max cube texture size seems to be 512x512(x6) */
-                                11, /* max rect texture size is 2048x2048. */
-                                12,
-                                GL_FALSE,
-                                i );
-
-
    ctx->Const.MaxTextureMaxAnisotropy = 16.0;
 
    /* No wide points.
@@ -450,10 +416,7 @@ void radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
    /* Free radeon context resources */
    assert(rmesa); /* should never be null */
    if ( rmesa ) {
-      GLboolean   release_texture_heaps;
-
 
-      release_texture_heaps = (rmesa->radeon.glCtx->Shared->RefCount == 1);
       _swsetup_DestroyContext( rmesa->radeon.glCtx );
       _tnl_DestroyContext( rmesa->radeon.glCtx );
       _vbo_DestroyContext( rmesa->radeon.glCtx );
@@ -473,20 +436,6 @@ void radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
         rmesa->radeon.state.scissor.pClipRects = NULL;
       }
 
-      if ( release_texture_heaps ) {
-         /* This share group is about to go away, free our private
-          * texture object data.
-          */
-         int i;
-
-         for ( i = 0 ; i < rmesa->radeon.nr_heaps ; i++ ) {
-           driDestroyTextureHeap( rmesa->radeon.texture_heaps[ i ] );
-           rmesa->radeon.texture_heaps[ i ] = NULL;
-         }
-
-        assert( is_empty_list( & rmesa->radeon.swapped ) );
-      }
-
       radeonCleanupContext(&rmesa->radeon);
 
       FREE( rmesa );