r600g: simplify dirty atom tracking

Now that R600_NUM_ATOMS is below 64, dirty atom tracking can be
simplified.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 1f96ed6..39c65ae 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -1427,8 +1427,8 @@
 	struct r600_context *rctx = (struct r600_context *)ctx;
 	struct pipe_draw_info info = *dinfo;
 	struct pipe_index_buffer ib = {};
-	unsigned i;
 	struct radeon_winsys_cs *cs = rctx->b.rings.gfx.cs;
+	uint64_t mask;
 
 	if (!info.indirect && !info.count && (info.indexed || !info.count_from_stream_output)) {
 		return;
@@ -1538,10 +1538,9 @@
 	r600_need_cs_space(rctx, ib.user_buffer ? 5 : 0, TRUE);
 	r600_flush_emit(rctx);
 
-	i = r600_next_dirty_atom(rctx, 0);
-	while (i < R600_NUM_ATOMS) {
-		r600_emit_atom(rctx, rctx->atoms[i]);
-		i = r600_next_dirty_atom(rctx, i + 1);
+	mask = rctx->dirty_atoms;
+	while (mask != 0) {
+		r600_emit_atom(rctx, rctx->atoms[u_bit_scan64(&mask)]);
 	}
 
 	if (rctx->b.chip_class == CAYMAN) {