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.
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.
Added two scenes that demonstrate conflation artifacts as described in
https://github.com/linebender/vello/issues/49. The first scene
demonstrates adjacent triangles and rects that belong to the same path
and use opposite winding.
The second scene demonstrates strokes with overlapping square caps
(these strokes are currently expressed as rects painted with the NonZero
fill rule).
Just load the atomic bump counter directly instead of piping it through a shared variable, when workgroupUniformLoad is not available. The value is in fact dynamically uniform, but that depends on the stage not setting its own failure flag, a fairly subtle invariant.
I think there was a write-after-read hazard for the reuse of sh_part_count[0]. However, doing the experiment of just changing that doesn't fix the problem on mac. It's possible there's a shader compilation problem (possibly the same one as provoking the storageBarrier workaround in tile_alloc), or also possibly a logic error I'm not understanding.
In any case, this change does appear to fix the hangs on mac.
Fixes#267
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