st/mesa: fix GL_FEEDBACK mode inverted Y coordinate bug
authorBrian Paul <brianp@vmware.com>
Tue, 19 Nov 2013 20:09:57 +0000 (13:09 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 19 Nov 2013 20:21:35 +0000 (13:21 -0700)
We need to check the drawbuffer's orientation before inverting Y
coordinates.  Fixes piglit feedback tests when running with the
-fbo option.

Cc: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_feedback.c

index d2e4346b7ea8c8ba320a393f99a5ca31b7240bc7..34a16ccf938ca674f640880c8408712e8965ffed 100644 (file)
@@ -85,9 +85,11 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw,
    const GLfloat *color, *texcoord;
    GLuint slot;
 
-   /* Recall that Y=0=Top of window for Gallium wincoords */
    win[0] = v->data[0][0];
-   win[1] = ctx->DrawBuffer->Height - v->data[0][1];
+   if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
+      win[1] = ctx->DrawBuffer->Height - v->data[0][1];
+   else
+      win[1] = v->data[0][1];
    win[2] = v->data[0][2];
    win[3] = 1.0F / v->data[0][3];