I'm building a game/DirectX12 renderer in c++. I've got most things working and I'm able to statically create in game objects with textures, normalmapping, lighting etc. Since i'm a programmer noob and not an engineer, i'm unsure of how to structure different stuff.
I would like to get some ideas of how to handle low level bufferers when rendering a frame. I've included a rough graph of the area of interest Rough graph
I create StructuredBufferers with instance data of every object in the game. I pass raw data and it gets translated into structures which are compitable with the low level directx bufferers.
I'm currently unsure how to handle the StructuredBufferers in terms of their entire lifetime. They are kinda static, but sometimes the translation matrix or texture might change and therefore need an update or an entirely new bufferer.
I'm wondering what's most reasonable and open to suggestions. I'll build the code myself (in c++) and don't mind pseudo-code, since i'm struggling a bit with the engineering side
For example:
Should i create buffers at the start of preperation of all frames (in flight) before submission to the draw-call and destroy them after each frame has been rendered? This means a lot of bufferer creation and destruction and of course fence syncronization
Should i create an allocator with a pagesystem, where bufferers are allocated, kept and updated, only recreated if the allocation is too small (due to more instances of the object)? Thereby keeping the buffers alive over many frames? In terms of culling this might be wasteful memory wise
Other ideas?