nouveau: stop calling ctx->Driver.Map/UnmapTexture()
authorBrian Paul <brianp@vmware.com>
Mon, 16 Jan 2012 20:05:59 +0000 (13:05 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 24 Jan 2012 21:12:36 +0000 (14:12 -0700)
And remove unused nouveau_texture_map/unmap()

src/mesa/drivers/dri/nouveau/nouveau_span.c
src/mesa/drivers/dri/nouveau/nouveau_texture.c

index 91a931161f00df90eec7ff63f547862b17dced31..f82a2e1e0d9ed6f45417afe89ba37572590871ff 100644 (file)
@@ -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
index b364f78f445999ac62a238f05b9ea2a28ccb12ca..66c3cb25188c4f0c7f141424dc37b514f3bcc1ec 100644 (file)
@@ -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;
 }