diff options
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 2e58a287a08..37f139274e8 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1639,6 +1639,8 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx, rctx->db_misc_state.atom.dirty = true; } + evergreen_update_db_shader_control(rctx); + /* Calculate the CS size. */ rctx->framebuffer.atom.num_dw = 4; /* SCISSOR */ @@ -2107,6 +2109,7 @@ static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_ r600_write_value(cs, db_render_control); /* R_028000_DB_RENDER_CONTROL */ r600_write_value(cs, db_count_control); /* R_028004_DB_COUNT_CONTROL */ r600_write_context_reg(cs, R_02800C_DB_RENDER_OVERRIDE, db_render_override); + r600_write_context_reg(cs, R_02880C_DB_SHADER_CONTROL, a->db_shader_control); } static void evergreen_emit_vertex_buffers(struct r600_context *rctx, @@ -2410,7 +2413,7 @@ void evergreen_init_state_functions(struct r600_context *rctx) r600_init_atom(rctx, &rctx->cb_misc_state.atom, id++, evergreen_emit_cb_misc_state, 4); r600_init_atom(rctx, &rctx->clip_misc_state.atom, id++, r600_emit_clip_misc_state, 6); r600_init_atom(rctx, &rctx->clip_state.atom, id++, evergreen_emit_clip_state, 26); - r600_init_atom(rctx, &rctx->db_misc_state.atom, id++, evergreen_emit_db_misc_state, 7); + r600_init_atom(rctx, &rctx->db_misc_state.atom, id++, evergreen_emit_db_misc_state, 10); r600_init_atom(rctx, &rctx->dsa_state.atom, id++, r600_emit_cso_state, 0); r600_init_atom(rctx, &rctx->poly_offset_state.atom, id++, evergreen_emit_polygon_offset, 6); r600_init_atom(rctx, &rctx->rasterizer_state.atom, id++, r600_emit_cso_state, 0); @@ -3367,26 +3370,19 @@ void *evergreen_create_db_flush_dsa(struct r600_context *rctx) return rctx->context.create_depth_stencil_alpha_state(&rctx->context, &dsa); } -void evergreen_update_dual_export_state(struct r600_context * rctx) +void evergreen_update_db_shader_control(struct r600_context * rctx) { bool dual_export = rctx->framebuffer.export_16bpc && !rctx->ps_shader->current->ps_depth_export; - unsigned db_source_format = dual_export ? V_02880C_EXPORT_DB_TWO : - V_02880C_EXPORT_DB_FULL; - unsigned db_shader_control = rctx->ps_shader->current->db_shader_control | S_02880C_DUAL_EXPORT_ENABLE(dual_export) | - S_02880C_DB_SOURCE_FORMAT(db_source_format) | + S_02880C_DB_SOURCE_FORMAT(dual_export ? V_02880C_EXPORT_DB_TWO : + V_02880C_EXPORT_DB_FULL) | S_02880C_ALPHA_TO_MASK_DISABLE(rctx->framebuffer.cb0_is_integer); - if (db_shader_control != rctx->db_shader_control) { - struct r600_pipe_state rstate; - - rctx->db_shader_control = db_shader_control; - - rstate.nregs = 0; - r600_pipe_state_add_reg(&rstate, R_02880C_DB_SHADER_CONTROL, db_shader_control); - r600_context_pipe_state_set(rctx, &rstate); + if (db_shader_control != rctx->db_misc_state.db_shader_control) { + rctx->db_misc_state.db_shader_control = db_shader_control; + rctx->db_misc_state.atom.dirty = true; } } |