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

Fix node mask compression #57

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Conversation

rosaliedewinther
Copy link
Contributor

Some old files only store tile values when the child bit is set to 0, so when iterating over our data we should grab the tile values by indexing into the tile buffer with an index computed by counting the number of 0 bits before the usual bit index. This fixes tile value loading of bunny_cloud.vdb

src/data_structure.rs Outdated Show resolved Hide resolved
Signed-off-by: rosaliedewinther <[email protected]>
@rosaliedewinther rosaliedewinther force-pushed the fix-node-mask-compression branch from f25d2d2 to acd9bd9 Compare November 10, 2023 09:27
@rosaliedewinther rosaliedewinther merged commit 2d6c6f8 into main Nov 10, 2023
@rosaliedewinther rosaliedewinther deleted the fix-node-mask-compression branch November 10, 2023 09:34
.iter()
.by_vals()
.take(idx)
.fold(0, |old, val| old + (!val as usize)); // count 0's before idx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you could have .map(|v| !v as usize).sum()'ed this 😬

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

Successfully merging this pull request may close these issues.

3 participants