summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-01-21 17:35:08 -0700
committerBrian Paul <[email protected]>2011-01-22 18:33:35 -0700
commit4c251b88613ae3650a7b9eb255b79a95d0c837a7 (patch)
tree935100fa7698a4cdc731f7a7802c1ddadfa2c955 /src
parentbd67962c5e8469062516da396e9c466a9446e00d (diff)
st/mesa: update comment, use st_fb_orientation()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index f92ca13d5e4..8bccceeec53 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/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