mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
zink: add function for waiting on a specific batch's fence
previously we only had zink_fence_wait(), which just waits on the current batch to finish, but it may be the case that we don't want to wait on all batches up to that point, so we can optimize a bit by only waiting as long as we have to Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8662>
This commit is contained in:
parent
53d9beb9b8
commit
2bc24c7e46
2 changed files with 17 additions and 0 deletions
|
|
@ -1149,6 +1149,20 @@ zink_fence_wait(struct pipe_context *pctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
zink_wait_on_batch(struct zink_context *ctx, int batch_id)
|
||||||
|
{
|
||||||
|
if (batch_id >= 0) {
|
||||||
|
struct zink_batch *batch = &ctx->batches[batch_id];
|
||||||
|
if (batch != zink_curr_batch(ctx)) {
|
||||||
|
ctx->base.screen->fence_finish(ctx->base.screen, NULL, (struct pipe_fence_handle*)batch->fence,
|
||||||
|
PIPE_TIMEOUT_INFINITE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zink_fence_wait(&ctx->base);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
zink_memory_barrier(struct pipe_context *pctx, unsigned flags)
|
zink_memory_barrier(struct pipe_context *pctx, unsigned flags)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,9 @@ zink_batch_no_rp(struct zink_context *ctx);
|
||||||
void
|
void
|
||||||
zink_fence_wait(struct pipe_context *ctx);
|
zink_fence_wait(struct pipe_context *ctx);
|
||||||
|
|
||||||
|
void
|
||||||
|
zink_wait_on_batch(struct zink_context *ctx, int batch_id);
|
||||||
|
|
||||||
void
|
void
|
||||||
zink_resource_barrier(VkCommandBuffer cmdbuf, struct zink_resource *res,
|
zink_resource_barrier(VkCommandBuffer cmdbuf, struct zink_resource *res,
|
||||||
VkImageAspectFlags aspect, VkImageLayout new_layout);
|
VkImageAspectFlags aspect, VkImageLayout new_layout);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue