pvr: Correct calculations in pvr_unwind_rects()

Fixes: 6d3d1f884c
       pvr: Fix rect splitting logic in pvr_unwind_rects()

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reported-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23430>
This commit is contained in:
Matt Coster 2023-06-01 16:15:32 +01:00 committed by Marge Bot
parent b5c31f14a2
commit dc3538cdb5

View file

@ -4857,8 +4857,11 @@ static void pvr_unwind_rects(uint32_t width,
rect->extent.width = split_point - rect->offset.x;
new_rect->offset.x = split_point;
new_rect->extent.width -=
(int32_t)split_point - (int32_t)rect->offset.x;
split_width = (rect->offset.x + new_rect->extent.width) - split_point;
split_width =
(new_rect->offset.x + new_rect->extent.width) - split_point;
if (input) {
mappings[i].dst_rect.extent.width -= split_width;
@ -4879,7 +4882,6 @@ static void pvr_unwind_rects(uint32_t width,
new_rect->offset.x += (int32_t)texel_unwind - (int32_t)width;
new_rect->offset.y++;
new_rect->extent.width += (int32_t)texel_unwind - (int32_t)width;
new_mappings++;
}