Commit graph

662 commits

Author SHA1 Message Date
Raph Levien 4907186de4 Prototype of buffer reuse
This helps performance but not all performance issues have been resolved. Nontrivial CPU goes into write_buffer, and it's also possible that there isn't enough overlapping between CPU and GPU work.
2023-01-12 20:43:58 -08:00
Chad Brokaw a9aa3f9cab
Merge pull request #242 from linebender/evenodd
Support even-odd fill rule
2023-01-11 14:13:24 -05:00
Raph Levien 3003e42acb
Merge pull request #235 from linebender/large_pathtag
Support for larger pathtags
2023-01-11 07:56:15 -08:00
Chad Brokaw c6ac5bf590 Support even-odd fill rule
Add logic for handling the even-odd fill rule to `SceneBuilder` and the coarse and fine shaders.
2023-01-10 15:22:04 -05:00
Raph Levien 5f45c2bdfb
Merge pull request #238 from linebender/roadmap
Draft roadmap
2023-01-10 11:19:15 -08:00
Raph Levien 89fd94e020 Better summary in introduction 2023-01-10 08:19:03 -08:00
Raph Levien e59a87c281 Editing improvements in response to feedback
This addresses most of the feedback other than the need to rework the opening paragraphs to be clearer to a casual observer.
2023-01-09 18:24:02 -08:00
Chad Brokaw c57db1d25b
Merge pull request #227 from rosefromthedead/multiadapter
Multi-adapter support
2023-01-09 17:29:14 -05:00
Rose Hudson c5401e777e Update winit example to use new multi-adapter API 2023-01-09 13:00:00 +00:00
Rose Hudson f0faadc356 Add multi-adapter support
some `RenderContext` stuff is now `DeviceHandle` stuff, and device
handles are created alongside surfaces to ensure compatibility, but are
reused if possible.

