diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-28 22:33:31 +0200 |
---|---|---|
committer | Martin Herkt <652892+lachs0r@users.noreply.github.com> | 2017-12-25 00:47:53 +0100 |
commit | 885497a4456256a147d9e7e30daa3170e461d7d6 (patch) | |
tree | ca0d9d08b032654aa52c326016baadebfdfe5af1 /video/out/vulkan/ra_vk.c | |
parent | 4e34615872011f906bf653f61e7ac75d2066a06b (diff) | |
download | mpv-885497a4456256a147d9e7e30daa3170e461d7d6.tar.bz2 mpv-885497a4456256a147d9e7e30daa3170e461d7d6.tar.xz |
vo_gpu: vulkan: reorganize vk_cmd slightly
Instead of associating a single VkSemaphore with every command buffer
and allowing the user to ad-hoc wait on it during submission, make the
raw semaphores-to-signal array work like the raw semaphores-to-wait-on
array. Doesn't really provide a clear benefit yet, but it's required for
upcoming modifications.
Diffstat (limited to 'video/out/vulkan/ra_vk.c')
-rw-r--r-- | video/out/vulkan/ra_vk.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c index 9101233495..e0e13391af 100644 --- a/video/out/vulkan/ra_vk.c +++ b/video/out/vulkan/ra_vk.c @@ -34,16 +34,13 @@ static struct vk_cmd *vk_require_cmd(struct ra *ra) return p->cmd; } -// Note: This technically follows the flush() API, but we don't need -// to expose that (and in fact, it's a bad idea) since we control flushing -// behavior with ra_vk_present_frame already. -static bool vk_flush(struct ra *ra, VkSemaphore *done) +static bool vk_flush(struct ra *ra) { struct ra_vk *p = ra->priv; struct mpvk_ctx *vk = ra_vk_get(ra); if (p->cmd) { - if (!vk_cmd_submit(vk, p->cmd, done)) + if (!vk_cmd_submit(vk, p->cmd)) return false; p->cmd = NULL; } @@ -74,7 +71,7 @@ static void vk_destroy_ra(struct ra *ra) struct ra_vk *p = ra->priv; struct mpvk_ctx *vk = ra_vk_get(ra); - vk_flush(ra, NULL); + vk_flush(ra); mpvk_dev_wait_cmds(vk, UINT64_MAX); ra_tex_free(ra, &p->clear_tex); @@ -1715,7 +1712,7 @@ static void present_cb(void *priv, int *inflight) } bool ra_vk_submit(struct ra *ra, struct ra_tex *tex, VkSemaphore acquired, - VkSemaphore *done, int *inflight) + VkSemaphore done, int *inflight) { struct vk_cmd *cmd = vk_require_cmd(ra); if (!cmd) @@ -1740,7 +1737,9 @@ bool ra_vk_submit(struct ra *ra, struct ra_tex *tex, VkSemaphore acquired, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT); - return vk_flush(ra, done); + vk_cmd_sig(cmd, done); + + return vk_flush(ra); error: return false; |