From a8ec3135bbec858c60ab5b5a3dd305a62d351cf5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 28 Nov 2022 22:00:52 -0500 Subject: [PATCH] ail: Fix tile sizes Fixes dEQP-GLES3.functional.texture.filtering.2d.sizes.3x7_nearest_mipmap_linear. Tested for all sizes 1..256x1..256. Tested-by: Asahi Lina Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/layout/layout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asahi/layout/layout.c b/src/asahi/layout/layout.c index d57fd1accbe..3f782f8688f 100644 --- a/src/asahi/layout/layout.c +++ b/src/asahi/layout/layout.c @@ -156,7 +156,8 @@ ail_initialize_twiddled(struct ail_layout *layout) layout->level_offsets_B[l] = offset_B; offset_B = ALIGN_POT(offset_B + (blocksize_B * size_el), AIL_CACHELINE); - unsigned tilesize_el = MIN2(potw_el, poth_el); + /* The tilesize is based on the true mipmap level size, not the POT rounded size */ + unsigned tilesize_el = util_next_power_of_two(u_minify(MIN2(w_el, h_el), l)); layout->tilesize_el[l] = (struct ail_tile) { tilesize_el, tilesize_el }; potw_el = u_minify(potw_el, 1);