Removed the workgroup count and buffer size calculations from
src/render.rs. This code now uses the types returned by the
vello_encoding crate for this purpose.
This method was intended for the coverage mask variant of the pipelines
that was present in piet-gpu. This code has regressed since the wgpu
rewrite and the mask rendering variant of the pipelines will be
redesigned. Remove this for now instead of having to maintain it until
the rewrite.
This change moves the vello encoding logic to a new crate under
crates/encoding. Combined with the `vello_shaders` crate, this enables
lightweight integration of the Vello pipelines into renderers that don't
depend on wgpu (or perhaps written in languages other than Rust).
The Scene/Fragment API currently remain the vello crate.
The Auto* modes should have wider compatibility as they implement
fallback behavior based on what the platform supports. This also means
that on web "vsync off" will likely be incorrect.
* Add comment about naughty ptr2int cast
* Change Option to anyhow::Result in test scene ImageCache
* Replace magic constant with pixel stride from selected format
* reorganize GlyphCache::get_or_insert() to use the HashMap entry API
* change DrawGlyphs::hint() parameter name from `yes` to `hint` for clarity
* change Layout::path_data() to return bytes instead of [f32; 2]. Path segments could be encoded as i16, making this incorrect
The texture and surface render API now takes render-time parameters
(such as clear color, target width/height) as a RenderParams struct.
The examples have been updated to demonstrate this. The with_winit
example now accepts a clear color as a command line option.
* make SimpleText::add_run accept glyph_transform and style parameters so it doesn't unconditionally do oblique strokes
* replace fill/stroke methods on DrawGlyphs with a single draw method that accepts either fill or stroke styles
* update peniko rev to access the new style types used above
* for now, change glyph cache to only cache non-zero fills. Prior to this, style was ignored in the key which could lead to incorrect rendering.
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