mesa/src/compiler/rust
Christian Gmeiner e201d4fa77
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
compiler/rust: Move VecPair from NAK to shared compiler crate
Move the VecPair<A, B> data structure from NAK's ir.rs to the shared
compiler Rust crate so it can be reused by other backends.

The fields are private, and NAK's ir.rs (now in a different crate)
needs to read and mutate the inner Vecs. Add a_as_slice(..),
a_as_mut_slice(..), b_as_slice(..) and b_as_mut_slice(..), and update
NAK's SrcsAsSlice and DstsAsSlice impls to call them. Returning slices
keeps callers from changing the length of one side without the other,
which is what VecPair is built to prevent.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41435>
2026-05-13 22:32:44 +00:00
..
proc nak,compiler: Move FromVariants to common code 2026-05-08 00:29:09 +00:00
.clang-format nak: memstream: move into common code 2024-10-17 02:50:21 +00:00
.rustfmt.toml
as_slice.rs nak,compiler: Move AttrList into NAK 2026-05-08 00:29:08 +00:00
bindings.h nak: memstream: move into common code 2024-10-17 02:50:21 +00:00
bindings.rs compiler/rust: Copy the Rust NIR wrappers from NAK 2024-08-07 21:08:18 +00:00
bitset.rs compiler/rust: allow CFG & BitSetStreamTrait to have a len() without also having an is_empty() 2025-12-20 00:13:19 +01:00
cfg.rs compiler/rust: drop "borrow of a value the compiler would automatically borrow" 2025-12-20 00:13:19 +01:00
dataflow.rs nak/dataflow: Fix typo in comments 2025-10-30 12:49:11 +00:00
depth_first_search.rs compiler/rust: Implement dfs() non-recursively 2025-10-14 22:47:40 +00:00
lib.rs compiler/rust: Move VecPair from NAK to shared compiler crate 2026-05-13 22:32:44 +00:00
memstream.rs nak,nir: Stop using std::mem::zeroed() 2025-06-06 18:58:35 +00:00
meson.build compiler/rust: Move VecPair from NAK to shared compiler crate 2026-05-13 22:32:44 +00:00
nir.rs nir: add nvidias shared memory non unform address shift 2026-02-11 03:41:23 +01:00
nir_instr_printer.rs compiler/rust: Copy NirInstrPrinter from NAK 2024-10-18 12:43:52 +00:00
rust_helpers.c compiler/rust: Add a unit test for the memstream abstraction 2024-10-17 18:59:02 +00:00
rust_helpers.h compiler/rust: Add a unit test for the memstream abstraction 2024-10-17 18:59:02 +00:00
smallvec.rs compiler/rust: Copy MappedInstrs from NAK 2024-10-01 11:33:35 +00:00
vec_pair.rs compiler/rust: Move VecPair from NAK to shared compiler crate 2026-05-13 22:32:44 +00:00