[Mesa-dev] [PATCH 2/3] swrast: Add a note about overlapping support for framebuffer blit.
Brian Paul
brian.e.paul at gmail.com
Tue Dec 13 13:14:22 PST 2011
On Tue, Dec 13, 2011 at 1:53 PM, Eric Anholt <eric at anholt.net> wrote:
> ---
> 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;
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list