From fb1c7bde42b835bfc41bc785905c050cef9f6f99 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 29 Sep 2017 03:23:14 +0200 Subject: 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. --- video/out/vulkan/context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'video/out/vulkan/context.c') 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; -- cgit v1.2.3