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 <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: <mesa-stable@lists.freedesktop.org>
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);
}
/**