mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 02:20:11 +01:00
pan/bi: Flatten block lists
From Midgard scheduler. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
parent
39406571ec
commit
3ddff0fa8b
1 changed files with 19 additions and 0 deletions
|
|
@ -136,6 +136,25 @@ bi_lower_cubeface(bi_context *ctx,
|
|||
return cubeface1;
|
||||
}
|
||||
|
||||
/* Flatten linked list to array for O(1) indexing */
|
||||
|
||||
static bi_instr **
|
||||
bi_flatten_block(bi_block *block, unsigned *len)
|
||||
{
|
||||
if (list_is_empty(&block->base.instructions))
|
||||
return NULL;
|
||||
|
||||
*len = list_length(&block->base.instructions);
|
||||
bi_instr **instructions = malloc(sizeof(bi_instr *) * (*len));
|
||||
|
||||
unsigned i = 0;
|
||||
|
||||
bi_foreach_instr_in_block(block, ins)
|
||||
instructions[i++] = ins;
|
||||
|
||||
return instructions;
|
||||
}
|
||||
|
||||
/* Determines messsage type by checking the table and a few special cases. Only
|
||||
* case missing is tilebuffer instructions that access depth/stencil, which
|
||||
* require a Z_STENCIL message (to implement
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue