}
}
-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)
{
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
_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)
{
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;
}