turnip: consider tile_max_h when calculating tiling config

Otherwise we may get a tile height exceeding the maximum.

Fixes tests:
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_s8_uint

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9159>
This commit is contained in:
Danylo Piliaiev 2021-02-19 16:41:33 +02:00 committed by Marge Bot
parent c763d238c6
commit 14a0004232
2 changed files with 9 additions and 2 deletions

View file

@ -66,7 +66,6 @@ dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_combined_image_sampl
dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_sampled_image,Crash
dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_sampler,Crash
dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_storage_image,Crash
dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_s8_uint,Crash
dEQP-VK.rasterization.line_continuity.line-strip,Fail
dEQP-VK.renderpass2.suballocation.attachment_allocation.input_output.7,Fail
dEQP-VK.spirv_assembly.instruction.compute.opquantize.infinities,Fail

View file

@ -85,7 +85,8 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
{
const uint32_t tile_align_w = pass->tile_align_w;
const uint32_t tile_align_h = dev->physical_device->info.tile_align_h;
const uint32_t max_tile_width = 1024;
const uint32_t max_tile_width = dev->physical_device->info.tile_max_w;
const uint32_t max_tile_height = dev->physical_device->info.tile_max_h;
/* start from 1 tile */
fb->tile_count = (VkExtent2D) {
@ -112,6 +113,13 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
util_align_npot(DIV_ROUND_UP(fb->width, fb->tile_count.width), tile_align_w);
}
/* do not exceed max tile height */
while (fb->tile0.height > max_tile_height) {
fb->tile_count.height++;
fb->tile0.height =
util_align_npot(DIV_ROUND_UP(fb->height, fb->tile_count.height), tile_align_h);
}
/* will force to sysmem, don't bother trying to have a valid tile config
* TODO: just skip all GMEM stuff when sysmem is forced?
*/