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

Not possible to retrieve the *aligned* written size? #48

Open
949f45ac opened this issue Jul 30, 2023 · 1 comment
Open

Not possible to retrieve the *aligned* written size? #48

949f45ac opened this issue Jul 30, 2023 · 1 comment

Comments

@949f45ac
Copy link

When writing out from an encase Buffer via into_inner/as_ref getting e.g. a Vec<u8>, that inner structure has unaligned length (there might be padding missing at the end of it).
This makes it impossible to append anything to a GPU-side buffer after having written to it with encase-data once, because how will one know the next properly aligned offset?
Would be great to just have a get_(next_)offset function along the already existing set_offset on encase’s types.

@teoxoy
Copy link
Owner

teoxoy commented Aug 31, 2023

For the dynamic buffer types you can keep writing, they have an internal offset that keeps increasing. .write(value) also returns the offset where the value was written to.

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

2 participants