From 8060339278e596ed121aed31191c3daf7e3e847b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Wed, 30 May 2018 22:47:10 +0200 Subject: [PATCH] radeonsi/gfx10: change location of instance ID shader input Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeonsi/si_shader.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 6cba8f8f8f1..ecf7f3bf39a 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -4534,11 +4534,17 @@ static void declare_vs_input_vgprs(struct si_shader_context *ctx, 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 */ + } else if (ctx->screen->info.chip_class == GFX10 && + !shader->is_gs_copy_shader) { + add_arg(fninfo, ARG_VGPR, ctx->i32); /* user vgpr */ + 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); ctx->param_vs_prim_id = add_arg(fninfo, ARG_VGPR, ctx->i32); + add_arg(fninfo, ARG_VGPR, ctx->i32); /* unused */ } - add_arg(fninfo, ARG_VGPR, ctx->i32); /* unused */ if (!shader->is_gs_copy_shader) { /* Vertex load indices. */ @@ -7292,7 +7298,10 @@ static void si_build_vs_prolog_function(struct si_shader_context *ctx, } unsigned vertex_id_vgpr = first_vs_vgpr; - unsigned instance_id_vgpr = first_vs_vgpr + (key->vs_prolog.as_ls ? 2 : 1); + unsigned instance_id_vgpr = + ctx->screen->info.chip_class >= GFX10 ? + first_vs_vgpr + 3 : + first_vs_vgpr + (key->vs_prolog.as_ls ? 2 : 1); ctx->abi.vertex_id = input_vgprs[vertex_id_vgpr]; ctx->abi.instance_id = input_vgprs[instance_id_vgpr]; -- 2.30.2