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)
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.
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).
This creates a new Renderer type that offers fairly simple render_to_texture and render_to_surface methods, the latter of which handles the final blit internally. Also adds a util module with some helpers for device and surface creation.
There is a new winit example in piet-wgsl/examples/winit that shows how to make use of it all. This should be fairly trivial to adapt to glazier/xilem.
* add writeable image support to engine
* add external resources to engine
* update fine to output to a texture
* copy over original piet-gpu test scenes
* put it all in a pretty (resizable!) window
Now that wgsl-analyzer 0.6 is released, most explicit type annotations on vec can be dropped (the exception being when it is a type conversion).
Also changes mix to select when the selector is actually boolean.
This adds a new dependency on peniko, reintroduces kurbo for geometry (!), removes the now defunct types from piet-scene and updates all the test scenes to use the new types.