swrast: Add a note about overlapping support for framebuffer blit.
authorEric Anholt <eric@anholt.net>
Thu, 8 Dec 2011 17:28:32 +0000 (09:28 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 14 Dec 2011 21:18:00 +0000 (13:18 -0800)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_blit.c

index 2817ec12ff9d5a01be92dd38db268fd08cdf2f2d..803ad2e899da9d1e5f95be316891528695b3e0e6 100644 (file)
@@ -478,7 +478,15 @@ simple_blit(struct gl_context *ctx,
    ASSERT(srcX1 - srcX0 == dstX1 - dstX0);
    ASSERT(srcY1 - srcY0 == dstY1 - dstY0);
 
-   /* determine if copy should be bottom-to-top or top-to-bottom */
+   /* From the GL_ARB_framebuffer_object spec:
+    *
+    *     "If the source and destination buffers are identical, and the source
+    *      and destination rectangles overlap, the result of the blit operation
+    *      is undefined."
+    *
+    * However, we provide the expected result anyway by flipping the order of
+    * the memcpy of rows.
+    */
    if (srcY0 > dstY0) {
       /* src above dst: copy bottom-to-top */
       yStep = 1;