From: Ian Romanick Date: Wed, 8 Jan 2014 03:06:59 +0000 (-0800) Subject: mesa: Restore all the scissor rectangles in _mesa_PopAttrib X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c65db3ebedf884568f9331d00b4759bee28102bb;p=mesa.git mesa: Restore all the scissor rectangles in _mesa_PopAttrib Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index f55433ea65f..db659ad8dc8 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1269,15 +1269,19 @@ _mesa_PopAttrib(void) break; case GL_SCISSOR_BIT: { + unsigned i; const struct gl_scissor_attrib *scissor; scissor = (const struct gl_scissor_attrib *) attr->data; - _mesa_set_scissor(ctx, 0, - scissor->ScissorArray[0].X, - scissor->ScissorArray[0].Y, - scissor->ScissorArray[0].Width, - scissor->ScissorArray[0].Height); - _mesa_set_enable(ctx, GL_SCISSOR_TEST, scissor->EnableFlags & 1); + for (i = 0; i < ctx->Const.MaxViewports; i++) { + _mesa_set_scissor(ctx, i, + scissor->ScissorArray[i].X, + scissor->ScissorArray[i].Y, + scissor->ScissorArray[i].Width, + scissor->ScissorArray[i].Height); + _mesa_set_enablei(ctx, GL_SCISSOR_TEST, i, + (scissor->EnableFlags >> i) & 1); + } } break; case GL_STENCIL_BUFFER_BIT: