diff options
author | Eric Anholt <[email protected]> | 2016-10-14 15:15:13 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-10-16 11:22:50 -0700 |
commit | 46cd3bab933196f46521c9462552ed19d16817e6 (patch) | |
tree | 7b374c35fe3232b89c94c3e168d4005109e049a7 /src | |
parent | 07422bf32b847493a1362e20eb0883c0e48fea84 (diff) |
state_tracker: Fix check for scissor enabled when < 0.
DEQP's clear tests like to give us x + w < 0 or y + h < 0. Since we
were comparing to an unsigned, it would get promoted to unsigned and come
out as bignum >= width or height and we would clear the whole fb instead
of none of the fb.
Fixes 10 tests under deqp-gles2/functional/color_clear.
Reviewed-by: Kenneth Graunke <[email protected]>
Acked-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 813ba9b10ff..158efc186c0 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -318,8 +318,8 @@ is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb) return (ctx->Scissor.EnableFlags & 1) && (scissor->X > 0 || scissor->Y > 0 || - scissor->X + scissor->Width < rb->Width || - scissor->Y + scissor->Height < rb->Height); + scissor->X + scissor->Width < (int)rb->Width || + scissor->Y + scissor->Height < (int)rb->Height); } /** |