Remove tile height restriction from `vello_common`, add to `vello_hybrid` With the changes to alpha mask packing in https://github.com/linebender/vello/pull/866 the scalar code in `vello_common` and `vello_cpu` now works for arbitrary tile sizes. Most tile size configurations I've checked pass the tests, some tile heights (e.g., 7) cause rounding differences in the rasterized images. `vello_hybrid`'s shader code assumes a tile height of 4, so a check has been introducted in that crate.
diff --git a/sparse_strips/vello_common/src/tile.rs b/sparse_strips/vello_common/src/tile.rs index 7a8d944..e6b89fa 100644 --- a/sparse_strips/vello_common/src/tile.rs +++ b/sparse_strips/vello_common/src/tile.rs
@@ -320,11 +320,6 @@ } #[cfg(test)] -const _: () = if Tile::HEIGHT != 4 { - panic!("Can only handle tiles with a height of 4 pixels for now."); -}; - -#[cfg(test)] mod tests { use crate::flatten::{Line, Point}; use crate::tile::Tiles;
diff --git a/sparse_strips/vello_hybrid/src/lib.rs b/sparse_strips/vello_hybrid/src/lib.rs index 74dbaf1..2e2dac9 100644 --- a/sparse_strips/vello_hybrid/src/lib.rs +++ b/sparse_strips/vello_hybrid/src/lib.rs
@@ -37,3 +37,8 @@ pub use scene::Scene; pub use util::DimensionConstraints; pub use vello_common::pixmap::Pixmap; + +#[cfg(test)] +const _: () = if vello_common::tile::Tile::HEIGHT != 4 { + panic!("`vello_hybrid` shaders currently require `Tile::HEIGHT` to be `4`"); +};