[Mesa-dev] [PATCH 08/10] intel: Drop our custom glGetTexImage() code.

Eric Anholt eric at anholt.net
Thu Sep 22 17:14:46 PDT 2011


The mesa core code uses MapTextureImage() like we need now.
---
 src/mesa/drivers/dri/intel/intel_tex_image.c |   61 --------------------------
 1 files changed, 0 insertions(+), 61 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index aae3395..77f6bd1 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -570,66 +570,6 @@ intelCompressedTexImage2D( struct gl_context *ctx, GLenum target, GLint level,
 		 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, GL_TRUE);
 }
 
-static void
-intelGetTexImage(struct gl_context * ctx, GLenum target, GLint level,
-                 GLenum format, GLenum type, GLvoid * pixels,
-                 struct gl_texture_object *texObj,
-                 struct gl_texture_image *texImage)
-{
-   struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_image *intelImage = intel_texture_image(texImage);
-
-   /* If we're reading from a texture that has been rendered to, need to
-    * make sure rendering is complete.
-    * We could probably predicate this on texObj->_RenderToTexture
-    */
-   intel_flush(ctx);
-
-   /* Map */
-   if (intelImage->mt) {
-      /* Image is stored in hardware format in a buffer managed by the
-       * kernel.  Need to explicitly map and unmap it.
-       */
-      intelImage->base.Base.Data =
-         intel_miptree_image_map(intel,
-                                 intelImage->mt,
-                                 intelImage->base.Base.Face,
-                                 intelImage->base.Base.Level,
-                                 &intelImage->base.Base.RowStride,
-                                 intelImage->base.Base.ImageOffsets);
-      intelImage->base.Base.RowStride /= intelImage->mt->cpp;
-   }
-   else {
-      /* Otherwise, the image should actually be stored in
-       * intelImage->base.Base.Data.  This is pretty confusing for
-       * everybody, I'd much prefer to separate the two functions of
-       * texImage->Data - storage for texture images in main memory
-       * and access (ie mappings) of images.  In other words, we'd
-       * create a new texImage->Map field and leave Data simply for
-       * storage.
-       */
-      assert(intelImage->base.Base.Data);
-   }
-
-   if (intelImage->stencil_rb) {
-      /*
-       * The texture has packed depth/stencil format, but uses separate
-       * stencil. The texture's embedded stencil buffer contains the real
-       * stencil data, so copy that into the miptree.
-       */
-      intel_tex_image_s8z24_gather(intel, intelImage);
-   }
-
-   _mesa_get_teximage(ctx, target, level, format, type, pixels,
-		      texObj, texImage);
-
-   /* Unmap */
-   if (intelImage->mt) {
-      intel_miptree_image_unmap(intel, intelImage->mt);
-      intelImage->base.Base.Data = NULL;
-   }
-}
-
 void
 intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
 		   GLint texture_format,
@@ -765,7 +705,6 @@ intelInitTextureImageFuncs(struct dd_function_table *functions)
    functions->TexImage1D = intelTexImage1D;
    functions->TexImage2D = intelTexImage2D;
    functions->TexImage3D = intelTexImage3D;
-   functions->GetTexImage = intelGetTexImage;
 
    functions->CompressedTexImage2D = intelCompressedTexImage2D;
 
-- 
1.7.5.4



More information about the mesa-dev mailing list