u_format: Rewrite format table to use YAML

u_format has always had its format table in CSV. This is kind of nice
for some things, but is a serious pain to extend, especially with
optional fields.

In going through our many (many, many) duplicated tables of format
mappings, it would've been nice to add some descriptions to our central
u_format table, such as mapping to DRM FourCC, to EGLImage mappings, and
to GL internalformats for EGLImage imports. Unfortunately, doing so with
more additional fields would just make the CSV totally unreadable.

Move the CSV table to a YAML-based table and adjust the Python parsers
to suit. The resulting generated files are identical before and after
the transition.

The new parser also has a significant amount of format validation to
make it easier to catch common errors.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29649>
This commit is contained in:
Daniel Stone
2024-06-06 12:36:00 +01:00
committed by Marge Bot
parent 12a33ecd0f
commit ccc6442d6f
11 changed files with 3000 additions and 706 deletions

View File

@@ -50,6 +50,7 @@ DEPS=(
py3-packaging
py3-pip
py3-ply
py3-yaml
vulkan-headers
spirv-tools-dev
util-macros

View File

@@ -74,6 +74,7 @@ DEPS=(
python3-pycparser
python3-requests
python3-setuptools
python3-yaml
qemu-user
valgrind
x11proto-dri2-dev

View File

@@ -78,6 +78,7 @@ DEPS=(
python3-mako
python3-ply
python3-pycparser
python3-yaml
rust-packaging
vulkan-headers
spirv-tools-devel

View File

@@ -13,10 +13,10 @@
variables:
DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base"
DEBIAN_BASE_TAG: "20240704-libdir"
DEBIAN_BASE_TAG: "20240717-pyyaml-3"
DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build"
DEBIAN_BUILD_TAG: "20240704-libdrm"
DEBIAN_BUILD_TAG: "20240717-pyyaml-3"
DEBIAN_X86_64_TEST_BASE_IMAGE: "debian/x86_64_test-base"
DEBIAN_ARM64_TEST_BASE_IMAGE: "debian/arm64_test-base"
@@ -32,18 +32,18 @@ variables:
DEBIAN_TEST_VK_TAG: "20240713-piglit-58"
KERNEL_ROOTFS_TAG: "20240713-piglit-58"
ALPINE_X86_64_BUILD_TAG: "20240620-sphinx"
ALPINE_X86_64_BUILD_TAG: "20240717-pyyaml"
ALPINE_X86_64_LAVA_SSH_TAG: "20240401-wlproto"
FEDORA_X86_64_BUILD_TAG: "20240704-libdrm"
FEDORA_X86_64_BUILD_TAG: "20240717-pyyaml"
KERNEL_TAG: "v6.6.21-mesa-f8ea"
KERNEL_REPO: "gfx-ci/linux"
PKG_REPO_REV: "bca9635d"
WINDOWS_X64_MSVC_PATH: "windows/x86_64_msvc"
WINDOWS_X64_MSVC_TAG: "20231222-msvc"
WINDOWS_X64_MSVC_TAG: "20240717-pyyaml-3"
WINDOWS_X64_BUILD_PATH: "windows/x86_64_build"
WINDOWS_X64_BUILD_TAG: "20240405-vainfo-ci-1"
WINDOWS_X64_BUILD_TAG: "20240717-pyyaml-3"
WINDOWS_X64_TEST_PATH: "windows/x86_64_test"
WINDOWS_X64_TEST_TAG: "20240405-vainfo-ci-1"
WINDOWS_X64_TEST_TAG: "20240717-pyyaml-3"

View File

@@ -68,7 +68,7 @@ Get-Date
python -m pip install --upgrade pip --progress-bar off
Write-Host "Installing python packages at:"
Get-Date
pip3 install packaging meson mako "numpy < 2.0" --progress-bar off
pip3 install packaging meson mako "numpy < 2.0" pyyaml --progress-bar off
if (!$?) {
Write-Host "Failed to install dependencies from pip"
Exit 1