summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-10 12:40:01 +0200
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:45 +0000
commit03efb6dd27b9ad8aafc8d06a4b8bd338fa850f89 (patch)
treec4074a22b85cf71ccc885409df2a36a31b29b5b7 /src
parent8edd357795bf71c98bca73de34d962ddbaacccc4 (diff)
zink: cleanup zink_end_batch
This inlines submit_cmdbuf into zink_end_batch, the only place it's used. This makes the code a bit more straight-forward to read. Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/zink/zink_batch.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index 474421081bf..1f87e874aaf 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -60,9 +60,19 @@ zink_start_batch(struct zink_context *ctx, struct zink_batch *batch)
debug_printf("vkBeginCommandBuffer failed\n");
}
-static bool
-submit_cmdbuf(struct zink_context *ctx, VkCommandBuffer cmdbuf, VkFence fence)
+void
+zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
{
+ if (vkEndCommandBuffer(batch->cmdbuf) != VK_SUCCESS) {
+ debug_printf("vkEndCommandBuffer failed\n");
+ return;
+ }
+
+ assert(batch->fence == NULL);
+ batch->fence = zink_create_fence(ctx->base.screen);
+ if (!batch->fence)
+ return;
+
VkPipelineStageFlags wait = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;
VkSubmitInfo si = {};
@@ -73,29 +83,10 @@ submit_cmdbuf(struct zink_context *ctx, VkCommandBuffer cmdbuf, VkFence fence)
si.pSignalSemaphores = NULL;
si.pWaitDstStageMask = &wait;
si.commandBufferCount = 1;
- si.pCommandBuffers = &cmdbuf;
+ si.pCommandBuffers = &batch->cmdbuf;
- if (vkQueueSubmit(ctx->queue, 1, &si, fence) != VK_SUCCESS) {
+ if (vkQueueSubmit(ctx->queue, 1, &si, batch->fence->fence) != VK_SUCCESS)
debug_printf("vkQueueSubmit failed\n");
- return false;
- }
-
- return true;
-}
-
-void
-zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
-{
- if (vkEndCommandBuffer(batch->cmdbuf) != VK_SUCCESS) {
- debug_printf("vkEndCommandBuffer failed\n");
- return;
- }
-
- assert(batch->fence == NULL);
- batch->fence = zink_create_fence(ctx->base.screen);
- if (!batch->fence ||
- !submit_cmdbuf(ctx, batch->cmdbuf, batch->fence->fence))
- return;
}
void