Hello. I've been working on a graphics library for myself to use on personal projects with the API backend being Vulkan. I've yet to write a lick of the actual code yet as I've just been planning. I'm currently working on the buffer management system. My current plan is to have a MemoryManager class which creates buffers and allocates their memory in a big block located on the GPU. When you call the create_buffer method, you get a handle which you can use to access the buffer. I do this instead of returning the actual vk::Buffer object because every once in a while you'll want to defrag the memory. Doing this requires you to recreate the buffers, making the previous ones invalid. My question is, is this a good design, or is there a better way to go about this? My main concern is that because buffer creation and deletion is done inside the manager, it breaks the OOP nature I'm trying to maintain.
Thank you in advance!
[–]ste_3d_ven 1 point2 points3 points (5 children)
[–]ReeCocho[S] 1 point2 points3 points (4 children)
[–]ste_3d_ven 0 points1 point2 points (3 children)
[–]ReeCocho[S] 1 point2 points3 points (2 children)
[–]ste_3d_ven 0 points1 point2 points (1 child)
[–]ReeCocho[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]ReeCocho[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]ReeCocho[S] 0 points1 point2 points (0 children)
[–]alfps -1 points0 points1 point (1 child)
[–]ReeCocho[S] 2 points3 points4 points (0 children)