turnip: fix renderpass gmem configs when there are too many attachments
authorJonathan Marek <jonathan@marek.ca>
Tue, 16 Jun 2020 14:45:58 +0000 (10:45 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Jun 2020 03:15:27 +0000 (03:15 +0000)
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 <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5499>

.gitlab-ci/deqp-freedreno-a630-fails.txt
src/freedreno/vulkan/tu_pass.c

index 41a38a887912219ed88f3be3cd03a00f1681cc58..6243f34cf7414481dbc7efda33cfad6fac8dbdd3 100644 (file)
@@ -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
index c3ca8eb939f567a81fbd00771771842ca2f82c16..beb2cf0c59eefa2675bf0f1a6fcdc615af681b9b 100644 (file)
@@ -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;