diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 338b0319d38..d3fb649a28f 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -732,6 +732,7 @@ emit_block(agx_context *ctx, nir_block *block) agx_block *blk = agx_create_block(ctx); list_addtail(&blk->link, &ctx->blocks); list_inithead(&blk->instructions); + ctx->current_block = blk; agx_builder _b = agx_init_builder(ctx, agx_after_block(blk)); diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 0c45c0e0b60..a9d818d83c6 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -321,6 +321,9 @@ typedef struct { /* I don't really understand how writeout ops work yet */ bool did_writeout; + /* During instruction selection, for inserting control flow */ + agx_block *current_block; + /* Stats for shader-db */ unsigned loop_count; unsigned spills;