radeonsi: remove 8 bytes from si_shader_key with uint32_t ff_tcs_inputs_to_copy
authorMarek Olšák <marek.olsak@amd.com>
Fri, 9 Jun 2017 15:26:27 +0000 (17:26 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 12 Jun 2017 16:24:37 +0000 (18:24 +0200)
The previous patch helps with this.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index 4ee4a64f531f7f8dcdc62f1e3065fc862665765e..e525a1807633ad46a5dc73ec0611b5270ec89dce 100644 (file)
@@ -2493,7 +2493,8 @@ static void si_copy_tcs_inputs(struct lp_build_tgsi_context *bld_base)
        lds_base = get_tcs_in_current_patch_offset(ctx);
        lds_base = LLVMBuildAdd(gallivm->builder, lds_base, lds_vertex_offset, "");
 
-       inputs = ctx->shader->key.mono.u.ff_tcs_inputs_to_copy;
+       inputs = ctx->shader->key.mono.u.ff_tcs_inputs_to_copy[0] |
+                ((uint64_t)ctx->shader->key.mono.u.ff_tcs_inputs_to_copy[1] << 32);
        while (inputs) {
                unsigned i = u_bit_scan64(&inputs);
 
@@ -5284,7 +5285,10 @@ static void si_dump_shader_key(unsigned processor, const struct si_shader *shade
                                              "part.tcs.ls_prolog", f);
                }
                fprintf(f, "  part.tcs.epilog.prim_mode = %u\n", key->part.tcs.epilog.prim_mode);
-               fprintf(f, "  mono.u.ff_tcs_inputs_to_copy = 0x%"PRIx64"\n", key->mono.u.ff_tcs_inputs_to_copy);
+               fprintf(f, "  mono.u.ff_tcs_inputs_to_copy[0] = 0x%x\n",
+                       key->mono.u.ff_tcs_inputs_to_copy[0]);
+               fprintf(f, "  mono.u.ff_tcs_inputs_to_copy[1] = 0x%x\n",
+                       key->mono.u.ff_tcs_inputs_to_copy[1]);
                break;
 
        case PIPE_SHADER_TESS_EVAL:
index 76e09b27e7cd62c1ed94c7ae599fa7fcc81f3da8..ed1df2bfa7d582f9843c6cbf55bc23d67a4f0a84 100644 (file)
@@ -492,7 +492,8 @@ struct si_shader_key {
                uint8_t         vs_fix_fetch[SI_MAX_ATTRIBS];
 
                union {
-                       uint64_t        ff_tcs_inputs_to_copy; /* for fixed-func TCS */
+                       /* Don't use "uint64_t" in order to get 32-bit alignment. */
+                       uint32_t        ff_tcs_inputs_to_copy[2]; /* for fixed-func TCS */
                        /* When PS needs PrimID and GS is disabled. */
                        unsigned        vs_export_prim_id:1;
                } u;
index 15e46b5a5e8edb48ad4269d14886a36ea30b5bef..6247b9c006e1940627cfe3b219039319868e7f76 100644 (file)
@@ -1283,8 +1283,12 @@ static inline void si_shader_selector_key(struct pipe_context *ctx,
                key->part.tcs.epilog.tes_reads_tess_factors =
                        sctx->tes_shader.cso->info.reads_tess_factors;
 
-               if (sel == sctx->fixed_func_tcs_shader.cso)
-                       key->mono.u.ff_tcs_inputs_to_copy = sctx->vs_shader.cso->outputs_written;
+               if (sel == sctx->fixed_func_tcs_shader.cso) {
+                       uint64_t outputs_written = sctx->vs_shader.cso->outputs_written;
+
+                       key->mono.u.ff_tcs_inputs_to_copy[0] = outputs_written;
+                       key->mono.u.ff_tcs_inputs_to_copy[1] = outputs_written >> 32;
+               }
                break;
        case PIPE_SHADER_TESS_EVAL:
                if (sctx->gs_shader.cso)