-
Notifications
You must be signed in to change notification settings - Fork 156
Add fast path for stripping rectangles #900
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An initial thought inline, I'll look more in-depth in the coming days.
Co-authored-by: Tom Churchman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most tests with rectangles call RenderContext::fill_rect
, which now uses the specialized path for rectangles. It would be good to continue exercising the general case as well.
I don't know what the best solution looks like. Perhaps performing multiple tests against the same snapshot could work, though we'd have to be robust against small rounding errors.
# Conflicts: # sparse_strips/vello_cpu/src/render.rs
I've added a few more test cases which check against the same snapshot as the rectangle case, I feel like this should already be an improvement? As you mentioned, there are few other test cases with rectangles, but there's also only so many ways to draw a rectangle. :P So I think this should already be a good coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This was a great read! Certainly adding a fast path for rects makes sense and I can see how it is so much faster.
edit: If it isn't clear, please don't let any of my comments block this from merging!
This re-adds my previously implemented fast path for rectangles. In my test scene with 20000 rectangles, this reduces the rendering time from around 37ms to 19ms!