panfrost: Move uniform_count to pan_assemble
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 8 Apr 2020 18:44:31 +0000 (14:44 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 10 Apr 2020 14:53:53 +0000 (16:53 +0200)
Again, not Midgard specific.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4505>

src/gallium/drivers/panfrost/pan_assemble.c
src/panfrost/midgard/midgard_compile.c
src/panfrost/util/pan_ir.h

index 513c55f08e777f968d262fe12aabdf899264ab47..4f8e14b105e0c7a0bc3928d7638af3e259b86f11 100644 (file)
@@ -146,8 +146,6 @@ panfrost_shader_compile(struct panfrost_context *ctx,
 
         util_dynarray_fini(&program.compiled);
 
-        /* Sysvals are prepended */
-        program.uniform_count += program.sysval_count;
         state->sysval_count = program.sysval_count;
         memcpy(state->sysval, program.sysvals, sizeof(state->sysval[0]) * state->sysval_count);
 
@@ -193,8 +191,9 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         if (outputs_written)
                 *outputs_written = s->info.outputs_written;
 
-        /* Separate as primary uniform count is truncated */
-        state->uniform_count = program.uniform_count;
+        /* Separate as primary uniform count is truncated. Sysvals are prefix
+         * uniforms */
+        state->uniform_count = s->num_uniforms + program.sysval_count;
         state->uniform_cutoff = program.uniform_cutoff;
         state->work_reg_count = program.work_register_count;
 
index d23d53bec918bb6496efa16c653fdca10c94512e..1dc021a2fb048ec0070d3ead23c6192e981c8275 100644 (file)
@@ -2626,8 +2626,6 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
          * (post-optimisation) */
 
         panfrost_nir_assign_sysvals(&ctx->sysvals, nir);
-
-        program->uniform_count = nir->num_uniforms;
         program->sysval_count = ctx->sysvals.sysval_count;
         memcpy(program->sysvals, ctx->sysvals.sysvals, sizeof(ctx->sysvals.sysvals[0]) * ctx->sysvals.sysval_count);
 
index 72f282163a7887793adabf0e459c7d4b0e426179..16d2a2b2f674866d175bc2ca468f66213362a406 100644 (file)
@@ -84,7 +84,6 @@ panfrost_sysval_for_instr(nir_instr *instr, nir_dest *dest);
 
 typedef struct {
         int work_register_count;
-        int uniform_count;
         int uniform_cutoff;
 
         /* Prepended before uniforms, mapping to SYSVAL_ names for the