From 2e2ad61ef1b085642bbb49297b4308758d9b892a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 26 Mar 2019 22:07:47 +0100 Subject: [PATCH] zink: add curr_cmdbuf-helper Acked-by: Jordan Justen --- src/gallium/drivers/zink/zink_context.c | 2 +- src/gallium/drivers/zink/zink_context.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index c868e7c98d6..13e630ca65b 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -994,7 +994,7 @@ zink_flush(struct pipe_context *pctx, if (pfence) zink_fence_reference(zink_screen(pctx->screen), (struct zink_fence **)pfence, - ctx->cmdbufs[0].fence); + zink_context_curr_cmdbuf(ctx)->fence); } static void diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 629321c72ba..ed5fe183f65 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -105,6 +105,12 @@ zink_context(struct pipe_context *context) return (struct zink_context *)context; } +static inline struct zink_cmdbuf * +zink_context_curr_cmdbuf(struct zink_context *ctx) +{ + return ctx->cmdbufs + 0; +} + void zink_resource_barrier(VkCommandBuffer cmdbuf, struct zink_resource *res, VkImageAspectFlags aspect, VkImageLayout new_layout); -- 2.30.2