From: Alyssa Rosenzweig Date: Wed, 19 Aug 2020 13:52:02 +0000 (-0400) Subject: panfrost: Clamp shader->uniform_count X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=606f05b9ab3c54acd1a7a0a6d8ad805e9d2bf7fc;p=mesa.git 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 Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index e16d7ea9f59..7a7200da425 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -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) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 7e5772f8ca3..155f480f18e 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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 */ diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 48873a79253..6e655b3d472 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -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;