diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index f9c2e854e3c..3196524a681 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1836,10 +1836,6 @@ agx_compile_shader_nir(nir_shader *nir, agx_builder _b = agx_init_builder(ctx, agx_after_block(last_block)); agx_stop(&_b); - /* Also add traps to match the blob, unsure what the function is */ - for (unsigned i = 0; i < 8; ++i) - agx_trap(&_b); - /* Index blocks now that we're done emitting so the order is consistent */ agx_foreach_block(ctx, block) block->index = ctx->num_blocks++; diff --git a/src/asahi/compiler/agx_pack.c b/src/asahi/compiler/agx_pack.c index 3e304b4b5e2..f22206ef536 100644 --- a/src/asahi/compiler/agx_pack.c +++ b/src/asahi/compiler/agx_pack.c @@ -701,5 +701,11 @@ agx_pack_binary(agx_context *ctx, struct util_dynarray *emission) util_dynarray_foreach(&fixups, struct agx_branch_fixup, fixup) agx_fixup_branch(emission, *fixup); + /* Dougall calls the instruction in this footer "trap". Match the blob. */ + for (unsigned i = 0; i < 8; ++i) { + uint16_t trap = agx_opcodes_info[AGX_OPCODE_TRAP].encoding.exact; + util_dynarray_append(emission, uint16_t, trap); + } + util_dynarray_fini(&fixups); }