Fixes #224 wgpu Adapter and Surface might not be compatible
2023-01-09 13:00:00 +00:00
Chad Brokaw 3ea8eef839
Merge pull request #239 from linebender/new-encoding
Public encoding API
2023-01-08 18:41:09 -05:00
Chad Brokaw 3606184cf6 better naming 2023-01-08 18:36:14 -05:00
Chad Brokaw ec956d859b add function to render directly from an encoding 2023-01-08 18:34:22 -05:00
Chad Brokaw 520f6d0d41 Address review feedback.
* remove area clamp in fine (now in #241)
* make DrawTag::info_size() const fn
* document DrawColor rgba field
* change Monoid type parameter to an associated type and describe the additional Default constraint
* consistent parens in PathTag::is_subpath_end
* add comments for 32-bit path segment types in PathTag

* also adds low level encoding functions for the three currently supported brushes
2023-01-08 17:10:05 -05:00
Raph Levien 080277bcd9
Merge pull request #241 from linebender/fine_fixes
Fixes to fine rasterization
2023-01-08 13:50:51 -08:00
Duane Johnson 3e8a4813f0
Update references to piet-gpu where it makes sense (#240) 2023-01-08 16:15:51 +00:00
Raph Levien 29a16eb210 Fixes to fine rasterization
The area bug was found and fixed by @dfrg, and is adapted from #239. I wanted to move it to a separate PR so that one would be more focused on API.

The other bug is currently silent because the two quantities swapped are both 4, but it is triggered when experimenting with tuning for performance.
2023-01-08 07:41:01 -08:00
Raph Levien cd92a64ea0 Color code "train diagram"
Also add a bit of explanation.
2023-01-06 20:17:17 -08:00
Raph Levien 96a64f8abb
typo fix
Co-authored-by: Vincent Isambart <vincent.isambart@gmail.com>
2023-01-06 20:15:41 -08:00
Raph Levien 767997e80a Typo and link #239 2023-01-06 14:06:07 -08:00
Chad Brokaw dbe7f27768 Public encoding API
This exposes significantly more of the previously internal encoding guts.

This is beneficial for its own sake as there always seem to be new and interesting things that are supported by the encoding and GPU pipeline that are not directly exposed by the scene builder.

The secondary purpose is laying the groundwork for scene *de*coding and processing. This will enable us to implement various stages of the pipeline on the CPU.
2023-01-06 16:52:41 -05:00
Raph Levien 3afae4c765 Add hand-drawn "train diagram" 2023-01-06 13:50:27 -08:00
Raph Levien 3918f02a42
Typo fix (sage->safe)
Co-authored-by: Aron Granberg <HalfVoxel@users.noreply.github.com>
2023-01-06 13:41:41 -08:00
Raph Levien de6c5294e9 Fix ambiguous Markdown
Some links to issues were being interpreted as link defs.
2023-01-06 13:23:32 -08:00
Raph Levien 6f80729917 Draft roadmap
Also includes a link to it from the READE
2023-01-06 13:19:07 -08:00
Daniel McNab 480e5a5e2f
Update the README to reflect velloness (#233)
Co-authored-by: Raph Levien <raph.levien@gmail.com>
2023-01-05 22:56:46 +00:00
Raph Levien d94257a7c5 Support for larger pathtags
Previously there was a limit of 256k pathtags in a scene, due to the need for multi-dispatch prefix sum for the pathtag monoid. This patch increases the limit to 64M, which ought to be enough for most applications.

It works by having 4 dispatches for the pathtag prefix sum: 2 to reduce, then 2 to scan.
2023-01-05 14:25:21 -08:00
Daniel McNab 6cfd358f80
Improve the gitattributes and gitignore files (#234)
* Delete some not needed files

* Specify wgsl

* Finalise gitattributes
2023-01-05 18:24:36 +00:00
Daniel McNab 57d79bdf1f
Fix the winit dependency (#232) 2023-01-05 15:18:57 +00:00
Daniel McNab ff59839737
Move the vello crate to the workspace root (#231)
* Move the vello crate to the root of the crate

* Add warning that README is work in progress

* Add newline in warning

* Move the unlicense into the shader folder

* Fixup wgsl-analyzer include paths
2023-01-05 09:32:09 +00:00
Daniel McNab dfde0936e5
Add an example bevy integration (#226) 2022-12-16 18:01:51 +00:00
Chad Brokaw 3bc81afbf6
Merge pull request #225 from dfrg/vello-ify
Rename piet-wgsl to vello!
2022-12-12 15:39:25 -05:00
Chad Brokaw 093af31e05 address initial review feedback
* move "formerly piet-gpu" text from title to body in readme
* use [T;N]::map() for affine conversion functions
2022-12-09 14:17:16 -05:00
Chad Brokaw 628bc9566d Rename piet-wgsl to vello!
Also drops the scene crate and moves the code to the main project.
2022-12-09 13:23:03 -05:00
Raph Levien a7dbeb3b9b
Merge pull request #220 from linebender/raph-browser
Full pipeline running in browser
2022-12-08 10:27:37 -08:00
Chad Brokaw 4b1f9d1921 remove timer 2022-12-08 12:45:45 -05:00
Chad Brokaw 4ea379aaa7 address feedback 2022-12-08 12:43:09 -05:00
Chad Brokaw e5081b51e4 remove unnecessary deps 2022-12-08 12:12:35 -05:00
Chad Brokaw c6b319aca0 fmt 2022-12-08 11:58:09 -05:00
Chad Brokaw 6bd644f7cc
Merge branch 'main' into raph-browser 2022-12-08 11:56:58 -05:00
Chad Brokaw 942817755c replace let with const on web 2022-12-08 11:53:35 -05:00
Raph Levien 12fdae8714
Merge pull request #223 from linebender/fix_222
Increase sizes of binning buffers
2022-12-05 13:46:22 -08:00
Raph Levien e2469fbcaa Increase sizes of binning buffers
Increase the size of the bin header and path buffers to accommodate the actual extents accessed by the shaders.

Also add a missing workgroup barrier, not essential to fixing this bug but found while auditing the code.

Fixes #222
2022-12-05 13:26:16 -08:00
Raph Levien 375f71b46d cargo fmt 2022-11-29 19:51:43 -08:00
Raph Levien 28816a027e Disable timing debug out
Time is not supported in the browser
2022-11-29 19:49:21 -08:00
Raph Levien c4274c7153 Tweak canvas aspect ratio 2022-11-29 19:42:52 -08:00
Raph Levien 340ac1d69c Hacky attempt to get running in browser 2022-11-29 19:36:05 -08:00
Raph Levien 571822248c
Merge pull request #219 from linebender/squeeze
Reduce resource requirements of shaders
2022-11-29 19:02:15 -08:00
Raph Levien 876a3ad581 Combine info and bin_data buffers
We need to reduce the number of buffer bindings to 8 so it can run on
all WebGPU devices. The best candidate was to combine info and bin_data,
which are written by two different stages (draw_leaf and binning,
respectively), both read by coarse, and are unstructured, so the only
real shader change needed is to add the offset for the binning data.

I thought I was going to have to do a blit to make it fit, but
fortunately that wasn't needed.

Progress to #202
2022-11-29 17:39:22 -08:00
Raph Levien e8f8ebbd14 Squeeze pipeline to fit
This commit reduces the workgroup shared memory of binning to fit in
16k (by packing two u16's in a u32), and moves the config binding to
uniform, from readonly storage.

Progress toward #202
2022-11-29 17:23:12 -08:00