From: Alyssa Rosenzweig Date: Fri, 3 Feb 2023 23:54:48 +0000 (-0500) Subject: ail: Test 63x63 cube map X-Git-Tag: upstream/23.3.3~13666 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b2dc9222822371f377e9d63f4088307c0eaf413;p=platform%2Fupstream%2Fmesa.git ail: Test 63x63 cube map This has a subtle interaction with page-aligned layers. Written while debugging dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_nearest_repeat_clamp Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/asahi/layout/tests/test-layout.cpp b/src/asahi/layout/tests/test-layout.cpp index 9285cda..1cc7c43 100644 --- a/src/asahi/layout/tests/test-layout.cpp +++ b/src/asahi/layout/tests/test-layout.cpp @@ -42,6 +42,30 @@ TEST(Cubemap, Nonmipmapped) EXPECT_EQ(layout.size_B, ALIGN_POT(512 * 512 * 4 * 6, 0x4000)); } +TEST(Cubemap, RoundsToOnePage) +{ + struct ail_layout layout = { + .width_px = 63, + .height_px = 63, + .depth_px = 6, + .sample_count_sa = 1, + .levels = 6, + .tiling = AIL_TILING_TWIDDLED, + .format = PIPE_FORMAT_R32_FLOAT, + }; + + ail_make_miptree(&layout); + + EXPECT_EQ(layout.level_offsets_B[0], 0); + EXPECT_EQ(layout.level_offsets_B[1], 0x4000); + EXPECT_EQ(layout.level_offsets_B[2], 0x5000); + EXPECT_EQ(layout.level_offsets_B[3], 0x5400); + EXPECT_EQ(layout.level_offsets_B[4], 0x5500); + EXPECT_TRUE(layout.page_aligned_layers); + EXPECT_EQ(layout.layer_stride_B, 0x8000); + EXPECT_EQ(layout.size_B, 0x30000); +} + TEST(Linear, SmokeTestBuffer) { struct ail_layout layout = {