-
Notifications
You must be signed in to change notification settings - Fork 148
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
vello_hybrid
implementation
#831
base: main
Are you sure you want to change the base?
vello_hybrid
implementation
#831
Conversation
This brings in the cpu-sparse prototype from the piet-next branch of the piet repo. No substantive changes, but cpu-sparse is renamed vello_hybrid and piet-next is renamed vello_api. Quite a bit of editing to satisfy the lint monster. There was a half-written SIMD implementation of flattening, that's removed. It should be finished and re-added, as it's a good speedup.
Renders a simple scene to the GPU, first by doing coarse rasterization the same as cpu-sparse, then doing a single draw call.
Adds a clip method to the (CPU) render context, plus a considerable amount of mechanism in coarse and fine rasterization to support clipping. The coarse rasterization logic contains a similar set of optimizations as Vello. In particular, all-zero tiles have drawing suppressed, and all-one tiles pass drawing commands through with no additional work to clip. Not extensively validated, but it does render a simple scene with clipping correctly.
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.
I'd probably tear out the SIMD code entirely from this version, to make the future refactorings clearer
let c = b.max(0.0); | ||
let d = xmin.max(0.0); | ||
let a = (b + 0.5 * (d * d - c * c) - xmin) / (xmax - xmin); | ||
areas[x as usize][y] += a * dy; |
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.
I get a panic on this line:
index out of bounds: the len is 4 but the index is 4
, just running:
> cargo run --example gpu
Fully based on #818, my changes simply relocate the code from the root folder to
sparse_strips/vello_hybrid
. Thevello_hybrid
code is functional and serves as a good foundation for the next refactoring step, aiming to unifyvello_cpu
andvello_hybrid
common components undervello_common
.