[Mesa-dev] [PATCH 06/17] swrast: Reuse _swrast_free_texture_image_buffer from drivers.

Eric Anholt eric at anholt.net
Mon Apr 22 09:14:47 PDT 2013


---
 src/mesa/drivers/dri/intel/intel_tex.c       |    8 +-------
 src/mesa/drivers/dri/radeon/radeon_texture.c |    9 +--------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 2fbd5c4..24f13df 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -121,13 +121,7 @@ intel_free_texture_image_buffer(struct gl_context * ctx,
 
    intel_miptree_release(&intelImage->mt);
 
-   if (intelImage->base.Buffer) {
-      _mesa_align_free(intelImage->base.Buffer);
-      intelImage->base.Buffer = NULL;
-   }
-
-   free(intelImage->base.ImageOffsets);
-   intelImage->base.ImageOffsets = NULL;
+   _swrast_free_texture_image_buffer(ctx, texImage);
 }
 
 /**
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index a953858..23942cb 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -127,20 +127,13 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag
 
 	if (image->mt) {
 		radeon_miptree_unreference(&image->mt);
-	} else {
-		_swrast_free_texture_image_buffer(ctx, timage);
 	}
 	if (image->bo) {
 		radeon_bo_unref(image->bo);
 		image->bo = NULL;
 	}
-	if (image->base.Buffer) {
-		_mesa_align_free(image->base.Buffer);
-		image->base.Buffer = NULL;
-	}
 
-	free(image->base.ImageOffsets);
-	image->base.ImageOffsets = NULL;
+        _swrast_free_texture_image_buffer(ctx, timage);
 }
 
 /**
-- 
1.7.10.4



More information about the mesa-dev mailing list