summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2008-05-09 13:02:41 +1000
committerDave Airlie <airlied@panoply-rh.(none)>2008-05-09 13:02:41 +1000
commitc50ffc4cb89b67ae59208eb72cdb664c846ba987 (patch)
treebf4b008317008083fd0802cb2020f62782aca31d /src/mesa
parent990e010394a2685c1daeaef61cf4f7e2a0ba419e (diff)
mesa/intel: map/unmap texture objects around mipmap generation function.
This at least stops the compiz brain explosion we were seeing, I do wonder though if we should somehow be calling intel_generate_mipmap somehow.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c18
-rw-r--r--src/mesa/main/fbobject.c6
2 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 329af0d1b04..1fa9da61bd8 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -198,6 +198,21 @@ intel_generate_mipmap(GLcontext *ctx, GLenum target,
}
}
+void intelMapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
+{
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_tex_map_images(intel, intelObj);
+}
+
+void intelUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
+{
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_tex_unmap_images(intel, intelObj);
+}
void
intelInitTextureFuncs(struct dd_function_table *functions)
@@ -233,6 +248,9 @@ intelInitTextureFuncs(struct dd_function_table *functions)
functions->UpdateTexturePalette = 0;
functions->IsTextureResident = intelIsTextureResident;
+ functions->MapTexture = intelMapTexture;
+ functions->UnmapTexture = intelUnmapTexture;
+
#if DO_DEBUG && !defined(__ia64__)
if (INTEL_DEBUG & DEBUG_BUFMGR)
functions->TextureMemCpy = timed_memcpy;
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 9b60c732940..b015ca6c5e6 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1542,10 +1542,16 @@ _mesa_GenerateMipmapEXT(GLenum target)
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ if (ctx->Driver.MapTexture)
+ ctx->Driver.MapTexture(ctx, texObj);
+
/* XXX this might not handle cube maps correctly */
_mesa_lock_texture(ctx, texObj);
_mesa_generate_mipmap(ctx, target, texUnit, texObj);
_mesa_unlock_texture(ctx, texObj);
+
+ if (ctx->Driver.UnmapTexture)
+ ctx->Driver.UnmapTexture(ctx, texObj);
}