mesa/src/asahi/layout
Alyssa Rosenzweig 54ebddaa0f ail: Force page-alignment for layered attachments
When rendering to a layered depth/stencil attachment, we specify the layer
stride in pages. That means that depth/stencil targets must be page-aligned to
be rendered to correctly.

If we're merely sampling, not rendering, we do not need the extra alignment. So
we add a flag to handle this case so we keep passing the generated ail tests.

Fixes KHR-GLES31.core.texture_cube_map_array.color_depth_attachments

Similarly, we page-align colour attachments. I don't have a good theoretical
justification for this part, but it seems to be necessary and layered rendering
fails otherwise. Possibly the PBE requires page-aligned layers unconditionally?

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
..
tests ail: Add MSAA tests 2023-05-11 23:24:48 +00:00
layout.c ail: Force page-alignment for layered attachments 2023-09-05 18:50:34 +00:00
layout.h ail: Force page-alignment for layered attachments 2023-09-05 18:50:34 +00:00
meson.build asahi: decouple layout from gallium 2023-08-03 19:38:56 +00:00
README ail: Handle multisampling 2022-11-19 20:25:41 +00:00
tiling.c asahi: Convert to SPDX headers 2023-03-28 05:14:00 +00:00

# ail

ail is a small library for working with the image (and buffer) layouts
encountered with AGX hardware. Its design is inspired by isl. In
particular, ail strives to use isl unit suffixes and to represent
quantities in a canonical, API-agnostic fashion.

ail conventions differ slightly from isl. See the isl documentation in
mesa/docs/isl for the conventions that inspired ail, in particular
mesa/docs/isl/units.rst.

In ail, we have the following units:

**Bytes (B)**: 8-bits.

**Samples (sa)**: An individual sample. The number of bytes per sample depends
on the format.

**Pixels (px)**: The unit everything starts as from the API. A pixel contains a
fixed number of samples, given as the layout's `sample_count_sa`. For twiddled
layouts, these samples are stored together in emmory.

**Elements (el)**: For a block-compressed format, a single compression block
containing multiple pixels. Otherwise, equal to a single pixel.

**Tiles (tiles)**: Defined only for tiled/twiddled layouts. A group of elements
forming the layout-specific tile.

We do not support any multisampled block-compressed layouts, so either pixels
equals either samples or elements.