pan/bi: Add bi_temp{_reg} for new-style bi_index

Variant of bi_make_temp{_reg} returning a bi_index.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
Alyssa Rosenzweig 2020-12-11 20:02:25 -05:00
parent 903a818f33
commit fc760e7d66
1 changed files with 14 additions and 0 deletions

View File

@ -715,6 +715,20 @@ bi_max_temp(bi_context *ctx)
return ((alloc + 2 + ctx->temp_alloc) << 1);
}
static inline bi_index
bi_temp(bi_context *ctx)
{
unsigned alloc = (ctx->impl->ssa_alloc + ctx->temp_alloc++);
return bi_get_index(alloc, false, 0);
}
static inline bi_index
bi_temp_reg(bi_context *ctx)
{
unsigned alloc = (ctx->impl->reg_alloc + ctx->temp_alloc++);
return bi_get_index(alloc, true, 0);
}
static inline unsigned
bi_make_temp(bi_context *ctx)
{