[Mesa-dev] [PATCH 18/40] mesa: Restore all the scissor rectangles in _mesa_PopAttrib

Ian Romanick idr at freedesktop.org
Fri Jan 10 17:40:19 PST 2014


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/attrib.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index f55433e..db659ad 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:
-- 
1.8.1.4



More information about the mesa-dev mailing list