uint32_t state_offset, *dw;
unsigned i;
- ILO_DEV_ASSERT(builder->dev, 7, 7.5);
+ ILO_DEV_ASSERT(builder->dev, 7, 8);
/*
* From the Ivy Bridge PRM, volume 2 part 1, page 270:
dw[5] = fui(vp->m32);
dw[6] = 0;
dw[7] = 0;
+
dw[8] = fui(vp->min_gbx);
dw[9] = fui(vp->max_gbx);
dw[10] = fui(vp->min_gby);
dw[11] = fui(vp->max_gby);
- dw[12] = 0;
- dw[13] = 0;
- dw[14] = 0;
- dw[15] = 0;
+
+ if (ilo_dev_gen(builder->dev) >= ILO_GEN(8)) {
+ dw[12] = fui(vp->min_x);
+ dw[13] = fui(vp->max_x - 1.0f);
+ dw[14] = fui(vp->min_y);
+ dw[15] = fui(vp->max_y - 1.0f);
+ } else {
+ dw[12] = 0;
+ dw[13] = 0;
+ dw[14] = 0;
+ dw[15] = 0;
+ }
dw += 16;
}
dw = writer_dw(builder, which, offset, 11, "SF_CLIP VP%d", i);
ilo_printf("guardband ymax = %f\n", uif(dw));
+ if (ilo_dev_gen(builder->dev) >= ILO_GEN(8)) {
+ dw = writer_dw(builder, which, offset, 12, "SF_CLIP VP%d", i);
+ ilo_printf("extent xmin = %f\n", uif(dw));
+
+ dw = writer_dw(builder, which, offset, 13, "SF_CLIP VP%d", i);
+ ilo_printf("extent xmax = %f\n", uif(dw));
+
+ dw = writer_dw(builder, which, offset, 14, "SF_CLIP VP%d", i);
+ ilo_printf("extent ymin = %f\n", uif(dw));
+
+ dw = writer_dw(builder, which, offset, 15, "SF_CLIP VP%d", i);
+ ilo_printf("extent ymax = %f\n", uif(dw));
+ }
+
offset += state_size;
}
}
unsigned i;
/*
- * We do not do 2D clipping yet. Guard band test should only be enabled
- * when the viewport is larger than the framebuffer.
+ * Gen8+ has viewport extent test. Guard band test can be enabled on
+ * prior Gens only when the viewport is larger than the framebuffer,
+ * unless we emulate viewport extent test on them.
*/
- for (i = 0; i < vec->viewport.count; i++) {
- const struct ilo_viewport_cso *vp = &vec->viewport.cso[i];
-
- if (vp->min_x > 0.0f || vp->max_x < vec->fb.state.width ||
- vp->min_y > 0.0f || vp->max_y < vec->fb.state.height) {
- enable_guardband = false;
- break;
+ if (ilo_dev_gen(r->dev) < ILO_GEN(8)) {
+ for (i = 0; i < vec->viewport.count; i++) {
+ const struct ilo_viewport_cso *vp = &vec->viewport.cso[i];
+
+ if (vp->min_x > 0.0f || vp->max_x < vec->fb.state.width ||
+ vp->min_y > 0.0f || vp->max_y < vec->fb.state.height) {
+ enable_guardband = false;
+ break;
+ }
}
}