diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-29 14:15:13 +0200 |
---|---|---|
committer | Martin Herkt <652892+lachs0r@users.noreply.github.com> | 2017-12-25 00:47:53 +0100 |
commit | 80540be211adbc9e19c6cb95a1ddfddd890847a9 (patch) | |
tree | 4aad87acb2d6a9ca43918de1bfe20cf48fa316c9 /video/out/vulkan/ra_vk.c | |
parent | b138bdc01c666c1b33dc23e276228aa56a2bf7f8 (diff) | |
download | mpv-80540be211adbc9e19c6cb95a1ddfddd890847a9.tar.bz2 mpv-80540be211adbc9e19c6cb95a1ddfddd890847a9.tar.xz |
vo_gpu: vulkan: properly depend on the swapchain acquire semaphore
This is now associated with the ra_tex directly and used in the correct
way, rather than hackily done from submit_frame.
Diffstat (limited to 'video/out/vulkan/ra_vk.c')
-rw-r--r-- | video/out/vulkan/ra_vk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c index 0ffd5097f5..1cfeb4a948 100644 --- a/video/out/vulkan/ra_vk.c +++ b/video/out/vulkan/ra_vk.c @@ -321,8 +321,16 @@ struct ra_tex_vk { // the signal guards reuse, and can be NULL struct vk_signal *sig; VkPipelineStageFlags sig_stage; + VkSemaphore ext_dep; // external semaphore, not owned by the ra_tex }; +void ra_tex_vk_external_dep(struct ra *ra, struct ra_tex *tex, VkSemaphore dep) +{ + struct ra_tex_vk *tex_vk = tex->priv; + assert(!tex_vk->ext_dep); + tex_vk->ext_dep = dep; +} + // Small helper to ease image barrier creation. if `discard` is set, the contents // of the image will be undefined after the barrier static void tex_barrier(struct ra *ra, struct vk_cmd *cmd, struct ra_tex *tex, @@ -332,6 +340,11 @@ static void tex_barrier(struct ra *ra, struct vk_cmd *cmd, struct ra_tex *tex, struct mpvk_ctx *vk = ra_vk_get(ra); struct ra_tex_vk *tex_vk = tex->priv; + if (tex_vk->ext_dep) { + vk_cmd_dep(cmd, tex_vk->ext_dep, stage); + tex_vk->ext_dep = NULL; + } + VkImageMemoryBarrier imgBarrier = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = tex_vk->current_layout, |