vello/piet-gpu/shader
Elias Naur a2a2d12c5d path_coarse.comp: fix intersection inconsistencies, take 2
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] 29cfb8b63e

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-12-27 20:24:29 +01:00
..
annotated.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
backdrop.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
backdrop.spv remove FillMask and FillMaskInv 2020-11-29 16:59:58 +01:00
binning.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
binning.spv remove FillMask and FillMaskInv 2020-11-29 16:59:58 +01:00
bins.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
build.ninja piet-gpu-types: remove unused scene elements 2020-09-27 18:57:53 +02:00
coarse.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
coarse.spv Merge branch 'master' into clip_opt 2020-11-29 17:07:46 -08:00
elements.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
elements.spv elements.comp: tighten state size calculations 2020-12-10 18:48:16 +01:00
kernel4.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
kernel4.spv Merge branch 'master' into image_work 2020-12-02 11:58:45 -08:00
path_coarse.comp path_coarse.comp: fix intersection inconsistencies, take 2 2020-12-27 20:24:29 +01:00
path_coarse.spv path_coarse.comp: fix intersection inconsistencies, take 2 2020-12-27 20:24:29 +01:00
pathseg.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
ptcl.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
scene.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
setup.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
state.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
tile.h all: add SPDX license headers 2020-12-11 18:24:35 +01:00
tile_alloc.comp all: add SPDX license headers 2020-12-11 18:24:35 +01:00
tile_alloc.spv remove FillMask and FillMaskInv 2020-11-29 16:59:58 +01:00