This fixes an incorrect application of the inverse transform for radial gradients in fine.
Also fixes an edge case in `SceneBuilder` where a brush transform is identical to the path transform leading to a corrupt encoding.
A number of things were wrong:
* The args were missing to `run`
* The robust memory changes introduced uniformity errors
* `clear_buffer` is a todo for wgpu on wasm
* Some more time calls crept in
* Initializing both env_logger and console_logger fails
In addition, we conditionally opt the shaders into
`workgroupUniformLoad`, as that's available on wasm but not yet native.
Some of the things (args, uniformity errors) are important fixes. Other
things (clear_buffer, wUL being optional) are workarounds for wgpu
limitations and have TODO items to be removed when wgpu catches up.
Make async versions of the main library entry points, and invoke those from the with_winit example.
Right now this just prints the contents of the bump buffer before just running the fine dispatch, but it could apply conditional logic.
We'll be persisting some buffers across recordings, so make the mapping from id to actual resource scoped to the engine rather than a single `run_recording` call.
Part of the change is being explicit about which buffers to free and when. That will enable more fine-grained reuse of buffers, including within a recording.
* Add counts to offsets when comparing against buffer size limits
* Remove multiplication by 4 in blend buffer allocation (we use units of u32)
* Move buffer sizes from BumpAllocators to Config
* Add comments about early exit
* Improve the svg parser
* Handle `opacity`
* Double the segments buffer
* Rotate the multiplication
This matches firefox's output, although it is contrary to my use
of 3d transformation matrices
* Double ptcl size
Seems to be required to show entire scene at 4k
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.
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
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