diff --git a/src/asahi/clc/asahi_clc.c b/src/asahi/clc/asahi_clc.c index d2f8e9b97ac..7cd4f571f20 100644 --- a/src/asahi/clc/asahi_clc.c +++ b/src/asahi/clc/asahi_clc.c @@ -91,6 +91,26 @@ lower_builtins(nir_builder *b, nir_instr *instr, void *data) nir_store_deref(b, nir_src_as_deref(call->params[0]), nir_stack_unmap_agx(b, call->params[1].ssa), 1); return true; + } else if (strcmp(func->name, "nir_load_core_id_agx") == 0) { + b->cursor = nir_instr_remove(&call->instr); + nir_store_deref(b, nir_src_as_deref(call->params[0]), + nir_load_core_id_agx(b), 1); + return true; + } else if (strcmp(func->name, "nir_load_helper_op_id_agx") == 0) { + b->cursor = nir_instr_remove(&call->instr); + nir_store_deref(b, nir_src_as_deref(call->params[0]), + nir_load_helper_op_id_agx(b, 1, 32), 1); + return true; + } else if (strcmp(func->name, "nir_load_helper_arg_lo_agx") == 0) { + b->cursor = nir_instr_remove(&call->instr); + nir_store_deref(b, nir_src_as_deref(call->params[0]), + nir_load_helper_arg_lo_agx(b, 1, 32), 1); + return true; + } else if (strcmp(func->name, "nir_load_helper_arg_hi_agx") == 0) { + b->cursor = nir_instr_remove(&call->instr); + nir_store_deref(b, nir_src_as_deref(call->params[0]), + nir_load_helper_arg_hi_agx(b, 1, 32), 1); + return true; } return false; diff --git a/src/asahi/lib/shaders/libagx.h b/src/asahi/lib/shaders/libagx.h index 6db8025bb97..ff09ce587c8 100644 --- a/src/asahi/lib/shaders/libagx.h +++ b/src/asahi/lib/shaders/libagx.h @@ -27,6 +27,10 @@ uint32_t nir_interleave_agx(uint16_t x, uint16_t y); void nir_doorbell_agx(uint8_t value); void nir_stack_map_agx(uint16_t index, uint32_t address); uint32_t nir_stack_unmap_agx(uint16_t index); +uint32_t nir_load_core_id_agx(void); +uint32_t nir_load_helper_op_id_agx(void); +uint32_t nir_load_helper_arg_lo_agx(void); +uint32_t nir_load_helper_arg_hi_agx(void); #endif