From: Brian Paul Date: Thu, 3 Sep 2009 20:39:53 +0000 (-0600) Subject: st/mesa: fix glCopyPixels(GL_STENCIL_INDEX) inverted position X-Git-Tag: mesa-7.8~2464^2~177^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3a0624ef01c3b347ed8a9fd3bab578b52bd9130;p=platform%2Fupstream%2Fmesa.git st/mesa: fix glCopyPixels(GL_STENCIL_INDEX) inverted position If the renderbuffer orientation is Y=0=TOP we need to invert the dstY position. --- diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 8b5094a..adb349c 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -842,6 +842,10 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, else usage = PIPE_TRANSFER_WRITE; + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + dsty = rbDraw->Base.Height - dsty - height; + } + ptDraw = st_cond_flush_get_tex_transfer(st_context(ctx), rbDraw->texture, 0, 0, 0, usage, dstx, dsty,