SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanFrameBuffer.h
1#pragma once
2
3#include "spark/render/FrameBuffer.h"
4#include "spark/render/Resource.h"
5#include "spark/render/vk/Export.h"
6#include "spark/render/vk/Helpers.h"
7#include "spark/render/vk/VulkanCommandBuffer.h"
8
9SPARK_FWD_DECLARE_VK_HANDLE(VkFramebuffer)
10SPARK_FWD_DECLARE_VK_HANDLE(VkSemaphore)
11
12namespace spark::render::vk
13{
14 class VulkanRenderPass;
15 class IVulkanImage;
16
20 class SPARK_RENDER_VK_EXPORT VulkanFrameBuffer final : public FrameBuffer<VulkanCommandBuffer>, public Resource<VkFramebuffer>
21 {
22 public:
30 explicit VulkanFrameBuffer(const VulkanRenderPass& render_pass, unsigned buffer_index, const math::Vector2<unsigned>& render_area, unsigned command_buffers = 1);
31 ~VulkanFrameBuffer() override;
32
33 VulkanFrameBuffer(const VulkanFrameBuffer& other) = delete;
34 VulkanFrameBuffer(VulkanFrameBuffer&& other) noexcept = delete;
35 VulkanFrameBuffer& operator=(const VulkanFrameBuffer& other) = delete;
36 VulkanFrameBuffer& operator=(VulkanFrameBuffer&& other) noexcept = delete;
37
42 [[nodiscard]] const VkSemaphore& semaphore() const noexcept;
43
50 [[nodiscard]] std::size_t& lastFence() const noexcept;
51
53 [[nodiscard]] unsigned bufferIndex() const noexcept override;
54
56 [[nodiscard]] spark::math::Vector2<unsigned> size() const noexcept override;
57
59 void resize(const spark::math::Vector2<unsigned>& render_area) override;
60
62 [[nodiscard]] std::vector<std::shared_ptr<const VulkanCommandBuffer>> commandBuffers() const noexcept override;
63
65 [[nodiscard]] std::shared_ptr<const VulkanCommandBuffer> commandBuffer(unsigned index) const override;
66
68 [[nodiscard]] std::vector<const IVulkanImage*> images() const noexcept override;
69
71 [[nodiscard]] const IVulkanImage& image(unsigned location) const override;
72
73 private:
74 struct Impl;
75 std::unique_ptr<Impl> m_impl;
76 };
77}
A vector with two components.
Definition Vector2.h:13
Stores the images for the output attachments for a back buffer of a IRenderPass>, as well as a Comman...
Definition FrameBuffer.h:91
Definition Resource.h:34
Represents a Vulkan image.
Definition VulkanImage.h:33
Vulkan implementation of IFrameBuffer.
Definition VulkanFrameBuffer.h:21
Vulkan implementation of IRenderPass.
Definition VulkanRenderPass.h:27
Definition VulkanFrameBuffer.cpp:23