From b28fe26d7c613e7adc7d27515c4945e1f4060b9e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 28 Nov 2022 19:21:21 -0500 Subject: [PATCH] ail: Save level_offsets_compressed_B So we can bind specific mip levels for rendering into compressed Z/S. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/layout/layout.c | 2 ++ src/asahi/layout/layout.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/asahi/layout/layout.c b/src/asahi/layout/layout.c index e88cdaa0c83..1801df87164 100644 --- a/src/asahi/layout/layout.c +++ b/src/asahi/layout/layout.c @@ -198,6 +198,8 @@ ail_initialize_compression(struct ail_layout *layout) if (width_px < 16 && height_px < 16) break; + layout->level_offsets_compressed_B[l] = compbuf_B; + /* The compression buffer seems to have 8 bytes per 16 x 16 pixel block. */ unsigned cmpw_el = DIV_ROUND_UP(util_next_power_of_two(width_px), 16); unsigned cmph_el = DIV_ROUND_UP(util_next_power_of_two(height_px), 16); diff --git a/src/asahi/layout/layout.h b/src/asahi/layout/layout.h index c35dbab1051..4f911d908ed 100644 --- a/src/asahi/layout/layout.h +++ b/src/asahi/layout/layout.h @@ -110,6 +110,11 @@ struct ail_layout { */ uint32_t level_offsets_B[AIL_MAX_MIP_LEVELS]; + /** + * For the compressed buffer, offsets of mip levels within a layer. + */ + uint32_t level_offsets_compressed_B[AIL_MAX_MIP_LEVELS]; + /** * If tiling is TWIDDLED, the tile size used for each mip level within a * layer. Calculating tile sizes is the sole responsibility of