Refactored Graphics #297

Merged
Xenosas1337 merged 13 commits from SP3-1-Rendering into main 2023-01-01 12:35:09 +08:00

13 Commits

Author SHA1 Message Date
Brandon Mak d7754e125d Wrote remove resource for render graph (untested) 2023-01-01 12:02:51 +08:00
Brandon Mak 118ad33109 Got rid of SHEnumWrapper 2022-12-30 15:54:45 +08:00
Kah Wei ce16ca6f8d Exposed transform and MDI buffers in SHBatch and exposed Batches in SHSuperBatch 2022-12-30 15:29:17 +08:00
Brandon Mak 8e2c32d110 Graphics refactor more or less tested and working
- Descriptors sets are now independent from a set index. Camera matrices for example can be bound to set index 1 for the batching system but index 2 for compute shaders.
- Truly global descriptors sets (misc data, textures and light data) are now manually bound to a global static class that allows retrieval of these sets to be bound whenever in the middle end. 
- Predefined descriptor set layouts (but not truly global such as camera data, materials and font) have their layouts predefined in a class and used for descriptor set initialization within the middle end. The sets themselves are allocated using these layouts (also accessible globally). 
- Descriptor sets that are more flexible with their bindings such as render graph resources are introspected from shaders and not predefined at all (though their types are recorded in SHGraphicsPredefinedData to avoid magic numbers when binding descriptor sets in some systems).
- Systems now have fixed mappings for descriptors used in shaders and these are defined in SHGraphicsPredefinedData. Batching for example has 3 fixed descriptors: Static global bound at 0, camera data bound at 1, materials bound at 2.
- Viewports no longer contain renderers and renderers no longer contain render graphs. The graphics system only has 1 render graph and subpasses can have both viewports and renderers bound to them to have options for viewport/scissor and camera settings. 
- Light data is now bound before every compute system.
- There is only 1 render graph in the entire system and contains only 6 nodes: G-Buffer pass (with lighting compute pass), debug draw with depth, debug draw, screen space pass, dummy pass for transition to input attachment for imGui and lastly the imGui pass for rendering editor to swapchain.
2022-12-29 14:29:25 +08:00
Brandon Mak 99e7dbfa01 WIP 2022-12-28 20:47:20 +08:00
Brandon Mak 497889c050 Merge branch 'main' into SP3-1-Rendering 2022-12-28 15:09:38 +08:00
Brandon Mak b84364ffe9 Minor changes
- Render Node Compute now has access to camera to send camera data to shaders
- Fonts now have functions to bind descriptor set
2022-12-28 12:43:40 +08:00
Brandon Mak 4210f5c533 Merge remote-tracking branch 'origin/SP3-1-Rendering' into SP3-1-Rendering 2022-12-28 12:24:50 +08:00
Brandon Mak 3bfec1e54f WIP will update later, afraid for BSOD again
- All Shaders now take in a single projection matrix. The type of projection matrix is dependent on the SHRenderer projection type.
- SHGraphicsSystem now only has a single render graph.
- SHGlobalDescriptorSets now store a descriptor set for static global data and a handle to the lighting system. Functions to bind their descriptor sets are also available. 
- Font desc set layout is added back into SHPredefinedData because while its possible to introspect the layouts from the shaders, the layouts is required beforehand to generate the font objects
- SHRenderers and SHViewport are now 2 separate entities, both passable to SHSubpass to be contained and used to set viewport/scissor and send camera matrices to shaders.
-  SHRenderer descriptor sets are now updated separately from the binding. They happen directly before the render graph executes.
2022-12-28 12:19:30 +08:00
Brandon Mak 44ca317e1d WIP will update later, afraid for BSOD again 2022-12-28 10:22:01 +08:00
Brandon Mak 5f2fa7fdf5 WIP
- Created a class that allows custom mappings of descriptor types to set indices
- SHPredefinedData now contains objects of the above class with predefined mappings for the different sub systems in the Graphics System. 
- These mappings are also accompanied with descriptor set layout vectors that are only for that system. This helps the sub systems have access to these layouts easily without having to pass them around. 
- Created another class to manage global descriptor sets such as lights. 
- Modified pipeline layout creation code to take in the correct descriptor set layouts.
2022-12-26 09:28:15 +08:00
Brandon Mak b035582b30 Renamed SHGraphicsGlobalData to SHPredefinedData
- SHPredefinedData now contains the font data descriptor set layout as well 
- Added a function for SHPredefinedData to retrieve descriptor sets based on a bitfield
- Modified descriptor sets to not be tied to a set index anymore
- Descriptor set layout doesn't have a set anymore
- Removed desc set index constants from SHGraphicsConstants since they aren't really needed anymore
2022-12-25 14:32:55 +08:00
Brandon Mak dfa9facfe0 Merge branch 'main' into SP3-1-Rendering 2022-12-24 20:43:16 +08:00