From 141e084f55cb05fd1d7eafd300a2752475f6e1fa Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 1 Feb 2024 23:25:41 -0400 Subject: [PATCH] asahi: use load_instance_id in gs lowering it will lower differently in the prepass vs the rast shader Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/agx_nir_lower_gs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/asahi/lib/agx_nir_lower_gs.c b/src/asahi/lib/agx_nir_lower_gs.c index a4ba8d0814a..1189fcc9d6d 100644 --- a/src/asahi/lib/agx_nir_lower_gs.c +++ b/src/asahi/lib/agx_nir_lower_gs.c @@ -205,10 +205,11 @@ lower_gs_inputs(nir_builder *b, nir_intrinsic_instr *intr, void *key) /* The unrolled vertex ID uses the input_vertices, which differs from what * our load_num_vertices will return (vertices vs primitives). */ - nir_def *unrolled = nir_iadd( - b, - nir_imul(b, load_instance_id(b), load_geometry_param(b, input_vertices)), - vertex); + nir_def *unrolled = + nir_iadd(b, + nir_imul(b, nir_load_instance_id(b), + load_geometry_param(b, input_vertices)), + vertex); /* Calculate the address of the input given the unrolled vertex ID */ nir_def *addr = libagx_vertex_output_address(