From 591537c7fa2aedb7c6dca3c2dd76a3810c94728b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 31 Aug 2018 19:58:35 +0200 Subject: [PATCH] radeonsi/gfx10: use correct VGPR for instance ID in LS shader Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeonsi/si_shader.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 7f4fc22f175..a99a58e5675 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -4547,8 +4547,13 @@ static void declare_vs_input_vgprs(struct si_shader_context *ctx, add_arg_assign(fninfo, ARG_VGPR, ctx->i32, &ctx->abi.vertex_id); if (shader->key.as_ls) { ctx->param_rel_auto_id = add_arg(fninfo, ARG_VGPR, ctx->i32); - add_arg_assign(fninfo, ARG_VGPR, ctx->i32, &ctx->abi.instance_id); - add_arg(fninfo, ARG_VGPR, ctx->i32); /* unused */ + if (ctx->screen->info.chip_class >= GFX10) { + add_arg(fninfo, ARG_VGPR, ctx->i32); /* user VGPR */ + add_arg_assign(fninfo, ARG_VGPR, ctx->i32, &ctx->abi.instance_id); + } else { + add_arg_assign(fninfo, ARG_VGPR, ctx->i32, &ctx->abi.instance_id); + add_arg(fninfo, ARG_VGPR, ctx->i32); /* unused */ + } } else if (ctx->screen->info.chip_class == GFX10 && !shader->is_gs_copy_shader) { add_arg(fninfo, ARG_VGPR, ctx->i32); /* user vgpr */ -- 2.30.2