From ba87cbf2be04d9d14d7e0b6d40508edadd4705e9 Mon Sep 17 00:00:00 2001 From: Cooper Yuan Date: Thu, 27 Aug 2009 17:46:59 +0800 Subject: [PATCH] r300g: Correct scissor setting, subtract 1 from window's width and height --- src/gallium/drivers/r300/r300_state.c | 8 ++++---- 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. */ -- 2.30.2