aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-23 16:30:09 +0000
committermarha <marha@users.sourceforge.net>2011-01-23 16:30:09 +0000
commit8cd59857a99c534c560f58c931f5c2466d4c1f9b (patch)
treefd9f3d3f8c557611c1fc509cb947e826b3da1999 /mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
parentb8ffa56f8bda74a402eae0c89aadfda7b7db507f (diff)
downloadvcxsrv-8cd59857a99c534c560f58c931f5c2466d4c1f9b.tar.gz
vcxsrv-8cd59857a99c534c560f58c931f5c2466d4c1f9b.tar.bz2
vcxsrv-8cd59857a99c534c560f58c931f5c2466d4c1f9b.zip
mesalib git update 23/1/2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_rasterizer.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_rasterizer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
index 4936385d2..4fad1f297 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -70,14 +70,16 @@ static void update_raster_state( struct st_context *st )
{
raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW);
- /* XXX
- * I think the intention here is that user-created framebuffer objects
- * use Y=0=TOP layout instead of OpenGL's normal Y=0=bottom layout.
- * Flipping Y changes CW to CCW and vice-versa.
- * But this is an implementation/driver-specific artifact - remove...
+ /*
+ * Gallium's surfaces are Y=0=TOP orientation. OpenGL is the
+ * opposite. Window system surfaces are Y=0=TOP. Mesa's FBOs
+ * must match OpenGL conventions so FBOs use Y=0=BOTTOM. In that
+ * case, we must invert Y and flip the notion of front vs. back.
*/
- if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
+ /* Drawing to an FBO. The viewport will be inverted. */
raster->front_ccw ^= 1;
+ }
}
/* _NEW_LIGHT