v3dv: precompute more tiling info at framebuffer creation time

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga 2019-12-17 08:51:33 +01:00 committed by Marge Bot
parent 3b8aeb7f50
commit 98697e1fb5
2 changed files with 24 additions and 0 deletions

View file

@ -1336,6 +1336,26 @@ compute_tile_size_for_framebuffer(struct v3dv_framebuffer *framebuffer)
DIV_ROUND_UP(framebuffer->width, framebuffer->tile_width);
framebuffer->draw_tiles_y =
DIV_ROUND_UP(framebuffer->height, framebuffer->tile_height);
/* Size up our supertiles until we get under the limit */
const uint32_t max_supertiles = 256;
framebuffer->supertile_width = 1;
framebuffer->supertile_height = 1;
for (;;) {
framebuffer->frame_width_in_supertiles =
DIV_ROUND_UP(framebuffer->draw_tiles_x, framebuffer->supertile_width);
framebuffer->frame_height_in_supertiles =
DIV_ROUND_UP(framebuffer->draw_tiles_y, framebuffer->supertile_height);
const uint32_t num_supertiles = framebuffer->frame_width_in_supertiles *
framebuffer->frame_height_in_supertiles;
if (num_supertiles < max_supertiles)
break;
if (framebuffer->supertile_width < framebuffer->supertile_height)
framebuffer->supertile_width++;
else
framebuffer->supertile_height++;
}
}
VkResult

View file

@ -338,6 +338,10 @@ struct v3dv_framebuffer {
uint32_t tile_height;
uint32_t draw_tiles_x;
uint32_t draw_tiles_y;
uint32_t supertile_width;
uint32_t supertile_height;
uint32_t frame_width_in_supertiles;
uint32_t frame_height_in_supertiles;
uint32_t attachment_count;
struct v3dv_image_view *attachments[0];