This gives us the possibility of describing other GOB formats in the
future. This also cleans things up a bit as it replaces all of the uses
of GOB_WIDTH/DEPTH with an extent which we can change in the future.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31410>
What we actually want here is the size of the 1/2/3D part of the level,
not the array part. This means a little more code duplication but the
result is also way more clear. This shouldn't be a functional change as
Extent4D<units::Bytes>::size_B() doesn't take array_len into account.
This means we no longer call Image::level_size_B() for layout. Instead,
Image::level_size_B() should mirror this code.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31191>
This bumps the req for everything, but I think that's fine, because one
part restricting to a lower rust version doesn't make much sense as we are
also not doing it generally for C or C++.
This also makes it easier for packagers to know what requires rust.
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30414>
This isn't an exact translation. It's identical to the previous values
for all uncompressed items but I fixed some of the compressed ones
(which we don't currently use) based on the enum names.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24596>
We add a units generic parameter to Extent4D and Offset4D and then make
every helper take and return the right type. The mul and div_* helpers
only half-enforce types but it's better than nothing. We leave them
non-public so no one outside extent.rs uses them.
Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
This just shuffles around the meson to make it so that the Rust library
is the final build target, not a C library. We're still building
fundamentally the same amount of stuff because nil_format_table.c is
still C (C is really good at tables that go in the .data section) and we
still need a wrapper rlib for bindgen. Howver, the Rust library is now
the main thing. When the time comes to start using NIL from other Rust
code, this will mean that we can just build an rlib and it will have
everything.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
Initially I left it in place because I didn't want to disturb the table
beyond what was in nv50_formats.c. However, we've moved past that now
and these formats are permanently broken so it's easiest to just remove
them from the table rather than have them in the table and then have C
code which disables them.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28453>
This is much more readable than the macro mess we had before. Most
notably because we no longer have this mess of #defines for format
support flags and instead have a character per flag and every every
supported flag is there every time. This makes it way easier to figure
out what we're actually claiming a format can do.
This conversion was tested with a patch that did a memcmp() of this
table against the old one to ensure that the two tables are bit-for-bit
identical. Later commits may modify the table in various ways but this
conversion to a CSV file is lossless.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28453>