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

Author: Dave Airlie <[email protected]>
Date:   Wed Nov 13 12:53:52 2013 +1000

mesa/swrast: fix inverted front buffer rendering with old-school swrast

I've no idea when this broke, but we have some people who wanted it fixed,
so here's my attempt.

reproducer, run readpix with swrast hit f, or run trival tri -sb things are
upside down, after this patch they aren't.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62142
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66213

Cc: <[email protected]>"
Signed-off-by: Dave Airlie <[email protected]>
(cherry picked from commit a43b49dfb13dc7e6d2d6d7ceee892077038d7102)

---

 src/mesa/drivers/dri/swrast/swrast.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index 332c7b7..a29a9ea 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -401,8 +401,8 @@ swrast_map_renderbuffer(struct gl_context *ctx,
                                     (char *) xrb->Base.Buffer,
                                     dPriv->loaderPrivate);
 
-      *out_map = xrb->Base.Buffer;
-      *out_stride = stride;
+      *out_map = xrb->Base.Buffer + (h - 1) * stride;
+      *out_stride = -stride;
       return;
    }
 

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

Reply via email to