From 27750dadb733e54c7dbaf316bbe0240afed6dd8a Mon Sep 17 00:00:00 2001 From: harrand Date: Fri, 29 Dec 2023 07:54:41 +0000 Subject: [PATCH] [tz.gl.vk][Issue 84] Fix an issue where renderers that draw into a swapchain image would not wait for the acquire to finish unless it was about to present the finished work right away. --- src/tz/gl/impl/vulkan/renderer2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tz/gl/impl/vulkan/renderer2.cpp b/src/tz/gl/impl/vulkan/renderer2.cpp index ad3578f867..a54aa1ddb0 100644 --- a/src/tz/gl/impl/vulkan/renderer2.cpp +++ b/src/tz/gl/impl/vulkan/renderer2.cpp @@ -877,9 +877,11 @@ namespace tz::gl { // we need to wait on the image being available. const vk2::Semaphore& image_wait = dev.acquire_image(nullptr); + // note: we want to wait on the acquire even if we're not about to present. + // this is because we're about to render into a swapchain image, so it better be ready for use (e.g *not* still being presented by a previous frame.) + extra_waits.add(&image_wait); if(will_present) { - extra_waits.add(&image_wait); // we want our work to signal a semaphore which our present waits on. extra_signals.add(&this->present_sync_semaphore); }