[Mesa-dev] [PATCH] mesa/swrast: fix inverted front buffer rendering with old-school swrast

Kenneth Graunke kenneth at whitecape.org
Tue Nov 12 20:08:14 PST 2013


On 11/12/2013 06:56 PM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> 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=66213
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/drivers/dri/swrast/swrast.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
> index bfa2efd..06b4812 100644
> --- a/src/mesa/drivers/dri/swrast/swrast.c
> +++ b/src/mesa/drivers/dri/swrast/swrast.c
> @@ -406,8 +406,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;
>     }
>  
> 

Might help this too:

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


More information about the mesa-dev mailing list