mesa/src/compiler/rust/lib.rs
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

14 lines
272 B
Rust

// Copyright © 2024 Igalia S.L.
// SPDX-License-Identifier: MIT
pub mod as_slice;
pub mod bindings;
pub mod bitset;
pub mod cfg;
pub mod dataflow;
pub mod depth_first_search;
pub mod memstream;
pub mod nir;
pub mod nir_instr_printer;
pub mod smallvec;
pub mod vec_pair;