Hymn to Beauty
C++ 3D Engine
VulkanRenderPass.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../Interface/RenderPass.hpp"
4
5#include <vulkan/vulkan.h>
6#include <glm/glm.hpp>
7
8namespace Video {
9
10class Texture;
11class VulkanTexture;
12
15 public:
17
23
26
29
32
35 };
36
38
45 VulkanRenderPass(VkDevice device, Texture* colorAttachment, RenderPass::LoadOperation colorLoadOperation, Texture* depthAttachment, RenderPass::LoadOperation depthLoadOperation);
46
48
53 VulkanRenderPass(VkDevice device, const glm::uvec2& size, uint32_t msaaSamples);
54
56 ~VulkanRenderPass() final;
57
58 const glm::uvec2& GetSize() const final;
59
61
64 VkRenderPass GetRenderPass() const;
65
67
70 VkFramebuffer GetFramebuffer() const;
71
73
76 bool HasColorAttachment() const;
77
79
83
85
88 bool HasDepthAttachment() const;
89
91
95
97
100 const Compatibility& GetCompatiblity() const;
101
102 private:
103 VulkanRenderPass(const VulkanRenderPass& other) = delete;
104
105 VkDevice device;
106 VkRenderPass renderPass;
107 VkFramebuffer framebuffer;
108 VkImage colorImage;
109 bool hasColorAttachment;
110 VulkanTexture* colorAttachment;
111 bool hasDepthAttachment;
112 VulkanTexture* depthAttachment;
113
114 glm::uvec2 size;
115 Compatibility compatibility;
116};
117
118} // namespace Video
A render pass.
Definition: RenderPass.hpp:11
LoadOperation
What to do with an image being rendered to before rendering to it.
Definition: RenderPass.hpp:14
A texture.
Definition: Texture.hpp:8
Vulkan implementation of RenderPass.
Definition: VulkanRenderPass.hpp:14
const Compatibility & GetCompatiblity() const
Get the render pass' compatibility information.
Definition: VulkanRenderPass.cpp:248
const glm::uvec2 & GetSize() const final
Get the size of the frame buffer.
Definition: VulkanRenderPass.cpp:216
VulkanRenderPass(VkDevice device, Texture *colorAttachment, RenderPass::LoadOperation colorLoadOperation, Texture *depthAttachment, RenderPass::LoadOperation depthLoadOperation)
Create new Vulkan render pass.
Definition: VulkanRenderPass.cpp:8
VkFramebuffer GetFramebuffer() const
Get the Vulkan framebuffer.
Definition: VulkanRenderPass.cpp:224
bool HasDepthAttachment() const
Get whether there is a depth attachment.
Definition: VulkanRenderPass.cpp:238
VulkanTexture * GetDepthAttachment() const
Get the depth attachment.
Definition: VulkanRenderPass.cpp:242
~VulkanRenderPass() final
Destructor.
Definition: VulkanRenderPass.cpp:211
bool HasColorAttachment() const
Get whether there is a color attachment.
Definition: VulkanRenderPass.cpp:228
VkRenderPass GetRenderPass() const
Get the Vulkan render pass.
Definition: VulkanRenderPass.cpp:220
VulkanTexture * GetColorAttachment() const
Get the first color attachment.
Definition: VulkanRenderPass.cpp:232
Vulkan implementation of Texture.
Definition: VulkanTexture.hpp:13
Definition: Editor.hpp:18
Compatibility information about the render pass.
Definition: VulkanRenderPass.hpp:20
bool hasDepthAttachment
Whether the render pass has a depth attachment.
Definition: VulkanRenderPass.hpp:28
VkFormat depthAttachmentFormat
The format of the render pass' depth attachment.
Definition: VulkanRenderPass.hpp:31
VkFormat colorAttachmentFormat
The format of the render pass' color attachment.
Definition: VulkanRenderPass.hpp:25
uint32_t attachmentlessMsaa
MSAA sample count when doing attachmentless rendering.
Definition: VulkanRenderPass.hpp:34
bool hasColorAttachment
Whether the render pass has a color attachment.
Definition: VulkanRenderPass.hpp:22