intel: use new mipmap generation hooks in driver.
authorDave Airlie <airlied@redhat.com>
Fri, 9 May 2008 03:51:37 +0000 (13:51 +1000)
committerDave Airlie <airlied@panoply-rh.(none)>
Fri, 9 May 2008 03:51:37 +0000 (13:51 +1000)
src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/intel/intel_tex.h
src/mesa/drivers/dri/intel/intel_tex_copy.c
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/intel/intel_tex_subimage.c

index 2c0dd248ee3787d97099f1d3249d9294b356199b..f1d6a6dbfc0310fa03ea592fb83d9c23a3f18f2a 100644 (file)
@@ -172,7 +172,6 @@ timed_memcpy(void *dest, const void *src, size_t n)
  */
 void
 intel_generate_mipmap(GLcontext *ctx, GLenum target,
-                      const struct gl_texture_unit *texUnit,
                       struct gl_texture_object *texObj)
 {
    struct intel_texture_object *intelObj = intel_texture_object(texObj);
@@ -198,6 +197,15 @@ intel_generate_mipmap(GLcontext *ctx, GLenum target,
    }
 }
 
+static void intelGenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj)
+{
+   struct intel_context *intel = intel_context(ctx);
+   struct intel_texture_object *intelObj = intel_texture_object(texObj);
+
+   intel_tex_map_images(intel, intelObj);
+   intel_generate_mipmap(ctx, target, texObj);
+   intel_tex_unmap_images(intel, intelObj);
+}
 
 void
 intelInitTextureFuncs(struct dd_function_table *functions)
@@ -221,6 +229,7 @@ intelInitTextureFuncs(struct dd_function_table *functions)
    functions->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
 #endif
    functions->GetTexImage = intelGetTexImage;
+   functions->GenerateMipmap = intelGenerateMipmap;
 
    /* compressed texture functions */
    functions->CompressedTexImage2D = intelCompressedTexImage2D;
index 3a87137cc9ecfc5c7bd7984b20948557c70e3d39..60ab8203e52ec89dc31f6a78d844a120bfed39b5 100644 (file)
@@ -151,7 +151,6 @@ void intel_tex_unmap_images(struct intel_context *intel,
 int intel_compressed_num_bytes(GLuint mesaFormat);
 
 void intel_generate_mipmap(GLcontext *ctx, GLenum target,
-                          const struct gl_texture_unit *texUnit,
                           struct gl_texture_object *texObj);
 
 #endif
index 7facc469f4809bbcfe9edceb25b80dbb5a2731e5..1add7c6188c42265b1c6eefc21ed3dbdc1096ef2 100644 (file)
@@ -161,9 +161,7 @@ do_copy_texsubimage(struct intel_context *intel,
 
    /* GL_SGIS_generate_mipmap */
    if (intelImage->level == texObj->BaseLevel && texObj->GenerateMipmap) {
-      intel_generate_mipmap(ctx, target,
-                            &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
-                            texObj);
+      intel_generate_mipmap(ctx, target, texObj);
    }
 
    return GL_TRUE;
index bcb65835c6bdd1d1a829f5daf0fe8811c8adb31f..95ddbd59202dead1af2212226a65c59240a3f6bb 100644 (file)
@@ -522,9 +522,7 @@ intelTexImage(GLcontext * ctx,
 
    /* GL_SGIS_generate_mipmap */
    if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
-      intel_generate_mipmap(ctx, target,
-                            &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
-                            texObj);
+      intel_generate_mipmap(ctx, target, texObj);
    }
 
    _mesa_unmap_teximage_pbo(ctx, unpack);
index 78621814c3a18c8c53b17fb1f1138088feee8ab6..5428a1d06890281d9c7847ed612e3ffad49949f8 100644 (file)
@@ -103,9 +103,7 @@ intelTexSubimage(GLcontext * ctx,
 
    /* GL_SGIS_generate_mipmap */
    if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
-      intel_generate_mipmap(ctx, target,
-                            &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
-                            texObj);
+      intel_generate_mipmap(ctx, target, texObj);
    }
 
    _mesa_unmap_teximage_pbo(ctx, packing);