[Vulkan v2] Present framebuffer clearing

This commit is contained in:
Triang3l
2019-08-11 23:53:24 +03:00
parent 490f3de853
commit 470f9946d6
2 changed files with 192 additions and 30 deletions

View File

@@ -54,6 +54,12 @@ class VulkanContext : public GraphicsContext {
uint32_t GetCurrentQueueFrame() { return current_queue_frame_; }
void AwaitAllFramesCompletion();
const VkSurfaceFormatKHR& GetSurfaceFormat() const { return surface_format_; }
VkCommandBuffer GetPresentCommandBuffer() const {
return present_command_buffers_[current_queue_frame_];
}
private:
friend class VulkanProvider;
@@ -87,6 +93,10 @@ class VulkanContext : public GraphicsContext {
VkSemaphore semaphore_present_complete_ = VK_NULL_HANDLE;
VkSemaphore semaphore_draw_complete_ = VK_NULL_HANDLE;
VkRenderPass present_render_pass_ = VK_NULL_HANDLE;
VkCommandPool present_command_pool_ = VK_NULL_HANDLE;
VkCommandBuffer present_command_buffers_[kQueuedFrames] = {};
std::unique_ptr<VulkanImmediateDrawer> immediate_drawer_ = nullptr;
VkSwapchainKHR swapchain_ = VK_NULL_HANDLE;