From 0b70ebc14c0f66375bc2d6a9ed073dd54ee7aa17 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 9 Feb 2021 19:09:43 -0500 Subject: [PATCH] panfrost: Don't store uniform_count on Midgard 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 Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_assemble.c | 6 +++--- src/gallium/drivers/panfrost/pan_context.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index ba39b75..96ea69b 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -41,11 +41,12 @@ 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; diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 4e41a3e..c9fb1e3 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -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; -- 2.7.4