struct brw_cc_viewport *ccv;
ccv = brw_state_batch(brw, AUB_TRACE_CC_VP_STATE,
- sizeof(*ccv), 32, &brw->cc.vp_offset);
+ sizeof(*ccv) * ctx->Const.MaxViewports, 32,
+ &brw->cc.vp_offset);
/* _NEW_TRANSFORM */
- if (ctx->Transform.DepthClamp) {
- /* _NEW_VIEWPORT */
- ccv->min_depth = MIN2(ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far);
- ccv->max_depth = MAX2(ctx->ViewportArray[0].Near, ctx->ViewportArray[0].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;
+ }
}
- brw->state.dirty.cache |= CACHE_NEW_CC_VP;
+ SET_DIRTY_BIT(cache, CACHE_NEW_CC_VP);
}
const struct brw_tracked_state brw_cc_vp = {
}
/**
- * Creates the state cache entry for the given CC unit key.
+ * Creates a CC unit packet from the current blend state.
*/
static void upload_cc_unit(struct brw_context *brw)
{
cc->cc5.statistics_enable = 1;
/* CACHE_NEW_CC_VP */
- cc->cc4.cc_viewport_state_offset = (brw->batch.bo->offset +
+ cc->cc4.cc_viewport_state_offset = (brw->batch.bo->offset64 +
brw->cc.vp_offset) >> 5; /* reloc */
- brw->state.dirty.cache |= CACHE_NEW_CC_UNIT;
+ SET_DIRTY_BIT(cache, CACHE_NEW_CC_UNIT);
/* Emit CC viewport relocation */
drm_intel_bo_emit_reloc(brw->batch.bo,