[Mesa-dev] [PATCH 38/40] i965: Consider all viewports before enabling guardband clipping

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


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

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/i965/gen6_clip_state.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c
index 3499e37..ed7afd7 100644
--- a/src/mesa/drivers/dri/i965/gen6_clip_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c
@@ -96,11 +96,15 @@ upload_clip_state(struct brw_context *brw)
    dw2 |= (ctx->Transform.ClipPlanesEnabled <<
            GEN6_USER_CLIP_CLIP_DISTANCES_SHIFT);
 
-   if (ctx->ViewportArray[0].X == 0 &&
-       ctx->ViewportArray[0].Y == 0 &&
-       ctx->ViewportArray[0].Width == (float) fb->Width &&
-       ctx->ViewportArray[0].Height == (float) fb->Height) {
-      dw2 |= GEN6_CLIP_GB_TEST;
+   dw2 |= GEN6_CLIP_GB_TEST;
+   for (unsigned i = 0; i < ctx->Const.MaxViewports; i++) {
+      if (ctx->ViewportArray[i].X != 0 ||
+          ctx->ViewportArray[i].Y != 0 ||
+          ctx->ViewportArray[i].Width != (float) fb->Width ||
+          ctx->ViewportArray[i].Height != (float) fb->Height) {
+         dw2 &= ~GEN6_CLIP_GB_TEST;
+         break;
+      }
    }
 
    /* BRW_NEW_RASTERIZER_DISCARD */
-- 
1.8.1.4



More information about the mesa-dev mailing list