Mesa (master): panfrost: Move uniform_count to pan_assemble

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 10 15:11:42 UTC 2020


Module: Mesa
Branch: master
Commit: e30091bc5162e560320e46abf23be8748cb269ae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e30091bc5162e560320e46abf23be8748cb269ae

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Apr  8 14:44:31 2020 -0400

panfrost: Move uniform_count to pan_assemble

Again, not Midgard specific.

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

---

 src/gallium/drivers/panfrost/pan_assemble.c | 7 +++----
 src/panfrost/midgard/midgard_compile.c      | 2 --
 src/panfrost/util/pan_ir.h                  | 1 -
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index 513c55f08e7..4f8e14b105e 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -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;
 
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index d23d53bec91..1dc021a2fb0 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -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);
 
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index 72f282163a7..16d2a2b2f67 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -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



More information about the mesa-commit mailing list