Commit graph

692 commits

Author SHA1 Message Date
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
Chad Brokaw 2bd75ac86f
Merge pull request #218 from dfrg/blend-group-alpha
Add blend group alpha and sync clip data in clip_leaf
2022-11-29 14:55:44 -05:00
Chad Brokaw d13ec497e2 Address review feedback.
* add comment for ClipInp::path_ix
* update comment for SceneBuilder drawtags
* remove copy of blend data through info buffer. Instead, update EndClip's DrawMonoid::scene_offset to point to the same scene data of the associated EndClip.
2022-11-29 14:52:03 -05:00
Chad Brokaw 28082af9ec clip changes/blend group alpha
Adds blend group alpha. Also changes the clip logic to sync blend mode and alpha from BeginClip to EndClip in clip_leaf.
2022-11-29 13:28:25 -05:00
Chad Brokaw 99199195bf
Merge pull request #217 from dfrg/info-gradients
Read gradient data from info buffer in fine
2022-11-29 13:26:02 -05:00
Chad Brokaw 6d8428e377 fix and offset bug and remove comment 2022-11-28 18:29:57 -05:00
Chad Brokaw c8ed14ae67 read gradient data from info buf 2022-11-28 18:20:29 -05:00
Chad Brokaw ab3ef4381d
Merge pull request #215 from dfrg/small-fixes
Hodgepodge of small fixes
2022-11-28 14:12:22 -05:00
Chad Brokaw 923765aff9 Address review feedback
* Add comment about avoiding NaNs to inverse alpha divisions
* Change inverse alpha computations to use max(a, epsilon) rather than +
* Emit alpha component in blit fragment shader (enables support for partially transparent windows)
2022-11-28 14:07:26 -05:00
Chad Brokaw 4fea305883 Hodgepodge of small fixes
This just a collection of minor fixes to various things I noticed while looking over the code.

Adds a `Device::poll` call to the winit example.
Removes some lingering unnecessary `<f32>`s in the blit shaders.
Removes a duplicated bbox entry in the shared shader inclusion code and collapses nested `concat!`s.

Finally, it reintroduces the computation of separated alpha in the output of fine which I removed in a previous PR. This allows the `render_to_texture` mode to be useful for generating images that can be properly blended over other content. The blit shader has been changed to accommodate this.
2022-11-28 00:03:02 -05:00
Daniel McNab c689767782
Remove the old pipeline (#209)
Remove the old hal and pipeline. 

Update the README to reflect this
2022-11-27 16:02:16 +00:00
Raph Levien 1f9a4d5322
Merge pull request #214 from linebender/stroke_bbox
Fix rendering artifacts with strokes
2022-11-26 20:10:29 -05:00
Raph Levien 2338e3bedd Fix style nit 2022-11-26 17:07:23 -08:00
Raph Levien 3c0752f6ae Fix rendering artifacts with strokes
A number of things weren't being computed correctly for strokes,
including bounding boxes and also incorrectly applying y_edge logic
(which is only correct for fills).
2022-11-26 16:51:22 -08:00
Chad Brokaw cf9b5c5805
Merge pull request #213 from dfrg/libize
Libify piet-wgsl
2022-11-26 16:07:48 -05:00
Chad Brokaw 9ad7f7270e revert rename of SceneBuilder ctors 2022-11-26 16:00:34 -05:00
Chad Brokaw 36fa836735 include shaders in source 2022-11-26 15:51:07 -05:00
Chad Brokaw a4441007c4 make use of Result type in RenderContext 2022-11-26 14:56:43 -05:00
Chad Brokaw 3174e284f2 remove double && 2022-11-26 14:53:51 -05:00
Chad Brokaw 207ab45f16 format 2022-11-26 14:41:30 -05:00
Chad Brokaw 37a9763748 fix longstanding annoying in SceneBuilder ctor
SceneBuilder::new() now takes &mut Scene or &mut SceneFragment
2022-11-26 14:38:26 -05:00