LineArt: Correct clamping of out of bound isect index

Handles rare cases where line doesn't intersect the triangle correctly.
This commit is contained in:
YimingWu
2021-12-31 21:25:03 +08:00
parent d09b1d2759
commit 97ae08c9fc

View File

@@ -2585,8 +2585,12 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
}
else {
INTERSECT_JUST_GREATER(is, order, is[LCross], LCross);
INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
if (LCross >= 0) {
INTERSECT_JUST_GREATER(is, order, is[LCross], LCross);
if (LCross >= 0) {
INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
}
}
}
}
}