summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2017-01-25 00:15:35 +0100
committerMarek Olšák <marek.olsak@amd.com>2017-01-30 13:27:14 +0100
commitccecf79c2b3695962d4c3b46f10968f830ae1e35 (patch)
tree2a4422967cc544e68eb5c0108be03d13e02c09f8
parentac059f1c238ff8f9a6a1852ec9c89858e7276700 (diff)
radeonsi: state atom IDs don't have to be off by one
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h4
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c4
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;
}