zink: add curr_cmdbuf-helper
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 26 Mar 2019 21:07:47 +0000 (22:07 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:44 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h

index c868e7c98d6bc9b967f065b10cda60d538e572e5..13e630ca65b0ef15d166aa4252b7d50698317e8a 100644 (file)
@@ -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
index 629321c72bac57173b9265bc31a731ad19caa9f2..ed5fe183f65102e085070acde389eb4b16252471 100644 (file)
@@ -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);