zink: track overall samplerview bind counts

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17192>
This commit is contained in:
Mike Blumenkrantz 2022-06-20 11:03:56 -04:00 committed by Marge Bot
parent 49cc3696bd
commit 7d56912208
2 changed files with 3 additions and 0 deletions

View file

@ -1549,6 +1549,7 @@ unbind_samplerview(struct zink_context *ctx, enum pipe_shader_type stage, unsign
if (!sv || !sv->base.texture)
return;
struct zink_resource *res = zink_resource(sv->base.texture);
res->sampler_bind_count[stage == PIPE_SHADER_COMPUTE]--;
check_samplerview_for_batch_ref(ctx, sv);
update_res_bind_count(ctx, res, stage == PIPE_SHADER_COMPUTE, true);
res->sampler_binds[stage] &= ~BITFIELD_BIT(slot);
@ -1580,6 +1581,7 @@ zink_set_sampler_views(struct pipe_context *pctx,
if (a)
unbind_samplerview(ctx, shader_type, start_slot + i);
update_res_bind_count(ctx, res, shader_type == PIPE_SHADER_COMPUTE, false);
res->sampler_bind_count[shader_type == PIPE_SHADER_COMPUTE]++;
} else if (a != b) {
check_samplerview_for_batch_ref(ctx, a);
}

View file

@ -143,6 +143,7 @@ struct zink_resource {
};
uint32_t sampler_binds[PIPE_SHADER_TYPES];
uint32_t image_binds[PIPE_SHADER_TYPES];
uint16_t sampler_bind_count[2]; //gfx, compute
uint16_t image_bind_count[2]; //gfx, compute
uint16_t write_bind_count[2]; //gfx, compute
uint16_t bindless[2]; //tex, img