struct r300_scissor_state {
uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */
uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */
+ uint32_t no_scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */
+ uint32_t no_scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */
};
struct r300_texture_state {
BEGIN_CS(3);
OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
- OUT_CS(scissor->scissor_top_left);
- OUT_CS(scissor->scissor_bottom_right);
+ if (r300->rs_state->rs.scissor) {
+ OUT_CS(scissor->scissor_top_left);
+ OUT_CS(scissor->scissor_bottom_right);
+ } else {
+ OUT_CS(scissor->no_scissor_top_left);
+ OUT_CS(scissor->no_scissor_bottom_right);
+ }
END_CS;
}
r300->framebuffer_state = *state;
r300->dirty_state |= R300_NEW_FRAMEBUFFERS;
+
+ if (r300_screen(r300->context.screen)->caps->is_r500) {
+ r300->scissor_state->no_scissor_top_left =
+ (0 << R300_SCISSORS_X_SHIFT) |
+ (0 << R300_SCISSORS_Y_SHIFT);
+ r300->scissor_state->no_scissor_bottom_right =
+ ((state->width - 1) << R300_SCISSORS_X_SHIFT) |
+ ((state->height - 1) << R300_SCISSORS_Y_SHIFT);
+ } else {
+ /* Offset of 1440 in non-R500 chipsets. */
+ r300->scissor_state->no_scissor_top_left =
+ ((0 + 1440) << R300_SCISSORS_X_SHIFT) |
+ ((0 + 1440) << R300_SCISSORS_Y_SHIFT);
+ r300->scissor_state->no_scissor_bottom_right =
+ (((state->width - 1) + 1440) << R300_SCISSORS_X_SHIFT) |
+ (((state->height - 1) + 1440) << R300_SCISSORS_Y_SHIFT);
+ }
+
+ r300->dirty_state |= R300_NEW_SCISSOR;
}
/* Create fragment shader state. */