@@ -48,11 +48,12 @@ class BasePass
4848 std::vector<Graphics::Framebuffer> m_framebuffers;
4949 uint32_t m_framebufferImageDepth; // In case if multilayered rendering.
5050
51+ Extent2D m_imageExtent;
5152 std::string m_name;
5253
53- // Key: Renderpass ID
54- // Value: Framebuffer's image ID inside renderpass
55- std::unordered_map<uint32_t , std::vector<uint32_t >> m_imageDepedanceTable;
54+ // Key: Vec2 ( Renderpass ID, Framebuffer ID)
55+ // Value: Framebuffer's image attachment IDs
56+ std::unordered_map<iVec2 , std::vector<uint32_t >> m_imageDepedanceTable;
5657
5758 // Query
5859 bool m_initiatized = false ;
@@ -62,7 +63,7 @@ class BasePass
6263 bool m_isGraphical = true ;
6364
6465 virtual void
65- setup_attachments (std::vector<Graphics::Attachment>& attachments,
66+ setup_attachments (std::vector<Graphics::AttachmentInfo>& attachments,
6667 std::vector<Graphics::SubPassDependency>& dependencies) = 0 ; // Only for graphical renderpasses
6768 virtual void setup_uniforms (std::vector<Graphics::Frame>& frames) = 0;
6869 virtual void setup_shader_passes () = 0;
@@ -73,13 +74,14 @@ class BasePass
7374 uint32_t framebufferCount = 1 ,
7475 uint32_t framebufferDepth = 1 ,
7576 bool isDefault = false ,
76- std::string name = " Graphic Pass " )
77+ std::string name = " UNNAMED PASS " )
7778 : m_device(ctx)
7879 , m_framebufferImageDepth(framebufferDepth)
7980 , m_isDefault(isDefault)
8081 , m_name(name) {
81- m_framebuffers.resize (framebufferCount);
82- m_renderpass.extent = extent;
82+ !isDefault ? m_framebuffers.resize (framebufferCount)
83+ : m_framebuffers.resize (m_device->get_swapchain ().get_present_images ().size ());
84+ m_imageExtent = extent;
8385 }
8486
8587#pragma region Getters & Setters
@@ -92,24 +94,20 @@ class BasePass
9294 }
9395
9496 inline Extent2D get_extent () const {
95- return m_renderpass. extent ;
97+ return m_imageExtent ;
9698 }
9799 inline void set_extent (Extent2D extent) {
98- m_renderpass. extent = extent;
100+ m_imageExtent = extent;
99101 }
100102
101- inline Graphics::RenderPass get_handle () const {
103+ inline Graphics::RenderPass get_renderpass () const {
102104 return m_renderpass;
103105 }
104106 inline std::vector<Graphics::Framebuffer> const get_framebuffers () const {
105107 return m_framebuffers;
106108 }
107-
108- inline std::vector<Graphics::Attachment> get_attachments () {
109- return m_renderpass.attachments ;
110- }
111109 inline void set_attachment_clear_value (VkClearValue value, size_t attachmentLayout = 0 ) {
112- m_renderpass.attachments [attachmentLayout].clearValue = value;
110+ m_renderpass.attachmentsInfo [attachmentLayout].clearValue = value;
113111 }
114112
115113 inline bool resizeable () const {
@@ -137,13 +135,14 @@ class BasePass
137135 }
138136
139137 /*
140- Sets a table of connection with different passes. Key is the pass ID and value
141- is the atachment number
138+ Sets a table of depedencies with different passes.
139+ - Key: Vec2 (Renderpass ID, Framebuffer ID)
140+ - Value: array of framebuffer's image attachment IDs
142141 */
143- inline void set_image_dependace_table (std::unordered_map<uint32_t , std::vector<uint32_t >> table) {
142+ inline void set_image_dependace_table (std::unordered_map<iVec2 , std::vector<uint32_t >> table) {
144143 m_imageDepedanceTable = table;
145144 }
146- inline std::unordered_map<uint32_t , std::vector<uint32_t >> get_image_dependace_table () const {
145+ inline std::unordered_map<iVec2 , std::vector<uint32_t >> get_image_dependace_table () const {
147146 return m_imageDepedanceTable;
148147 }
149148
@@ -158,7 +157,7 @@ class BasePass
158157
159158 virtual void update_uniforms (uint32_t frameIndex, Scene* const scene) {
160159 }
161- virtual void connect_to_previous_images (std::vector<Graphics::Image> images) {
160+ virtual void link_previous_images (std::vector<Graphics::Image> images) {
162161 }
163162 /* *
164163 * Create framebuffers and images attached to them necessary for the
0 commit comments