panfrost: Clamp shader->uniform_count

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>
This commit is contained in:
Alyssa Rosenzweig 2020-08-19 09:52:02 -04:00 committed by Tomeu Vizoso
parent e45142113c
commit 606f05b9ab
3 changed files with 4 additions and 8 deletions

View 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)

View 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 */

View 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;