zink: track vertex buffer bind counts on resources

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
This commit is contained in:
Mike Blumenkrantz 2022-06-17 10:55:10 -04:00 committed by Marge Bot
parent 7b88dbfd78
commit db0fda6f36
2 changed files with 3 additions and 0 deletions

View File

@ -1018,6 +1018,7 @@ update_existing_vbo(struct zink_context *ctx, unsigned slot)
if (!ctx->vertex_buffers[slot].buffer.resource)
return;
struct zink_resource *res = zink_resource(ctx->vertex_buffers[slot].buffer.resource);
res->vbo_bind_count--;
res->vbo_bind_mask &= ~BITFIELD_BIT(slot);
update_res_bind_count(ctx, res, false, true);
}
@ -1054,6 +1055,7 @@ zink_set_vertex_buffers(struct pipe_context *pctx,
if (vb->buffer.resource) {
struct zink_resource *res = zink_resource(vb->buffer.resource);
res->vbo_bind_mask |= BITFIELD_BIT(start_slot + i);
res->vbo_bind_count++;
update_res_bind_count(ctx, res, false, false);
ctx_vb->stride = vb->stride;
ctx_vb->buffer_offset = vb->buffer_offset;

View File

@ -123,6 +123,7 @@ struct zink_resource {
struct util_range valid_buffer_range;
uint32_t vbo_bind_mask : PIPE_MAX_ATTRIBS;
uint8_t ubo_bind_count[2];
uint8_t vbo_bind_count;
uint8_t so_bind_count; //not counted in all_binds
bool so_valid;
uint32_t ubo_bind_mask[PIPE_SHADER_TYPES];