- sizeof(*ccv), 32, &brw->cc.vp_offset);
-
- /* _NEW_TRANSOFORM */
- if (ctx->Transform.DepthClamp) {
- /* _NEW_VIEWPORT */
- ccv->min_depth = MIN2(ctx->Viewport.Near, ctx->Viewport.Far);
- ccv->max_depth = MAX2(ctx->Viewport.Near, ctx->Viewport.Far);
- } else {
- ccv->min_depth = 0.0;
- ccv->max_depth = 1.0;
+ sizeof(*ccv) * ctx->Const.MaxViewports, 32,
+ &brw->cc.vp_offset);
+
+ /* _NEW_TRANSFORM */
+ for (unsigned i = 0; i < ctx->Const.MaxViewports; i++) {
+ if (ctx->Transform.DepthClamp) {
+ /* _NEW_VIEWPORT */
+ ccv[i].min_depth = MIN2(ctx->ViewportArray[i].Near,
+ ctx->ViewportArray[i].Far);
+ ccv[i].max_depth = MAX2(ctx->ViewportArray[i].Near,
+ ctx->ViewportArray[i].Far);
+ } else {
+ ccv[i].min_depth = 0.0;
+ ccv[i].max_depth = 1.0;
+ }