Module: Mesa
Branch: master
Commit: a68e8a4eaadfe2a1e4999d5e378c7d9fa99dc656
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a68e8a4eaadfe2a1e4999d5e378c7d9fa99dc656

Author: Maciej Cencora <[email protected]>
Date:   Wed Mar 10 20:53:21 2010 +0100

radeon: fix glCopyTex(Sub)Image if user FBO is bound

Fixes piglit/fbo-blit and wine d3d9 unit test.

---

 src/mesa/drivers/dri/radeon/radeon_tex_copy.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c 
b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
index 5cfad6f..e57d77e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
@@ -52,15 +52,18 @@ do_copy_texsubimage(GLcontext *ctx,
     gl_format dst_mesaformat;
     unsigned src_width;
     unsigned dst_width;
+    unsigned flip_y;
 
     if (!radeon->vtbl.blit) {
         return GL_FALSE;
     }
 
     if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) {
-        rrb = radeon_get_depthbuffer(radeon);
+        rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
+        flip_y = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Type == GL_NONE;
     } else {
-        rrb = radeon_get_colorbuffer(radeon);
+        rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
+        flip_y = ctx->ReadBuffer->Attachment[BUFFER_COLOR0].Type == GL_NONE;
     }
 
     if (!timg->mt) {
@@ -124,7 +127,7 @@ do_copy_texsubimage(GLcontext *ctx,
                              timg->mt->bo, dst_offset, dst_mesaformat,
                              timg->mt->levels[level].rowstride / dst_bpp,
                              dst_width, timg->base.Height,
-                             dstx, dsty, width, height, 1);
+                             dstx, dsty, width, height, flip_y);
 }
 
 void

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to