mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
gallium/util: fix returning empty box for rectangle intersection
These functions deal with inclusive coordinates, hence a 0/0/0/0 rect returned when there's no intersection doesn't actually represent an empty rectangle. Hence return 0/-1/0/-1 instead. This fixes some problems in llvmpipe with empty scissor rects (which up to now didn't really matter because while the intersect test returned the wrong result all pixels were scissored away later anyway).
This commit is contained in:
parent
fec4f5de67
commit
1754208617
1 changed files with 6 additions and 1 deletions
|
|
@ -87,7 +87,12 @@ u_rect_possible_intersection(const struct u_rect *a,
|
|||
u_rect_find_intersection(a,b);
|
||||
}
|
||||
else {
|
||||
b->x0 = b->x1 = b->y0 = b->y1 = 0;
|
||||
/*
|
||||
* Note the u_rect_xx tests deal with inclusive coordinates
|
||||
* hence all-zero would not be an empty box.
|
||||
*/
|
||||
b->x0 = b->y0 = 0;
|
||||
b->x1 = b->y1 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue