ilo: update SF_CLIP_VIEWPORT for Gen8

This commit is contained in:
Chia-I Wu 2015-01-26 16:23:29 +08:00
parent b64aeebbcc
commit 9ab0165375
3 changed files with 39 additions and 13 deletions

View File

@ -1056,7 +1056,7 @@ gen7_SF_CLIP_VIEWPORT(struct ilo_builder *builder,
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:
@ -1084,14 +1084,23 @@ gen7_SF_CLIP_VIEWPORT(struct ilo_builder *builder,
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;
}

View File

@ -192,6 +192,20 @@ writer_decode_sf_clip_viewport_gen7(const struct ilo_builder *builder,
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;
}
}

View File

@ -637,16 +637,19 @@ gen6_draw_clip(struct ilo_render *r,
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 (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;
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;
}
}
}