Skip to content

Commit

Permalink
Merge pull request #397 from linebender/blocky
Browse files Browse the repository at this point in the history
Fix blocky artifacts in area aa
  • Loading branch information
raphlinus authored Oct 26, 2023
2 parents 37459da + fc06a92 commit c9faf2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shader/path_tiling.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ fn main(
}
// See comments in CPU version of shader
var y_edge = 1e9;
if xy0.x == tile_xy.x {
if xy0.x == tile_xy.x && xy1.x != tile_xy.x && xy0.y != tile_xy.y {
y_edge = xy0.y;
} else if xy1.x == tile_xy.x {
} else if xy1.x == tile_xy.x && xy1.y != tile_xy.y {
y_edge = xy1.y;
}
if !is_down {
Expand Down
7 changes: 3 additions & 4 deletions src/cpu_shader/path_tiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ fn path_tiling_main(
if !is_down {
(xy0, xy1) = (xy1, xy0);
}
// TODO: figure out what to if both xy0 and xy1 are at left edge
// Also TODO (part of move to 8 byte encoding for segments): don't store y_edge at all,
// TODO (part of move to 8 byte encoding for segments): don't store y_edge at all,
// resolve this in fine.
let y_edge = if xy0.x == tile_xy.x {
let y_edge = if xy0.x == tile_xy.x && xy1.x != tile_xy.x && xy0.y != tile_xy.y {
xy0.y
} else if xy1.x == tile_xy.x {
} else if xy1.x == tile_xy.x && xy1.y != tile_xy.y {
xy1.y
} else {
1e9
Expand Down

0 comments on commit c9faf2d

Please sign in to comment.