X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fcommands_backend.h;h=00e492f2542c2fa9fada9c0929480503cb842f25;hb=016f0f0dd51511f98d0bf398d99199d7dec1543c;hp=b87d73e0b71b5bffb22ff5c13133cf8e53ac2f21;hpb=b9b6fb7c5e59f662b011857140cea5e6be0c4309;p=libs%2Fgl.git diff --git a/source/backends/vulkan/commands_backend.h b/source/backends/vulkan/commands_backend.h index b87d73e0..00e492f2 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 { @@ -14,17 +15,24 @@ class Device; class Framebuffer; class PipelineState; class QueryPool; -struct Rect; class Semaphore; 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; @@ -35,16 +43,20 @@ 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; const Framebuffer *framebuffer = 0; - const Rect *viewport = 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();