The git revision being used was from `0.11` while the current
release is `0.12`. `0.12` is used in `wgpu`, so this lets us
have a single `naga` crate being built.
This turns on clippy checking and also fixes all lints in the code.
Many lints are obvious improvements. Only a small number are slightly annoying, so I think overall worth having a vanilla default config.
* Bazel builds seem to fail to open relative paths to parent directories
due to hermetic sandboxing of third-party repositories. This adds a
WORKSPACE_MANIFEST_FILE environment variable that allows the caller to
optionally provide an absolute path to the workspace root manifest
file.
* The existing code processed a shader file only if
`FileType::is_file` returns true for it. This is not the case when
sources are accessed via symbolic links, which is possible in a Bazel
sandbox. The code now filters for the ".wgsl" file extension instead
of the file type which should generally be safe.
Previously the generated shader data structures were rooted in
backend-specific top-level mods (`mod wgsl`, `mod msl`, etc). This made
access to per-shader information that is common to all backends (e.g.
workgroup sizes, shader name etc) awkward to access from backend
agnostic code, especially when feature-gated conditional compilation is
used on the client side.
The data structures have been rearranged such that there is a top-level
`ComputeShader` declaration for each stage under a `gen` mod. The
`ComputeShader` struct declares feature-gated fields for backend shader
sources, such that backend specific data is now a leaf node in the
structure rather than the root. This has some additional benefits:
1. Common data doesn't have to be redeclared, saving on code size when
multiple backends are enabled.
2. The backend specific source code was previously encoded as a `[u8]`.
We can now use types that more closely match the expected format, for
example `&str` for WGSL and MSL, `[u32]` for SPIR-V, etc.
3. If we ever need to expose additional backend-specific metadata in the
future, we can bundle them alongside the source code in a
backend-specific data structure at this level of the tree.
Adds full support for COLRv1 radial gradients based on the two-point conical gradient algorithm at https://skia.org/docs/dev/design/conical/
Also adds robustness to degenerate cases in gradient encoding:
* Radial where p0 == p1 && r0 == r1 renders transparent solid
* Empty stops render as transparent solid
* Single stop renders as solid
* rename resolve_simple to resolve_solid_paths_only to better capture the semantics of the function
* move duplicated buffer size computation code to separate function
* change Resolver::resolve to call resolve_solid_paths_only when encoding.patches.is_empty() is true. This is likely to be slightly faster and will ensure that the "simple" code path is actually used.
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.
- 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'
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.