summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-10 16:24:55 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-10 16:24:55 -0600
commit717831ea712c07e18f2c2e797c49754bf2500e5e (patch)
treecf4edd8655cce8b24ccb11f35cbe0f4c13c1c1db /src
parentfb4ff8a2a8c0adbe1925d42eaaedfa52707c7ffb (diff)
invert Y for scissor
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_scissor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
index 05a9f3eed1..2bf633828e 100644
--- a/src/mesa/state_tracker/st_atom_scissor.c
+++ b/src/mesa/state_tracker/st_atom_scissor.c
@@ -44,6 +44,7 @@ update_scissor( struct st_context *st )
{
struct pipe_scissor_state scissor;
const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ GLint miny, maxy;
scissor.minx = 0;
scissor.miny = 0;
@@ -66,6 +67,13 @@ update_scissor( struct st_context *st )
scissor.minx = scissor.miny = scissor.maxx = scissor.maxy = 0;
}
+ /* Now invert Y. Pipe drivers use the convention Y=0=top for surfaces
+ */
+ miny = fb->Height - scissor.maxy;
+ maxy = fb->Height - scissor.miny;
+ scissor.miny = miny;
+ scissor.maxy = maxy;
+
if (memcmp(&scissor, &st->state.scissor, sizeof(scissor)) != 0) {
/* state has changed */
st->state.scissor = scissor; /* struct copy */