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

Initial commit of piet-next API sketch #589

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Initial commit of piet-next API sketch #589

wants to merge 17 commits into from

Conversation

raphlinus
Copy link
Contributor

Ideas for what an API might look like. We'll use the CPU sparse strip implementation to test those ideas.

Currently lots of TODO and very likely things will change, but this should give an idea.

raphlinus and others added 17 commits December 3, 2024 07:55
Ideas for what an API might look like. We'll use the CPU sparse strip implementation to test those ideas.

Currently lots of TODO and very likely things will change, but this should give an idea.
This copies the implementation from the cpu-sparse branch of compute-shader-101, which is currently the most up-to-date version (though there are still rendering flaws).

We remove the bytemuck dependency and change colors the color crate (following tip of tree peniko), but otherwise unchanged. Lots of warnings as well, as basically everything is unused.

There will be changes. In particular, path_id will be removed, as there will be a separate sort per path.
This is the point where the pieces start coming together.

At this point, we should be doing basic coarse rasterization for path fills. Not well validated yet.

Printing debug output of wide tiles. Doing checkpoint before starting in on fine raster.
This brings it to the point where it can rasterize a single triangle.
Adapt pico-svg from Vello. It now renders the tiger.
Small changes to the example, and basic stats added, to help with performance measurement. Not by any means a careful performance evaluation framework, but ok for doing experiments by hand.
Neon implementation of the 4 basic fine raster operations, all using f32 as the scratch buffer.
Optimize core render_strips implementation using Neon intrinsics.
Simpler scalar code, not designed for thread parallelism.

This renders tiger but is likely to have numerical robustness issues; the robustness logic from Vello has not been ported.
CI is very scoldy and doesn't like it!
Again, feed the CI beast
Keep feeding the CI beast!
This might not be the last of them.
Also put allow(unused) on use_cpu, as whether that's used will vary by platform.
The logic for choosing whether to use the scalar or simd version of the strip kernel was backwards.

This makes a pretty small performance difference; it just isn't a large part of the total time.

Also optimize clamping behavior to take advantage of saturation in conversion operations.
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.

2 participants