X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fcommands_backend.h;h=7c98b15f0d061bbe7ea43bce73e8ae9559c1996a;hb=cebf1330ef6773b7b4496dc279ec02a7ca4351bb;hp=4de712f57092947409fb554826139e9300ee4198;hpb=0bcebf9930e4baada774a16c0e7637a22a410bb4;p=libs%2Fgl.git diff --git a/source/backends/vulkan/commands_backend.h b/source/backends/vulkan/commands_backend.h index 4de712f5..7c98b15f 100644 --- a/source/backends/vulkan/commands_backend.h +++ b/source/backends/vulkan/commands_backend.h @@ -4,6 +4,7 @@ #include #include "fence.h" #include "handles.h" +#include "rect.h" namespace Msp { namespace GL { @@ -20,10 +21,18 @@ class SwapChain; class VulkanCommands { protected: + struct CommandBuffers + { + std::vector buffers; + unsigned next_buffer = 0; + }; + struct CommandPool { Device &device; VkCommandPool pool = 0; + CommandBuffers primary; + CommandBuffers secondary; Fence fence; bool in_use = false; @@ -34,15 +43,21 @@ protected: Device &device; std::vector 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; - VkRenderPass render_pass = 0; + const PipelineState *last_pipeline = 0; + const Framebuffer *framebuffer = 0; + Rect viewport = Rect::max(); + bool fb_is_swapchain = false; + bool discard_fb_contents = false; + std::vector pass_begin_info; VulkanCommands(); ~VulkanCommands(); - void begin_buffer(); + void begin_buffer(VkRenderPass); void begin_render_pass(bool, const ClearValue *); void end_render_pass(); @@ -54,6 +69,7 @@ protected: void clear(const ClearValue *); void draw(const Batch &); void draw_instanced(const Batch &, unsigned); + void dispatch(unsigned, unsigned, unsigned); void resolve_multisample(Framebuffer &); void begin_query(const QueryPool &, unsigned);