@@ -35,25 +35,27 @@ It can be inherited for full user control over the render pipeline.
3535class RenderPass
3636{
3737 protected:
38- Graphics::VulkanRenderPass m_handle;
3938 Graphics::Device* m_device{nullptr };
4039 Graphics::DescriptorPool m_descriptorPool{};
41- std::vector<Graphics::Attachment> m_attachments;
42- std::vector<Graphics::SubPassDependency> m_dependencies;
40+ Graphics::VulkanRenderPass m_handle;
4341 std::vector<Graphics::Framebuffer> m_framebuffers;
4442 std::unordered_map<std::string, Graphics::ShaderPass*> m_shaderPasses;
4543
46- Extent2D m_extent;
4744 uint32_t m_framebufferImageDepth; // The depth of the framebuffer image layers.
4845
4946 // Key: Renderpass ID
5047 // Value: Framebuffer's image ID inside renderpass
5148 std::unordered_map<uint32_t , std::vector<uint32_t >> m_imageDepedanceTable;
5249
53- bool m_initiatized{false };
54- bool m_isResizeable{true };
55- bool m_enabled{true };
56- bool m_isDefault;
50+ bool m_initiatized = false ;
51+ bool m_isResizeable = true ;
52+ bool m_enabled = true ;
53+ bool m_isDefault = false ;
54+
55+ virtual void setup_attachments (std::vector<Graphics::Attachment>& attachments,
56+ std::vector<Graphics::SubPassDependency>& dependencies) = 0;
57+ virtual void setup_uniforms (std::vector<Graphics::Frame>& frames) = 0;
58+ virtual void setup_shader_passes () = 0;
5759
5860 public:
5961 // static std::vector<Graphics::Frame> frames;
@@ -64,10 +66,10 @@ class RenderPass
6466 uint32_t framebufferDepth = 1 ,
6567 bool isDefault = false )
6668 : m_device(ctx)
67- , m_extent(extent)
6869 , m_framebufferImageDepth(framebufferDepth)
6970 , m_isDefault(isDefault) {
7071 m_framebuffers.resize (framebufferCount);
72+ m_handle.extent = extent;
7173 }
7274
7375#pragma region Getters & Setters
@@ -80,10 +82,10 @@ class RenderPass
8082 }
8183
8284 inline Extent2D get_extent () const {
83- return m_extent ;
85+ return m_handle. extent ;
8486 }
8587 inline void set_extent (Extent2D extent) {
86- m_extent = extent;
88+ m_handle. extent = extent;
8789 }
8890
8991 inline Graphics::VulkanRenderPass get_handle () const {
@@ -94,10 +96,10 @@ class RenderPass
9496 }
9597
9698 inline std::vector<Graphics::Attachment> get_attachments () {
97- return m_attachments ;
99+ return m_handle. attachments ;
98100 }
99101 inline void set_attachment_clear_value (VkClearValue value, size_t attachmentLayout = 0 ) {
100- m_attachments [attachmentLayout].clearValue = value;
102+ m_handle. attachments [attachmentLayout].clearValue = value;
101103 }
102104
103105 inline bool resizeable () const {
@@ -139,9 +141,6 @@ class RenderPass
139141 */
140142 void setup (std::vector<Graphics::Frame>& frames);
141143
142- virtual void setup_attachments () = 0;
143- virtual void setup_uniforms (std::vector<Graphics::Frame>& frames) = 0;
144- virtual void setup_shader_passes () = 0;
145144 virtual void render (Graphics::Frame& currentFrame, Scene* const scene, uint32_t presentImageIndex = 0 ) = 0;
146145
147146 virtual void update_uniforms (uint32_t frameIndex, Scene* const scene) {
0 commit comments