From c78640ce319e323ee2fdfac0d5b4dfce797baf0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 7 Feb 2018 01:11:10 +0100 Subject: [PATCH] radeonsi: set correct num_input_sgprs for VS prolog in merged shaders MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We need to take num_input_sgprs from VS, not the second shader. No apps suffered from this. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_shader.c | 48 ++++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 288f7434bb2..54f90fcac72 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -6750,18 +6750,6 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, si_build_tcs_epilog_function(&ctx, &tcs_epilog_key); parts[3] = ctx.main_fn; - /* VS prolog */ - if (vs_needs_prolog) { - union si_shader_part_key vs_prolog_key; - si_get_vs_prolog_key(&ls->info, - shader->info.num_input_sgprs, - &shader->key.part.tcs.ls_prolog, - shader, &vs_prolog_key); - vs_prolog_key.vs_prolog.is_monolithic = true; - si_build_vs_prolog_function(&ctx, &vs_prolog_key); - parts[0] = ctx.main_fn; - } - /* VS as LS main part */ struct si_shader shader_ls = {}; shader_ls.selector = ls; @@ -6777,6 +6765,18 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, shader->info.uses_instanceid |= ls->info.uses_instanceid; parts[1] = ctx.main_fn; + /* LS prolog */ + if (vs_needs_prolog) { + union si_shader_part_key vs_prolog_key; + si_get_vs_prolog_key(&ls->info, + shader_ls.info.num_input_sgprs, + &shader->key.part.tcs.ls_prolog, + shader, &vs_prolog_key); + vs_prolog_key.vs_prolog.is_monolithic = true; + si_build_vs_prolog_function(&ctx, &vs_prolog_key); + parts[0] = ctx.main_fn; + } + /* Reset the shader context. */ ctx.shader = shader; ctx.type = PIPE_SHADER_TESS_CTRL; @@ -6814,18 +6814,6 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, si_build_gs_prolog_function(&ctx, &gs_prolog_key); gs_prolog = ctx.main_fn; - /* ES prolog */ - if (es->vs_needs_prolog) { - union si_shader_part_key vs_prolog_key; - si_get_vs_prolog_key(&es->info, - shader->info.num_input_sgprs, - &shader->key.part.gs.vs_prolog, - shader, &vs_prolog_key); - vs_prolog_key.vs_prolog.is_monolithic = true; - si_build_vs_prolog_function(&ctx, &vs_prolog_key); - es_prolog = ctx.main_fn; - } - /* ES main part */ struct si_shader shader_es = {}; shader_es.selector = es; @@ -6841,6 +6829,18 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, shader->info.uses_instanceid |= es->info.uses_instanceid; es_main = ctx.main_fn; + /* ES prolog */ + if (es->vs_needs_prolog) { + union si_shader_part_key vs_prolog_key; + si_get_vs_prolog_key(&es->info, + shader_es.info.num_input_sgprs, + &shader->key.part.gs.vs_prolog, + shader, &vs_prolog_key); + vs_prolog_key.vs_prolog.is_monolithic = true; + si_build_vs_prolog_function(&ctx, &vs_prolog_key); + es_prolog = ctx.main_fn; + } + /* Reset the shader context. */ ctx.shader = shader; ctx.type = PIPE_SHADER_GEOMETRY; -- 2.30.2