mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 20:51:29 +11:00
076e6d600d
Write the right_edge to the binning output. More work on encoding the fill/stroke distinction and plumbing that through the pipeline. This is a bit unsatisfying because of the code duplication; having an extra fill/stroke bool might be better, but I want to avoid making the structs bigger (this could be solved by better packing in the struct encoding). Fills are plumbed through to the last stage. Backdrop is WIP.
23 lines
565 B
Rust
23 lines
565 B
Rust
use piet_gpu_derive::piet_gpu;
|
|
|
|
// The output of the binning stage, organized as a linked list of chunks.
|
|
|
|
piet_gpu! {
|
|
#[gpu_write]
|
|
mod bins {
|
|
struct BinInstance {
|
|
element_ix: u32,
|
|
// Right edge of the bounding box of the associated fill
|
|
// element; used in backdrop computation.
|
|
right_edge: f32,
|
|
}
|
|
|
|
struct BinChunk {
|
|
// First chunk can have n = 0, subsequent ones not.
|
|
n: u32,
|
|
next: Ref<BinChunk>,
|
|
// Instances follow
|
|
}
|
|
}
|
|
}
|