Skip to content

ail: Introduce image layout module

Alyssa Rosenzweig requested to merge asahi/mesa:asahi/image-layout into main

Introduce ail, 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 [1].

ail replaces the old miptree code (based on some ad hoc heuristics that passed a few dEQP tests). It is based on a thorough reverse-engineering of AGX's twiddled format, courtesy of Asahi Lina, Dougall Johnson, and me. This corrects our handling of many common cases that were totally wrong in the old code, leading to GPU faults.

Unlike the code, ail differentiates between pixels and elements consistently, allowing block-compressed formats like ETC2 to be supported correctly. These formats will be enabled later in the series.

This commit fixes Inochi2D, glmark2 -brefract and -bterrain, and who knows what else.

ail stands for { Asahi, AGX } Image { Layout, Library } at your convenience. ail is best served warm.

Liberal use of ail is recommended. Yum!

[1] https://docs.mesa3d.org/isl/units.html

Cc @asahilina. Your model renders upstream + this MR. (The "Lina renders Lina" demo used an early version of this branch.)

Added some docs on the image layouts supported here: https://mesa.pages.freedesktop.org/-/mesa/-/jobs/27093858/artifacts/public/drivers/asahi.html#image-layouts

Edited by Alyssa Rosenzweig

Merge request reports