Open harokyang opened 5 years ago
Or at least provide a method to set custom allocator for std::vector
There are some situation for reading Buffer data: From base64 encoded string, from URI, from external bin file, from embedded bin section in .glb.
At this time, it would be difficult to provide unified callback function for Buffer allocation.
What is your actual usecase(e.g. want to read large .bin file)?
I'm doing some real time rendering/video streaming Large scene and dynamic loading may involved
I'm currently experimenting on adding a new constructor for Model class to pass a custom std::allcoator
I see. Could you please send a PR? > I'm currently experimenting on adding a new constructor for Model class to pass a custom std::allcoator
It's on my company's project I have to reimplement it in a different way before submit to fork on github to avoid copyright issue It may take some time
After parsing a gltf file, all the buffers are already allocated in host memory
If we can provide a callback function to handle buffer memory allocation while loading then it is possible to load binary data directly into staging buffer and save one memory copying on host side very helpful with large size scene