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 20:39:53 +0000 (14:39 -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 8b5094a04f3762aeb4503328f93f8026c8d092d1..adb349c1f1e3f6ab68e81fa9748ea7afc3156610 100644 (file)
@@ -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,