From ccecf79c2b3695962d4c3b46f10968f830ae1e35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 25 Jan 2017 00:15:35 +0100 Subject: [PATCH] radeonsi: state atom IDs don't have to be off by one MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_pipe.h | 4 ++-- src/gallium/drivers/radeonsi/si_state.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.30.2