Mesa (master): i965/gen6: Upload all the clip viewports

Chris Forbes chrisf at kemper.freedesktop.org
Wed May 6 07:02:25 UTC 2015


Module: Mesa
Branch: master
Commit: 2a8835d4854a49087fb032a927209dac50dfa827
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a8835d4854a49087fb032a927209dac50dfa827

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Wed May  6 17:34:27 2015 +1200

i965/gen6: Upload all the clip viewports

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/gen6_viewport_state.c |   40 ++++++++++++-----------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c
index 0c63283..95d204f 100644
--- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c
@@ -42,27 +42,29 @@ gen6_upload_clip_vp(struct brw_context *brw)
    struct brw_clipper_viewport *vp;
 
    vp = brw_state_batch(brw, AUB_TRACE_CLIP_VP_STATE,
-			sizeof(*vp), 32, &brw->clip.vp_offset);
+                        sizeof(*vp) * ctx->Const.MaxViewports, 32, &brw->clip.vp_offset);
 
-   /* According to the "Vertex X,Y Clamping and Quantization" section of the
-    * Strips and Fans documentation, objects must not have a screen-space
-    * extents of over 8192 pixels, or they may be mis-rasterized.  The maximum
-    * screen space coordinates of a small object may larger, but we have no
-    * way to enforce the object size other than through clipping.
-    *
-    * If you're surprised that we set clip to -gbx to +gbx and it seems like
-    * we'll end up with 16384 wide, note that for a 8192-wide render target,
-    * we'll end up with a normal (-1, 1) clip volume that just covers the
-    * drawable.
-    */
-   const float maximum_post_clamp_delta = 8192;
-   float gbx = maximum_post_clamp_delta / ctx->ViewportArray[0].Width;
-   float gby = maximum_post_clamp_delta / ctx->ViewportArray[0].Height;
+   for (unsigned i = 0; i < ctx->Const.MaxViewports; i++) {
+      /* According to the "Vertex X,Y Clamping and Quantization" section of the
+       * Strips and Fans documentation, objects must not have a screen-space
+       * extents of over 8192 pixels, or they may be mis-rasterized.  The maximum
+       * screen space coordinates of a small object may larger, but we have no
+       * way to enforce the object size other than through clipping.
+       *
+       * If you're surprised that we set clip to -gbx to +gbx and it seems like
+       * we'll end up with 16384 wide, note that for a 8192-wide render target,
+       * we'll end up with a normal (-1, 1) clip volume that just covers the
+       * drawable.
+       */
+      const float maximum_post_clamp_delta = 8192;
+      float gbx = maximum_post_clamp_delta / ctx->ViewportArray[i].Width;
+      float gby = maximum_post_clamp_delta / ctx->ViewportArray[i].Height;
 
-   vp->xmin = -gbx;
-   vp->xmax = gbx;
-   vp->ymin = -gby;
-   vp->ymax = gby;
+      vp[i].xmin = -gbx;
+      vp[i].xmax = gbx;
+      vp[i].ymin = -gby;
+      vp[i].ymax = gby;
+   }
 
    brw->ctx.NewDriverState |= BRW_NEW_CLIP_VP;
 }




More information about the mesa-commit mailing list