Mesa (master): swrast: Add a note about overlapping support for framebuffer blit.
Eric Anholt
anholt at kemper.freedesktop.org
Thu Dec 15 04:31:33 UTC 2011
Module: Mesa
Branch: master
Commit: b2469ff043de303402a188c58865dabde14fd03b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2469ff043de303402a188c58865dabde14fd03b
Author: Eric Anholt <eric at anholt.net>
Date: Thu Dec 8 09:28:32 2011 -0800
swrast: Add a note about overlapping support for framebuffer blit.
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/swrast/s_blit.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index 2817ec1..803ad2e 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -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;
More information about the mesa-commit
mailing list