From: Marek Olšák Date: Fri, 13 Dec 2019 02:02:13 +0000 (-0500) Subject: radeonsi: fix determining whether the VS prolog is needed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1436c261e93a5503042216156884d43fe4fc9b14;p=mesa.git radeonsi: fix determining whether the VS prolog is needed Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- 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,