mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-07 12:10:39 +02:00
agx: add helpers for multiblock unit tests
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
parent
a181f3caf4
commit
0dbf1b48d1
1 changed files with 15 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ agx_test_builder(void *memctx)
|
|||
|
||||
agx_block *blk = rzalloc(ctx, agx_block);
|
||||
util_dynarray_init(&blk->predecessors, NULL);
|
||||
ctx->num_blocks = 1;
|
||||
|
||||
list_addtail(&blk->link, &ctx->blocks);
|
||||
list_inithead(&blk->instructions);
|
||||
|
|
@ -31,6 +32,20 @@ agx_test_builder(void *memctx)
|
|||
return b;
|
||||
}
|
||||
|
||||
static inline agx_block *
|
||||
agx_test_block(agx_context *ctx)
|
||||
{
|
||||
agx_block *blk = rzalloc(ctx, agx_block);
|
||||
|
||||
util_dynarray_init(&blk->predecessors, blk);
|
||||
list_addtail(&blk->link, &ctx->blocks);
|
||||
list_inithead(&blk->instructions);
|
||||
|
||||
blk->index = ctx->num_blocks++;
|
||||
|
||||
return blk;
|
||||
}
|
||||
|
||||
/* Helper to compare for logical equality of instructions. Need to compare the
|
||||
* pointers, then compare raw data.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue