From f39679199b2d72b6d890ae515b9f3473c37b4d6b Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 13 Feb 2025 16:02:20 -0500 Subject: [PATCH] tu: Fix vertical tile merging check The intent here was to check if the tile we're trying to merge vertically (prev_y_tile) has already been merged horizontally into a neighboring tile, but I used the slot_mask which also contains the tiles that have been merged into the prev_y_tile, so the check was too conservative and would fail even if another tile had been merged into prev_y_tile. This meant that we would fail to ever create 2x2 regions of tiles. Fix this by just testing prev_y_tile's bit in the mask. Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.cc b/src/freedreno/vulkan/tu_cmd_buffer.cc index 9d8b7aa06db..48339337128 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.cc +++ b/src/freedreno/vulkan/tu_cmd_buffer.cc @@ -2490,8 +2490,13 @@ tu_render_pipe_fdm(struct tu_cmd_buffer *cmd, uint32_t pipe, } } if (y > 0) { - struct tu_tile_config *prev_y_tile = &tiles[width * (y - 1) + x]; - if (!(merged_tiles & prev_y_tile->slot_mask) && + unsigned prev_y_idx = width * (y - 1) + x; + struct tu_tile_config *prev_y_tile = &tiles[prev_y_idx]; + + /* We can't merge prev_y_tile into tile if it's already been + * merged horizontally into its neighbor in the previous row. + */ + if (!(merged_tiles & (1u << prev_y_idx)) && try_merge_tiles(tile, prev_y_tile, views, has_abs_mask)) { merged_tiles |= prev_y_tile->slot_mask; }