Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer allocation callback function #184

Open
harokyang opened this issue Aug 9, 2019 · 5 comments
Open

Buffer allocation callback function #184

harokyang opened this issue Aug 9, 2019 · 5 comments

Comments

@harokyang
Copy link
Contributor

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

@harokyang
Copy link
Contributor Author

Or at least provide a method to set custom allocator for std::vector data in tinygltf::Buffer

@syoyo
Copy link
Owner

syoyo commented Aug 10, 2019

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)?

@harokyang
Copy link
Contributor Author

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

@syoyo
Copy link
Owner

syoyo commented Aug 16, 2019

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

@harokyang
Copy link
Contributor Author

harokyang commented Aug 16, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants