diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-28 23:06:56 +0200 |
---|---|---|
committer | Martin Herkt <652892+lachs0r@users.noreply.github.com> | 2017-12-25 00:47:53 +0100 |
commit | 5feaaba0fd27af34ee1fef12545f1dd96ebefddd (patch) | |
tree | cd6278cc8f8de6e2f9f66a1d8ab6c06281ad77f5 /video/out/vulkan/ra_vk.h | |
parent | 885497a4456256a147d9e7e30daa3170e461d7d6 (diff) | |
download | mpv-5feaaba0fd27af34ee1fef12545f1dd96ebefddd.tar.bz2 mpv-5feaaba0fd27af34ee1fef12545f1dd96ebefddd.tar.xz |
vo_gpu: vulkan: refactor command submission
Instead of being submitted immediately, commands are appended into an
internal submission queue, and the actual submission is done once per
frame (at the same time as queue cycling). Again, the benefits are not
immediately obvious because nothing benefits from this yet, but it will
make more sense for an upcoming vk_signal mechanism.
This also cleans up the way the ra_vk submission interacts with the
synchronization/callbacks from the ra_vk_ctx. Although currently, the
way the dependency is signalled is a bit hacky: normally it would be
associated with the ra_tex itself and waited on in the appropriate stage
implicitly. But that code is just temporary, so I'm keeping it in there
for a better commit order.
Diffstat (limited to 'video/out/vulkan/ra_vk.h')
-rw-r--r-- | video/out/vulkan/ra_vk.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/video/out/vulkan/ra_vk.h b/video/out/vulkan/ra_vk.h index d15b6380f0..8939bc7ce0 100644 --- a/video/out/vulkan/ra_vk.h +++ b/video/out/vulkan/ra_vk.h @@ -16,14 +16,11 @@ VkDevice ra_vk_get_dev(struct ra *ra); struct ra_tex *ra_vk_wrap_swapchain_img(struct ra *ra, VkImage vkimg, VkSwapchainCreateInfoKHR info); -// This function flushes the command buffers, transitions `tex` (which must be -// a wrapped swapchain image) into a format suitable for presentation, and -// submits the current rendering commands. `acquired` must fire before the -// command can run, and `done` will fire after it completes. If `inflight` -// is non-NULL, it will be incremented when the command starts and decremented -// when it completes. -bool ra_vk_submit(struct ra *ra, struct ra_tex *tex, VkSemaphore acquired, - VkSemaphore done, int *inflight); +// This function finalizes rendering, transitions `tex` (which must be a +// wrapped swapchain image) into a format suitable for presentation, and returns +// the resulting command buffer (or NULL on error). The caller may add their +// own semaphores to this command buffer, and must submit it afterwards. +struct vk_cmd *ra_vk_submit(struct ra *ra, struct ra_tex *tex); // May be called on a struct ra of any type. Returns NULL if the ra is not // a vulkan ra. |