summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-01-17 23:13:51 +0100
committerCorbin Simpson <[email protected]>2010-01-24 23:03:29 -0800
commit9f8ec533123f07f29b084e8a46fc35c498b3a670 (patch)
treeb7ee1a398814aff25a28f13d52f0fe13cd0b1103 /src/gallium/drivers/r300
parentb7a002df1e06504ff1ed0dc005c9b10aa4be54f7 (diff)
r300g: fix zero-area scissor
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index e07185b7783..36d2c64b587 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -686,6 +686,22 @@ void r300_emit_scissor_state(struct r300_context* r300, void* state)
maxy = MIN2(maxy, scissor->maxy);
}
+ /* Special case for zero-area scissor.
+ *
+ * We can't allow the variables maxx and maxy to be zero because they are
+ * subtracted from later in the code, which would cause emitting ~0 and
+ * making the kernel checker angry.
+ *
+ * Let's consider we change maxx and maxy to 1, which is effectively
+ * a one-pixel area. We must then change minx and miny to a number which is
+ * greater than 1 to get the zero area back. */
+ if (!maxx || !maxy) {
+ minx = 2;
+ miny = 2;
+ maxx = 1;
+ maxy = 1;
+ }
+
if (r300screen->caps->is_r500) {
top_left =
(minx << R300_SCISSORS_X_SHIFT) |