tu: Make sure tiles being merged are adjacent
Even though we always try to merge a horizontally or vertically adjacent
tile, when we try to merge a vertically adjacent tile it may not
actually be adjacent because it was merged horizontally and the current
tile wasn't or vice versa. We have to detect this and reject merging it.
Fixes: 3fdaad0948 ("tu: Implement bin merging for fragment density map")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33534>
This commit is contained in:
@@ -2401,6 +2401,19 @@ try_merge_tiles(struct tu_tile_config *dst, const struct tu_tile_config *src,
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The tiles must be vertically or horizontally adjacent and have the
|
||||
* compatible width/height.
|
||||
*/
|
||||
if (dst->pos.x == src->pos.x) {
|
||||
if (dst->extent.height != src->extent.height)
|
||||
return false;
|
||||
} else if (dst->pos.y == src->pos.y) {
|
||||
if (dst->extent.width != src->extent.width)
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!has_abs_bin_mask) {
|
||||
/* The mask of the combined tile has to fit in 16 bits */
|
||||
uint32_t hw_mask = slot_mask >> (ffs(slot_mask) - 1);
|
||||
|
||||
Reference in New Issue
Block a user