]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/commands_backend.h
Multiplex streaming buffer contents on Vulkan
[libs/gl.git] / source / backends / vulkan / commands_backend.h
index b87d73e0b71b5bffb22ff5c13133cf8e53ac2f21..5fcae882a26a7c053ff72595c35521d32735d1bc 100644 (file)
@@ -21,10 +21,18 @@ class SwapChain;
 class VulkanCommands
 {
 protected:
+       struct CommandBuffers
+       {
+               std::vector<VkCommandBuffer> buffers;
+               unsigned next_buffer = 0;
+       };
+
        struct CommandPool
        {
                Device &device;
                VkCommandPool pool = 0;
+               CommandBuffers primary;
+               CommandBuffers secondary;
                Fence fence;
                bool in_use = false;
                
@@ -35,16 +43,20 @@ protected:
 
        Device &device;
        std::vector<CommandPool> command_pools;
-       CommandPool *current_pool = 0;
-       VkCommandBuffer current_buffer = 0;
+       unsigned frame_index = 0;
+       VkCommandBuffer primary_buffer = 0;
+       VkCommandBuffer pass_buffer = 0;
        const PipelineState *pipeline_state = 0;
        const Framebuffer *framebuffer = 0;
        const Rect *viewport = 0;
+       bool fb_is_swapchain = false;
+       bool discard_fb_contents = false;
+       std::vector<char> pass_begin_info;
 
        VulkanCommands();
        ~VulkanCommands();
 
-       void begin_buffer();
+       void begin_buffer(VkRenderPass);
        void begin_render_pass(bool, const ClearValue *);
        void end_render_pass();