// Copyright 2022 the Vello Authors // SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense // Segments laid out for contiguous storage struct Segment { // Points are relative to tile origin point0: vec2, point1: vec2, y_edge: f32, } // A line segment produced by flattening and ready for rasterization. // // The name is perhaps too playful, but reflects the fact that these // lines are completely unordered. They will flow through coarse path // rasterization, then the per-tile segments will be scatter-written into // segment storage so that each (tile, path) tuple gets a contiguous // slice of segments. struct LineSoup { path_ix: u32, // Note: this creates an alignment gap. Don't worry about // this now, but maybe move to scalars. p0: vec2, p1: vec2, } // An intermediate data structure for sorting tile segments. struct SegmentCount { // Reference to element of LineSoup array line_ix: u32, // Two count values packed into a single u32 // Lower 16 bits: index of segment within line // Upper 16 bits: index of segment within segment slice counts: u32, }