SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanRenderPass.h
1#pragma once
2
3#include "spark/render/RenderPass.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/VulkanFrameBuffer.h"
8#include "spark/render/vk/VulkanRenderPipeline.h"
9#include "spark/render/vk/VulkanInputAttachmentMapping.h"
10
11#include <span>
12
13SPARK_FWD_DECLARE_VK_HANDLE(VkRenderPass)
14
15namespace spark::render::vk
16{
17 class VulkanDescriptorSet;
18 class VulkanDevice;
19
20 SPARK_WARNING_PUSH
21 SPARK_DISABLE_MSVC_WARNING(4250) // 'VulkanRenderPass': inherits 'StateResource::name' via dominance
22
23
26 class SPARK_RENDER_VK_EXPORT VulkanRenderPass final : public RenderPass<VulkanRenderPipeline, VulkanFrameBuffer, VulkanInputAttachmentMapping>, public Resource<VkRenderPass>
27 {
28 public:
37 explicit VulkanRenderPass(const VulkanDevice& device,
38 std::span<RenderTarget> render_targets,
39 unsigned command_buffers = 1,
40 MultiSamplingLevel samples = MultiSamplingLevel::X1,
41 std::span<VulkanInputAttachmentMapping> input_attachments = {});
42
52 explicit VulkanRenderPass(const VulkanDevice& device,
53 const std::string& name,
54 std::span<RenderTarget> render_targets,
55 unsigned command_buffers = 1,
56 MultiSamplingLevel samples = MultiSamplingLevel::X1,
57 std::span<VulkanInputAttachmentMapping> input_attachments = {});
58
59 ~VulkanRenderPass() override;
60
61 VulkanRenderPass(const VulkanRenderPass& other) = delete;
62 VulkanRenderPass(VulkanRenderPass&& other) noexcept = delete;
63 VulkanRenderPass& operator=(const VulkanRenderPass& other) = delete;
64 VulkanRenderPass& operator=(VulkanRenderPass&& other) noexcept = delete;
65
70 [[nodiscard]] const VulkanDevice& device() const noexcept;
71
73 void begin(unsigned buffer) override;
74
76 void end() const override;
77
79 [[nodiscard]] const VulkanFrameBuffer& activeFrameBuffer() const override;
80
82 [[nodiscard]] const VulkanFrameBuffer& frameBuffer(unsigned buffer) const override;
83
85 [[nodiscard]] std::vector<const VulkanFrameBuffer*> frameBuffers() const noexcept override;
86
88 void resizeFrameBuffers(const math::Vector2<unsigned>& new_render_area) override;
89
91 [[nodiscard]] std::vector<const VulkanRenderPipeline*> pipelines() const noexcept override;
92
94 [[nodiscard]] const RenderTarget& renderTarget(unsigned location) const override;
95
97 [[nodiscard]] std::span<const RenderTarget> renderTargets() const noexcept override;
98
100 [[nodiscard]] bool hasPresentRenderTarget() const noexcept override;
101
103 [[nodiscard]] MultiSamplingLevel multiSamplingLevel() const noexcept override;
104
106 [[nodiscard]] std::span<const VulkanInputAttachmentMapping> inputAttachments() const noexcept override;
107
109 void updateAttachments(const VulkanDescriptorSet& descriptor_set) const override;
110
111 private:
112 struct Impl;
113 std::unique_ptr<Impl> m_impl;
114 };
115
116 SPARK_WARNING_POP
117}
A vector with two components.
Definition Vector2.h:13
Represents a render pass.
Definition RenderPass.h:114
Implements a IRenderTarget.
Definition RenderTarget.h:201
Definition Resource.h:34
Vulkan implementation of IDescriptorSet.
Definition VulkanDescriptorSet.h:24
Vulkan implementation of IGraphicsDevice.
Definition VulkanDevice.h:25
Vulkan implementation of IFrameBuffer.
Definition VulkanFrameBuffer.h:21
Vulkan implementation of IInputAttachmentMapping.
Definition VulkanInputAttachmentMapping.h:17
Vulkan implementation of IRenderPass.
Definition VulkanRenderPass.h:27
Vulkan implementation of IRenderPipeline.
Definition VulkanRenderPipeline.h:25
Definition VulkanRenderPass.cpp:19