From: Marek Olšák Date: Fri, 12 Jul 2019 21:26:24 +0000 (-0400) Subject: radeonsi/gfx10: set as_ngg for GS prolog X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8a526c5cb8a160ef4b4a9db38359247986fe692;p=mesa.git radeonsi/gfx10: set as_ngg for GS prolog as_ngg is required by Wave32. Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Samuel Pitoiset --- diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index a3578ebf720..3cfb1207b4a 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -7023,6 +7023,7 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, memset(&gs_prolog_key, 0, sizeof(gs_prolog_key)); gs_prolog_key.gs_prolog.states = shader->key.part.gs.prolog; gs_prolog_key.gs_prolog.is_monolithic = true; + gs_prolog_key.gs_prolog.as_ngg = shader->key.as_ngg; si_build_gs_prolog_function(&ctx, &gs_prolog_key); gs_prolog = ctx.main_fn; @@ -7260,11 +7261,6 @@ si_get_shader_part(struct si_screen *sscreen, result->key = *key; struct si_shader shader = {}; - struct si_shader_context ctx; - - si_init_shader_ctx(&ctx, sscreen, compiler); - ctx.shader = &shader; - ctx.type = type; switch (type) { case PIPE_SHADER_VERTEX: @@ -7278,6 +7274,7 @@ si_get_shader_part(struct si_screen *sscreen, break; case PIPE_SHADER_GEOMETRY: assert(prolog); + shader.key.as_ngg = key->gs_prolog.as_ngg; break; case PIPE_SHADER_FRAGMENT: if (prolog) @@ -7289,6 +7286,11 @@ si_get_shader_part(struct si_screen *sscreen, unreachable("bad shader part"); } + struct si_shader_context ctx; + si_init_shader_ctx(&ctx, sscreen, compiler); + ctx.shader = &shader; + ctx.type = type; + build(&ctx, key); /* Compile. */ @@ -7699,6 +7701,7 @@ static bool si_shader_select_gs_parts(struct si_screen *sscreen, union si_shader_part_key prolog_key; memset(&prolog_key, 0, sizeof(prolog_key)); prolog_key.gs_prolog.states = shader->key.part.gs.prolog; + prolog_key.gs_prolog.as_ngg = shader->key.as_ngg; shader->prolog2 = si_get_shader_part(sscreen, &sscreen->gs_prologs, PIPE_SHADER_GEOMETRY, true, diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 211e2db1697..15698bcddeb 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -490,6 +490,7 @@ union si_shader_part_key { struct si_gs_prolog_bits states; /* Prologs of monolithic shaders shouldn't set EXEC. */ unsigned is_monolithic:1; + unsigned as_ngg:1; } gs_prolog; struct { struct si_ps_prolog_bits states;