diff options
author | Cooper Yuan <[email protected]> | 2009-08-27 17:46:59 +0800 |
---|---|---|
committer | Cooper Yuan <[email protected]> | 2009-08-27 17:46:59 +0800 |
commit | ba87cbf2be04d9d14d7e0b6d40508edadd4705e9 (patch) | |
tree | 4e31b35cf01d3ed09ee5a4a6d9c33ca27da2a0e5 /src/gallium/drivers/r300 | |
parent | 82ff3190de3cd6cf4a514bac00ae02597abfb963 (diff) |
r300g: Correct scissor setting, subtract 1 from window's width and height
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_surface.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 27680a38631..c16cadd0407 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -538,16 +538,16 @@ static void r300_set_scissor_state(struct pipe_context* pipe, (state->minx << R300_SCISSORS_X_SHIFT) | (state->miny << R300_SCISSORS_Y_SHIFT); r300->scissor_state->scissor_bottom_right = - (state->maxx << R300_SCISSORS_X_SHIFT) | - (state->maxy << R300_SCISSORS_Y_SHIFT); + ((state->maxx - 1) << R300_SCISSORS_X_SHIFT) | + ((state->maxy - 1) << R300_SCISSORS_Y_SHIFT); } else { /* Offset of 1440 in non-R500 chipsets. */ r300->scissor_state->scissor_top_left = ((state->minx + 1440) << R300_SCISSORS_X_SHIFT) | ((state->miny + 1440) << R300_SCISSORS_Y_SHIFT); r300->scissor_state->scissor_bottom_right = - ((state->maxx + 1440) << R300_SCISSORS_X_SHIFT) | - ((state->maxy + 1440) << R300_SCISSORS_Y_SHIFT); + (((state->maxx - 1) + 1440) << R300_SCISSORS_X_SHIFT) | + (((state->maxy - 1) + 1440) << R300_SCISSORS_Y_SHIFT); } r300->dirty_state |= R300_NEW_SCISSOR; diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index a093f839454..96e6e4a77d4 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -58,13 +58,13 @@ static void r300_surface_setup(struct r300_context* r300, OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); if (caps->is_r500) { OUT_CS((x << R300_SCISSORS_X_SHIFT) | (y << R300_SCISSORS_Y_SHIFT)); - OUT_CS((w << R300_SCISSORS_X_SHIFT) | (h << R300_SCISSORS_Y_SHIFT)); + OUT_CS(((w - 1) << R300_SCISSORS_X_SHIFT) | ((h - 1) << R300_SCISSORS_Y_SHIFT)); } else { /* Non-R500 chipsets have an offset of 1440 in their scissors. */ OUT_CS(((x + 1440) << R300_SCISSORS_X_SHIFT) | ((y + 1440) << R300_SCISSORS_Y_SHIFT)); - OUT_CS(((w + 1440) << R300_SCISSORS_X_SHIFT) | - ((h + 1440) << R300_SCISSORS_Y_SHIFT)); + OUT_CS((((w - 1) + 1440) << R300_SCISSORS_X_SHIFT) | + (((h - 1) + 1440) << R300_SCISSORS_Y_SHIFT)); } /* Flush colorbuffer and blend caches. */ |