vello/piet-gpu-types/src/bins.rs
Raph Levien 076e6d600d Progress on wiring up fills
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.
2020-05-20 11:14:19 -07:00

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
}
}
}