summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-09-11 13:37:30 -0400
committerIlia Mirkin <[email protected]>2016-09-12 20:07:21 -0400
commit742832434abc8caff2425fcc174966b2834ac552 (patch)
treeab9e9c5804d6908c65a09d7a1e2efe408f2e72d1 /src
parent6b9d7e69ee7fd1162f7ac231a337630d859c493b (diff)
st/mesa: fix is_scissor_enabled when X/Y are negative
Similar to commit 49c24d8a24 ("i965: fix noop_scissor range issue on width/height") - take the X/Y into account to determine whether the scissor covers the whole area or not. Fixes the recently-added gl-1.0-scissor-depth-clear-negative-xy piglit test. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index e70cba6f938..813ba9b10ff 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -313,11 +313,13 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers)
static inline GLboolean
is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
{
+ const struct gl_scissor_rect *scissor = &ctx->Scissor.ScissorArray[0];
+
return (ctx->Scissor.EnableFlags & 1) &&
- (ctx->Scissor.ScissorArray[0].X > 0 ||
- ctx->Scissor.ScissorArray[0].Y > 0 ||
- (unsigned) ctx->Scissor.ScissorArray[0].Width < rb->Width ||
- (unsigned) ctx->Scissor.ScissorArray[0].Height < rb->Height);
+ (scissor->X > 0 ||
+ scissor->Y > 0 ||
+ scissor->X + scissor->Width < rb->Width ||
+ scissor->Y + scissor->Height < rb->Height);
}
/**