aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out/vulkan/context.c
diff options
context:
space:
mode:
authorGravatar Niklas Haas <git@haasn.xyz>2017-09-29 03:23:14 +0200
committerGravatar Martin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commitfb1c7bde42b835bfc41bc785905c050cef9f6f99 (patch)
tree0e2ea3913b1de04a26124a9a07cc5e8b113c4948 /video/out/vulkan/context.c
parentf2f91cf570ad6736a62192f2cb36b6c2887a0fda (diff)
vo_gpu: vulkan: properly track image dependencies
This uses the new vk_signal mechanism to order all access to textures. This has several advantageS: 1. It allows real synchronization of image access across multiple frames when using multiple queues for parallelism. 2. It allows using events instead of pipeline barriers, which is a finer-grained synchronization primitive that allows for more efficient layout transitions over longer durations. This commit also restructures some of the implicit transition code for renderpasses to be more flexible and correct. (Note: this technically drops the ability to transition the image out of undefined layout when not blending, but that was a bug anyway and needs to be done properly) vo_gpu: vulkan: remove no-longer-true optimization The change to the output_tex format makes this no longer true, and it actually seems to hurt performance now as well. So just don't do it anymore. I also realized it hurts performance when drawing an OSD, so it's probably not a good idea anyway.
Diffstat (limited to 'video/out/vulkan/context.c')
-rw-r--r--video/out/vulkan/context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index 20fa5fc6d9..ddc80be042 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -447,8 +447,10 @@ static bool start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
if (!p->swapchain)
goto error;
+ MP_TRACE(vk, "vkAcquireNextImageKHR signals %p\n",
+ (void *)p->sems_in[p->idx_sems]);
+
uint32_t imgidx = 0;
- MP_TRACE(vk, "vkAcquireNextImageKHR\n");
VkResult res = vkAcquireNextImageKHR(vk->dev, p->swapchain, UINT64_MAX,
p->sems_in[p->idx_sems], NULL,
&imgidx);
@@ -518,6 +520,7 @@ static bool submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame)
.pImageIndices = &p->last_imgidx,
};
+ MP_TRACE(vk, "vkQueuePresentKHR waits on %p\n", (void *)p->sems_out[semidx]);
VK(vkQueuePresentKHR(queue, &pinfo));
return true;