radeonsi/gfx10: set as_ngg for GS prolog
authorMarek Olšák <marek.olsak@amd.com>
Fri, 12 Jul 2019 21:26:24 +0000 (17:26 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 20 Jul 2019 00:16:19 +0000 (20:16 -0400)
as_ngg is required by Wave32.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h

index a3578ebf720efda6f44d437108b56e1a73d10421..3cfb1207b4a94ef7bdb1504c319977d6a335585f 100644 (file)
@@ -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,
index 211e2db169782280794b84bc9c34dd0e7011cabb..15698bcddebb2567d729debd06f479e8b4739037 100644 (file)
@@ -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;