diff --git a/src/asahi/layout/layout.c b/src/asahi/layout/layout.c index e13e10b7115..280466ed524 100644 --- a/src/asahi/layout/layout.c +++ b/src/asahi/layout/layout.c @@ -220,7 +220,8 @@ ail_initialize_compression(struct ail_layout *layout) height_px = DIV_ROUND_UP(height_px, 2); } - layout->size_B += compbuf_B * layout->depth_px; + layout->compression_layer_stride_B = compbuf_B; + layout->size_B += layout->compression_layer_stride_B * layout->depth_px; } void diff --git a/src/asahi/layout/layout.h b/src/asahi/layout/layout.h index 69eba327c64..d0d97a16fd1 100644 --- a/src/asahi/layout/layout.h +++ b/src/asahi/layout/layout.h @@ -125,6 +125,9 @@ struct ail_layout { /* Offset of the start of the compression metadata buffer */ uint32_t metadata_offset_B; + /* Stride between subsequent layers in the compression metadata buffer */ + uint32_t compression_layer_stride_B; + /* Size of entire texture */ uint32_t size_B; };