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
* 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
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.
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.
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.
* 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
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
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
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
* 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.
* 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)