diff --git a/src/freedreno/fdl/fd6_layout.c b/src/freedreno/fdl/fd6_layout.c index 31a8002e87d..906b6c970b5 100644 --- a/src/freedreno/fdl/fd6_layout.c +++ b/src/freedreno/fdl/fd6_layout.c @@ -267,10 +267,8 @@ fdl6_layout(struct fdl_layout *layout, const struct fd_dev_info *info, if (pitch != fdl_pitch(layout, level - 1) / 2) min_3d_layer_size = slice->size0 = nblocksy * pitch; - /* If the height is now less than the alignment requirement, then - * scale it up and let this be the minimum layer size. - */ - if (tile_mode && util_format_get_nblocksy(format, height) < heightalign) + /* If the height wouldn't be aligned, stay aligned instead */ + if (slice->size0 < nblocksy * pitch) min_3d_layer_size = slice->size0 = nblocksy * pitch; /* If the size would become un-page-aligned, stay aligned instead. */ diff --git a/src/freedreno/fdl/fd6_layout_test.c b/src/freedreno/fdl/fd6_layout_test.c index d45cec660e0..fe9cb6157aa 100644 --- a/src/freedreno/fdl/fd6_layout_test.c +++ b/src/freedreno/fdl/fd6_layout_test.c @@ -961,6 +961,40 @@ static const struct testcase }, }, }, + + /* dEQP-VK.image.texel_view_compatible.graphic.extended.3d_image.texture_read.astc_8x8_unorm_block.r32g32b32a32_uint + * + * This is an interesting case where the size is 4K-aligned but the + * height becomes not aligned, and we have to use MINLAYERSZ to + * intervene. + * + * This test can only use tiled layouts on a750+, and the blob seems + * to make this one texture linear rather than deal with the + * alignment problem. + */ + { + .format = PIPE_FORMAT_R32G32B32A32_FLOAT, + .is_3d = true, + .layout = + { + .tile_mode = TILE6_3, + .ubwc = false, + .width0 = 76, + .height0 = 76, + .depth0 = 1, + .slices = + { + {.offset = 0, .pitch = 2048, .size0 = 163840}, + {.offset = 163840, .pitch = 1024, .size0 = 49152}, + {.offset = 212992, .pitch = 1024, .size0 = 49152}, + {.offset = 262144, .pitch = 1024}, + {.offset = 311296, .pitch = 1024}, + {.offset = 360448, .pitch = 1024}, + {.offset = 409600, .pitch = 1024}, + }, + }, + }, + }; /* has_ubwc_linear_mipmap_fallback is supported started from A6XX gen4. */