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:
parent
7b88dbfd78
commit
db0fda6f36
|
@ -1018,6 +1018,7 @@ update_existing_vbo(struct zink_context *ctx, unsigned slot)
|
||||||
if (!ctx->vertex_buffers[slot].buffer.resource)
|
if (!ctx->vertex_buffers[slot].buffer.resource)
|
||||||
return;
|
return;
|
||||||
struct zink_resource *res = zink_resource(ctx->vertex_buffers[slot].buffer.resource);
|
struct zink_resource *res = zink_resource(ctx->vertex_buffers[slot].buffer.resource);
|
||||||
|
res->vbo_bind_count--;
|
||||||
res->vbo_bind_mask &= ~BITFIELD_BIT(slot);
|
res->vbo_bind_mask &= ~BITFIELD_BIT(slot);
|
||||||
update_res_bind_count(ctx, res, false, true);
|
update_res_bind_count(ctx, res, false, true);
|
||||||
}
|
}
|
||||||
|
@ -1054,6 +1055,7 @@ zink_set_vertex_buffers(struct pipe_context *pctx,
|
||||||
if (vb->buffer.resource) {
|
if (vb->buffer.resource) {
|
||||||
struct zink_resource *res = zink_resource(vb->buffer.resource);
|
struct zink_resource *res = zink_resource(vb->buffer.resource);
|
||||||
res->vbo_bind_mask |= BITFIELD_BIT(start_slot + i);
|
res->vbo_bind_mask |= BITFIELD_BIT(start_slot + i);
|
||||||
|
res->vbo_bind_count++;
|
||||||
update_res_bind_count(ctx, res, false, false);
|
update_res_bind_count(ctx, res, false, false);
|
||||||
ctx_vb->stride = vb->stride;
|
ctx_vb->stride = vb->stride;
|
||||||
ctx_vb->buffer_offset = vb->buffer_offset;
|
ctx_vb->buffer_offset = vb->buffer_offset;
|
||||||
|
|
|
@ -123,6 +123,7 @@ struct zink_resource {
|
||||||
struct util_range valid_buffer_range;
|
struct util_range valid_buffer_range;
|
||||||
uint32_t vbo_bind_mask : PIPE_MAX_ATTRIBS;
|
uint32_t vbo_bind_mask : PIPE_MAX_ATTRIBS;
|
||||||
uint8_t ubo_bind_count[2];
|
uint8_t ubo_bind_count[2];
|
||||||
|
uint8_t vbo_bind_count;
|
||||||
uint8_t so_bind_count; //not counted in all_binds
|
uint8_t so_bind_count; //not counted in all_binds
|
||||||
bool so_valid;
|
bool so_valid;
|
||||||
uint32_t ubo_bind_mask[PIPE_SHADER_TYPES];
|
uint32_t ubo_bind_mask[PIPE_SHADER_TYPES];
|
||||||
|
|
Loading…
Reference in New Issue