panfrost: Derive texture/sampler_count from shader

This avoids a dependency of the shader descriptor on the texture/sampler
state, which simplifies state management. It also fixes pandecode
warnings where textures/samplers are specified but not referenced.

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-21 10:03:15 -04:00 committed by Tomeu Vizoso
parent d353b15bee
commit 3bb61e21f8
3 changed files with 6 additions and 4 deletions

View File

@ -201,6 +201,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
state->reads_frag_coord = s->info.system_values_read & (1 << SYSTEM_VALUE_FRAG_COORD);
state->writes_global = s->info.writes_memory;
state->texture_count = s->info.num_textures;
switch (stage) {
case MESA_SHADER_VERTEX:

View File

@ -318,8 +318,8 @@ panfrost_emit_compute_shader(struct panfrost_context *ctx,
meta->shader = ss->shader;
meta->attribute_count = ss->attribute_count;
meta->varying_count = ss->varying_count;
meta->texture_count = ctx->sampler_view_count[st];
meta->sampler_count = ctx->sampler_count[st];
meta->texture_count = ss->texture_count;
meta->sampler_count = ss->texture_count; /* Combined on mesa/st */
if (dev->quirks & IS_BIFROST) {
struct mali_bifrost_properties_packed prop;
@ -573,8 +573,8 @@ panfrost_emit_frag_shader(struct panfrost_context *ctx,
fragmeta->shader = fs->shader;
fragmeta->attribute_count = fs->attribute_count;
fragmeta->varying_count = fs->varying_count;
fragmeta->texture_count = ctx->sampler_view_count[PIPE_SHADER_FRAGMENT];
fragmeta->sampler_count = ctx->sampler_count[PIPE_SHADER_FRAGMENT];
fragmeta->texture_count = fs->texture_count;
fragmeta->sampler_count = fs->texture_count; /* Combined on mesa/st */
if (dev->quirks & IS_BIFROST) {
struct mali_bifrost_properties_packed prop;

View File

@ -188,6 +188,7 @@ struct panfrost_shader_state {
unsigned uniform_count;
unsigned work_reg_count;
unsigned attribute_count;
unsigned texture_count;
bool can_discard;
bool writes_point_size;
bool writes_depth;