summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2015-05-06 17:34:27 +1200
committerChris Forbes <[email protected]>2015-05-06 19:01:55 +1200
commit2a8835d4854a49087fb032a927209dac50dfa827 (patch)
tree5a488f7d0a6d68c0a9b2ed5beca764430723ab4b
parent0374159b0ce3c4634364ca5ab257e305765d4879 (diff)
i965/gen6: Upload all the clip viewports
Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/gen6_viewport_state.c40
1 files 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 0c632830815..95d204f5c78 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;
}