nvc0: remove vport_int hack and instead use the usual state validation

Commit ad4dc772 fixed an issue with the viewport not being restored
correctly. However it's rather hackish and confusing. Instead just mark
the viewport dirty and let the viewport validation take care of it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Ilia Mirkin
2014-06-15 17:05:35 -04:00
parent 8658fe3e4c
commit 7e7097a4f4
3 changed files with 3 additions and 11 deletions
@@ -202,7 +202,6 @@ struct nvc0_context {
struct pipe_surface *surfaces[2][NVC0_MAX_SURFACE_SLOTS];
uint16_t surfaces_dirty[2];
uint16_t surfaces_valid[2];
uint32_t vport_int[2];
struct util_dynarray global_residents;
@@ -299,11 +299,6 @@ nvc0_validate_viewport(struct nvc0_context *nvc0)
PUSH_DATA (push, (w << 16) | x);
PUSH_DATA (push, (h << 16) | y);
if (i == 0) {
nvc0->vport_int[0] = (w << 16) | x;
nvc0->vport_int[1] = (h << 16) | y;
}
zmin = vp->translate[2] - fabsf(vp->scale[2]);
zmax = vp->translate[2] + fabsf(vp->scale[2]);
@@ -1012,11 +1012,13 @@ nvc0_blitctx_post_blit(struct nvc0_blitctx *blit)
nvc0->dirty = blit->saved.dirty |
(NVC0_NEW_FRAMEBUFFER | NVC0_NEW_SCISSOR | NVC0_NEW_SAMPLE_MASK |
NVC0_NEW_RASTERIZER | NVC0_NEW_ZSA | NVC0_NEW_BLEND |
NVC0_NEW_VIEWPORT |
NVC0_NEW_TEXTURES | NVC0_NEW_SAMPLERS |
NVC0_NEW_VERTPROG | NVC0_NEW_FRAGPROG |
NVC0_NEW_TCTLPROG | NVC0_NEW_TEVLPROG | NVC0_NEW_GMTYPROG |
NVC0_NEW_TFB_TARGETS | NVC0_NEW_VERTEX | NVC0_NEW_ARRAYS);
nvc0->scissors_dirty |= 1;
nvc0->viewports_dirty |= 1;
nvc0->base.pipe.set_min_samples(&nvc0->base.pipe, blit->saved.min_samples);
}
@@ -1188,11 +1190,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
nvc0_blitctx_post_blit(blit);
/* restore viewport */
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, nvc0->vport_int[0]);
PUSH_DATA (push, nvc0->vport_int[1]);
/* restore viewport transform */
IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1);
}