aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-03-25 14:59:44 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:44 +0000
commit229cd042d3a53e9057b3e8052ae47959deb7c647 (patch)
treeb22396388d6cc9cd0325f5f20c280a224c8f2d27
parentac45bc2359393d92ddba0e6dc4f3833df4918f27 (diff)
zink: move cmdbuf-resetting into a helper
Acked-by: Jordan Justen <[email protected]>
-rw-r--r--src/gallium/drivers/zink/zink_cmdbuf.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/zink/zink_cmdbuf.c b/src/gallium/drivers/zink/zink_cmdbuf.c
index 8d868558dfb..df55b2377f5 100644
--- a/src/gallium/drivers/zink/zink_cmdbuf.c
+++ b/src/gallium/drivers/zink/zink_cmdbuf.c
@@ -6,16 +6,22 @@
#include "util/u_debug.h"
+static void
+reset_cmdbuf(struct zink_screen *screen, struct zink_cmdbuf *cmdbuf)
+{
+ // cmdbuf hasn't been submitted before
+ if (!cmdbuf->fence)
+ return;
+
+ zink_fence_finish(screen, cmdbuf->fence, PIPE_TIMEOUT_INFINITE);
+ zink_fence_reference(screen, &cmdbuf->fence, NULL);
+}
+
struct zink_cmdbuf *
zink_start_cmdbuf(struct zink_context *ctx)
{
struct zink_cmdbuf *cmdbuf = &ctx->cmdbuf;
-
- if (cmdbuf->fence) {
- struct zink_screen *screen = zink_screen(ctx->base.screen);
- zink_fence_finish(screen, cmdbuf->fence, PIPE_TIMEOUT_INFINITE);
- zink_fence_reference(screen, &cmdbuf->fence, NULL);
- }
+ reset_cmdbuf(zink_screen(ctx->base.screen), cmdbuf);
VkCommandBufferBeginInfo cbbi = {};
cbbi.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;