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

Instance Data Memory Abstraction #139

Open
JessyDL opened this issue Aug 15, 2024 · 0 comments
Open

Instance Data Memory Abstraction #139

JessyDL opened this issue Aug 15, 2024 · 0 comments

Comments

@JessyDL
Copy link
Owner

JessyDL commented Aug 15, 2024

Dynamic instance data currently needs to clear the bundle's instance data to write its data in, as a result this leads to static data that is only uploaded once when they get added to also be cleared. Additionally this leads to an issue where if you add 3 static instances, remove the middle one, you end up with a hole.

Currently instance ID's are additionally their direct offsets in memory for the given geometry. These should be abstracted away (possible using the same container type as the sparse arrays are). This would of-course cause a lookup per ID, but this pales in comparison to the cost of transferring the data anyway. Most would be contiguous anyway.

As an advantage this would mean we are much more able to compartmentalize instance data upload, promoting long lived data to more stable regions of memory while dynamic data is in the more volatile region.

It would also be okay to implement an intermediate solution that just keeps static and dynamic data separate, as dynamic data is updated per-frame anyway, though we still run into the problem of dealing with static data when it's removed.

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

No branches or pull requests

1 participant