diff options
author | Jonathan Marek <[email protected]> | 2019-12-17 17:22:46 -0500 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2020-03-05 12:48:12 -0500 |
commit | 036230341f4f2e7b11791708015342cf9385cf76 (patch) | |
tree | 52a9203a7bb470ebb065dd406ff697326ccc79cc /src/freedreno | |
parent | 9f9432d56c055b9704a76cad44da88d5e12f825c (diff) |
turnip: improve binning pipe layout config
The old code looks the same as GL driver, but we get things like
pipe_count = {32, 1}, which seems bad.
This uses similar logic as for tiles which produces a balanced pipe_count
width/height.
Signed-off-by: Jonathan Marek <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3142>
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/vulkan/tu_cmd_buffer.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 27295cfdb25..b9408f87a4b 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -254,21 +254,16 @@ tu_tiling_config_update_pipe_layout(struct tu_tiling_config *tiling, }; tiling->pipe_count = tiling->tile_count; - /* do not exceed max pipe count vertically */ - while (tiling->pipe_count.height > max_pipe_count) { - tiling->pipe0.height += 2; - tiling->pipe_count.height = - (tiling->tile_count.height + tiling->pipe0.height - 1) / - tiling->pipe0.height; - } - - /* do not exceed max pipe count */ - while (tiling->pipe_count.width * tiling->pipe_count.height > - max_pipe_count) { - tiling->pipe0.width += 1; - tiling->pipe_count.width = - (tiling->tile_count.width + tiling->pipe0.width - 1) / - tiling->pipe0.width; + while (tiling->pipe_count.width * tiling->pipe_count.height > max_pipe_count) { + if (tiling->pipe0.width < tiling->pipe0.height) { + tiling->pipe0.width += 1; + tiling->pipe_count.width = + DIV_ROUND_UP(tiling->tile_count.width, tiling->pipe0.width); + } else { + tiling->pipe0.height += 1; + tiling->pipe_count.height = + DIV_ROUND_UP(tiling->tile_count.height, tiling->pipe0.height); + } } } |