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

Different method of emitting tile intersections #63

Merged
merged 7 commits into from
Dec 7, 2024
Merged

Conversation

ArthurBrussee
Copy link
Owner

@ArthurBrussee ArthurBrussee commented Dec 7, 2024

This method doesn't rely on project and map_gaussians_to_intersects to be EXACTLY in sync lest really bad stuff happens, including memory corruption.

This definitely caused trouble in a previous version of Brush - it's unknown whether the current version does. It doesn't seem to for me but on the other hand it's one floating point inaccuracy away from memory corruption, which just isn't tenable.

This version doesn't rely on first generating intersections counts, and then generating the actual intersections. Instead it immedialty produces them (be it in an arbitrary order). These then get reshuffled to be in order of depth, and then sorte to be in tile order.

The tile offsets are then found using a standard prefix sum, instead of a scan which checks for the 'edges'. That might be slower for low intersection counts, but could be faster for more intense scenes.

Overall this does seem like a small performance regression, but that will be fixed later, I think some cleverer algorithms are possible here. Even just a faster prefix sum (coming in Cube soon hopefully) should fix most of the overhead.

@ArthurBrussee ArthurBrussee merged commit 5e2c3b4 into main Dec 7, 2024
1 check passed
@ArthurBrussee ArthurBrussee deleted the no-map branch December 10, 2024 09:31
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.

1 participant