From adf958d9c2b4cbfbeef36c253b8889967d83c272 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 19 Apr 2013 13:10:55 -0700 Subject: swrast: Always use MapTextureImage for mapping textures for swrast. Now that everything goes through ImageSlices[], we can rely on the driver's existing texture mapping function. A big block of code goes away on Radeon that looks like it was to deal with the validate that happened at SpanRenderStart, which no longer occurs since we don't need validation for the MapTextureImage hook. v2: Rewrite comment about ImageSlices, fix duplicated swImages, touch up unmap loop. Reviewed-by: Kenneth Graunke (v1) Reviewed-by: Brian Paul --- src/mesa/drivers/dri/radeon/radeon_span.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_span.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 0617adc5bc5..6a7df730a19 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -119,18 +119,11 @@ radeon_unmap_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) static void radeonSpanRenderStart(struct gl_context * ctx) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - int i; radeon_firevertices(rmesa); - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { - radeon_validate_texture_miptree(ctx, _mesa_get_samplerobj(ctx, i), - ctx->Texture.Unit[i]._Current); - radeon_swrast_map_texture_images(ctx, ctx->Texture.Unit[i]._Current); - } - } - + _swrast_map_textures(ctx); + radeon_map_framebuffer(ctx, ctx->DrawBuffer); if (ctx->ReadBuffer != ctx->DrawBuffer) radeon_map_framebuffer(ctx, ctx->ReadBuffer); @@ -138,13 +131,8 @@ static void radeonSpanRenderStart(struct gl_context * ctx) static void radeonSpanRenderFinish(struct gl_context * ctx) { - int i; - _swrast_flush(ctx); - - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) - if (ctx->Texture.Unit[i]._ReallyEnabled) - radeon_swrast_unmap_texture_images(ctx, ctx->Texture.Unit[i]._Current); + _swrast_unmap_textures(ctx); radeon_unmap_framebuffer(ctx, ctx->DrawBuffer); if (ctx->ReadBuffer != ctx->DrawBuffer) -- cgit v1.2.3