mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 20:51:29 +11:00
a2a2d12c5d
The previous attempt to fix inconsistent intersections because of floating
point inaccuracy[0] missed two cases.
The first case is that for top intersections with the very first row would fail
the test
tag == PathSeg_FillCubic && y > y0 && xbackdrop < bbox.z
In particular, y is not larger than y0 when y0 has been clipped to 0.
Fix that by re-introducing the min(p0.y, p1.y) < tile_y0 check that does work
and is just as consistent. Add similar check, min(p0.x, p1.x) < tile_x0, for
deciding when to clip the segment to the left edge (but keep consistent xray check
for deciding left edge *intersections*).
The second case is that the tracking left intersections in the [xray, next_xray]
range of tiles may fail when next_xray is forced to last_xray, the final xray value.
Fix that case by computing next_xray explicitly, before looping over the
x tiles. The code is now much simpler.
Finally, ensure that xx0 and xx1 doesn't overflow the allocated number of tiles
by clamping them *after* setting them. Adjust xx0 to include xray, just as xx1
is adjusted; I haven't seen corruption without it, but it's not obvious xx0
always includes xray.
While here, replace a "+=" on a guaranteed zero value to just "=".
Updates #23
[0]
|
||
---|---|---|
.. | ||
annotated.h | ||
backdrop.comp | ||
backdrop.spv | ||
binning.comp | ||
binning.spv | ||
bins.h | ||
build.ninja | ||
coarse.comp | ||
coarse.spv | ||
elements.comp | ||
elements.spv | ||
kernel4.comp | ||
kernel4.spv | ||
path_coarse.comp | ||
path_coarse.spv | ||
pathseg.h | ||
ptcl.h | ||
scene.h | ||
setup.h | ||
state.h | ||
tile.h | ||
tile_alloc.comp | ||
tile_alloc.spv |