diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 3a0ea82db21..d6247d50433 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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); } diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index b8a12766cc0..78ad2c4d03e 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -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