#include <vector>
#include "fence.h"
#include "handles.h"
+#include "rect.h"
namespace Msp {
namespace GL {
class Framebuffer;
class PipelineState;
class QueryPool;
-struct Rect;
class Semaphore;
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;
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 PipelineState *last_pipeline = 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<char> pass_begin_info;
VulkanCommands();
~VulkanCommands();
- void begin_buffer();
+ void begin_buffer(VkRenderPass);
void begin_render_pass(bool, const ClearValue *);
void end_render_pass();