zink: use sampler_bind_count to simplify some code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17524>
This commit is contained in:
Mike Blumenkrantz 2022-07-11 21:49:55 -04:00 committed by Marge Bot
parent 3a47576687
commit 960a6316d4

View file

@ -2354,8 +2354,8 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns
layout = zink_render_pass_attachment_get_barrier_info(&rt, i < ctx->fb_state.nr_cbufs, &pipeline, &access);
}
zink_resource_image_barrier(ctx, res, layout, access, pipeline);
if (i == ctx->fb_state.nr_cbufs && res->bind_count[0] && res->bind_count[0] != res->image_bind_count[0]) {
unsigned find = res->bind_count[0] - res->image_bind_count[0];
if (i == ctx->fb_state.nr_cbufs && res->sampler_bind_count[0]) {
unsigned find = res->sampler_bind_count[0];
for (unsigned i = 0; find && i < PIPE_SHADER_COMPUTE; i++) {
u_foreach_bit(slot, res->sampler_binds[i]) {
/* only set layout, skip rest of update */