From 3542d5ce6b39309aa02844a4eaf9a1eafaec9280 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Sat, 23 Jul 2022 18:30:45 +0800 Subject: [PATCH] radeonsi: fix NGG VS primitive ID load MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When NGG VS need to export primitive ID, it will load it in GS threads, so need to use gs_prim_id arg. Current nir to llvm translator check vs_prim_id present to use vs_prim_id first. Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/gallium/drivers/radeonsi/si_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index dd21c9182de..73dd8d4ee0d 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -334,7 +334,8 @@ static void declare_vs_input_vgprs(struct si_shader_context *ctx, unsigned *num_ } else if (ctx->screen->info.gfx_level >= GFX10) { ac_add_arg(&ctx->args, AC_ARG_VGPR, 1, AC_ARG_INT, NULL); /* user VGPR */ ac_add_arg(&ctx->args, AC_ARG_VGPR, 1, AC_ARG_INT, - &ctx->args.vs_prim_id); /* user vgpr or PrimID (legacy) */ + /* user vgpr or PrimID (legacy) */ + shader->key.ge.as_ngg ? NULL : &ctx->args.vs_prim_id); ac_add_arg(&ctx->args, AC_ARG_VGPR, 1, AC_ARG_INT, &ctx->args.instance_id); } else { ac_add_arg(&ctx->args, AC_ARG_VGPR, 1, AC_ARG_INT, &ctx->args.instance_id); -- 2.34.1