From ab075de53baa9829780cc133e5ac06e5498a763c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 5 Oct 2012 04:59:50 +0200 Subject: r600g: atomize polygon offset state POLY_OFFSET_DB_FMT_CNTL is moved to the framebuffer state, because it only depends on the zbuffer format. Reviewed-by: Jerome Glisse --- src/gallium/drivers/r600/r600_state_common.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r600/r600_state_common.c') diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index fe800f25a51..e30ec3dae7d 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -328,10 +328,12 @@ static void r600_bind_rs_state(struct pipe_context *ctx, void *state) rctx->states[rs->rstate.id] = &rs->rstate; r600_context_pipe_state_set(rctx, &rs->rstate); - if (rctx->chip_class >= EVERGREEN) { - evergreen_polygon_offset_update(rctx); - } else { - r600_polygon_offset_update(rctx); + if (rs->offset_enable && + (rs->offset_units != rctx->poly_offset_state.offset_units || + rs->offset_scale != rctx->poly_offset_state.offset_scale)) { + rctx->poly_offset_state.offset_units = rs->offset_units; + rctx->poly_offset_state.offset_scale = rs->offset_scale; + rctx->poly_offset_state.atom.dirty = true; } /* Update clip_misc_state. */ -- cgit v1.2.3