panfrost: Don't store uniform_count on Midgard
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 10 Feb 2021 00:09:43 +0000 (19:09 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Feb 2021 17:24:37 +0000 (17:24 +0000)
We weren't reading it anywhere outside this function, no need to keep
the extra copy of the data around. Avoids a footgun since this field
isn't even used on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8973>

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

index ba39b75..96ea69b 100644 (file)
 
 static void
 pan_prepare_midgard_props(struct panfrost_shader_state *state,
+                          panfrost_program *program,
                           gl_shader_stage stage)
 {
         pan_prepare(&state->properties, RENDERER_PROPERTIES);
         state->properties.uniform_buffer_count = state->ubo_count;
-        state->properties.midgard.uniform_count = state->uniform_count;
+        state->properties.midgard.uniform_count = program->uniform_cutoff;
         state->properties.midgard.shader_has_side_effects = state->writes_global;
 
         /* TODO: Select the appropriate mode. Suppresing inf/nan works around
@@ -373,7 +374,6 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         if (outputs_written)
                 *outputs_written = s->info.outputs_written;
 
-        state->uniform_count = program->uniform_cutoff;
         state->work_reg_count = program->work_register_count;
 
         if (pan_is_bifrost(dev))
@@ -413,7 +413,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         if (pan_is_bifrost(dev))
                 pan_prepare_bifrost_props(state, program, stage);
         else
-                pan_prepare_midgard_props(state, stage);
+                pan_prepare_midgard_props(state, program, stage);
 
         state->properties.stencil_from_shader = state->writes_stencil;
         state->properties.shader_contains_barrier = state->helper_invocations;
index 4e41a3e..c9fb1e3 100644 (file)
@@ -215,7 +215,6 @@ struct panfrost_shader_state {
         struct MALI_PRELOAD preload;
 
         /* Non-descript information */
-        unsigned uniform_count;
         unsigned work_reg_count;
         bool can_discard;
         bool writes_point_size;