From: Marek Olšák Date: Tue, 24 Jan 2017 23:15:35 +0000 (+0100) Subject: radeonsi: state atom IDs don't have to be off by one X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ccecf79c2b3695962d4c3b46f10968f830ae1e35;p=mesa.git radeonsi: state atom IDs don't have to be off by one Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index da6aca123d1..13b1e34d722 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -435,7 +435,7 @@ static inline void si_set_atom_dirty(struct si_context *sctx, struct r600_atom *atom, bool dirty) { - unsigned bit = 1 << (atom->id - 1); + unsigned bit = 1 << atom->id; if (dirty) sctx->dirty_atoms |= bit; @@ -447,7 +447,7 @@ static inline bool si_is_atom_dirty(struct si_context *sctx, struct r600_atom *atom) { - unsigned bit = 1 << (atom->id - 1); + unsigned bit = 1 << atom->id; return sctx->dirty_atoms & bit; } diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index df4b8135a25..359058b99a2 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -40,7 +40,7 @@ static void si_init_external_atom(struct si_context *sctx, struct r600_atom *atom, struct r600_atom **list_elem) { - atom->id = list_elem - sctx->atoms.array + 1; + atom->id = list_elem - sctx->atoms.array; *list_elem = atom; } @@ -50,7 +50,7 @@ void si_init_atom(struct si_context *sctx, struct r600_atom *atom, void (*emit_func)(struct si_context *ctx, struct r600_atom *state)) { atom->emit = (void*)emit_func; - atom->id = list_elem - sctx->atoms.array + 1; /* index+1 in the atom array */ + atom->id = list_elem - sctx->atoms.array; *list_elem = atom; }