VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
RenderPass.h
1
8#pragma once
9
15
16namespace venom
17{
18namespace vulkan
19{
20class AttachmentsManager
21{
22public:
23 AttachmentsManager();
24 ~AttachmentsManager();
25
26 static AttachmentsManager * Get();
27
28public:
29 vc::Vector<vc::Vector<vc::Texture>> attachments;
30 vc::Vector<vc::Vector<vc::Texture>> resolveAttachments;
31};
32
33class VulkanRenderPass : public vc::RenderPassImpl
34{
35public:
36 VulkanRenderPass();
37 ~VulkanRenderPass();
38 VulkanRenderPass(const VulkanRenderPass&) = delete;
39 VulkanRenderPass& operator=(const VulkanRenderPass&) = delete;
40 VulkanRenderPass(VulkanRenderPass&& other);
41 VulkanRenderPass& operator=(VulkanRenderPass&& other);
42
43 void ClearRenderPass();
44
45 void SetRenderingType(const vc::RenderingPipelineType type);
46 vc::Error _Init() override;
47 vc::Error _SetMultiSampling(const vc::GraphicsSettings::MultiSamplingModeOption mode, const vc::GraphicsSettings::MultiSamplingCountOption samples) override;
48 vc::Error BeginRenderPass(CommandBuffer * commandBuffer, int framebufferIndex);
49 vc::Error BeginRenderPassCustomFramebuffer(CommandBuffer * commandBuffer, const Framebuffer * const framebuffer);
50 void NextSubpass(CommandBuffer * commandBuffer);
51 vc::Error EndRenderPass(CommandBuffer * commandBuffer);
52 VkRenderPass GetVkRenderPass() const;
53
54 Framebuffer * GetFramebuffer(const int index);
55 Framebuffer * GetCurrentFramebuffer();
56
57 inline const vc::Vector<VkSubpassDescription> & GetSubpassDescriptions() const { return __subpassDescriptions; }
58 inline vc::Vector<vc::Vector<vc::Texture>> & GetAttachments() { return __attachments; }
59
60 inline static VulkanRenderPass * GetVulkanRenderPass(const vc::RenderingPipelineType type) { return GetRenderPass(type)->DAs<VulkanRenderPass>(); }
61
62private:
63 vc::Error __CreateNormalRenderPass();
64 vc::Error __CreateCSMRenderPass();
65 vc::Error __CreateGuiRenderPass();
66 vc::Error __CreateDeferredShadowRenderPass();
67
68 void __AddAttachment(const VkFormat format, const VkImageLayout layout, const VkAttachmentLoadOp loadOp, const VkAttachmentStoreOp storeOp, const VkImageLayout initalLayout, bool resolve);
69 void __SolveAttachmentReferences();
70
71private:
72 VkRenderPass __renderPass;
73 // By image count then attachments
74 vc::Vector<vc::Vector<vc::Texture>> __attachments;
75 vc::Vector<Framebuffer> __framebuffers;
76
77 vc::Vector<VkAttachmentDescription> __attachmentDescriptions;
78 vc::Vector<VkAttachmentDescription> __resolveAttachmentDescriptions;
79 vc::Vector<VkAttachmentReference> __attachmentRefs;
80 vc::Vector<VkAttachmentReference> __resolveAttachmentRefs;
81
82 vc::Vector<VkSubpassDescription> __subpassDescriptions;
83
84 vc::Vector<VkClearValue> __clearValues;
85};
86}
87}
MultiSamplingModeOption
Definition GraphicsSettings.h:46
Definition RenderPass.h:22
Command Buffer class, only instanciable by VulkanCommandPool. To use them, you need to create a Vulka...
Definition CommandPool.h:58
Definition Framebuffer.h:22
Encapsulation of Vulkan for the front end of VenomEngine.
Definition Allocator.h:18
Contains the entirety of the code of the VenomEngine project.
Definition Callback.h:13