From 1436c261e93a5503042216156884d43fe4fc9b14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 12 Dec 2019 21:02:13 -0500 Subject: [PATCH] radeonsi: fix determining whether the VS prolog is needed Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_shader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 0f96b5f6088..88b082de451 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5993,7 +5993,9 @@ static bool si_vs_needs_prolog(const struct si_shader_selector *sel, { /* VGPR initialization fixup for Vega10 and Raven is always done in the * VS prolog. */ - return sel->vs_needs_prolog || key->ls_vgpr_fix; + return sel->vs_needs_prolog || + key->ls_vgpr_fix || + key->unpack_instance_id_from_vertex_id; } LLVMValueRef si_is_es_thread(struct si_shader_context *ctx) @@ -6932,7 +6934,7 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, if (shader->is_monolithic && ctx.type == PIPE_SHADER_VERTEX) { LLVMValueRef parts[2]; - bool need_prolog = sel->vs_needs_prolog; + bool need_prolog = si_vs_needs_prolog(sel, &shader->key.part.vs.prolog); parts[1] = ctx.main_fn; @@ -7055,7 +7057,8 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, es_main = ctx.main_fn; /* ES prolog */ - if (es->vs_needs_prolog) { + if (es->type == PIPE_SHADER_VERTEX && + si_vs_needs_prolog(es, &shader->key.part.gs.vs_prolog)) { union si_shader_part_key vs_prolog_key; si_get_vs_prolog_key(&es->info, shader_es.info.num_input_sgprs, -- 2.30.2