void r600_constant_buffers_dirty(struct r600_context *rctx, struct r600_constbuf_state *state)
{
- r600_inval_shader_cache(rctx);
- state->atom.num_dw = rctx->chip_class >= EVERGREEN ? util_bitcount(state->dirty_mask)*20
- : util_bitcount(state->dirty_mask)*19;
- r600_atom_dirty(rctx, &state->atom);
+ if (state->dirty_mask) {
+ r600_inval_shader_cache(rctx);
+ state->atom.num_dw = rctx->chip_class >= EVERGREEN ? util_bitcount(state->dirty_mask)*20
+ : util_bitcount(state->dirty_mask)*19;
+ r600_atom_dirty(rctx, &state->atom);
+ }
}
void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index,