From: Mikko Rasa Date: Wed, 1 Dec 2021 08:35:23 +0000 (+0200) Subject: Submit commands for isolated offscreen rendering X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6df421e276f88aba6efe320e2d882350b930fcf0;p=libs%2Fgl.git Submit commands for isolated offscreen rendering --- diff --git a/source/backends/vulkan/renderer_backend.cpp b/source/backends/vulkan/renderer_backend.cpp index d0bd0c7b..ab77158a 100644 --- a/source/backends/vulkan/renderer_backend.cpp +++ b/source/backends/vulkan/renderer_backend.cpp @@ -7,6 +7,7 @@ namespace GL { void VulkanRenderer::begin() { begin_semaphore = 0; + end_semaphore = 0; } void VulkanRenderer::begin(Semaphore &sem) @@ -18,14 +19,15 @@ void VulkanRenderer::begin(Semaphore &sem) void VulkanRenderer::end() { - static_cast(this)->commands.use_pipeline(0); + Renderer &self = *static_cast(this); + self.commands.use_pipeline(0); + self.commands.submit_frame(begin_semaphore, end_semaphore); } void VulkanRenderer::end(Semaphore &sem) { - Renderer &self = *static_cast(this); - self.end(); - self.commands.submit_frame(begin_semaphore, &sem); + end_semaphore = &sem; + static_cast(this)->end(); } } // namespace GL diff --git a/source/backends/vulkan/renderer_backend.h b/source/backends/vulkan/renderer_backend.h index f1a0725e..d4ebc326 100644 --- a/source/backends/vulkan/renderer_backend.h +++ b/source/backends/vulkan/renderer_backend.h @@ -13,6 +13,7 @@ class VulkanRenderer: public NonCopyable protected: PipelineState pipeline_state; Semaphore *begin_semaphore; + Semaphore *end_semaphore; void begin(); void begin(Semaphore &);