asahi: use load_instance_id in gs lowering

it will lower differently in the prepass vs the rast shader

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-02-01 23:25:41 -04:00 committed by Marge Bot
parent 3641a37e8f
commit 141e084f55

View file

@ -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(