ra: Document that class index is allocated in order, use that in r300.

etnaviv also relies on this being the case, just drop the remapping.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9437>
This commit is contained in:
Eric Anholt 2021-03-04 15:17:39 -08:00 committed by Marge Bot
parent 3072318ab8
commit 7e0127fb3e
2 changed files with 2 additions and 2 deletions

View file

@ -722,8 +722,7 @@ void rc_init_regalloc_state(struct rc_regalloc_state *s)
for (i = 0; i < RC_REG_CLASS_COUNT; i++) {
ra_q_values[i] = MALLOC(RC_REG_CLASS_COUNT * sizeof(unsigned));
for (j = 0; j < RC_REG_CLASS_COUNT; j++) {
ra_q_values[s->class_ids[i]][s->class_ids[j]] =
q_values[i][j];
ra_q_values[i][j] = q_values[i][j];
}
}

View file

@ -227,6 +227,7 @@ ra_alloc_reg_class(struct ra_regs *regs)
class->regs = rzalloc_array(class, BITSET_WORD, BITSET_WORDS(regs->count));
/* Users may rely on the class index being allocated in order starting from 0. */
return regs->class_count++;
}