Module: Mesa Branch: main Commit: 89e0f544223034a902f5459103e66ce3f245bc95 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=89e0f544223034a902f5459103e66ce3f245bc95
Author: Alyssa Rosenzweig <[email protected]> Date: Sun Sep 11 11:17:15 2022 -0400 agx: Don't use nir_find_variable_with_driver_location io_semantics is the preferred alternative. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18525> --- src/asahi/compiler/agx_compile.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 3528238a236..654f4c641cc 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -437,13 +437,9 @@ agx_emit_store_vary(agx_builder *b, nir_intrinsic_instr *instr) static agx_instr * agx_emit_fragment_out(agx_builder *b, nir_intrinsic_instr *instr) { - const nir_variable *var = - nir_find_variable_with_driver_location(b->shader->nir, - nir_var_shader_out, nir_intrinsic_base(instr)); - assert(var); - - unsigned loc = var->data.location; - assert(var->data.index == 0 && "todo: dual-source blending"); + nir_io_semantics sem = nir_intrinsic_io_semantics(instr); + unsigned loc = sem.location; + assert(sem.dual_source_blend_index == 0 && "todo: dual-source blending"); assert(loc == FRAG_RESULT_DATA0 && "todo: MRT"); unsigned rt = (loc - FRAG_RESULT_DATA0); @@ -474,13 +470,9 @@ agx_emit_fragment_out(agx_builder *b, nir_intrinsic_instr *instr) static void agx_emit_load_tile(agx_builder *b, agx_index *dests, nir_intrinsic_instr *instr) { - const nir_variable *var = - nir_find_variable_with_driver_location(b->shader->nir, - nir_var_shader_out, nir_intrinsic_base(instr)); - assert(var); - - unsigned loc = var->data.location; - assert(var->data.index == 0 && "todo: dual-source blending"); + nir_io_semantics sem = nir_intrinsic_io_semantics(instr); + unsigned loc = sem.location; + assert(sem.dual_source_blend_index == 0 && "dual src ld_tile is nonsense"); assert(loc == FRAG_RESULT_DATA0 && "todo: MRT"); unsigned rt = (loc - FRAG_RESULT_DATA0);
