- 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;
+ 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;
+ }