Hello, I'm trying to implement resource and level streaming in my engine.
And I would like some help/clarification:
1 - From what I've been reading every resource should be divided in fixed-size chunks and stored using a pool allocator. But how should the resources be divided? I need meshes and textures to be stored continuously so I can create GPU resources. The solution I found is to load the whole resource using a temporary allocator, create the GPU resource, store resource info in chunks, and clear the temporary allocator. But what if the resource info doesn't fit in a single chunk?
2 - Resources like materials are simply command groups (containing commands to bind textures to shader slots, etc), ideally they should be stored continuously in memory, but might not fit in a single chunk so how should I handle them?
3 - Is there any way to know how many chunks the pool must be able to hold? Or simply wait until a chunk is freed when the pool is full?
4 - Should I separate resource chunks and level object chunks in two pools? Each level (or section) in my engine contains a list of resource packages that must be loaded before the level. The sizes of level objects vary so I guess the chunks size should be equal to the size of the largest object (which is usually small).