From: Nicolai Hähnle Date: Fri, 31 Aug 2018 17:58:35 +0000 (+0200) Subject: radeonsi/gfx10: use correct VGPR for instance ID in LS shader X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=591537c7fa2aedb7c6dca3c2dd76a3810c94728b;p=mesa.git radeonsi/gfx10: use correct VGPR for instance ID in LS shader Acked-by: Bas Nieuwenhuizen --- 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 */