panfrost: Clamp shader->uniform_count
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 19 Aug 2020 13:52:02 +0000 (09:52 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:34 +0000 (17:05 +0200)
Rather than passing the clamp out-of-band to be done at draw-time, just
handle it together in pan_assemble.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>

src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_context.h

index e16d7ea9f59516f136cbded23f168af07058b8bb..7a7200da425ef03e22038526fdc3e9209ff5b129 100644 (file)
@@ -260,8 +260,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
 
         /* 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->uniform_count = MIN2(s->num_uniforms + program.sysval_count, program.uniform_cutoff);
         state->work_reg_count = program.work_register_count;
 
         if (dev->quirks & IS_BIFROST)
index 7e5772f8ca3a6e5b509728a94f5469d3295723a7..155f480f18eca395ff876dec332ba9b4d0b024d4 100644 (file)
@@ -338,11 +338,9 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
                         SET_BIT(meta->bifrost2.preload_regs, 0x10, ss->reads_frag_coord);
                 }
 
-                meta->bifrost2.uniform_count = MIN2(ss->uniform_count,
-                                                    ss->uniform_cutoff);
+                meta->bifrost2.uniform_count = ss->uniform_count;
         } else {
-                meta->midgard1.uniform_count = MIN2(ss->uniform_count,
-                                                    ss->uniform_cutoff);
+                meta->midgard1.uniform_count = ss->uniform_count;
                 meta->midgard1.work_count = ss->work_reg_count;
 
                 /* TODO: This is not conformant on ES3 */
index 48873a7925342d219c087eb910fc065e2918dd38..6e655b3d472c824282fc09b383c7fa0d21617eeb 100644 (file)
@@ -185,8 +185,7 @@ struct panfrost_shader_state {
         bool compiled;
 
         /* Non-descript information */
-        int uniform_count;
-        unsigned uniform_cutoff;
+        unsigned uniform_count;
         unsigned work_reg_count;
         unsigned attribute_count;
         bool can_discard;