]> git.tdb.fi Git - libs/gl.git/commitdiff
Submit commands for isolated offscreen rendering
authorMikko Rasa <tdb@tdb.fi>
Wed, 1 Dec 2021 08:35:23 +0000 (10:35 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 1 Dec 2021 08:35:23 +0000 (10:35 +0200)
source/backends/vulkan/renderer_backend.cpp
source/backends/vulkan/renderer_backend.h

index d0bd0c7b65244c1a20d0ad66e989854dd4ba4538..ab77158a1d52e3cf6d8acf6d25bbbe78998fb669 100644 (file)
@@ -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<Renderer *>(this)->commands.use_pipeline(0);
+       Renderer &self = *static_cast<Renderer *>(this);
+       self.commands.use_pipeline(0);
+       self.commands.submit_frame(begin_semaphore, end_semaphore);
 }
 
 void VulkanRenderer::end(Semaphore &sem)
 {
-       Renderer &self = *static_cast<Renderer *>(this);
-       self.end();
-       self.commands.submit_frame(begin_semaphore, &sem);
+       end_semaphore = &sem;
+       static_cast<Renderer *>(this)->end();
 }
 
 } // namespace GL
index f1a0725eee6260ac3658ae282792aa5bc087dfa5..d4ebc326df01ac628928aa682d237e2e429224fc 100644 (file)
@@ -13,6 +13,7 @@ class VulkanRenderer: public NonCopyable
 protected:
        PipelineState pipeline_state;
        Semaphore *begin_semaphore;
+       Semaphore *end_semaphore;
 
        void begin();
        void begin(Semaphore &);