From 8b8a54afd9b748b7250993393864544ad6961edb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Jan 2012 13:05:59 -0700 Subject: [PATCH] nouveau: stop calling ctx->Driver.Map/UnmapTexture() And remove unused nouveau_texture_map/unmap() --- src/mesa/drivers/dri/nouveau/nouveau_span.c | 17 +++--------- .../drivers/dri/nouveau/nouveau_texture.c | 27 ------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c index 91a931161f0..f82a2e1e0d9 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_span.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c @@ -45,18 +45,6 @@ renderbuffer_map_unmap(struct gl_renderbuffer *rb, GLboolean map) } } -static void -texture_unit_map_unmap(struct gl_context *ctx, struct gl_texture_unit *u, GLboolean map) -{ - if (!u->_ReallyEnabled) - return; - - if (map) - ctx->Driver.MapTexture(ctx, u->_Current); - else - ctx->Driver.UnmapTexture(ctx, u->_Current); -} - static void framebuffer_map_unmap(struct gl_framebuffer *fb, GLboolean map) { @@ -82,7 +70,10 @@ span_map_unmap(struct gl_context *ctx, GLboolean map) framebuffer_map_unmap(ctx->ReadBuffer, map); for (i = 0; i < ctx->Const.MaxTextureUnits; i++) - texture_unit_map_unmap(ctx, &ctx->Texture.Unit[i], map); + if (map) + _swrast_map_texture(ctx, ctx->Texture.Unit[i]._Current); + else + _swrast_unmap_texture(ctx, ctx->Texture.Unit[i]._Current); } static void diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index b364f78f445..66c3cb25188 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -680,31 +680,6 @@ nouveau_set_texbuffer(__DRIcontext *dri_ctx, _mesa_unlock_texture(ctx, t); } -static void -nouveau_texture_map(struct gl_context *ctx, struct gl_texture_object *t) -{ - int i; - - for (i = t->BaseLevel; i < t->_MaxLevel; i++) { - struct gl_texture_image *ti = t->Image[0][i]; - - if (ti) - nouveau_teximage_map(ctx, ti, GL_MAP_READ_BIT, - 0, 0, ti->Width, ti->Height); - } -} - -static void -nouveau_texture_unmap(struct gl_context *ctx, struct gl_texture_object *t) -{ - int i; - - for (i = t->BaseLevel; i < t->_MaxLevel; i++) { - if (t->Image[0][i]) - nouveau_teximage_unmap(ctx, t->Image[0][i]); - } -} - void nouveau_texture_functions_init(struct dd_function_table *functions) { @@ -720,8 +695,6 @@ nouveau_texture_functions_init(struct dd_function_table *functions) functions->TexSubImage2D = nouveau_texsubimage_2d; functions->TexSubImage3D = nouveau_texsubimage_3d; functions->BindTexture = nouveau_bind_texture; - functions->MapTexture = nouveau_texture_map; - functions->UnmapTexture = nouveau_texture_unmap; functions->MapTextureImage = nouveau_map_texture_image; functions->UnmapTextureImage = nouveau_unmap_texture_image; } -- 2.30.2