zink: set vbo resource usage on bind

this is how other descriptor binds work, and it makes repeated draws
with the same vbo binds faster since this was a redundant operation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
This commit is contained in:
Mike Blumenkrantz
2022-03-17 11:30:52 -04:00
committed by Marge Bot
parent 8294d45424
commit 3472fed4da
2 changed files with 1 additions and 1 deletions
+1
View File
@@ -987,6 +987,7 @@ zink_set_vertex_buffers(struct pipe_context *pctx,
update_res_bind_count(ctx, res, false, false);
ctx_vb->stride = vb->stride;
ctx_vb->buffer_offset = vb->buffer_offset;
zink_batch_resource_usage_set(&ctx->batch, res, false);
/* always barrier before possible rebind */
zink_resource_buffer_barrier(ctx, res, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT,
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT);
-1
View File
@@ -144,7 +144,6 @@ zink_bind_vertex_buffers(struct zink_batch *batch, struct zink_context *ctx)
buffer_strides[i] = vb->stride;
if (DYNAMIC_STATE == ZINK_DYNAMIC_VERTEX_INPUT)
elems->hw_state.dynbindings[i].stride = vb->stride;
zink_batch_resource_usage_set(&ctx->batch, zink_resource(vb->buffer.resource), false);
} else {
buffers[i] = zink_resource(ctx->dummy_vertex_buffer)->obj->buffer;
buffer_offsets[i] = 0;