Commit graph

10 commits

Author SHA1 Message Date
Chad Brokaw
15cd306af6 Extend modes for gradients
This patch implements the pad, repeat and reflect extend modes for gradient brushes. Adds a new example demonstrating the functionality.

Also fixes a few bugs:
* Clamps alpha in blend.wgsl for the `blend_compose` function. The `Plus` mode was generating `alpha > 1.0` leading to incorrect rendering.
* Small change to radial gradients in fine.wgsl to reject pixels outside the cone when the circles don't nest. This requires further work to properly extend the cone when one of the radii is not 0.
2023-04-30 23:11:57 -04:00
Arman Uguray
2b0eab2bbc fix some clippy errors/warnings 2023-04-18 15:15:01 -07:00
Arman Uguray
e9278a9253 [vello_encoding] Declare bump buffer sizes in terms of element count 2023-04-18 15:02:31 -07:00
Arman Uguray
4ae4177510 [vello_encoding] Fixup copyright headers 2023-04-18 14:46:16 -07:00
Arman Uguray
fe29125a84 Remove unused WG size declarations 2023-04-18 14:46:16 -07:00
Arman Uguray
0256d8a92f [vello_encoding] Minor clean ups and correctness fixes
- Use the buffer sizes in src/render.rs as the current 128K is not
  sufficient for even the test scenes
- Add BumpAllocators type and bump buffer size
- Support the `base_color` render option
- Use immutable type construction where possible
- Fix the path tag stream length calculation to use the offsets stored
  in Layout. This both matches the current behavior in src/render.rs and
  makes it so that CpuConfig's construction no longer needs the Encoding
  type as an input
- Renamed CpuConfig & GpuConfig types to 'RenderConfig' and
  'ConfigUniform'
2023-04-18 14:46:16 -07:00
Arman Uguray
3ff490fc13 [vello_encoding] Declare padding in binding types to match WGSL layout 2023-04-18 14:46:16 -07:00
Chad Brokaw
9f27fae64e capture computation of workgroup and buffer sizes 2023-04-18 14:46:16 -07:00
Arman Uguray
db2fefdc8f [vello_encoding] Move the encoding module into its own crate
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.
2023-04-18 14:46:14 -07:00
Arman Uguray
0a6a6e2c21 [vello_shaders] Move vello_shaders to crates/shaders 2023-03-29 12:24:28 -07:00