pan/bi: Return the size of the last clause from bi_pack
Will be used for calculating prefetch size. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
@@ -914,11 +914,13 @@ bi_collect_blend_ret_addr(bi_context *ctx, struct util_dynarray *emission,
|
||||
assert(!(ctx->blend_ret_offsets[loc] & 0x7));
|
||||
}
|
||||
|
||||
void
|
||||
unsigned
|
||||
bi_pack(bi_context *ctx, struct util_dynarray *emission)
|
||||
{
|
||||
bool tdd = bi_terminate_discarded_threads(ctx);
|
||||
|
||||
unsigned previous_size = emission->size;
|
||||
|
||||
bi_foreach_block(ctx, _block) {
|
||||
bi_block *block = (bi_block *) _block;
|
||||
|
||||
@@ -937,12 +939,16 @@ bi_pack(bi_context *ctx, struct util_dynarray *emission)
|
||||
bi_clause *next = bi_next_clause(ctx, _block, clause);
|
||||
bi_clause *next_2 = is_last ? succ_clause : NULL;
|
||||
|
||||
previous_size = emission->size;
|
||||
|
||||
bi_pack_clause(ctx, clause, next, next_2, emission, ctx->stage, tdd);
|
||||
|
||||
if (!is_last)
|
||||
bi_collect_blend_ret_addr(ctx, emission, clause);
|
||||
}
|
||||
}
|
||||
|
||||
return emission->size - previous_size;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
@@ -761,7 +761,8 @@ bi_is_terminal_block(bi_context *ctx, bi_block *block)
|
||||
|
||||
/* Code emit */
|
||||
|
||||
void bi_pack(bi_context *ctx, struct util_dynarray *emission);
|
||||
/* Returns the size of the final clause */
|
||||
unsigned bi_pack(bi_context *ctx, struct util_dynarray *emission);
|
||||
|
||||
struct bi_packed_tuple {
|
||||
uint64_t lo;
|
||||
|
||||
Reference in New Issue
Block a user