The owner asked for a nightly toolchain, -Zthreads, kache 2.0 with its incremental cache, and Rust's incremental compilation on. - rust-toolchain.toml pins nightly-2026-11-03 (rustc 1.101.0-nightly 1c3a65069), dated so every machine runs one rustc, clippy and rustfmt. The published crates keep rust-version 1.98, which this build no longer checks by itself (clippy's incompatible_msrv still flags newer std items). - .cargo/config.toml passes -Zthreads=0 (a thread per core) through Cargo's profile rustflags, which add to RUSTFLAGS instead of being replaced by it, so `--cfg m2v_gpu` lanes and CI's -Dwarnings keep it. - scripts/rustc-wrapper hands each compile to kache where kache is on PATH outside CI, and to rustc otherwise; `RUSTC_WRAPPER=` (empty) builds without it. - CARGO_INCREMENTAL=0 is gone from scripts/device-lane, AGENTS.md and CONTRIBUTING.md. - CI installs the toolchain the file names; both Dockerfiles take the same nightly. What the nightly asked of the code: - Its standard library containers take more trait-solver levels (Box -> BoxRaw, RawVec -> PhantomData), so proving a RenderCommandEncoder `Send` from a program's crate ran past the default recursion limit (tests/consumer_auto_traits.rs failed, a future-incompat lint that will become an error). The encoder now holds its own lowering in `OwnLowering`, whose `Send` impl is written out over a compile-time proof that `RenderLowering` is `Send`, as `LoweringSlot` already was. The runtime crate's own proofs need recursion_limit 256. - New clippy lints: needless_range_loop, single_element_loop, new_instead_of_clear (a false positive on a moved-from Vec: the part's segments are now taken explicitly), needless_borrows_for_generic_args, redundant_closure, unnecessary_lazy_evaluations, manual_range_patterns; AtomicU64::fetch_update is deprecated for try_update (present in 1.98). - Cargo warns that `homepage` equals `repository`: homepage removed from the manifests. - nightly rustfmt formats ir_id! invocations one argument per line. Verified on the M3 Max: `cargo clippy --workspace --all-targets --all-features -- -D warnings` clean on the nightly; `cargo build -v` shows -Zthreads on every rustc invocation and scripts/rustc-wrapper in front of each.
103 lines
3.8 KiB
TOML
103 lines
3.8 KiB
TOML
[package]
|
|
name = "metal2vulkan-runtime"
|
|
version = "0.2.0"
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
description = "The Metal API on Vulkan: Metal's objects and calls run on a Vulkan device through ash"
|
|
readme = "README.md"
|
|
repository.workspace = true
|
|
documentation = "https://docs.rs/metal2vulkan-runtime"
|
|
keywords = ["metal", "vulkan", "gpu", "graphics"]
|
|
categories = ["graphics", "api-bindings"]
|
|
# No crate root can appear unannounced, so validation's product fingerprint follows exactly the
|
|
# runtime's module tree (build_support.rs). Each example is listed below.
|
|
autobins = false
|
|
autoexamples = false
|
|
# The runtime's tests read the repository's profiles, fixtures and guide beside this directory.
|
|
exclude = ["/target/", "**/*.air", "**/*.metallib", "**/*.spv"]
|
|
|
|
[lib]
|
|
name = "metal2vulkan_runtime"
|
|
path = "src/lib.rs"
|
|
|
|
# Runnable examples for consumers (README.md, "Examples"): each runs the owned fixture
|
|
# validation/fixtures/public/examples/runtime_examples.metal on the system default device, from the
|
|
# workspace checkout (its committed LLVM text, assembled by `llvm-as`), or a metallib passed as the
|
|
# first argument.
|
|
[[example]]
|
|
name = "compute_dispatch"
|
|
path = "examples/compute_dispatch.rs"
|
|
|
|
[[example]]
|
|
name = "render_to_texture"
|
|
path = "examples/render_to_texture.rs"
|
|
|
|
[[example]]
|
|
name = "indirect_command_buffer"
|
|
path = "examples/indirect_command_buffer.rs"
|
|
|
|
[[example]]
|
|
name = "heap_placement"
|
|
path = "examples/heap_placement.rs"
|
|
|
|
[[example]]
|
|
name = "adopted_buffer"
|
|
path = "examples/adopted_buffer.rs"
|
|
|
|
# Not a consumer's example: the host A/B benchmark, the same Metal workloads natively on Metal
|
|
# and through the runtime, with a table of the two (examples/host_ab/main.rs).
|
|
[[example]]
|
|
name = "host_ab"
|
|
path = "examples/host_ab/main.rs"
|
|
|
|
# Not a consumer's example: a command buffer's fixed cost on the submit and completion path, from
|
|
# commit to its handler, and the CPU of the runtime's threads per command buffer
|
|
# (examples/submit_path.rs).
|
|
[[example]]
|
|
name = "submit_path"
|
|
path = "examples/submit_path.rs"
|
|
|
|
# Not a consumer's example: the CPU cost of an indirect command buffer's command setters, a
|
|
# render and a compute command encoded field by field (examples/icb_setters.rs).
|
|
[[example]]
|
|
name = "icb_setters"
|
|
path = "examples/icb_setters.rs"
|
|
|
|
# Not a consumer's example: command queues sharing `VkQueue`s, each workload under the policy its
|
|
# arguments name (examples/queue_share.rs).
|
|
[[example]]
|
|
name = "queue_share"
|
|
path = "examples/queue_share.rs"
|
|
|
|
[dependencies]
|
|
# The translator, through its public API only: the compiler checks that the runtime
|
|
# reaches nothing else. `ash` gives `ash_interop`'s conversions and `DeviceDescription::query`.
|
|
metal2vulkan = { version = "0.2.0", path = "../metal2vulkan", features = ["ash"] }
|
|
# `ash/loaded` opens the Vulkan loader with `dlopen` when a device is created; nothing is linked at
|
|
# build time.
|
|
ash = { workspace = true, features = ["std", "loaded"] }
|
|
# No-copy buffers take the host's page size on unix; elsewhere they are
|
|
# refused typed. It also registers the exit guard's exit handler on unix.
|
|
libc.workspace = true
|
|
# The shader cache's entry names and the binary archive's keys.
|
|
sha2.workspace = true
|
|
|
|
[dev-dependencies]
|
|
serde_json.workspace = true
|
|
# `llvm-as` for the device tests' owned fixture (`tests/pipeline_wait_order.rs`).
|
|
metal2vulkan-devtools = { path = "../metal2vulkan-devtools" }
|
|
|
|
# The host A/B benchmark's native side (examples/host_ab): Metal itself, on macOS.
|
|
[target.'cfg(target_os = "macos")'.dev-dependencies]
|
|
block2 = "0.6"
|
|
objc2 = "0.6"
|
|
objc2-foundation = "0.3"
|
|
objc2-metal = "0.3"
|
|
|
|
# The device tests compile only under the validation crate's GPU safety cfgs (`tests/mod.rs`).
|
|
[lints.rust]
|
|
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(m2v_gpu)", "cfg(m2v_cpu_icd)", "cfg(m2v_no_recycle)"] }
|
|
|