aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorOwen Taylor <[email protected]>2009-10-14 16:20:07 -0400
committerAlex Deucher <[email protected]>2009-10-15 11:33:08 -0400
commit3f30b0709b5a71915df336194f9f805e4c306cef (patch)
tree237b2e3d88ef8926733bacaab1934782a4175c37 /src/mesa/drivers
parent16c6a3b71e6be04b6bb3d08fcb658194c5251fc7 (diff)
Use the right pitch when rendering to a texture
We need to get the pitch from the texture level we are rendering to, rather than just using the base texel width.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_fbo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index d83b166742c..2012cbcf838 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -445,7 +445,6 @@ restart:
goto restart;
}
- rrb->pitch = texImage->Width * rrb->cpp;
rrb->base.InternalFormat = rrb->base._ActualFormat;
rrb->base.Width = texImage->Width;
rrb->base.Height = texImage->Height;
@@ -555,8 +554,10 @@ radeon_render_texture(GLcontext * ctx,
imageOffset += offsets[att->Zoffset];
}
- /* store that offset in the region */
+ /* store that offset in the region, along with the correct pitch for
+ * the image we are rendering to */
rrb->draw_offset = imageOffset;
+ rrb->pitch = radeon_image->mt->levels[att->TextureLevel].rowstride;
/* update drawing region, etc */
radeon_draw_buffer(ctx, fb);