From 0a84d22bf2b81ff483b7728bf0e6c267d98c6b9c Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 16 Jun 2020 10:45:58 -0400 Subject: [PATCH] turnip: fix renderpass gmem configs when there are too many attachments Since a value of at least "align" is used for nblocks, we might end up with nblocks greater than the number of GMEM blocks remaining. Check for this case and bail out, sysmem rendering will be used for such cases. Fixes some of these tests: dEQP-VK.pipeline.render_to_image.core.*.huge.* Signed-off-by: Jonathan Marek Part-of: --- .gitlab-ci/deqp-freedreno-a630-fails.txt | 2 -- src/freedreno/vulkan/tu_pass.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/deqp-freedreno-a630-fails.txt b/.gitlab-ci/deqp-freedreno-a630-fails.txt index 41a38a88791..6243f34cf74 100644 --- a/.gitlab-ci/deqp-freedreno-a630-fails.txt +++ b/.gitlab-ci/deqp-freedreno-a630-fails.txt @@ -6,8 +6,6 @@ dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw dEQP-VK.compute.indirect_dispatch.upload_buffer.multiple_groups dEQP-VK.glsl.linkage.varying.struct.int dEQP-VK.image.texel_view_compatible.graphic.extended.2d_image.texture_read.astc_10x6_unorm_block.r32g32b32a32_uint -dEQP-VK.pipeline.render_to_image.core.2d_array.huge.height_layers.r8g8b8a8_unorm_d24_unorm_s8_uint -dEQP-VK.pipeline.render_to_image.core.cube_array.huge.width_height_layers.r8g8b8a8_unorm_d24_unorm_s8_uint dEQP-VK.renderpass2.dedicated_allocation.formats.d24_unorm_s8_uint.input.dont_care.store.self_dep_clear_draw dEQP-VK.renderpass2.suballocation.formats.d24_unorm_s8_uint.input.dont_care.store.self_dep_clear_draw_stencil_read_only dEQP-VK.renderpass.dedicated_allocation.formats.d24_unorm_s8_uint.input.dont_care.dont_care.draw diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index c3ca8eb939f..beb2cf0c59e 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -339,6 +339,11 @@ create_render_pass_common(struct tu_render_pass *pass, uint32_t align = MAX2(1, att->cpp >> block_align_shift); uint32_t nblocks = MAX2((gmem_blocks * att->cpp / cpp_total) & ~(align - 1), align); + if (nblocks > gmem_blocks) { + pixels = 0; + break; + } + gmem_blocks -= nblocks; cpp_total -= att->cpp; offset += nblocks * gmem_align; -- 2.30.2