st/mesa: fix glCopyPixels(GL_STENCIL_INDEX) inverted position
authorBrian Paul <brianp@vmware.com>
Thu, 3 Sep 2009 20:39:53 +0000 (14:39 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Sep 2009 22:07:46 +0000 (16:07 -0600)
If the renderbuffer orientation is Y=0=TOP we need to invert the dstY
position.

src/mesa/state_tracker/st_cb_drawpixels.c

index e00754a036551d2f7c81808757597e3e49f47196..a9cafbf8cdcea529ec52d3ede58fa27b34a77a40 100644 (file)
@@ -865,6 +865,10 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
       usage = PIPE_TRANSFER_READ_WRITE;
    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,